refactor(antdv-next): 将message组件调用统一改为window.message

将项目中直接导入的antdv-next的message组件调用改为通过window.message调用,提升代码一致性
移除不再需要的message组件导入
新增api-switch组件用于统一处理状态切换逻辑
This commit is contained in:
dap
2026-01-15 09:35:54 +08:00
parent 2312f438ac
commit ee1b37c787
23 changed files with 211 additions and 90 deletions

View File

@@ -3,7 +3,6 @@ import type { VbenFormProps } from '#/adapter/form';
import { $t } from '@vben/locales';
import { cloneDeep, formatDate } from '@vben/utils';
import { message } from 'antdv-next';
import { isFunction } from 'lodash-es';
import { dataURLtoBlob, urlToBase64 } from './base64Conver';
@@ -26,7 +25,10 @@ export async function downloadExcel(
requestData: any = {},
withRandomName = true,
) {
const hideLoading = message.loading($t('pages.common.downloadLoading'), 0);
const hideLoading = window.message.loading(
$t('pages.common.downloadLoading'),
0,
);
try {
const data = await func(requestData);
downloadExcelFile(data, fileName, withRandomName);
@@ -114,7 +116,10 @@ export async function commonDownloadExcel(
requestData: any = {},
options: DownloadExcelOptions = {},
) {
const hideLoading = message.loading($t('pages.common.downloadLoading'), 0);
const hideLoading = window.message.loading(
$t('pages.common.downloadLoading'),
0,
);
try {
const { withRandomName = true, fieldMappingTime } = options;
// 需要处理时间字段映射