lining преди 3 години
родител
ревизия
364d955104

+ 35 - 4
src/App.vue

@@ -1,5 +1,24 @@
 <template class="app">
   <TitleBar class="titleBar" />
+  <div class="right">
+    <el-col >
+      <el-row>
+        <el-col>
+          <ModeControl ref="modeControl" :current="current" @clicks="handleClick"></ModeControl>
+        </el-col>
+      </el-row>
+      <el-row>
+        <el-col>
+          <FocusArea />
+        </el-col>
+      </el-row>
+      <el-row>
+        <el-col>
+          <WarningArea></WarningArea>
+        </el-col>
+      </el-row>
+    </el-col>
+  </div>
   <StatusBar class="statusBar" />
   <router-view />
 </template>
@@ -7,10 +26,16 @@
   import TitleBar from 'views/TitleBar.vue'
   import StatusBar from 'views/StatusBar.vue'
   import MessageBridge from 'utils/MessageBridge'
+  import ModeControl from "components/modeControl/modeControl.vue";
+	import FocusArea from "components/focus/focusArea.vue";
+	import WarningArea from "components/warning/warningArea.vue";
   export default {
     components: {
       TitleBar,
       StatusBar,
+      ModeControl,
+      FocusArea,
+      WarningArea
     },
     created: function () {
       this.initData()
@@ -39,10 +64,10 @@
         var json = JSON.parse(msg);
         this.$store.commit('suggestion', json)
       },
-      titleInfos(msg){
-        var json = JSON.parse(msg);
-        this.$store.commit('titleInfo', json)
-      },
+      // titleInfos(msg){
+      //   var json = JSON.parse(msg);
+      //   this.$store.commit('titleInfo', json)
+      // },
     },
   }
 </script>
@@ -60,6 +85,12 @@
   /* .app{
     background-color: #000000;
   } */
+  .right{
+    width: 32%;
+    position: absolute;
+    right: 20px;
+    z-index: 99;
+  }
   .statusBar {
     width: 100%;
     position: absolute;

+ 6 - 5
src/components/control/areaCard.vue

@@ -53,12 +53,10 @@
                 type: Number,
                 default: 200,
             },
-            current: {
-                type: Number,
-            },
         },
         data() {
             return {
+                current:1,
                 windturbinelist: {},
                 titleList: [],
                 startList: [],
@@ -137,6 +135,9 @@
             },
         },
         methods: {
+            control(current){
+                this.current = current
+            },
             initData: function () {
                 var mb = MessageBridge.getInstance();
                 var vs = [{ key: "/topic/suggestion", action: this.suggestion }];
@@ -505,9 +506,9 @@
                     })
                 },
             },
