Bladeren bron

Merge branch 'v2.0.0-jm-local' of http://192.168.0.115:3000/bill/fuse-code into v2.0.0-jm-local

xzw 3 weken geleden
bovenliggende
commit
aeb5e767b8

+ 9 - 4
src/api/instance.ts

@@ -10,7 +10,7 @@ import { ui18n } from "@/lang";
 const instance = axiosFactory();
 
 export const {
-  axios, 
+  axios,
   addUnsetTokenURLS,
   delUnsetTokenURLS,
   addReqErrorHandler,
@@ -50,7 +50,7 @@ addReqErrorHandler((err) => {
 });
 
 addResErrorHandler((response, data) => {
-  console.log('hahah')
+  console.log("hahah");
   if (response && response.status !== 200) {
     Message.error(response.statusText);
   } else if (data) {
@@ -66,7 +66,12 @@ addResErrorHandler((response, data) => {
       // })
       // throw msg
     } else {
-      Message.error(msg || ui18n.t('sys.serviceErr'));
+      const umsg = msg
+        ? ui18n.te(`sys.${msg}`)
+          ? ui18n.t(`sys.${msg}`)
+          : msg
+        : ui18n.t("sys.serviceErr");
+      Message.error(umsg);
     }
   }
 });
@@ -85,6 +90,6 @@ addHook({
 });
 
 setDefaultURI(baseURL);
-const token = params.token || localStorage.getItem('token')
+const token = params.token || localStorage.getItem("token");
 token && setToken(token);
 export default axios;

+ 1 - 0
src/api/scene.ts

@@ -75,6 +75,7 @@ export const fetchScenes = async () => {
 export const fetchScenesAll = async (params: {
   numList?: string[];
   isObj: number;
+  sceneName?: string
   pageNum: number;
   pageSize: number;
 }) => {

+ 1 - 1
src/api/tagging-style.ts

@@ -138,7 +138,7 @@ export const fetchTaggingStyles = async () => {
   console.error("treeData", tree, styles);
   styleTypes.length = 0;
   styleTypes.push(...tree.children)
-  Object.assign(defStyleType, tree.children[tree.children.length - 1]);
+  Object.assign(defStyleType, tree.children[0]);
 
   console.error("StyleT", styleTypes);
 

+ 8 - 2
src/components/materials/index.vue

@@ -92,7 +92,13 @@
               }}
             </template>
             <template v-if="column.key === 'group'">
-              <span class="group-str">{{ record.group }}</span>
+              <span class="group-str">
+                {{
+                  ui18n.te(`sys.${record.group}`)
+                    ? ui18n.t(`sys.${record.group}`)
+                    : record.group
+                }}
+              </span>
             </template>
             <template v-else-if="column.key === 'action'">
               <span v-if="record.useType !== 'animation'">
@@ -130,7 +136,7 @@ import {
 } from "@/api/material";
 import Message from "bill/components/message/message.vue";
 import { Dialog } from "bill/expose-common";
-import { ui18n } from "@/lang";
+import { ui18n, lang } from "@/lang";
 
 const props = defineProps<{
   uploadFormat?: string[];

+ 31 - 11
src/components/tagging/sign-new.vue

@@ -1,6 +1,6 @@
 <template>
   <div
-    v-if="show && posStyle"
+    v-if="task3D && show && posStyle"
     class="hot-item pc"
     :style="posStyle"
     @mouseenter="isHover = true"
@@ -78,6 +78,7 @@ import type { Tagging, TaggingPosition } from "@/store";
 import { useCameraChange, usePixel } from "@/hook/use-pixel";
 import { inRevise } from "bill/utils";
 import { defStyleType } from "@/api";
+import mitt from "mitt";
 
 export type SignProps = { tagging: Tagging; scenePos: TaggingPosition; show?: boolean };
 
@@ -94,7 +95,6 @@ const emit = defineEmits<{
 const desc = ref<HTMLDivElement>();
 const showDesc = computed(() => {
   const a = desc.value?.innerText.trim();
-  console.error("--aaa->", desc.value, a);
   return a;
 });
 
@@ -112,15 +112,34 @@ const queryItems = computed(() =>
   }))
 );
 const taggingStyle = computed(() => getTaggingStyle(props.tagging.styleId));
-const tag = markRaw(
-  sdk.createTagging({
-    ...props.scenePos,
-    title: props.tagging.title,
-    position: props.scenePos.localPos,
-    canMove: false,
-    image: getFileUrl(taggingStyle.value!.icon),
-  })
-) as TaggingPositionNode;
+let task3D = sdk.createTagging({
+  ...props.scenePos,
+  title: props.tagging.title,
+  position: props.scenePos.localPos,
+  canMove: false,
+  image: getFileUrl(taggingStyle.value!.icon),
+});
+if (!task3D) {
+  emit("delete");
+}
+const emptyfn = () => {};
+const tag = (task3D
+  ? markRaw(task3D)
+  : {
+      changeCanMove: emptyfn,
+      changeMat: emptyfn,
+      changeFontSize: emptyfn,
+      changeTitle: emptyfn,
+      visibilityTitle: emptyfn,
+      changeType: emptyfn,
+      changeImage: emptyfn,
+      changePosition: emptyfn,
+      changeLineHeight: emptyfn,
+      visibility: emptyfn,
+      getImageCenter: emptyfn,
+      bus: mitt(),
+      destroy: emptyfn,
+    }) as TaggingPositionNode;
 const showDelete = ref(false);
 tag.showDelete = (show) => {
   showDelete.value = show;
@@ -308,6 +327,7 @@ defineExpose(tag);
       p {
         margin-bottom: 10px;
         display: flex;
+
         span {
           flex: 0 0 auto;
         }

+ 1 - 2
src/lang/index.ts

@@ -13,7 +13,6 @@ export enum langNameEum {
   ja = 'ja',
   kr = 'kr'
 }
-console.log('en', JSON.stringify(zh))
 
 export const langNameDescs = {
   [langNameEum.zh]: '中文',
@@ -76,9 +75,9 @@ export const langs = {
   [langNameEum.ja]: ja,
   [langNameEum.kr]: kr,
 }
-console.error(langKey, langs)
 export const lang = langs[langKey] as typeof zh
 
+console.error(lang)
 i18n.global.setLocaleMessage(langNameEum.zh, zh)
 i18n.global.setLocaleMessage(langNameEum.en, en)
 i18n.global.setLocaleMessage(langNameEum.ja, ja)

+ 5 - 0
src/lang/locales/en.json

@@ -439,12 +439,16 @@
       "sizeErr": "The size of {name} exceeds {sizeStr}"
     },
     "viewPWD": "Access password",
+    "上传失败,请检查文件格式。": "Upload failed: Check file format.",
     "其他": "Other",
     "其它物证(痕迹物证)": "Other Trace Evidence",
+    "动画模型": "Animation Model",
+    "图片缺失": "No Image",
     "尸体": "Corpse",
     "工具痕迹": "Tool Marks",
     "手印痕迹": "Handprint Marks",
     "提取物品": "Extract Items",
+    "文件格式错误": "Invalid File Format",
     "文检物证": "Forensic Document Evidence",
     "枪弹痕迹": "Ballistic Marks",
     "毒化物证": "Toxic Evidence",
@@ -454,6 +458,7 @@
     "电子物证": "Electronic Evidence",
     "痕迹物证": "Trace Evidence",
     "视听物证": "Audiovisual Evidence",
+    "足迹痕迹": "Footprint Marks",
     "高德影像地图": "Amap Imagery Map",
     "高德矢量地图": "Amap Vector Map"
   },

+ 5 - 0
src/lang/locales/ja.json

@@ -439,12 +439,16 @@
       "sizeErr": "{name}のサイズが{sizeStr}を超えています"
     },
     "viewPWD": "アクセスパスワード",
+    "上传失败,请检查文件格式。": "アップロード失敗:ファイル形式を確認",
     "其他": "その他",
     "其它物证(痕迹物证)": "その他痕跡物証",
+    "动画模型": "アニメモデル",
+    "图片缺失": "画像欠損",
     "尸体": "死体",
     "工具痕迹": "工具痕跡",
     "手印痕迹": "手形痕跡",
     "提取物品": "物品抽出",
+    "文件格式错误": "ファイル形式エラー",
     "文检物证": "文書検査物証",
     "枪弹痕迹": "銃弾痕跡",
     "毒化物证": "毒物物証",
@@ -454,6 +458,7 @@
     "电子物证": "電子物証",
     "痕迹物证": "痕跡物証",
     "视听物证": "視聴物証",
+    "足迹痕迹": "足跡痕跡",
     "高德影像地图": "Amap イメージ地図",
     "高德矢量地图": "Amap ベクトル地図"
   },

+ 5 - 0
src/lang/locales/ko.json

@@ -439,12 +439,16 @@
       "sizeErr": "{name}의 크기가 {sizeStr}를 초과했습니다"
     },
     "viewPWD": "액세스 비밀번호",
+    "上传失败,请检查文件格式。": "업로드 실패: 파일 형식 확인",
     "其他": "기타",
     "其它物证(痕迹物证)": "기타 흔적 물증",
+    "动画模型": "애니모델",
+    "图片缺失": "이미지 누락",
     "尸体": "시체",
     "工具痕迹": "공구 흔적",
     "手印痕迹": "손자국 흔적",
     "提取物品": "물품 추출",
+    "文件格式错误": "파일 형식 오류",
     "文检物证": "문서 검증 물증",
     "枪弹痕迹": "총탄 흔적",
     "毒化物证": "독물 물증",
@@ -454,6 +458,7 @@
     "电子物证": "전자 물증",
     "痕迹物证": "흔적 물증",
     "视听物证": "시청 물증",
+    "足迹痕迹": "보행 흔적",
     "高德影像地图": "Amap 이미지 지도",
     "高德矢量地图": "Amap 벡터 지도"
   },

+ 7 - 2
src/lang/locales/zh.json

@@ -356,7 +356,7 @@
     "addData": "添加数据",
     "address": "地址",
     "all": "全部",
-    "camera0": "圆周率/Mesh",
+    "camera0": "现勘补拍仪/Mesh",
     "camera1": "四维看见/Mesh",
     "camera2": "四维深时/点云",
     "camera3": "本地上传",
