提交 773179eb 作者: 翁进城

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

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