浏览代码

[Feat 0000] 风门、风窗、局扇、主扇支持了模型缩略图查看功能

houzekong 2 天之前
父节点
当前提交
0d8979d531

+ 4 - 1
src/views/vent/monitorManager/fanLocalMonitor/fanLocal.threejs.ts

@@ -3,6 +3,7 @@ import UseThree from '../../../../utils/threejs/useThree';
 
 import { animateCamera } from '/@/utils/threejs/util';
 import useEvent from '../../../../utils/threejs/useEvent';
+import { useModelFileStore } from '/@/store/modules/modelFile';
 import { getDictItemsByCode } from '/@/utils/dict';
 
 /** 模型总控制器 */
@@ -129,7 +130,9 @@ export function mountedThree(sceneSelctor: string, cssSelectors: string[]) {
     }
 
     // 这里根据字典判断
-    const dictCodes = getDictItemsByCode('fanlocal_install_kind');
+    const store = useModelFileStore();
+    const storeData = store.getModelFileDataByKey('fanlocal');
+    const dictCodes = storeData.length ? storeData.map((item) => ({ ...item, value: item.fileName })) : getDictItemsByCode('fanlocal_install_kind');
     if (dictCodes && dictCodes.length > 0) {
       for (let i = 0; i < dictCodes.length; i++) {
         const dict = dictCodes[i];

+ 3 - 2
src/views/vent/monitorManager/gateMonitor/gate.threejs.ts

@@ -870,11 +870,12 @@ export const mountedThree = () => {
     model.renderer.toneMappingExposure = 0.9;
     model.camera.position.set(100, 0, 1000);
     const store = useModelFileStore();
-    const dictCodes = store.getModelFileDataByKey('gate').length ? store.getModelFileDataByKey('gate') : getDictItemsByCode('gateStyle');
+    const storeData = store.getModelFileDataByKey('gate');
+    const dictCodes = storeData.length ? storeData.map((item) => ({ ...item, value: item.fileName })) : getDictItemsByCode('gateStyle');
     if (dictCodes && dictCodes.length > 0) {
       for (let i = 0; i < dictCodes.length; i++) {
         const dict = dictCodes[i];
-        switch (dict.fileName) {
+        switch (dict.value) {
           case 'fmXr':
             const FmXR = await loadModel('FmXR');
             fmXr = new FmXR(model);

+ 4 - 1
src/views/vent/monitorManager/mainFanMonitor/main.threejs.ts

@@ -7,6 +7,7 @@ import mainLjWindRect from './mainWind.lj.threejs';
 import mainWindLj3 from './mainWind.li3.threejs';
 import mainWindLjDt from './mainWind.lidt.threejs';
 import useEvent from '../../../../utils/threejs/useEvent';
+import { useModelFileStore } from '/@/store/modules/modelFile';
 import { getDictItemsByCode } from '/@/utils/dict';
 
 // import * as dat from 'dat.gui';
@@ -749,7 +750,9 @@ export const mountedThree = (playerVal1) => {
       model?.scene?.add(bgGroup);
 
       // 这里根据字典判断
-      const dictCodes = getDictItemsByCode('mainFanType');
+      const store = useModelFileStore();
+      const storeData = store.getModelFileDataByKey('fanmain');
+      const dictCodes = storeData.length ? storeData.map((item) => ({ ...item, value: item.fileName })) : getDictItemsByCode('mainFanType');
       if (dictCodes && dictCodes.length > 0) {
         for (let i = 0; i < dictCodes.length; i++) {
           const dict = dictCodes[i];

+ 4 - 1
src/views/vent/monitorManager/windowMonitor/window.threejs.ts

@@ -17,6 +17,7 @@ import ddFc_lt from './dandaoFcLt.threejs';
 import SdFcZhq from './shuangdaoFcZhq.threejs';
 import { animateCamera } from '/@/utils/threejs/util';
 import useEvent from '../../../../utils/threejs/useEvent';
+import { useModelFileStore } from '/@/store/modules/modelFile';
 import { getDictItemsByCode } from '/@/utils/dict';
 
 // import * as dat from 'dat.gui';
@@ -426,7 +427,9 @@ export const mountedThree = () => {
     model.renderer.toneMappingExposure = 1.8;
     model.camera.position.set(100, 0, 1000);
     // 根据模型类型判断要初始化哪些模型
-    const dictCodes = getDictItemsByCode('windowModalType');
+    const store = useModelFileStore();
+    const storeData = store.getModelFileDataByKey('windows');
+    const dictCodes = storeData.length ? storeData.map((item) => ({ ...item, value: item.fileName })) : getDictItemsByCode('windowModalType');
     for (let i = 0; i < dictCodes.length; i++) {
       const dict = dictCodes[i];