Selaa lähdekoodia

[Fix 0000] 地下注氮模型绑定注氮机监测框的问题修复

houzekong 1 päivä sitten
vanhempi
commit
996ba75f95

+ 4 - 1
src/views/vent/monitorManager/compressor/nitrogen.dixia.threejs.ts

@@ -66,9 +66,12 @@ class NitrogenUnderground {
             // if (i == 2) nitrogenMonitorCSS3D.position.set(-0.89, 0.31, 0.08);
             // if (i == 3) nitrogenMonitorCSS3D.position.set(-0.89, 0.31, 0.12);
             this.group.add(nitrogenMonitorCSS3D);
-          } else {
           }
         }
+        // 而如若此项超出了已绑定的注氮机数量,则隐藏或销毁
+        if (this.group && i >= this.nitrogenNum && this.group.getObjectByName('monitorNitrogenText' + i)) {
+          this.group.remove(this.group.getObjectByName('monitorNitrogenText' + i) as THREE.Object3D);
+        }
       }
     }
     if (this.group && !this.group.getObjectByName('downWindMonitor')) {