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

@@ -20,7 +20,11 @@ import {
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 { configInfoByKey } from '#/api/system/config';
import { ossDownload, ossList, ossRemove } from '#/api/system/oss';
import { downloadByData } from '#/utils/file/download';
@@ -100,12 +104,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),
},
});