|
@@ -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);
|
|
|
}
|