diff --git a/src/views/devicePhotoSchedule/components/setdevice.vue b/src/views/devicePhotoSchedule/components/setdevice.vue index 395b457..53614db 100644 --- a/src/views/devicePhotoSchedule/components/setdevice.vue +++ b/src/views/devicePhotoSchedule/components/setdevice.vue @@ -232,6 +232,7 @@ export default { this.allCheckNode = this.$refs.tree.getCheckedNodes(); // console.log(this.allCheckNode); console.log(nodeObj); + this.isactive = nodeObj.id; this.isCheck = this.$refs.tree.getCheckedNodes().indexOf(nodeObj) > -1; console.log(this.isCheck); @@ -245,16 +246,23 @@ export default { }, //时间表 sureSum() { - console.log(this.ruleSchedule); - console.log(this.checkedAisle); + var ruleBox = []; for (var i = 0; i < this.allCheckNode.length; i++) { + console.log(this.allCheckNode[i].protocol); + + if (this.allCheckNode[i].protocol == "65283") { + //湖南规约 + this.getHnTime(this.allCheckNode[i]); + } else if (this.allCheckNode[i].protocol == "65286") { + //郑州规约 + this.getZzTime(this.allCheckNode[i]); + } var parmsobj = { termid: this.allCheckNode[i].id, - channelidlist: this.checkedAisle, + channelid: this.checkedAisle, offset: this.allCheckNode[i].offsetNum, - list: [], }; console.log(parmsobj); ruleBox.push(parmsobj); @@ -283,6 +291,67 @@ export default { }); }); }, + //获取到时间规则,把时间规则转化为对应的规约格式 + //湖南规约 + getHnTime(val) { + console.log("湖南"); + console.log(val); + + var numberoff = val.offsetNum; + console.log(numberoff); + console.log(this.ruleSchedule); + let arr = []; + for (var i = 0; i < this.ruleSchedule.length; i++) { + console.log(this.ruleSchedule[i].startTime); + console.log(this.ruleSchedule[i].endTime); + let sTime = new Date(this.ruleSchedule[i].startTime); + let eTime = new Date(this.ruleSchedule[i].endTime); + console.log(sTime, eTime); + arr.push( + { + hour: Math.floor(this.ruleSchedule[i].span / 60), + minute: this.ruleSchedule[i].span % 60, + preset: 255, + }, + { + hour: new Date(this.ruleSchedule[i].startTime).getHours(), + minute: + new Date(this.ruleSchedule[i].startTime).getMinutes() + numberoff, + preset: 255, + }, + { + hour: new Date(this.ruleSchedule[i].endTime).getHours(), + minute: + new Date(this.ruleSchedule[i].endTime).getMinutes() + numberoff, + + preset: 255, + } + ); + console.log(arr); + // arr.push( + // { + // hour: Math.floor(this.ruleForm.listTime[i].span / 60), + // minute: this.ruleForm.listTime[i].span % 60, + // preset: 255, + // }, + // { + // hour: this.ruleForm.listTime[i].startTime.getHours(), + // minute: this.ruleForm.listTime[i].startTime.getMinutes(), + // preset: 255, + // }, + // { + // hour: this.ruleForm.listTime[i].endTime.getHours(), + // minute: this.ruleForm.listTime[i].endTime.getMinutes(), + // preset: 255, + // } + // ); + } + }, + //河南规约 + getZzTime() { + console.log("河南"); + console.log(this.ruleSchedule); + }, //根据requestid查询时间表下发状态 requestTime() { this.sureloading = true; @@ -297,7 +366,6 @@ export default { arr ) { console.log(value, index, arr); - return value.status !== 1; }); if (this.requestList.length == 0) {