吉安感知网项目-前端
张含笑
2026-01-29 3e39466d98aa1c39befe4e68f1dbbaca16b3611c
feat:导出添加禁用
2 files modified
36 ■■■■ changed files
applications/task-work-order/src/views/orderView/organizational/agenciesManagement/index.vue 17 ●●●● patch | view | raw | blame | history
applications/task-work-order/src/views/orderView/organizational/zoningManagement/index.vue 19 ●●●● patch | view | raw | blame | history
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(() => {
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(() => {