Explorar o código

Merge branch 'master' of http://49.4.49.126:3000/GYEE_R.D/neic

xushili %!s(int64=3) %!d(string=hai) anos
pai
achega
a991980307

+ 3 - 5
src/components/TitleBar.vue

@@ -194,7 +194,7 @@
               border-radius: 8px;
               border: none;
             "
-            :before-close="mainClose"
+            v-on:click="mainClose"
           >
             ×
           </button>
@@ -233,10 +233,8 @@ export default {
       done();
     },
     mainClose() {
-      const {app} = require("electron");
-      app.on("window-all-closed", () => {
-        app.quit();
-      });
+      const {remote} = require('electron');
+      remote.getCurrentWindow().destroy();
     }
   }
 };

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

@@ -47,11 +47,53 @@ 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(this.getCardValue(v));
+        } else if (v.adviceOperateStyle == "Stop") {
+          // 推荐停机
+          ll.stop.value.push(this.getCardValue(v));
+        } else if (v.adviceOperateStyle == "Reset") {
+          // 推荐复位
+          ll.reset.value.push(this.getCardValue(v));
+        } else if (v.adviceOperateStyle == "Maintain") {
+          // 推荐维护
+          ll.maintain.value.push(this.getCardValue(v));
+        }
+      }
+      this.ls=ll;
     },
+    getCardValue(val){
+        return {
+            status:0,
+            power:0,
+            windSpeed:0,
+            rollSpeed:0,
+            windturbineId:val.windturbineId,
+        }
+    }
   },
 };
 </script>

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

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

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

@@ -4,10 +4,10 @@
         <el-row>
             <div :class="leftStyle">
                 <el-row>
-                    <div :class="title1Style" style="font-size:13px;">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,7 @@
             power:Number,
             windSpeed:Number,
             rollSpeed:Number,
+            windturbineId:String,
         },
         data() {
             return {
@@ -65,6 +66,13 @@
             },
             contentStyle: function () {
                 return "card-content-style-" + this.status;
+            },
+            stationName:function () {
+                return this.windturbineId.slice(0,2);
+            },
+            windturbineName:function () {
+                var vs = this.windturbineId.split('_');
+                return vs[1];
             }
         },
         methods: {

+ 1 - 1
src/main.js

@@ -7,4 +7,4 @@ import gyCard from './components/area';
 const app = createApp(App)
 app.use(ElementPlus)
 app.use(gyCard)
-app.mount('#app')
+app.mount('#app')

+ 5 - 0
vue.config.js

@@ -1,5 +1,10 @@
 module.exports = {
     configureWebpack: {
       devtool: 'source-map'
+    },
+    pluginOptions:{
+      electronBuilder:{
+        nodeIntegration:true
+      }
     }
   }