提交 04d9bfa7 作者: 温凯

fix:无人机任务回显

上级 857a97de
...@@ -72,7 +72,7 @@ export default { ...@@ -72,7 +72,7 @@ export default {
"useSTLAirway", "useSTLAirway",
"useTask", "useTask",
]), ]),
...mapState("MMCFlightControlCenter/uav", ["uav"]), ...mapState("MMCFlightControlCenter/uav", ["uav","uavRealTimeData"]),
// 选择的任务 // 选择的任务
selectedTask() { selectedTask() {
let find = this.taskList.find((item) => { let find = this.taskList.find((item) => {
...@@ -129,7 +129,7 @@ export default { ...@@ -129,7 +129,7 @@ export default {
"uavRealTimeData.isFlying": { "uavRealTimeData.isFlying": {
handler: function (newVal, oldVal) { handler: function (newVal, oldVal) {
if (oldVal === false && newVal === true) { if (oldVal === false && newVal === true) {
this.getTaskInfoRecord(); this.getTaskInfoRecord()
} }
}, },
deep: true, deep: true,
...@@ -176,6 +176,7 @@ export default { ...@@ -176,6 +176,7 @@ export default {
this.bus.$on("refreshAirway", this.getAirwayList); this.bus.$on("refreshAirway", this.getAirwayList);
await this.getTaskList(); await this.getTaskList();
await this.getAirwayList(); await this.getAirwayList();
console.log(this.uavRealTimeData,'this.uavRealTimeData');
// 获取正在飞行的航线 // 获取正在飞行的航线
if (this.uavRealTimeData.isFlying) { if (this.uavRealTimeData.isFlying) {
this.getTaskInfoRecord(); this.getTaskInfoRecord();
...@@ -192,7 +193,7 @@ export default { ...@@ -192,7 +193,7 @@ export default {
"clearAirwayEntities", "clearAirwayEntities",
"apiPointsToFKZXPoints", "apiPointsToFKZXPoints",
]), ]),
...mapActions("MMCFlightControlCenter/uav", ["isTakeOver","uavRealTimeData"]), ...mapActions("MMCFlightControlCenter/uav", ["isTakeOver","InituavRealTimeData"]),
/** /**
* 获取任务列表 * 获取任务列表
*/ */
......
...@@ -355,16 +355,16 @@ const actions = { ...@@ -355,16 +355,16 @@ const actions = {
type260.grade <= 2 type260.grade <= 2
? "[危险]" ? "[危险]"
: type260.grade == 3 : type260.grade == 3
? "[错误]" ? "[错误]"
: type260.grade == 4 : type260.grade == 4
? "[警告]" ? "[警告]"
: type260.grade == 5 : type260.grade == 5
? "[通知]" ? "[通知]"
: type260.grade == 6 : type260.grade == 6
? "[正常]" ? "[正常]"
: type260.grade == 7 : type260.grade == 7
? "[调试]" ? "[调试]"
: "AUTO", : "AUTO",
text: type260.msg, text: type260.msg,
time: moment(type260.timestamp).format("YYYY-MM-DD HH:mm:ss"), time: moment(type260.timestamp).format("YYYY-MM-DD HH:mm:ss"),
timestamp: type260.timestamp, timestamp: type260.timestamp,
...@@ -499,15 +499,15 @@ const actions = { ...@@ -499,15 +499,15 @@ const actions = {
if (state.uavRealTimeData.locationCoordinate3D.longitude) { if (state.uavRealTimeData.locationCoordinate3D.longitude) {
if ( if (
state.uavRealTimeData.locationCoordinate3D.longitude === state.uavRealTimeData.locationCoordinate3D.longitude ===
defaultPos.longitude && defaultPos.longitude &&
state.uavRealTimeData.locationCoordinate3D.latitude === state.uavRealTimeData.locationCoordinate3D.latitude ===
defaultPos.latitude defaultPos.latitude
) { ) {
// 默认坐标不记录 // 默认坐标不记录
} else { } else {
// const posData = UAVDataParser(state.uavRealTimeData); // 这种写法在执行rollup混淆压缩后, posData对象会变成elementUI的对象,原因未知 // const posData = UAVDataParser(state.uavRealTimeData); // 这种写法在执行rollup混淆压缩后, posData对象会变成elementUI的对象,原因未知
// 更新轨迹 // 更新轨迹
let flag = positions.some(val=> val.x == UAVDataParser(state.uavRealTimeData).position.x && val.y == UAVDataParser(state.uavRealTimeData).position.y) let flag = positions.some(val => val.x == UAVDataParser(state.uavRealTimeData).position.x && val.y == UAVDataParser(state.uavRealTimeData).position.y)
if (!flag) { if (!flag) {
positions.push(UAVDataParser(state.uavRealTimeData).position); positions.push(UAVDataParser(state.uavRealTimeData).position);
} }
...@@ -516,7 +516,7 @@ const actions = { ...@@ -516,7 +516,7 @@ const actions = {
if ( if (
state.uavRealTimeData.locationCoordinate3D.longitude !== state.uavRealTimeData.locationCoordinate3D.longitude !==
defaultPos.longitude && defaultPos.longitude &&
!state.uavModelEntity !state.uavModelEntity
) { ) {
dispatch("createUavModel"); dispatch("createUavModel");
...@@ -704,7 +704,7 @@ const actions = { ...@@ -704,7 +704,7 @@ const actions = {
if (state.uav.network == 2) { if (state.uav.network == 2) {
try { try {
let flightSortieId; let flightSortieId;
if(data.taskInfoId){ if (data.taskInfoId) {
flightSortieId = await TaskInfo.createTaskRecord({ flightSortieId = await TaskInfo.createTaskRecord({
taskInfoId: data.taskInfoId || undefined, taskInfoId: data.taskInfoId || undefined,
deviceId: state.uav.deviceId, deviceId: state.uav.deviceId,
...@@ -717,7 +717,7 @@ const actions = { ...@@ -717,7 +717,7 @@ const actions = {
reouteId: state.airlineData.id, reouteId: state.airlineData.id,
}); });
} }
/* const flightSortieId = { /* const flightSortieId = {
data: `tmj-v4-${Date.now()}` data: `tmj-v4-${Date.now()}`
} */ } */
...@@ -738,7 +738,7 @@ const actions = { ...@@ -738,7 +738,7 @@ const actions = {
maxFlightSpeed: 12, maxFlightSpeed: 12,
}, },
}, },
callback() {}, callback() { },
}); });
// 告诉飞控开始任务,并且把架次号和 任务id传过去 // 告诉飞控开始任务,并且把架次号和 任务id传过去
...@@ -751,7 +751,7 @@ const actions = { ...@@ -751,7 +751,7 @@ const actions = {
flightSortiesID: flightSortieId.data, flightSortiesID: flightSortieId.data,
}, },
}, },
callback() {}, callback() { },
}); });
// 起飞指令 // 起飞指令
...@@ -1344,6 +1344,9 @@ const actions = { ...@@ -1344,6 +1344,9 @@ const actions = {
}); });
} }
}, },
async showUavRealTimeData({ state }, data) {
return state.isFlying;
},
/** /**
* 判断是否已接管 * 判断是否已接管
* @param { Number } data.id 无人机id * @param { Number } data.id 无人机id
...@@ -1355,7 +1358,7 @@ const actions = { ...@@ -1355,7 +1358,7 @@ const actions = {
if ( if (
res.data.currentOperator && res.data.currentOperator &&
res.data.currentOperator === res.data.currentOperator ===
window.$mmc_stl.$store.state.MMCFlightControlCenter.userInfo.id window.$mmc_stl.$store.state.MMCFlightControlCenter.userInfo.id
) { ) {
return true; return true;
} }
...@@ -1373,7 +1376,7 @@ const actions = { ...@@ -1373,7 +1376,7 @@ const actions = {
type: window.$mmc_stl.$store.state.MMCMQTT.orders.链路切换, type: window.$mmc_stl.$store.state.MMCMQTT.orders.链路切换,
data, data,
}, },
callback() {}, callback() { },
}); });
}, },
// 键盘控制 // 键盘控制
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论