Jelajahi Sumber

修改时间格式化

tangning 1 hari lalu
induk
melakukan
963cf010b5
5 mengubah file dengan 44 tambahan dan 5 penghapusan
  1. TEMPAT SAMPAH
      public/favicon.ico
  2. TEMPAT SAMPAH
      public/faviconga.ico
  3. 33 1
      src/layout/edit/scene-select.vue
  4. 7 4
      src/layout/model-list/sign.vue
  5. 4 0
      src/sdk/cover/index.js

TEMPAT SAMPAH
public/favicon.ico


TEMPAT SAMPAH
public/faviconga.ico


+ 33 - 1
src/layout/edit/scene-select.vue

@@ -95,6 +95,7 @@ import { fetchScenesAll, SceneType, uploadMaterialToModel, type Scene } from "@/
 import { activeModel, getSceneModel, sceneModelMap } from "@/sdk";
 import { selectMaterials } from "@/components/materials/quisk";
 import { custom } from "@/env";
+import { formatDate } from "@/utils";
 import { actionItems, currentItem } from "@/views/merge";
 
 type Key = string;
@@ -193,12 +194,39 @@ const rowSelection: any = ref({
         curIds.push(...cache[keyp][key])
       }
     }
-    selects.value = curIds
+    selects.value =  deduplicateBySuffix(curIds) || []
+
   },
   getCheckboxProps: (record: Scene) => ({
     disabled: selectIds.value.includes(record.num),
   }),
 });
+/**
+ * 根据字符串中----ll----之后的部分进行去重,保留第一次出现的元素
+ * @param {string[]} strList - 待去重的字符串列表
+ * @returns {string[]} 去重后的字符串列表
+ */
+function deduplicateBySuffix(strList: string[]) {
+    // 用对象记录已出现的后缀(key:后缀,value:完整字符串)
+    const seenSuffix = {};
+    
+    // 遍历列表中的每个字符串
+    strList.forEach(str => {
+        // 分割字符串,获取----ll----之后的部分
+        const parts = str.split('----ll----');
+        // 确保分割后有后缀部分
+        if (parts.length >= 2) {
+            const suffix:string = parts[1];
+            // 仅当后缀未出现过时,才记录
+            if (!seenSuffix[suffix]) {
+                seenSuffix[suffix] = str;
+            }
+        }
+    });
+    
+    // 提取对象的value,转为数组返回
+    return Object.values(seenSuffix);
+}
 const cloumns = [
   {
     width: "400px",
@@ -215,6 +243,10 @@ const cloumns = [
     title: "拍摄/创建时间",
     dataIndex: "createTime",
     key: "createTime",
+    customRender:({text})=>{
+      return text?formatDate(new Date(text), 'yyyy-MM-dd hh:mm'):""
+
+    }
   },
 ];
 

+ 7 - 4
src/layout/model-list/sign.vue

@@ -34,10 +34,10 @@
     </div>
     <div class="model-desc" v-if="active">
       <p><span>数据来源:</span>{{ model.raw.sourceName }}</p>
-      <p v-if="![SceneType.SWSS, SceneType.SWYDSS].includes(model.type)">
+      <p v-if="![SceneType.SWSS, SceneType.SWYDSS, SceneType.SWSX].includes(model.type)">
         <span>数据大小:</span>{{ model.size }}
       </p>
-      <p v-if="model.type !== SceneType.SWMX"><span>拍摄时间:</span>{{ model.time }}</p>
+      <p v-if="model.type !== SceneType.SWMX"><span>拍摄时间:</span>{{ getTime(model.time) }}</p>
     </div>
   </div>
 </template>
@@ -46,7 +46,7 @@
 import { getFuseModelShowVariable, SceneTypeDesc, SceneType } from "@/store";
 import { custom } from "@/env";
 import { getSceneModel } from "@/sdk";
-
+import { formatDate } from "@/utils";
 import type { FuseModel } from "@/store";
 import { computed, onMounted, ref, watchEffect } from "vue";
 import { currentModel, fuseModel } from "@/model";
@@ -70,7 +70,10 @@ type ModelEmits = {
 };
 defineEmits<ModelEmits>();
 onMounted(() => console.error("mount", custom.showModelsMap.get(props.model)));
-
+const getTime = (time:any) => {
+  const date = new Date(time);
+  return date ? formatDate(date) : '';
+};
 const supportPano = ref(false);
 const show = getFuseModelShowVariable(props.model);
 watchEffect(() => {

+ 4 - 0
src/sdk/cover/index.js

@@ -1,6 +1,7 @@
 import mitt from 'mitt'
 import libTransform from 'coordtransform';
 import axios from 'axios' //{ axios } from '@/api'
+import { params } from "@/env";
 
 //火调 
 
@@ -176,6 +177,9 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
         viewer.images360.tileDownloader.getTiles = function(d, sceneNum, useV4url, model){ 
             let kankan = !model.isPointcloud //ModelTypes[model.props.fromType].panos4dkk  
             if(kankan){
+                if(window.location.pathname.includes('fusion_offline')){// 案件多元融合嵌入
+                    return `/fusion_offline/${params.caseId}/www/swkk/${sceneNum}/wwwroot/scene_view_data/${sceneNum}/images/${d}`
+                }
                 return `/swkk/${sceneNum}/wwwroot/scene_view_data/${sceneNum}/images/${d}`
             }else{
                 return `/swss/${sceneNum}/www/${sceneNum}/scene_view_data/${sceneNum}/images/${d}`