@@ -378,7 +378,7 @@
     "errPage": "错误页面",
     "expand": "展开",
     "ga": {
-      "camera0": "圆周率/Mesh",
+      "camera0": "现勘补拍仪/Mesh",
       "camera1": "现勘三号/Mesh",
       "camera2": "现勘一号/点云",
       "camera3": "本地上传",
@@ -439,12 +439,16 @@
       "sizeErr": "{name}的大小超过{sizeStr}"
     },
     "viewPWD": "访问密码",
+    "上传失败,请检查文件格式。": "上传失败,请检查文件格式。",
     "其他": "其他",
     "其它物证(痕迹物证)": "其它物证(痕迹物证)",
+    "动画模型": "动画模型",
+    "图片缺失": "图片缺失",
     "尸体": "尸体",
     "工具痕迹": "工具痕迹",
     "手印痕迹": "手印痕迹",
     "提取物品": "提取物品",
+    "文件格式错误": "文件格式错误",
     "文检物证": "文检物证",
     "枪弹痕迹": "枪弹痕迹",
     "毒化物证": "毒化物证",
@@ -454,6 +458,7 @@
     "电子物证": "电子物证",
     "痕迹物证": "痕迹物证",
     "视听物证": "视听物证",
+    "足迹痕迹": "足迹痕迹",
     "高德影像地图": "高德影像地图",
     "高德矢量地图": "高德矢量地图"
   },

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

