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");
});