提交 d00ec496 作者: 翁进城

fix: 周期与定时飞行增加定时器刷新列表

上级 c11e07b6
......@@ -70,7 +70,7 @@ export default {
return {
showTaskAdd: false,
taskListAll: [],
lastMsg: null
timeHandle: null,
};
},
computed: {
......@@ -81,37 +81,19 @@ export default {
]),
},
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() {
this.rootNode.$emit("hangarTaskTabChange", {
type: 3,
});
this.getTaskList();
this.timeHandle = setInterval(() => {
this.getTaskList();
}, 5000);
},
beforeDestroy() {
this.clearAirwayEntities();
clearInterval(this.timeHandle);
},
methods: {
...mapActions("MMCFlightControlCenter", [
......
......@@ -23,7 +23,11 @@
<span>{{item.taskStartTime}}</span>
</el-tooltip>
</div>
<div class="row__column" style="color: rgb(255, 189, 54);">{{item.status}}</div>
<div class="row__column" style="color: rgb(255, 189, 54);">
<el-tooltip class="item" effect="dark" :content="item.status" placement="top-start">
<span>{{item.status}}</span>
</el-tooltip>
</div>
<div class="row__column flex2 ctrl">
<el-tooltip content="查看" placement="top">
<span
......@@ -70,7 +74,7 @@ export default {
return {
showTaskAdd: false,
taskListAll: [],
lastMsg: null,
timeHandle: null,
};
},
computed: {
......@@ -82,37 +86,19 @@ export default {
]),
},
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() {
this.rootNode.$emit("hangarTaskTabChange", {
type: 2,
});
this.getTaskList();
this.timeHandle = setInterval(() => {
this.getTaskList();
}, 5000);
},
beforeDestroy() {
this.clearAirwayEntities();
clearInterval(this.timeHandle);
},
methods: {
...mapActions("MMCFlightControlCenter", [
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论