From d6182e6521e66fef8daa0610265123e0a4d11557 Mon Sep 17 00:00:00 2001 From: Aoi_Tori <2547614904@qq.com> Date: Sun, 29 Jun 2025 09:08:05 +0800 Subject: [PATCH] 2025/6/29 --- src/views/common/filterSearch.vue | 37 +++++++++++++++++++------------ 1 file changed, 23 insertions(+), 14 deletions(-) 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="是否可见"