-            "current": {
+            "$store.getters.current": {
                 handler: function (json) {
-                    // this.current = json
+                    this.current = json
                     if (json === 0) {
                         let dateList = []
                         this.titleList.forEach(item => {

+ 4 - 1
src/components/control/controlArea.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="problem">
-    <AreaCard title="控制区" height="60" :current="current"></AreaCard>
+    <AreaCard title="控制区" height="60" :current="current" ref="areaCard"></AreaCard>
   </div>
 </template>
 
@@ -32,6 +32,9 @@
       console.log(this.current);
     },
     methods: {
+      control(current){
+        this.$refs.areaCard.control(current)
+      }
     }
   };
 </script>

+ 1 - 1
src/components/focus/focusCard.vue

@@ -108,7 +108,7 @@
 					.then(msg => {
 						console.log(msg)
 						for (let v in msg.data) {
-							if (msg.data[v].doubleValue ? (msg.data[v].doubleValue === 0) : (!msg.data[v].booleanValue)) {
+							if (msg.data[v].doubleValue ? (msg.data[v].doubleValue > 0) : (msg.data[v].booleanValue)) {
 								bd.Recommends[v].isActive = true
 							}
 						}

+ 9 - 49
src/components/matrixBlock.vue

@@ -1,6 +1,6 @@
 <template>
     <div style="display: flex; flex-direction: row; flex-wrap: wrap;">
-        <div :class="item.active?'box-' + item.status:'unbox-' + item.status" v-for="(item, index) in showList"
+        <div :class="item.active?'box-' + item.status:'unbox-' + item.status" v-for="(item, index) in dataList"
             :key="index" @click="onSelectHandler(item)" @dblclick="sendMsg(item)" style="margin-right: 15px;">
             <div :class="item.active?'left-' + item.status:'unleft-' + item.status">
                 <div>{{ item.windturbineId.slice(0, 2) }}</div>
@@ -9,18 +9,9 @@
             <div :class="item.active?'right-' + item.status:'unright-' + item.status">
                 <div class="rightrow">{{ item.windSpeed.toFixed(2) }} m/s</div>
                 <div class="rightrow">{{ item.power.toFixed(2) }} kw</div>
-                <div class="rightrow">{{ (item.modelId.indexOf("105") >= 0)?(item.rollSpeed *
-                    9.55).toFixed(2):item.rollSpeed.toFixed(2) }} rpm</div>
-            </div>
-            <div v-if="item.lockValue > 0">
-                <el-popover placement="bottom-start" :width="130" trigger="hover" class="popoverBack"
-                    :show-arrow="false">
-                    <template #reference>
-                        <img class="lock" src="../assets/img/type/lock.png" alt="">
-                    </template>
-                    <div>挂牌原因:{{item.locked}}</div>
-                </el-popover>
+                <div class="rightrow">{{ (item.modelId.indexOf("105") >= 0)?(item.rollSpeed * 9.55).toFixed(2):item.rollSpeed.toFixed(2) }} rpm</div>
             </div>
+            <!-- <img v-if="item.lockValue > 0" class="lock" src="../assets/img/type/lock.png" alt=""> -->
         </div>
     </div>
     <WindturbineDetailPages v-model="dialogVisible" :showSvg="showSvg" @close="handleClose"
@@ -42,42 +33,13 @@
             area: String,
         },
         mounted() {
-            this.dataDeal(this.dataList)
+            this.dataList.forEach(item => {
+                if (item.modelId.indexOf("105") >= 0) {
+                    item.rollSpeed *= 9.55;
+                }
+            })
         },
         methods: {
-            dataDeal(dataList) {
-                let list = []
-                dataList&&dataList.forEach(item => {
-                    if (item.modelId.indexOf("105") >= 0) {
-                        item.rollSpeed *= 9.55;
-                    }
-                    switch (item.lockValue) {
-                        case 2:
-                            item.locked = '场内受累检修'
-                            break;
-                        case 3:
-                            item.locked = '场内受累故障'
-                            break;
-                        case 4:
-                            item.locked = '场外受累电网'
-                            break;
-                        case 5:
-                            item.locked = '场外受累天气'
-                            break;
-                        case 7:
-                            item.locked = '故障检修'
-                            break;
-                        case 8:
-                            item.locked = '检修'
-                            break;
-                        case 9:
-                            item.locked = '未知'
-                            break;
-                    }
-                    list.push(item)
-                })
-                this.showList = list
-            },
             onSelectHandler(values) {
                 if (this.area === 'problem') {
                     this.$emit('problem-click', values);
@@ -101,20 +63,18 @@
                 dialogVisible: false,
                 showSvg: false,
                 currentWindturbine: {},
-                showList:[]
             };
         },
     }
 </script>
 <style scoped>
-    .lock {
+    .lock{
         width: 10px;
         height: 10px;
         position: relative;
         right: 6px;
         top: -15px;
     }
-
     .box-0 {
         width: 135px;
         height: 50px;

+ 49 - 35
src/components/modeControl/modeControl.vue

@@ -29,8 +29,8 @@
             <div id="mainEcharts" class="echarts"></div>
             <div class="dataShows">
                 <div class="number">
-                    <div class="numbers-right">88%</div>
-                    <div class="dataName-right">{{showDate.windEnergyRate}}%</div>
+                    <div class="numbers-right">{{showDate.windEnergyRate}}%</div>
+                    <div class="dataName-right">风能利用率</div>
                 </div>
                 <div class="progress-right">
                     <div class="progressNum-right" :style="windStyle"></div>
@@ -60,9 +60,9 @@
     import * as echarts from "echarts";
     export default {
         props: {
-            current: {
-                type: Number,
-            },
+            // current: {
+            //     type: Number,
+            // },
         },
         data() {
             return {
@@ -99,7 +99,7 @@
             },
         },
         mounted() {
-            this.current = this.$props.current
+            // this.current = this.$props.current
             this.$nextTick(() => {
                 if (document.getElementById('mainEcharts')) {
                     this.getEcharts()
@@ -110,7 +110,7 @@
             initData() {
                 var mb = MessageBridge.getInstance();
                 var vss = [{ key: "/topic/voice-control", action: this.windturbineMessage }];
-                var vs = [{ key: "/topic/title-info", action: this.getEcharts }];
+                var vs = [{ key: "/topic/title-info", action: this.getEchartss }];
                 mb.register(vs);
                 mb.register(vss);
             },
@@ -133,17 +133,23 @@
                     this.ChangeBar(1)
                 }
             },
-            getEcharts(msg) {
-                let data = msg ? JSON.parse(msg) : this.$store.state.titleInfo
-                if (Object.keys(data).length>0) {
-                    data.healthIndex = Number(data.healthIndex).toFixed(2)
-                    data.resourceIndex = Number(data.resourceIndex).toFixed(2)
-                    data.realTimePower = data.realTimePower.toFixed(2)
-                    data.theoreticalPower = data.theoreticalPower.toFixed(2)
-                    data.agcPowerSet = data.agcPowerSet.toFixed(2)
-                    data.windEnergyRate = data.windEnergyRate.toFixed(2)
-                    data.curveFollowingRate = data.curveFollowingRate.toFixed(2)
-                }
+            getEchartss(msg){
+                let data = JSON.parse(msg)
+                data.healthIndex = Number(data.healthIndex).toFixed(0)
+                data.resourceIndex = Number(data.resourceIndex).toFixed(0)
+                data.realTimePower = data.realTimePower.toFixed(2)
+                data.theoreticalPower = data.theoreticalPower.toFixed(2)
+                data.agcPowerSet = data.agcPowerSet.toFixed(2)
+                data.windEnergyRate = data.windEnergyRate.toFixed(2)
+                data.curveFollowingRate = data.curveFollowingRate.toFixed(2)
+                this.healthWidth= (data.healthIndex/4000)*100
+                this.resourceWidth= (data.resourceIndex/4000)*100
+                this.windWidth= data.windEnergyRate
+                this.curveWidth= data.curveFollowingRate
+                this.showDate = data
+                this.getEcharts()
+            },
+            getEcharts() {
                 var chartDom = document.getElementById('mainEcharts');
                 var myChart = echarts.init(chartDom, '#000000');
                 var option;
@@ -257,14 +263,9 @@
                         }
                     }]
                 };
-                option.series[0].data[0].value = Number(data.realTimePower);
-                option.series[0].data[1].value = Number(data.theoreticalPower);
-                option.series[0].data[2].value = Number(data.agcPowerSet);
-                this.healthWidth= (data.healthIndex/4000)*100
-                this.resourceWidth= (data.resourceIndex/4000)*100
-                this.windWidth= data.windEnergyRate
-                this.curveWidth= data.curveFollowingRate
-                this.showDate = data
+                option.series[0].data[0].value = Number(this.showDate.realTimePower);
+                option.series[0].data[1].value = Number(this.showDate.theoreticalPower);
+                option.series[0].data[2].value = Number(this.showDate.agcPowerSet);
                 myChart.setOption(option, true);
             },
             getData() {
@@ -315,20 +316,33 @@
                     return;
                 }
                 if (this.current !== values) {
-                    if ((this.current === 0 && values === 1) || (this.current === 1 && values === 0)) {
+                    if (values === 2) {
                         this.current = values
-                        this.$emit('clicks', values);
-                    } else if (values === 2 && this.current !== 2) {
                         this.$router.push(`/ManualPage?current=${values}`)
-                        // this.current = values
-                    } else {
-                        this.$router.push(`/?current=${values}`)
+                    } else if (values === 1){
+                        this.$store.commit('current', values)
+                        if(this.current === 0){
+                            this.current = values
+                        }else{
+                            this.current = values
+                            this.$router.push(`/?current=${values}`)
+                        }
+                    } else if(values === 0){
+                        this.$store.commit('current', values)
+                        if(this.current === 2){
+                            this.current = values
+                            this.$router.push(`/?current=${values}`)
+                        }else{
+                            this.current = values
+                        }
+                        
                     }
+                    
                 }
             },
-            controls(value) {
-                this.current = value
-            }
+            // controls(value) {
+            //     this.current = value
+            // }
         },
     }
 </script>

+ 1 - 0
src/components/problem/areaCard.vue

@@ -450,6 +450,7 @@
                             this.listedList.push(val)
                         }
                     }
+                    console.log(this.faultList);
                 },
             },
         },

+ 8 - 1
src/store/index.js

@@ -9,6 +9,7 @@ const store = createStore({
                warning: Object,
                suggestion: [],
                titleInfo: Object,
+               current: Number,
           }
      },
 
@@ -17,6 +18,9 @@ const store = createStore({
           windturbinelist(state) {
                return state.windturbinelist;
           },
+          current(state) {
+               return state.current;
+          },
      },
 
      // 数据更新 使用: this.$store.commit('函数名','val')
@@ -32,7 +36,10 @@ const store = createStore({
           },
           titleInfo(state, data) {
                state.titleInfo = data;
-          }
+          },
+          current(state, data) {
+               state.current = data;
+          },
      }
 })
 

