no message
parent
ffdf0aaf71
commit
ba2c7f819b
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue