提交 fb992f45 作者: 温凯

fix:驾驶中心右侧面板添加权限判断

上级 7867144a
......@@ -96,6 +96,20 @@ export default {
}
},
methods: {
/**
* 接管判断, 机库模块中不需要判断接管
*/
async isTakeOver() {
if (this.isHangar) {
return await this.$store.dispatch(
"MMCFlightControlCenter/hangar/isTakeOver"
);
} else {
return await this.$store.dispatch(
"MMCFlightControlCenter/uav/isTakeOver"
);
}
},
hideAll(key) {
let arr = [
"showAlarmLamp",
......@@ -114,10 +128,15 @@ export default {
/**
* 切换展示
*/
onSwitchShow(key) {
async onSwitchShow(key) {
if (key == 'showHealth' && !this?.uav?.isOnline) {
return this.$message.info('无人机不在线!');
}
// 判断是否已接管
if (!(await this.isTakeOver())) {
this.$message.warning("请先接管设备");
return;
}
this.$emit("switchCallback");
this.hideAll(key);
this[key] = !this[key];
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论