refactor: 移除已经弃用的方法

This commit is contained in:
dap 2025-01-15 23:34:50 +08:00
parent 11dba43d83
commit 8816086b37
3 changed files with 11 additions and 53 deletions

View File

@ -24,6 +24,8 @@
- 用户管理 新增只获取一次(mounted)默认密码而非每次打开modal都获取
- `apps/web-antd/src/utils/dict.ts` `getDict`方法将于下个版本删除 使用`getDictOptions`替代
- VxeTable升级V4.10.0
- 移除`@deprecated` `apps/web-antd/src/adapter/vxe-table.ts`的`tableCheckboxEvent`方法
- 移除`由于更新方案弃用的` `apps/web-antd/src/adapter/vxe-table.ts`的`vxeSortEvent`方法
# 1.1.3

View File

@ -1,6 +1,4 @@
import type { Ref } from 'vue';
import type { VxeGridDefines, VxeGridPropTypes } from '@vben/plugins/vxe-table';
import type { VxeGridPropTypes } from '@vben/plugins/vxe-table';
import { h } from 'vue';
@ -105,21 +103,6 @@ export { useVbenVxeGrid };
export type * from '@vben/plugins/vxe-table';
/**
*
* @deprecated 使vxeCheckboxChecked代替
* @param checked
* @returns function
*/
export function tableCheckboxEvent(checked: Ref<boolean>) {
const event: (params: VxeGridDefines.CheckboxChangeEventParams) => void = (
params,
) => {
checked.value = params.$table.getCheckboxRecords().length > 0;
};
return event;
}
/**
* vxe-table的复选框是否选中
* @param tableApi api
@ -131,28 +114,6 @@ export function vxeCheckboxChecked(
return tableApi?.grid?.getCheckboxRecords?.()?.length > 0;
}
/**
* vxe-table排序事件 /
* @deprecated 使addSortParams代替
* @param tableApi api
* @param sortParams
*/
export function vxeSortEvent(
tableApi: ReturnType<typeof useVbenVxeGrid>[1],
sortParams: VxeGridDefines.SortChangeEventParams,
) {
const { sortList } = sortParams;
// 这里是排序取消 length为0 就不传参数了
if (sortList.length === 0) {
tableApi.query();
return;
}
// 支持单/多字段排序
const orderByColumn = sortList.map((item) => item.field).join(',');
const isAsc = sortList.map((item) => item.order).join(',');
tableApi.query({ orderByColumn, isAsc });
}
/**
*
* @param params

View File

@ -1,19 +1,18 @@
<script setup lang="ts">
import type { VbenFormProps } from '@vben/common-ui';
import type { Recordable } from '@vben/types';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { ref } from 'vue';
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { Page, useVbenModal } from '@vben/common-ui';
import { getPopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import {
tableCheckboxEvent,
useVbenVxeGrid,
type VxeGridProps,
} from '#/adapter/vxe-table';
import { downloadExcel } from '#/utils/file/download';
import { useVbenVxeGrid, vxeCheckboxChecked } from '#/adapter/vxe-table';
import { commonDownloadExcel } from '#/utils/file/download';
import { demoExport, demoList, demoRemove } from './api';
import { columns, querySchema } from './data';
@ -61,10 +60,6 @@ const checked = ref(false);
const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
gridEvents: {
checkboxChange: tableCheckboxEvent(checked),
checkboxAll: tableCheckboxEvent(checked),
},
});
const [DemoModal, modalApi] = useVbenModal({
@ -113,7 +108,7 @@ function handleMultiDelete() {
<a-button
v-access:code="['system:demo:export']"
@click="
downloadExcel(
commonDownloadExcel(
demoExport,
'测试单数据',
tableApi.formApi.form.values,
@ -123,7 +118,7 @@ function handleMultiDelete() {
{{ $t('pages.common.export') }}
</a-button>
<a-button
:disabled="!checked"
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['system:demo:remove']"