lining пре 3 година
родитељ
комит
83f1c99f4f

+ 69 - 71
src/components/control/areaCard.vue

@@ -137,8 +137,8 @@
             },
         },
         methods: {
-            control(current){
-                this.current = current?current:1
+            control(current) {
+                this.current = current ? current : 1
             },
             initData: function () {
                 var mb = MessageBridge.getInstance();
@@ -148,10 +148,10 @@
                 mb.register(vss);
             },
             suggestion(msg, headers) {
-                this.titleList = msg?JSON.parse(msg):this.$store.state.suggestion
-                if(msg&&JSON.parse(msg).length>0){
-                    api.sendRecommend(this.titleList).then(res =>{
-                        if(res){
+                this.titleList = msg ? JSON.parse(msg) : this.$store.state.suggestion
+                if (msg && JSON.parse(msg).length > 0) {
+                    api.sendRecommend(this.titleList).then(res => {
+                        if (res) {
                             console.log(res);
                         }
                     })
@@ -193,83 +193,81 @@
                     this.svgWeb = arr[1];
                     this.stationName = this.boosterStation[arr[1]].name
                 } else if (arr[0] === 'CONTROL_START' || arr[0] === 'CONTROL_STOP' || arr[0] === 'CONTROL_MAINTAIN') {
-                    let windControlList=[];
+                    let windControlList = [];
                     let mss = {}
-                    for(var i=1;i<arr.length;i++){
-                        windControlList[i-1]=this.windturbinelist [arr[i]];
-                        switch (arr[0]) {
-                                case 'CONTROL_START':
-                                    //mss.controlType = '1'
-                                    windControlList[i-1].controlType = '1'
-                                    break
-                                case 'CONTROL_STOP':
-                                    //mss.controlType = '2'
-                                    windControlList[i-1].controlType = '2'
-                                    break
-                                case 'CONTROL_MAINTAIN':
-                                    //mss.controlType = '6'
-                                    windControlList[i-1].controlType = '6'
-                                    break
-                            }
-                    }
-                    /* arr.forEach(item =>{
-                        if(item === (this.windturbinelist[item]?this.windturbinelist[item].windturbineId:'')){
-                            windControlList.push(this.windturbinelist [item])
+                    arr.forEach(item => {
+                        if (item === (this.windturbinelist[item] ? this.windturbinelist[item].windturbineId : '')) {
                             switch (arr[0]) {
                                 case 'CONTROL_START':
-                                    //mss.controlType = '1'
+                                    this.windturbinelist[item].controlType = '1'
                                     break
                                 case 'CONTROL_STOP':
-                                    //mss.controlType = '2'
+                                    this.windturbinelist[item].controlType = '2'
                                     break
                                 case 'CONTROL_MAINTAIN':
-                                    //mss.controlType = '6'
+                                    this.windturbinelist[item].controlType = '6'
                                     break
                             }
+                            windControlList.push(this.windturbinelist[item])
                         }
-                    }) */
-                    //let windturbine = this.windturbinelist[arr[1]]
-                    /* switch (arr[0]) {
-                        case 'CONTROL_START':
-                            mss.controlType = '1'
-                            break
-                        case 'CONTROL_STOP':
-                            mss.controlType = '2'
-                            break
-                        case 'CONTROL_MAINTAIN':
-                            mss.controlType = '6'
-                            break
-                    } */
+                    })
+                    mss.type = 'send'
+                    this.menuClicked(mss, windControlList, 'automatic')
+                } else if (arr[0] === 'CONTROL_LOCK_OVERHAUL' || arr[0] === 'CONTROL_LOCK_MAINTAIN' || arr[0] === 'CONTROL_LOCK_LNVOLVED_OVERHAUL' ||
+                    arr[0] === 'CONTROL_LOCK_LNVOLVED_MAINTAIN' || arr[0] === 'CONTROL_LOCK_LNVOLVED_PG' || arr[0] === 'CONTROL_LOCK_LNVOLVED_WEATHER' || arr[0] === 'CONTROL_UNLOCK') {
+                    let windturbine = this.windturbinelist[arr[1]]
+                    switch (arr[0]) {
+                        case 'CONTROL_LOCK_OVERHAUL':
+                            this.menuClicked({ type: "lock", value: "CheckLock" }, windturbine);
+                            break;
+                        case 'CONTROL_LOCK_MAINTAIN':
+                            this.menuClicked({ type: "lock", value: "FaultLock" }, windturbine);
+                            break;
+                        case 'CONTROL_LOCK_LNVOLVED_OVERHAUL':
+                            this.menuClicked({ type: "lock", value: "StationCheckLock" }, windturbine);
+                            break;
+                        case 'CONTROL_LOCK_LNVOLVED_MAINTAIN':
+                            this.menuClicked({ type: "lock", value: "StationFaulLock" }, windturbine);
+                            break;
+                        case 'CONTROL_LOCK_LNVOLVED_PG':
+                            this.menuClicked({ type: "lock", value: "StationPowerLineLock" }, windturbine);
+                            break;
+                        case 'CONTROL_LOCK_LNVOLVED_WEATHER':
+                            this.menuClicked({ type: "lock", value: "StationWeatherLock" }, windturbine);
+                            break;
+                        case 'CONTROL_UNLOCK':
+                            this.menuClicked({ type: "lock", value: "UnLock" }, windturbine);
+                            break;
+                    }
+                }else if(arr[0] === 'CONTROL_SART_RECOMMENDATION'){
+                    let mss = {}
+                    mss.type = 'send'
+                    this.startList.forEach(item =>{
+                        item.controlType = '1'
+                    })
+                    this.menuClicked(mss, this.startList, 'automatic')
+                }else if(arr[0] === 'CONTROL_STOP_RECOMMENDATION'){
+                    let mss = {}
                     mss.type = 'send'
-                    this.menuClicked(mss, windControlList,true)
+                    this.stopList.forEach(item =>{
+                        item.controlType = '2'
+                    })
+                    this.menuClicked(mss, this.stopList, 'automatic')
+                }else if(arr[0] === 'CONTROL_RECOMMENDATION_ALL'){
+                    let windControlList = []
+                    let mss = {}
+                    mss.type = 'send'
+                    this.startList.forEach(item =>{
+                        item.controlType = '1'
+                        windControlList.push(item)
+                    })
+                    this.stopList.forEach(item =>{
+                        item.controlType = '2'
+                        windControlList.push(item)
+                    })
+                    console.log(windControlList);
+                    this.menuClicked(mss, windControlList, 'automatic')
                 }
-                // else if (arr[0] === 'CONTROL_LOCK_OVERHAUL' || arr[0] === 'CONTROL_LOCK_MAINTAIN' || arr[0] === 'CONTROL_LOCK_LNVOLVED_OVERHAUL' ||
-                //     arr[0] === 'CONTROL_LOCK_LNVOLVED_MAINTAIN' || arr[0] === 'CONTROL_LOCK_LNVOLVED_PG' || arr[0] === 'CONTROL_LOCK_LNVOLVED_WEATHER' || arr[0] === 'CONTROL_UNLOCK') {
-                //     let windturbine = this.windturbinelist[arr[1]]
-                //     switch (arr[0]) {
-                //         case 'CONTROL_LOCK_OVERHAUL':
-                //             this.menuClicked({ type: "lock", value: "CheckLock" }, windturbine);
-                //             break;
-                //         case 'CONTROL_LOCK_MAINTAIN':
-                //             this.menuClicked({ type: "lock", value: "FaultLock" }, windturbine);
-                //             break;
-                //         case 'CONTROL_LOCK_LNVOLVED_OVERHAUL':
-                //             this.menuClicked({ type: "lock", value: "StationCheckLock" }, windturbine);
-                //             break;
-                //         case 'CONTROL_LOCK_LNVOLVED_MAINTAIN':
-                //             this.menuClicked({ type: "lock", value: "StationFaulLock" }, windturbine);
-                //             break;
-                //         case 'CONTROL_LOCK_LNVOLVED_PG':
-                //             this.menuClicked({ type: "lock", value: "StationPowerLineLock" }, windturbine);
-                //             break;
-                //         case 'CONTROL_LOCK_LNVOLVED_WEATHER':
-                //             this.menuClicked({ type: "lock", value: "StationWeatherLock" }, windturbine);
-                //             break;
-                //         case 'CONTROL_UNLOCK':
-                //             this.menuClicked({ type: "lock", value: "UnLock" }, windturbine);
-                //             break;
-                //     }
-                // }
             },
             handleClick(values) {
                 if (values.active) {

+ 3 - 5
src/components/focus/focusCard.vue

@@ -76,7 +76,6 @@
                 this.dialogVisible = false
                 this.showSvg = false
                 this.svgWeb = ''
-                console.log(arr);
                 if (arr[0] === 'OPEN_AGC') {
                     let data = bd.Recommends
 					for(let v in data){
@@ -99,14 +98,12 @@
 				var list = new Array();
 				var arr = [],
 					thisKey = ''
-				console.log(bd.Recommends)
 				for (var v in bd.Recommends) {
 					this.arrKey.push(v);
 					thisKey += v + ',';
 				}
 				axios.get(process.env.VUE_APP_ADAPTERURL+`/ts/latest?keys=` + thisKey)
 					.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)) {
 								bd.Recommends[v].isActive = true
@@ -125,8 +122,8 @@
 			},
 			sendMsg: function (vl, index) {
 				var that = this;
+				that.timeIndex = 0;
 				that.ajaxDetail(vl, index);
-				this.timeIndex = 0;
 				that.interval = window.setInterval(function () {
 					that.ajaxDetail(vl, index);
 				}, 3000);
@@ -134,6 +131,7 @@
 				that.dialogData.stationName = vl.stationName;
 			},
 			ajaxDetail(data, index) {
+				
 				var thisKey = Photoelectric[index?this.arrKey[index] : data.values];
 				thisKey.forEach(item => {
 					if (item.value) {
@@ -194,7 +192,7 @@
 					this.timeIndex = -1;
 				}
 				this.timeIndex++;
-				console.log(this.timeIndex)
+				
 			},
 		},
 	};

+ 8 - 0
src/components/focus/multiple-line-chart.vue

@@ -8,6 +8,14 @@ import * as echarts from "echarts";
 export default {
   name: "multiple-line-chart",
   componentName: "multiple-line-chart",
+  watch: {
+    'list': {
+        deep: true,
+        handler: function (json) {
+          this.initChart()
+        }
+    }
+  },
   props: {
     width: {
       type: String,

+ 74 - 73
src/components/modeControl/modeControl.vue

@@ -78,34 +78,34 @@
                 current: 1,
                 datas: {},
                 list: {},
-                showDate:{},
+                showDate: {},
                 winFlag: 0,
                 curveFlag: 0,
                 fieldFlag: 0,
-                healthWidth: 0,
-                resourceWidth: 0,
-                windWidth: 0,
-                curveWidth: 0,
+                // healthWidth: 0,
+                // resourceWidth: 0,
+                // windWidth: 0,
+                // curveWidth: 0,
             };
         },
         created() {
             this.initData();
-            this.getData(),
-                this.refreshTimer = setInterval(this.getData, 20000);
+            // this.getData(),
+            //     this.refreshTimer = setInterval(this.getData, 20000);
         },
         computed: {
-            healthStyle() {
-                return `width: ${this.healthWidth}%;`
-            },
-            resourceStyle() {
-                return `width: ${this.resourceWidth}%;`
-            },
-            windStyle() {
-                return `width: ${this.windWidth}%;`
-            },
-            curveStyle() {
-                return `width: ${this.curveWidth}%;`
-            },
+            // healthStyle() {
+            //     return `width: ${this.healthWidth}%;`
+            // },
+            // resourceStyle() {
+            //     return `width: ${this.resourceWidth}%;`
+            // },
+            // windStyle() {
+            //     return `width: ${this.windWidth}%;`
+            // },
+            // curveStyle() {
+            //     return `width: ${this.curveWidth}%;`
+            // },
         },
         mounted() {
             // this.current = this.$props.current
@@ -142,7 +142,7 @@
                     this.ChangeBar(1)
                 }
             },
-            getEchartss(msg){
+            getEchartss(msg) {
                 let data = JSON.parse(msg)
                 data.healthIndex = Number(data.healthIndex).toFixed(0)
                 data.resourceIndex = Number(data.resourceIndex).toFixed(0)
@@ -151,10 +151,6 @@
                 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()
             },
@@ -278,40 +274,40 @@
                 option.series[0].data[2].value = Number(this.showDate.agcPowerSet);
                 myChart.setOption(option, true);
             },
-            getData() {
-                api.getOverview().then(res => {
-                    if (res) {
-                        let data = res.data
-                        if (this.datas.curveFollowingRate > data.curveFollowingRate) {
-                            this.curveFlag = 2
-                        } else if (this.datas.curveFollowingRate < data.curveFollowingRate) {
-                            this.curveFlag = 1
-                        } else {
-                            this.curveFlag = 0
-                        }
-
-                        if (this.datas.fieldElectricityRate > data.fieldElectricityRate) {
-                            this.fieldFlag = 2
-                        } else if (this.datas.fieldElectricityRate < data.fieldElectricityRate) {
-                            this.fieldFlag = 1
-                        } else {
-                            this.fieldFlag = 0
-                        }
-
-                        if (this.datas.windEnergyRate > data.windEnergyRate) {
-                            this.winFlag = 2
-                        } else if (this.datas.windEnergyRate < data.windEnergyRate) {
-                            this.winFlag = 1
-                        } else {
-                            this.winFlag = 0
-                        }
-                        data.curveFollowingRate = data.curveFollowingRate.toFixed(2)
-                        data.fieldElectricityRate = data.fieldElectricityRate.toFixed(2)
-                        data.windEnergyRate = data.windEnergyRate.toFixed(2)
-                        this.datas = data
-                    }
-                })
-            },
+            // getData() {
+            //     api.getOverview().then(res => {
+            //         if (res) {
+            //             let data = res.data
+            //             if (this.datas.curveFollowingRate > data.curveFollowingRate) {
+            //                 this.curveFlag = 2
+            //             } else if (this.datas.curveFollowingRate < data.curveFollowingRate) {
+            //                 this.curveFlag = 1
+            //             } else {
+            //                 this.curveFlag = 0
+            //             }
+
+            //             if (this.datas.fieldElectricityRate > data.fieldElectricityRate) {
+            //                 this.fieldFlag = 2
+            //             } else if (this.datas.fieldElectricityRate < data.fieldElectricityRate) {
+            //                 this.fieldFlag = 1
+            //             } else {
+            //                 this.fieldFlag = 0
+            //             }
+
+            //             if (this.datas.windEnergyRate > data.windEnergyRate) {
+            //                 this.winFlag = 2
+            //             } else if (this.datas.windEnergyRate < data.windEnergyRate) {
+            //                 this.winFlag = 1
+            //             } else {
+            //                 this.winFlag = 0
+            //             }
+            //             data.curveFollowingRate = data.curveFollowingRate.toFixed(2)
+            //             data.fieldElectricityRate = data.fieldElectricityRate.toFixed(2)
+            //             data.windEnergyRate = data.windEnergyRate.toFixed(2)
+            //             this.datas = data
+            //         }
+            //     })
+            // },
             ChangeBar(values) {
                 var bd = BackgroundData.getInstance();
                 if (!bd.LoginUser) {
@@ -329,25 +325,23 @@
                     if (values === 2) {
                         this.current = values
                         this.$router.push(`/ManualPage?current=${values}`)
-                    } else if (values === 1){
+                    } else if (values === 1) {
                         this.$store.commit('current', values)
-                        if(this.current === 0){
+                        if (this.current === 0) {
                             this.current = values
-                        }else{
+                        } else {
                             this.current = values
                             this.$router.push(`/?current=${values}`)
                         }
-                    } else if(values === 0){
+                    } else if (values === 0) {
                         this.$store.commit('current', values)
-                        if(this.current === 2){
+                        if (this.current === 2) {
                             this.current = values
                             this.$router.push(`/?current=${values}`)
-                        }else{
+                        } else {
                             this.current = values
                         }
-                        
                     }
-                    
                 }
             },
             // controls(value) {
@@ -646,19 +640,23 @@
         font-size: 18px;
         color: #ffffff;
     }
-    .numbers{
+
+    .numbers {
         margin-right: 48px;
     }
-    .numbers-right{
+
+    .numbers-right {
         margin-left: 18px;
     }
-    .showData{
+
+    .showData {
         display: flex;
         flex-direction: column;
         align-items: center;
         justify-content: center;
     }
-    .dataBox{
+
+    .dataBox {
         display: flex;
         flex-direction: column;
         width: 120px;
@@ -668,7 +666,8 @@
         margin-top: 15px;
         margin-left: 30px;
     }
-    .dataBox-right{
+
+    .dataBox-right {
         display: flex;
         flex-direction: column;
         width: 120px;
@@ -678,7 +677,8 @@
         margin-top: 15px;
         margin-right: 30px;
     }
-    .dataTitle{
+
+    .dataTitle {
         height: 50%;
         display: flex;
         flex-direction: row;
@@ -687,7 +687,8 @@
         color: rgba(153, 162, 163, 1);
         margin-left: 5px;
     }
-    .datas{
+
+    .datas {
         height: 50%;
         display: flex;
         flex-direction: row-reverse;