提交 94a3c6b7 作者: 温凯

fix:挂载控制添加权限判断

上级 0673a9bb
...@@ -2,15 +2,10 @@ ...@@ -2,15 +2,10 @@
<div class="mountBox"> <div class="mountBox">
<div class="main" v-if="show"> <div class="main" v-if="show">
<div v-if="mountList.length > 0" class="list"> <div v-if="mountList.length > 0" class="list">
<div <div class="mount-item pr mt6" :class="{
class="mount-item pr mt6" active:
:class="{ (selectMount && selectMount.gimbalName) === item.gimbalName,
active: }" v-for="(item, index) in mountList" :key="index">
(selectMount && selectMount.gimbalName) === item.gimbalName,
}"
v-for="(item, index) in mountList"
:key="index"
>
<div class="icon-box" @click="onSelectMount(item)"> <div class="icon-box" @click="onSelectMount(item)">
<img class :src="item.icon" /> <img class :src="item.icon" />
</div> </div>
...@@ -18,17 +13,9 @@ ...@@ -18,17 +13,9 @@
</div> </div>
</div> </div>
<template v-if="selectMount"> <template v-if="selectMount">
<component <component :is="selectMount.gimbalName" v-if="selectMount" class="mount-panel" :keyFlag="nxNormal"
:is="selectMount.gimbalName" :payload_data="selectMountPayload" @directive="mountDirective" @take_photo="mountTakePhoto"
v-if="selectMount" @record="mountRecord" @close="mountClose" />
class="mount-panel"
:keyFlag="nxNormal"
:payload_data="selectMountPayload"
@directive="mountDirective"
@take_photo="mountTakePhoto"
@record="mountRecord"
@close="mountClose"
/>
</template> </template>
</div> </div>
</template> </template>
...@@ -48,6 +35,11 @@ export default { ...@@ -48,6 +35,11 @@ export default {
...mountComponents, ...mountComponents,
}, },
props: { props: {
// 是否机库页面使用
isHangar: {
type: Boolean,
default: false,
},
show: { show: {
type: Boolean, type: Boolean,
default: false, default: false,
...@@ -78,11 +70,30 @@ export default { ...@@ -78,11 +70,30 @@ export default {
return this.uavRealTimeData?.healthData?.NX?.warningLevel === "NORMAL"; return this.uavRealTimeData?.healthData?.NX?.warningLevel === "NORMAL";
}, },
}, },
created() {}, created() { },
mounted() {}, mounted() { },
beforeDestroy() {}, beforeDestroy() { },
methods: { methods: {
onSelectMount(item) { /**
* 接管判断, 机库模块中不需要判断接管
*/
async isTakeOver() {
if (this.isHangar) {
return await this.$store.dispatch(
"MMCFlightControlCenter/hangar/isTakeOver"
);
} else {
return await this.$store.dispatch(
"MMCFlightControlCenter/uav/isTakeOver"
);
}
},
async onSelectMount(item) {
// 判断是否已接管
if (!(await this.isTakeOver())) {
this.$message.warning("请先接管设备");
return;
}
this.$store.commit("MMCFlightControlCenter/uav/setState", { this.$store.commit("MMCFlightControlCenter/uav/setState", {
key: "selectMount", key: "selectMount",
value: item, value: item,
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<ControlList @clearId="$emit('clearId')" @closeIconShow="iconShow = false" @exit="showControlList = false" <ControlList @clearId="$emit('clearId')" @closeIconShow="iconShow = false" @exit="showControlList = false"
:show="showControlList" :isHangar="isHangar"></ControlList> :show="showControlList" :isHangar="isHangar"></ControlList>
<Health v-if="showHealth" @exit="showHealth = false"></Health> <Health v-if="showHealth" @exit="showHealth = false"></Health>
<Mount v-if="showMount" :show="showMount"></Mount> <Mount v-if="showMount" :isHangar="isHangar" :show="showMount"></Mount>
<!-- 喊话器 --> <!-- 喊话器 -->
<MMCGimbalP1 class="PagerP1" v-show="showMMCGimbalP1" ref="MMCGimbalP1" @close="showMMCGimbalP1 = false" /> <MMCGimbalP1 class="PagerP1" v-show="showMMCGimbalP1" ref="MMCGimbalP1" @close="showMMCGimbalP1 = false" />
<MountController @webscoketFn="(data) => fun(data)" v-if="uav && uav.deviceId" ref="MountControllerRef" /> <MountController @webscoketFn="(data) => fun(data)" v-if="uav && uav.deviceId" ref="MountControllerRef" />
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论