refactor: download.ts 使用@vben/utils替换

This commit is contained in:
xingyu4j
2025-04-23 17:22:37 +08:00
parent 84a5002d4a
commit ecf10c0539
24 changed files with 51 additions and 49 deletions

View File

@@ -9,6 +9,7 @@ import { h } from 'vue';
import { Page, useVbenModal } from '@vben/common-ui';
import { Download, Plus } from '@vben/icons';
import { downloadFileFromBlobPart } from '@vben/utils';
import { Button, message } from 'ant-design-vue';
@@ -19,7 +20,6 @@ import {
getDemo01ContactPage,
} from '#/api/infra/demo/demo01';
import { $t } from '#/locales';
import { downloadByData } from '#/utils/download';
import { useGridColumns, useGridFormSchema } from './data';
import Form from './modules/form.vue';
@@ -66,7 +66,7 @@ async function onDelete(row: Demo01ContactApi.Demo01Contact) {
/** 导出表格 */
async function onExport() {
const data = await exportDemo01Contact(await gridApi.formApi.getValues());
downloadByData(data, '示例联系人.xls');
downloadFileFromBlobPart({ fileName: '示例联系人.xls', source: data });
}
/** 表格操作按钮的回调函数 */