refactor: 重构导出功能,使用新的 useBlobExport 钩子

移除旧的 commonDownloadExcel 函数,统一使用 useBlobExport 钩子处理文件导出
- 在用户导入模板、请假申请和字典类型页面中替换导出逻辑
- 移除 demo 页面未使用的导出按钮和相关导入
- 为导出按钮添加加载状态,提升用户体验
This commit is contained in:
dap
2026-01-28 19:41:50 +08:00
parent 35d67ad71c
commit 7b4d68a164
4 changed files with 37 additions and 33 deletions

View File

@@ -12,9 +12,8 @@ import { getPopupContainer } from '@vben/utils';
import { Popconfirm, Space } from 'antdv-next';
import { useVbenVxeGrid, vxeCheckboxChecked } from '#/adapter/vxe-table';
import { commonDownloadExcel } from '#/utils/file/download';
import { demoExport, demoList, demoRemove } from './api';
import { demoList, demoRemove } from './api';
import { columns, querySchema } from './data';
import demoModal from './demo-modal.vue';
@@ -105,18 +104,6 @@ function handleMultiDelete() {
</template>
<template #toolbar-tools>
<Space>
<a-button
v-access:code="['system:demo:export']"
@click="
commonDownloadExcel(
demoExport,
'测试单数据',
tableApi.formApi.form.values,
)
"
>
{{ $t('pages.common.export') }}
</a-button>
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger