From c942d88e04a2ab92572e564f2cd74e763314bc3d Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期四, 18 四月 2024 18:25:40 +0800 Subject: [PATCH] 生丝标准设置模块 连续添加2个表头错误的问题修改,修改添加表头的逻辑 --- src/views/systemSetting/silkStandardSetting/components/silkTableList.vue | 37 ++++++++++++++++++++++++++----------- 1 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/views/systemSetting/silkStandardSetting/components/silkTableList.vue b/src/views/systemSetting/silkStandardSetting/components/silkTableList.vue index c25faab..bc3226f 100644 --- a/src/views/systemSetting/silkStandardSetting/components/silkTableList.vue +++ b/src/views/systemSetting/silkStandardSetting/components/silkTableList.vue @@ -6,6 +6,7 @@ <el-table ref="fromTable" + v-if="tableShow" :data="tableList.tableData" style="width: 100%" @selection-change="handleSelectionChange" @@ -46,7 +47,8 @@ } " ></el-input> - <div class="common-select-btn" @click="clearupColumn(item.prop)"> + {{item.prop}} + <div class="common-select-btn" @click="clearupColumn(item.prop,i)"> <i class="el-icon-remove" title="鍒犻櫎"></i> </div> </div> @@ -237,6 +239,11 @@ type: Boolean, default: true }, + // 鏄惁鍙互缂栬緫琛ㄥご + isEdit: { + type: Boolean, + default: false + }, silkTableList: { type: Object, default: () => { @@ -257,7 +264,8 @@ productList: [], tableList: [], projectIndex: 0, - projectOptions: getDataByType("projectOptions") + projectOptions: getDataByType("projectOptions"), + tableShow:true, } }, created() { @@ -272,7 +280,18 @@ this.getTableInfo() }, immediate: true - } + }, + 'silkTableList.tableColumn': { + handler() { + this.tableShow=false; + this.$nextTick(()=>{ + this.tableShow=true; + this.$forceUpdate() + }) + + }, + immediate: true + }, }, computed: {}, methods: { @@ -321,21 +340,17 @@ this.$emit("addColumnInputChange", val, prop) }, editColumnInput(item,i,prop){ - console.log(item,'===item') - console.log(i,'===i') - console.log(prop,'===prop') - if(prop.indexOf('prop')!=-1){ + 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喅琛ㄦ牸鎶栧姩闂 @@ -426,7 +441,7 @@ } .el-input__inner { // text-align: left; - text-align: center !important; + // text-align: center !important; } } </style> -- Gitblit v1.8.0