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

@@ -12,7 +12,11 @@ import { Modal, Space } from 'ant-design-vue';
import dayjs from 'dayjs';
import { isEmpty } from 'lodash-es';
import { useVbenVxeGrid, type VxeGridProps } from '#/adapter/vxe-table';
import {
tableCheckboxEvent,
useVbenVxeGrid,
type VxeGridProps,
} from '#/adapter/vxe-table';
import {
operLogClean,
operLogDelete,
@@ -98,12 +102,8 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
sortChange: () => {
tableApi.query();
},
checkboxChange: (e: any) => {
checked.value = e.records.length > 0;
},
checkboxAll: (e: any) => {
checked.value = e.records.length > 0;
},
checkboxChange: tableCheckboxEvent(checked),
checkboxAll: tableCheckboxEvent(checked),
},
});