feat: 批量下载失败-重新下载

This commit is contained in:
rd
2025-07-21 15:42:35 +08:00
parent e6798bf313
commit 4387037b2d
2 changed files with 50 additions and 15 deletions

View File

@ -5,6 +5,7 @@ import { IconLoading } from '@arco-design/web-vue/es/icon';
import icon1 from '@/assets/img/media-account/icon-warn-1.png';
import icon2 from '@/assets/img/media-account/icon-success.png';
import icon3 from "@/assets/img/media-account/icon-warn.png"
interface RenderNotificationData {
total_number: number;
@ -13,7 +14,9 @@ interface RenderNotificationData {
file?: string;
}
export function showExportNotification(label: string, { id = '', duration = 3000}) {
// 下载通知框
export function showExportNotification(label: string, others: { id?: string, duration?: number }) {
const { id = '', duration = 3000 } = others ?? {}
Notification.warning({
id,
showIcon: false,
@ -29,6 +32,28 @@ export function showExportNotification(label: string, { id = '', duration = 300
});
}
// 下载失败框
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: () => (
<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" />
<p class="text-14px lh-22px font-400 color-#211F24 ">{label}</p>
</div>
<p class="text-14px lh-22px font-400 color-#6D4CFE cursor-pointer" onClick={() => onReDownload?.()}></p>
</div>
),
duration,
class: 'px-16px py-9px w-500px rounded-2px bg-#FFE9E7',
});
}
export const showImportResultNotification = (data: RenderNotificationData) => {
const { total_number, success_number, fail_number, file } = data;
const hasError = fail_number > 0;