chenminghua 4 rokov pred
rodič
commit
febc73a9f3

+ 65 - 107
src/views/WindSite/pages/Info/Base-Info.vue

@@ -87,38 +87,18 @@
           </div>
           <div class="panel-body">
             <table class="table-form">
-              <tr>
-                <td class="text gray">U1绕组温度</td>
-                <td class="value green">{{ sourceMap.fdjmap && sourceMap.fdjmap.U1YZWD }}</td>
-                <td class="unit gray">℃</td>
-                <td class="text gray">V1绕组温度</td>
-                <td class="value green">{{ sourceMap.fdjmap && sourceMap.fdjmap.V1YZWD }}</td>
-                <td class="unit gray">℃</td>
-              </tr>
-              <tr>
-                <td class="text gray">W1绕组温度</td>
-                <td class="value green">{{ sourceMap.fdjmap && sourceMap.fdjmap.W1YZWD }}</td>
-                <td class="unit gray">℃</td>
-                <td class="text gray">发电机轴承A温度</td>
-                <td class="value green">{{ sourceMap.fdjmap && sourceMap.fdjmap.FDJZCAWD }}</td>
-                <td class="unit gray">℃</td>
-              </tr>
-              <tr>
-                <td class="text gray">发电机轴承B温度</td>
-                <td class="value green">{{ sourceMap.fdjmap && sourceMap.fdjmap.FDJZCBWD }}</td>
-                <td class="unit gray">℃</td>
-                <td class="text gray">发电机冷却风温度</td>
-                <td class="value green">{{ sourceMap.fdjmap && sourceMap.fdjmap.FDJLQFWD }}</td>
-                <td class="unit gray">℃</td>
-              </tr>
-              <tr>
-                <td class="text gray">发电机滑环温度</td>
-                <td class="value green">{{ sourceMap.fdjmap && sourceMap.fdjmap.FDJHHWD }}</td>
-                <td class="unit gray">℃</td>
-                <td class="text gray"></td>
-                <td class="value green"></td>
-                <td class="unit gray"></td>
-              </tr>
+              <template v-for="(item,index) in fdjmap" :key="index">
+                <tr v-for="i in fdjmap.length / 2" :key="i">
+                  <td v-if="index%2==0" class="text gray">{{ item.name }}</td>
+                  <td v-if="index%2==0" class="value green">{{ item.value }}</td>
+                  <td v-if="index%2==0" class="unit gray">{{ item.unit }}</td>
+                </tr>
+                <tr>
+                  <td v-if="index%2==1" class="text gray">{{ item.name }}</td>
+                  <td v-if="index%2==1" class="value green">{{ item.value }}</td>
+                  <td v-if="index%2==1" class="unit gray">{{ item.unit }}</td>
+                </tr>
+              </template>
             </table>
           </div>
         </div>
@@ -132,30 +112,16 @@
           </div>
           <div class="panel-body">
             <table class="table-form">
-              <tr>
-                <td class="text gray">润滑油滤网入口压力</td>
-                <td class="value green">{{ sourceMap.clxmap && sourceMap.clxmap.RHYLWRKYL }}</td>
-                <td class="unit gray">Kw</td>
-                <td class="text gray">润滑油滤网出口压力</td>
-                <td class="value green">{{ sourceMap.clxmap && sourceMap.clxmap.RHYLWCKYL }}</td>
-                <td class="unit gray">Kw</td>
-              </tr>
-              <tr>
-                <td class="text gray">齿轮箱输入轴1温度</td>
-                <td class="value green">{{ sourceMap.clxmap && sourceMap.clxmap.CLXSRZ1WD }}</td>
-                <td class="unit gray">℃</td>
-                <td class="text gray">齿轮箱输入轴2温度</td>
-                <td class="value green">{{ sourceMap.clxmap && sourceMap.clxmap.CLXSRZ2WD }}</td>
-                <td class="unit gray">℃</td>
-              </tr>
-              <tr>
-                <td class="text gray">齿轮箱油温</td>
-                <td class="value green">{{ sourceMap.clxmap && sourceMap.clxmap.CLXYW }}</td>
-                <td class="unit gray">℃</td>
-                <td class="text gray">齿轮箱入口油温</td>
-                <td class="value green">{{ sourceMap.clxmap && sourceMap.clxmap.CLXRKYW }}</td>
-                <td class="unit gray">℃</td>
-              </tr>
+              <template v-for="(item,index) in clxmap" :key="index" :v-if="index%2==0">
+                <tr>
+                  <td class="text gray">{{ item.name }}</td>
+                  <td class="value green">{{ item.value }}</td>
+                  <td class="unit gray">{{ item.unit }}</td>
+                  <td class="text gray" v-if="index+1<clxmap.length">{{clxmap[index+1].name}}</td>
+                  <td class="value green" v-if="index+1<clxmap.length">{{clxmap[index+1].value}}</td>
+                  <td class="unit gray" v-if="index+1<clxmap.length">{{clxmap[index+1].unit}}</td>
+                </tr>
+              </template>
             </table>
           </div>
         </div>