+ 6 - 4
src/views/CenterPage.vue

@@ -8,7 +8,7 @@
 				<el-col :span="8" style="padding-left: 5px;padding-right: 5px;">
 					<el-row>
 						<el-col :span="24">
-							<ControlArea  :current="current"/>
+							<ControlArea ref="controlArea"  :current="current"/>
 						</el-col>
 					</el-row>
 					<el-row>
@@ -17,7 +17,7 @@
 						</el-col>
 					</el-row>
 				</el-col>
-				<el-col :span="8">
+				<!-- <el-col :span="8">
 					<el-row>
 						<el-col :span="23">
 							<ModeControl ref="modeControl" :current="current" @clicks="handleClick"></ModeControl>
@@ -33,7 +33,7 @@
 							<WarningArea></WarningArea>
 						</el-col>
 					</el-row>
-				</el-col>
+				</el-col> -->
 				
 			</el-row>
 			<!-- <WindturbineDetailPages v-model="dialogVisible"></WindturbineDetailPages> -->
@@ -71,8 +71,9 @@
 		},
 		mounted() {
 			const { current } = this.$route.query
+			current?this.$store.commit('current', Number(current)):''
 			this.current = current?Number(current):1
-			this.$refs.modeControl.controls(this.current)
+			this.$refs.controlArea.control(Number(current))
 		},
 		methods: {
 			initData: function () {
@@ -92,5 +93,6 @@
 <style scoped>
 	.homePage {
 		height: 87%;
+		z-index: 2;
 	}
 </style>

+ 2 - 2
src/views/ManualPage.vue

@@ -14,7 +14,7 @@
                         </el-col>
                     </el-row>
                 </el-col>
-                <el-col :span="8">
+                <!-- <el-col :span="8">
                     <el-row>
                         <el-col :span="23">
                             <ModeControl :current="current"></ModeControl>
@@ -30,7 +30,7 @@
                             <WarningArea></WarningArea>
                         </el-col>
                     </el-row>
-                </el-col>
+                </el-col> -->
             </el-row>
             <!-- <WindturbineDetailPages v-model="dialogVisible"></WindturbineDetailPages> -->
         </div>

+ 1 - 1
src/views/TitleBar.vue

@@ -36,7 +36,7 @@
           </el-dialog>
         </div>
       </el-col>
-      <el-col :span="19" style="margin-left: 20px;">
+      <el-col :span="19" style="margin-left: 60px;">
         <div class="titleinfoall">
           <div class="titleinfo">
             <ul>