From c579731e0c206d6062f8442ec9df70ca781b26f6 Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期二, 31 三月 2026 17:41:51 +0800
Subject: [PATCH] #前端

---
 rsf-design/src/views/basic-info/bas-station-area/index.vue |   67 +++++++++++++++++++++++----------
 1 files changed, 47 insertions(+), 20 deletions(-)

diff --git a/rsf-design/src/views/basic-info/bas-station-area/index.vue b/rsf-design/src/views/basic-info/bas-station-area/index.vue
index 7d9c219..3160d21 100644
--- a/rsf-design/src/views/basic-info/bas-station-area/index.vue
+++ b/rsf-design/src/views/basic-info/bas-station-area/index.vue
@@ -12,7 +12,7 @@
       <ArtTableHeader v-model:columns="columnChecks" :loading="loading" @refresh="refreshData">
         <template #left>
           <ElSpace wrap>
-            <ElButton v-auth="'add'" @click="showDialog('add')" v-ripple>鏂板绔欑偣鍖哄煙</ElButton>
+            <ElButton v-auth="'add'" @click="handleShowDialog('add')" v-ripple>鏂板绔欑偣鍖哄煙</ElButton>
             <ElButton
               v-auth="'delete'"
               type="danger"
@@ -66,7 +66,7 @@
   import { defaultResponseAdapter } from '@/utils/table/tableUtils'
   import { guardRequestWithMessage } from '@/utils/sys/requestGuard'
   import { fetchDictDataPage } from '@/api/system-manage'
-  import { fetchBasStationPage } from '@/api/bas-station'
+  import { fetchBasStationOptionPage } from '@/api/bas-station'
   import { fetchWarehouseAreasList } from '@/api/warehouse-areas'
   import {
     fetchBasStationAreaDetail,
@@ -109,6 +109,8 @@
   const containerTypeOptions = ref([])
   const stationOptions = ref([])
   const useStatusOptions = ref([])
+  const stationOptionsLoaded = ref(false)
+  const stationOptionsLoading = ref(null)
   let handleDeleteAction = null
 
   const areaLabelMap = computed(
@@ -314,12 +316,54 @@
     }
   }
 
+  async function ensureStationOptions() {
+    if (stationOptionsLoaded.value) {
+      return
+    }
+
+    if (stationOptionsLoading.value) {
+      await stationOptionsLoading.value
+      return
+    }
+
+    stationOptionsLoading.value = (async () => {
+      const response = await guardRequestWithMessage(
+        fetchBasStationOptionPage(
+          {
+            current: 1,
+            pageSize: 100
+          },
+          {
+            showErrorMessage: false
+          }
+        ),
+        { records: [] },
+        {
+          timeoutMessage: '绔欑偣鍒悕閫夐」鍔犺浇瓒呮椂锛屽凡鍋滄绛夊緟'
+        }
+      )
+      stationOptions.value = resolveBasStationAreaStationOptions(defaultResponseAdapter(response).records)
+      stationOptionsLoaded.value = true
+    })()
+
+    try {
+      await stationOptionsLoading.value
+    } finally {
+      stationOptionsLoading.value = null
+    }
+  }
+
+  async function handleShowDialog(type, record) {
+    await ensureStationOptions()
+    showDialog(type, record)
+  }
+
   async function openEditDialog(row) {
     try {
       const detail = await guardRequestWithMessage(fetchBasStationAreaDetail(row.id), {}, {
         timeoutMessage: '绔欑偣鍖哄煙璇︽儏鍔犺浇瓒呮椂锛屽凡鍋滄绛夊緟'
       })
-      showDialog('edit', detail)
+      await handleShowDialog('edit', detail)
     } catch (error) {
       ElMessage.error(error?.message || '鑾峰彇绔欑偣鍖哄煙璇︽儏澶辫触')
     }
@@ -403,22 +447,6 @@
     crossZoneAreaOptions.value = options
   }
 
-  async function loadStationOptions() {
-    const response = await guardRequestWithMessage(
-      fetchBasStationPage({
-        current: 1,
-        pageSize: 500
-      }, {
-        showErrorMessage: false
-      }),
-      { records: [] },
-      {
-        timeoutMessage: '绔欑偣鍒悕閫夐」鍔犺浇瓒呮椂锛屽凡鍋滄绛夊緟'
-      }
-    )
-    stationOptions.value = resolveBasStationAreaStationOptions(defaultResponseAdapter(response).records)
-  }
-
   async function loadContainerTypeOptions() {
     const response = await guardRequestWithMessage(
       fetchDictDataPage({
@@ -450,7 +478,6 @@
   onMounted(async () => {
     await Promise.allSettled([
       loadAreaOptions(),
-      loadStationOptions(),
       loadContainerTypeOptions(),
       loadUseStatusOptions()
     ])

--
Gitblit v1.9.1