提交 595acb3a 作者: 翁进城

fix: 挂载云台数据实时更新

上级 bedc5dd7
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
v-if="selectMount" v-if="selectMount"
class="mount-panel" class="mount-panel"
:keyFlag="nxNormal" :keyFlag="nxNormal"
:payload_data="selectMountPayload"
@directive="mountDirective" @directive="mountDirective"
@take_photo="mountTakePhoto" @take_photo="mountTakePhoto"
@record="mountRecord" @record="mountRecord"
...@@ -33,7 +34,7 @@ ...@@ -33,7 +34,7 @@
</template> </template>
<script> <script>
// import API from "@/api"; // import API from "@/api";
import { mapState } from "vuex"; import { mapState, mapGetters } from "vuex";
import mount from "../../../../../../../../../MMCMount"; import mount from "../../../../../../../../../MMCMount";
// 所有的挂载组件 // 所有的挂载组件
const mountComponents = {}; const mountComponents = {};
...@@ -72,6 +73,7 @@ export default { ...@@ -72,6 +73,7 @@ export default {
"uavRealTimeData", "uavRealTimeData",
"isQingLiu", "isQingLiu",
]), ]),
...mapGetters("MMCFlightControlCenter/uav", ["selectMountPayload"]),
nxNormal() { nxNormal() {
return this.uavRealTimeData?.healthData?.NX?.warningLevel === "NORMAL"; return this.uavRealTimeData?.healthData?.NX?.warningLevel === "NORMAL";
}, },
...@@ -117,7 +119,10 @@ export default { ...@@ -117,7 +119,10 @@ export default {
*/ */
mountRecord(streamData) { mountRecord(streamData) {
console.log("挂载录像", streamData); console.log("挂载录像", streamData);
let recordControl = streamData.data.data.status || streamData.data.data.recordControl || false; let recordControl =
streamData.data.data.status ||
streamData.data.data.recordControl ||
false;
this.$store.dispatch("MMCFlightControlCenter/uav/videoTranscribe", { this.$store.dispatch("MMCFlightControlCenter/uav/videoTranscribe", {
recordControl: recordControl, recordControl: recordControl,
callback: () => { callback: () => {
......
...@@ -212,7 +212,7 @@ const state = { ...@@ -212,7 +212,7 @@ const state = {
mountId: 12, mountId: 12,
}, */ }, */
], // 挂载列表 ], // 挂载列表
selectMount: null, // 选中的挂载 selectMount: null, // 选中的挂载,payload数据是固定的,不会实时更新,实时更新使用selectMountPayload
showPlayer: false, //显示播放器 showPlayer: false, //显示播放器
showPanel: false, //显示数据面板 showPanel: false, //显示数据面板
isQingLiu: null, // 当前视频播放的是否为清流 isQingLiu: null, // 当前视频播放的是否为清流
...@@ -422,6 +422,18 @@ const actions = { ...@@ -422,6 +422,18 @@ const actions = {
} }
}); });
commit("setState", { key: "mountList", value: [...state.mountList] }); commit("setState", { key: "mountList", value: [...state.mountList] });
} else {
// 更新挂载数据
let mountList = state.mountList.map((item) => {
if (item.mountId === type259.mountId) {
return {
...item,
...type259
};
}
return item;
});
commit("setState", { key: "mountList", value: mountList });
} }
} }
} else { } else {
...@@ -1363,12 +1375,33 @@ const actions = { ...@@ -1363,12 +1375,33 @@ const actions = {
}, },
}; };
const getters = {
/**
* 选中挂载的实时数据
*/
selectMountPayload(state) {
if (state.selectMount) {
let find = state.mountList.find(
(item) => item.mountId === state.selectMount.mountId
);
if (find) {
return find.payload;
} else {
throw Error("选中的挂载不在挂载列表中!");
}
} else {
return null;
}
},
};
export default { export default {
namespaced: true, namespaced: true,
name: "uav", name: "uav",
state, state,
mutations, mutations,
actions, actions,
getters,
}; };
/** /**
......
...@@ -110,7 +110,7 @@ export default { ...@@ -110,7 +110,7 @@ export default {
}, },
// ZT60R高清相机 // ZT60R高清相机
{ {
title: "高清变焦相机ZT60R", title: "高清变焦相机Z60R",
icon: pngZT60R, icon: pngZT60R,
name: "MMC_Gimbal_Z60R", name: "MMC_Gimbal_Z60R",
type: [1, 2, 3, 4, 5, 6, 8], type: [1, 2, 3, 4, 5, 6, 8],
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论