提交 773179eb 作者: 翁进城

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

上级 6d36ef3a
...@@ -19,27 +19,26 @@ export default { ...@@ -19,27 +19,26 @@ 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();
} }
...@@ -48,11 +47,12 @@ export default { ...@@ -48,11 +47,12 @@ export default {
} }
} }
}, },
},
beforeDestroy() { beforeDestroy() {
this.$store.commit('MMCFlightControlCenter/setState', { this.$store.commit("MMCFlightControlCenter/setState", {
key: 'listCollapse', key: "listCollapse",
value: false value: false,
}) });
}, },
}; };
</script> </script>
......
...@@ -39,21 +39,23 @@ export default { ...@@ -39,21 +39,23 @@ export default {
"uavRealTimeData.isFlying"(newVal, oldVal) { "uavRealTimeData.isFlying"(newVal, oldVal) {
// 监听飞机降落然后进行任务结束的提示 // 监听飞机降落然后进行任务结束的提示
if (oldVal === true && newVal === false) { if (oldVal === true && newVal === false) {
if (!this.uav.deviceId.include("mock")) {
this.$alert("当前任务已结束", "提示", { this.$alert("当前任务已结束", "提示", {
type: "success ", type: "success ",
confirmButtonText: "确定", confirmButtonText: "确定",
callback: (action) => { }, 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);
} }
}
}, },
}, },
created() {}, created() {},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论