@@ -169,30 +135,16 @@
           </div>
           <div class="panel-body">
             <table class="table-form">
-              <tr>
-                <td class="text gray">U1项绕组电流</td>
-                <td class="value green">{{ sourceMap.bjmap && sourceMap.bjmap.U1YZDL }}</td>
-                <td class="unit gray">A</td>
-                <td class="text gray">U2项绕组电流</td>
-                <td class="value green">{{ sourceMap.bjmap && sourceMap.bjmap.U2YZDL }}</td>
-                <td class="unit gray">A</td>
-              </tr>
-              <tr>
-                <td class="text gray">U3项绕组电流</td>
-                <td class="value green">{{ sourceMap.bjmap && sourceMap.bjmap.U3YZDL }}</td>
-                <td class="unit gray">A</td>
-                <td class="text gray">U1项绕组电压</td>
-                <td class="value green">{{ sourceMap.bjmap && sourceMap.bjmap.U1YZDY }}</td>
-                <td class="unit gray">V</td>
-              </tr>
-              <tr>
-                <td class="text gray">U2项绕组电压</td>
-                <td class="value green">{{ sourceMap.bjmap && sourceMap.bjmap.U2YZDY }}</td>
-                <td class="unit gray">V</td>
-                <td class="text gray">U2项绕组电压</td>
-                <td class="value green">{{ sourceMap.bjmap && sourceMap.bjmap.U3YZDY }}</td>
-                <td class="unit gray">V</td>
-              </tr>
+              <template v-for="(item,index) in bjmap" :key="index" :v-if="index%2==0">
+                <tr>
+                  <td class="text gray">{{ item.name }}</td>
+                  <td class="value green">{{ item.value }}</td>
+                  <td class="unit gray">{{ item.unit }}</td>
+                  <td class="text gray" v-if="index+1<bjmap.length">{{bjmap[index+1].name}}</td>
+                  <td class="value green" v-if="index+1<bjmap.length">{{bjmap[index+1].value}}</td>
+                  <td class="unit gray" v-if="index+1<bjmap.length">{{bjmap[index+1].unit}}</td>
+                </tr>
+              </template>
             </table>
           </div>
         </div>
@@ -208,14 +160,16 @@
           </div>
           <div class="panel-body">
             <table class="table-form">
-              <tr>
-                <td class="text gray">对风角度</td>
-                <td class="value green">{{ sourceMap.phmap && sourceMap.phmap.DFJD }}</td>
-                <td class="unit gray">度</td>
-                <td class="text gray">偏航位置</td>
-                <td class="value green">{{ sourceMap.phmap && sourceMap.phmap.PHWZ }}</td>
-                <td class="unit gray">度</td>
-              </tr>
+              <template v-for="(item,index) in phmap" :key="index" :v-if="index%2==0">
+                <tr>
+                  <td class="text gray">{{ item.name }}</td>
+                  <td class="value green">{{ item.value }}</td>
+                  <td class="unit gray">{{ item.unit }}</td>
+                  <td class="text gray" v-if="index+1<phmap.length">{{phmap[index+1].name}}</td>
+                  <td class="value green" v-if="index+1<phmap.length">{{phmap[index+1].value}}</td>
+                  <td class="unit gray" v-if="index+1<phmap.length">{{phmap[index+1].unit}}</td>
+                </tr>
+              </template>
             </table>
           </div>
         </div>
@@ -229,22 +183,16 @@
           </div>
           <div class="panel-body">
             <table class="table-form">
