xushining 3 years ago
parent
commit
1f4bf98608

+ 42 - 2
src/components/area/ControlArea.vue

@@ -47,11 +47,51 @@ export default {
       mb.register(vs);
     },
     windturbineMessage: function (msg) {
-      console.log(msg);
+        var val = JSON.parse(msg);
+        for(var v in this.ls){
+            var vv = this.ls[v];
+            for(var it in vv.value){
+                vv.value[it].status = val[it].status;
+            }
+        }
     },
     suggestion: function (msg) {
-      console.log(msg);
+      var val = JSON.parse(msg);
+      var ll = {
+        start: { key: "待启动", value: [] },
+        stop: { key: "待停机", value: [] },
+        maintain: { key: "待维护", value: [] },
+        unmaintain: { key: "待取消维护", value: [] },
+        reset: { key: "待复位", value: [] },
+      };
+      for (var vv in val) {
+          var v = val[vv];
+        if (v.adviceOperateStyle == "UnMaintain") {
+          // 推荐取消维护
+          ll.unmaintain.value.push(this.getCardValue(v));
+        } else if (v.adviceOperateStyle == "Start") {
+          //推荐启动
+          ll.start.value.push(v);
+        } else if (v.adviceOperateStyle == "Stop") {
+          // 推荐停机
+          ll.stop.value.push(v);
+        } else if (v.adviceOperateStyle == "Reset") {
+          // 推荐复位
+          ll.reset.value.push(v);
+        } else if (v.adviceOperateStyle == "Maintain") {
+          // 推荐维护
+          ll.maintain.value.push(v);
+        }
+      }
+      this.ls=ll;
     },
+    getCardValue(val){
+        console.log(val);
+        return {
+            status:0,
+
+        }
+    }
   },
 };
 </script>

+ 2 - 0
src/components/area/windturbine/MatrixCard.vue

@@ -9,6 +9,8 @@
         :power="vs.power"
         :windSpeed="vs.windSpeed"
         :rollSpeed="vs.rollSpeed"
+        :stationId="vs.stationId"
+        :windturbineId="vs.windturbineId"
       ></WindturbineMinCard>
     </div>
     <div class="bottom"></div>

+ 12 - 2
src/components/area/windturbine/WindturbineMinCard.vue

@@ -4,10 +4,10 @@
         <el-row>
             <div :class="leftStyle">
                 <el-row>
-                    <div :class="title1Style">SG</div>
+                    <div :class="title1Style">{{stationName}}</div>
                 </el-row>
                 <el-row>
-                    <div :class="title2Style">223</div>
+                    <div :class="title2Style">{{windturbineName}}</div>
                 </el-row>
             </div>
             <div :class="rightStyle">
@@ -33,6 +33,8 @@
             power:Number,
             windSpeed:Number,
             rollSpeed:Number,
+            stationId:String,
+            windturbineId:String,
         },
         data() {
             return {
@@ -65,6 +67,14 @@
             },
             contentStyle: function () {
                 return "card-content-style-" + this.status;
+            },
+            stationName:function () {
+                var vs = this.stationId.split('_');
+                return vs[0];
+            },
+            windturbineName:function () {
+                var vs = this.windturbineId.split('_');
+                return vs[1];
             }
         },
         methods: {