提交 550fe22e 作者: 翁进城

fix:

1. 【驾驶中心】无人机-点击结束任务按钮,报错
2. (优化项)【驾驶中心】紧急迫降-图标大小和字体大小未对齐,需调整样式
3. (V4正式服)【驾驶中心】无人机应用-一键任务报错
4.【驾驶中心】无人机-已被接管的无人机再次点击接管按钮,无需出现强制接管弹框
上级 fa6cb2ae
流水线 #11014 已失败 于阶段
......@@ -2,18 +2,6 @@ import request from "../request";
import request_uav from "../request_uav";
class Control_API {
/**
* 无人机接管更新状态
* @param {*} id //设备id
* @returns
*/
static updateTakeOver(id) {
return request({
url: `/dms/uav/updateTakeOver/${id}`,
method: "put",
});
}
// 获取无人机树结构列表
static getUavTree(params) {
return request({
......
import Vue from "vue";
import './index.scss';
const Bus = new Vue();
let confirm = null; //外部传进来的confirm方法
let alert = null;
......
.cesium-widget-errorPanel {
display: none;
}
\ No newline at end of file
......@@ -7,7 +7,7 @@
<span class="title-scroll">{{ name }}</span>
</div>
<span class="label">{{ label }}</span>
<div class="el-icon-close close" @click="close"></div>
<!-- <div class="el-icon-close close" @click="close"></div> -->
</div>
<components :is="playerCom" ref="player" :url="url" :className="'fkLivePlayer'" />
<slot></slot>
......@@ -133,6 +133,9 @@ export default {
white-space: nowrap;
line-height: 30px;
overflow: hidden;
flex: auto;
display: flex;
justify-content: space-between;
.title-scroll {
display: inline-block;
......
......@@ -8,7 +8,7 @@
/>
<el-select v-model="selectUrl" class="select" popper-class="mmc">
<el-option
v-for="item in uav"
v-for="item in streamOptions"
:label="item.label"
:value="item.url"
:key="item.url"
......@@ -54,7 +54,7 @@ export default {
*/
streamOptions() {
let streamOptions = [];
let streamConfiguration = this.uav?.streamConfiguration.find(
let streamConfiguration = this.uav?.streamConfiguration?.find(
(item) => item.urlType === 0
);
......
......@@ -189,11 +189,11 @@ export default {
});
// 当前机库状态是否空闲
if ([0, 8].includes(this.hangarRealTimeData.processStatus)) {
this.$store.commit("MMCFlightControlCenter/hangar/setState", {
this.$store.commit("MMCFlightControlCenter/uav/setState", {
key: "airlineData",
value: this.selectedAirway,
});
this.$store.dispatch("MMCFlightControlCenter/hangar/takeOff", {
this.$store.dispatch("MMCFlightControlCenter/uav/takeOff", {
uav: this.uav,
callback: (status) => {
if (status) {
......
......@@ -418,12 +418,9 @@ export default {
font-weight: 700;
.text,
.time {
width: 20%;
width: 25%;
text-align: center;
}
.time {
width: 35%;
}
.con {
width: 50%;
}
......@@ -445,7 +442,7 @@ export default {
align-items: center;
.type-box {
width: 20%;
width: 25%;
height: 20px;
text-align: center;
font-family: SourceHanSansCN-Medium;
......@@ -485,7 +482,7 @@ export default {
font-weight: 500;
}
.time {
width: 35%;
width: 25%;
text-align: center;
font-family: SourceHanSansCN-Medium;
font-size: 14px;
......
......@@ -9,7 +9,7 @@
<span class="dib">一键返航</span>
</div>
<div class="control-bottom-item" @click="onLand" v-if="isHangar">
<SymbolIcon icon="anquanjiangla1" />
<img src="./assets/images/end.svg" />
<span class="dib">紧急迫降</span>
</div>
<div class="control-bottom-item" @click="onTaskEnd" v-else>
......@@ -231,10 +231,6 @@ export default {
"MMCFlightControlCenter/uav/isTakeOver"
);
},
// 无人机接管更新状态
async updateTakeOver() {
await Control_API.updateTakeOver(this.uav.id);
},
// 一键任务
onStartTask() {
this.bus.$emit("startTask");
......@@ -252,8 +248,6 @@ export default {
customClass: "uav_controlPane",
showClose: false,
}).then((res) => {
this.updateTakeOver();
this.$store.dispatch("MMCFlightControlCenter/uav/returnFlight", {
callback: (isOk) => {
isOk && this.$message.success("发出返航指令成功");
......@@ -274,8 +268,6 @@ export default {
customClass: "uav_controlPane",
showClose: false,
}).then((res) => {
this.updateTakeOver();
this.$store.dispatch("MMCFlightControlCenter/uav/takeEnd", {
callback: (isOk) => {
isOk && this.$message.success("发出任务结束指令成功");
......@@ -296,8 +288,6 @@ export default {
customClass: "uav_controlPane",
showClose: false,
}).then((res) => {
this.updateTakeOver();
this.$store.dispatch("MMCFlightControlCenter/uav/land", {
callback: (isOk) => {
isOk && this.$message.success("发出紧急降落指令成功");
......
......@@ -64,7 +64,7 @@
<el-form-item label="预计飞行时间">{{time}}s</el-form-item>
</el-form>
<div class="ae-btns">
<el-button type="primary" @click="onSave">保存</el-button>
<el-button type="primary" @click="onSave" :loading="saveLoading">保存</el-button>
<el-button type="danger" @click="onDel">删除航点</el-button>
</div>
</div>
......@@ -110,9 +110,11 @@ export default {
locationIcon: null, //定位图标
handler: null, //地图内容抓取事件
dataSource: null, //航点数据集
dataSourceName: "airway_edit_" + Date.now(),
positions: [], //航点坐标集合
isPickAddress: false, //是否通过目标位置对地理信息
showActions: false, // 打开航点动作
saveLoading: false,
};
},
computed: {
......@@ -131,7 +133,7 @@ export default {
this.form.forEach((item) => {
distance += item.distance;
});
return distance;
return Number(distance.toFixed(2));
},
//预计总时间
time() {
......@@ -145,7 +147,7 @@ export default {
},
mounted() {
let viewer = this.cesiumViewer;
this.dataSource = new Cesium.CustomDataSource("airway_edit");
this.dataSource = new Cesium.CustomDataSource(this.dataSourceName);
viewer.dataSources.add(this.dataSource);
this.handler = new Cesium.ScreenSpaceEventHandler(viewer.canvas); //获取事件对象
// 绘制航线
......@@ -177,10 +179,15 @@ export default {
this.onPickPoint,
Cesium.ScreenSpaceEventType.LEFT_DOWN
);
// 直接销毁会报错
this.$nextTick(() => {
this.cesiumViewer.dataSources.remove(this.dataSource);
})
// todo 连续两次创建航线后销毁cesium会崩溃, 原因未知, 改为隐藏
/* this.$nextTick(() => {
let list = this.cesiumViewer?.dataSources?.getByName(this.dataSourceName);
for (let i = 0; i < list.length; i++) {
let dataSource = list[i];
this.cesiumViewer.dataSources.remove(dataSource);
}
}); */
this.dataSource.show = false;
},
methods: {
// 保存航线
......@@ -193,6 +200,7 @@ export default {
this.$message.warning("请点击地图选择航点");
return;
}
this.saveLoading = true;
let waypoints = this.form.map((val) => {
let actions = val.actions.map((item) => {
let ret = {
......@@ -225,6 +233,7 @@ export default {
waypointActions: actions,
};
});
this.rootNode.$emit("airwayAdd", {
airway: {
content: waypoints,
......@@ -234,9 +243,12 @@ export default {
speed: this.form[0].speed,
},
callback: (data) => {
this.$emit('addDone', data.id);
this.$emit('close');
}
if(data?.id){
this.$emit("addDone", data.id);
this.$emit("close");
}
this.saveLoading = false;
},
});
},
/**
......
......@@ -159,6 +159,7 @@ export default {
height: 170px;
position: absolute;
right: 0;
bottom: 45px;
}
.vjs-volume-panel,
.vjs-playback-rate,
......
......@@ -151,7 +151,7 @@ export default {
position: absolute;
right: 0;
z-index: 1;
bottom: 0;
bottom: 45px;
}
}
......
......@@ -142,7 +142,7 @@ export default {
}
} else if (
// 判断当前接管人是不是自已, 是则提示退出接管, 不是则提示是否强制接管
uav.currentOperator === this.userInfo.userId
uav.currentOperator === this.userInfo.id
) {
try {
await this.$confirm(`请确认是否退出接管${uav.name}?`, "安全确认", {
......
......@@ -283,48 +283,6 @@ const actions = {
},
});
},
/**
* 一键起飞
* @param {function} data.callback //完成回调
* @param {Object} data.uav // 无人机对象
*/
async takeOff({ state }, data) {
console.log(state.airlineData, data);
try {
// 生成架次号
const flightSortieId = await TaskInfo.flightSortieId({
id: state.uav.deviceId,
});
/* const flightSortieId = {
data: `tmj-v4-${Date.now()}`
} */
// 一键任务指令
const waypointList = state.airlineData?.content;
window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PROCESS/OBTAIN/" + state.hangar.deviceId,
data: {
cmdControlType: 100004,
uavDeviceId: data.uav.deviceId,
wayLineObj: {
taskId: state.airlineData.id,
flightSortiesID: flightSortieId.data,
waypointList: waypointList,
autoFlightSpeed: state.airlineData.baseSpeed,
finishedAction: "GO_HOME",
headingMode: "AUTO",
isExitMissionOnRCSignalLostEnabled: true,
maxFlightSpeed: 12,
},
},
callback() {
data?.callback && data.callback(true, flightSortieId.data);
},
});
} catch (e) {
console.log("一键起飞失败", e);
data?.callback && data.callback(false);
}
},
};
export default {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论