-              <tr>
-                <td class="text gray">液压系统油压</td>
-                <td class="value green">{{ sourceMap.yymap && sourceMap.yymap.YYXTYY }}</td>
-                <td class="unit gray">Pa</td>
-                <td class="text gray">转子刹车系统液压</td>
-                <td class="value green">{{ sourceMap.yymap && sourceMap.yymap.ZZSCXTYY }}</td>
-                <td class="unit gray">Pa</td>
-              </tr>
-              <tr>
-                <td class="text gray">液压油温</td>
-                <td class="value green">{{ sourceMap.yymap && sourceMap.yymap.YYYW }}</td>
-                <td class="unit gray">℃</td>
-                <td class="text gray">液压系统油压</td>
-                <td class="value green">{{ sourceMap.yymap && sourceMap.yymap.FDJLQSWD }}</td>
-                <td class="unit gray">Pa</td>
-              </tr>
+              <template v-for="(item,index) in yymap" :key="index" :v-if="index%2==0">
+                <tr>
+                  <td class="text gray">{{ item.name }}</td>
+                  <td class="value green">{{ item.value }}</td>
+                  <td class="unit gray">{{ item.unit }}</td>
+                  <td class="text gray" v-if="index+1<yymap.length">{{yymap[index+1].name}}</td>
+                  <td class="value green" v-if="index+1<yymap.length">{{yymap[index+1].value}}</td>
+                  <td class="unit gray" v-if="index+1<yymap.length">{{yymap[index+1].unit}}</td>
+                </tr>
+              </template>
             </table>
           </div>
         </div>
@@ -272,6 +220,11 @@ export default {
   data() {
     return {
       sourceMap: {},
+      fdjmap: [],
+      clxmap: [],
+      bjmap: [],
+      phmap: [],
+      yymap: [],
       // 功率复核数据
       PowerLoad: [
         {
@@ -301,8 +254,13 @@ export default {
 
   watch: {
     data(value) {
-      this.sourceMap = value;
-    },
+      this.sourceMap = value
+      this.fdjmap = value.fdjmap.ai
+      this.clxmap = value.clxmap.ai
+      this.bjmap = value.bjmap.ai
+      this.phmap = value.phmap.ai
+      this.yymap = value.yymap.ai
+    }
   },
 };
 </script>
@@ -413,7 +371,7 @@ export default {
     .panel-title {
       display: flex;
       width: 100%;
-      background: fade(@darkgray, 40);
+      background: fade(@darkgray, 20);
       padding: 0.37vh;
       padding-left: 2.222vh;
       align-items: center;

+ 20 - 19
src/views/WindSite/pages/Info/Info.vue

@@ -22,7 +22,7 @@
           <div style="text-align:center;">
             <StandAloneImg class="sai" v-show="InfoBtns.activeIndex != 0" :activeIndex="InfoBtns.activeIndex" @selectSvg="selectSvg"></StandAloneImg>
           </div>
-          <generator class="saig" v-show="InfoBtns.activeIndex != 0"></generator>
+          <generator class="saig" v-show="InfoBtns.activeIndex != 0" :index="InfoBtns.activeIndex" :data="sourceMap"></generator>
         </el-col>
         <el-col :span="8">
           <warning :data="WarnData" />
@@ -180,7 +180,25 @@ export default {
           wtId: that.wtId,
         },
         success(res) {
-          that.sourceMap = res.data;
+          let data = res.data;
+          for(var key in data){
+            if(key.endsWith("map")){
+              let json = data[key];
+              let arrayai = [];
+              let arraydi = [];
+              for(var i = 0; i < json.length; i++){
+                let obj = {
+                  name: json[i][0],
+                  unit: json[i][1],
+                  value: json[i][3]
+                }
+                if(json[i][2] == "ai") arrayai.push(obj);
+                else arraydi.push(obj);
+              }
+              data[key] = {ai: arrayai, di: arraydi}
+            } 
+          } 
+          that.sourceMap = data;
           that.getWarnInfo();
         },
       });
@@ -200,22 +218,6 @@ export default {
         },
       });
     },
-
-    // 获取部件对应的测点信息
-    getWidgetInfo() {
-      let that = this;
-      that.API.requestData({
-        method: "POST",
-        subUrl: "monitorwt/findWtInfo",
-        data: {
-          wtId: that.wtId,
-        },
-        success(res) {
-          console.log('====' + res.data)
-        },
-      });
-    },
-
     // 点击左侧菜单
     clickMenu(res) {
       this.wtId = res.id;
@@ -232,7 +234,6 @@ export default {
         that.requestData(false);
       }, that.$store.state.websocketTimeSec);
     });