@@ -23,7 +23,7 @@
           style="width: 244px"
         />
       </div>
-      <div class="table-layout" v-if="origin.length">
+      <div class="table-layout">
         <Tabs v-model:activeKey="type">
           <TabPane v-for="current in types" :key="current" :tab="current">
             <Table
@@ -45,13 +45,13 @@
           </TabPane>
         </Tabs>
       </div>
-      <div style="padding: 1px" v-else>
+      <!-- <div style="padding: 1px" v-else>
         <Empty
           :description="keyword.length ? $t('sys.unSearchData') : $t('sys.undata')"
           :image="Empty.PRESENTED_IMAGE_SIMPLE"
           className="ant-empty ant-empty-normal"
         />
-      </div>
+      </div> -->
     </div>
   </Modal>
 
@@ -118,17 +118,23 @@ const handleTableChange: TableProps["onChange"] = (pag) => {
   params.value.pageSize = pag.pageSize!;
   params.value.pageNum = pag.current!;
 };
-const meshParams = ref({ isObj: 1, pageNum: 1, pageSize: 12, total: 0 })
-const cloudParams = ref({ isObj: 0, pageNum: 1, pageSize: 12, total: 0 })
+const meshParams = ref({ isObj: 1, pageNum: 1, pageSize: 12, total: 0, sceneName: '' })
+const cloudParams = ref({ isObj: 0, pageNum: 1, pageSize: 12, total: 0, sceneName: '' })
 const meshList = ref<Scene[]>([])
 const cloudList = ref<Scene[]>([])
 const params = computed(() => type.value === ui18n.t('scene.typeRaws.0') ? meshParams.value : cloudParams.value)
 
