chore: 点行会勾选/取消全部权限 点权限不会勾选行
This commit is contained in:
parent
d1ef1192b2
commit
5033ea2e82
@ -14,7 +14,11 @@ import { uniq } from 'lodash-es';
|
|||||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
|
|
||||||
import { columns, nodeOptions } from './data';
|
import { columns, nodeOptions } from './data';
|
||||||
import { menusWithPermissions, rowAndChildrenChecked } from './helper';
|
import {
|
||||||
|
menusWithPermissions,
|
||||||
|
rowAndChildrenChecked,
|
||||||
|
setPermissionsChecked,
|
||||||
|
} from './helper';
|
||||||
import { useFullScreenGuide } from './hook';
|
import { useFullScreenGuide } from './hook';
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
@ -112,17 +116,19 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
|||||||
gridEvents: {
|
gridEvents: {
|
||||||
// 勾选事件
|
// 勾选事件
|
||||||
checkboxChange: (params) => {
|
checkboxChange: (params) => {
|
||||||
// 节点独立 不做处理
|
|
||||||
if (!association.value) {
|
|
||||||
updateCheckedNumber();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 选中还是取消选中
|
// 选中还是取消选中
|
||||||
const checked = params.checked;
|
const checked = params.checked;
|
||||||
// 行
|
// 行
|
||||||
const record = params.row;
|
const record = params.row;
|
||||||
// 设置所有子节点选中状态
|
if (association.value) {
|
||||||
rowAndChildrenChecked(record, checked);
|
// 节点关联
|
||||||
|
// 设置所有子节点选中状态
|
||||||
|
rowAndChildrenChecked(record, checked);
|
||||||
|
} else {
|
||||||
|
// 节点独立
|
||||||
|
// 点行会勾选/取消全部权限 点权限不会勾选行
|
||||||
|
setPermissionsChecked(record, checked);
|
||||||
|
}
|
||||||
updateCheckedNumber();
|
updateCheckedNumber();
|
||||||
},
|
},
|
||||||
// 全选事件
|
// 全选事件
|
||||||
|
Loading…
Reference in New Issue
Block a user