- 查询
+ 查询
@@ -152,6 +171,7 @@ export default {
return {
loading: false,
isShow: false,
+ searchloading: false,
activeName: "1", //选项卡
accesslist: [], //通道选择器
colorlist: [
@@ -221,6 +241,7 @@ export default {
//查询触发
inquirebtn() {
this.loading = true;
+ this.searchloading = true;
getPhotoParamApi({
channelId: this.selaccess,
cmdId: this.selcmdId,
@@ -232,7 +253,7 @@ export default {
this.timer = window.setInterval(() => {
this.inquirenr();
this.i++;
- }, 10000);
+ }, 1000);
} else {
this.$message.error(res.code.msg);
}
@@ -251,11 +272,16 @@ export default {
if (res.code == 200) {
this.capturenr = res.data;
if (res.data.isNew == true) {
+ this.searchloading = false;
+ this.i = 0;
this.$message.success("查询已更新");
clearInterval(this.timer);
this.timer = null;
} else if (this.i > 9) {
+ this.searchloading = false;
+ this.i = 0;
this.$message.warning("暂无响应,请稍后再试!");
+
clearInterval(this.timer);
this.timer = null;
}
@@ -295,6 +321,8 @@ export default {
this.isShow = false;
},
handleclose() {
+ this.searchloading = false;
+ this.i = 0;
clearInterval(this.timer);
this.timer = null;
},
diff --git a/src/views/realTimeMonitor/components/infoDialog.vue b/src/views/realTimeMonitor/components/infoDialog.vue
index b1d8312..2176a67 100644
--- a/src/views/realTimeMonitor/components/infoDialog.vue
+++ b/src/views/realTimeMonitor/components/infoDialog.vue
@@ -100,16 +100,17 @@ export default {
if (res.code == 200) {
this.infornr = res.data;
if (res.data.isNew == true) {
+ this.i = 0;
this.$message.success("装置信息已更新");
clearInterval(this.timer);
- } else if(this.i > 9) {
+ } else if (this.i > 9) {
+ this.i = 0;
this.$message.warning("暂无响应,请稍后再试!");
clearInterval(this.timer);
}
} else {
this.$message.error(res.code.msg);
}
-
})
.catch((err) => {});
},
@@ -120,7 +121,9 @@ export default {
this.isShow = false;
},
handleclose() {
+ this.i = 0;
clearInterval(this.timer);
+ this.timer = null;
},
},
};