提交 9af1d91c 作者: 翁进城

V4功能适配

上级 caa9c6da
流水线 #10564 已失败 于阶段
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
:scene="scene" :scene="scene"
:useSTLAirway="useSTLAirway" :useSTLAirway="useSTLAirway"
:useTimedTask="useTimedTask" :useTimedTask="useTimedTask"
@tokenInvalid="dispatchEvent('tokenInvalid')"
@uavChange="dispatchEvent('uavChange', $event)" @uavChange="dispatchEvent('uavChange', $event)"
@uavTaskStart="dispatchEvent('uavTaskStart', $event)" @uavTaskStart="dispatchEvent('uavTaskStart', $event)"
@uavTaskAdd="dispatchEvent('uavTaskAdd', $event)" @uavTaskAdd="dispatchEvent('uavTaskAdd', $event)"
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
"mqtt": "^4.3.6", "mqtt": "^4.3.6",
"nanoid": "^5.0.7", "nanoid": "^5.0.7",
"prismjs": "^1.29.0", "prismjs": "^1.29.0",
"qs": "^6.12.3",
"recorder-core": "^1.2.23020100", "recorder-core": "^1.2.23020100",
"terraformer-wkt-parser": "^1.2.1", "terraformer-wkt-parser": "^1.2.1",
"url": "^0.11.0", "url": "^0.11.0",
......
import request from '../request'; import request from "../request";
class AirLine { class AirLine {
/** /**
...@@ -8,9 +8,9 @@ class AirLine { ...@@ -8,9 +8,9 @@ class AirLine {
*/ */
static lineList(params) { static lineList(params) {
return request({ return request({
url: '/dms/route/page', url: "/dms/route/page",
method: 'get', method: "get",
params params,
}); });
} }
...@@ -21,15 +21,15 @@ class AirLine { ...@@ -21,15 +21,15 @@ class AirLine {
*/ */
static Edit(data) { static Edit(data) {
return request({ return request({
url: '/dms/route/add', url: "/dms/route/add",
method: 'post', method: "post",
data data,
}); });
} }
static routeDelete(id) { static routeDelete(id) {
return request({ return request({
url: `/dms/route/delete/${id}`, url: `/dms/route/delete/${id}`,
method: 'delete' method: "delete",
}); });
} }
...@@ -40,9 +40,9 @@ class AirLine { ...@@ -40,9 +40,9 @@ class AirLine {
*/ */
static Change(data) { static Change(data) {
return request({ return request({
url: '/dms/route/update', url: "/dms/route/update",
method: 'put', method: "put",
data data,
}); });
} }
...@@ -54,8 +54,8 @@ class AirLine { ...@@ -54,8 +54,8 @@ class AirLine {
static details(params) { static details(params) {
return request({ return request({
url: `/tmj/route/getRouteDetail/${params}`, url: `/tmj/route/getRouteDetail/${params}`,
method: 'get', method: "get",
params params,
}); });
} }
...@@ -67,11 +67,11 @@ class AirLine { ...@@ -67,11 +67,11 @@ class AirLine {
static upload(data) { static upload(data) {
return request({ return request({
headers: { headers: {
'Content-Type': 'multipart/form-data' "Content-Type": "multipart/form-data",
}, },
url: '/dms/route/upload', url: "/dms/route/upload",
method: 'post', method: "post",
data data,
}); });
} }
/** /**
...@@ -82,11 +82,11 @@ class AirLine { ...@@ -82,11 +82,11 @@ class AirLine {
static uploadFile(data) { static uploadFile(data) {
return request({ return request({
headers: { headers: {
'Content-Type': 'multipart/form-data' "Content-Type": "multipart/form-data",
}, },
url: '/crm/dimensionMark/uploadFile', url: "/crm/dimensionMark/uploadFile",
method: 'post', method: "post",
data data,
}); });
} }
...@@ -98,11 +98,11 @@ class AirLine { ...@@ -98,11 +98,11 @@ class AirLine {
static uploadRoutes(data) { static uploadRoutes(data) {
return request({ return request({
headers: { headers: {
'Content-Type': 'multipart/form-data' "Content-Type": "multipart/form-data",
}, },
url: '/dms/route/upload', url: "/dms/route/upload",
method: 'post', method: "post",
data data,
}); });
} }
/** /**
...@@ -113,7 +113,7 @@ class AirLine { ...@@ -113,7 +113,7 @@ class AirLine {
static deleteRoute(params) { static deleteRoute(params) {
return request({ return request({
url: `/dms/route/delete/${params}`, url: `/dms/route/delete/${params}`,
method: 'delete' method: "delete",
}); });
} }
...@@ -124,9 +124,25 @@ class AirLine { ...@@ -124,9 +124,25 @@ class AirLine {
*/ */
static routeDetail(params) { static routeDetail(params) {
return request({ return request({
url: '/dms/route/id', url: "/admin-api/uas/flight-line/get",
method: 'get', method: "get",
params params,
}).then(async (res) => {
let content = await window.$mmc.$store.dispatch("MMCFlightControlCenter/apiPointsToFKZXPoints", {
list: res.data.linePointRespVOS,
actionListKey: "pointActionRespVOS",
});
res.data = {
id: res.data.id,
name: res.data.flightName,
organizationName: "无",
status: "可用", //空域状态
safe: res.data.safe ? 1 : 0, // 安全状态1: 安全 , 0: 待确定,
labelName: "无",
//航线数据
content,
};
return res;
}); });
} }
...@@ -137,9 +153,9 @@ class AirLine { ...@@ -137,9 +153,9 @@ class AirLine {
*/ */
static getSorties(params) { static getSorties(params) {
return request({ return request({
url: '/dms/route/id', url: "/dms/route/id",
method: 'get', method: "get",
params params,
}); });
} }
/** /**
...@@ -149,9 +165,9 @@ class AirLine { ...@@ -149,9 +165,9 @@ class AirLine {
*/ */
static getSortiesHistoryVideo(params) { static getSortiesHistoryVideo(params) {
return request({ return request({
url: '/dms/sortie/history-video', url: "/dms/sortie/history-video",
method: 'get', method: "get",
params params,
}); });
} }
/** /**
...@@ -161,9 +177,9 @@ class AirLine { ...@@ -161,9 +177,9 @@ class AirLine {
*/ */
static getSortiesTrajectory(params) { static getSortiesTrajectory(params) {
return request({ return request({
url: '/dms/sortie/data', url: "/dms/sortie/data",
method: 'get', method: "get",
params params,
}); });
} }
} }
......
...@@ -218,7 +218,7 @@ class Control_API { ...@@ -218,7 +218,7 @@ class Control_API {
// 获取设备视频流 // 获取设备视频流
static getDeviceStream(params) { static getDeviceStream(params) {
return request({ return request({
url: `/admin-api/uas/drive/getDeviceStream`, url: `/admin-api/uas/device-stream/page`,
method: "get", method: "get",
params params
}); });
......
...@@ -59,6 +59,11 @@ $axios.interceptors.response.use( ...@@ -59,6 +59,11 @@ $axios.interceptors.response.use(
case 0: case 0:
return Promise.resolve(res); return Promise.resolve(res);
case 401:
localStorage.setItem("token", "");
window.$mmc.app.$emit('tokenInvalid');
break;
default: default:
if (response.config.responseType === "blob") { if (response.config.responseType === "blob") {
return Promise.resolve(res); return Promise.resolve(res);
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<div class="tb-tr" v-for="item in airwayData.records" :key="item.id"> <div class="tb-tr" v-for="item in airwayData.records" :key="item.id">
<div class="td">{{ item.id || "暂无" }}</div> <div class="td">{{ item.id || "暂无" }}</div>
<div class="td"> <div class="td">
<div>{{ item.flightName || "暂无" }}</div> <div>{{ item.name || "暂无" }}</div>
</div> </div>
<div class="td">{{ item.organizationName || "暂无" }}</div> <div class="td">{{ item.organizationName || "暂无" }}</div>
<!-- 空域状态 --> <!-- 空域状态 -->
......
...@@ -143,7 +143,7 @@ export default { ...@@ -143,7 +143,7 @@ export default {
let res = await AirLine.routeDetail({ let res = await AirLine.routeDetail({
id: this.selectedTask?.airwayId, id: this.selectedTask?.airwayId,
}); });
if (res.code === 200) { if (res.code === 0) {
this.selectedAirway = res.data; this.selectedAirway = res.data;
} }
} else { } else {
......
<template> <template>
<div class="task-add"> <div class="task-add dialog1027">
<div class="task-add-header" v-interact> <div class="dialog-header" v-interact>
<div class="header__title">定时任务</div> <div class="dialog-header__title">定时任务</div>
<div class="header-right"> <div class="dialog-header__close" @click="$emit('close')">关闭</div>
<div class="header-right__close" @click="$emit('close')">关闭</div>
</div>
</div> </div>
<div class="task-add-main"> <div class="dialog-content">
<el-form ref="form" :model="form" label-width="100px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="执行日期" prop="date" required> <el-form-item label="执行日期" prop="date" required>
<el-date-picker <el-date-picker
v-model="form.date" v-model="form.date"
...@@ -58,15 +56,22 @@ export default { ...@@ -58,15 +56,22 @@ export default {
return { return {
form: { form: {
date: [], date: [],
time: ['00:00:00', '00:00:00'], time: ["00:00:00", "23:59:59"],
normalTaskId: "", normalTaskId: "",
}, },
rules: {
date: [{ required: true, message: "请选择日期", trigger: "blur" }],
time: [{ required: true, message: "请选择时间", trigger: "blur" }],
normalTaskId: [
{ required: true, message: "请选择任务", trigger: "blur" },
],
},
pickerOptions: { pickerOptions: {
disabledDate: (time) => { disabledDate: (time) => {
// 日期选择限制 // 日期选择限制
return time.getTime() < Date.now() - 8.64e7; return time.getTime() < Date.now() - 8.64e7;
}, },
} },
}; };
}, },
computed: { computed: {
...@@ -96,9 +101,8 @@ export default { ...@@ -96,9 +101,8 @@ export default {
//渲染新航线 //渲染新航线
if (newVal) { if (newVal) {
await this.getAirway(newVal); await this.getAirway(newVal);
let airway = JSON.parse(newVal.airway.content);
this.createAirwayEntities({ this.createAirwayEntities({
polyline: airway.content, polyline: newVal.airway.content,
id: newVal.airwayId, id: newVal.airwayId,
}); });
} }
...@@ -118,7 +122,7 @@ export default { ...@@ -118,7 +122,7 @@ export default {
let res = await AirLine.routeDetail({ let res = await AirLine.routeDetail({
id: item?.airwayId, id: item?.airwayId,
}); });
if (res.code === 200) { if (res.code === 0) {
this.$set(item, "airway", res.data); this.$set(item, "airway", res.data);
} }
} }
...@@ -132,7 +136,7 @@ export default { ...@@ -132,7 +136,7 @@ export default {
if (valid) { if (valid) {
this.rootNode.$emit("hangarTaskAdd", { this.rootNode.$emit("hangarTaskAdd", {
type: 3, //1: 日常任务 2.定时任务 3.周期任务 type: 3, //1: 日常任务 2.定时任务 3.周期任务
taskList: [this.form], //任务数据 taskList: [{ ...this.form, airway: this.selectedTask.airway }], //任务数据
}); // 根节点发送机库任务新增事件 }); // 根节点发送机库任务新增事件
this.$emit("close"); this.$emit("close");
} else { } else {
...@@ -148,7 +152,7 @@ export default { ...@@ -148,7 +152,7 @@ export default {
.task-add { .task-add {
height: 286px; height: 286px;
background: rgba(9, 32, 87, 0.7); background: rgba(9, 32, 87, 0.7);
border: 1px solid #70daf9; // border: 1px solid #70daf9;
position: absolute; position: absolute;
top: -5px; top: -5px;
left: 550px; left: 550px;
...@@ -163,43 +167,8 @@ export default { ...@@ -163,43 +167,8 @@ export default {
height: 376px; height: 376px;
} }
.task-add-header { .dialog-header {
flex-shrink: 0; padding-left: 16px !important;
display: flex;
justify-content: space-between;
align-items: center;
height: 32px;
background-image: linear-gradient(
180deg,
#9198ff,
rgba(45, 81, 153, 0.22) 40%,
#05091a
);
border: 1px solid #70daf9;
box-shadow: inset 0 0 10px 2px #3f9dff;
padding: 0 20px;
.header__title {
font-family: MicrosoftYaHei-Bold;
font-size: 16px;
color: #70daf9;
letter-spacing: 0;
font-weight: 700;
}
.header-right {
display: flex;
gap: 20px;
font-family: MicrosoftYaHei;
font-size: 16px;
color: #70daf9;
letter-spacing: 0;
font-weight: 400;
.header-right__close {
font-size: 16px;
cursor: pointer;
}
}
} }
.task-add-main { .task-add-main {
...@@ -211,18 +180,12 @@ export default { ...@@ -211,18 +180,12 @@ export default {
.task-add__btn { .task-add__btn {
margin: auto; margin: auto;
width: 122px; width: 92px;
height: 32px; height: 36px;
background: #3388ff;
border-radius: 2px;
cursor: pointer; cursor: pointer;
text-align: center; text-align: center;
background-image: linear-gradient(
180deg,
#9198ff,
rgba(45, 81, 153, 0.22) 40%,
#05091a
);
border: 1px solid #70daf9;
box-shadow: inset 0 0 10px 2px #3f9dff;
color: #fff; color: #fff;
display: flex; display: flex;
justify-content: center; justify-content: center;
......
...@@ -13,7 +13,11 @@ ...@@ -13,7 +13,11 @@
<span>{{item.name}}</span> <span>{{item.name}}</span>
</el-tooltip> </el-tooltip>
</div> </div>
<div class="row__column flex2">{{item.time}}</div> <div class="row__column flex2">
<el-tooltip class="item" effect="dark" :content="item.time" placement="top-start">
<span>{{item.time}}</span>
</el-tooltip>
</div>
<div class="row__column" style="color: rgb(255, 189, 54);">{{item.status}}</div> <div class="row__column" style="color: rgb(255, 189, 54);">{{item.status}}</div>
<div class="row__column flex2 ctrl"> <div class="row__column flex2 ctrl">
<el-tooltip content="查看" placement="top"> <el-tooltip content="查看" placement="top">
...@@ -60,7 +64,7 @@ export default { ...@@ -60,7 +64,7 @@ export default {
data() { data() {
return { return {
showTaskAdd: false, showTaskAdd: false,
taskListAll: [] taskListAll: [],
}; };
}, },
computed: { computed: {
...@@ -92,11 +96,11 @@ export default { ...@@ -92,11 +96,11 @@ export default {
* 更新任务列表 * 更新任务列表
*/ */
updateTaskList() { updateTaskList() {
console.log("updateTaskList");
this.taskListAll = [ this.taskListAll = [
...(this.$store.state.MMCFlightControlCenter.hangar.taskList.period || ...(this.$store.state.MMCFlightControlCenter.hangar.taskList.period ||
[]), []),
]; ];
console.log("updateTaskList", this.taskListAll);
}, },
/** /**
* 将任务中航线对象补充完整 * 将任务中航线对象补充完整
...@@ -106,7 +110,7 @@ export default { ...@@ -106,7 +110,7 @@ export default {
let res = await AirLine.routeDetail({ let res = await AirLine.routeDetail({
id: item?.airwayId, id: item?.airwayId,
}); });
if (res.code === 200) { if (res.code === 0) {
item.airway = res.data; item.airway = res.data;
} }
} }
...@@ -122,9 +126,8 @@ export default { ...@@ -122,9 +126,8 @@ export default {
if (find) { if (find) {
this.clearAirwayEntities({ id: find.airwayId }); this.clearAirwayEntities({ id: find.airwayId });
} else { } else {
let airway = JSON.parse(item.airway.content);
this.createAirwayEntities({ this.createAirwayEntities({
polyline: airway.content, polyline: item.airway.content,
id: item.airwayId, id: item.airwayId,
}); });
} }
...@@ -229,20 +232,14 @@ export default { ...@@ -229,20 +232,14 @@ export default {
text-align: center; text-align: center;
.task-add__btn { .task-add__btn {
width: 122px; width: 124px;
height: 32px; height: 36px;
background: #3388ff;
border-radius: 2px;
text-align: center; text-align: center;
line-height: 32px; line-height: 32px;
margin: 0 auto; margin: 0 auto;
margin-bottom: 10px; margin-bottom: 10px;
background-image: linear-gradient(
180deg,
#9198ff,
rgba(45, 81, 153, 0.22) 40%,
#05091a
);
border: 1px solid #70daf9;
box-shadow: inset 0 0 10px 2px #3f9dff;
cursor: pointer; cursor: pointer;
color: #fff; color: #fff;
} }
......
<template> <template>
<div class="task-add" :class="{more: showMore}"> <div class="task-add dialog1027" :class="{more: showMore}">
<div class="task-add-header" v-interact> <div class="task-add-header dialog-header" v-interact>
<div class="header__title">定时任务</div> <div class="header__title dialog-header__title">定时任务</div>
<div class="header-right"> <div class="header-right dialog-header__close">
<div class="header-right__add" @click="onTaskAdd"> <div class="header-right__add" @click="onTaskAdd">
<span class="iconfont icon-zengjia"></span>添加任务 <span class="iconfont icon-zengjia"></span>添加任务
</div> </div>
<div class="header-right__close" @click="$emit('close')">关闭</div> <div class="header-right__close" @click="$emit('close')">关闭</div>
</div> </div>
</div> </div>
<div class="task-add-main"> <div class="task-add-main dialog-content">
<div class="main-item" v-for="(item, index) in list" :key="index"> <div class="main-item" v-for="(item, index) in list" :key="index">
<el-date-picker <el-date-picker
v-model="item.time" v-model="item.time"
...@@ -19,16 +19,27 @@ ...@@ -19,16 +19,27 @@
placeholder="选择时间" placeholder="选择时间"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions" :picker-options="pickerOptions"
></el-date-picker>任务名称 ></el-date-picker>
<el-select <el-select
v-model="item.normalTaskId" v-model="item.normalTaskId"
size="mini" size="mini"
popper-class="mmc" popper-class="mmc"
@change="onChangeTask(item)" @change="onChangeTask(item, index)"
placeholder="请选择任务"
> >
<el-option :label="item1.name" :value="item1.id" v-for="(item1, index) in taskList.normal"></el-option> <el-option
:label="item1.name"
:value="item1.id"
v-for="(item1, index) in taskList.normal"
></el-option>
</el-select> </el-select>
<el-input class="input" size="mini" :value="item.airway ? item.airway.name : ''" disabled /> <el-input
placeholder="航线名称"
class="input"
size="mini"
:value="item.airway ? item.airway.name : ''"
disabled
/>
<el-tooltip content="删除" placement="top"> <el-tooltip content="删除" placement="top">
<span class="icon-shanchu iconfont" @click="onDelTask(index)"></span> <span class="icon-shanchu iconfont" @click="onDelTask(index)"></span>
</el-tooltip> </el-tooltip>
...@@ -72,7 +83,7 @@ export default { ...@@ -72,7 +83,7 @@ export default {
// 日期选择限制 // 日期选择限制
return time.getTime() < Date.now() - 8.64e7; return time.getTime() < Date.now() - 8.64e7;
}, },
} },
}; };
}, },
computed: { computed: {
...@@ -87,30 +98,26 @@ export default { ...@@ -87,30 +98,26 @@ export default {
/** /**
* 将任务中航线对象补充完整 * 将任务中航线对象补充完整
*/ */
async getAirway(item) { async getAirway(id) {
if (!item.airway) { let res = await AirLine.routeDetail({
let res = await AirLine.routeDetail({ id: id,
id: item?.airwayId, });
}); if (res.code === 0) {
if (res.code === 200) { return res.data;
this.$set(item, "airway", res.data);
}
} }
}, },
/** /**
* 显示或隐藏航线 * 显示或隐藏航线
*/ */
async onSwitchAirway(item) { async onSwitchAirway(item) {
await this.getAirway(item);
let find = this.airwayEntities.find( let find = this.airwayEntities.find(
(item1) => item1.airwayId === item.airwayId (item1) => item1.airwayId === item.airwayId
); );
if (find) { if (find) {
this.clearAirwayEntities({ id: find.airwayId }); this.clearAirwayEntities({ id: find.airwayId });
} else { } else {
let airway = JSON.parse(item.airway.content);
this.createAirwayEntities({ this.createAirwayEntities({
polyline: airway.content, polyline: item.airway.content,
id: item.airwayId, id: item.airwayId,
}); });
} }
...@@ -128,14 +135,19 @@ export default { ...@@ -128,14 +135,19 @@ export default {
/** /**
* 任务内容更改 * 任务内容更改
*/ */
async onChangeTask(item) { async onChangeTask(item, i) {
let normalTask = this.selectedTask(item.normalTaskId); let normalTask = this.selectedTask(item.normalTaskId);
item.airwayId = normalTask.airwayId; item.airwayId = normalTask.airwayId;
let find = this.taskList.normal.find(task => task.airwayId === item.airwayId); let find = this.taskList.normal.find(
if(find){ (task) => task.airwayId === item.airwayId
);
if (find) {
item.airway = find.airway; item.airway = find.airway;
} }
this.getAirway(item); if (!find.airway) {
item.airway = await this.getAirway(item.airwayId);
}
this.$set(this.list, i, item);
}, },
/** /**
* 删除的任务 * 删除的任务
...@@ -156,11 +168,26 @@ export default { ...@@ -156,11 +168,26 @@ export default {
* 确认事件 * 确认事件
*/ */
onConfirm() { onConfirm() {
this.rootNode.$emit("hangarTaskAdd", { let isOk = true;
type: 2, //1: 日常任务 2.定时任务 3.周期任务 this.list.some((item) => {
taskList: this.list, //任务数据 if (!item.time) {
}); // 根节点发送机库任务新增事件 this.$message.warning("请选择时间")
this.$emit('close'); isOk = false;
return true;
}
if (!item.normalTaskId) {
this.$message.warning("请选择任务")
isOk = false;
return true;
}
});
if (isOk) {
this.rootNode.$emit("hangarTaskAdd", {
type: 2, //1: 日常任务 2.定时任务 3.周期任务
taskList: this.list, //任务数据
}); // 根节点发送机库任务新增事件
this.$emit("close");
}
}, },
}, },
}; };
...@@ -169,12 +196,10 @@ export default { ...@@ -169,12 +196,10 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.task-add { .task-add {
height: 250px; height: 250px;
background: rgba(9, 32, 87, 0.7);
border: 1px solid #70daf9;
position: absolute; position: absolute;
top: -5px; top: -5px;
left: 550px; left: 550px;
width: 700px; width: 620px;
z-index: 1; z-index: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -190,15 +215,7 @@ export default { ...@@ -190,15 +215,7 @@ export default {
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
height: 32px; height: 32px;
background-image: linear-gradient( padding: 0 20px 0 0;
180deg,
#9198ff,
rgba(45, 81, 153, 0.22) 40%,
#05091a
);
border: 1px solid #70daf9;
box-shadow: inset 0 0 10px 2px #3f9dff;
padding: 0 20px;
.header__title { .header__title {
font-family: MicrosoftYaHei-Bold; font-family: MicrosoftYaHei-Bold;
...@@ -242,6 +259,7 @@ export default { ...@@ -242,6 +259,7 @@ export default {
font-size: 15px; font-size: 15px;
color: #fff; color: #fff;
gap: 5px; gap: 5px;
height: fit-content;
.el-date-editor { .el-date-editor {
width: 188px; width: 188px;
...@@ -266,28 +284,21 @@ export default { ...@@ -266,28 +284,21 @@ export default {
flex-shrink: 0; flex-shrink: 0;
.task-add__btn { .task-add__btn {
margin: auto; width: 92px;
width: 122px; height: 36px;
height: 32px; background: #3388ff;
cursor: pointer; border-radius: 2px;
text-align: center; text-align: center;
background-image: linear-gradient( line-height: 32px;
180deg, margin: 0 auto;
#9198ff, margin-bottom: 10px;
rgba(45, 81, 153, 0.22) 40%, cursor: pointer;
#05091a
);
border: 1px solid #70daf9;
box-shadow: inset 0 0 10px 2px #3f9dff;
color: #fff; color: #fff;
display: flex;
justify-content: center;
align-items: center;
} }
} }
.task-add-more { .task-add-more {
background-color: rgba(13, 82, 143, 0.6); background-color: #191919;
height: 24px; height: 24px;
cursor: pointer; cursor: pointer;
display: flex; display: flex;
......
...@@ -13,7 +13,11 @@ ...@@ -13,7 +13,11 @@
<span>{{item.name}}</span> <span>{{item.name}}</span>
</el-tooltip> </el-tooltip>
</div> </div>
<div class="row__column flex2">{{item.time}}</div> <div class="row__column flex2">
<el-tooltip class="item" effect="dark" :content="item.time" placement="top-start">
<span>{{item.time}}</span>
</el-tooltip>
</div>
<div class="row__column" style="color: rgb(255, 189, 54);">{{item.status}}</div> <div class="row__column" style="color: rgb(255, 189, 54);">{{item.status}}</div>
<div class="row__column flex2 ctrl"> <div class="row__column flex2 ctrl">
<el-tooltip content="查看" placement="top"> <el-tooltip content="查看" placement="top">
...@@ -92,11 +96,11 @@ export default { ...@@ -92,11 +96,11 @@ export default {
* 更新任务列表 * 更新任务列表
*/ */
updateTaskList() { updateTaskList() {
console.log("updateTaskList");
this.taskListAll = [ this.taskListAll = [
...(this.$store.state.MMCFlightControlCenter.hangar.taskList.timed || ...(this.$store.state.MMCFlightControlCenter.hangar.taskList.timed ||
[]), []),
]; ];
console.log("updateTaskList", this.taskListAll);
}, },
/** /**
* 将任务中航线对象补充完整 * 将任务中航线对象补充完整
...@@ -106,7 +110,7 @@ export default { ...@@ -106,7 +110,7 @@ export default {
let res = await AirLine.routeDetail({ let res = await AirLine.routeDetail({
id: item?.airwayId, id: item?.airwayId,
}); });
if (res.code === 200) { if (res.code === 0) {
item.airway = res.data; item.airway = res.data;
} }
} }
...@@ -122,9 +126,8 @@ export default { ...@@ -122,9 +126,8 @@ export default {
if (find) { if (find) {
this.clearAirwayEntities({ id: find.airwayId }); this.clearAirwayEntities({ id: find.airwayId });
} else { } else {
let airway = JSON.parse(item.airway.content);
this.createAirwayEntities({ this.createAirwayEntities({
polyline: airway.content, polyline: item.airway.content,
id: item.airwayId, id: item.airwayId,
}); });
} }
...@@ -229,20 +232,14 @@ export default { ...@@ -229,20 +232,14 @@ export default {
text-align: center; text-align: center;
.task-add__btn { .task-add__btn {
width: 122px; width: 124px;
height: 32px; height: 36px;
background: #3388ff;
border-radius: 2px;
text-align: center; text-align: center;
line-height: 32px; line-height: 32px;
margin: 0 auto; margin: 0 auto;
margin-bottom: 10px; margin-bottom: 10px;
background-image: linear-gradient(
180deg,
#9198ff,
rgba(45, 81, 153, 0.22) 40%,
#05091a
);
border: 1px solid #70daf9;
box-shadow: inset 0 0 10px 2px #3f9dff;
cursor: pointer; cursor: pointer;
color: #fff; color: #fff;
} }
......
...@@ -83,6 +83,10 @@ export default { ...@@ -83,6 +83,10 @@ export default {
color: #fff; color: #fff;
cursor: pointer; cursor: pointer;
* {
cursor: pointer;
}
&.active { &.active {
background: #3388ff; background: #3388ff;
label { label {
......
...@@ -107,6 +107,15 @@ export default { ...@@ -107,6 +107,15 @@ export default {
}, },
}, },
}, },
watch: {
hangar(){
this.openTask = false;
this.openAIList = false;
this.$nextTick(() => {
this.openTask = true;
})
}
},
methods: { methods: {
onClickTask() { onClickTask() {
this.openTask = !this.openTask; this.openTask = !this.openTask;
......
...@@ -341,7 +341,7 @@ export default { ...@@ -341,7 +341,7 @@ export default {
} }
.title-box { .title-box {
padding-left: 20px; padding-left: 10px !important;
flex-shrink: 0; flex-shrink: 0;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
......
...@@ -15,12 +15,13 @@ ...@@ -15,12 +15,13 @@
</div> </div>
<div slot="dialog"> <div slot="dialog">
<div class="hangar-ctrl dialog1027" v-if="showHangar"> <div class="hangar-ctrl dialog1027" v-if="showHangar">
<div class="hangar-ctrl-header dialog-header"> <div class="dialog-header">
<span class="dialog-header__title"> <img
<img class="dialog-header__icon"
class="hangar-ctrl-header__icon"
src="../../../../../../assets/images/mount_head.png" src="../../../../../../assets/images/mount_head.png"
/>操作区域 />
<span class="dialog-header__title">
操作区域
</span> </span>
<span class="dialog-header__close" @click="showHangar = false;">关闭</span> <span class="dialog-header__close" @click="showHangar = false;">关闭</span>
</div> </div>
......
...@@ -32,6 +32,6 @@ export default { ...@@ -32,6 +32,6 @@ export default {
bottom: 0; bottom: 0;
left: 50%; left: 50%;
transform: translate(-50%, 0); transform: translate(-50%, 0);
z-index: 100; // z-index: 100;
} }
</style> </style>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="22px" height="22px" viewBox="0 0 22 22" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组 53备份</title>
<g id="套用鹰视改" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="驾驶中心-无人机应用4-AI人脸" transform="translate(-1692.000000, -186.000000)">
<g id="编组-14备份" transform="translate(1456.000000, 178.000000)">
<g id="编组-63" transform="translate(220.000000, 0.000000)">
<g id="编组-53备份" transform="translate(16.000000, 8.000000)">
<rect id="矩形" x="0" y="0" width="22" height="22"></rect>
<g id="编组" transform="translate(0.000000, 2.000000)" fill="#4E4E4E" fill-rule="nonzero">
<path d="M16.0001364,11.00025 C19.0000682,11.00025 20.9995227,11.70825 20.9995227,13.5 C20.9995227,16.2435 16.4823754,18 11,18 C5.5176246,18 1.00047726,16.2435 1.00047726,13.5 C1.00047726,11.7 3.50017045,11.00025 5.99986364,11.00025 L7.0003409,11.00025 L6.97559146,11.01825 C6.87359378,11.09325 6.45810322,11.37975 5.99461376,11.5005 C3.90666121,12.042 2.99993182,12.9315 2.99993182,13.5 C2.99993182,14.62275 6.54135133,16.0005 11,16.0005 C15.4586487,16.0005 19.0000682,14.62275 19.0000682,13.5 C19.0000682,12.93525 18.0685894,12.04275 16.0001364,11.5005 C15.4653985,11.36025 14.9996591,11.36025 14.9996591,11.00025 C14.9996591,10.64025 15.3491512,11.00025 16.0001364,11.00025 Z M18.4998295,0 C18.7518238,0 18.9603191,0.5595 18.9948183,1.28625 C19.7275516,1.21125 20.3942865,1.0005 20.8922752,1.0005 C21.2860162,1.0005 22,1.1805 22,1.5 C22,1.82025 21.2860162,2.00025 20.8922752,2.00025 C20.3942865,2.00025 19.7275516,1.7895 18.9948183,1.71225 C18.962569,2.3955 18.7773232,2.9295 18.5463285,2.994 L18.5043294,2.99925 L19.9997955,3 L19.0000682,5.00025 L19.0000682,5.5005 C18.9998947,6.28544776 18.3945984,6.93752141 17.6118497,6.996 L17.4993523,7.0005 L16.9998636,7.0005 L16.9998636,4.9995 L13.9999318,5.00025 C13.9999318,5.55225 13.462944,6 12.7999591,6 L9.20004091,6 C8.53705598,6 8.00006818,5.55225 8.00006818,5.00025 L5.00013636,5.00025 L5.00013636,7.0005 L4.49989773,7.0005 C3.67148943,7.0005 2.99993182,6.32892712 2.99993182,5.5005 L2.99993182,5.00025 L2.00020454,3 L3.49417059,3 L3.45367151,2.994 C3.22267676,2.9295 3.03743097,2.3955 3.0051817,1.71375 C2.27319834,1.78875 1.60571351,2.00025 1.10772482,2.00025 C0.713983773,2.00025 0,1.82025 0,1.5 C0,1.1805 0.713983773,1.0005 1.10772482,1.0005 C1.60571351,1.0005 2.27319834,1.21125 3.0051817,1.28775 C3.03968092,0.5595 3.24817618,0 3.50017045,0 C3.75216472,0 3.96065999,0.5595 3.9951592,1.28625 C4.72789255,1.21125 5.39462739,1.0005 5.89261608,1.0005 C6.28635713,1.0005 7.0003409,1.1805 7.0003409,1.5 C7.0003409,1.82025 6.28635713,2.00025 5.89261608,2.00025 C5.39462739,2.00025 4.72789255,1.7895 3.9951592,1.71225 C3.96290993,2.3955 3.77766414,2.9295 3.54666939,2.994 L3.50467035,2.99925 L8.99979546,2.99925 L8.99979546,2.75025 C8.99979546,2.33603644 9.33557427,2.00025 9.74977841,2.00025 L12.2502216,2.00025 C12.6644257,2.00025 13.0002045,2.33603644 13.0002045,2.75025 L13.0002045,2.99925 L18.4938297,2.99925 L18.4533306,2.994 C18.2223359,2.9295 18.0370901,2.3955 18.0048408,1.71375 C17.2728574,1.78875 16.6053726,2.00025 16.1073839,2.00025 C15.7136429,2.00025 14.9996591,1.82025 14.9996591,1.5 C14.9996591,1.1805 15.7136429,1.0005 16.1073839,1.0005 C16.6053726,1.0005 17.2728574,1.21125 18.0048408,1.28775 C18.03934,0.5595 18.2478353,0 18.4998295,0 Z" id="形状"></path>
<polygon id="路径" points="12.9972046 10.0005 12.9972046 7.0005 8.99979546 7.0005 8.99979546 10.0005 5.99986364 10.0005 11 14.00025 16.0001364 10.0005"></polygon>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
...@@ -13,10 +13,10 @@ ...@@ -13,10 +13,10 @@
<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>
<SymbolIcon icon="renwujieshu1" /> <img src="./assets/images/end.svg" />
<span class="dib">任务结束</span> <span class="dib">任务结束</span>
</div> </div>
<template v-if="uav.network === 1"> <template v-if="uav.network === 2">
<div v-if="controlType === 0" class="control-bottom-item" @click="onModeManual"> <div v-if="controlType === 0" class="control-bottom-item" @click="onModeManual">
<img src="./assets/images/manual.svg" /> <img src="./assets/images/manual.svg" />
<span class="dib">自动</span> <span class="dib">自动</span>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<div class="tb-tr" v-for="item in airwayData.records" :key="item.id"> <div class="tb-tr" v-for="item in airwayData.records" :key="item.id">
<div class="td">{{ item.id || "暂无" }}</div> <div class="td">{{ item.id || "暂无" }}</div>
<div class="td"> <div class="td">
<div>{{ item.flightName || "暂无" }}</div> <div>{{ item.name || "暂无" }}</div>
</div> </div>
<div class="td">{{ item.organizationName || "暂无" }}</div> <div class="td">{{ item.organizationName || "暂无" }}</div>
<!-- 空域状态 --> <!-- 空域状态 -->
......
...@@ -132,6 +132,7 @@ export default { ...@@ -132,6 +132,7 @@ export default {
...mapActions("MMCFlightControlCenter", [ ...mapActions("MMCFlightControlCenter", [
"createAirwayEntities", "createAirwayEntities",
"clearAirwayEntities", "clearAirwayEntities",
"apiPointsToFKZXPoints",
]), ]),
...mapActions("MMCFlightControlCenter/uav", ["isTakeOver"]), ...mapActions("MMCFlightControlCenter/uav", ["isTakeOver"]),
/** /**
...@@ -202,8 +203,16 @@ export default { ...@@ -202,8 +203,16 @@ export default {
let res = await AirLine.routeDetail({ let res = await AirLine.routeDetail({
id: this.selectedTask?.airwayId, id: this.selectedTask?.airwayId,
}); });
if (res.code === 200) { if (res.code === 0) {
this.selectedAirway = res.data; let content = await apiPointsToFKZXPoints({
list: res.data.linePointRespVOS,
actionListKey: "pointActionRespVOS",
});
this.selectedAirway = {
name: res.data.flightName,
id: res.data.id,
content,
};
} }
} else { } else {
this.rootNode.$emit("airwayGet", { this.rootNode.$emit("airwayGet", {
......
...@@ -82,6 +82,15 @@ export default { ...@@ -82,6 +82,15 @@ export default {
}, },
}, },
}, },
watch: {
hangar() {
this.openTask = false;
this.openAIList = false;
this.$nextTick(() => {
this.openTask = true;
});
},
},
methods: { methods: {
onClickTask() { onClickTask() {
this.openTask = !this.openTask; this.openTask = !this.openTask;
......
<template> <template>
<div> <div>
<div class="police" v-interact> <div class="police dialog1027" v-interact>
<div class="police_head"> <div class="dialog-header">
<div class="police_name"> <img class="dialog-header__icon" src="../../assets/images/mount_head.png" />
<img src="../../assets/images/mount_head.png" /> <div class="dialog-header__title">警灯</div>
<div class="police_font">警灯</div>
</div> <div class="dialog-header__close" @click="$emit('close')">关闭</div>
<div class="police_font" @click="$emit('close')">关闭</div>
</div> </div>
<div class="police_ceonter"> <div class="police_ceonter">
<!-- 警灯模式 --> <!-- 警灯模式 -->
......
...@@ -33,11 +33,11 @@ ...@@ -33,11 +33,11 @@
<SymbolIcon icon="yunhangrizhi2" /> <SymbolIcon icon="yunhangrizhi2" />
<span class="txt">运行日志</span> <span class="txt">运行日志</span>
</div> </div>
<div class="item" @click="guideFlight" v-if="uav && uav.network === 1"> <div class="item" @click="guideFlight" v-if="uav && uav.network === 2">
<SymbolIcon icon="tiaozhuandaozuobiao" /> <SymbolIcon icon="tiaozhuandaozuobiao" />
<span class="txt">指点飞行</span> <span class="txt">指点飞行</span>
</div> </div>
<div class="item" @click="onInfieldControl" v-if="uav && uav.network === 1"> <div class="item" @click="onInfieldControl" v-if="uav && uav.network === 2">
<img class="dib mt3" src="./assets/images/1.svg" alt /> <img class="dib mt3" src="./assets/images/1.svg" alt />
<span class="txt">内场控制</span> <span class="txt">内场控制</span>
</div> </div>
...@@ -415,6 +415,7 @@ export default { ...@@ -415,6 +415,7 @@ export default {
height: 36px; height: 36px;
background: #3c3c3c; background: #3c3c3c;
border-radius: 10px 10px 0px 0px; border-radius: 10px 10px 0px 0px;
padding-left: 10px;
.title { .title {
display: flex; display: flex;
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<span class="">无人机</span> <span class="">无人机</span>
</div> </div>
<div <div
v-if="!isHangar && uav.network === 1" v-if="!isHangar && uav.network === 2"
class="control-item" class="control-item"
:class="showAlarmLamp ? 'active' : ''" :class="showAlarmLamp ? 'active' : ''"
@click="onSwitchShow('showAlarmLamp')" @click="onSwitchShow('showAlarmLamp')"
......
...@@ -48,6 +48,6 @@ export default { ...@@ -48,6 +48,6 @@ export default {
bottom: 0; bottom: 0;
left: 50%; left: 50%;
transform: translate(-50%, 0); transform: translate(-50%, 0);
z-index: 100; // z-index: 100;
} }
</style> </style>
\ No newline at end of file
...@@ -471,7 +471,7 @@ export default { ...@@ -471,7 +471,7 @@ export default {
let res = await flightTaskAPI.addFlight(data); let res = await flightTaskAPI.addFlight(data);
this.$emit("close"); this.$emit("close");
if (res.code === 200) { if (res.code === 0) {
this.$message.success("航线已生成!"); this.$message.success("航线已生成!");
this.bus.$emit('getFlyway'); this.bus.$emit('getFlyway');
} }
......
...@@ -36,6 +36,11 @@ export default { ...@@ -36,6 +36,11 @@ export default {
sdk: null, sdk: null,
}; };
}, },
computed: {
vUrl(){
return this.data?.vUrl?.replace('srs://', '');
}
},
watch: { watch: {
data: { data: {
handler(value) { handler(value) {
...@@ -70,7 +75,7 @@ export default { ...@@ -70,7 +75,7 @@ export default {
this.sdk = new SrsRtcPlayerAsync(); this.sdk = new SrsRtcPlayerAsync();
this.$refs["webrtc"].srcObject = this.sdk.stream; this.$refs["webrtc"].srcObject = this.sdk.stream;
this.sdk this.sdk
.play(this.data.vUrl) .play(this.vUrl)
.then(function (session) {}) .then(function (session) {})
.catch(function (reason) { .catch(function (reason) {
console.log("srs err", reason); console.log("srs err", reason);
......
...@@ -322,7 +322,7 @@ ...@@ -322,7 +322,7 @@
</div> </div>
<div class="right-menu"> <div class="right-menu">
<template v-if="device.network === 1"> <template v-if="device.network === 2">
<el-tooltip content="拍照" placement="bottom"> <el-tooltip content="拍照" placement="bottom">
<div class="menu-item plate" @click="photojz"> <div class="menu-item plate" @click="photojz">
<img src="./assets/images/ai.png" /> <img src="./assets/images/ai.png" />
...@@ -561,32 +561,15 @@ export default { ...@@ -561,32 +561,15 @@ export default {
*/ */
playerCom() { playerCom() {
if (this.streamSelect) { if (this.streamSelect) {
switch (this.streamSelect.toLowerCase()) { if (this.vUrl.vUrl?.toLowerCase().includes("pzsp://")) {
case "flv":
return "LiveNVRPlayer";
case "srs":
return "SRSPlayer";
case "livenvr":
return "LiveNVRPlayer";
case "qingliu":
return "QingLiuPlayer";
case "webrtc":
// return "LiveNVRPlayer";
return "SRSPlayer";
default:
return "LiveNVRPlayer";
}
} else {
if (this.vUrl.vUrl?.includes("pzsp://")) {
return "QingLiuPlayer"; return "QingLiuPlayer";
} else if(this.vUrl.vUrl?.toLowerCase().includes("srs://")){
return "SRSPlayer"
} else { } else {
return "LiveNVRPlayer"; return "LiveNVRPlayer";
} }
} else {
return "QingLiuPlayer";
} }
}, },
/** /**
...@@ -618,37 +601,34 @@ export default { ...@@ -618,37 +601,34 @@ export default {
*/ */
streamOptions() { streamOptions() {
let streamOptions = []; let streamOptions = [];
// this.streamSelect = "hlsUrl"; let streamConfiguration = this.device?.streamConfiguration.find(item => item.urlType === 0);
// 固定使用公网类型的视频地址 urlType 0公网
this.device?.streamConfiguration?.filter(i => i.urlType === 0).forEach((item1) => { if (streamConfiguration?.fluencyUrl) {
const fields = [{ // 流畅地址
field: 'originalUrl', streamOptions.push({
streamType: 'ORIGINAL', label: "流畅",
streamLabel: '原画', value: 'FLV',
},{ url: streamConfiguration?.fluencyUrl,
field: 'fluencyUrl',
streamType: 'FLV',
streamLabel: '流畅',
},{
field: 'lowLatencyUrl',
streamType: 'WEBRTC',
streamLabel: '低延迟',
}]
fields.filter(f => item1[f.field]).forEach((item2) => {
let brand = item1.videoSource?.toUpperCase() || "";
if (item2.streamType === "WEBRTC") {
brand = "SRS";
}
streamOptions.unshift({
label: item2.streamLabel,
value: item2.streamType,
brand,
url: item1[item2.field],
// 只有liveNVR支持fpvUrl
fpvUrl: "",
});
}); });
}); }
if (streamConfiguration?.lowLatencyUrl) {
// 低延迟地址
streamOptions.push({
label: "低延迟",
value: 'WEBRTC',
url: streamConfiguration?.lowLatencyUrl,
});
}
if (streamConfiguration?.originalUrl) {
// 原画地址
streamOptions.push({
label: "原画",
value: 'QINGLIU',
url: streamConfiguration?.originalUrl,
});
}
return streamOptions; return streamOptions;
}, },
/** /**
...@@ -717,7 +697,6 @@ export default { ...@@ -717,7 +697,6 @@ export default {
deep: true, deep: true,
immediate: true, immediate: true,
}, },
streamSelect: function (val) {},
networkType() { networkType() {
let find = this.streamOptions.find((item) => { let find = this.streamOptions.find((item) => {
return item.value == this.streamSelect; return item.value == this.streamSelect;
...@@ -867,7 +846,9 @@ export default { ...@@ -867,7 +846,9 @@ export default {
`${this.screenRecordingStatus ? "开始" : "结束"}录屏` `${this.screenRecordingStatus ? "开始" : "结束"}录屏`
); );
} else { } else {
this.$message.error(`${this.screenRecordingStatus ? "开始" : "结束"}录屏失败`); this.$message.error(
`${this.screenRecordingStatus ? "开始" : "结束"}录屏失败`
);
this.screenRecordingStatus = !this.screenRecordingStatus; this.screenRecordingStatus = !this.screenRecordingStatus;
} }
}, },
...@@ -920,7 +901,7 @@ export default { ...@@ -920,7 +901,7 @@ export default {
data.append("latitude", this.device?.locationCoordinate3D?.latitude); data.append("latitude", this.device?.locationCoordinate3D?.latitude);
} }
const res = await Control_API.addPhoto(data); const res = await Control_API.addPhoto(data);
if (res.code === 200) { if (res.code === 0) {
this.$message.success("截屏成功"); this.$message.success("截屏成功");
} else { } else {
this.$message({ this.$message({
...@@ -1006,7 +987,7 @@ export default { ...@@ -1006,7 +987,7 @@ export default {
} }
let mounteList = { data: buffer, ...mountData }; let mounteList = { data: buffer, ...mountData };
if (buffer) { if (buffer) {
if (this.device.network === 1) { if (this.device.network === 2) {
let topic = "PX4/OBTAIN/" + this.device.deviceId; let topic = "PX4/OBTAIN/" + this.device.deviceId;
this.$store.dispatch("MMCMQTT/publish", { this.$store.dispatch("MMCMQTT/publish", {
topic: topic, topic: topic,
......
...@@ -43,12 +43,8 @@ ...@@ -43,12 +43,8 @@
style="margin-right:10px" style="margin-right:10px"
:class="device.status==1&&device.currentOperator==1? 'blue' : device.status==1&&device.currentOperator!=1 ?'yellow':'' " :class="device.status==1&&device.currentOperator==1? 'blue' : device.status==1&&device.currentOperator!=1 ?'yellow':'' "
:title="device.name" :title="device.name"
>{{device.name}}</span> --> >{{device.name}}</span>-->
<span <span style="margin-right:10px" :class="'blue'" :title="device.name">{{device.name}}</span>
style="margin-right:10px"
:class="'blue'"
:title="device.name"
>{{device.name}}</span>
<span style="color:#31DB24 " class="dib" v-if="device.isOnline">(在线)</span> <span style="color:#31DB24 " class="dib" v-if="device.isOnline">(在线)</span>
<span v-else class="dib">(离线)</span> <span v-else class="dib">(离线)</span>
<div class="symbol-icon-box"> <div class="symbol-icon-box">
...@@ -67,7 +63,7 @@ ...@@ -67,7 +63,7 @@
<div class="uav_version status-icon cp"> <div class="uav_version status-icon cp">
<img src="./assets/images/cq.svg" /> <img src="./assets/images/cq.svg" />
</div> </div>
</template> --> </template>-->
<template> <template>
<div class="uav_version status-icon cp"> <div class="uav_version status-icon cp">
<img src="./assets/images/I.svg" /> <img src="./assets/images/I.svg" />
...@@ -91,11 +87,7 @@ ...@@ -91,11 +87,7 @@
@click="onShowPanel(device)" @click="onShowPanel(device)"
v-hover v-hover
></div> ></div>
<div <div class="jieg" title="接管无人机" @click="onTakeOver(device)" v-hover>
class="jieg" title="接管无人机"
@click="onTakeOver(device)"
v-hover
>
<img src="./assets/images/jieguan_active.svg" v-if="device.currentOperator" /> <img src="./assets/images/jieguan_active.svg" v-if="device.currentOperator" />
<img src="./assets/images/jieguan.svg" v-else /> <img src="./assets/images/jieguan.svg" v-else />
</div> </div>
...@@ -112,7 +104,7 @@ import { Control_API } from "../../../../../../../../api"; ...@@ -112,7 +104,7 @@ import { Control_API } from "../../../../../../../../api";
export default { export default {
name: "Item", name: "Item",
inject: ['rootNode', 'bus'], inject: ["rootNode", "bus"],
data() { data() {
return {}; return {};
}, },
...@@ -134,7 +126,7 @@ export default { ...@@ -134,7 +126,7 @@ export default {
]), ]),
...mapState("MMCFlightControlCenter", ["userInfo"]), ...mapState("MMCFlightControlCenter", ["userInfo"]),
}, },
methods: { methods: {
/** /**
* 接管无人机 * 接管无人机
...@@ -142,7 +134,7 @@ export default { ...@@ -142,7 +134,7 @@ export default {
async onTakeOver(uav) { async onTakeOver(uav) {
if (!uav.currentOperator) { if (!uav.currentOperator) {
let res = await Control_API.setUavControlOn({ let res = await Control_API.setUavControlOn({
deviceId: uav.id deviceId: uav.id,
}); });
if (res.code === 0) { if (res.code === 0) {
this.$message.success(`请开始操作${uav.name}`); this.$message.success(`请开始操作${uav.name}`);
...@@ -160,7 +152,7 @@ export default { ...@@ -160,7 +152,7 @@ export default {
showClose: false, showClose: false,
}); });
let res = await Control_API.setUavControlOff({ let res = await Control_API.setUavControlOff({
deviceId: uav.id deviceId: uav.id,
}); });
if (res.code === 0) { if (res.code === 0) {
this.$message.success(`已退出接管${uav.name}`); this.$message.success(`已退出接管${uav.name}`);
...@@ -180,7 +172,7 @@ export default { ...@@ -180,7 +172,7 @@ export default {
} }
); );
let res = await Control_API.setUavControlOnForce({ let res = await Control_API.setUavControlOnForce({
deviceId: uav.id deviceId: uav.id,
}); });
if (res.code === 0) { if (res.code === 0) {
this.$message.success(`请开始操作${uav.name}`); this.$message.success(`请开始操作${uav.name}`);
...@@ -228,6 +220,13 @@ export default { ...@@ -228,6 +220,13 @@ export default {
if (this.uav) { if (this.uav) {
this.$store.dispatch("MMCFlightControlCenter/uav/unsubscribe"); this.$store.dispatch("MMCFlightControlCenter/uav/unsubscribe");
} }
// 在未打开播放器的情况下,有uav信息,到此步时肯定已经展开了面板,判断是否有流媒体信息, 并显示播放器
if (!item.streamConfiguration) {
let res = await Control_API.getDeviceStream({
deviceId: item.id,
});
item.streamConfiguration = res.data.list;
}
this.$store.commit("MMCFlightControlCenter/uav/setState", { this.$store.commit("MMCFlightControlCenter/uav/setState", {
key: "showPanel", key: "showPanel",
value: true, value: true,
...@@ -254,11 +253,11 @@ export default { ...@@ -254,11 +253,11 @@ export default {
value: true, value: true,
}); });
} }
this.rootNode.$emit('uavChange', { this.rootNode.$emit("uavChange", {
uav: this.uav, uav: this.uav,
showPanel: this.showPanel, showPanel: this.showPanel,
showPlayer: this.showPlayer showPlayer: this.showPlayer,
}) });
}, },
/** /**
* 显示播放器 * 显示播放器
...@@ -281,16 +280,16 @@ export default { ...@@ -281,16 +280,16 @@ export default {
}, },
}); });
// 关闭播放器时若未展开面板,需要取消订阅 // 关闭播放器时若未展开面板,需要取消订阅
if(!this.showPanel){ if (!this.showPanel) {
this.$store.dispatch("MMCFlightControlCenter/uav/unsubscribe"); this.$store.dispatch("MMCFlightControlCenter/uav/unsubscribe");
} }
} else { } else {
// 在未打开播放器的情况下,有uav信息,到此步时肯定已经展开了面板,判断是否有流媒体信息, 并显示播放器 // 在未打开播放器的情况下,有uav信息,到此步时肯定已经展开了面板,判断是否有流媒体信息, 并显示播放器
if (!this.uav.streamConfiguration) { if (!item.streamConfiguration) {
let res = await Control_API.getDeviceStream({ let res = await Control_API.getDeviceStream({
id: item.id, deviceId: item.id,
}); });
item.streamConfiguration = res.data; item.streamConfiguration = res.data.list;
} }
this.$store.commit("MMCFlightControlCenter/uav/setState", { this.$store.commit("MMCFlightControlCenter/uav/setState", {
key: "showPlayer", key: "showPlayer",
...@@ -300,7 +299,7 @@ export default { ...@@ -300,7 +299,7 @@ export default {
key: "uav", key: "uav",
value: { value: {
...item, ...item,
...this.uav || {}, ...(this.uav || {}),
showPlayer: true, showPlayer: true,
showPanel: this.showPanel, showPanel: this.showPanel,
}, },
...@@ -308,21 +307,23 @@ export default { ...@@ -308,21 +307,23 @@ export default {
} }
} else { } else {
// 由于hardId不同,到此步时可能是第一次点击,或者是面板已展开 // 由于hardId不同,到此步时可能是第一次点击,或者是面板已展开
if(this.showPanel){ if (this.showPanel) {
// 面板已展开禁止切换视频 // 面板已展开禁止切换视频
return; return;
} }
if(this.uav){ if (this.uav) {
// 切换无人机视频前需要取消订阅前一台无人机消息 // 切换无人机视频前需要取消订阅前一台无人机消息
this.$store.dispatch("MMCFlightControlCenter/uav/unsubscribe"); this.$store.dispatch("MMCFlightControlCenter/uav/unsubscribe");
} }
// 获取该无人机视频流信息 // 获取该无人机视频流信息
let res = await Control_API.getDeviceStream({ if (!item.streamConfiguration) {
id: item.id, let res = await Control_API.getDeviceStream({
}); deviceId: item.id,
item.streamConfiguration = res.data; });
item.streamConfiguration = res.data.list;
}
this.$store.commit("MMCFlightControlCenter/uav/setState", { this.$store.commit("MMCFlightControlCenter/uav/setState", {
key: "showPlayer", key: "showPlayer",
value: true, value: true,
...@@ -337,11 +338,11 @@ export default { ...@@ -337,11 +338,11 @@ export default {
}); });
this.$store.dispatch("MMCFlightControlCenter/uav/subscribe"); this.$store.dispatch("MMCFlightControlCenter/uav/subscribe");
} }
this.rootNode.$emit('uavChange', { this.rootNode.$emit("uavChange", {
uav: this.uav, uav: this.uav,
showPanel: this.showPanel, showPanel: this.showPanel,
showPlayer: this.showPlayer showPlayer: this.showPlayer,
}) });
}, },
}, },
}; };
......
...@@ -15,7 +15,7 @@ export default { ...@@ -15,7 +15,7 @@ export default {
}, },
watch: { watch: {
mqttDataSet(newVal) { mqttDataSet(newVal) {
if (this.uav?.network === 1) { if (this.uav?.network === 2) {
if (newVal) { if (newVal) {
this.$store.dispatch( this.$store.dispatch(
"MMCFlightControlCenter/uav/updateByMQTT", "MMCFlightControlCenter/uav/updateByMQTT",
......
...@@ -181,6 +181,7 @@ export default { ...@@ -181,6 +181,7 @@ export default {
if (!window.$mmc) { if (!window.$mmc) {
window.$mmc = {}; window.$mmc = {};
} }
window.$mmc.app = this;
window.$mmc.$store = this.$store; window.$mmc.$store = this.$store;
window.$mmc.state = () => { window.$mmc.state = () => {
return this.$store.state; return this.$store.state;
...@@ -235,7 +236,7 @@ export default { ...@@ -235,7 +236,7 @@ export default {
width: 100%; width: 100%;
.el-input__inner { .el-input__inner {
background-color: #191919; background-color: #191919 !important;
color: #fff; color: #fff;
border: 1px solid #4b4b4b !important; border: 1px solid #4b4b4b !important;
} }
...@@ -277,9 +278,10 @@ export default { ...@@ -277,9 +278,10 @@ export default {
.dialog1027 { .dialog1027 {
z-index: 1; z-index: 1;
background: #222222; background: #222222;
border-radius: 10px 10px 0px 0px;
.dialog-header { .dialog-header {
box-sizing: border-box; box-sizing: border-box;
padding-left: 8px; padding-left: 32px;
padding-right: 16px; padding-right: 16px;
background-position: 12px 4px; background-position: 12px 4px;
height: 32px; height: 32px;
...@@ -374,10 +376,7 @@ export default { ...@@ -374,10 +376,7 @@ export default {
} }
.el-input__inner { .el-input__inner {
// height: 32px;
background: #02173d;
border-radius: 2px; border-radius: 2px;
border: 1px solid #315ec7;
font-size: 14px; font-size: 14px;
font-family: MicrosoftYaHei; font-family: MicrosoftYaHei;
color: #ffffff; color: #ffffff;
...@@ -542,8 +541,7 @@ export default { ...@@ -542,8 +541,7 @@ export default {
.el-picker-panel__body-wrapper, .el-picker-panel__body-wrapper,
.el-time-range-picker__content { .el-time-range-picker__content {
background: #0d224f; background: #191919;
border: 1px solid #00aeff;
color: #fff; color: #fff;
.el-month-table td.current:not(.disabled) .cell { .el-month-table td.current:not(.disabled) .cell {
...@@ -552,7 +550,6 @@ export default { ...@@ -552,7 +550,6 @@ export default {
.el-input__inner { .el-input__inner {
color: #fff; color: #fff;
border: 1px solid #00aeff;
} }
.el-date-table td.disabled div { .el-date-table td.disabled div {
...@@ -573,7 +570,7 @@ export default { ...@@ -573,7 +570,7 @@ export default {
} }
.el-input--small .el-input__inner { .el-input--small .el-input__inner {
background-color: #0d224f; background-color: #191919;
} }
.el-picker-panel__icon-btn { .el-picker-panel__icon-btn {
...@@ -583,17 +580,17 @@ export default { ...@@ -583,17 +580,17 @@ export default {
.el-picker-panel__footer, .el-picker-panel__footer,
.el-time-panel__footer { .el-time-panel__footer {
background-color: #0d224f; background-color: #191919;
} }
.popper__arrow { .popper__arrow {
border-bottom-color: #00aeff; border-bottom-color: #fff;
border-top-color: #00aeff; border-top-color: #fff;
} }
.popper__arrow::after { .popper__arrow::after {
border-top-color: #0d224f; border-top-color: #191919;
border-bottom-color: #0d224f; border-bottom-color: #191919;
} }
.el-button.el-button--mini.is-plain, .el-button.el-button--mini.is-plain,
...@@ -604,7 +601,7 @@ export default { ...@@ -604,7 +601,7 @@ export default {
} }
.el-time-spinner__item { .el-time-spinner__item {
color: #00eaff; color: #fff;
} }
.el-time-panel__btn { .el-time-panel__btn {
......
...@@ -166,18 +166,18 @@ export default { ...@@ -166,18 +166,18 @@ export default {
entityCollection.airwayId = data.id; // 由于id属性不允许更改,这里使用airwayId来使用 entityCollection.airwayId = data.id; // 由于id属性不允许更改,这里使用airwayId来使用
polyline.forEach(async (item, index) => { polyline.forEach(async (item, index) => {
item.longitude = Number(item.longitude); item.longitude = Number(item.coordinate.longitude);
item.latitude = Number(item.latitude); item.latitude = Number(item.coordinate.latitude);
item.alt = Number(item.alt); item.altitude = Number(item.altitude);
pointPositions.push(item.longitude, item.latitude, item.alt); pointPositions.push(item.longitude, item.latitude, item.altitude);
label_arr.push( label_arr.push(
Cesium.Cartesian3.fromDegrees(item.longitude, item.latitude, item.alt) Cesium.Cartesian3.fromDegrees(item.longitude, item.latitude, item.altitude)
); );
let point_entity = state.cesiumViewer.entities.add({ let point_entity = state.cesiumViewer.entities.add({
position: Cesium.Cartesian3.fromDegrees( position: Cesium.Cartesian3.fromDegrees(
item.longitude, item.longitude,
item.latitude, item.latitude,
item.alt item.altitude
), ),
name: "show_airline_point", name: "show_airline_point",
point: { point: {
...@@ -237,6 +237,37 @@ export default { ...@@ -237,6 +237,37 @@ export default {
state.airwayEntities.push(entityCollection); state.airwayEntities.push(entityCollection);
}, },
/**
* api航线数据协议转飞控中心航点数据协议
* @param { array } list api返回的航线数据
* @param { string } actionListKey api航线数据中动作列表键名
*/
apiPointsToFKZXPoints({ state, dispatch }, { list, actionListKey }) {
// 转换成飞控中心能接受的数据协议
let waypointList =
list?.map((item) => {
let waypointActions =
item[actionListKey]?.map((item1) => {
return {
param3: item1.actionValue,
actionType: item1.actionType,
};
}) || [];
return {
altitude: item.altitude,
coordinate: {
latitude: item.latitude,
longitude: item.longitude,
},
frame: 3,
speed: item.speed,
stay: 0,
waypointActions,
};
}) || [];
return waypointList;
},
}, },
getters: { getters: {
//地面站websocket url //地面站websocket url
......
...@@ -446,7 +446,7 @@ const actions = { ...@@ -446,7 +446,7 @@ const actions = {
* @param {object} data * @param {object} data
*/ */
subscribe({ state, dispatch }) { subscribe({ state, dispatch }) {
if (state.uav.network === 1) { if (state.uav.network === 2) {
window.$mmc.$store.dispatch("MMCMQTT/subscribe", { window.$mmc.$store.dispatch("MMCMQTT/subscribe", {
topic: "PX4/RECEIVE/" + state.uav.deviceId, topic: "PX4/RECEIVE/" + state.uav.deviceId,
callback(ok) { callback(ok) {
...@@ -491,7 +491,7 @@ const actions = { ...@@ -491,7 +491,7 @@ const actions = {
* @param {} param0 * @param {} param0
*/ */
unsubscribe({ state, dispatch }) { unsubscribe({ state, dispatch }) {
if (state.uav.network === 1) { if (state.uav.network === 2) {
window.$mmc.$store.dispatch("MMCMQTT/unsubscribe", { window.$mmc.$store.dispatch("MMCMQTT/unsubscribe", {
topic: "PX4/RECEIVE/" + state.uav.deviceId, topic: "PX4/RECEIVE/" + state.uav.deviceId,
callback(ok) { callback(ok) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论