diff --git a/src/views/common/filterSearch.vue b/src/views/common/filterSearch.vue index 751605e..be19d00 100644 --- a/src/views/common/filterSearch.vue +++ b/src/views/common/filterSearch.vue @@ -104,16 +104,24 @@ export default { this.$message.error(error) }) }else { + this.showSetting = true; } }, - selectRow(selection,row){ - if (row.visible === 'Y'){ - row.visible = 'N' - }else { - row.visible = 'Y' - } + handleSelectionChange(selection) { + this.tableList.forEach(row => { + // 使用 Object.is 判断是否为同一个对象(即同一引用) + const isSelected = selection.some(selectedRow => Object.is(selectedRow, row)); + row.visible = isSelected ? 'Y' : 'N'; + }); }, + // selectRow(selection,row){ + // // if (row.visible === 'Y'){ + // // row.visible = 'N' + // // }else { + // // row.visible = 'Y' + // // } + // }, clearTableList(){ if (this.showSetting){ this.tableList = this.tableList.map(row=>{ @@ -333,13 +341,13 @@ export default { this.showSettingTableList = [] } }, - tableList(newVal,oldVal){ - this.$nextTick(()=>{ - this.tableList.forEach(row=>{ - this.$refs.settingTable.toggleRowSelection(row,row.visible === 'Y') - }) - }) - } + // tableList(newVal,oldVal){ + // this.$nextTick(()=>{ + // this.tableList.forEach(row=>{ + // this.$refs.settingTable.toggleRowSelection(row,row.visible === 'Y') + // }) + // }) + // } }, created() { @@ -373,10 +381,11 @@ export default {
- + + label="是否可见"