lining vor 3 Jahren
Ursprung
Commit
d24c2d1698

+ 11 - 2
src/api/index.js

@@ -25,10 +25,10 @@ const refreshData = (keys) => {
     });
 };
 //风机控制
-const windturbControl = (isLockOrUnlock,pairs) => {
+const windturbControl = (isLockOrUnlock,pairs,test) => {
     return request({
         baseURL:process.env.VUE_APP_API,
-        url: `/api/control/send?isLockOrUnlock=${isLockOrUnlock}`,
+        url: `/api/control/send?isLockOrUnlock=${isLockOrUnlock}&test=${test}`,
         method: "post",
         data:pairs
     });
@@ -63,6 +63,14 @@ const sendRecommend = (data) => {
         data:data
     });
 };
+const getPower = (data) => {
+    return request({
+        baseURL:process.env.VUE_APP_ADAPTERURL,
+        url: `/ts/history/snap?tagName=${data.tagName}&startTs=${data.startTs}&endTs=${data.endTs}`,
+        method: "get",
+    });
+};
+
 export default {
     login,
     getSnap,
@@ -72,4 +80,5 @@ export default {
     getOverview,
     sendWarning,
     sendRecommend,
+    getPower,
 };

+ 5 - 1
src/components/BasicInformationDetail.vue

@@ -162,7 +162,9 @@
       this.getWarning()
     },
     beforeUpdate() {
-      
+      this.getDetial()
+      this.getHealthDate()
+      this.getWarning()
     },
 
     data() {
@@ -569,6 +571,7 @@
             los,
             true,
             '',
+            '',
             this.controlSuccess,
             this.controlError
           );
@@ -581,6 +584,7 @@
             vs,
             false,
             '',
+            '',
             this.controlSuccess,
             this.controlError
           );

+ 9 - 1
src/components/WindturbineDetailPages.vue

@@ -205,7 +205,6 @@
 
 		methods: {
 			opened() {
-
 				this.line = "";
 				this.alarmTime = "";
 				this.alarmContent = "";
@@ -269,6 +268,15 @@
 					});
 			},
 		},
+		watch:{
+			'windturbine': {
+                handler: function (json) {
+                    if (json) {
+                        this.initData()
+                    }
+                }
+            }
+		}
 	};
 </script>
 <style scoped>

+ 2 - 11
src/components/areaCard.vue

@@ -156,7 +156,6 @@
         },
         methods: {
             handleClick(values) {
-                console.log(this.chooseList, values)
                 if (values.active) {
                     let showIndex = null
                     this.chooseList.forEach((item, index) => {
@@ -267,16 +266,7 @@
             },
             menuClicked(msg) {
                 var bd = BackgroundData.getInstance();
-                if (!bd.LoginUser) {
-                    this.$notify({
-                        title: "请登录",
-                        message: "控制风机需要先登录!",
-                        type: "warning",
-                        position: "bottom-right",
-                        offset: 60,
-                    });
-                    return;
-                }
+                
                 if (msg.type == "lock") {
                     // 挂牌
                     var los = this.getSelectedItems();
@@ -300,6 +290,7 @@
                         vs,
                         false,
                         '',
+                        '',
                         this.controlSuccess,
                         this.controlError
                     );

+ 300 - 133
src/components/control/areaCard.vue

@@ -16,6 +16,16 @@
                         <MatrixBlock @on-click="handleDetial" @choose-click="handleClick" :dataList="stopList">
                         </MatrixBlock>
                     </div>
+                    <div class="matrix" v-if="maintainList.length>0">
+                        <div class="problemTitle">维护</div>
+                        <MatrixBlock @on-click="handleDetial" @choose-click="handleClick" :dataList="maintainList">
+                        </MatrixBlock>
+                    </div>
+                    <div class="matrix" v-if="unMaintainList.length>0">
+                        <div class="problemTitle">取消维护</div>
+                        <MatrixBlock @on-click="handleDetial" @choose-click="handleClick" :dataList="unMaintainList">
+                        </MatrixBlock>
+                    </div>
                 </div>
             </el-scrollbar>
         </div>
@@ -58,17 +68,23 @@
         },
         data() {
             return {
+                testsIndex: 0,
+                testIndex: 0,
                 current: 1,
+                vss: {},
                 windturbinelist: {},
                 titleList: [],
                 startList: [],
                 stopList: [],
+                maintainList: [],
+                unMaintainList: [],
                 chooseList: [],
                 sendList: [],
                 currentWindturbine: {},
                 dialogVisible: false,
                 showSvg: false,
                 showFlag: false,
+                postData: false,
                 svgWeb: '',
                 stationName: '',
                 // 定时器
@@ -128,7 +144,8 @@
                     'HZJ_SYZ': {
                         name: '海子井升压站'
                     },
-                }
+                },
+                indexsss: 0,
             }
         },
         computed: {
@@ -138,136 +155,175 @@
         },
         methods: {
             control(current) {
-                this.current = current ? current : 1
+                this.current = current === 0?current:current === 1?current:1
             },
             initData: function () {
                 var mb = MessageBridge.getInstance();
+                mb.unregister({ key: "/topic/suggestion"});
                 var vs = [{ key: "/topic/suggestion", action: this.suggestion }];
                 var vss = [{ key: "/topic/voice-control", action: this.windturbineMessage }];
+                this.vss = vss
                 mb.register(vs);
                 mb.register(vss);
             },
             suggestion(msg, headers) {
+                let bd = BackgroundData.getInstance();
                 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);
-                        }
-                    })
+                    if (bd.LoginUser) {
+                        this.postData = true
+                    }
                 }
                 if (this.current === 0) {
+                    console.log(this);
                     let dateList = []
                     this.titleList.forEach(item => {
-                        item.operateStyle === 'Start' ? this.windturbinelist[item.windturbineId].controlType = 1 : this.windturbinelist[item.windturbineId].controlType = 2
-                        dateList.push(this.windturbinelist[item.windturbineId])
+                        if (item.windturbineId.slice(0, 2) === 'NG') {
+                            switch (item.operateStyle) {
+                                case 'Start':
+                                    this.windturbinelist[item.windturbineId].controlType = 1
+                                    break;
+                                case 'Stop':
+                                    this.windturbinelist[item.windturbineId].controlType = 2
+                                    break;
+                                case 'Maintain':
+                                    this.windturbinelist[item.windturbineId].controlType = 6
+                                    break;
+                                case 'UnMaintain':
+                                    this.windturbinelist[item.windturbineId].controlType = 8
+                                    break;
+                            }
+                            dateList.push(this.windturbinelist[item.windturbineId])
+                        }
                     })
                     let mss = {}
                     mss.type = 'send'
                     this.timer = setTimeout(() => {
-                        this.menuClicked(mss, dateList, 'automatic')
+                        this.sendCommand(mss, dateList, 'automatic')
                         this.showFlag = false
                         clearInterval(this.timer);
                     }, 3000);
                 }
             },
             windturbineMessage(msg) {
-                let arr = []
-                if (msg === 'CLOSE') {
-                    arr.push(msg)
-                } else {
-                    arr = msg.split('-')
-                }
-                this.dialogVisible = false
-                this.showSvg = false
-                this.svgWeb = ''
-                console.log(arr);
-                if (arr[0] === 'OPEN_FJ') {
-                    this.currentWindturbine = this.windturbinelist[arr[1]]
-                    this.dialogVisible = true;
-                } else if (arr[0] === 'CLOSE') {
+                if (this.$store.state.current === 1 || this.$store.state.current === 0) {
+                    let arr = []
+                    if (msg === 'CLOSE') {
+                        arr.push(msg)
+                    } else {
+                        arr = msg.split('-')
+                    }
                     this.dialogVisible = false
-                } else if (arr[0] === 'OPEN_SYZ') {
-                    this.showSvg = true
-                    this.dialogVisible = true
-                    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 mss = {}
-                    arr.forEach(item => {
-                        if (item === (this.windturbinelist[item] ? this.windturbinelist[item].windturbineId : '')) {
-                            switch (arr[0]) {
-                                case 'CONTROL_START':
-                                    this.windturbinelist[item].controlType = '1'
-                                    break
-                                case 'CONTROL_STOP':
-                                    this.windturbinelist[item].controlType = '2'
-                                    break
-                                case 'CONTROL_MAINTAIN':
-                                    this.windturbinelist[item].controlType = '6'
-                                    break
+                    this.showSvg = false
+                    this.svgWeb = ''
+                    console.log(arr);
+                    if (arr[0] === 'OPEN_FJ') {
+                        this.currentWindturbine = this.windturbinelist[arr[1]]
+                        setTimeout(() => {
+                            this.dialogVisible = true;
+                        }, 500);
+                    } else if (arr[0] === 'CLOSE') {
+                        this.dialogVisible = false
+                    } else if (arr[0] === 'OPEN_SYZ') {
+                        this.showSvg = true
+                        this.dialogVisible = true
+                        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' || arr[0] === 'CONTROL_UNMAINTAIN') {
+                        let windControlList = [];
+                        let mss = {}
+                        arr.forEach(item => {
+                            if (item === (this.windturbinelist[item] ? this.windturbinelist[item].windturbineId : '')) {
+                                switch (arr[0]) {
+                                    case 'CONTROL_START':
+                                        this.windturbinelist[item].controlType = '1'
+                                        break
+                                    case 'CONTROL_STOP':
+                                        this.windturbinelist[item].controlType = '2'
+                                        break
+                                    case 'CONTROL_MAINTAIN':
+                                        this.windturbinelist[item].controlType = '6'
+                                        break
+                                    case 'CONTROL_UNMAINTAIN':
+                                        this.windturbinelist[item].controlType = '8'
+                                        break
+                                }
+                                windControlList.push(this.windturbinelist[item])
                             }
-                            windControlList.push(this.windturbinelist[item])
+                        })
+                        mss.type = 'send'
+                        this.testIndex++
+                        this.sendCommand(mss, windControlList, 'automatic')
+                        // 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]]
+                        this.testIndex++
+                        switch (arr[0]) {
+                            case 'CONTROL_LOCK':
+                                this.menuClicked({ type: "lock", value: "Lock" }, windturbine);
+                                break;
+                            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;
                         }
-                    })
-                    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.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)
+                        })
+                        this.maintainList.forEach(item => {
+                            item.controlType = '6'
+                            windControlList.push(item)
+                        })
+                        this.unMaintainList.forEach(item => {
+                            item.controlType = '8'
+                            windControlList.push(item)
+                        })
+                        console.log(windControlList);
+                        this.menuClicked(mss, windControlList, 'automatic')
                     }
-                }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.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')
                 }
