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