feat: tag,Notification替换
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { Notification } from '@arco-design/web-vue';
|
||||
import { notification } from 'ant-design-vue';
|
||||
import { downloadByUrl } from '@/utils/tools';
|
||||
import { IconLoading } from '@arco-design/web-vue/es/icon';
|
||||
|
||||
@ -16,30 +16,30 @@ interface RenderNotificationData {
|
||||
|
||||
// 下载通知框
|
||||
export function showExportNotification(label: string, others: { id?: string, duration?: number }) {
|
||||
const { id = '', duration = 3000 } = others ?? {}
|
||||
Notification.warning({
|
||||
id,
|
||||
showIcon: false,
|
||||
closable: true,
|
||||
content: () => (
|
||||
const { id = '', duration = 3 } = others ?? {}
|
||||
notification.warning({
|
||||
key: id,
|
||||
icon: () => null,
|
||||
message: () => null,
|
||||
description: (
|
||||
<div class="flex items-center pr-16px">
|
||||
<IconLoading size={16} class="color-#6D4CFE mr-8px" />
|
||||
<p class="text-14px lh-22px font-400 color-#211F24">{label}</p>
|
||||
</div>
|
||||
),
|
||||
duration,
|
||||
class: 'px-16px py-9px w-450px rounded-2px bg-#F0EDFF',
|
||||
class: 'w-450px rounded-2px bg-#F0EDFF',
|
||||
});
|
||||
}
|
||||
|
||||
// 下载失败框
|
||||
export function showFailExportNotification(label: string, others: { id?: string, duration?: number, onReDownload?: Function }) {
|
||||
const { id = '', duration = 0, onReDownload } = others ?? {}
|
||||
Notification.warning({
|
||||
id,
|
||||
showIcon: false,
|
||||
closable: true,
|
||||
content: () => (
|
||||
notification.warning({
|
||||
key: id,
|
||||
icon: () => null,
|
||||
message: () => null,
|
||||
description: (
|
||||
<div class="flex items-center justify-between pr-16px">
|
||||
<div class="flex items-center mr-10px">
|
||||
<img src={icon3} width={16} height={16} class=" mr-8px" />
|
||||
@ -50,7 +50,7 @@ export function showFailExportNotification(label: string, others: { id?: string,
|
||||
</div>
|
||||
),
|
||||
duration,
|
||||
class: 'px-16px py-9px w-500px rounded-2px bg-#FFE9E7',
|
||||
class: 'w-500px rounded-2px bg-#FFE9E7',
|
||||
});
|
||||
}
|
||||
|
||||
@ -61,10 +61,10 @@ export const showImportResultNotification = (data: RenderNotificationData) => {
|
||||
file && downloadByUrl(file);
|
||||
};
|
||||
|
||||
Notification.warning({
|
||||
showIcon: false,
|
||||
closable: true,
|
||||
content: () => (
|
||||
notification.warning({
|
||||
icon: () => null,
|
||||
message: () => null,
|
||||
description: (
|
||||
<div>
|
||||
<div class="flex items-center mb-4px">
|
||||
<img src={hasError ? icon1 : icon2} width="16" height="16" class="mr-8px" />
|
||||
@ -89,6 +89,6 @@ export const showImportResultNotification = (data: RenderNotificationData) => {
|
||||
</div>
|
||||
),
|
||||
duration: 3000,
|
||||
class: `px-16px py-16px w-400px rounded-2px ${hasError ? 'bg-#FFF7E5' : 'bg-#EBF7F2'}`,
|
||||
class: `w-400px rounded-2px ${hasError ? 'bg-#FFF7E5' : 'bg-#EBF7F2'}`,
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user