Explorar o código

[Mod 0000] 优化皮带三级防灭火模型监测弹框加载逻辑

hongrunxia hai 2 días
pai
achega
50f98907cb

+ 2 - 3
src/views/vent/home/configurable/belt/threejs/belt.threejs.ts

@@ -240,7 +240,6 @@ export async function modalAnimate(modal, modalMonitorData: Ref<any, any>) {
   }
 
   function setPartitionAnimate() {
-    if (Number(warningPartitionIndex.value) > -1) panelManager.destroyPanel(`partition${Number(warningPartitionIndex.value)}`);
     warningPartition.length = 0;
     partitionList.forEach((partition, index) => {
       const solidBox = partition.getObjectByName(partition.name + '_solid') as THREE.Mesh;
@@ -309,8 +308,8 @@ export async function modalAnimate(modal, modalMonitorData: Ref<any, any>) {
               solidBox.material.needsUpdate = true;
             },
           });
-          panelManager.destroyPanel(partition.name);
         }
+        panelManager.destroyPanel(partition.name);
       }
     }
   }
@@ -342,7 +341,7 @@ function createMonitorPanel3D(modal, partition) {
   box.setFromObject(partition);
   const center = box.getCenter(new THREE.Vector3());
   const partitionIndex = partition.name.split('_')[0];
-  const index = Number(partitionIndex.split('partition')[1]) + 1;
+  const index = Number(partitionIndex.split('partition')[1]);
   const data = modalData.value[index + ''];
   // if (partitionRefMap.has(partition.name)) {
   //   partitionRefMap.set(partition.name, ref(data));