From 2429c95af0dde4bf0730cbbd7f0d9c7e9fb7e93b Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Thu, 29 Jan 2026 09:55:46 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
applications/task-work-order/src/views/orderView/organizational/zoningManagement/index.vue | 19 ++++++++++++++-----
applications/task-work-order/src/views/orderView/organizational/agenciesManagement/index.vue | 17 +++++++++++++----
2 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/applications/task-work-order/src/views/orderView/organizational/agenciesManagement/index.vue b/applications/task-work-order/src/views/orderView/organizational/agenciesManagement/index.vue
index 5621c62..9a2441e 100644
--- a/applications/task-work-order/src/views/orderView/organizational/agenciesManagement/index.vue
+++ b/applications/task-work-order/src/views/orderView/organizational/agenciesManagement/index.vue
@@ -48,7 +48,7 @@
<div class="gd-table-toolbar">
<el-button :icon="Plus" color="#4C34FF" type="primary" @click="openForm('add')">新增机构</el-button>
<el-button :icon="Upload" @click="handleImport">导入机构</el-button>
- <el-button :icon="Download" @click="handleExport">导出机构</el-button>
+ <el-button :icon="Download" :loading="exportLoading" :disabled="exportLoading" @click="handleExport">导出机构</el-button>
</div>
<div class="gd-table-container" v-loading="loading">
@@ -182,6 +182,9 @@
const importRules = ref({
file: [{ required: true, message: '请上传文件', trigger: ['change'] }],
})
+
+// 导出加载状态
+const exportLoading = ref(false)
provide('regionOptions', regionOptions)
provide('dictObj', dictObj)
@@ -351,8 +354,10 @@
}
// 导出机构
-function handleExport() {
- agenciesExportApi(searchParams.value).then(res => {
+async function handleExport() {
+ exportLoading.value = true
+ try {
+ const res = await agenciesExportApi(searchParams.value)
const blob = new Blob([res.data])
const url = URL.createObjectURL(blob)
const a = document.createElement('a')
@@ -363,7 +368,11 @@
a.click()
document.body.removeChild(a)
URL.revokeObjectURL(url)
- })
+ } catch (error) {
+ console.error('导出失败:', error)
+ } finally {
+ exportLoading.value = false
+ }
}
onMounted(() => {
diff --git a/applications/task-work-order/src/views/orderView/organizational/zoningManagement/index.vue b/applications/task-work-order/src/views/orderView/organizational/zoningManagement/index.vue
index bdcccd5..8c492b0 100644
--- a/applications/task-work-order/src/views/orderView/organizational/zoningManagement/index.vue
+++ b/applications/task-work-order/src/views/orderView/organizational/zoningManagement/index.vue
@@ -40,7 +40,7 @@
<div class="gd-table-toolbar">
<el-button :icon="Plus" color="#4C34FF" type="primary" @click="openForm('add')">新增区划</el-button>
<el-button :icon="Upload" @click="handleImport">导入区划</el-button>
- <el-button :icon="Download" @click="handleExport">导出区划</el-button>
+ <el-button :icon="Download" :loading="exportLoading" :disabled="exportLoading" @click="handleExport">导出区划</el-button>
</div>
<div class="gd-table-container" v-loading="loading">
@@ -171,6 +171,9 @@
const importRules = ref({
file: [{ required: true, message: '请上传文件', trigger: ['change'] }],
})
+
+// 导出加载状态
+const exportLoading = ref(false)
provide('regionOptions', regionOptions)
provide('dictObj', dictObj)
@@ -313,18 +316,24 @@
}
// 导出区划
-function handleExport() {
- zoningExportApi(searchParams.value).then(res => {
+async function handleExport() {
+ exportLoading.value = true
+ try {
+ const res = await zoningExportApi(searchParams.value)
const blob = new Blob([res.data])
const url = URL.createObjectURL(blob)
const a = document.createElement('a')
a.href = url
- a.download = `区划列表${new Date().getTime()}.xlsx`
+ a.download = `区划列表.xlsx`
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
URL.revokeObjectURL(url)
- })
+ } catch (error) {
+ console.error('导出失败:', error)
+ } finally {
+ exportLoading.value = false
+ }
}
onMounted(() => {
--
Gitblit v1.9.3