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

@@ -9,7 +9,11 @@ import { getPopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } 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 {
configExport,
configList,
@@ -78,12 +82,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),
},
});
const [ConfigModal, modalApi] = useVbenModal({