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 { watch } from 'vue';
import { 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 {
getDictDataPage,
} from '#/api/system/dict/data';
import { $t } from '#/locales';
import { downloadByData } from '#/utils/download';
import { useDataGridColumns, useDataGridFormSchema } from '../data';
import DataForm from './data-form.vue';
@@ -44,7 +44,7 @@ function onRefresh() {
/** 导出表格 */
async function onExport() {
const data = await exportDictData(await gridApi.formApi.getValues());
downloadByData(data, '字典数据.xls');
downloadFileFromBlobPart({ fileName: '字典数据.xls', source: data });
}
/** 创建字典数据 */

View File

@@ -8,6 +8,7 @@ import type { SystemDictTypeApi } from '#/api/system/dict/type';
import { useVbenModal } from '@vben/common-ui';
import { Download, Plus } from '@vben/icons';
import { downloadFileFromBlobPart } from '@vben/utils';
import { Button, message } from 'ant-design-vue';
@@ -18,7 +19,6 @@ import {
getDictTypePage,
} from '#/api/system/dict/type';
import { $t } from '#/locales';
import { downloadByData } from '#/utils/download';
import { useTypeGridColumns, useTypeGridFormSchema } from '../data';
import TypeForm from './type-form.vue';
@@ -38,7 +38,7 @@ function onRefresh() {
/** 导出表格 */
async function onExport() {
const data = await exportDictType(await gridApi.formApi.getValues());
downloadByData(data, '字典类型.xls');
downloadFileFromBlobPart({ fileName: '字典类型.xls', source: data });
}
/** 创建字典类型 */