no message

main
HUOJIN\92525 2025-05-09 14:27:43 +08:00
parent ffdf0aaf71
commit ba2c7f819b
1 changed files with 26 additions and 9 deletions

View File

@ -56,13 +56,28 @@
</template>
导入
</a-button>
<a-modal v-model:open="open" :title="progressTitle" :maskClosable="false" :footer="null">
<a-modal
v-model:open="open"
@cancel="onClose"
:closable="false"
:maskClosable="false"
:destroyOnClose="true">
<a-progress
:percent="progressPercent"
:status="progressStatus"
/>
<template #title>
<span style="display: inline-flex; align-items: center">
<LoadingOutlined style="margin-right: 8px"/>
{{progressTitle}}
</span>
</template>
<template #footer>
<a-space>
<a-button @click="onClose"></a-button>
</a-space>
</template>
</a-modal>
<a-button @click="onExportAddress" type="primary" v-privilege="'address:exportAddress'">
<template #icon>
<ExportOutlined/>
@ -178,6 +193,7 @@
<script setup lang="ts">
import {reactive, ref, onMounted} from 'vue';
import {message, Modal, UploadFile} from 'ant-design-vue';
import { LoadingOutlined } from '@ant-design/icons-vue';
import {SmartLoading} from '/@/components/framework/smart-loading';
import {addressApi} from '/@/api/business/wms/base/address/address-api';
import {PAGE_SIZE_OPTIONS} from '/@/constants/common-const';
@ -426,7 +442,7 @@ async function onImportAddress() {
}
//
const progressTitle = ref('文件导出中,请稍等...');
const progressTitle = ref('文件下载中,请稍等...');
const progressPercent = ref(0);//
const progressStatus = ref('active');//
const currentTaskId = ref('');//ID
@ -455,15 +471,14 @@ const onExportAddress = async () => {
if (progress >= 100) {
clearInterval(timer);
progressStatus.value = 'success';
progressTitle.value = '文件导出完成';
// 1
progressTitle.value = '文件下载完成';
// 2
setTimeout(() => {
open.value = false;
progressPercent.value = 0;
}, 1000);
progressTitle.value = '文件下载中,请稍等...';
}, 2000);
}
} catch (error) {
clearInterval(timer);
progressStatus.value = 'exception';
@ -471,12 +486,14 @@ const onExportAddress = async () => {
}
}, 1000); //
} catch (error) {
message.error('导出失败');
}
};
const onClose = () => {
open.value = false;
};
onMounted(queryData);
</script>