拍照装置添加规约

ds1.0
fanluyan 2 years ago
parent 9df6f03ee6
commit 279b2b463a

@ -119,6 +119,7 @@ import {
getTermListByChannelJoggle,
getCmaSchelduleUpload,
} from "@/utils/api/index";
import moment from "moment";
export default {
props: {
title: String,
@ -168,6 +169,7 @@ export default {
flag: false,
sureloading: false,
showtag: false,
checkOffset: "",
};
},
mounted() {},
@ -177,6 +179,7 @@ export default {
console.log(val);
this.selid = val.id;
this.ruleSchedule = val.listTime;
console.log(this.ruleSchedule);
// console.log(this.ruleSchedule, "");
this.getlistnr();
},
@ -232,11 +235,34 @@ export default {
this.allCheckNode = this.$refs.tree.getCheckedNodes();
// console.log(this.allCheckNode);
console.log(nodeObj);
console.log(this.allCheckNode);
this.isactive = nodeObj.id;
this.isCheck = this.$refs.tree.getCheckedNodes().indexOf(nodeObj) > -1;
console.log(this.isCheck);
},
// //
// getruleSchedule() {
// for (var j = 0; j < this.allCheckNode.length; j++) {
// console.log(this.allCheckNode[j].offsetNum);
// for (var i = 0; i < this.ruleSchedule.length; i++) {
// console.log(typeof this.ruleSchedule[i].startTime);
// console.log(this.ruleSchedule[i].startTime);
// var Stime = moment(this.ruleSchedule[i].startTime).format("HH:mm");
// var Etime = moment(this.ruleSchedule[i].endTime).format("HH:mm");
// console.log(Stime, Etime);
// // this.ruleSchedule[i].startTime = new Date(
// // this.ruleSchedule[i].startTime
// // );
// // this.ruleSchedule[i].endTime = new Date(this.ruleSchedule[i].endTime);
// // console.log(this.ruleSchedule[i].startTime);
// // console.log(this.ruleSchedule[i].endTime);
// // moment().add(offsetSeconds, "seconds").toObject();
// // console.log(time);
// }
// }
// },
//
submitForm() {
@ -249,25 +275,155 @@ export default {
console.log(this.checkedAisle);
var ruleBox = [];
//
for (var i = 0; i < this.allCheckNode.length; i++) {
console.log(this.allCheckNode[i].protocol);
console.log(this.allCheckNode[i].bsManufacturer);
if (
this.allCheckNode[i].bsManufacturer == null ||
this.allCheckNode[i].bsManufacturer == undefined
) {
console.log(this.allCheckNode[i].offsetNum);
//
let timearr = [];
let dayArr = [];
for (var j = 0; j < this.ruleSchedule.length; j++) {
console.log(this.ruleSchedule);
console.log(this.ruleSchedule[j].startTime);
// var Stime = moment(this.ruleSchedule[j].startTime).format("HH:mm");
// var Etime = moment(this.ruleSchedule[j].endTime).format("HH:mm");
var Stime = moment(this.ruleSchedule[j].startTime)
.add(this.allCheckNode[i].offsetNum, "minute")
.format();
var Etime = moment(this.ruleSchedule[j].endTime)
.add(this.allCheckNode[i].offsetNum, "minute")
.format();
var spanTime = this.ruleSchedule[j].span;
console.log(spanTime);
console.log(moment(this.ruleSchedule[j].endTime).hour());
//
if (this.allCheckNode[i].protocol == "65283") {
console.log("湖南规约");
console.log(Stime, Etime);
console.log(typeof Stime);
console.log(
moment(this.ruleSchedule[j].endTime)
.add(this.allCheckNode[i].offsetNum, "minute")
.hour()
);
console.log(
moment(this.ruleSchedule[j].endTime)
.add(this.allCheckNode[i].offsetNum, "minute")
.minute()
);
//
console.log(moment().isSame(moment(Etime), "day"));
//
if (moment().isSame(moment(Etime), "day")) {
//
timearr.push(
{
hour: Math.floor(this.ruleSchedule[j].span / 60),
minute: this.ruleSchedule[j].span % 60,
preset: 255,
},
{
hour: moment(this.ruleSchedule[j].startTime)
.add(this.allCheckNode[i].offsetNum, "minute")
.hour(),
minute: moment(this.ruleSchedule[j].startTime)
.add(this.allCheckNode[i].offsetNum, "minute")
.minute(),
preset: 255,
},
{
hour: moment(this.ruleSchedule[j].endTime)
.add(this.allCheckNode[i].offsetNum, "minute")
.hour(),
minute: moment(this.ruleSchedule[j].endTime)
.add(this.allCheckNode[i].offsetNum, "minute")
.minute(),
preset: 255,
}
);
} else {
timearr.push(
{
hour: Math.floor(this.ruleSchedule[j].span / 60),
minute: this.ruleSchedule[j].span % 60,
preset: 255,
},
{
hour: moment(this.ruleSchedule[j].startTime)
.add(this.allCheckNode[i].offsetNum, "minute")
.hour(),
minute: moment(this.ruleSchedule[j].startTime)
.add(this.allCheckNode[i].offsetNum, "minute")
.minute(),
preset: 255,
},
{
hour: moment(this.ruleSchedule[j].endTime).hour(),
minute: moment(this.ruleSchedule[j].endTime).minute(),
preset: 255,
}
);
}
console.log(timearr);
}
////
if (this.allCheckNode[i].protocol == "65286") {
console.log("河南规约");
//
//this.getDayArr(startDay, endDay);
let startDay = Stime;
let endDay = Etime;
console.log(startDay, endDay);
let startVal = this.$moment(new Date(startDay)).format(
"YYYY-MM-DD HH:mm"
);
console.log(startVal);
while (this.$moment(startVal).isBefore(endDay)) {
dayArr.push(startVal);
//
startVal = this.$moment(new Date(startVal))
.add(spanTime, "minute")
.format("YYYY-MM-DD HH:mm");
console.log(startVal);
}
// //
dayArr.push(
this.$moment(new Date(endDay)).format("YYYY-MM-DD HH:mm")
);
console.log(dayArr);
for (var k = 0; k < dayArr.length; k++) {
//console.log(moment(dayArr[k]).hour());
timearr.push({
hour: moment(dayArr[k]).hour(),
minute: moment(dayArr[k]).minute(),
preset: 255,
});
}
if (this.allCheckNode[i].protocol == "65283") {
//
this.getHnTime(this.allCheckNode[i]);
} else if (this.allCheckNode[i].protocol == "65286") {
//
this.getZzTime(this.allCheckNode[i]);
// return dayArr;
}
}
var parmsobj = {
termid: this.allCheckNode[i].id,
channelid: this.checkedAisle,
offset: this.allCheckNode[i].offsetNum,
list: timearr,
};
console.log(parmsobj);
ruleBox.push(parmsobj);
}
var parmsobj = {
termid: this.allCheckNode[i].id,
channelid: this.checkedAisle,
offset: this.allCheckNode[i].offsetNum,
};
console.log(parmsobj);
ruleBox.push(parmsobj);
console.log(ruleBox);
}
console.log(ruleBox);
setScheduleRulel({
list: ruleBox,
scheduleid: this.selid,
@ -283,75 +439,19 @@ export default {
}, 3000);
})
.catch((err) => {
this.$message({
duration: 1500,
showClose: true,
message: "添加失败",
type: "error",
});
// this.$message({
// duration: 1500,
// showClose: true,
// message: "",
// type: "error",
// });
});
},
//
//
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,
// }
// );
}
},
getHnTime() {},
//
getZzTime() {
console.log("河南");
console.log(this.ruleSchedule);
},
getZzTime() {},
//requestid
requestTime() {
this.sureloading = true;

@ -687,9 +687,9 @@ export default {
this.picTime = res.data.taketime; //
console.log(this.requestId);
this.btnvideoloading = true;
this.getTakePicStatus(this.requestId);
this.getTakePicStatus(res.data);
this.statusTimer = window.setInterval(() => {
this.getTakePicStatus(this.requestId);
this.getTakePicStatus(res.data);
this.statusNum++;
}, 2000);
})

Loading…
Cancel
Save