更改下发指令逻辑

hn2.0
fanluyan 2 years ago
parent 1532436d58
commit 1c0bec39d8

@ -274,6 +274,7 @@ export default {
type: "", // type: "", //
lineTreeData: [], lineTreeData: [],
filterText: "", filterText: "",
searchName: "",
defaultProps: { defaultProps: {
// //
children: "list", children: "list",
@ -348,6 +349,7 @@ export default {
// }, // },
//treenode //treenode
handleNodeClick(data) { handleNodeClick(data) {
this.clearfun();
console.log(data); console.log(data);
this.selectData = data; this.selectData = data;
this.zztermId = data.id; this.zztermId = data.id;
@ -394,12 +396,17 @@ export default {
}); });
}, },
// //
filterNode(value, data) { filterNode(value, data, node) {
console.log(value, data); console.log(value, data, node);
if (!value) return true;
console.log(data.name);
return data.name.indexOf(value) !== -1; //
if (!value) return true;
this.searchName = data.name + data.cmdid;
console.log(this.searchName);
// valuedatalabel
if (this.searchName.indexOf(value) !== -1) {
return true;
}
}, },
// //
getLineTreeList() { getLineTreeList() {
@ -509,6 +516,7 @@ export default {
}, },
// //
getTerminalPhotoList(id, date, termId) { getTerminalPhotoList(id, date, termId) {
this.clearfun();
this.terminalPhoto = []; this.terminalPhoto = [];
console.log(id, date, termId); console.log(id, date, termId);
this.swiperLoading = true; this.swiperLoading = true;
@ -628,9 +636,10 @@ export default {
this.requestId = res.data.requestId; //requestid this.requestId = res.data.requestId; //requestid
this.picTime = res.data.taketime; // this.picTime = res.data.taketime; //
console.log(this.requestId); console.log(this.requestId);
console.log(this.picTime);
this.btnpicloading = true; this.btnpicloading = true;
this.statusTimer = window.setInterval(() => { this.statusTimer = window.setInterval(() => {
this.getTakePicStatus(this.requestId); this.getTakePicStatus(res.data);
this.statusNum++; this.statusNum++;
}, 2000); }, 2000);
}) })
@ -650,6 +659,7 @@ export default {
// //
handleCommandvideo(command) { handleCommandvideo(command) {
console.log(command); console.log(command);
this.clearfun();
getTermStatus({ termId: this.zztermId }).then((res) => { getTermStatus({ termId: this.zztermId }).then((res) => {
console.log(res); console.log(res);
if (res.data.isonline) { if (res.data.isonline) {
@ -689,12 +699,14 @@ export default {
getTakePicStatus(data) { getTakePicStatus(data) {
console.log(data); console.log(data);
getTakePicStatusJoggle({ getTakePicStatusJoggle({
requestid: data, requestid: data.requestId,
termId: this.zztermId,
photoTime: new Date(data.taketime).getTime(),
}) })
.then((res) => { .then((res) => {
console.log(res); console.log(res);
//res.data 0 1 2 //res.data 0 1 2
if (res.data == 0 && this.statusNum >= 5) { if (res.data.cmaStatus == 0 && this.statusNum >= 5) {
this.statusNum = 0; this.statusNum = 0;
clearInterval(this.statusTimer); clearInterval(this.statusTimer);
this.statusTimer = null; this.statusTimer = null;
@ -706,7 +718,7 @@ export default {
message: "下发指令超时,请重试!", message: "下发指令超时,请重试!",
type: "warning", type: "warning",
}); });
} else if (res.data == 1) { } else if (res.data.cmaStatus == 1) {
this.statusNum = 0; this.statusNum = 0;
this.btnpicloading = false; this.btnpicloading = false;
this.btnvideoloading = false; this.btnvideoloading = false;
@ -722,7 +734,7 @@ export default {
this.newPicApi(); this.newPicApi();
this.i++; this.i++;
}, 8000); }, 8000);
} else if (res.data == 2) { } else if (res.data.cmaStatus == 2) {
this.statusNum = 0; this.statusNum = 0;
this.btnpicloading = false; this.btnpicloading = false;
this.btnvideoloading = false; this.btnvideoloading = false;
@ -745,6 +757,7 @@ export default {
getTakePicPhotoStatusJoggle({ getTakePicPhotoStatusJoggle({
photoTime: new Date(this.picTime).getTime(), photoTime: new Date(this.picTime).getTime(),
termId: this.zztermId, termId: this.zztermId,
requestid: this.requestId,
}).then((res) => { }).then((res) => {
console.log(res.data); console.log(res.data);
// // console.log(this.i); // // console.log(this.i);
@ -789,6 +802,7 @@ export default {
handleWarn(val) { handleWarn(val) {
console.log("声光报警"); console.log("声光报警");
console.log(this.zztermId); console.log(this.zztermId);
this.clearfun();
getTermStatus({ termId: this.zztermId }).then((res) => { getTermStatus({ termId: this.zztermId }).then((res) => {
console.log(res); console.log(res);
if (res.data.isonline) { if (res.data.isonline) {
@ -837,12 +851,14 @@ export default {
}, },
// //
handleSetSchedule() { handleSetSchedule() {
this.clearfun();
this.$refs.setschedule_ref.display(); this.$refs.setschedule_ref.display();
this.$refs.setschedule_ref.getSingleAccess(this.zztermId, this.zzCmdid); this.$refs.setschedule_ref.getSingleAccess(this.zztermId, this.zzCmdid);
this.$refs.setschedule_ref.deviceList(); this.$refs.setschedule_ref.deviceList();
}, },
//线 //线
handleCommandLine(command) { handleCommandLine(command) {
this.clearfun();
switch (command) { switch (command) {
case "open": // case "open": //
this.$refs.carouselpic.openline(); this.$refs.carouselpic.openline();
@ -854,6 +870,7 @@ export default {
}, },
//handleShowInfo //handleShowInfo
handleShowInfo() { handleShowInfo() {
this.clearfun();
getTermStatus({ termId: this.zztermId }).then((res) => { getTermStatus({ termId: this.zztermId }).then((res) => {
console.log(res); console.log(res);
if (res.data.isonline) { if (res.data.isonline) {
@ -872,6 +889,7 @@ export default {
}, },
//GPS //GPS
handleShowGPS() { handleShowGPS() {
this.clearfun();
this.$refs.gpsdialog_ref.display(this.zzCmdid, this.zztermId); this.$refs.gpsdialog_ref.display(this.zzCmdid, this.zztermId);
this.$refs.gpsdialog_ref.getgpssql(); this.$refs.gpsdialog_ref.getgpssql();
}, },
@ -888,6 +906,7 @@ export default {
}, },
changeGPS(val, cmdid) { changeGPS(val, cmdid) {
console.log(val, cmdid); console.log(val, cmdid);
this.clearfun();
setTermGPSJoggle({ gpsstatus: val, cmdId: cmdid }) setTermGPSJoggle({ gpsstatus: val, cmdId: cmdid })
.then((res) => { .then((res) => {
console.log(res); console.log(res);
@ -942,6 +961,7 @@ export default {
}, },
}); });
// sessionStorage.setItem("keyPath", " realTimeSearch"); // sessionStorage.setItem("keyPath", " realTimeSearch");
this.clearfun();
}, },
// //
dragControllerDiv() { dragControllerDiv() {
@ -985,31 +1005,33 @@ export default {
}; };
} }
}, },
}, clearfun() {
console.log("清除轮询");
destroyed() { this.statusNum = 0;
// this.i = 0;
clearInterval(this.treetimer);
this.treetimer = null;
// //
clearInterval(this.statusTimer); clearInterval(this.statusTimer);
this.statusTimer = null; this.statusTimer = null;
//
if (this.timer) { if (this.timer) {
console.log(this.timer); console.log(this.timer);
clearInterval(this.timer); clearInterval(this.timer);
this.timer = null; this.timer = null;
} //vue } //vue
}, },
beforeRouteLeave(to, from, next) { },
//
next(); destroyed() {
//
clearInterval(this.treetimer);
this.treetimer = null;
//
clearInterval(this.statusTimer);
this.statusTimer = null;
if (this.timer) { if (this.timer) {
console.log(this.timer); console.log(this.timer);
clearInterval(this.timer); clearInterval(this.timer);
this.timer = null; this.timer = null;
} } //vue
}, },
}; };
</script> </script>

@ -142,7 +142,7 @@ export default {
// //
changedate2() { changedate2() {
console.log(this.dateValue2.getTime()); console.log(this.dateValue2.getTime());
this.dateValue = this.dateValue2.getTime(); this.dateValue2 = this.dateValue2.getTime();
this.getTodayAlarmStatistics(); this.getTodayAlarmStatistics();
}, },
// //

Loading…
Cancel
Save