From 082b572b91abd0d5ae8e409714553130448aa6d1 Mon Sep 17 00:00:00 2001 From: 张涛 <“2538313560@qq.com”> Date: 星期五, 30 八月 2024 17:25:44 +0800 Subject: [PATCH] fix:薪资调整 --- src/views/systemSetting/silkStandardSetting/components/silkTableList.vue | 67 ++++++++++++++++++++++++++++----- 1 files changed, 56 insertions(+), 11 deletions(-) diff --git a/src/views/systemSetting/silkStandardSetting/components/silkTableList.vue b/src/views/systemSetting/silkStandardSetting/components/silkTableList.vue index d900a09..34d5eb1 100644 --- a/src/views/systemSetting/silkStandardSetting/components/silkTableList.vue +++ b/src/views/systemSetting/silkStandardSetting/components/silkTableList.vue @@ -3,8 +3,10 @@ <div class="top-box"> <div class="table-box" :style="{ width: detailEnter ? '95%' : '100%' }"> <el-form ref="form" :model="tableList" :show-message="false" label-position="right"> + <el-table ref="fromTable" + v-if="tableShow" :data="tableList.tableData" style="width: 100%" @selection-change="handleSelectionChange" @@ -45,11 +47,11 @@ } " ></el-input> - <div class="common-select-btn" @click="clearupColumn(item.prop)"> + <div class="common-select-btn" @click="clearupColumn(item.prop,i)"> <i class="el-icon-remove" title="鍒犻櫎"></i> </div> </div> - <span v-else>{{ item.label }}</span> + <span v-else @click="editColumnInput(item,i, item.prop)">{{ item.label||'--' }}</span> </template> <!-- column鏍峰紡 --> <template slot-scope="scope"> @@ -192,8 +194,8 @@ </div> </div> <div v-if="detailEnter" style="margin: 10px"> - <div class="add-btn-box" @click="addRowClick"> - <i class="el-icon-circle-plus"></i> + <div class="add-btn-box"> + <i class="el-icon-circle-plus" @click="addRowClick"></i> </div> <!-- <el-button size="small" type="primary" :disabled="!isOperate" @click="add">鏂板</el-button> --> <!-- <el-button size="small" type="primary" disabled>瀵煎叆鏄庣粏</el-button> --> @@ -236,6 +238,11 @@ type: Boolean, default: true }, + // 鏄惁鍙互缂栬緫琛ㄥご + isEdit: { + type: Boolean, + default: false + }, silkTableList: { type: Object, default: () => { @@ -256,7 +263,8 @@ productList: [], tableList: [], projectIndex: 0, - projectOptions: getDataByType("projectOptions") + projectOptions: getDataByType("projectOptions"), + tableShow:true, } }, created() { @@ -271,7 +279,18 @@ this.getTableInfo() }, immediate: true - } + }, + 'silkTableList.tableColumn': { + handler() { + this.tableShow=false; + this.$nextTick(()=>{ + this.tableShow=true; + this.$forceUpdate() + }) + + }, + immediate: true + }, }, computed: {}, methods: { @@ -319,16 +338,26 @@ console.log(val, prop, "娣诲姞鍒楀ご閮ㄦ爣棰樿緭鍏�") this.$emit("addColumnInputChange", val, prop) }, + editColumnInput(item,i,prop){ + if(prop.indexOf('prop')!=-1&&this.isEdit){ + item.addColumn=true; + this.$set(this.tableList.tableColumn[i],'addColumn',true) + this.$forceUpdate() + this.$emit("editColumnInput", item, i,prop) + } + }, // 鍒犻櫎鍒� - clearupColumn(prop) { + clearupColumn(prop,index) { console.log(prop) - this.$emit("clearupColumn", prop) + this.$emit("clearupColumn", prop,index) } }, //瑙e喅琛ㄦ牸鎶栧姩闂 beforeUpdate() { this.$nextTick(() => { - this.$refs["fromTable"].doLayout() + if(this.$refs["fromTable"]){ + this.$refs["fromTable"].doLayout() + } }) } } @@ -367,7 +396,10 @@ font-size: 26px; color: #5582f3; margin-left: 50px; - cursor: pointer; + .el-icon{ + cursor: pointer; + padding:5px; + } } .add-column-box { display: flex; @@ -395,9 +427,22 @@ .el-table th.el-table__cell > .cell { padding: 0 5px; } + .el-table th.el-table__cell > .cell { + span{ + width:100%; + display:inline-block; + } + } + .el-table__cell{ + padding: 5px 0 !important; + height: 35px; + } + .el-input__suffix{ + text-align:right; + } .el-input__inner { // text-align: left; - text-align: center !important; + // text-align: center !important; } } </style> -- Gitblit v1.8.0