tangning недель назад: 2
Родитель
Сommit
cde227022b

+ 1 - 1
src/view/newFireCase/newFireDetails/components/otherFiles.vue

@@ -219,7 +219,7 @@ const handleDelete = async (file: CaseFile) => {
   if (await confirm('确定要删除此文件?')) {
   if (await confirm('确定要删除此文件?')) {
     await delCaseFile({ caseId: caseId.value!, filesId: file.filesId });
     await delCaseFile({ caseId: caseId.value!, filesId: file.filesId });
     ElMessage.success('删除成功');
     ElMessage.success('删除成功');
-    if (previewUrl.value === file.filesUrl) previewUrl.value = '';
+    // if (previewUrl.value === file.filesUrl) previewUrl.value = '';
     refresh();
     refresh();
   }
   }
 };
 };

+ 23 - 5
src/view/newFireCase/newFireDetails/components/siteInspection.vue

@@ -16,10 +16,10 @@
         <!-- 顶部切换栏,默认“现场图” -->
         <!-- 顶部切换栏,默认“现场图” -->
         <div class="top-switch">
         <div class="top-switch">
           <el-tabs v-model="activeTab">
           <el-tabs v-model="activeTab">
-            <el-tab-pane label="现场图" name="scene" />
-            <el-tab-pane label="勘验笔录" name="inspection" />
-            <el-tab-pane label="提取清单" name="extraction" />
-            <el-tab-pane label="照片卷" name="album" />
+            <el-tab-pane label="现场图" v-if="showObj.scene" name="scene" />
+            <el-tab-pane label="勘验笔录" v-if="showObj.inspection" name="inspection" />
+            <el-tab-pane label="提取清单" v-if="showObj.extraction" name="extraction" />
+            <el-tab-pane label="照片卷" v-if="showObj.album" name="album" />
           </el-tabs>
           </el-tabs>
         </div>
         </div>
 
 
@@ -371,7 +371,12 @@ const url = import.meta.env.VITE_DRAW_URL || 'http://mix3d.4dkankan.com';
 
 
 const props = defineProps<{ caseId?: number; fire?: any, editOrShow?: string }>();
 const props = defineProps<{ caseId?: number; fire?: any, editOrShow?: string }>();
 const caseId = computed(() => props.caseId ?? Number(router.currentRoute.value.params.caseId));
 const caseId = computed(() => props.caseId ?? Number(router.currentRoute.value.params.caseId));
-
+const showObj = ref({
+  scene: true,
+  inspection: true,
+  extraction: true,
+  album: true
+});
 type PicItem = { url: string; name?: string };
 type PicItem = { url: string; name?: string };
 
 
 // 顶部切换栏:默认“现场图”
 // 顶部切换栏:默认“现场图”
@@ -423,6 +428,7 @@ const loadListsFromTree = async () => {
     orientationFiles.value = drawList.filter((i: any) => !isPlane(i) && isOrientation(i));
     orientationFiles.value = drawList.filter((i: any) => !isPlane(i) && isOrientation(i));
     planeImages.value = planeFiles.value.map(mapToPic);
     planeImages.value = planeFiles.value.map(mapToPic);
     orientationImages.value = orientationFiles.value.map(mapToPic);
     orientationImages.value = orientationFiles.value.map(mapToPic);
+
     if (orientationImages.value.length) {
     if (orientationImages.value.length) {
       openViewer('orientation', 0);
       openViewer('orientation', 0);
     } else if (planeImages.value.length) {
     } else if (planeImages.value.length) {
@@ -473,6 +479,14 @@ const loadListsFromTree = async () => {
         }
         }
       }
       }
     }
     }
+        
+    if(props.editOrShow == 'show'){
+      showObj.value.scene = !(orientationImages.value.length == 0 && planeImages.value.length == 0);
+      showObj.value.inspection = !!inspectionList.value.length
+      showObj.value.extraction = !!extractionList.value.length
+      showObj.value.album = !!albumList.value.length
+      activeTab.value = showObj.value.scene ? 'scene' : (showObj.value.inspection ? 'inspection' : (showObj.value.extraction ? 'extraction' : 'album'))
+    }
   } catch (e) {
   } catch (e) {
     console.error('获取文件类型树失败:', e);
     console.error('获取文件类型树失败:', e);
     // 重置所有列表
     // 重置所有列表
@@ -968,6 +982,10 @@ const loadAlbum = async () => {
       const name = item.imgInfo || item.filesTitle || item.name || `照片卷 ${idx + 1}`;
       const name = item.imgInfo || item.filesTitle || item.name || `照片卷 ${idx + 1}`;
       return { id: item.id, title: name, images: url ? [{ url, name }] : [] };
       return { id: item.id, title: name, images: url ? [{ url, name }] : [] };
     });
     });
+    if(props.editOrShow == 'show'){
+      showObj.value.album = !!albumList.value.length
+      // activeTab.value = showObj.value.album ? 'album' : activeTab.value
+    }
     // 若无数据,置空;否则默认选中第一项
     // 若无数据,置空;否则默认选中第一项
     selectedAlbumIndex.value = albumList.value.length ? 0 : 0;
     selectedAlbumIndex.value = albumList.value.length ? 0 : 0;
   } catch (e) {
   } catch (e) {