提交 257afc37 作者: 翁进城

fix: 定时任务与周期任务监听日志实现任务状态更新

上级 041bfa16
...@@ -70,6 +70,7 @@ export default { ...@@ -70,6 +70,7 @@ export default {
return { return {
showTaskAdd: false, showTaskAdd: false,
taskListAll: [], taskListAll: [],
lastMsg: null
}; };
}, },
computed: { computed: {
...@@ -79,6 +80,30 @@ export default { ...@@ -79,6 +80,30 @@ export default {
"hangar", "hangar",
]), ]),
}, },
watch: {
"hangarRealTimeData.msgList": {
immediate: false,
handler(msgList) {
// 起飞后执行刷新任务列表, 获取最新状态
if (msgList.length > 0) {
let msg = msgList[msgList.length - 1];
let keyword = "开始上传航线到无人机";
if (msg) {
if (
!this?.lastMsg?.text?.includes(keyword) &&
msg.text.includes(keyword)
) {
this.getTaskList();
}
this.lastMsg = msg;
}
}
},
},
},
created() { created() {
this.rootNode.$emit("hangarTaskTabChange", { this.rootNode.$emit("hangarTaskTabChange", {
type: 3, type: 3,
......
...@@ -70,6 +70,7 @@ export default { ...@@ -70,6 +70,7 @@ export default {
return { return {
showTaskAdd: false, showTaskAdd: false,
taskListAll: [], taskListAll: [],
lastMsg: null,
}; };
}, },
computed: { computed: {
...@@ -80,6 +81,30 @@ export default { ...@@ -80,6 +81,30 @@ export default {
"taskList", "taskList",
]), ]),
}, },
watch: {
"hangarRealTimeData.msgList": {
immediate: false,
handler(msgList) {
// 起飞后执行刷新任务列表, 获取最新状态
if (msgList.length > 0) {
let msg = msgList[msgList.length - 1];
let keyword = "开始上传航线到无人机";
if (msg) {
if (
!this?.lastMsg?.text?.includes(keyword) &&
msg.text.includes(keyword)
) {
this.getTaskList();
}
this.lastMsg = msg;
}
}
},
},
},
created() { created() {
this.rootNode.$emit("hangarTaskTabChange", { this.rootNode.$emit("hangarTaskTabChange", {
type: 2, type: 2,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论