Parcourir la source

[Fix 0000] 地图管理上传逻辑修复

houzekong il y a 1 mois
Parent
commit
94392498a1

+ 1 - 1
src/views/system/cadFile/components/MapEditModal.vue

@@ -87,7 +87,7 @@
       const svc = new vjmap.Service(env.serviceUrl, env.accessToken);
       const res = await svc.uploadMap(file);
 
-      setFieldsValue({ wjId: res.fieldId, filePath: file.name });
+      setFieldsValue({ wjId: res.fileid, filePath: file.name });
       onSuccess(res);
     } catch (err: any) {
       console.error('上传错误:', err);

+ 6 - 2
src/views/system/cadFile/components/MapView.vue

@@ -3,8 +3,8 @@
     <div ref="map3dContainer"></div>
     <!-- 操作按钮面板 -->
     <div class="map-operation-panel">
-      <button @click="drawerVisible = true" class="btn">老空区永久密闭列表</button>
-      <button @click="emit('close')" class="btn ml-5px">返回列表</button>
+      <button :loading="loading" @click="drawerVisible = true" class="btn">老空区永久密闭列表</button>
+      <button :loading="loading" @click="emit('close')" class="btn ml-5px">返回列表</button>
     </div>
 
     <SideDrawer v-model:open="drawerVisible" :mineCode="mineCode" :getContainer="() => map3dContainer" />
@@ -29,12 +29,16 @@
   // 定义弹框显隐状态
   const drawerVisible = ref(false);
   const map3dContainer = ref<HTMLElement>();
+  const loading = ref(false);
 
   // 初始化地图(确保先加载地图,再调用其他方法)
   onMounted(() => {
     // nextTick(async () => {
+    loading.value = true;
     initMap2d(map3dContainer.value!, {
       wjId: props.wjId as string,
+    }).finally(() => {
+      loading.value = false;
     });
     // });
   });