+watch(
+  () => keyword.value,
+  () => (params.value.pageNum = 1),
+  { flush: "sync" }
+);
+
 let loadCount = 0
 watchEffect(() => {
   const list = type.value === ui18n.t('scene.typeRaws.2') ? meshList : cloudList
   const currentCount = ++loadCount
-  fetchScenesAll(params.value).then((data) => {
+  fetchScenesAll({...params.value, sceneName: keyword.value, }).then((data) => {
     console.log('====>', currentCount, loadCount, params.value)
     if (currentCount === loadCount) {
 
@@ -145,7 +151,7 @@ const typeFilterScenes = computed(() => {
   const typeScenes: any = {};
   for (const type of types.value) {
     typeScenes[type] = origin.value
-      .filter((item) => item.name && item.num && item.name.includes(keyword.value))
+      .filter((item) => item.name && item.num )
       .filter((item) => item.type === type);
   }
   return typeScenes;
@@ -165,12 +171,21 @@ const rowSelection: any = ref({
 
   hideSelectAll: true,
   onChange: (ids: string[]) => {
-    console.error(ids)
+    const key =  typeFilterScenes.value[type.value].map((item: any) => item.num).join('')
     ids = ids.filter(id => !selectIds.value.includes(id))
-    cache[type.value] = ids
+    if (!cache[type.value]) {
+      cache[type.value] = {}
+    }
+    cache[type.value][key] = ids
+
+
+
+
     const curIds = [...selectIds.value]
-    for (const key in cache) {
-      curIds.push(...cache[key])
+    for (const keyp in cache) {
+      for (const key in cache[keyp]) {
+        curIds.push(...cache[keyp][key])
+      }
     }
     selects.value = curIds
   },
@@ -214,19 +229,19 @@ const addModelHandler = createLoadPack(async (attachs: any[]) => {
         if (fuseModelsLoaded.value) {
           nextTick(() => {
             stop();
-            resolve();
+            setTimeout(resolve, 500)
           });
         }
       });
     });
   });
 
-  items.forEach(item => {
-    console.error('--->', item, getSceneModel(item.data), sceneModelMap)
-    if (getSceneModel(item.data)) {
-      item.data.rotation = getSceneModel(item.data)!.getDefaultRotation();
-      console.log('rotate', item.data.rotation)
+  addModels.forEach(item => {
+    if (getSceneModel(item)) {
+      item.rotation = getSceneModel(item)!.getDefaultRotation();
+      // getSceneModel(item)!.putInFrontOfCam()
     }
+
   });
   await asyncTimeout(100);
   await save();
@@ -264,6 +279,7 @@ const selectModel = async () => {
   });
   if (!list?.length) return;
   list = list.filter(item => item.uploadId)
+
   // const modelList = await Promise.all(list.map(item => uploadMaterialToModel(item.uploadId!)))
   const attachs: any[] = []
   for (let i = 0; i < list.length; i++) {

+ 0 - 1
src/sdk/association/fuseMode.ts

@@ -306,7 +306,6 @@ export const associationModels = (sdk: SDK) => {
             () => item.rotation,
             () => {
               if (!us.isUnSet) {
-                console.error('rotation', item.raw.modelTitle,  toRaw(item.rotation))
                 getSceneModel(item)?.changeRotation(toRaw(item.rotation));
               }
             }

+ 7 - 1
src/sdk/association/measure.ts

@@ -39,7 +39,13 @@ export const associationMessaure = <T extends MeasureType>(smMeasure: SceneMeasu
   smMeasure.bus.on('update', ([points, modelIds]) => {
     us.unSet(() => measure.positions = points.map((point, i) => ({ point, modelId: modelIds[i] })))
   })
-  smMeasure.bus.on('highlight', selected => us.unSet(() => measure.selected = selected))
+  let timeout: any
+  smMeasure.bus.on('highlight', selected => {
+    clearTimeout(timeout)
+    timeout = setTimeout(() => {
+      us.unSet(() => measure.selected = selected)
+    })
+  })
 }
 
 export const associationMessaures = (sdk: SDK) => {

+ 1 - 0
src/sdk/sdk.ts

@@ -52,6 +52,7 @@ export type SceneModel = ToChangeAPI<SceneModelAttrs> & {
   enterMoveMode: () => void;
   leaveTransform: () => void;
   getDefaultRotation: () => SceneLocalPos;
+  putInFrontOfCam: () => void
   enterAlignment: () => void;
   leaveAlignment: () => void;
   enterScaleSet: () => ScaleSet;

+ 1 - 0
src/utils/unset.ts

@@ -5,6 +5,7 @@ export const unsetFactory = () => {
   let isUnSet = false;
   
   const unSet = (fn: () => void) => {
+    console.error('unset')
     const pop = isStoreUnset.push(true)
     isUnSet = true;
     fn();

+ 1 - 0
src/views/tagging/hot/edit.vue

@@ -280,6 +280,7 @@ const activeStyle = computed(() => getTaggingStyle(tagging.value.styleId));
 if (!activeStyle.value && defaultStyle.value) {
   // tagging.value.styleId = defaultStyle.value.id;
 }
+console.log(activeStyle.value, defStyleType.id);
 const type = ref(activeStyle.value ? activeStyle.value.typeId : defStyleType.id);
 
 const submitHandler = () => {

+ 3 - 2
src/views/tagging/hot/style-type-select.vue

@@ -36,7 +36,7 @@ const allType = { name: ui18n.t("sys.all"), id: -1 };
 const getTypeCount = (item: any) => {
   if (item.id === allType.id) {
     return taggings.value.length;
-  } else if (item.children) {
+  } else if (item.children?.length) {
     return item.children.reduceRight((c: number, item: any) => {
       return (
         c +
@@ -58,13 +58,14 @@ const getItems = (types = styleTypes): any => {
       let count = 0;
       if (props.count) {
         count = getTypeCount(item);
+        console.log("items", item.name, count);
       }
       return {
         label: item.name + (props.count ? ` (${count}) ` : ""),
         title: item.name,
         count,
         key: item.id,
-        children: "children" in item ? getItems(item.children) : null,
+        children: item.children?.length ? getItems(item.children) : null,
       };
     })
     .filter((item) => !props.count || item.count || item.key === allType.id);