From 9e8d65d9fe136c771ebc54f99e22fa420baff23b Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Wed, 23 Aug 2023 11:42:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=BE=BD=E8=A7=86=E9=A2=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/setschedule.vue | 83 +++++++++---------- src/views/realTimeMonitor/index.vue | 61 +++++--------- 2 files changed, 63 insertions(+), 81 deletions(-) diff --git a/src/views/realTimeMonitor/components/setschedule.vue b/src/views/realTimeMonitor/components/setschedule.vue index 761fcaa..47d4da5 100644 --- a/src/views/realTimeMonitor/components/setschedule.vue +++ b/src/views/realTimeMonitor/components/setschedule.vue @@ -1079,53 +1079,52 @@ export default { console.log(timearr); } - } + ////判断河南规约 + if ( + this.deviceListData.zzprotocol == "65286" || + this.deviceListData.zzprotocol == "65282" || + this.deviceListData.zzprotocol == "65281" + ) { + 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); - ////判断河南规约 - if ( - this.deviceListData.zzprotocol == "65286" || - this.deviceListData.zzprotocol == "65282" || - this.deviceListData.zzprotocol == "65281" - ) { - 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); + } - 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") + ); + } - // // 将结束日期的天放进数组 - 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; } - // return dayArr; } - + 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, + }); + } var parmsobj = { termid: this.deviceListData.zzid, channelid: this.checkList, diff --git a/src/views/realTimeMonitor/index.vue b/src/views/realTimeMonitor/index.vue index 54da154..edb5291 100644 --- a/src/views/realTimeMonitor/index.vue +++ b/src/views/realTimeMonitor/index.vue @@ -421,7 +421,7 @@ export default { zzradio: -1, videoVisible: false, videoForm: { - stream: "0", + stream: 0, time: "20", }, commondChannel: 1, @@ -891,44 +891,8 @@ export default { } }, - setTermFn(dataParams) { - console.log("点击了统一的接口", "runningstatus"); - setTermCamera({ - termId: this.zztermId, - list: dataParams, - }) - .then((res) => { - console.log(res); - this.requestid = res.data.requestId; - //this.getinfo1(); - clearInterval(this.statusTimer); - this.statusTimer = window.setInterval(() => { - this.getinfo(); - this.statusNum++; - }, 1000); - }) - .catch((err) => {}); - }, - getinfo() { - getTermCameraRequest({ requestid: this.requestid }) - .then((res) => { - if (res.data.success == 1) { - this.btnvideoloading = false; - this.statusNum = 0; - clearInterval(this.statusTimer); - this.statusTimer = null; - console.log(res); - } else if (this.statusNum > 9) { - this.btnvideoloading = false; - this.statusNum = 0; - clearInterval(this.statusTimer); - this.statusTimer = null; - console.log(res); - } - }) - .catch((err) => {}); - }, anVideoFn(command) { + this.videoVisible = false; getTermStatus({ termId: this.zztermId }).then((res) => { console.log(res); if (res.data.isonline) { @@ -971,13 +935,32 @@ export default { } }); }, + setTermFn(dataParams) { + console.log("点击了统一的接口", "runningstatus"); + setTermCamera({ + termId: this.zztermId, + list: dataParams, + }) + .then((res) => { + console.log(res); + this.requestId = res.data.requestId; + this.picTime = res.data.date; + this.getTakePicStatus(res.data); + clearInterval(this.statusTimer); + this.statusTimer = window.setInterval(() => { + this.getTakePicStatus(res.data); + this.statusNum++; + }, 3000); + }) + .catch((err) => {}); + }, //获取装置是否下发状态 getTakePicStatus(data) { console.log(data); getTakePicStatusJoggle({ requestid: data.requestId, termId: this.zztermId, - photoTime: new Date(data.taketime).getTime(), + photoTime: new Date(this.picTime).getTime(), }) .then((res) => { console.log(res);