拍照装置添加规约

ds1.0
fanluyan 2 years ago
parent 78bfd4ead9
commit 9ee2b57776

@ -298,6 +298,8 @@ export default {
var Etime = moment(this.ruleSchedule[j].endTime)
.add(this.allCheckNode[i].offsetNum, "minute")
.format();
var lastETime = moment(this.ruleSchedule[j].endTime).format();
var spanTime = this.ruleSchedule[j].span;
console.log(spanTime);
console.log(moment(this.ruleSchedule[j].endTime).hour());
@ -378,14 +380,17 @@ export default {
console.log("河南规约");
//
//this.getDayArr(startDay, endDay);
let startDay = Stime;
let endDay = Etime;
var lastendDay = lastETime;
console.log(lastETime);
console.log(startDay, endDay);
let startVal = this.$moment(new Date(startDay)).format(
"YYYY-MM-DD HH:mm"
);
console.log(startVal);
console.log(moment().isSame(moment(endDay), "day"));
while (this.$moment(startVal).isBefore(endDay)) {
dayArr.push(startVal);
//
@ -396,9 +401,12 @@ export default {
}
// //
dayArr.push(
this.$moment(new Date(endDay)).format("YYYY-MM-DD HH:mm")
);
if (!moment().isSame(moment(endDay), "day")) {
dayArr.push(
this.$moment(new Date(lastETime)).format("YYYY-MM-DD HH:mm")
);
}
console.log(dayArr);
for (var k = 0; k < dayArr.length; k++) {
//console.log(moment(dayArr[k]).hour());

@ -50,12 +50,22 @@
<div class="w8">时间表:</div>
<div class="w80 flexonly" v-loading="timeloading">
<el-tag
v-if="timeProtocol == '65283'"
class="mr10 mt10"
size="mini"
v-for="(val, index) in this.shedulenr"
:key="index"
>{{ val.substring(0, val.lastIndexOf(":")) }}</el-tag
>{{ val.substring(val.length - 5) }}</el-tag
>
<el-tag
v-if="timeProtocol == '65286'"
class="mr10 mt10"
size="mini"
v-for="(val, index) in this.shedulenr"
:key="index"
>{{ $moment(val).format("HH:mm") }}</el-tag
>
<!-- {{ val.substring(val.length - 5) }} -->
</div>
</div>
<div class="rightTime" v-if="newshedulenr.length !== 0">
@ -65,11 +75,20 @@
>
<div class="w80 flexonly" v-loading="timeloading">
<el-tag
v-if="timeProtocol == '65283'"
class="mr10 mt10"
size="mini"
v-for="(val, index) in this.newshedulenr"
:key="index"
>{{ val.substring(val.length - 5) }}</el-tag
>
<el-tag
v-if="timeProtocol == '65286'"
class="mr10 mt10"
size="mini"
v-for="(val, index) in this.newshedulenr"
:key="index"
>{{ val.substring(0, val.lastIndexOf(":")) }}</el-tag
>{{ $moment(val).format("HH:mm") }}</el-tag
>
</div>
</div>
@ -101,10 +120,10 @@
<el-table-column label="名称" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column>
<el-table-column label="时间表类型" show-overflow-tooltip>
<!-- <el-table-column label="时间表类型" show-overflow-tooltip>
<template>按时间段</template>
</el-table-column>
<el-table-column label="时间表规则">
</el-table-column> -->
<el-table-column label="时间表规则" width="360px">
<template slot-scope="scope">
<p
class="timeGz"
@ -200,8 +219,31 @@
v-for="(val, index) in scheduleInfo"
:key="index"
>
<span>{{ val.startTime }}</span> ~
<span>{{ val.endTime }}</span>
<span
>{{
new Date(val.startTime).getHours() < 10
? "0" + new Date(val.startTime).getHours()
: new Date(val.startTime).getHours()
}}:
{{
new Date(val.startTime).getMinutes() < 10
? "0" + new Date(val.startTime).getMinutes()
: new Date(val.startTime).getMinutes()
}}</span
>
~
<span
>{{
new Date(val.endTime).getHours() < 10
? "0" + new Date(val.endTime).getHours()
: new Date(val.endTime).getHours()
}}:
{{
new Date(val.endTime).getMinutes() < 10
? "0" + new Date(val.endTime).getMinutes()
: new Date(val.endTime).getMinutes()
}}</span
>
间隔<b>{{ val.span }}分钟</b>
</p>
</div>
@ -262,6 +304,7 @@ import {
getCmaSchelduleUpload,
getTermStatus,
} from "@/utils/api/index";
import moment from "moment";
export default {
props: {
title: String,
@ -314,6 +357,7 @@ export default {
offsetnum: "",
setNum: Math.floor(Math.random() * 10),
compareloading: false,
timeProtocol: "",
};
},
mounted() {
@ -324,9 +368,11 @@ export default {
console.log(tab, event);
},
//
getSingleAccess(id, zzid) {
getSingleAccess(id, zzid, protocol) {
this.newcmdzzid = zzid;
this.selfacilityId = id;
this.timeProtocol = protocol;
console.log(this.timeProtocol);
getChannelListJoggle({ termid: id })
.then((res) => {
this.accesslist = res.data.list;
@ -340,10 +386,97 @@ export default {
terminalid: this.selfacilityId,
})
.then((res) => {
// this.$message.success("");
// this.shedulenr = res.data.list.join("; ")
this.shedulenr = res.data.list;
console.log(this.shedulenr);
//
if (this.timeProtocol == "65283") {
console.log("1111111111111111111111111111111111111");
var hnarr = [];
for (var i = 0; i < this.shedulenr.length; i++) {
if (i % 3 == 0) {
var hnobj = {};
hnobj.span =
this.shedulenr[i].hour * 60 + this.shedulenr[i].minute;
console.log("时间间隔");
} else if (i % 3 == 1) {
console.log("开始时间");
console.log("a");
let timeDate = new Date();
timeDate.setHours(this.shedulenr[i].hour);
timeDate.setMinutes(this.shedulenr[i].minute);
console.log(timeDate);
hnobj.startTime = timeDate;
} else if (i % 3 == 2) {
console.log("结束时间");
hnobj.endTime =
this.shedulenr[i].hour + ":" + this.shedulenr[i].minute;
let timeDate = new Date();
timeDate.setHours(this.shedulenr[i].hour);
timeDate.setMinutes(this.shedulenr[i].minute);
// hnobj.endTime = c.toJSON();
let timeHour =
timeDate.getHours() < 10
? "0" + timeDate.getHours()
: timeDate.getHours();
let timeMinute =
timeDate.getMinutes() < 10
? "0" + timeDate.getMinutes()
: timeDate.getMinutes();
hnobj.endTime = timeDate;
hnarr.push(hnobj);
}
}
console.log("222222222222222222");
console.log(hnarr);
console.log("22222222222222222222222");
let dayArr = [];
//
for (let k = 0; k < hnarr.length; k++) {
console.log(hnarr[k].startTime);
console.log(hnarr[k].endTime);
console.log(hnarr[k].span);
let startDay = hnarr[k].startTime;
let endDay = hnarr[k].endTime;
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(hnarr[k].span, "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);
this.shedulenr = dayArr;
}
}
//
if (this.timeProtocol == "65286") {
console.log("河南规约");
var hnarr = [];
for (var i = 0; i < this.shedulenr.length; i++) {
console.log(this.shedulenr[i].hour);
let timeDate = new Date();
timeDate.setHours(this.shedulenr[i].hour);
timeDate.setMinutes(this.shedulenr[i].minute);
console.log(timeDate);
hnarr.push(timeDate);
}
console.log(hnarr);
this.shedulenr = hnarr;
}
this.offsetnum = res.data.offset;
this.loading = false;
})
.catch((err) => {
@ -362,9 +495,95 @@ export default {
terminalid: this.selfacilityId,
})
.then((res) => {
// this.$message.success("");
// this.shedulenr = res.data.list.join("; ")
this.shedulenr = res.data.list;
console.log(this.shedulenr);
//
if (this.timeProtocol == "65283") {
console.log("1111111111111111111111111111111111111");
var hnarr = [];
for (var i = 0; i < this.shedulenr.length; i++) {
if (i % 3 == 0) {
var hnobj = {};
hnobj.span =
this.shedulenr[i].hour * 60 + this.shedulenr[i].minute;
console.log("时间间隔");
} else if (i % 3 == 1) {
console.log("开始时间");
console.log("a");
let timeDate = new Date();
timeDate.setHours(this.shedulenr[i].hour);
timeDate.setMinutes(this.shedulenr[i].minute);
console.log(timeDate);
hnobj.startTime = timeDate;
} else if (i % 3 == 2) {
console.log("结束时间");
hnobj.endTime =
this.shedulenr[i].hour + ":" + this.shedulenr[i].minute;
let timeDate = new Date();
timeDate.setHours(this.shedulenr[i].hour);
timeDate.setMinutes(this.shedulenr[i].minute);
// hnobj.endTime = c.toJSON();
let timeHour =
timeDate.getHours() < 10
? "0" + timeDate.getHours()
: timeDate.getHours();
let timeMinute =
timeDate.getMinutes() < 10
? "0" + timeDate.getMinutes()
: timeDate.getMinutes();
hnobj.endTime = timeDate;
hnarr.push(hnobj);
}
}
console.log("222222222222222222");
console.log(hnarr);
console.log("22222222222222222222222");
let dayArr = [];
//
for (let k = 0; k < hnarr.length; k++) {
console.log(hnarr[k].startTime);
console.log(hnarr[k].endTime);
console.log(hnarr[k].span);
let startDay = hnarr[k].startTime;
let endDay = hnarr[k].endTime;
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(hnarr[k].span, "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);
this.shedulenr = dayArr;
}
}
//
if (this.timeProtocol == "65286") {
console.log("河南规约");
var hnarr = [];
for (var i = 0; i < this.shedulenr.length; i++) {
console.log(this.shedulenr[i].hour);
let timeDate = new Date();
timeDate.setHours(this.shedulenr[i].hour);
timeDate.setMinutes(this.shedulenr[i].minute);
console.log(timeDate);
hnarr.push(timeDate);
}
console.log(hnarr);
this.shedulenr = hnarr;
}
this.offsetnum = res.data.offset;
this.loading = false;
})
@ -405,6 +624,99 @@ export default {
// this.shedulenr = res.data.list.join("; ")
this.compareloading = false;
this.newshedulenr = res.data.list;
//
if (this.timeProtocol == "65283") {
console.log("湖南规约");
console.log("1111111111111111111111111111111111111");
var hnarr = [];
for (var i = 0; i < this.newshedulenr.length; i++) {
if (i % 3 == 0) {
var hnobj = {};
hnobj.span =
this.newshedulenr[i].hour * 60 +
this.newshedulenr[i].minute;
console.log("时间间隔");
} else if (i % 3 == 1) {
console.log("开始时间");
console.log("a");
let timeDate = new Date();
timeDate.setHours(this.newshedulenr[i].hour);
timeDate.setMinutes(this.newshedulenr[i].minute);
console.log(timeDate);
hnobj.startTime = timeDate;
} else if (i % 3 == 2) {
console.log("结束时间");
hnobj.endTime =
this.newshedulenr[i].hour +
":" +
this.newshedulenr[i].minute;
let timeDate = new Date();
timeDate.setHours(this.newshedulenr[i].hour);
timeDate.setMinutes(this.newshedulenr[i].minute);
// hnobj.endTime = c.toJSON();
let timeHour =
timeDate.getHours() < 10
? "0" + timeDate.getHours()
: timeDate.getHours();
let timeMinute =
timeDate.getMinutes() < 10
? "0" + timeDate.getMinutes()
: timeDate.getMinutes();
hnobj.endTime = timeDate;
hnarr.push(hnobj);
}
}
console.log("222222222222222222");
console.log(hnarr);
console.log("22222222222222222222222");
let dayArr = [];
//
for (let k = 0; k < hnarr.length; k++) {
console.log(hnarr[k].startTime);
console.log(hnarr[k].endTime);
console.log(hnarr[k].span);
let startDay = hnarr[k].startTime;
let endDay = hnarr[k].endTime;
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(hnarr[k].span, "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);
this.newshedulenr = dayArr;
}
}
//
if (this.timeProtocol == "65286") {
console.log("河南规约");
var hnarr = [];
for (var i = 0; i < this.newshedulenr.length; i++) {
console.log(this.newshedulenr[i].hour);
let timeDate = new Date();
timeDate.setHours(this.newshedulenr[i].hour);
timeDate.setMinutes(this.newshedulenr[i].minute);
console.log(timeDate);
hnarr.push(timeDate);
}
console.log(hnarr);
this.newshedulenr = hnarr;
}
this.timernum = 0;
// this.$message.success("");
clearInterval(this.timer);
@ -537,11 +849,14 @@ export default {
},
//-
handleSet(val) {
console.log(this.setNum);
var deviceOffsetnum = this.setNum;
this.loading = true;
this.scheduleid = val.id;
this.isShowset = true;
console.log(val);
this.scheduleInfo = val.list;
this.scheduleInfo = val.listTime;
console.log("1111111", deviceOffsetnum);
this.timeName = val.name;
getScheduleRulelAccessList({ termid: this.selfacilityId })
.then((res) => {
@ -556,6 +871,8 @@ export default {
zzname: this.listnr[0].list[0].list[0].name,
zzcmid: this.listnr[0].list[0].list[0].cmdid,
zzid: this.listnr[0].list[0].list[0].id,
zzprotocol: this.timeProtocol,
offsetNum: deviceOffsetnum,
};
this.zzchannel = this.listnr[0].list[0].list[0].list;
console.log(this.deviceListData);
@ -625,15 +942,149 @@ export default {
getTermStatus({ termId: this.deviceListData.zzid }).then((res) => {
console.log(res);
if (res.data.isonline) {
var ruleBox = [];
//
//
let timearr = [];
let dayArr = [];
console.log(this.scheduleInfo);
for (var j = 0; j < this.scheduleInfo.length; j++) {
var Stime = moment(this.scheduleInfo[j].startTime)
.add(this.deviceListData.offsetNum, "minute")
.format();
var Etime = moment(this.scheduleInfo[j].endTime)
.add(this.deviceListData.offsetNum, "minute")
.format();
var lastETime = moment(this.scheduleInfo[j].endTime).format();
var spanTime = this.scheduleInfo[j].span;
console.log(Stime, Etime, spanTime);
console.log(moment(this.scheduleInfo[j].endTime).hour());
//
if (this.deviceListData.zzprotocol == "65283") {
console.log("湖南规约");
console.log(Stime, Etime);
console.log(typeof Stime);
console.log(
moment(this.scheduleInfo[j].endTime)
.add(this.deviceListData.offsetNum, "minute")
.hour()
);
console.log(
moment(this.scheduleInfo[j].endTime)
.add(this.deviceListData.offsetNum, "minute")
.minute()
);
if (moment().isSame(moment(Etime), "day")) {
//
timearr.push(
{
hour: Math.floor(this.scheduleInfo[j].span / 60),
minute: this.scheduleInfo[j].span % 60,
preset: 255,
},
{
hour: moment(this.scheduleInfo[j].startTime)
.add(this.deviceListData.offsetNum, "minute")
.hour(),
minute: moment(this.scheduleInfo[j].startTime)
.add(this.deviceListData.offsetNum, "minute")
.minute(),
preset: 255,
},
{
hour: moment(this.scheduleInfo[j].endTime)
.add(this.deviceListData.offsetNum, "minute")
.hour(),
minute: moment(this.scheduleInfo[j].endTime)
.add(this.deviceListData.offsetNum, "minute")
.minute(),
preset: 255,
}
);
} else {
timearr.push(
{
hour: Math.floor(this.scheduleInfo[j].span / 60),
minute: this.scheduleInfo[j].span % 60,
preset: 255,
},
{
hour: moment(this.scheduleInfo[j].startTime)
.add(this.deviceListData.offsetNum, "minute")
.hour(),
minute: moment(this.scheduleInfo[j].startTime)
.add(this.deviceListData.offsetNum, "minute")
.minute(),
preset: 255,
},
{
hour: moment(this.scheduleInfo[j].endTime).hour(),
minute: moment(this.scheduleInfo[j].endTime).minute(),
preset: 255,
}
);
}
console.log(timearr);
}
}
////
if (this.deviceListData.zzprotocol == "65286") {
console.log("河南规约");
//
//this.getDayArr(startDay, endDay);
let startDay = Stime;
let endDay = Etime;
var lastendDay = lastETime;
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);
}
// //
if (!moment().isSame(moment(endDay), "day")) {
dayArr.push(
this.$moment(new Date(lastETime)).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,
});
}
// return dayArr;
}
var parmsobj = {
termid: this.deviceListData.zzid,
channelid: this.checkList,
offset: this.deviceListData.offsetNum,
list: timearr,
};
console.log(parmsobj);
ruleBox.push(parmsobj);
console.log(ruleBox);
setScheduleRulel({
scheduleid: this.scheduleid,
list: [
{
termid: this.deviceListData.zzid,
channelidlist: [this.checkList],
offset: this.setNum,
},
],
list: ruleBox,
})
.then((res) => {
console.log(res);
@ -703,7 +1154,7 @@ export default {
closebtn() {
this.isShowset = false;
this.checkList = "";
this.setNum = Math.floor(Math.random() * 10);
// this.setNum = this.offsetnum;
this.deviceList();
clearInterval(this.timers);

@ -343,6 +343,7 @@ export default {
swiperLoading: false,
zzCmdid: "",
zztermId: "",
zzprotocol: "", //
dateValue: "", //
pickerOptions: {
disabledDate(date) {
@ -406,6 +407,7 @@ export default {
console.log(data);
this.selectData = data;
this.zztermId = data.id;
this.zzprotocol = data.protocol;
this.CurrentData = data;
//this.previewData = data;
if (data.dyValue) {
@ -922,7 +924,11 @@ export default {
handleSetSchedule() {
this.clearfun();
this.$refs.setschedule_ref.display();
this.$refs.setschedule_ref.getSingleAccess(this.zztermId, this.zzCmdid);
this.$refs.setschedule_ref.getSingleAccess(
this.zztermId,
this.zzCmdid,
this.zzprotocol
);
this.$refs.setschedule_ref.deviceList();
},
//线

Loading…
Cancel
Save