From 5033ea2e826e6a8932baa92301765a9d4de618bf Mon Sep 17 00:00:00 2001 From: dap <15891557205@163.com> Date: Mon, 6 Jan 2025 14:27:00 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E7=82=B9=E8=A1=8C=E4=BC=9A=E5=8B=BE?= =?UTF-8?q?=E9=80=89/=E5=8F=96=E6=B6=88=E5=85=A8=E9=83=A8=E6=9D=83?= =?UTF-8?q?=E9=99=90=20=20=E7=82=B9=E6=9D=83=E9=99=90=E4=B8=8D=E4=BC=9A?= =?UTF-8?q?=E5=8B=BE=E9=80=89=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/tree/src/menu-select-table.vue | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/apps/web-antd/src/components/tree/src/menu-select-table.vue b/apps/web-antd/src/components/tree/src/menu-select-table.vue index e4d14a12..abf1ba2a 100644 --- a/apps/web-antd/src/components/tree/src/menu-select-table.vue +++ b/apps/web-antd/src/components/tree/src/menu-select-table.vue @@ -14,7 +14,11 @@ import { uniq } from 'lodash-es'; import { useVbenVxeGrid } from '#/adapter/vxe-table'; import { columns, nodeOptions } from './data'; -import { menusWithPermissions, rowAndChildrenChecked } from './helper'; +import { + menusWithPermissions, + rowAndChildrenChecked, + setPermissionsChecked, +} from './helper'; import { useFullScreenGuide } from './hook'; defineOptions({ @@ -112,17 +116,19 @@ const [BasicTable, tableApi] = useVbenVxeGrid({ gridEvents: { // 勾选事件 checkboxChange: (params) => { - // 节点独立 不做处理 - if (!association.value) { - updateCheckedNumber(); - return; - } // 选中还是取消选中 const checked = params.checked; // 行 const record = params.row; - // 设置所有子节点选中状态 - rowAndChildrenChecked(record, checked); + if (association.value) { + // 节点关联 + // 设置所有子节点选中状态 + rowAndChildrenChecked(record, checked); + } else { + // 节点独立 + // 点行会勾选/取消全部权限 点权限不会勾选行 + setPermissionsChecked(record, checked); + } updateCheckedNumber(); }, // 全选事件