+
             },
             handleClick(values) {
                 if (values.active) {
@@ -283,6 +339,8 @@
                 }
                 this.startList.forEach(item => { if (item.windturbineId === values.windturbineId) { item.active = !item.active } })
                 this.stopList.forEach(item => { if (item.windturbineId === values.windturbineId) { item.active = !item.active } })
+                this.maintainList.forEach(item => { if (item.windturbineId === values.windturbineId) { item.active = !item.active } })
+                this.unMaintainList.forEach(item => { if (item.windturbineId === values.windturbineId) { item.active = !item.active } })
             },
             handleDetial(itm) {
                 this.dialogVisible = true;
@@ -300,7 +358,7 @@
             /* 右键菜单 */
             contextmenu() {
                 const { remote } = require("electron");
-                var that = this;
+                let that = this;
                 const menuTemplate = [
                     {
                         label: "发送",
@@ -365,7 +423,7 @@
             },
 
             menuClicked(msg, windturbine, automatic) {
-                var bd = BackgroundData.getInstance();
+                let bd = BackgroundData.getInstance();
                 if (!bd.LoginUser) {
                     this.$notify({
                         title: "请登录",
@@ -379,17 +437,30 @@
                 }
 
                 if (msg.type == "lock") {
+                    let sendList = []
                     // 挂牌
-                    this.chooseList.forEach(item => {
-                        item.lockType = msg.value;
-                    })
-                    bd.windturbineControl(
-                        this.chooseList,
-                        true,
-                        '',
-                        this.controlSuccess,
-                        this.controlError
-                    );
+                    if (windturbine) {
+                        windturbine.lockType = msg.value;
+                        sendList.push(windturbine)
+                    } else {
+                        this.chooseList.forEach(item => {
+                            item.lockType = msg.value;
+                        })
+                        sendList = this.chooseList
+                    }
+                    if (sendList.length > 0) {
+                        let showss = ''
+                        this.testsIndex++
+                        showss = String(this.testsIndex) + String(this.testIndex)
+                        bd.windturbineControl(
+                            sendList,
+                            true,
+                            '',
+                            showss,
+                            this.controlSuccess,
+                            this.controlError
+                        );
+                    }
                 } else if (msg.type == "send") {
                     // 发送
                     let sendList = []
@@ -405,11 +476,18 @@
                                 item.controlType = 1
                             } else if (item.operateStyle === "Stop") {
                                 item.controlType = 2
+                            } else if (item.operateStyle === "Maintain") {
+                                item.controlType = 6
+                            } else if (item.operateStyle === "UnMaintain") {
+                                item.controlType = 8
                             }
                         })
                         sendList = this.chooseList
                     }
                     this.showFlag = true
+                    this.testsIndex++
+                    let showss = ''
+                    showss = String(this.testsIndex) + String(this.testIndex)
                     if (sendList.length > 0) {
                         bd.checkout(sendList);
                         if (automatic) {
@@ -417,6 +495,7 @@
                                 sendList,
                                 false,
                                 'automatic',
+                                showss,
                                 this.controlSuccess,
                                 this.controlError
                             );
@@ -425,6 +504,7 @@
                                 sendList,
                                 false,
                                 '',
+                                '',
                                 this.controlSuccess,
                                 this.controlError
                             );
@@ -432,11 +512,48 @@
                     }
                 } else if (msg.type == "marking") {
                     // 标注
-                    var vvs = this.getSelectedItems();
+                    let vvs = this.getSelectedItems();
                     bd.marking(vvs);
                 }
                 this.clearSelected();
             },
