Koishi 3 роки тому
батько
коміт
76981e5e0f

+ 0 - 1
src/views/SandTable/SandTable.vue

@@ -728,7 +728,6 @@ export default {
         },
         success(res) {
           that.mapSource = res.data;
-          console.log(123123,res)
         },
       });
     },

+ 14 - 18
src/views/SandTable/component/ThreeModel1.vue

@@ -132,7 +132,6 @@ export default {
     const that = this;
     return {
       mapSource: {},
-      warScore: 60,
       pointer: false,
       jkd: null,
       ysl: null,
@@ -847,9 +846,8 @@ export default {
       this.setFanName(fan_mhs, "fan_mhs");
       rootNode.add(fan_mhs);
       this.htmlLayer[0].position = fan_mhs.position;
-      if (this.htmlLayer[0].jkd < this.warScore) {
-        this.initCylinderGeometry(fan_mhs);
-      }
+      fan_mhs.score = this.htmlLayer[0].jkd;
+      this.initCylinderGeometry(fan_mhs);
 
       // 牛首山
       let fan_nss = obj.clone(true);
@@ -857,9 +855,8 @@ export default {
       this.setFanName(fan_nss, "fan_nss");
       rootNode.add(fan_nss);
       this.htmlLayer[1].position = fan_nss.position;
-      if (this.htmlLayer[1].jkd < this.warScore) {
-        this.initCylinderGeometry(fan_nss); // 故障 显示红色圆柱
-      }
+      fan_nss.score = this.htmlLayer[1].jkd;
+      this.initCylinderGeometry(fan_nss); // 故障 显示红色圆柱
 
       // 青山
       let fan_qs = obj.clone(true);
@@ -867,9 +864,8 @@ export default {
       this.setFanName(fan_qs, "fan_qs");
       rootNode.add(fan_qs);
       this.htmlLayer[2].position = fan_qs.position;
-      if (this.htmlLayer[2].jkd < this.warScore) {
-        this.initCylinderGeometry(fan_qs);
-      }
+      fan_qs.score = this.htmlLayer[2].jkd;
+      this.initCylinderGeometry(fan_qs);
 
       // 石板泉
       let fan_sbq = obj.clone(true);
@@ -877,9 +873,8 @@ export default {
       this.setFanName(fan_sbq, "fan_sbq");
       rootNode.add(fan_sbq);
       this.htmlLayer[3].position = fan_sbq.position;
-      if (this.htmlLayer[3].jkd < this.warScore) {
-        this.initCylinderGeometry(fan_sbq);
-      }
+      fan_sbq.score = this.htmlLayer[3].jkd;
+      this.initCylinderGeometry(fan_sbq);
 
       // 香山
       let fan_xs = obj.clone(true);
@@ -887,9 +882,8 @@ export default {
       this.setFanName(fan_xs, "fan_xs");
       rootNode.add(fan_xs);
       this.htmlLayer[4].position = fan_xs.position;
-      if (this.htmlLayer[4].jkd < this.warScore) {
-        this.initCylinderGeometry(fan_xs);
-      }
+      fan_xs.score = this.htmlLayer[4].jkd;
+      this.initCylinderGeometry(fan_xs);
 
       // 改一下颜色
       this.changeObjectColor(fan_mhs, "green"); // 麻黄山
@@ -991,7 +985,7 @@ export default {
       this.setEveryHTML();
     },
     // 创建一个圆柱
-    initCylinderGeometry: function (obj, mode = "fan") {
+    initCylinderGeometry(obj, mode = "fan") {
       let cr = 1.7;
       let xyz = [5.75, 6.85, -0.63];
       switch (mode) {
@@ -1010,7 +1004,9 @@ export default {
       let geometry = new THREE.CylinderGeometry(cr, cr, 4, 128, 1, true);
       //加载纹理
       let texture = new THREE.TextureLoader().load(
-        "static/3d/beam-texture-red.png"
+        obj.score < 60
+          ? "static/3d/beam-texture-red.png"
+          : "static/3d/beam-texture.png"
       );
       texture.wrapS = texture.wrapT = THREE.RepeatWrapping; //每个都重复
       texture.repeat.set(1, 1);