feat: 增加Notificatio方法
This commit is contained in:
@ -12,6 +12,7 @@ import { downloadByUrl } from '@/utils/tools';
|
|||||||
import DeleteTaskModal from './delete-task-modal.vue';
|
import DeleteTaskModal from './delete-task-modal.vue';
|
||||||
import icon1 from '@/assets/img/media-account/icon-delete.png';
|
import icon1 from '@/assets/img/media-account/icon-delete.png';
|
||||||
import icon5 from '@/assets/img/media-account/icon-warn-1.png';
|
import icon5 from '@/assets/img/media-account/icon-warn-1.png';
|
||||||
|
import { showExportNotification } from '@/utils/arcoD';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
setup(props, { emit, expose }) {
|
setup(props, { emit, expose }) {
|
||||||
@ -106,18 +107,7 @@ export default {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleDownload = (record) => {
|
const handleDownload = (record) => {
|
||||||
Notification.warning({
|
showExportNotification(record.name)
|
||||||
showIcon: false,
|
|
||||||
closable: true,
|
|
||||||
content: (
|
|
||||||
<div class="flex items-center">
|
|
||||||
<icon-loading size="16" class="color-#6D4CFE mr-8px" />
|
|
||||||
<p class="text-14px lh-22px font-400 color-#211F24">{`正在下载“${record.name}”,请稍后...`}</p>
|
|
||||||
</div>
|
|
||||||
),
|
|
||||||
duration: 3000,
|
|
||||||
class: `px-16px py-9px w-400px rounded-2px bg-#F0EDFF`,
|
|
||||||
});
|
|
||||||
record.file && downloadByUrl(record.file);
|
record.file && downloadByUrl(record.file);
|
||||||
};
|
};
|
||||||
const handleBatchDownload = () => {
|
const handleBatchDownload = () => {
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import { downloadByUrl } from '@/utils/tools';
|
|||||||
import DeleteTaskModal from './delete-task-modal.vue';
|
import DeleteTaskModal from './delete-task-modal.vue';
|
||||||
import icon1 from '@/assets/img/media-account/icon-delete.png';
|
import icon1 from '@/assets/img/media-account/icon-delete.png';
|
||||||
import icon5 from '@/assets/img/media-account/icon-warn-1.png';
|
import icon5 from '@/assets/img/media-account/icon-warn-1.png';
|
||||||
|
import { showExportNotification } from '@/utils/arcoD';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
setup(props, { emit, expose }) {
|
setup(props, { emit, expose }) {
|
||||||
@ -106,19 +107,7 @@ export default {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleDownload = (record) => {
|
const handleDownload = (record) => {
|
||||||
Notification.warning({
|
showExportNotification(record.name)
|
||||||
showIcon: false,
|
|
||||||
closable: true,
|
|
||||||
content: (
|
|
||||||
<div class="flex items-center">
|
|
||||||
<icon-loading size="16" class="color-#6D4CFE mr-8px" />
|
|
||||||
<p class="text-14px lh-22px font-400 color-#211F24">{`正在下载“${record.name}”,请稍后...`}</p>
|
|
||||||
</div>
|
|
||||||
),
|
|
||||||
duration: 3000,
|
|
||||||
class: `px-16px py-9px w-400px rounded-2px bg-#F0EDFF`,
|
|
||||||
});
|
|
||||||
record.file && downloadByUrl(record.file);
|
|
||||||
};
|
};
|
||||||
const handleBatchDownload = () => {
|
const handleBatchDownload = () => {
|
||||||
// 批量下载逻辑
|
// 批量下载逻辑
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
:footer="false"
|
:footer="false"
|
||||||
@close="onClose"
|
@close="onClose"
|
||||||
>
|
>
|
||||||
<a-tabs v-model="activeTab" @tab-click="handleTabClick">
|
<a-tabs :active-key="activeTab" @tab-click="handleTabClick">
|
||||||
<a-tab-pane key="0" title="导入"> </a-tab-pane>
|
<a-tab-pane key="0" title="导入"> </a-tab-pane>
|
||||||
<a-tab-pane key="1" title="导出"> </a-tab-pane>
|
<a-tab-pane key="1" title="导出"> </a-tab-pane>
|
||||||
</a-tabs>
|
</a-tabs>
|
||||||
@ -42,6 +42,8 @@ const getData = () => {
|
|||||||
const open = () => {
|
const open = () => {
|
||||||
getData();
|
getData();
|
||||||
|
|
||||||
|
console.log(activeTab.value);
|
||||||
|
|
||||||
timer = setInterval(() => {
|
timer = setInterval(() => {
|
||||||
getData();
|
getData();
|
||||||
}, 10000);
|
}, 10000);
|
||||||
|
|||||||
17
src/utils/arcoD.tsx
Normal file
17
src/utils/arcoD.tsx
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import { Notification } from '@arco-design/web-vue';
|
||||||
|
import { IconLoading } from '@arco-design/web-vue/es/icon';
|
||||||
|
|
||||||
|
export function showExportNotification(name: string) {
|
||||||
|
Notification.warning({
|
||||||
|
showIcon: false,
|
||||||
|
closable: true,
|
||||||
|
content: () => (
|
||||||
|
<div class="flex items-center">
|
||||||
|
<IconLoading size={16} class="color-#6D4CFE mr-8px" />
|
||||||
|
<p class="text-14px lh-22px font-400 color-#211F24">{`正在下载“${name}”,请稍后...`}</p>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
duration: 3000,
|
||||||
|
class: 'px-16px py-9px w-400px rounded-2px bg-#F0EDFF',
|
||||||
|
});
|
||||||
|
}
|
||||||
@ -106,3 +106,4 @@ export function downloadByUrl(url: string, filename?: string) {
|
|||||||
a.click();
|
a.click();
|
||||||
document.body.removeChild(a);
|
document.body.removeChild(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -66,6 +66,7 @@ import { getAccountBoardOverview, getAccountBoardList, postAccountBoardExport }
|
|||||||
import { formatNumberShow } from '@/utils/tools';
|
import { formatNumberShow } from '@/utils/tools';
|
||||||
import { INITIAL_QUERY, CARD_FIELDS } from './constants';
|
import { INITIAL_QUERY, CARD_FIELDS } from './constants';
|
||||||
import { downloadByUrl } from '@/utils/tools';
|
import { downloadByUrl } from '@/utils/tools';
|
||||||
|
import { showExportNotification } from '@/utils/arcoD';
|
||||||
|
|
||||||
import icon1 from '@/assets/img/icon-question.png';
|
import icon1 from '@/assets/img/icon-question.png';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user