|
|
|
@ -365,6 +365,7 @@ import setschedule from "./components/setschedule.vue";
|
|
|
|
|
import infoDialog from "./components/infoDialog.vue";
|
|
|
|
|
import gpsPosition from "./components/gpsPosition.vue";
|
|
|
|
|
import morePicPreveiw from "./components/morePicPreveiw.vue";
|
|
|
|
|
import socketService from "../../../socket/index";
|
|
|
|
|
import { number } from "echarts";
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
@ -440,6 +441,7 @@ export default {
|
|
|
|
|
}, //收藏夹参数
|
|
|
|
|
favorOptions: [], //收藏夹列表
|
|
|
|
|
carouselKey: 0, // 初始key
|
|
|
|
|
picnotiy: [],
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
@ -460,12 +462,23 @@ export default {
|
|
|
|
|
deep: true,
|
|
|
|
|
immediate: true,
|
|
|
|
|
},
|
|
|
|
|
picnotiy: {
|
|
|
|
|
handler(newVal, oldVal) {
|
|
|
|
|
console.log(newVal);
|
|
|
|
|
console.log(oldVal);
|
|
|
|
|
console.log("我是通知信息,我改变了");
|
|
|
|
|
},
|
|
|
|
|
deep: true,
|
|
|
|
|
immediate: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
computed: {},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.dragControllerDiv();
|
|
|
|
|
this.getDateTime();
|
|
|
|
|
this.initWebSocket();
|
|
|
|
|
window.addEventListener("onmessageWS", this.getSocketData);
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
//获取日期
|
|
|
|
@ -477,7 +490,7 @@ export default {
|
|
|
|
|
this.getLineTreeList();
|
|
|
|
|
this.treetimer = window.setInterval(() => {
|
|
|
|
|
setTimeout(this.getLineTreeStatus(), 0);
|
|
|
|
|
}, 300000);
|
|
|
|
|
}, 1800000);
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
//获取当前选中的radio
|
|
|
|
@ -635,46 +648,6 @@ export default {
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.$refs.tree.setCurrentKey(this.currentNodekey); //一定要加这个选中了否则样式没有出来
|
|
|
|
|
});
|
|
|
|
|
// }
|
|
|
|
|
// if (this.zzradio == -1) {
|
|
|
|
|
// this.lineTreeData = this.lineTreeData;
|
|
|
|
|
// } else if (this.zzradio == 1) {
|
|
|
|
|
// //在线
|
|
|
|
|
// var data = JSON.parse(JSON.stringify(this.lineTreeData));
|
|
|
|
|
// console.log(data);
|
|
|
|
|
// const filterId = (data, id) => {
|
|
|
|
|
// if (!Array.isArray(data)) {
|
|
|
|
|
// return data;
|
|
|
|
|
// }
|
|
|
|
|
// return data.filter((item) => {
|
|
|
|
|
// if ("list" in item) {
|
|
|
|
|
// item.list = filterId(item.list, id);
|
|
|
|
|
// }
|
|
|
|
|
// return item.onlinestatus !== 0;
|
|
|
|
|
// });
|
|
|
|
|
// };
|
|
|
|
|
// const filtredData = filterId(data);
|
|
|
|
|
// console.log(filtredData);
|
|
|
|
|
// this.lineTreeData = filtredData;
|
|
|
|
|
// } else if (this.zzradio == 0) {
|
|
|
|
|
// //离线
|
|
|
|
|
// var data = JSON.parse(JSON.stringify(this.lineTreeData));
|
|
|
|
|
// console.log(data);
|
|
|
|
|
// const filterId = (data, id) => {
|
|
|
|
|
// if (!Array.isArray(data)) {
|
|
|
|
|
// return data;
|
|
|
|
|
// }
|
|
|
|
|
// return data.filter((item) => {
|
|
|
|
|
// if ("list" in item) {
|
|
|
|
|
// item.list = filterId(item.list, id);
|
|
|
|
|
// }
|
|
|
|
|
// return item.onlinestatus !== 1;
|
|
|
|
|
// });
|
|
|
|
|
// };
|
|
|
|
|
// const filtredData = filterId(data);
|
|
|
|
|
// console.log(filtredData);
|
|
|
|
|
// this.lineTreeData = filtredData;
|
|
|
|
|
// }
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
console.log(err); //代码错误、请求失败捕获
|
|
|
|
@ -968,6 +941,7 @@ export default {
|
|
|
|
|
//主动拍照
|
|
|
|
|
handleCommandpic(command) {
|
|
|
|
|
console.log(command);
|
|
|
|
|
// localStorage.setItem("picNotify", "");
|
|
|
|
|
getTermStatus({ termId: this.zztermId }).then((res) => {
|
|
|
|
|
console.log(res);
|
|
|
|
|
if (res.data.isonline) {
|
|
|
|
@ -1080,12 +1054,13 @@ export default {
|
|
|
|
|
message: "下发指令成功!",
|
|
|
|
|
type: "success",
|
|
|
|
|
});
|
|
|
|
|
clearInterval(this.timer);
|
|
|
|
|
this.timer = null;
|
|
|
|
|
this.timer = window.setInterval(() => {
|
|
|
|
|
this.newPicApi();
|
|
|
|
|
this.i++;
|
|
|
|
|
}, 8000);
|
|
|
|
|
|
|
|
|
|
// clearInterval(this.timer);
|
|
|
|
|
// this.timer = null;
|
|
|
|
|
// this.timer = window.setInterval(() => {
|
|
|
|
|
// this.newPicApi();
|
|
|
|
|
// this.i++;
|
|
|
|
|
// }, 8000);
|
|
|
|
|
} else if (res.data.cmaStatus == 2) {
|
|
|
|
|
this.statusNum = 0;
|
|
|
|
|
this.btnpicloading = false;
|
|
|
|
@ -1104,6 +1079,27 @@ export default {
|
|
|
|
|
console.log(err); //代码错误、请求失败捕获
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
async initWebSocket() {
|
|
|
|
|
console.log(this.$websocket);
|
|
|
|
|
this.$websocket.initWebSocket();
|
|
|
|
|
},
|
|
|
|
|
getSocketData(res) {
|
|
|
|
|
console.log(res);
|
|
|
|
|
console.log(JSON.parse(res.detail.data));
|
|
|
|
|
let a = JSON.parse(res.detail.data);
|
|
|
|
|
console.log(a.type);
|
|
|
|
|
console.log(a.action);
|
|
|
|
|
if (a.action == "photo") {
|
|
|
|
|
this.$notify({
|
|
|
|
|
title: "通知",
|
|
|
|
|
message: a.content,
|
|
|
|
|
position: "bottom-right",
|
|
|
|
|
type: "warning",
|
|
|
|
|
duration: 60000,
|
|
|
|
|
});
|
|
|
|
|
// this.newPicApi();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//获取最新图片
|
|
|
|
|
newPicApi() {
|
|
|
|
|
getTakePicPhotoStatusJoggle({
|
|
|
|
|