Просмотр исходного кода

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

bill недель назад: 3
Родитель
Сommit
aad374bd7a

+ 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);
 

+ 4 - 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",

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

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

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

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

+ 4 - 0
src/lang/locales/zh.json

@@ -439,12 +439,16 @@
       "sizeErr": "{name}的大小超过{sizeStr}"
     },
     "viewPWD": "访问密码",
+    "上传失败,请检查文件格式。": "上传失败,请检查文件格式。",
     "其他": "其他",
     "其它物证(痕迹物证)": "其它物证(痕迹物证)",
+    "动画模型": "动画模型",
+    "图片缺失": "图片缺失",
     "尸体": "尸体",
     "工具痕迹": "工具痕迹",
     "手印痕迹": "手印痕迹",
     "提取物品": "提取物品",
+    "文件格式错误": "文件格式错误",
     "文检物证": "文检物证",
     "枪弹痕迹": "枪弹痕迹",
     "毒化物证": "毒化物证",

+ 18 - 11
src/layout/edit/scene-select.vue

@@ -37,7 +37,7 @@
             />
             <div style="padding: 1px" v-else>
               <Empty
-                :description="$t('sys.unSearchData')"
+                description="暂无搜索结果"
                 :image="Empty.PRESENTED_IMAGE_SIMPLE"
                 className="ant-empty ant-empty-normal"
               />
@@ -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;
@@ -214,19 +220,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 +270,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 = () => {