Ver código fonte

bugfix一波

wangfumin 3 semanas atrás
pai
commit
3434a46aa2

+ 3 - 0
src/assets/style/public.scss

@@ -174,6 +174,9 @@ body {
 .head-layer .el-tabs__nav-wrap {
   padding: 0 24px;
 }
+.el-tabs--top .el-tabs__nav{
+  padding-bottom: 16px;
+}
 
 .el-tabs__item {
   font-size  : 16px;

+ 8 - 1
src/view/case/drawMap/creatMap.vue

@@ -543,8 +543,14 @@ const handleConfirm = async () => {
     console.log('方位图保存成功:', response)
     if(appId === 'fire'){
       window.open(`${url}/draw/fire/index.html#/tabulation?caseId=${props.caseId}&tabulationId=${response.data.id}&token=${user.value.token}`, '_blank')
-    }else{
+    } else if(appId === 'criminal'){
       window.open(`${url}/draw/criminal/index.html#/tabulation?caseId=${props.caseId}&tabulationId=${response.data.id}&token=${user.value.token}`, '_blank')
+    } else if(appId === 'cjzfire'){
+      window.open(`${url}/draw/cjzfire/index.html#/tabulation?caseId=${props.caseId}&tabulationId=${response.data.id}&token=${user.value.token}`, '_blank')
+    } else if(appId === 'xmfire'){
+      window.open(`${url}/draw/xmfire/index.html#/tabulation?caseId=${props.caseId}&tabulationId=${response.data.id}&token=${user.value.token}`, '_blank')
+    } else{
+      window.open(`${url}/draw/fire/index.html#/tabulation?caseId=${props.caseId}&tabulationId=${response.data.id}&token=${user.value.token}`, '_blank')
     }
     // console.log(`http://test-mix3d.4dkankan.com/draw/index.html#/tabulation?caseId=${props.caseId}&tabulationId=${response.data.id}&token=${user.value.token}`)
 
@@ -609,6 +615,7 @@ onUnmounted(() => {
         
         :deep(.el-select__wrapper){
           border-radius: 4px 0 0 4px;
+          height: 40px;
         }
     }
     .search-input-latlng{

+ 93 - 93
src/view/case/newCaseFile.vue

@@ -105,7 +105,7 @@
           <div class="card-image-container">
             <el-image
               ref="imageRef"
-              :src="file.type === 'old' ? file.filesUrl : file.listCover"
+              :src="file.filesUrl"
               :preview-teleported="true"
               class="card-image"
             >
@@ -168,15 +168,14 @@
           <!-- 卡片底部:文件名 -->
           <div class="card-footer">
             <div class="file-title">
-              <span v-if="!inputCaseTitles.includes(file)" :title="file.type === 'old' ? file.filesTitle : file.title" class="title-text">
-                {{ file.type === 'old' ? file.filesTitle : file.title }}
+              <span v-if="!inputCaseTitles.includes(file)" :title="file.filesTitle" class="title-text">
+                {{ file.filesTitle }}
                 <el-icon class="edit-title" @click="inputCaseTitles.push(file)">
                   <EditPen />
                 </el-icon>
               </span>
               <template v-else>
                 <ElInput
-                  v-if="file.type === 'old'"
                   v-model="file.filesTitle"
                   placeholder="请输入文件名"
                   focus
@@ -190,21 +189,6 @@
                     </el-button>
                   </template>
                 </ElInput>
-                <ElInput
-                  v-else
-                  v-model="file.title"
-                  placeholder="请输入文件名"
-                  focus
-                  :maxlength="50"
-                  size="default"
-                  class="edit-input"
-                >
-                  <template #append>
-                    <el-button type="primary" plain @click="updateFileTitle(file)">
-                      确定
-                    </el-button>
-                  </template>
-                </ElInput>
               </template>
             </div>
           </div>
@@ -275,16 +259,12 @@ const inputCaseTitles = ref<CaseFile[]>([]);
 
 // 处理标题输入事件
 const handleTitleInput = (file: CaseFile, value: string) => {
-  if (file.type === 'old') {
-    file.filesTitle = value;
-  } else {
-    file.title = value;
-  }
+  file.filesTitle = value;
 };
 
 const updateFileTitle = async (caseFile: CaseFile) => {
   // 根据文件类型检查不同的标题字段
-  const title = caseFile.type === 'old' ? caseFile.filesTitle : caseFile.title;
+  const title = caseFile.filesTitle;
   if (!title || !title.trim()) {
     ElMessage.error("标题不能为空!");
     return;
@@ -292,40 +272,42 @@ const updateFileTitle = async (caseFile: CaseFile) => {
   
   try {
     // 根据文件类型调用不同的更新接口
-    if (caseFile.type === 'old') {
-      await updateCaseInfo(caseFile);
-    } else if (caseFile.type === 'tabulation') {
-      // updateCaseTabulation 参数:id, caseId, store, viewport, cover, paperKey, overviewId, isAutoGen, listCover, mapUrl, high, width
-      await updateCaseTabulation({
-        id: caseFile.id,
-        caseId: caseFile.caseId,
-        store: caseFile.store,
-        viewport: caseFile.viewport,
-        cover: caseFile.cover,
-        paperKey: caseFile.paperKey,
-        overviewId: caseFile.overviewId,
-        isAutoGen: caseFile.isAutoGen,
-        listCover: caseFile.listCover,
-        mapUrl: caseFile.mapUrl,
-        high: caseFile.high,
-        width: caseFile.width,
-        title: title // 使用最新输入的 title
-      });
-    } else if (caseFile.type === 'overview') {
-      // updateCaseOverview 参数:id, caseId, store, title, cover, mapUrl, listCover, high, width, kankanCover
-      await updateCaseOverview({
-        id: caseFile.id,
-        caseId: caseFile.caseId,
-        store: caseFile.store,
-        title: title, // 使用最新输入的 title
-        cover: caseFile.cover,
-        mapUrl: caseFile.mapUrl,
-        listCover: caseFile.listCover,
-        high: caseFile.high,
-        width: caseFile.width,
-        kankanCover: caseFile.kankanCover
-      });
-    }
+    await updateCaseInfo(caseFile);
+    // if (caseFile.type === 'old') {
+    //   await updateCaseInfo(caseFile);
+    // } 
+    // else if (caseFile.type === 'tabulation') {
+    //   // updateCaseTabulation 参数:id, caseId, store, viewport, cover, paperKey, overviewId, isAutoGen, listCover, mapUrl, high, width
+    //   await updateCaseTabulation({
+    //     id: caseFile.id,
+    //     caseId: caseFile.caseId,
+    //     store: caseFile.store,
+    //     viewport: caseFile.viewport,
+    //     cover: caseFile.cover,
+    //     paperKey: caseFile.paperKey,
+    //     overviewId: caseFile.overviewId,
+    //     isAutoGen: caseFile.isAutoGen,
+    //     listCover: caseFile.listCover,
+    //     mapUrl: caseFile.mapUrl,
+    //     high: caseFile.high,
+    //     width: caseFile.width,
+    //     title: title // 使用最新输入的 title
+    //   });
+    // } else if (caseFile.type === 'overview') {
+    //   // updateCaseOverview 参数:id, caseId, store, title, cover, mapUrl, listCover, high, width, kankanCover
+    //   await updateCaseOverview({
+    //     id: caseFile.id,
+    //     caseId: caseFile.caseId,
+    //     store: caseFile.store,
+    //     title: title, // 使用最新输入的 title
+    //     cover: caseFile.cover,
+    //     mapUrl: caseFile.mapUrl,
+    //     listCover: caseFile.listCover,
+    //     high: caseFile.high,
+    //     width: caseFile.width,
+    //     kankanCover: caseFile.kankanCover
+    //   });
+    // }
     
     inputCaseTitles.value = inputCaseTitles.value.filter(
       (item) => item !== caseFile
@@ -371,7 +353,7 @@ const files = ref<CaseFile[]>([]);
 const srcList = computed(() => {
   return files.value.map(file => {
     // 根据文件类型返回对应的图片URL
-    return file.type === 'old' ? file.filesUrl : (file.listCover || file.filesUrl);
+    return  file.filesUrl;
   });
 });
 
@@ -410,7 +392,7 @@ const previewImage = (index: number) => {
     }
   } else {
     // tabulation 和 overview 类型的查看逻辑
-    if (file.listCover) {
+    if (file.filesUrl) {
       // 如果有封面图,显示预览
       showPreview.value = true
     } else {
@@ -433,25 +415,24 @@ const refresh = async () => {
     ]);
     
     // 提取数据并为每种类型添加标记
-    let tabulationList = (tabulationRes?.data || []).map(item => ({
-      ...item,
-      title: item.title || '方位图',
-      type: 'tabulation' as const
-    }));
-    // 方位图需要清除封面图为空的数据
-    tabulationList = tabulationList.filter(item => item.listCover !== '');
-    const overviewList = (overviewRes?.data || []).map(item => ({
-      ...item,
-      title: item.title || '平面图',
-      type: 'overview' as const
-    }));
+    // let tabulationList = (tabulationRes?.data || []).map(item => ({
+    //   ...item,
+    //   title: item.title || '方位图',
+    //   type: 'tabulation' as const
+    // }));
+    // // 方位图需要清除封面图为空的数据
+    // tabulationList = tabulationList.filter(item => item.listCover !== '');
+    // const overviewList = (overviewRes?.data || []).map(item => ({
+    //   ...item,
+    //   title: item.title || '平面图',
+    //   type: 'overview' as const
+    // }));
     const caseFiles = (caseFilesRes || []).map(item => ({
       ...item,
-      type: 'old' as const
+      type: item.tabulationId ? 'tabulation' : item.overviewId ? 'overview' : 'old'
     }));
     
-    files.value = [...tabulationList, ...overviewList, ...caseFiles];
-    console.log(files.value)
+    files.value = [...caseFiles];
   } catch (error) {
     console.error('获取文件列表失败:', error);
     files.value = [];
@@ -477,16 +458,17 @@ const del = async (file: CaseFile) => {
   if (await confirm("确定要删除此数据?")) {
     try {
       // 根据文件类型调用不同的删除接口
-      if (file.type === 'old') {
-        // old 类型的删除逻辑不变
-        await delCaseFile({ caseId: caseId.value!, filesId: file.filesId });
-      } else if (file.type === 'tabulation') {
-        // tabulation 类型调用 /fusion/caseTabulation/del
-        await delCaseTabulation({ id: file.id! });
-      } else if (file.type === 'overview') {
-        // overview 类型调用 /fusion/caseOverview/del
-        await delCaseOverview({ id: file.id! });
-      }
+      await delCaseFile({ caseId: caseId.value!, filesId: file.filesId });
+      // if (file.type === 'old') {
+      //   // old 类型的删除逻辑不变
+      //   await delCaseFile({ caseId: caseId.value!, filesId: file.filesId });
+      // } else if (file.type === 'tabulation') {
+      //   // tabulation 类型调用 /fusion/caseTabulation/del
+      //   await delCaseTabulation({ id: file.id! });
+      // } else if (file.type === 'overview') {
+      //   // overview 类型调用 /fusion/caseOverview/del
+      //   await delCaseOverview({ id: file.id! });
+      // }
       
       refresh();
       ElMessage.success("删除成功!");
@@ -514,16 +496,28 @@ const handleEdit = (file: CaseFile) => {
   if (file.type === 'tabulation') {
     // tabulation 类型的编辑链接
     if(appId === 'fire'){
-      window.open(`${url}/draw/fire/index.html#/tabulation?caseId=${caseId.value}&tabulationId=${file.id}&token=${user.value.token}`, '_blank');
-    } else {
-      window.open(`${url}/draw/criminal/index.html#/tabulation?caseId=${caseId.value}&tabulationId=${file.id}&token=${user.value.token}`, '_blank');
+      window.open(`${url}/draw/fire/index.html#/tabulation?caseId=${caseId.value}&tabulationId=${file.tabulationId}&token=${user.value.token}`, '_blank');
+    } else if(appId === 'criminal'){
+      window.open(`${url}/draw/criminal/index.html#/tabulation?caseId=${caseId.value}&tabulationId=${file.tabulationId}&token=${user.value.token}`, '_blank');
+    } else if(appId === 'cjzfire'){
+      window.open(`${url}/draw/cjzfire/index.html#/tabulation?caseId=${caseId.value}&tabulationId=${file.tabulationId}&token=${user.value.token}`, '_blank');
+    } else if(appId === 'xmfire'){
+      window.open(`${url}/draw/xmfire/index.html#/tabulation?caseId=${caseId.value}&tabulationId=${file.tabulationId}&token=${user.value.token}`, '_blank');
+    } else{
+      window.open(`${url}/draw/fire/index.html#/tabulation?caseId=${caseId.value}&tabulationId=${file.tabulationId}&token=${user.value.token}`, '_blank');
     }
   } else if (file.type === 'overview') {
     // overview 类型的编辑链接
     if(appId === 'fire'){
-      window.open(`${url}/draw/fire/index.html#/overview?caseId=${caseId.value!}&overviewId=${file.id}&token=${user.value.token}`, '_blank');
-    } else {
-      window.open(`${url}/draw/criminal/index.html#/overview?caseId=${caseId.value!}&overviewId=${file.id}&token=${user.value.token}`, '_blank');
+      window.open(`${url}/draw/fire/index.html#/overview?caseId=${caseId.value!}&overviewId=${file.overviewId}&token=${user.value.token}`, '_blank');
+    } else if(appId === 'criminal'){
+      window.open(`${url}/draw/criminal/index.html#/overview?caseId=${caseId.value!}&overviewId=${file.overviewId}&token=${user.value.token}`, '_blank');
+    } else if(appId === 'cjzfire'){
+      window.open(`${url}/draw/cjzfire/index.html#/overview?caseId=${caseId.value!}&overviewId=${file.overviewId}&token=${user.value.token}`, '_blank');
+    } else if(appId === 'xmfire'){
+      window.open(`${url}/draw/xmfire/index.html#/overview?caseId=${caseId.value!}&overviewId=${file.overviewId}&token=${user.value.token}`, '_blank');
+    } else{
+      window.open(`${url}/draw/fire/index.html#/overview?caseId=${caseId.value!}&overviewId=${file.overviewId}&token=${user.value.token}`, '_blank');
     }
   }
 };
@@ -544,8 +538,14 @@ const openOverView = () => {
   console.log('appId', appId)
   if(appId === 'fire'){
     window.open(`${url}/draw/fire/index.html#/overview?caseId=${caseId.value!}&token=${user.value.token}`, '_blank')
-  } else {
+  } else if(appId === 'criminal'){
     window.open(`${url}/draw/criminal/index.html#/overview?caseId=${caseId.value!}&token=${user.value.token}`, '_blank')
+  } else if(appId === 'cjzfire'){
+    window.open(`${url}/draw/cjzfire/index.html#/overview?caseId=${caseId.value!}&token=${user.value.token}`, '_blank')
+  } else if(appId === 'xmfire'){
+    window.open(`${url}/draw/xmfire/index.html#/overview?caseId=${caseId.value!}&token=${user.value.token}`, '_blank')
+  } else{
+    window.open(`${url}/draw/fire/index.html#/overview?caseId=${caseId.value!}&token=${user.value.token}`, '_blank')
   }
 }
 

+ 2 - 2
src/view/mediaLibrary/index.vue

@@ -68,9 +68,9 @@
           {{ formatStatus(row.status) }}
         </template>
       </el-table-column>
-      <el-table-column label="上传时间" width="200px" prop="updateTime">
+      <el-table-column label="上传时间" width="200px" prop="createTime">
         <template #default="{ row }">
-          {{ formatDateTime(row.updateTime) }}
+          {{ formatDateTime(row.createTime) }}
         </template>
       </el-table-column>
       <el-table-column label="操作" width="240px" v-slot:default="{ row }">