提交 773179eb 作者: 翁进城

feat: mock飞机屏蔽任务结束提示

上级 6d36ef3a
...@@ -19,40 +19,40 @@ export default { ...@@ -19,40 +19,40 @@ export default {
ControlPanel, ControlPanel,
}, },
data() { data() {
return {}; return {};
}, },
computed: { computed: {
...mapState("MMCFlightControlCenter/hangar", ["showPanel", "hangar"]), ...mapState("MMCFlightControlCenter/hangar", ["showPanel", "hangar"]),
...mapState("MMCFlightControlCenter/uav", ["uavRealTimeData"]), ...mapState("MMCFlightControlCenter/uav", ["uav", "uavRealTimeData"]),
}, },
watch: { watch: {
'uavRealTimeData.isFlying'(newVal, oldVal){ "uavRealTimeData.isFlying"(newVal, oldVal) {
// 监听飞机降落然后进行任务结束的提示 // 监听飞机降落然后进行任务结束的提示
if(oldVal === true && newVal === false){ if (oldVal === true && newVal === false) {
this.$alert('当前任务已结束', '提示', { if (!this.uav.deviceId.include("mock")) {
type: 'success ', this.$alert("当前任务已结束", "提示", {
confirmButtonText: '确定', type: "success ",
callback: action => { confirmButtonText: "确定",
}, callback: (action) => {},
}); });
setTimeout(() => { setTimeout(() => {
const dialog = document.querySelector('.el-message-box__wrapper'); const dialog = document.querySelector(".el-message-box__wrapper");
if (dialog) { if (dialog) {
const closeButton = dialog.querySelector('.el-button'); const closeButton = dialog.querySelector(".el-button");
if (closeButton) { if (closeButton) {
closeButton.click(); closeButton.click();
} }
} }
}, 3000); }, 3000);
}
} }
} },
}, },
beforeDestroy() { beforeDestroy() {
this.$store.commit('MMCFlightControlCenter/setState', { this.$store.commit("MMCFlightControlCenter/setState", {
key: 'listCollapse', key: "listCollapse",
value: false value: false,
}) });
}, },
}; };
</script> </script>
......
...@@ -39,20 +39,22 @@ export default { ...@@ -39,20 +39,22 @@ export default {
"uavRealTimeData.isFlying"(newVal, oldVal) { "uavRealTimeData.isFlying"(newVal, oldVal) {
// 监听飞机降落然后进行任务结束的提示 // 监听飞机降落然后进行任务结束的提示
if (oldVal === true && newVal === false) { if (oldVal === true && newVal === false) {
this.$alert("当前任务已结束", "提示", { if (!this.uav.deviceId.include("mock")) {
type: "success ", this.$alert("当前任务已结束", "提示", {
confirmButtonText: "确定", type: "success ",
callback: (action) => { }, confirmButtonText: "确定",
}); callback: (action) => {},
setTimeout(() => { });
const dialog = document.querySelector('.el-message-box__wrapper'); setTimeout(() => {
if (dialog) { const dialog = document.querySelector(".el-message-box__wrapper");
const closeButton = dialog.querySelector('.el-button'); if (dialog) {
const closeButton = dialog.querySelector(".el-button");
if (closeButton) { if (closeButton) {
closeButton.click(); closeButton.click();
} }
} }
}, 3000); }, 3000);
}
} }
}, },
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论