From 5b73519a2c26fea97b4dfd7f56ee6c4e5ea27dde Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Thu, 11 Sep 2025 15:55:37 +0800
Subject: [PATCH] Merge branch 'feature/v5.0/5.0.5' into feature/v6.0/6.0.1

---
 src/views/resource/patchManagement.vue |   42 +++++++++++-------------------------------
 1 files changed, 11 insertions(+), 31 deletions(-)

diff --git a/src/views/resource/patchManagement.vue b/src/views/resource/patchManagement.vue
index f18babe..0f78973 100644
--- a/src/views/resource/patchManagement.vue
+++ b/src/views/resource/patchManagement.vue
@@ -84,10 +84,12 @@
       :detailid="detailid"
       :detailList="detailList"
       :spotTypeOption="allspotTypeOption"
+      :regionalData="regionalData"
     ></SpotDetails>
   </basic-container>
 </template>
 <script setup>
+import { findAreaName } from '@/utils/areaUtils';
 import {
   spotManagementTableApi,
   searchManagementApi,
@@ -136,6 +138,7 @@
 const query = ref({});
 const loading = ref(true);
 const box = ref(false);
+
 const page = ref({
   pageSize: 20,
   currentPage: 1,
@@ -157,6 +160,8 @@
   searchMenuPosition: 'right',
   border: true,
   index: true,
+  indexLabel: '序号',
+  indexWidth: 60,
   selection: true,
   grid: false,
   menuWidth: 240,
@@ -463,40 +468,13 @@
     data.value = d.records.map(i => ({
       ...i,
       dataFrom: i.date_from === 0 ? '本地上传' : '国土调查云',
-      areaName: findAreaName(i.area_code),
+      areaName: findAreaName(i.area_code, regionalData.value, true),
     }));
     loading.value = false;
     selectionClear();
   });
 };
-const findAreaName = areaCode => {
-  const nodes = regionalData.value;
-  if (!nodes || nodes.length === 0) return areaCode;
 
-  const normalizeCode = code => {
-    if (!code) return '';
-    const strCode = String(code).replace(/0+$/, '');
-    return strCode.length >= 6 ? strCode : '';
-  };
-  const targetCode = normalizeCode(areaCode);
-  const findInTree = (treeNodes, needFullPath = false, parentPath = []) => {
-    for (const node of treeNodes) {
-      const currentPath = [...parentPath, node.name];
-
-      if (normalizeCode(node.id) === targetCode) {
-        return needFullPath ? currentPath.join('/') : node.name;
-      }
-
-      if (node.childrens?.length > 0) {
-        const found = findInTree(node.childrens, needFullPath, currentPath);
-        if (found) return found;
-      }
-    }
-    return null;
-  };
-
-  return findInTree(nodes, true) || areaCode;
-};
 // 图斑详情/编辑
 const uploadPatch = (row, type = 'detail') => {
   detailid.value = row.id;
@@ -532,11 +510,14 @@
 };
 // 图斑上传
 const uploadFlightFile = (file, t) => {
+  loading.value = true;
   const fileSuffix = file.name.substring(file.name.lastIndexOf('.') + 1);
   if (!['kmz', 'kml', 'zip'].includes(fileSuffix)) {
     return ElMessage.error('请上传zip/kmz/kml格式的文件');
   }
-
+  if (file) {
+    box.value = false;
+  }
   let data = new FormData();
   let type = t === '3' ? '' : t;
   const params = {
@@ -556,8 +537,7 @@
 
     ElMessage.success('上传成功');
 
-    box.value = false;
-
+    loading.value = false;
     ruleForm.name = '';
     ruleForm.region = '';
 

--
Gitblit v1.9.3