提交 9af1d91c 作者: 翁进城

V4功能适配

上级 caa9c6da
流水线 #10564 已失败 于阶段
......@@ -9,6 +9,7 @@
:scene="scene"
:useSTLAirway="useSTLAirway"
:useTimedTask="useTimedTask"
@tokenInvalid="dispatchEvent('tokenInvalid')"
@uavChange="dispatchEvent('uavChange', $event)"
@uavTaskStart="dispatchEvent('uavTaskStart', $event)"
@uavTaskAdd="dispatchEvent('uavTaskAdd', $event)"
......
......@@ -48,6 +48,7 @@
"mqtt": "^4.3.6",
"nanoid": "^5.0.7",
"prismjs": "^1.29.0",
"qs": "^6.12.3",
"recorder-core": "^1.2.23020100",
"terraformer-wkt-parser": "^1.2.1",
"url": "^0.11.0",
......
import request from '../request';
import request from "../request";
class AirLine {
/**
......@@ -8,9 +8,9 @@ class AirLine {
*/
static lineList(params) {
return request({
url: '/dms/route/page',
method: 'get',
params
url: "/dms/route/page",
method: "get",
params,
});
}
......@@ -21,15 +21,15 @@ class AirLine {
*/
static Edit(data) {
return request({
url: '/dms/route/add',
method: 'post',
data
url: "/dms/route/add",
method: "post",
data,
});
}
static routeDelete(id) {
return request({
url: `/dms/route/delete/${id}`,
method: 'delete'
method: "delete",
});
}
......@@ -40,9 +40,9 @@ class AirLine {
*/
static Change(data) {
return request({
url: '/dms/route/update',
method: 'put',
data
url: "/dms/route/update",
method: "put",
data,
});
}
......@@ -54,8 +54,8 @@ class AirLine {
static details(params) {
return request({
url: `/tmj/route/getRouteDetail/${params}`,
method: 'get',
params
method: "get",
params,
});
}
......@@ -67,11 +67,11 @@ class AirLine {
static upload(data) {
return request({
headers: {
'Content-Type': 'multipart/form-data'
"Content-Type": "multipart/form-data",
},
url: '/dms/route/upload',
method: 'post',
data
url: "/dms/route/upload",
method: "post",
data,
});
}
/**
......@@ -82,11 +82,11 @@ class AirLine {
static uploadFile(data) {
return request({
headers: {
'Content-Type': 'multipart/form-data'
"Content-Type": "multipart/form-data",
},
url: '/crm/dimensionMark/uploadFile',
method: 'post',
data
url: "/crm/dimensionMark/uploadFile",
method: "post",
data,
});
}
......@@ -98,11 +98,11 @@ class AirLine {
static uploadRoutes(data) {
return request({
headers: {
'Content-Type': 'multipart/form-data'
"Content-Type": "multipart/form-data",
},
url: '/dms/route/upload',
method: 'post',
data
url: "/dms/route/upload",
method: "post",
data,
});
}
/**
......@@ -113,7 +113,7 @@ class AirLine {
static deleteRoute(params) {
return request({
url: `/dms/route/delete/${params}`,
method: 'delete'
method: "delete",
});
}
......@@ -124,9 +124,25 @@ class AirLine {
*/
static routeDetail(params) {
return request({
url: '/dms/route/id',
method: 'get',
params
url: "/admin-api/uas/flight-line/get",
method: "get",
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 {
*/
static getSorties(params) {
return request({
url: '/dms/route/id',
method: 'get',
params
url: "/dms/route/id",
method: "get",
params,
});
}
/**
......@@ -149,9 +165,9 @@ class AirLine {
*/
static getSortiesHistoryVideo(params) {
return request({
url: '/dms/sortie/history-video',
method: 'get',
params
url: "/dms/sortie/history-video",
method: "get",
params,
});
}
/**
......@@ -161,9 +177,9 @@ class AirLine {
*/
static getSortiesTrajectory(params) {
return request({
url: '/dms/sortie/data',
method: 'get',
params
url: "/dms/sortie/data",
method: "get",
params,
});
}
}
......
......@@ -218,7 +218,7 @@ class Control_API {
// 获取设备视频流
static getDeviceStream(params) {
return request({
url: `/admin-api/uas/drive/getDeviceStream`,
url: `/admin-api/uas/device-stream/page`,
method: "get",
params
});
......
......@@ -59,6 +59,11 @@ $axios.interceptors.response.use(
case 0:
return Promise.resolve(res);
case 401:
localStorage.setItem("token", "");
window.$mmc.app.$emit('tokenInvalid');
break;
default:
if (response.config.responseType === "blob") {
return Promise.resolve(res);
......
......@@ -23,7 +23,7 @@
<div class="tb-tr" v-for="item in airwayData.records" :key="item.id">
<div class="td">{{ item.id || "暂无" }}</div>
<div class="td">
<div>{{ item.flightName || "暂无" }}</div>
<div>{{ item.name || "暂无" }}</div>
</div>
<div class="td">{{ item.organizationName || "暂无" }}</div>
<!-- 空域状态 -->
......
......@@ -143,7 +143,7 @@ export default {
let res = await AirLine.routeDetail({
id: this.selectedTask?.airwayId,
});
if (res.code === 200) {
if (res.code === 0) {
this.selectedAirway = res.data;
}
} else {
......
<template>
<div class="task-add">
<div class="task-add-header" v-interact>
<div class="header__title">定时任务</div>
<div class="header-right">
<div class="header-right__close" @click="$emit('close')">关闭</div>
</div>
<div class="task-add dialog1027">
<div class="dialog-header" v-interact>
<div class="dialog-header__title">定时任务</div>
<div class="dialog-header__close" @click="$emit('close')">关闭</div>
</div>
<div class="task-add-main">
<el-form ref="form" :model="form" label-width="100px">
<div class="dialog-content">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="执行日期" prop="date" required>
<el-date-picker
v-model="form.date"
......@@ -58,15 +56,22 @@ export default {
return {
form: {
date: [],
time: ['00:00:00', '00:00:00'],
time: ["00:00:00", "23:59:59"],
normalTaskId: "",
},
rules: {
date: [{ required: true, message: "请选择日期", trigger: "blur" }],
time: [{ required: true, message: "请选择时间", trigger: "blur" }],
normalTaskId: [
{ required: true, message: "请选择任务", trigger: "blur" },
],
},
pickerOptions: {
disabledDate: (time) => {
// 日期选择限制
return time.getTime() < Date.now() - 8.64e7;
},
}
},
};
},
computed: {
......@@ -96,9 +101,8 @@ export default {
//渲染新航线
if (newVal) {
await this.getAirway(newVal);
let airway = JSON.parse(newVal.airway.content);
this.createAirwayEntities({
polyline: airway.content,
polyline: newVal.airway.content,
id: newVal.airwayId,
});
}
......@@ -118,7 +122,7 @@ export default {
let res = await AirLine.routeDetail({
id: item?.airwayId,
});
if (res.code === 200) {
if (res.code === 0) {
this.$set(item, "airway", res.data);
}
}
......@@ -132,7 +136,7 @@ export default {
if (valid) {
this.rootNode.$emit("hangarTaskAdd", {
type: 3, //1: 日常任务 2.定时任务 3.周期任务
taskList: [this.form], //任务数据
taskList: [{ ...this.form, airway: this.selectedTask.airway }], //任务数据
}); // 根节点发送机库任务新增事件
this.$emit("close");
} else {
......@@ -148,7 +152,7 @@ export default {
.task-add {
height: 286px;
background: rgba(9, 32, 87, 0.7);
border: 1px solid #70daf9;
// border: 1px solid #70daf9;
position: absolute;
top: -5px;
left: 550px;
......@@ -163,43 +167,8 @@ export default {
height: 376px;
}
.task-add-header {
flex-shrink: 0;
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;
}
}
.dialog-header {
padding-left: 16px !important;
}
.task-add-main {
......@@ -211,18 +180,12 @@ export default {
.task-add__btn {
margin: auto;
width: 122px;
height: 32px;
width: 92px;
height: 36px;
background: #3388ff;
border-radius: 2px;
cursor: pointer;
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;
display: flex;
justify-content: center;
......
......@@ -13,7 +13,11 @@
<span>{{item.name}}</span>
</el-tooltip>
</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 flex2 ctrl">
<el-tooltip content="查看" placement="top">
......@@ -60,7 +64,7 @@ export default {
data() {
return {
showTaskAdd: false,
taskListAll: []
taskListAll: [],
};
},
computed: {
......@@ -92,11 +96,11 @@ export default {
* 更新任务列表
*/
updateTaskList() {
console.log("updateTaskList");
this.taskListAll = [
...(this.$store.state.MMCFlightControlCenter.hangar.taskList.period ||
[]),
];
console.log("updateTaskList", this.taskListAll);
},
/**
* 将任务中航线对象补充完整
......@@ -106,7 +110,7 @@ export default {
let res = await AirLine.routeDetail({
id: item?.airwayId,
});
if (res.code === 200) {
if (res.code === 0) {
item.airway = res.data;
}
}
......@@ -122,9 +126,8 @@ export default {
if (find) {
this.clearAirwayEntities({ id: find.airwayId });
} else {
let airway = JSON.parse(item.airway.content);
this.createAirwayEntities({
polyline: airway.content,
polyline: item.airway.content,
id: item.airwayId,
});
}
......@@ -229,20 +232,14 @@ export default {
text-align: center;
.task-add__btn {
width: 122px;
height: 32px;
width: 124px;
height: 36px;
background: #3388ff;
border-radius: 2px;
text-align: center;
line-height: 32px;
margin: 0 auto;
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;
color: #fff;
}
......
<template>
<div class="task-add" :class="{more: showMore}">
<div class="task-add-header" v-interact>
<div class="header__title">定时任务</div>
<div class="header-right">
<div class="task-add dialog1027" :class="{more: showMore}">
<div class="task-add-header dialog-header" v-interact>
<div class="header__title dialog-header__title">定时任务</div>
<div class="header-right dialog-header__close">
<div class="header-right__add" @click="onTaskAdd">
<span class="iconfont icon-zengjia"></span>添加任务
</div>
<div class="header-right__close" @click="$emit('close')">关闭</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">
<el-date-picker
v-model="item.time"
......@@ -19,16 +19,27 @@
placeholder="选择时间"
value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions"
></el-date-picker>任务名称
></el-date-picker>
<el-select
v-model="item.normalTaskId"
size="mini"
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-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">
<span class="icon-shanchu iconfont" @click="onDelTask(index)"></span>
</el-tooltip>
......@@ -72,7 +83,7 @@ export default {
// 日期选择限制
return time.getTime() < Date.now() - 8.64e7;
},
}
},
};
},
computed: {
......@@ -87,30 +98,26 @@ export default {
/**
* 将任务中航线对象补充完整
*/
async getAirway(item) {
if (!item.airway) {
let res = await AirLine.routeDetail({
id: item?.airwayId,
});
if (res.code === 200) {
this.$set(item, "airway", res.data);
}
async getAirway(id) {
let res = await AirLine.routeDetail({
id: id,
});
if (res.code === 0) {
return res.data;
}
},
/**
* 显示或隐藏航线
*/
async onSwitchAirway(item) {
await this.getAirway(item);
let find = this.airwayEntities.find(
(item1) => item1.airwayId === item.airwayId
);
if (find) {
this.clearAirwayEntities({ id: find.airwayId });
} else {
let airway = JSON.parse(item.airway.content);
this.createAirwayEntities({
polyline: airway.content,
polyline: item.airway.content,
id: item.airwayId,
});
}
......@@ -128,14 +135,19 @@ export default {
/**
* 任务内容更改
*/
async onChangeTask(item) {
async onChangeTask(item, i) {
let normalTask = this.selectedTask(item.normalTaskId);
item.airwayId = normalTask.airwayId;
let find = this.taskList.normal.find(task => task.airwayId === item.airwayId);
if(find){
let find = this.taskList.normal.find(
(task) => task.airwayId === item.airwayId
);
if (find) {
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 {
* 确认事件
*/
onConfirm() {
this.rootNode.$emit("hangarTaskAdd", {
type: 2, //1: 日常任务 2.定时任务 3.周期任务
taskList: this.list, //任务数据
}); // 根节点发送机库任务新增事件
this.$emit('close');
let isOk = true;
this.list.some((item) => {
if (!item.time) {
this.$message.warning("请选择时间")
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 {
<style lang="scss" scoped>
.task-add {
height: 250px;
background: rgba(9, 32, 87, 0.7);
border: 1px solid #70daf9;
position: absolute;
top: -5px;
left: 550px;
width: 700px;
width: 620px;
z-index: 1;
display: flex;
flex-direction: column;
......@@ -190,15 +215,7 @@ export default {
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;
padding: 0 20px 0 0;
.header__title {
font-family: MicrosoftYaHei-Bold;
......@@ -242,6 +259,7 @@ export default {
font-size: 15px;
color: #fff;
gap: 5px;
height: fit-content;
.el-date-editor {
width: 188px;
......@@ -266,28 +284,21 @@ export default {
flex-shrink: 0;
.task-add__btn {
margin: auto;
width: 122px;
height: 32px;
cursor: pointer;
width: 92px;
height: 36px;
background: #3388ff;
border-radius: 2px;
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;
line-height: 32px;
margin: 0 auto;
margin-bottom: 10px;
cursor: pointer;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
}
}
.task-add-more {
background-color: rgba(13, 82, 143, 0.6);
background-color: #191919;
height: 24px;
cursor: pointer;
display: flex;
......
......@@ -13,7 +13,11 @@
<span>{{item.name}}</span>
</el-tooltip>
</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 flex2 ctrl">
<el-tooltip content="查看" placement="top">
......@@ -92,11 +96,11 @@ export default {
* 更新任务列表
*/
updateTaskList() {
console.log("updateTaskList");
this.taskListAll = [
...(this.$store.state.MMCFlightControlCenter.hangar.taskList.timed ||
[]),
];
console.log("updateTaskList", this.taskListAll);
},
/**
* 将任务中航线对象补充完整
......@@ -106,7 +110,7 @@ export default {
let res = await AirLine.routeDetail({
id: item?.airwayId,
});
if (res.code === 200) {
if (res.code === 0) {
item.airway = res.data;
}
}
......@@ -122,9 +126,8 @@ export default {
if (find) {
this.clearAirwayEntities({ id: find.airwayId });
} else {
let airway = JSON.parse(item.airway.content);
this.createAirwayEntities({
polyline: airway.content,
polyline: item.airway.content,
id: item.airwayId,
});
}
......@@ -229,20 +232,14 @@ export default {
text-align: center;
.task-add__btn {
width: 122px;
height: 32px;
width: 124px;
height: 36px;
background: #3388ff;
border-radius: 2px;
text-align: center;
line-height: 32px;
margin: 0 auto;
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;
color: #fff;
}
......
......@@ -83,6 +83,10 @@ export default {
color: #fff;
cursor: pointer;
* {
cursor: pointer;
}
&.active {
background: #3388ff;
label {
......
......@@ -107,6 +107,15 @@ export default {
},
},
},
watch: {
hangar(){
this.openTask = false;
this.openAIList = false;
this.$nextTick(() => {
this.openTask = true;
})
}
},
methods: {
onClickTask() {
this.openTask = !this.openTask;
......
......@@ -341,7 +341,7 @@ export default {
}
.title-box {
padding-left: 20px;
padding-left: 10px !important;
flex-shrink: 0;
display: flex;
justify-content: space-between;
......
......@@ -15,12 +15,13 @@
</div>
<div slot="dialog">
<div class="hangar-ctrl dialog1027" v-if="showHangar">
<div class="hangar-ctrl-header dialog-header">
<span class="dialog-header__title">
<img
class="hangar-ctrl-header__icon"
<div class="dialog-header">
<img
class="dialog-header__icon"
src="../../../../../../assets/images/mount_head.png"
/>操作区域
/>
<span class="dialog-header__title">
操作区域
</span>
<span class="dialog-header__close" @click="showHangar = false;">关闭</span>
</div>
......
......@@ -32,6 +32,6 @@ export default {
bottom: 0;
left: 50%;
transform: translate(-50%, 0);
z-index: 100;
// z-index: 100;
}
</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 @@
<span class="dib">紧急迫降</span>
</div>
<div class="control-bottom-item" @click="onTaskEnd" v-else>
<SymbolIcon icon="renwujieshu1" />
<img src="./assets/images/end.svg" />
<span class="dib">任务结束</span>
</div>
<template v-if="uav.network === 1">
<template v-if="uav.network === 2">
<div v-if="controlType === 0" class="control-bottom-item" @click="onModeManual">
<img src="./assets/images/manual.svg" />
<span class="dib">自动</span>
......
......@@ -23,7 +23,7 @@
<div class="tb-tr" v-for="item in airwayData.records" :key="item.id">
<div class="td">{{ item.id || "暂无" }}</div>
<div class="td">
<div>{{ item.flightName || "暂无" }}</div>
<div>{{ item.name || "暂无" }}</div>
</div>
<div class="td">{{ item.organizationName || "暂无" }}</div>
<!-- 空域状态 -->
......
......@@ -132,6 +132,7 @@ export default {
...mapActions("MMCFlightControlCenter", [
"createAirwayEntities",
"clearAirwayEntities",
"apiPointsToFKZXPoints",
]),
...mapActions("MMCFlightControlCenter/uav", ["isTakeOver"]),
/**
......@@ -202,8 +203,16 @@ export default {
let res = await AirLine.routeDetail({
id: this.selectedTask?.airwayId,
});
if (res.code === 200) {
this.selectedAirway = res.data;
if (res.code === 0) {
let content = await apiPointsToFKZXPoints({
list: res.data.linePointRespVOS,
actionListKey: "pointActionRespVOS",
});
this.selectedAirway = {
name: res.data.flightName,
id: res.data.id,
content,
};
}
} else {
this.rootNode.$emit("airwayGet", {
......
......@@ -82,6 +82,15 @@ export default {
},
},
},
watch: {
hangar() {
this.openTask = false;
this.openAIList = false;
this.$nextTick(() => {
this.openTask = true;
});
},
},
methods: {
onClickTask() {
this.openTask = !this.openTask;
......
<template>
<div>
<div class="police" v-interact>
<div class="police_head">
<div class="police_name">
<img src="../../assets/images/mount_head.png" />
<div class="police_font">警灯</div>
</div>
<div class="police_font" @click="$emit('close')">关闭</div>
<div class="police dialog1027" v-interact>
<div class="dialog-header">
<img class="dialog-header__icon" src="../../assets/images/mount_head.png" />
<div class="dialog-header__title">警灯</div>
<div class="dialog-header__close" @click="$emit('close')">关闭</div>
</div>
<div class="police_ceonter">
<!-- 警灯模式 -->
......
......@@ -33,11 +33,11 @@
<SymbolIcon icon="yunhangrizhi2" />
<span class="txt">运行日志</span>
</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" />
<span class="txt">指点飞行</span>
</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 />
<span class="txt">内场控制</span>
</div>
......@@ -415,6 +415,7 @@ export default {
height: 36px;
background: #3c3c3c;
border-radius: 10px 10px 0px 0px;
padding-left: 10px;
.title {
display: flex;
......
......@@ -29,7 +29,7 @@
<span class="">无人机</span>
</div>
<div
v-if="!isHangar && uav.network === 1"
v-if="!isHangar && uav.network === 2"
class="control-item"
:class="showAlarmLamp ? 'active' : ''"
@click="onSwitchShow('showAlarmLamp')"
......
......@@ -48,6 +48,6 @@ export default {
bottom: 0;
left: 50%;
transform: translate(-50%, 0);
z-index: 100;
// z-index: 100;
}
</style>
\ No newline at end of file
......@@ -471,7 +471,7 @@ export default {
let res = await flightTaskAPI.addFlight(data);
this.$emit("close");
if (res.code === 200) {
if (res.code === 0) {
this.$message.success("航线已生成!");
this.bus.$emit('getFlyway');
}
......
......@@ -36,6 +36,11 @@ export default {
sdk: null,
};
},
computed: {
vUrl(){
return this.data?.vUrl?.replace('srs://', '');
}
},
watch: {
data: {
handler(value) {
......@@ -70,7 +75,7 @@ export default {
this.sdk = new SrsRtcPlayerAsync();
this.$refs["webrtc"].srcObject = this.sdk.stream;
this.sdk
.play(this.data.vUrl)
.play(this.vUrl)
.then(function (session) {})
.catch(function (reason) {
console.log("srs err", reason);
......
......@@ -322,7 +322,7 @@
</div>
<div class="right-menu">
<template v-if="device.network === 1">
<template v-if="device.network === 2">
<el-tooltip content="拍照" placement="bottom">
<div class="menu-item plate" @click="photojz">
<img src="./assets/images/ai.png" />
......@@ -561,32 +561,15 @@ export default {
*/
playerCom() {
if (this.streamSelect) {
switch (this.streamSelect.toLowerCase()) {
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://")) {
if (this.vUrl.vUrl?.toLowerCase().includes("pzsp://")) {
return "QingLiuPlayer";
} else if(this.vUrl.vUrl?.toLowerCase().includes("srs://")){
return "SRSPlayer"
} else {
return "LiveNVRPlayer";
}
} else {
return "QingLiuPlayer";
}
},
/**
......@@ -618,37 +601,34 @@ export default {
*/
streamOptions() {
let streamOptions = [];
// this.streamSelect = "hlsUrl";
// 固定使用公网类型的视频地址 urlType 0公网
this.device?.streamConfiguration?.filter(i => i.urlType === 0).forEach((item1) => {
const fields = [{
field: 'originalUrl',
streamType: 'ORIGINAL',
streamLabel: '原画',
},{
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: "",
});
let streamConfiguration = this.device?.streamConfiguration.find(item => item.urlType === 0);
if (streamConfiguration?.fluencyUrl) {
// 流畅地址
streamOptions.push({
label: "流畅",
value: 'FLV',
url: streamConfiguration?.fluencyUrl,
});
});
}
if (streamConfiguration?.lowLatencyUrl) {
// 低延迟地址
streamOptions.push({
label: "低延迟",
value: 'WEBRTC',
url: streamConfiguration?.lowLatencyUrl,
});
}
if (streamConfiguration?.originalUrl) {
// 原画地址
streamOptions.push({
label: "原画",
value: 'QINGLIU',
url: streamConfiguration?.originalUrl,
});
}
return streamOptions;
},
/**
......@@ -717,7 +697,6 @@ export default {
deep: true,
immediate: true,
},
streamSelect: function (val) {},
networkType() {
let find = this.streamOptions.find((item) => {
return item.value == this.streamSelect;
......@@ -867,7 +846,9 @@ export default {
`${this.screenRecordingStatus ? "开始" : "结束"}录屏`
);
} else {
this.$message.error(`${this.screenRecordingStatus ? "开始" : "结束"}录屏失败`);
this.$message.error(
`${this.screenRecordingStatus ? "开始" : "结束"}录屏失败`
);
this.screenRecordingStatus = !this.screenRecordingStatus;
}
},
......@@ -920,7 +901,7 @@ export default {
data.append("latitude", this.device?.locationCoordinate3D?.latitude);
}
const res = await Control_API.addPhoto(data);
if (res.code === 200) {
if (res.code === 0) {
this.$message.success("截屏成功");
} else {
this.$message({
......@@ -1006,7 +987,7 @@ export default {
}
let mounteList = { data: buffer, ...mountData };
if (buffer) {
if (this.device.network === 1) {
if (this.device.network === 2) {
let topic = "PX4/OBTAIN/" + this.device.deviceId;
this.$store.dispatch("MMCMQTT/publish", {
topic: topic,
......
......@@ -43,12 +43,8 @@
style="margin-right:10px"
:class="device.status==1&&device.currentOperator==1? 'blue' : device.status==1&&device.currentOperator!=1 ?'yellow':'' "
:title="device.name"
>{{device.name}}</span> -->
<span
style="margin-right:10px"
:class="'blue'"
:title="device.name"
>{{device.name}}</span>
>{{device.name}}</span>-->
<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 v-else class="dib">(离线)</span>
<div class="symbol-icon-box">
......@@ -67,7 +63,7 @@
<div class="uav_version status-icon cp">
<img src="./assets/images/cq.svg" />
</div>
</template> -->
</template>-->
<template>
<div class="uav_version status-icon cp">
<img src="./assets/images/I.svg" />
......@@ -91,11 +87,7 @@
@click="onShowPanel(device)"
v-hover
></div>
<div
class="jieg" title="接管无人机"
@click="onTakeOver(device)"
v-hover
>
<div class="jieg" title="接管无人机" @click="onTakeOver(device)" v-hover>
<img src="./assets/images/jieguan_active.svg" v-if="device.currentOperator" />
<img src="./assets/images/jieguan.svg" v-else />
</div>
......@@ -112,7 +104,7 @@ import { Control_API } from "../../../../../../../../api";
export default {
name: "Item",
inject: ['rootNode', 'bus'],
inject: ["rootNode", "bus"],
data() {
return {};
},
......@@ -134,7 +126,7 @@ export default {
]),
...mapState("MMCFlightControlCenter", ["userInfo"]),
},
methods: {
/**
* 接管无人机
......@@ -142,7 +134,7 @@ export default {
async onTakeOver(uav) {
if (!uav.currentOperator) {
let res = await Control_API.setUavControlOn({
deviceId: uav.id
deviceId: uav.id,
});
if (res.code === 0) {
this.$message.success(`请开始操作${uav.name}`);
......@@ -160,7 +152,7 @@ export default {
showClose: false,
});
let res = await Control_API.setUavControlOff({
deviceId: uav.id
deviceId: uav.id,
});
if (res.code === 0) {
this.$message.success(`已退出接管${uav.name}`);
......@@ -180,7 +172,7 @@ export default {
}
);
let res = await Control_API.setUavControlOnForce({
deviceId: uav.id
deviceId: uav.id,
});
if (res.code === 0) {
this.$message.success(`请开始操作${uav.name}`);
......@@ -228,6 +220,13 @@ export default {
if (this.uav) {
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", {
key: "showPanel",
value: true,
......@@ -254,11 +253,11 @@ export default {
value: true,
});
}
this.rootNode.$emit('uavChange', {
this.rootNode.$emit("uavChange", {
uav: this.uav,
showPanel: this.showPanel,
showPlayer: this.showPlayer
})
showPlayer: this.showPlayer,
});
},
/**
* 显示播放器
......@@ -281,16 +280,16 @@ export default {
},
});
// 关闭播放器时若未展开面板,需要取消订阅
if(!this.showPanel){
if (!this.showPanel) {
this.$store.dispatch("MMCFlightControlCenter/uav/unsubscribe");
}
} else {
// 在未打开播放器的情况下,有uav信息,到此步时肯定已经展开了面板,判断是否有流媒体信息, 并显示播放器
if (!this.uav.streamConfiguration) {
if (!item.streamConfiguration) {
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", {
key: "showPlayer",
......@@ -300,7 +299,7 @@ export default {
key: "uav",
value: {
...item,
...this.uav || {},
...(this.uav || {}),
showPlayer: true,
showPanel: this.showPanel,
},
......@@ -308,21 +307,23 @@ export default {
}
} else {
// 由于hardId不同,到此步时可能是第一次点击,或者是面板已展开
if(this.showPanel){
if (this.showPanel) {
// 面板已展开禁止切换视频
return;
}
if(this.uav){
if (this.uav) {
// 切换无人机视频前需要取消订阅前一台无人机消息
this.$store.dispatch("MMCFlightControlCenter/uav/unsubscribe");
}
// 获取该无人机视频流信息
let res = await Control_API.getDeviceStream({
id: item.id,
});
item.streamConfiguration = res.data;
if (!item.streamConfiguration) {
let res = await Control_API.getDeviceStream({
deviceId: item.id,
});
item.streamConfiguration = res.data.list;
}
this.$store.commit("MMCFlightControlCenter/uav/setState", {
key: "showPlayer",
value: true,
......@@ -337,11 +338,11 @@ export default {
});
this.$store.dispatch("MMCFlightControlCenter/uav/subscribe");
}
this.rootNode.$emit('uavChange', {
this.rootNode.$emit("uavChange", {
uav: this.uav,
showPanel: this.showPanel,
showPlayer: this.showPlayer
})
showPlayer: this.showPlayer,
});
},
},
};
......
......@@ -15,7 +15,7 @@ export default {
},
watch: {
mqttDataSet(newVal) {
if (this.uav?.network === 1) {
if (this.uav?.network === 2) {
if (newVal) {
this.$store.dispatch(
"MMCFlightControlCenter/uav/updateByMQTT",
......
......@@ -181,6 +181,7 @@ export default {
if (!window.$mmc) {
window.$mmc = {};
}
window.$mmc.app = this;
window.$mmc.$store = this.$store;
window.$mmc.state = () => {
return this.$store.state;
......@@ -235,7 +236,7 @@ export default {
width: 100%;
.el-input__inner {
background-color: #191919;
background-color: #191919 !important;
color: #fff;
border: 1px solid #4b4b4b !important;
}
......@@ -277,9 +278,10 @@ export default {
.dialog1027 {
z-index: 1;
background: #222222;
border-radius: 10px 10px 0px 0px;
.dialog-header {
box-sizing: border-box;
padding-left: 8px;
padding-left: 32px;
padding-right: 16px;
background-position: 12px 4px;
height: 32px;
......@@ -374,10 +376,7 @@ export default {
}
.el-input__inner {
// height: 32px;
background: #02173d;
border-radius: 2px;
border: 1px solid #315ec7;
font-size: 14px;
font-family: MicrosoftYaHei;
color: #ffffff;
......@@ -542,8 +541,7 @@ export default {
.el-picker-panel__body-wrapper,
.el-time-range-picker__content {
background: #0d224f;
border: 1px solid #00aeff;
background: #191919;
color: #fff;
.el-month-table td.current:not(.disabled) .cell {
......@@ -552,7 +550,6 @@ export default {
.el-input__inner {
color: #fff;
border: 1px solid #00aeff;
}
.el-date-table td.disabled div {
......@@ -573,7 +570,7 @@ export default {
}
.el-input--small .el-input__inner {
background-color: #0d224f;
background-color: #191919;
}
.el-picker-panel__icon-btn {
......@@ -583,17 +580,17 @@ export default {
.el-picker-panel__footer,
.el-time-panel__footer {
background-color: #0d224f;
background-color: #191919;
}
.popper__arrow {
border-bottom-color: #00aeff;
border-top-color: #00aeff;
border-bottom-color: #fff;
border-top-color: #fff;
}
.popper__arrow::after {
border-top-color: #0d224f;
border-bottom-color: #0d224f;
border-top-color: #191919;
border-bottom-color: #191919;
}
.el-button.el-button--mini.is-plain,
......@@ -604,7 +601,7 @@ export default {
}
.el-time-spinner__item {
color: #00eaff;
color: #fff;
}
.el-time-panel__btn {
......
......@@ -166,18 +166,18 @@ export default {
entityCollection.airwayId = data.id; // 由于id属性不允许更改,这里使用airwayId来使用
polyline.forEach(async (item, index) => {
item.longitude = Number(item.longitude);
item.latitude = Number(item.latitude);
item.alt = Number(item.alt);
pointPositions.push(item.longitude, item.latitude, item.alt);
item.longitude = Number(item.coordinate.longitude);
item.latitude = Number(item.coordinate.latitude);
item.altitude = Number(item.altitude);
pointPositions.push(item.longitude, item.latitude, item.altitude);
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({
position: Cesium.Cartesian3.fromDegrees(
item.longitude,
item.latitude,
item.alt
item.altitude
),
name: "show_airline_point",
point: {
......@@ -237,6 +237,37 @@ export default {
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: {
//地面站websocket url
......
......@@ -446,7 +446,7 @@ const actions = {
* @param {object} data
*/
subscribe({ state, dispatch }) {
if (state.uav.network === 1) {
if (state.uav.network === 2) {
window.$mmc.$store.dispatch("MMCMQTT/subscribe", {
topic: "PX4/RECEIVE/" + state.uav.deviceId,
callback(ok) {
......@@ -491,7 +491,7 @@ const actions = {
* @param {} param0
*/
unsubscribe({ state, dispatch }) {
if (state.uav.network === 1) {
if (state.uav.network === 2) {
window.$mmc.$store.dispatch("MMCMQTT/unsubscribe", {
topic: "PX4/RECEIVE/" + state.uav.deviceId,
callback(ok) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论