@ -80,7 +80,7 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
gridOptions,
gridEvents: {
checkboxChange: (e) => {
const records = e.$grid.getCheckboxRecords();
const records = e.$grid?.getCheckboxRecords?.() ?? [];
canUnlock.value = records.length === 1 && records[0]!.status === '1';
},
@ -46,7 +46,7 @@ const formOptions: VbenFormProps = {
],
};
const gridOptions: VxeGridProps<OperationLog> = {
const gridOptions: VxeGridProps = {
checkboxConfig: {
// 高亮
highlight: true,
@ -46,7 +46,6 @@ const gridOptions: VxeGridProps = {
// 默认请求接口后展开全部 不需要可以删除这段
querySuccess: () => {
// 默认展开 需要加上标记
// eslint-disable-next-line no-use-before-define
eachTree(tableApi.grid.getData(), (item) => (item.expand = true));
nextTick(() => {
setExpandOrCollapse(true);
@ -32,7 +32,6 @@ const formOptions: VbenFormProps = {
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
handleReset: async () => {
selectDeptId.value = [];
const { formApi, reload } = tableApi;
await formApi.resetForm();
const formValues = formApi.form.values;