refactor: 通用的表格复选框是否选中事件

This commit is contained in:
dap
2024-10-18 15:39:39 +08:00
parent c6984c164c
commit 6e7fade539
19 changed files with 130 additions and 127 deletions

View File

@@ -24,7 +24,11 @@ import {
} from 'ant-design-vue';
import dayjs from 'dayjs';
import { useVbenVxeGrid, type VxeGridProps } from '#/adapter/vxe-table';
import {
tableCheckboxEvent,
useVbenVxeGrid,
type VxeGridProps,
} from '#/adapter/vxe-table';
import {
userExport,
userList,
@@ -128,12 +132,8 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
gridEvents: {
checkboxChange: (e: any) => {
checked.value = e.records.length > 0;
},
checkboxAll: (e: any) => {
checked.value = e.records.length > 0;
},
checkboxChange: tableCheckboxEvent(checked),
checkboxAll: tableCheckboxEvent(checked),
},
});