From 568edcae24156ea948a945848ef87bdeda8a2717 Mon Sep 17 00:00:00 2001 From: wangyufei <2267742828@qq.com> Date: Sun, 11 Aug 2024 17:26:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8B=BE=E9=80=89=E5=A4=8D=E9=80=89=E6=A1=86--?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=85=B3=E8=81=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SearchTable/src/SearchTable.vue | 1 + src/components/Table/src/Table.vue | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/components/SearchTable/src/SearchTable.vue b/src/components/SearchTable/src/SearchTable.vue index 37cf6b4b6..2dd84a162 100644 --- a/src/components/SearchTable/src/SearchTable.vue +++ b/src/components/SearchTable/src/SearchTable.vue @@ -18,6 +18,7 @@ ([]) const sortRef = ref() // 选中某行 - const selectRow = ()=>{ - console.log(currentPageRef.value,elTableRef.value?.getSelectionRows()) + const selectRow = (selection,row)=>{ + console.log('selectRow',row) + const selected = elTableRef.value?.getSelectionRows().some((item) => item.id === row.id) + if(props.isCheckStrictly&&selected&&row.children){//取消关联 + row.children.forEach(item => { + elTableRef.value?.toggleRowSelection(item, false); + }); + } emit('getSelectionRows', currentPageRef.value,elTableRef.value?.getSelectionRows()) } //全选回调