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> </template>
导入 导入
</a-button> </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 <a-progress
:percent="progressPercent" :percent="progressPercent"
:status="progressStatus" :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-modal>
<a-button @click="onExportAddress" type="primary" v-privilege="'address:exportAddress'"> <a-button @click="onExportAddress" type="primary" v-privilege="'address:exportAddress'">
<template #icon> <template #icon>
<ExportOutlined/> <ExportOutlined/>
@ -178,6 +193,7 @@
<script setup lang="ts"> <script setup lang="ts">
import {reactive, ref, onMounted} from 'vue'; import {reactive, ref, onMounted} from 'vue';
import {message, Modal, UploadFile} from 'ant-design-vue'; import {message, Modal, UploadFile} from 'ant-design-vue';
import { LoadingOutlined } from '@ant-design/icons-vue';
import {SmartLoading} from '/@/components/framework/smart-loading'; import {SmartLoading} from '/@/components/framework/smart-loading';
import {addressApi} from '/@/api/business/wms/base/address/address-api'; import {addressApi} from '/@/api/business/wms/base/address/address-api';
import {PAGE_SIZE_OPTIONS} from '/@/constants/common-const'; 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 progressPercent = ref(0);//
const progressStatus = ref('active');// const progressStatus = ref('active');//
const currentTaskId = ref('');//ID const currentTaskId = ref('');//ID
@ -455,15 +471,14 @@ const onExportAddress = async () => {
if (progress >= 100) { if (progress >= 100) {
clearInterval(timer); clearInterval(timer);
progressStatus.value = 'success'; progressStatus.value = 'success';
progressTitle.value = '文件导出完成'; progressTitle.value = '文件下载完成';
// 1 // 2
setTimeout(() => { setTimeout(() => {
open.value = false; open.value = false;
progressPercent.value = 0; progressPercent.value = 0;
}, 1000); progressTitle.value = '文件下载中,请稍等...';
}, 2000);
} }
} catch (error) { } catch (error) {
clearInterval(timer); clearInterval(timer);
progressStatus.value = 'exception'; progressStatus.value = 'exception';
@ -471,12 +486,14 @@ const onExportAddress = async () => {
} }
}, 1000); // }, 1000); //
} catch (error) { } catch (error) {
message.error('导出失败'); message.error('导出失败');
} }
}; };
const onClose = () => {
open.value = false;
};
onMounted(queryData); onMounted(queryData);
</script> </script>