From c088e7b2efb44ea18ee05e5c36f526585da322be Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Thu, 15 Jun 2023 16:46:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0loading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/setschedule.vue | 59 +++++++++++-------- src/views/realTimeMonitor/index.vue | 56 +++++------------- 2 files changed, 51 insertions(+), 64 deletions(-) diff --git a/src/views/realTimeMonitor/components/setschedule.vue b/src/views/realTimeMonitor/components/setschedule.vue index 063778d..9bc62d9 100644 --- a/src/views/realTimeMonitor/components/setschedule.vue +++ b/src/views/realTimeMonitor/components/setschedule.vue @@ -243,6 +243,7 @@ import { cmaSchelduleDetials, getCmaSchelduleDetials, getCmaSchelduleUpload, + getTermStatus, } from "@/utils/api/index"; export default { props: { @@ -514,34 +515,46 @@ export default { if (this.checkList.length == 0) { this.$message.error("请选择通道"); } else { - setScheduleRulel({ - scheduleid: this.scheduleid, - list: [ - { - termid: this.deviceListData.zzid, - channelidlist: [this.checkList], - offset: this.setNum, - }, - ], - }) - .then((res) => { - console.log(res); - this.requestList = res.data.list; - this.requestTime(); - this.timers = window.setInterval(() => { - //console.log(this.requestList); - this.requestTime(); - this.i++; - }, 3000); - }) - .catch((err) => { + getTermStatus({ termId: this.deviceListData.zzid }).then((res) => { + console.log(res); + if (res.data.isonline) { + setScheduleRulel({ + scheduleid: this.scheduleid, + list: [ + { + termid: this.deviceListData.zzid, + channelidlist: [this.checkList], + offset: this.setNum, + }, + ], + }) + .then((res) => { + console.log(res); + this.requestList = res.data.list; + this.requestTime(); + this.timers = window.setInterval(() => { + //console.log(this.requestList); + this.requestTime(); + this.i++; + }, 3000); + }) + .catch((err) => { + this.$message({ + duration: 1500, + showClose: true, + message: "添加失败", + type: "error", + }); + }); + } else { this.$message({ duration: 1500, showClose: true, - message: "添加失败", + message: "装置下线,发送指令失败", type: "error", }); - }); + } + }); } }, //下发时间表 diff --git a/src/views/realTimeMonitor/index.vue b/src/views/realTimeMonitor/index.vue index 5adb43a..d9ff9f4 100644 --- a/src/views/realTimeMonitor/index.vue +++ b/src/views/realTimeMonitor/index.vue @@ -55,7 +55,7 @@
-
+
拍照时间表 - + 关闭 - -
@@ -259,8 +243,8 @@ export default { totalPic: "", dateValue: "", //日期 nopicPath: require("@/assets/img/nopic.jpg"), - loadingBg: true, - loading: true, + loadingBg: false, + loadingpic: false, newPicData: "", timer: null, treetimer: null, @@ -453,7 +437,7 @@ export default { }, //获取图片 getTerminalPhotoList(id, date, termId) { - this.loading = true; + this.loadingpic = true; this.terminalPhoto = []; console.log(id, date, termId); getTerminalPhotoListJoggle({ @@ -478,7 +462,7 @@ export default { console.log(this.terminalPhoto.length); this.totalPic = res.data.num; //this.$refs.a.getphotodata(this.terminalPhoto); - this.loading = false; + this.loadingpic = false; console.log(this.terminalPhoto); }) .catch((err) => { @@ -505,25 +489,9 @@ export default { //设置时间表 handleSetSchedule() { - getTermStatus({ termId: this.newTermId }).then((res) => { - console.log(res); - if (res.data.isonline) { - this.$refs.setschedule_ref.display(); - this.$refs.setschedule_ref.getSingleAccess( - this.channelId, - this.cmdid - ); - this.$refs.setschedule_ref.deviceList(); - } else { - this.btnpicloading = false; - this.$message({ - duration: 1500, - showClose: true, - message: "装置下线,发送指令失败", - type: "error", - }); - } - }); + this.$refs.setschedule_ref.display(); + this.$refs.setschedule_ref.getSingleAccess(this.channelId, this.cmdid); + this.$refs.setschedule_ref.deviceList(); }, handleCommandWarn(command) { switch (command) { @@ -613,6 +581,7 @@ export default { console.log(res); if (res.data.isonline) { this.btnpicloading = true; + this.loadingpic = true; getLatestPhotoJoggle({ captureType: 0, channel: command, @@ -642,6 +611,7 @@ export default { }); } else { this.btnpicloading = false; + this.loadingpic = false; this.$message({ duration: 1500, showClose: true, @@ -659,6 +629,7 @@ export default { console.log(res); if (res.data.isonline) { this.btnvideoloading = true; + this.loadingpic = true; getLatestPhotoJoggle({ captureType: 1, channel: command, @@ -686,6 +657,8 @@ export default { console.log(err); //代码错误、请求失败捕获 }); } else { + this.btnvideoloading = false; + this.loadingpic = false; this.$message({ duration: 1500, showClose: true, @@ -730,6 +703,7 @@ export default { }); this.btnpicloading = false; this.btnvideoloading = false; + this.loadingpic = false; } console.log("2222222222222222"); });