+            sendCommand(msg, windturbine, automatic) {
+                let bd = BackgroundData.getInstance();
+                if (!bd.LoginUser) {
+                    this.$notify({
+                        title: "请登录",
+                        message: "控制风机需要先登录!",
+                        type: "warning",
+                        position: "bottom-right",
+                        offset: 60,
+                        duration: 3000,
+                    });
+                    return;
+                }
+                let sendList = windturbine
+                if (sendList.length > 0) {
+                    bd.checkout(sendList);
+                    let pairs = {}
+                    sendList.forEach(item => {
+                        let ct = {
+                            windturbineId: item.windturbineId,
+                            stationId: item.stationId,
+                            projectId: item.projectId,
+                            modelId: item.modelId,
+                            controlType: item.controlType,
+                            lockType: item.lockType,
+                            userName: `system_${bd.LoginUser.name}`,
+                            userId: 0,
+                        };
+                        pairs[ct.windturbineId] = ct;
+                    })
+                    api.windturbControl(false, pairs, '1').then(res => {
+                        if (res) {
+                            this.controlSuccess(res)
+                        }
+                    })
+                }
+            },
             clearSelected() {
                 this.startList.forEach(item => {
                     item.active = false
@@ -448,24 +565,23 @@
             },
             /* 控制成功 */
             controlSuccess(msg) {
-                var bd = BackgroundData.getInstance();
+                let bd = BackgroundData.getInstance();
                 console.log(msg);
                 if (msg.data || msg.data !== {}) {
-                    var mss = '';     // 信息
-                    var iserror = false;// 是否有控制错误的风机
-                    for (var v in msg.data) {
-                        var val = msg.data[v];
+                    let mss = '';     // 信息
+                    let iserror = false;// 是否有控制错误的风机
+                    for (let v in msg.data) {
+                        let val = msg.data[v];
                         if (val.errorCode > 0) {
                             iserror = true;
                             mss += `${val.windturbineId}  ${this.controlErorCodes[val.errorCode]}\n`;
                         }
                     }
-                    var tp = iserror ? "warning" : "success";
-                    var dt = iserror ? 0 : 4500;
+                    let tp = iserror ? "warning" : "success";
+                    let dt = iserror ? 0 : 4500;
                     if (!iserror) {
                         mss = "控制成功";
                     }
-
                     this.$notify({
                         title: "控制",
                         message: mss,
@@ -507,8 +623,10 @@
                     let arr = Object.keys(json).sort()
                     this.stopList = []
                     this.startList = []
-                    for (var id of arr) {
-                        var val = json[id];
+                    this.maintainList = []
+                    this.unMaintainList = []
+                    for (let id of arr) {
+                        let val = json[id];
                         this.chooseList.forEach(item => {
                             if (item.windturbineId === val.windturbineId) {
                                 val.active = true
@@ -522,28 +640,62 @@
                                 } else if (item.operateStyle === "Stop" && val.status === 4) {
                                     this.stopList.push(val)
                                 }
+                                else if (item.operateStyle === "Maintain" && val.status === 2) {
+                                    this.maintainList.push(val)
+                                }
+                                else if (item.operateStyle === "UnMaintain" && val.status === 6) {
+                                    this.unMaintainList.push(val)
+                                }
                             }
                         })
                     }
+                    if (this.postData && (this.current === 1)) {
+                        let postList = [...this.startList, ...this.stopList]
+                        api.sendRecommend(postList).then(res => {
+                            if (res) {
+
+                            }
+                        })
+                    }
+                    this.postData = false
                     let checkoutList = BackgroundData.getInstance().checkouts;
                     checkoutList.forEach(item => {
-                        let showIndex = null
+                        let starIndex = null
+                        let stopIndex = null
+                        let maintainIndex = null
+                        let unMaintainIndex = null
                         let starFlag = false
                         let stopFlag = false
+                        let maintainFlag = false
+                        let unMaintainFlag = false
                         this.startList.forEach((param, index) => {
                             if (item.windturbineId === param.windturbineId) {
-                                showIndex = index
+                                starIndex = index
                                 starFlag = true
                             }
                         })
                         this.stopList.forEach((param, index) => {
                             if (item.windturbineId === param.windturbineId) {
-                                showIndex = index
+                                stopIndex = index
                                 stopFlag = true
                             }
                         })
-                        starFlag ? this.startList.splice(showIndex, 1) : '';
-                        stopFlag ? this.stopList.splice(showIndex, 1) : '';
+                        this.maintainList.forEach((param, index) => {
+                            if (item.windturbineId === param.windturbineId) {
+                                maintainIndex = index
+                                maintainFlag = true
+                            }
+                        })
+                        this.unMaintainList.forEach((param, index) => {
+                            if (item.windturbineId === param.windturbineId) {
+                                unMaintainIndex = index
+                                unMaintainFlag = true
+                            }
+                        })
+                        starFlag ? this.startList.splice(starIndex, 1) : '';
+                        stopFlag ? this.stopList.splice(stopIndex, 1) : '';
+                        maintainFlag ? this.maintainList.splice(maintainIndex, 1) : '';
+                        unMaintainFlag ? this.unMaintainList.splice(unMaintainIndex, 1) : '';
                     })
                 },
             },
@@ -553,13 +705,28 @@
                     if (json === 0) {
                         let dateList = []
                         this.titleList.forEach(item => {
-                            item.operateStyle === 'Start' ? this.windturbinelist[item.windturbineId].controlType = 1 : this.windturbinelist[item.windturbineId].controlType = 2
-                            dateList.push(this.windturbinelist[item.windturbineId])
+                            if (item.windturbineId.slice(0, 2) === 'NG') {
+                                switch (item.operateStyle) {
+                                    case 'Start':
+                                        this.windturbinelist[item.windturbineId].controlType = 1
+                                        break;
+                                    case 'Stop':
+                                        this.windturbinelist[item.windturbineId].controlType = 2
+                                        break;
+                                    case 'Maintain':
+                                        this.windturbinelist[item.windturbineId].controlType = 6
+                                        break;
+                                    case 'UnMaintain':
+                                        this.windturbinelist[item.windturbineId].controlType = 8
+                                        break;
+                                }
+                                dateList.push(this.windturbinelist[item.windturbineId])
+                            }
                         })
                         let mss = {}
                         mss.type = 'send'
                         this.timer = setTimeout(() => {
-                            this.menuClicked(mss, dateList, 'automatic')
+                            this.sendCommand(mss, dateList, 'automatic')
                             this.showFlag = false
                             clearInterval(this.timer);
                         }, 3000);
@@ -617,7 +784,7 @@
 
     .matrix {
         margin-left: 20px;
-        margin-right: 10px;
+        /* margin-right: 10px; */
         padding-bottom: 20px;
         border-bottom: 1px solid rgba(31, 31, 31, 1);
     }

+ 122 - 76
src/components/control/controlAllArea.vue

@@ -192,77 +192,89 @@
                 })
                 console.log(this.showList);
             },
-            /* 右键菜单 */
+
             initData: function () {
                 var mb = MessageBridge.getInstance();
                 var vss = [{ key: "/topic/voice-control", action: this.windturbineMessage }];
                 mb.register(vss);
             },
             windturbineMessage(msg) {
-                let arr = []
-                if (msg === 'CLOSE') {
-                    arr.push(msg)
-                } else {
-                    arr = msg.split('-')
-                }
-                this.dialogVisible = false
-                this.showSvg = false
-                this.svgWeb = ''
-                console.log(arr);
-                if (arr[0] === 'OPEN_FJ') {
-                    this.currentWindturbine = this.windturbinelist[arr[1]]
-                    this.dialogVisible = true;
-                } else if (arr[0] === 'CLOSE') {
+                if (this.$store.state.current === 2) {
+                    let arr = []
+                    if (msg === 'CLOSE') {
+                        arr.push(msg)
+                    } else {
+                        arr = msg.split('-')
+                    }
                     this.dialogVisible = false
-                } else if (arr[0] === 'OPEN_SYZ') {
-                    this.showSvg = true
-                    this.dialogVisible = true
-                    this.svgWeb = arr[1];
-                } else if (arr[0] === 'CONTROL_START' || arr[0] === 'CONTROL_STOP' || arr[0] === 'CONTROL_MAINTAIN') {
-                    let mss = {}
-                    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
+                    this.showSvg = false
+                    this.svgWeb = ''
+                    console.log(arr);
+                    if (arr[0] === 'OPEN_FJ') {
+                        this.currentWindturbine = this.windturbinelist[arr[1]]
+                        this.dialogVisible = true;
+                    } else if (arr[0] === 'CLOSE') {
+                        this.dialogVisible = false
+                    } else if (arr[0] === 'OPEN_SYZ') {
+                        this.showSvg = true
+                        this.dialogVisible = true
+                        this.svgWeb = arr[1];
+                    } else if (arr[0] === 'CONTROL_START' || arr[0] === 'CONTROL_STOP' || arr[0] === 'CONTROL_MAINTAIN') {
+                        let windControlList = [];
+                        let mss = {}
+                        arr.forEach(item => {
+                            if (item === (this.windturbinelist[item] ? this.windturbinelist[item].windturbineId : '')) {
+                                switch (arr[0]) {
+                                    case 'CONTROL_START':
+                                        this.windturbinelist[item].controlType = '1'
+                                        break
+                                    case 'CONTROL_STOP':
+                                        this.windturbinelist[item].controlType = '2'
+                                        break
+                                    case 'CONTROL_MAINTAIN':
+                                        this.windturbinelist[item].controlType = '6'
+                                        break
+                                    case 'CONTROL_UNMAINTAIN':
+                                        this.windturbinelist[item].controlType = '8'
+                                        break
+                                }
+                                windControlList.push(this.windturbinelist[item])
+                            }
+                        })
+                        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;
+                        }
                     }
-                    mss.type = 'send'
-                    this.menuClicked(mss, windturbine)
                 }
-                // 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;
-                //     }
-                // }
+
             },
+            /* 右键菜单 */
             contextmenu() {
                 const remote = require('electron').remote;
                 var that = this;
@@ -419,7 +431,7 @@
                 menu.popup(remote.getCurrentWindow());
             },
 
-            menuClicked(msg, windturbine) {
+            menuClicked(msg, windturbine, automatic) {
                 var bd = BackgroundData.getInstance();
                 if (!bd.LoginUser) {
                     this.$notify({
@@ -434,14 +446,35 @@
                 }
                 if (msg.type == "lock") {
                     // 挂牌
-                    this.chooseList.forEach(item => {
-                        item.lockType = msg.value;
-                    })
-                    bd.windturbineControl(this.chooseList, true, '',);
+                    let sendList = []
+                    // 挂牌
+                    if (windturbine) {
+                        windturbine.lockType = msg.value;
+                        sendList.push(windturbine)
+                    } else {
+                        this.chooseList.forEach(item => {
+                            item.lockType = msg.value;
+                        })
+                        sendList = this.chooseList
+                    }
+
+                    if (sendList.length > 0) {
+                        bd.windturbineControl(
+                            sendList,
+                            true,
+                            '',
+                            '',
+                            this.controlSuccess,
+                            this.controlError
+                        );
+                    }
                 } else if (msg.type == "send") {
                     // 发送
                     let sendList = []
-                    if (windturbine) {
+                    if (automatic) {
+                        sendList = windturbine
+                    }
+                    else if (windturbine) {
                         windturbine.controlType = msg.controlType
                         sendList.push(windturbine)
                     } else {
@@ -450,15 +483,28 @@
                         })
                         sendList = this.chooseList
                     }
-
-                    bd.checkout(sendList);
-                    bd.windturbineControl(
-                        sendList,
-                        false,
-                        '',
-                        this.controlSuccess,
-                        this.controlError
-                    );
+                    if (sendList.length > 0) {
+                        bd.checkout(sendList);
+                        if (automatic) {
+                            bd.windturbineControl(
+                                sendList,
+                                false,
+                                'automatic',
+                                '',
+                                this.controlSuccess,
+                                this.controlError
+                            );
+                        } else {
+                            bd.windturbineControl(
+                                sendList,
+                                false,
+                                '',
+                                '',
+                                this.controlSuccess,
+                                this.controlError
+                            );
+                        }
+                    }
                 } else if (msg.type == "marking") {
                     // 标注
                     bd.marking(this.chooseList);

+ 14 - 9
src/components/focus/PhotoelectricDetailPages.vue

@@ -11,38 +11,38 @@
 			<div class="dataList">
 				<div class="data">
 					<div class="name">{{data.PowerSet.name}}:</div>
-					<div class="num">{{data.PowerSet.value?data.PowerSet.value:''}}</div>
+					<div class="num">{{data.PowerSet?.value}}</div>
 					<div class="unit">MW</div>
 				</div>
 				<div class="data">
 					<div class="name">{{data.TheoryPower.name}}:</div>
-					<div class="num">{{data.TheoryPower.value?data.TheoryPower.value:''}}</div>
+					<div class="num">{{data.TheoryPower?.value}}</div>
 					<div class="unit">MW</div>
 				</div>
 				<div class="data">
 					<div class="name">{{data.AgcLower.name}}:</div>
-					<div class="num">{{data.AgcLower.value?data.AgcLower.value:''}}</div>
+					<div class="num">{{data.AgcLower?.value}}</div>
 					<div class="unit">MW</div>
 				</div>
 				<div class="data">
 					<div class="name">{{data.ActualPower.name}}:</div>
-					<div class="num">{{data.ActualPower.value?data.ActualPower.value:''}}</div>
+					<div class="num">{{data.ActualPower?.value}}</div>
 					<div class="unit">MW</div>
 				</div>
 				<div class="data">
 					<div class="name">{{data.AgcUp.name}}:</div>
-					<div class="num">{{data.AgcUp.value?data.AgcUp.value:''}}</div>
+					<div class="num">{{data.AgcUp?.value}}</div>
 					<div class="unit">MW</div>
 				</div>
 				<div class="data">
 					<div class="name">{{data.ForecastPower.name}}:</div>
-					<div class="num">{{data.ForecastPower.value?data.ForecastPower.value:''}}</div>
+					<div class="num">{{data.ForecastPower?.value}}</div>
 					<div class="unit">MW</div>
 				</div>
 			</div>
 			<div class="condition">
 				<div class="status">
-					<div class="name">{{data.AgcIn.name}}:{{data.AgcIn.value}}</div>
+					<div class="name">{{data.AgcIn.name}}:</div>
 					<img v-if="data.AgcIn.value === 0" class="statusIcon"
 						src="../../assets/img/controlcenter/daraTrue.png">
 					<img v-else-if="data.AgcIn.value === 1" class="statusIcon"
@@ -82,9 +82,10 @@
 					</div>
 				</div>
 			</div>
+			<!-- <button @click='ChangeColors()'>测试按钮</button> -->
 			<!-- <div id="main" class="echartsBox"></div> -->
 			<MultipleLineChart height="400px" :units="powerLineChartData.units" :list="powerLineChartData.value"
-				:showLegend="true" />
+				 :showLegend="true" />
 		</div>
 	</el-dialog>
 </template>
@@ -115,6 +116,7 @@
 					units: [""],
 					value: [],
 				},
+				colors: ["rgba(75, 85, 174, 1)", "rgba(05, 187, 76, 1)"],
 				timeData: [],
 				PowerSet: [],
 				ActualPower: [],
@@ -126,6 +128,9 @@
 			closed() {
 				//勿删,传递关闭方法
 			},
+			ChangeColors() {
+				this.colors = ["#aa2116", "#fcaf17"]
+			},
 			initData(PowerSet, ActualPower) {
 				// this.chartData.units = ["(MW)", "(MW)"];
 				this.chartData.value[0] = {
@@ -255,4 +260,4 @@
 		height: 14px;
 		margin-left: 8px;
 	}
-</style>
+</style>

+ 51 - 53
src/components/focus/focusCard.vue

@@ -60,33 +60,33 @@
 			this.initData();
 		},
 		methods: {
-			datacontrol(){
+			datacontrol() {
 				var mb = MessageBridge.getInstance();
-                var vss = [{ key: "/topic/voice-control", action: this.windturbineMessage }];
-                mb.register(vss);
+				var vss = [{ key: "/topic/voice-control", action: this.windturbineMessage }];
+				mb.register(vss);
 			},
 			windturbineMessage(msg) {
 				var bd = BackgroundData.getInstance();
-                let arr = []
-                if (msg === 'CLOSE') {
-                    arr.push(msg)
-                } else {
-                    arr = msg.split('-')
-                }
-                this.dialogVisible = false
-                this.showSvg = false
-                this.svgWeb = ''
-                if (arr[0] === 'OPEN_AGC') {
-                    let data = bd.Recommends
-					for(let v in data){
-						if(arr[1] === data[v].stationID){
+				let arr = []
+				if (msg === 'CLOSE') {
+					arr.push(msg)
+				} else {
+					arr = msg.split('-')
+				}
+				this.dialogVisible = false
+				this.showSvg = false
+				this.svgWeb = ''
+				if (arr[0] === 'OPEN_AGC' && arr[1] !== 'GS') {
+					let data = bd.Recommends
+					for (let v in data) {
+						if (arr[1] === data[v].stationID) {
 							this.sendMsg(data[v])
 						}
 					}
-                } else if (arr[0] === 'CLOSE') {
-                    this.dialogVisible = false
-                } 
-            },
+				} else if (arr[0] === 'CLOSE') {
+					this.dialogVisible = false
+				}
+			},
 			closed() {
 				clearInterval(this.interval);
 			},
@@ -99,10 +99,9 @@
 				var arr = [],
 					thisKey = ''
 				for (var v in bd.Recommends) {
-					this.arrKey.push(v);
 					thisKey += v + ',';
 				}
-				axios.get(process.env.VUE_APP_ADAPTERURL+`/ts/latest?keys=` + thisKey)
+				axios.get(process.env.VUE_APP_ADAPTERURL + `/ts/latest?keys=` + thisKey)
 					.then(msg => {
 						for (let v in msg.data) {
 							if (msg.data[v].doubleValue ? (msg.data[v].doubleValue > 0) : (msg.data[v].booleanValue)) {
@@ -114,7 +113,7 @@
 								list.push(bd.Recommends[rec])
 							}
 						}
-						list.forEach(item =>{
+						list.forEach(item => {
 							item.createTime = dayjs(item.createTime).format('YYYY-MM-DD HH:mm:ss')
 						})
 						this.values = list
@@ -131,47 +130,46 @@
 				that.dialogData.stationName = vl.stationName;
 			},
 			ajaxDetail(data, index) {
-				
-				var thisKey = Photoelectric[index?this.arrKey[index] : data.values];
-				thisKey.forEach(item => {
-					if (item.value) {
-						var calc = item.calc ? item.calc : 1;
-						axios.get(process.env.VUE_APP_ADAPTERURL+`/ts/latest?keys=` + item.value)
-							.then(msg => {
-								var msgData = msg.data[item.value];
-								var val = msgData ? msgData.doubleValue ? (msgData.doubleValue * calc).toFixed(2) : (msgData.booleanValue ? 1 : 0) : '';
-								this.dialogData.data[item.tag] = {
-									name: item.name,
-									value: val
-								}
-							})
-					} else {
-						this.dialogData.data[item.tag] = {
-							name: item.name,
-							value: ''
+				let thisKey = Photoelectric[data.values];
+				console.log(thisKey)
+				let array = []
+				thisKey.forEach(item => { item.value ? array.push(item.value) : '' })
+				let params = array.join(',')
+				axios.get(process.env.VUE_APP_ADAPTERURL + `/ts/latest?keys=` + params)
+					.then(res => {
+						if (res) {
+							console.log(res, this.dialogData.data, thisKey);
+							for (let v in res.data) {
+								thisKey.forEach(item => {
+									let calc = item.calc ? item.calc : 1;
+									if (item.value === v) {
+										this.dialogData.data[item.tag] = {
+											name: item.name,
+											value: res.data[v].doubleValue ? res.data[v].doubleValue === 0 ? '0' : (res.data[v].doubleValue * calc).toFixed(2) : (res.data[v].booleanValue ? 1 : 0)
+										}
+										console.log(this.dialogData.data);
+									}
+								})
+							}
 						}
-					}
-				})
+					})
 				if (this.timeIndex == 0) {//一分钟执行一次
 					var date = new Date()
 					var endTs = date.getTime();
 					var starTs = endTs - 28800000;
-
 					const PowerSet = thisKey.find(ele => {
 						return ele.tag == 'PowerSet'
 					});
-
 					const ActualPower = thisKey.find(ele => {
 						return ele.tag == 'ActualPower'
 					});
 					var PowerSetData = [],
 						ActualPowerData = [];
-					axios.get(process.env.VUE_APP_ADAPTERURL+`/ts/history/snap?tagName=` + PowerSet.value + '&startTs=' +
+					axios.get(process.env.VUE_APP_ADAPTERURL + `/ts/history/snap?tagName=` + PowerSet.value + '&startTs=' +
 						starTs +
 						'&endTs=' + endTs).then(res1 => {
-							axios.get(process.env.VUE_APP_ADAPTERURL+`/ts/history/snap?tagName=` + ActualPower.value +
+							axios.get(process.env.VUE_APP_ADAPTERURL + `/ts/history/snap?tagName=` + ActualPower.value +
 								'&startTs=' + starTs + '&endTs=' + endTs).then(res2 => {
-
 									res1.data.forEach(item => {
 										PowerSetData.push({
 											ts: item.ts,
@@ -187,12 +185,10 @@
 									this.$refs.photo.initData(PowerSetData, ActualPowerData);
 								});
 						});
-
 				} else if (this.timeIndex == 20) {
 					this.timeIndex = -1;
 				}
 				this.timeIndex++;
-				
 			},
 		},
 	};
@@ -209,11 +205,12 @@
 		background-repeat: no-repeat;
 		color: #ffffff;
 	} */
-	.imgs{
+	.imgs {
 		/* width: 70px;
 		height: 66px; */
 	}
-	.area{
+
+	.area {
 		display: flex;
 		flex-direction: column;
 		font-size: 12px;
@@ -222,7 +219,8 @@
 		align-items: center;
 		margin-bottom: 10px;
 	}
-	.content{
+
+	.content {
 		margin-top: -70px;
 		width: 25px;
 		height: 34px;

+ 266 - 438
src/components/focus/multiple-line-chart.vue

@@ -3,470 +3,298 @@
 </template>
 
 <script>
-import * as echarts from "echarts";
+  import * as echarts from "echarts";
 
-export default {
-  name: "multiple-line-chart",
-  componentName: "multiple-line-chart",
-  watch: {
-    'list': {
+  export default {
+    name: "multiple-line-chart",
+    componentName: "multiple-line-chart",
+    watch: {
+      'list': {
         deep: true,
         handler: function (json) {
           this.initChart()
         }
-    }
-  },
-  props: {
-    width: {
-      type: String,
-      default: "100%",
+      }
     },
-    height: {
-      type: String,
-      default: "13.889vh",
+    props: {
+      width: {
+        type: String,
+        default: "100%",
+      },
+      height: {
+        type: String,
+        default: "13.889vh",
+      },
+      // 数据
+      list: {
+        type: Array,
+        default: () => [
+          {
+            title: "有功设定限值(MW)",
+            yAxisIndex: 0,
+            value: [],
+          },
+          {
+            title: "实发有功(MW)",
+            yAxisIndex: 0,
+            value: [],
+          },
+        ],
+      },
+      colors: {
+        type: Array,
+        default: () => ["rgba(75, 85, 174, 1)", "rgba(05, 187, 76, 1)"]
+      },
+      // 单位
+      units: {
+        type: Array,
+        default: () => ["(MW)", "(风速)"],
+      },
+      showLegend: {
+        type: Boolean,
+        default: false,
+      },
+      hoverType: {
+        type: String,
+        default: "item",
+      },
     },
-    // 数据
-    list: {
-      type: Array,
-      default: () => [
-        {
-          title: "日发电量",
-          yAxisIndex: 0,
-          value: [
-            {
-              text: "1",
-              value: 1,
-            },
-            {
-              text: "2",
-              value: 2,
-            },
-            {
-              text: "3",
-              value: 1,
-            },
-            {
-              text: "4",
-              value: 4,
-            },
-            {
-              text: "5",
-              value: 6,
-            },
-            {
-              text: "6",
-              value: 2,
-            },
-            {
-              text: "7",
-              value: 3,
-            },
-            {
-              text: "8",
-              value: 8,
-            },
-            {
-              text: "9",
-              value: 3,
-            },
-            {
-              text: "10",
-              value: 2,
-            },
-            {
-              text: "11",
-              value: 5,
-            },
-            {
-              text: "12",
-              value: 8,
-            },
-            {
-              text: "13",
-              value: 3,
-            },
-            {
-              text: "14",
-              value: 9,
-            },
-            {
-              text: "15",
-              value: 3,
-            },
-            {
-              text: "16",
-              value: 2,
-            },
-            {
-              text: "17",
-              value: 1,
-            },
-            {
-              text: "18",
-              value: 3,
-            },
-            {
-              text: "19",
-              value: 4,
-            },
-            {
-              text: "20",
-              value: 9,
-            },
-            {
-              text: "21",
-              value: 2,
-            },
-            {
-              text: "22",
-              value: 1,
-            },
-            {
-              text: "23",
-              value: 2,
-            },
-            {
-              text: "24",
-              value: 3,
-            },
-            {
-              text: "25",
-              value: 3,
-            },
-            {
-              text: "26",
-              value: 4,
-            },
-            {
-              text: "27",
-              value: 9,
-            },
-            {
-              text: "28",
-              value: 7,
-            },
-            {
-              text: "29",
-              value: 4,
-            },
-            {
-              text: "30",
-              value: 1,
-            },
-            {
-              text: "31",
-              value: 2,
-            },
-          ],
-        },
-        {
-          title: "上网电量",
-          yAxisIndex: 0,
-          value: [
-            {
-              text: "1",
-              value: 1,
-            },
-            {
-              text: "2",
-              value: 2,
-            },
-            {
-              text: "3",
-              value: 1,
-            },
-            {
-              text: "4",
-              value: 3,
-            },
-          ],
-        },
-        {
-          title: "购网电量",
-          yAxisIndex: 0,
-          value: [
-            {
-              text: "1",
-              value: 1,
-            },
-          ],
-        },
-        {
-          title: "风速",
-          yAxisIndex: 1,
-          value: [
-            {
-              text: "1",
-              value: 100,
-            },
-            {
-              text: "2",
-              value: 200,
+    data() {
+      return {
+        id: "",
+        chart: null,
+        // colors: ["#ffffff", "#ffffff"],
+      };
+    },
+    computed: {
+      datas() {
+        return this.list.map((t) => {
+          return t.value;
+        });
+      },
+      legend() {
+        return this.list.map((t) => {
+          return t.title;
+        });
+      },
+      xdata() {
+        if (this.list.length > 0)
+          return this.list[0].value.map((t) => {
+            return t.text;
+          });
+        return [];
+      },
+      series() {
+        let result = [];
+        this.list.forEach((value, index) => {
+          result.push({
+            name: value.title,
+            type: "line",
+            smooth: true,
+            showSymbol: false,
+            zlevel: index,
+            lineStyle: {
+              normal: {
+                color: this.colors[index],
+                width: 1,
+              },
             },
-            {
-              text: "1",
-              value: 100,
+            itemStyle: {
+              normal: {
+                color: this.colors[index],
+              },
             },
-            {
-              text: "2",
-              value: 400,
+            tooltip: {
+              show: true,
+              position: [10, 10],
             },
-          ],
-        },
-      ],
-    },
-    // 单位
-    units: {
-      type: Array,
-      default: () => ["(MW)", "(风速)"],
-    },
-    showLegend: {
-      type: Boolean,
-      default: false,
-    },
-    hoverType: {
-      type: String,
-      default: "item",
-    },
-  },
-  data() {
-    return {
-      id: "",
-      chart: null,
-      color: ["#05bb4c", "#1D6AEB"],
-    };
-  },
-  computed: {
-    datas() {
-      return this.list.map((t) => {
-        return t.value;
-      });
-    },
-    legend() {
-      return this.list.map((t) => {
-        return t.title;
-      });
-    },
-    xdata() {
-      if (this.list.length > 0)
-        return this.list[0].value.map((t) => {
-          return t.text;
+            yAxisIndex: value.yAxisIndex,
+            data: value.value.map((t) => {
+              return t.value;
+            }),
+          });
         });
-      return [];
-    },
-    series() {
-      let result = [];
 
-      this.list.forEach((value, index) => {
-        result.push({
-          name: value.title,
-          type: "line",
-          smooth: true,
-          showSymbol: false,
-          zlevel: index,
-          lineStyle: {
-            normal: {
-              color: this.color[index],
-              width: 1,
+        return result;
+      },
+      yAxis() {
+        let result = [];
+        this.units.forEach((value, index) => {
+          result.push({
+            type: "value",
+            name: value,
+            axisLabel: {
+              formatter: "{value}",
+              fontSize: 14,
             },
-            // emphasis: {
-            //   color: this.color[index],
-            // },
-          },
-          // areaStyle: {
-          //   normal: {
-          //     color:
-          //       index == 0
-          //         ? new echarts.graphic.LinearGradient(
-          //             0,
-          //             0,
-          //             0,
-          //             1,
-          //             [
-          //               {
-          //                 offset: 0,
-          //                 color: this.hexToRgba(this.color[index], 0.3),
-          //               },
-          //               {
-          //                 offset: 1,
-          //                 color: this.hexToRgba(this.color[index], 0.1),
-          //               },
-          //             ],
-          //             false
-          //           )
-          //         : "transparent",
-          //     shadowColor: this.hexToRgba(this.color[index], 0.1),
-          //     shadowBlur: 10,
-          //   },
-          //   emphasis: {
-          //     color: new echarts.graphic.LinearGradient(
-          //       0,
-          //       0,
-          //       0,
-          //       1,
-          //       [
-          //         {
-          //           offset: 0,
-          //           color: this.hexToRgba(this.color[index], 0.3),
-          //         },
-          //         {
-          //           offset: 1,
-          //           color: this.hexToRgba(this.color[index], 0.1),
-          //         },
-          //       ],
-          //       false
-          //     ),
-          //     shadowColor: this.hexToRgba(this.color[index], 0.1),
-          //     shadowBlur: 10,
-          //   },
-          // },
-          tooltip: {
-            show: true,
-            position: [10, 10],
-          },
-          yAxisIndex: value.yAxisIndex,
-          data: value.value.map((t) => {
-            return t.value;
-          }),
-        });
-      });
-
-      return result;
-    },
-    yAxis() {
-      let result = [];
-      this.units.forEach((value, index) => {
-        result.push({
-          type: "value",
-          name: value,
-          axisLabel: {
-            formatter: "{value}",
-            fontSize: 14,
-          },
-          axisLine: {
-            show: false,
-          },
-          //分格线
-          splitLine: {
-            show: index == 0,
-            lineStyle: {
-              color: '#606769',
-              type: "dashed",
+            axisLine: {
+              show: false,
             },
-          },
+            //分格线
+            splitLine: {
+              show: index == 0,
+              lineStyle: {
+                color: '#606769',
+                type: "dashed",
+              },
+            },
+          });
         });
-      });
 
-      return result;
+        return result;
+      },
     },
-  },
-  methods: {
-    hexToRgba(hex, opacity) {
-      let rgbaColor = "";
-      let reg = /^#[\da-f]{6}$/i;
-      if (reg.test(hex)) {
-        rgbaColor = `rgba(${parseInt("0x" + hex.slice(1, 3))},${parseInt("0x" + hex.slice(3, 5))},${parseInt("0x" + hex.slice(5, 7))},${opacity})`;
-      }
-      return rgbaColor;
-    },
-    resize() {},
-    initChart() {
-      let chart = echarts.init(this.$el);
+    methods: {
+      hexToRgba(hex, opacity) {
+        let rgbaColor = "";
+        let reg = /^#[\da-f]{6}$/i;
+        if (reg.test(hex)) {
+          rgbaColor = `rgba(${parseInt("0x" + hex.slice(1, 3))},${parseInt("0x" + hex.slice(3, 5))},${parseInt("0x" + hex.slice(5, 7))},${opacity})`;
+        }
+        return rgbaColor;
+      },
+      resize() { },
+      initChart() {
+        let chart = echarts.init(this.$el);
 
-      let option = {
-        color: this.color,
-        tooltip: {
-          trigger: this.hoverType,
-          axisPointer:
-            this.hoverType != "item"
-              ? {
+        let option = {
+          color: this.colors,
+          tooltip: {
+            trigger: this.hoverType,
+            axisPointer:
+              this.hoverType != "item"
+                ? {
                   type: "cross",
                 }
-              : {},
-          backgroundColor: "rgba(0,0,0,0.4)",
-          borderColor: '#606769',
-          textStyle: {
-            fontSize: 16,
-            color: "#fff",
+                : {},
+            backgroundColor: "rgba(0,0,0,0.4)",
+            borderColor: '#606769',
+            textStyle: {
+              fontSize: 16,
+              color: "#4B55AE",
+            },
           },
-        },
-        legend: {
-          show: this.showLegend,
-          data: this.legend,
-          right: 56,
-          icon: "circle",
-          itemWidth: 6,
-          inactiveColor: '#606769',
-          textStyle: {
-            color: '#B3BDC0',
-            fontSize: 12,
+          legend: {
+            show: this.showLegend,
+            data: this.legend,
+            right: 56,
+            icon: "circle",
+            itemWidth: 6,
+            inactiveColor: '#606769',
+            textStyle: {
+              color: '#B3BDC0',
+              fontSize: 12,
+            },
           },
-        },
-        grid: {
-          top: 32,
-          left: 40,
-          right: 40,
-          bottom: 24,
-        },
-        xAxis: [
-          {
-            type: "category",
-            boundaryGap: false,
-            axisLabel: {
-              interval:60,
-              showMinLabel: true,
-              showMaxLabel: true,
-              formatter: "{value}",
-              fontSize: 14,
-              textStyle: {
-                color: '#606769',
+          grid: {
+            top: 32,
+            left: 40,
+            right: 40,
+            bottom: 24,
+          },
+          xAxis: [
+            {
+              type: "category",
+              boundaryGap: false,
+              axisLabel: {
+                interval: 60,
+                showMinLabel: true,
+                showMaxLabel: true,
+                formatter: "{value}",
+                fontSize: 14,
+                textStyle: {
+                  color: '#606769',
+                },
               },
+              axisLine: {
+                show: false,
+              },
+              data: this.xdata,
             },
-            axisLine: {
-              show: false,
-            },
-            data: this.xdata,
-          },
-        ],
-        yAxis: this.yAxis,
-        series: this.series,
-      };
-      chart.clear();
-      chart && option && chart.setOption(option);
-      this.resize = function() {
+          ],
+          yAxis: this.yAxis,
+          series: this.series,
+          // series: [
+          //   {
+          //     name: this.list[0].title,
+          //     type: "line",
+          //     smooth: true,
+          //     showSymbol: false,
+          //     zlevel: 0,
+          //     lineStyle: {
+          //       normal: {
+          //         color: "#4B55AE",
+          //         width: 1,
+          //       },
+          //     },
+          //     tooltip: {
+          //       show: true,
+          //       position: [10, 10],
+          //     },
+          //     yAxisIndex: this.list[0].yAxisIndex,
+          //     data: this.list[0].value.map((t) => {
+          //       return t.value;
+          //     }),
+          //   },
+          //   {
+          //     name: this.list[1].title,
+          //     type: "line",
+          //     smooth: true,
+          //     showSymbol: false,
+          //     zlevel: 1,
+          //     lineStyle: {
+          //       normal: {
+          //         color: "#05BB4C",
+          //         width: 1,
+          //       },
+          //     },
+          //     tooltip: {
+          //       show: true,
+          //       position: [10, 10],
+          //     },
+          //     yAxisIndex: this.list[1].yAxisIndex,
+          //     data: this.list[1].value.map((t) => {
+          //       return t.value;
+          //     }),
+          //   }
+          // ],
+        };
+        chart.clear();
+        chart && option && chart.setOption(option);
+        this.resize = function () {
+          chart.resize();
+        };
+        window.addEventListener("resize", this.resize);
         chart.resize();
-      };
-      window.addEventListener("resize", this.resize);
-      chart.resize();
+      },
+    },
+    created() {
+      this.$nextTick(() => {
+        this.id = "pie-chart-photo";
+      });
+    },
+    mounted() {
+      this.$nextTick(() => {
+        this.$el.style.width = this.width;
+        this.$el.style.height = this.height;
+        this.initChart();
+      });
+    },
+    updated() {
+      this.$nextTick(() => {
+        this.initChart();
+      });
+    },
+    unmounted() {
+      window.removeEventListener("resize", this.resize);
     },
-  },
-  created() {
-    this.$nextTick(() => {
-      this.id = "pie-chart-photo";
-    });
-  },
-  mounted() {
-    this.$nextTick(() => {
-      this.$el.style.width = this.width;
-      this.$el.style.height = this.height;
-      this.initChart();
-    });
-  },
-  updated() {
-    this.$nextTick(() => {
-      this.initChart();
-    });
-  },
-  unmounted() {
-    window.removeEventListener("resize", this.resize);
-  },
-};
+  };
 </script>
 
 <style lang="less">
-.chart {
-  width: 100%;
-  height: 100%;
-  display: inline-block;
-}
-</style>
+  .chart {
+    width: 100%;
+    height: 100%;
+    display: inline-block;
+  }
+</style>

+ 27 - 3
src/components/matrixBlock.vue

@@ -9,9 +9,13 @@
             <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 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 class="locks" v-if="item.lockValue > 0">
+                <img class="lock" src="../assets/img/type/lock.png" alt="">
+                <div class="lock-on">aaaa</div>
+            </div> -->
         </div>
     </div>
     <WindturbineDetailPages v-model="dialogVisible" :showSvg="showSvg" @close="handleClose"
@@ -68,13 +72,33 @@
     }
 </script>
 <style scoped>
-    .lock{
+    .lock {
         width: 10px;
         height: 10px;
         position: relative;
         right: 6px;
         top: -15px;
     }
+
+    .lock-on {
+        width: 0px;
+        height: 0px;
+        opacity: 0;
+    }
+
+    .locks:hover .lock-on {
+        position: fixed;
+        display: flex;
+        align-items: center;
+        width: 80px;
+        height: 30px;
+        border: 1px solid #999999;
+        background-color: #999999;
+        opacity: 1;
+        color: #ffffff;
+        z-index: 999;
+    }
+
     .box-0 {
         width: 135px;
         height: 50px;

+ 306 - 0
src/components/modeControl/detailPages.vue

@@ -0,0 +1,306 @@
+<template>
+	<el-dialog width="55%" @closed="closed()" :show-close="false" class="my-info-dialog">
+		<template #title>
+			<div class="showTitle">
+				<img class="titleImg" src="../../assets/img/controlcenter/daraTrue.png" alt="">
+				<div class="titles">国电电力宁夏新能源开发有限公司</div>
+			</div>
+		</template>
+		<div class="body">
+			<div class="dataList">
+				<div class="data">
+					<div class="name">健康指数:</div>
+					<div class="num">{{showDate.healthIndex}}</div>
+				</div>
+				<div class="data">
+					<div class="name">资源指数:</div>
+					<div class="num">{{showDate.resourceIndex}}</div>
+				</div>
+				<div class="data">
+					<div class="name">风能利用率:</div>
+					<div class="num">{{showDate.windEnergyRate}}%</div>
+				</div>
+				<div class="data">
+					<div class="name">曲线跟随率:</div>
+					<div class="num">{{showDate.curveFollowingRate}}%</div>
+				</div>
+				<div class="data">
+					<div class="name">实际功率:</div>
+					<div class="num">{{showDate.realTimePower}}</div>
+					<div class="unit">MW</div>
+				</div>
+				<div class="data">
+					<div class="name">理论功率:</div>
+					<div class="num">{{showDate.theoreticalPower}}</div>
+					<div class="unit" @click='ChangeColor()'>MW</div>
+				</div>
+				<div class="data">
+					<div class="name">AGC有功设定:</div>
+					<div class="num">{{showDate.agcPowerSet}}</div>
+					<div class="unit" @click='ChangeColors()'>MW</div>
+				</div>
+			</div>
+			<MultipleLineChart height="400px" :units="powerLineChartData.units" :list="powerLineChartData.value" :colors="colors"
+				:showLegend="true" />
+		</div>
+	</el-dialog>
+</template>
+
+<script>
+	import MultipleLineChart from "../focus/multiple-line-chart.vue";
+	import MessageBridge from 'utils/MessageBridge'
+	import dayjs from 'dayjs'
+	import api from "api/index";
+	export default {
+		components: {
+			MultipleLineChart
+		},
+		props: {
+			stationName: {
+				type: String,
+				default: ''
+			},
+			data: {
+				type: Array
+			},
+		},
+		created() {
+			// this.initData()
+		},
+		mounted() {
+			this.initData()
+		},
+		data() {
+			return {
+				// 定时器
+				timer: "",
+				colors: ["rgba(75, 85, 174, 1)", "rgba(05, 187, 76, 1)"],
+				showDate: {},
+				chartData: {
+					units: [""],
+					value: [
+						{
+							title: "实际功率(MW)",
+							yAxisIndex: 0,
+							value: []
+						},
+						{
+							title: "理论功率(MW)",
+							yAxisIndex: 0,
+							value: []
+						},
+					],
+				},
+				timeData: [],
+				PowerSet: [],
+				ActualPower: [],
+				index: 0,
+				powerLineChartData: {},
+			};
+		},
+		methods: {
+			initData() {
+				var mb = MessageBridge.getInstance();
+				var vs = [{ key: "/topic/title-info", action: this.getMessage }];
+				mb.register(vs);
+			},
+			getMessage(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.showDate = data
+			},
+			getDate() {
+				this.getPower({
+					PowerSet: 'JSFW.NX_GD_FDC_XX_XX_XXX_XXX_CI0135',
+					name: 'PowerSet',
+				})
+				this.getPower({
+					ActualPower: 'JSFW.NX_GD_FDC_XX_XX_XXX_XXX_CI0192',
+					name: 'ActualPower',
+				})
+				this.timer = setTimeout(() => {
+					this.getDate()
+
+				}, 10000);
+			},
+			getPower(values) {
+				let date = new Date()
+				let endTs = date.getTime();
+				let startTs = endTs - 28800000;
+				let names = values.name
+				// 	this.powerLineChartData = this.chartData;
+				api.getPower({
+					tagName: values.PowerSet ? values.PowerSet : values.ActualPower,
+					startTs: startTs,
+					endTs: endTs,
+				}).then(res => {
+					if (res) {
+						if (names === 'PowerSet') {
+							let list = []
+							res.data.forEach(item => {
+								list.push({
+									text: dayjs(item.ts).format('hh:mm'),
+									value: parseFloat((item.doubleValue).toFixed(2))
+								})
+								this.chartData.value[0].value = list
+							})
+						} else {
+							let list = []
+							res.data.forEach(item => {
+								list.push({
+									text: dayjs(item.ts).format('hh:mm'),
+									value: (parseFloat((item.doubleValue).toFixed(2))/1000)
+								})
+								this.chartData.value[1].value = list
+							})
+						}
+						this.powerLineChartData = this.chartData;
+					}
+				})
+			},
+			ChangeColors() {
+				this.colors = ["#aa2116", "#fcaf17"]
+			},
+			ChangeColor() {
+				this.colors = ["rgba(75, 85, 174, 1)", "rgba(05, 187, 76, 1)"]
+			},
+			closed() {
+				clearInterval(this.timer);
+				//勿删,传递关闭方法
+			},
+			// initData(PowerSet, ActualPower) {
+			// 	// this.chartData.units = ["(MW)", "(MW)"];
+			// 	this.chartData.value[0] = {
+			// 		title: "有功设定限值(MW)",
+			// 		yAxisIndex: 0,
+			// 		value: []
+			// 	};
+			// 	this.chartData.value[1] = {
+			// 		title: "实发有功(MW)",
+			// 		yAxisIndex: 0,
+			// 		value: []
+			// 	}
+			// 	PowerSet.forEach(item => {
+			// 		this.chartData.value[0].value.push({
+			// 			text: dayjs(item.ts).format('hh:mm'),
+			// 			value: parseFloat((item.doubleValue).toFixed(2))
+			// 		})
+			// 	})
+			// 	ActualPower.forEach(item => {
+			// 		this.chartData.value[1].value.push({
+			// 			text: dayjs(item.ts).format('hh:mm'),
+			// 			value: parseFloat((item.doubleValue).toFixed(2))
+			// 		})
+			// 	})
+			// 	this.powerLineChartData = this.chartData;
+			// }
+		},
+	};
+</script>
+<style scoped>
+	.echartsBox {
+		width: 64rem;
+		height: 220px;
+		overflow: hidden;
+	}
+
+	.el-dialog__header {
+		background-color: #000000;
+	}
+
+	.showTitle {
+		display: flex;
+		flex-direction: row;
+		align-items: center;
+		justify-content: center;
+		margin-top: -10px;
+		font-size: 18px;
+		color: #FFFFFF;
+	}
+
+	.titleImg {
+		width: 16px;
+		height: 16px;
+		margin-right: 13px;
+	}
+
+	.icon {
+		font-size: 12px;
+		margin-left: 10px;
+		margin-top: 5px;
+	}
+
+	.body {
+		background-color: black;
+		width: 100%;
+		margin-top: -30px;
+		/* height: 200px; */
+	}
+
+	.dataList {
+		display: flex;
+		flex-direction: row;
+		flex-wrap: wrap;
+		align-items: center;
+		padding-top: 27px;
+	}
+
+	.data {
+		width: 50%;
+		display: flex;
+		flex-direction: row;
+		align-items: center;
+		margin-bottom: 22px;
+	}
+
+	.name {
+		width: 40%;
+		display: flex;
+		flex-direction: row-reverse;
+		font-size: 12px;
+		color: #FFFFFF;
+	}
+
+	.num {
+		margin-left: 59px;
+		font-size: 16px;
+		color: #05BB4C;
+		min-width: 40px;
+	}
+
+	.unit {
+		font-size: 16px;
+		color: #FFFFFF;
+		margin-left: 20px;
+	}
+
+	.condition {
+		width: 100%;
+		display: flex;
+		flex-direction: row;
+		align-items: center;
+		margin-bottom: 20px;
+		border-bottom: 1px solid #3D3D3D;
+		padding-bottom: 10px;
+	}
+
+	.status {
+		width: 25%;
+		display: flex;
+		flex-direction: row;
+		align-items: center;
+		justify-content: center;
+	}
+
+	.statusIcon {
+		width: 14px;
+		height: 14px;
+		margin-left: 8px;
+	}
+</style>

+ 33 - 86
src/components/modeControl/modeControl.vue

@@ -5,23 +5,7 @@
             <div :class="current===1?'recommend_on':'recommend'" @click="ChangeBar(1)">推荐</div>
             <div :class="current===2?'manual_on':'manual'" @click="ChangeBar(2)">手动</div>
         </div>
-        <div style="display: flex;flex-direction: row;z-index: 2;">
-            <!-- <div class="dataShow">
-                <div class="number">
-                    <div class="dataName">健康指数</div>
-                    <div class="numbers">{{showDate.healthIndex}}</div>
-                </div>
-                <div class="progress">
-                    <div class="progressNum" :style="healthStyle"></div>
-                </div>
-                <div class="number">
-                    <div class="dataName">资源指数</div>
-                    <div class="numbers">{{showDate.resourceIndex}}</div>
-                </div>
-                <div class="progress">
-                    <div class="progressNum" :style="resourceStyle"></div>
-                </div>
-            </div> -->
+        <div style="display: flex;flex-direction: row;z-index: 2;" @dblclick="dbClick()">
             <div class="showData">
                 <div class="dataBox">
                     <div class="dataTitle">健康指数</div>
@@ -43,36 +27,26 @@
                     <div class="datas">{{showDate.curveFollowingRate}}%</div>
                 </div>
             </div>
-            <!-- <div class="dataShows">
-                <div class="number">
-                    <div class="numbers-right">{{showDate.windEnergyRate}}%</div>
-                    <div class="dataName-right">风能利用率</div>
-                </div>
-                <div class="progress-right">
-                    <div class="progressNum-right" :style="windStyle"></div>
-                </div>
-                <div class="number">
-                    <div class="numbers-right">{{showDate.curveFollowingRate}}%</div>
-                    <div class="dataName-right">曲线跟随率</div>
-                </div>
-                <div class="progress-right">
-                    <div class="progressNum-right" :style="curveStyle"></div>
-                </div>
-            </div> -->
         </div>
     </div>
+    <DetailPages ref="detials" @closed="closed()" v-model="dialogVisible">
+	</DetailPages>
 </template>
 <script>
     import BackgroundData from 'utils/BackgroundData'
     import api from "api/index";
     import MessageBridge from 'utils/MessageBridge'
     import * as echarts from "echarts";
+    import DetailPages from "./detailPages.vue";
     export default {
         props: {
             // current: {
             //     type: Number,
             // },
         },
+        components: {
+			DetailPages
+		},
         data() {
             return {
                 current: 1,
@@ -82,10 +56,7 @@
                 winFlag: 0,
                 curveFlag: 0,
                 fieldFlag: 0,
-                // healthWidth: 0,
-                // resourceWidth: 0,
-                // windWidth: 0,
-                // curveWidth: 0,
+                dialogVisible: false,
             };
         },
         created() {
@@ -140,6 +111,8 @@
                     this.ChangeBar(0)
                 } else if (arr[0] === 'OPEN_PAGE_RECOMMENDATION') {
                     this.ChangeBar(1)
+                }else if(msg === 'OPEN_AGC-GS'){
+                    this.dbClick()
                 }
             },
             getEchartss(msg) {
@@ -204,55 +177,55 @@
                             }
                         },
                         data: [{
-                            value: 21,
+                            value: 125.85,
                             name: '实际功率',
                             itemStyle: {
                                 color: 'rgba(75, 85, 174, 1)'
                             },
                             title: {
                                 color: '#999999',
-                                offsetCenter: ['-60%', '90%']
+                                offsetCenter: ['-70%', '90%']
                             },
                             detail: {
-                                width: 40,
+                                width: 50,
                                 height: 12,
                                 fontSize: 18,
-                                offsetCenter: ['-60%', '110%']
+                                offsetCenter: ['-70%', '110%']
                             }
                         },
                         {
-                            value: 24,
+                            value: 137.63,
                             name: '理论功率',
                             itemStyle: {
                                 color: 'rgba(05, 187, 76, 1)'
                             },
                             title: {
                                 color: '#999999',
-                                offsetCenter: ['-5%', '90%']
+                                offsetCenter: ['0%', '90%']
                             },
                             detail: {
-                                width: 40,
+                                width: 50,
                                 height: 12,
                                 fontSize: 18,
-                                offsetCenter: ['-5%', '110%']
+                                offsetCenter: ['0%', '110%']
                             }
                         },
                         {
-                            value: 73,
+                            value: 132.04,
                             name: 'AGC有功设定',
                             itemStyle: {
                                 color: 'rgba(186, 50, 55, 1)'
                             },
                             title: {
                                 color: '#999999',
-                                offsetCenter: ['60%', '90%']
+                                offsetCenter: ['70%', '90%']
                             },
                             detail: {
                                 align: 'center',
-                                width: 60,
+                                width: 50,
                                 height: 12,
                                 fontSize: 18,
-                                offsetCenter: ['60%', '110%']
+                                offsetCenter: ['70%', '110%']
                             }
                         }
                         ],
@@ -275,42 +248,11 @@
                 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
-            //         }
-            //     })
-            // },
             ChangeBar(values) {
                 var bd = BackgroundData.getInstance();
+                var mb = MessageBridge.getInstance();
+                var vss = { key: "/topic/voice-control"};
+                mb.unregister(vss);
                 if (!bd.LoginUser) {
                     this.$notify({
                         title: "请登录",
@@ -323,6 +265,7 @@
                     return;
                 }
                 if (this.current !== values) {
+                    this.$store.commit('current', Number(values))
                     if (values === 2) {
                         this.current = values
                         this.$router.push(`/ManualPage?current=${values}`)
@@ -345,9 +288,13 @@
                     }
                 }
             },
-            // controls(value) {
-            //     this.current = value
-            // }
+            dbClick(){
+                this.dialogVisible = true;
+                this.$refs.detials.getDate()
+            },
+            closed(){
+                this.dialogVisible = false;
+            },
         },
     }
 </script>

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

@@ -314,6 +314,7 @@
                         this.chooseList,
                         true,
                         '',
+                        '',
                         this.controlSuccess,
                         this.controlError
                     );
@@ -324,6 +325,7 @@
                         this.chooseList,
                         false,
                         '',
+                        '',
                         this.controlSuccess,
                         this.controlError
                     );

+ 3 - 2
src/components/warning/warningArea.vue

@@ -3,11 +3,12 @@
         <img class="logo" src="../../assets/img/logo.png" alt="">
         <div class="title">告警区</div>
         <div style="margin-top: 50px; margin-left: 10px; height: 19vh;">
-            <el-scrollbar>
+            <!-- <el-scrollbar>
                 <div class="scoll" style="margin-left: 5px;">
                     <WarningCard></WarningCard>
                 </div>
-            </el-scrollbar>
+            </el-scrollbar> -->
+            <WarningCard></WarningCard>
         </div>
     </div>
 </template>

+ 2 - 5
src/components/warning/warningCard.vue

@@ -1,7 +1,7 @@
 /* 告警区 */
 <template>
 	<div style="padding-left: 5px; padding-right: 5px">
-		<el-table :data="values" class="table" height="29vh" :header-cell-style="{
+		<el-table :data="values" class="table" height="20vh" :header-cell-style="{
           background: '#000000',
           color: 'rgb(220,220,220)',
           padding: '4px',
@@ -19,11 +19,8 @@
 			</el-table-column>
 			<el-table-column prop="isSelected" align="center" label="确认">
 				<template v-slot="scope">
-					<!-- <el-checkbox v-model="scope.row.isSelected" @click="itemChecked(scope.row)"></el-checkbox> -->
 					<input type="checkbox" v-model="scope.row.isSelected" @click="itemChecked(scope.row)" />
 				</template>
-				<!-- <el-checkbox v-model="isSelected"></el-checkbox> -->
-				<!-- <input type="checkbox"/> -->
 			</el-table-column>
 		</el-table>
 	</div>
@@ -46,7 +43,7 @@
 		},
 		created: function () {
 			this.initData()
-			this.faultMessage();
+			this.faultMessage()
 		},
 		props: {},
 		data() {

+ 1 - 1
src/store/index.js

@@ -9,7 +9,7 @@ const store = createStore({
                warning: Object,
                suggestion: [],
                titleInfo: Object,
-               current: Number,
+               current: 1,
           }
      },
 

+ 3 - 3
src/utils/BackgroundData.js

@@ -33,7 +33,7 @@ export default class BackgroundData {
             stationName: "大武口光伏电站",
             content: "通讯中断",
             createTime: this.formatDate(new Date("2021-04-15 8:17:59"), 'YY-MM-DD hh:mm'),
-            isActive: true,
+            isActive: false,
             stationID: 'DWK_AGC',
             values:'DWK'
         },
@@ -303,7 +303,7 @@ export default class BackgroundData {
     // }
 
     /* 风机控制 */
-    windturbineControl(windturbines, isLockOrUnlock, automatic ,success, error) {
+    windturbineControl(windturbines, isLockOrUnlock, automatic, test ,success, error) {
         var pairs = {};
         for (var ind in windturbines) {
             var wb = windturbines[ind];
@@ -319,7 +319,7 @@ export default class BackgroundData {
             };
             pairs[ct.windturbineId] = ct;
         }
-        api.windturbControl(isLockOrUnlock,pairs).then(res =>{
+        api.windturbControl(isLockOrUnlock,pairs,test).then(res =>{
             success(res);
         })
         // axios.post(process.env.VUE_APP_API+`/api/control/send?isLockOrUnlock=${isLockOrUnlock}`, pairs)

+ 7 - 1
src/utils/MessageBridge.js

@@ -60,7 +60,13 @@ export default class MessageBridge {
 
   /* 取消注册消息 */
   unregister(msgs) {
-    this.observers.remove(msgs);
+    let showIndex = null
+    this.observers.forEach((item,index) =>{
+      if(item.key === msgs.key){
+        showIndex = index
+      }
+    })
+    this.observers.splice(showIndex,1);
   }
 }
 

+ 1 - 1
src/utils/PhotoelectricDetailPages.js

@@ -19,7 +19,7 @@ export const Photoelectric = {
 			{name:"AGC可调上限", tag:"AgcUp", value:"QSDQ.NX_GD_QSF_DQ_P1_L1_001_AI1284", calc:"1"},
 			{name:"AGC可调下限", tag:"AgcLower", value:"QSDQ.NX_GD_QSF_DQ_P1_L1_001_AI1285", calc:"0.1"},
 			{name:"实发有功", tag:"ActualPower", value:"QSDQ.NX_GD_QSF_DQ_P1_L1_001_AI1282", calc:"1"},
-			{name:"理论功率", tag:"TheoryPower", value:"QSFCJSFW.NX_GD_QSF_FJ_P1_XXX_XXX_CI0192,QSFCJSFW.NX_GD_QSF_FJ_P2_XXX_XXX_CI0192", calc:"0.001"},
+			{name:"理论功率", tag:"TheoryPower", value:"QSFCJSFW.NX_GD_QSF_FJ_P1_XXX_XXX_CI0192", calc:"0.001"},
 			{name:"预测功率", tag:"ForecastPower", value:"QSFGL.NX_GD_QSF_YC_P1_L1_001_CDQ001", calc:"1"},
 			{name:"AGC投入", tag:"AgcIn", value:"QSDQ.NX_GD_QSF_DQ_P1_L1_001_DI2442"},
 			{name:"AGC远方", tag:"AgcFar", value:"QSDQ.NX_GD_QSF_DQ_P1_L1_001_DI2443"},