提交 550fe22e 作者: 翁进城

fix:

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