-    that.getWidgetInfo()
   },
 
   unmounted() {

+ 47 - 46
src/views/WindSite/pages/Info/pages/generator.vue

@@ -6,30 +6,16 @@
       </div>
       <div class="panel-body">
         <table class="table-form">
-          <tr>
-            <td class="text gray">U1绕组温度</td>
-            <td class="value green">90.5</td>
-            <td class="unit gray">℃</td>
-            <td class="text gray">轴承A温度</td>
-            <td class="value green">31.7</td>
-            <td class="unit gray">℃</td>
-          </tr>
-          <tr>
-            <td class="text gray">V1绕组温度</td>
-            <td class="value green">89.5</td>
-            <td class="unit gray">℃</td>
-            <td class="text gray">轴承B温度</td>
-            <td class="value green">49.9</td>
-            <td class="unit gray">℃</td>
-          </tr>
-          <tr>
-            <td class="text gray">W1绕组温度</td>
-            <td class="value green">87.3</td>
-            <td class="unit gray">℃</td>
-            <td class="text gray"></td>
-            <td class="value green"></td>
-            <td class="unit gray"></td>
-          </tr>
+          <template v-for="(item,index) in sourceMapAI" :key="index" :v-if="index%2==0">
+            <tr>
+              <td class="text gray">{{ item.name }}</td>
+              <td class="value green">{{ item.value }}</td>
+              <td class="unit gray">{{ item.unit }}</td>
+              <td class="text gray" v-if="index+1<sourceMapAI.length">{{sourceMapAI[index+1].name}}</td>
+              <td class="value green" v-if="index+1<sourceMapAI.length">{{sourceMapAI[index+1].value}}</td>
+              <td class="unit gray" v-if="index+1<sourceMapAI.length">{{sourceMapAI[index+1].unit}}</td>
+            </tr>
+          </template>
         </table>
       </div>
     </div>
@@ -39,27 +25,14 @@
       </div>
       <div class="panel-body">
         <table class="table-form">
-          <tr>
-            <td class="dot">空冷风扇保护1</td>
-            <td class="dot">空冷风扇保护1</td>
-            <td class="dot">空冷风扇保护1</td>
-            <td class="dot">空冷风扇保护1</td>
-            <td class="dot">空冷风扇保护1</td>
-          </tr>
-          <tr>
-            <td class="dot ">空冷风扇保护1</td>
-            <td class="dot ">空冷风扇保护1</td>
-            <td class="dot ">空冷风扇保护1</td>
-            <td class="dot red">空冷风扇保护1</td>
-            <td class="dot red">空冷风扇保护1</td>
-          </tr>
-          <tr>
-            <td class="dot ">空冷风扇保护1</td>
-            <td class="dot ">空冷风扇保护1</td>
-            <td class="dot ">空冷风扇保护1</td>
-            <td class="dot red">空冷风扇保护1</td>
-            <td class="dot">空冷风扇保护1</td>
-          </tr>
+          <template v-for="index in sourceMapDI" :key="index" :v-if="index%4==0">
+            <tr v-if="index < sourceMapDI.length">
+              <td class="dot" :class="sourceMapDI[index].value>0?'red':''">{{ sourceMapDI[index].name }}</td>
+              <td class="dot" :class="sourceMapDI[index+1].value>0?'red':''" v-if="index+1<sourceMapDI.length">{{sourceMapDI[index+1].name}}</td>
+              <td class="dot" :class="sourceMapDI[index+2].value>0?'red':''" v-if="index+2<sourceMapDI.length">{{sourceMapDI[index+2].name}}</td>
+              <td class="dot" :class="sourceMapDI[index+3].value>0?'red':''" v-if="index+3<sourceMapDI.length">{{sourceMapDI[index+3].name}}</td>
+            </tr>
+          </template>
         </table>
       </div>
     </div>
@@ -70,11 +43,27 @@
 export default {
   // 名称
   name: "generator",
+  props: {
+    index: {
+      type: Number,
+      default: 1,
+    },
+    data: {
+      type: Object,
+      default: () => {},
+    },
+  },
   // 使用组件
   components: {},
   // 数据
   data() {
-    return {};
+    return {
+      activeIndex: 1,
+      sourceMapAI: {},
+      sourceMapDI: {},
+      datamap: {},
+      widgetIndex: ["fdjmap", "clxmap", "bjmap", "phmap", "yymap", "jcmap", "zzmap"],
+    };
   },
   // 函数
   methods: {},
@@ -97,6 +86,18 @@ export default {
   updated() {
     // 数据更新后
   },
+  watch: {
+    index(value) {
+      this.activeIndex = value;
+      this.sourceMapAI = this.datamap[this.widgetIndex[this.activeIndex - 1]].ai;
+      this.sourceMapDI = this.datamap[this.widgetIndex[this.activeIndex - 1]].di;
+    },
+    data(value) {
+       this.datamap = value;
+       this.sourceMapAI = this.datamap[this.widgetIndex[this.activeIndex - 1]].ai;
+       this.sourceMapDI = this.datamap[this.widgetIndex[this.activeIndex - 1]].di;
+    },
+  },
 };
 </script>