提交 2b196ef0 作者: 翁进城

fix: 1.修正无人机任务

2.修正无人机连接模型创建流程
feat: 智能识别移除交通指引与快速建模
上级 07e72614
<template>
<div class="control-bottom">
<div class="control-bottom-item" @click="onTakeOff">
<div class="control-bottom-item" @click="onStartTask">
<SymbolIcon icon="yijianrenwu" />
<span class="dib f8">一键任务</span>
</div>
......@@ -203,6 +203,7 @@ import { flightTaskAPI, Control_API } from "../../../../../../api";
export default {
name: "ControlBottom",
inject:['bus'],
data() {
return {
controlType: 0, //控制类型, 0: 自动 1: 摇杆 2: 键盘
......@@ -220,65 +221,8 @@ export default {
await Control_API.updateTakeOver(this.uav.id);
},
// 一键任务
onTakeOff() {
if (this.airlineData) {
this.$confirm("请确认是否进行一键任务操作?", "安全确认", {
cancelButtonText: "取消",
confirmButtonText: "确定",
customClass: "uav_controlPane",
showClose: false,
}).then(async () => {
try {
this.$store.dispatch("uavApplications/takeOff", {
callback: async (isOk) => {
if (isOk) {
this.$message.success("发出一键任务指令成功");
const res = await flightTaskAPI.editFlight({
...item,
changeSchedul: false,
deviceHardId: this.uav.hardId,
taskStatus: 1,
});
if (res.code == 200) {
this.$message({
showClose: true,
type: "success",
message: "操作成功",
duration: 1000,
});
const newItem = JSON.parse(JSON.stringify(item));
newItem.taskId = item.id;
newItem.hardId = this.uav.hardId;
// 打开任务列表
// await this.getTaskList(newItem);
// if (this.showTaskDetails) this.showTaskDetails = false;
// 打开任务列表
this.$store.commit("uavApplications/setState", {
key: "TaskList",
value: newItem,
});
} else {
this.$message({
showClose: true,
type: "error",
message: res.msg,
duration: 1000,
});
}
this.fly_control_unlock("fly_control_unlock");
} else {
return this.$message.warning("发出一键任务指令失败");
}
},
});
} catch (e) {
this.$message.warning("解析航线失败");
console.log("解析航线失败", e);
}
});
} else {
this.$message.error("请先选择任务");
}
onStartTask() {
this.bus.$emit('startTask');
},
fly_control_unlock(key) {
const seed = Date.now();
......
......@@ -39,7 +39,7 @@
</template>
<script>
import API from '@/api';
// import API from '@/api';
export default {
props: {
......@@ -80,7 +80,7 @@ export default {
},
async list_airway() {
let res = await API.AIRWAY.getApprovedTask();
/* let res = await API.AIRWAY.getApprovedTask();
if (res) {
let jqList = [],
ctList = [],
......@@ -114,7 +114,7 @@ export default {
},
];
this.airway_list = airway_list;
}
} */
},
}
}
......
......@@ -28,7 +28,7 @@
</template>
<script>
import API from '@/api';
// import API from '@/api';
export default {
props: {
......@@ -51,7 +51,7 @@ export default {
methods: {
async load(){
this.pageNo++
let res = await API.HOME.getflightvideoMsg({
/* let res = await API.HOME.getflightvideoMsg({
uavId: this.uavId,
pageNo: this.pageNo,
pageSize: this.pageSize
......@@ -66,7 +66,7 @@ export default {
}
this.list.push(res[i])
}
console.log(this.list,"list");
console.log(this.list,"list"); */
},
async getCarList(){
if(!this.uavId){
......
......@@ -89,7 +89,7 @@
</template>
<script>
import API from '@/api';
// import API from '@/api';
export default {
props: {
......@@ -125,7 +125,7 @@ export default {
methods: {
async load(){
this.pageNo++
let res = await API.HOME.getFaceuavvideoMsg({
/* let res = await API.HOME.getFaceuavvideoMsg({
uavId: this.uavId,
pageNo: this.pageNo,
pageSize: this.pageSize
......@@ -140,7 +140,7 @@ export default {
}
this.list.push(res[i])
}
console.log(this.list,"list");
console.log(this.list,"list"); */
},
async getFaceList(){
if(!this.uavId){
......@@ -199,14 +199,14 @@ export default {
.rate-img{
flex: 1;
height: 75px;
background-image: url('~@/assets/images/observe/faceAI_border1.png');
background-image: url('../../assets/images/faceAI_border1.png');
background-size: 100% 100%;
padding: 7px;
display: flex;
align-items: center;
&.rate-img--contrary {
background-image: url('~@/assets/images/observe/faceAI_border2.png');
background-image: url('../../assets/images/faceAI_border2.png');
justify-content: right;
}
......
<template>
<div class="cpt-command-airway-list">
<div class="hd" v-interact>
<div class="left ml8">
<img src="../../../../assets/images/mount_head.png" />
<div class="title">航空航线</div>
</div>
<div @click="close" class="close">关闭</div>
</div>
<div class="list-box">
<div class="tb-box">
<div class="tb-hd-box">
<div class="tb-hd">航线ID</div>
<div class="tb-hd">航线名称</div>
<div class="tb-hd">所属单位</div>
<div class="tb-hd">空域状态</div>
<div class="tb-hd">安全状态</div>
<div class="tb-hd">航线标签</div>
<div class="tb-hd last-tb-hd">操作</div>
</div>
<div class="tb-bd-box">
<div class="tb-tr" v-for="item in airwayList" :key="item.id">
<div class="td">{{ item.id || "暂无" }}</div>
<div class="td">
<div>{{ item.name || "暂无" }}</div>
</div>
<div class="td">{{ item.organizationName || "暂无" }}</div>
<!-- 空域状态 -->
<div class="td">
<div v-if="item.status == 1" class="status">可用</div>
<div v-else-if="item.status == 2" class="status" style="color: #2ca1e2">待申请</div>
<div v-else-if="item.status == 3" class="status" style="color: #ffbd36">待审批</div>
<div v-else-if="item.status == 4" class="status" style="color: #2bfdf1">通过</div>
<div v-else-if="item.status == 5" class="status" style="color: #fb4a2d">驳回</div>
<div v-else>暂无</div>
</div>
<!-- 模式 -->
<!-- <div class="td">{{ item.distance || "暂无" }}</div> -->
<!-- 安全状态 -->
<div
class="td"
:style="{ color: item.isSafe == 1 ? '#19D864' : '' }"
>{{ item.isSafe == 1 ? "安全" : "待确定" }}</div>
<!-- 航线标签 -->
<div class="td">
<!-- <span v-for="item2 in item.labelList"
:key="item2.labelId">{{ item2.labelName }}</span>-->
{{ item.labelName ||"暂无" }}
</div>
<div class="td last-td" style="width: 15%">
<div @click="changeLine(item)">选择航线</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { mapState } from "vuex";
let point_index = null;
let isEditting = false;
let airline_entitys = [];
export default {
data() {
return {
keyword: null,
};
},
computed: {
...mapState("MMCFlightControlCenter", ["airwayList"]),
},
mounted() {},
methods: {
async changeLine(item) {
try {
if (item.isSafe != 1) {
await this.$confirm(
"此航线为非安全航线,开始任务前请确认航线安全!",
"安全确认",
{ customClass: "uav_controlPane", showClose: false }
);
}
this.$emit("change", item);
this.close();
} catch (e) {}
},
close() {
this.$emit("close");
},
},
};
</script>
<style lang="scss" scoped>
.cpt-command-airway-list {
width: 600px;
position: absolute;
right: -213px;
top: 300px;
// width: 1132px;
// height: 689px;
box-sizing: border-box;
// background: rgba(0, 23, 79, 0.7);
// box-shadow: 0 2px 4px 0 rgba(1, 162, 255, 0.35),
// inset 0 0 40px 0 rgba(0, 184, 255, 0.5);
// border-radius: 13px;
background: rgba(0, 23, 79, 0.7);
box-shadow: 0 2px 4px 0 rgba(1, 162, 255, 0.35),
inset 0 0 40px 0 rgba(0, 184, 255, 0.5);
border-radius: 10px;
.hd {
height: 32px;
display: flex;
justify-content: space-between;
align-items: center;
background: rgba(16, 65, 215, 0.2);
box-shadow: inset 0 0 15px 0 rgba(0, 182, 255, 0.6);
border-radius: 10px 10px 0 0;
.left {
display: flex;
align-items: center;
.title {
font-size: 20px;
font-family: YouSheBiaoTiHei;
color: #14faff;
line-height: 26px;
text-shadow: 0px 1px 1px rgba(2, 32, 56, 0.2);
background: linear-gradient(
135deg,
#e3aa77 0%,
#f5cda9 38%,
#f9ecd3 58%,
#fcdbb1 79%,
#edb07a 100%
);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
}
.close {
font-size: 14px;
font-family: MicrosoftYaHei;
color: #d2dfff;
margin-right: 8px;
cursor: pointer;
}
}
.list-box {
// width: 1132px;
height: calc(100% - 56px);
box-sizing: border-box;
padding: 0 16px 0 16px;
.search-box {
margin-left: 0 !important;
// height: 80px;
height: auto;
margin: 24px 0 24px 0;
box-sizing: border-box;
display: flex;
align-items: center;
.item-plan {
width: 79px;
height: 32px;
background: rgba(28, 67, 191, 0.6) !important;
box-shadow: 0px 2px 4px 0px rgba(23, 33, 60, 0.5),
inset 0px 0px 16px 0px rgba(33, 137, 255, 0.4),
inset 0px 0px 4px 0px #00a7ff;
border: 1px solid;
border-image: linear-gradient(
180deg,
rgba(138, 218, 255, 1),
rgba(82, 179, 255, 0)
)
1 1;
border-radius: 0px;
font-size: 12px;
font-family: MicrosoftYaHei;
color: #43deff;
line-height: 16px;
}
.item-plan:hover {
opacity: 0.5;
}
.item-input {
width: 168px;
height: 40px;
margin-left: 10px;
// margin-right: 10px;
color: #08c2d1;
::v-deep .el-input__inner {
background: rgba(2, 31, 51, 0);
border: 0px solid #06b6e0;
border-radius: 4px;
font-family: MicrosoftYaHeiUI;
font-size: 16px;
color: #08c2d1;
font-weight: 400;
padding-left: 0;
&::placeholder {
font-size: 14px;
font-family: MicrosoftYaHei;
color: #397c8b;
line-height: 19px;
}
}
}
.andLinlineBtn {
position: absolute;
top: 65px;
right: 160px;
width: 130px;
cursor: pointer;
height: 32px;
opacity: 0.8;
font-family: PangMenZhengDao;
font-size: 22px;
color: #00ffff;
text-align: center;
font-weight: 400;
line-height: 40px;
}
.routeLabelBtn {
position: absolute;
top: 65px;
right: 20px;
width: 130px;
cursor: pointer;
height: 40px;
opacity: 0.8;
font-family: PangMenZhengDao;
font-size: 22px;
color: #00ffff;
text-align: center;
font-weight: 400;
line-height: 40px;
}
.routeLabelBtnDefault {
background: rgba(0, 3, 36, 0.8);
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.5),
inset 0 0 15px 0 rgba(0, 182, 255, 0.9);
border-radius: 6px;
}
.routeLabelBtnActive {
background: rgba(0, 34, 140, 0.2);
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.5), inset 0 0 10px 0 #00b6ff;
border-radius: 6px;
}
}
.tb-box {
// overflow-x: scroll;
// overflow-y: hidden;
padding: 0 !important;
margin: 0 0 27px 0;
.tb-hd-box {
display: flex;
background: #081a3a;
// width: 1415.62px;
border-top: 1px solid rgba(207, 234, 255, 0.33);
border-bottom: 1px solid rgba(207, 234, 255, 0.33);
height: 37.6px;
.tb-hd {
flex: 1;
line-height: 37.6px;
width: calc(100% / 8);
white-space: nowrap;
height: 100%;
text-align: center;
font-family: MicrosoftYaHei-Bold;
font-size: 16px;
color: #b5e5ff;
letter-spacing: 0;
font-weight: 700;
}
}
.tb-bd-box {
width: 570px;
max-height: 280px;
margin-bottom: 24px;
overflow: hidden;
overflow-y: auto;
.tb-tr {
display: flex;
color: #fff;
align-items: center;
font-size: 14px;
width: 560px;
margin: 5px 0 0 0;
// border: 1px solid;
background: #081a3a;
cursor: pointer;
// background-image: url("~@/assets/newImage/tiaokaung.png") !important;
background-size: 100% 100%;
// &:hover {
// // background: rgba(2, 19, 96, 0.2);
// box-shadow: inset 0px 0px 10px 2px #3fcbff;
// // border: 1px solid #70f6f9;
// }
&:nth-of-type(2n - 1) {
background: rgba(73, 135, 210, 0.5);
}
.td {
// width: calc(100% / 7);
flex: 1;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
}
.last-td {
text-align: center;
width: 170px;
div {
background: url("../../../../assets/images/btn.png") no-repeat;
background-size: 100% 100%;
padding: 5px 12px;
}
.iconfont {
margin-right: 7px;
}
&:hover {
color: #43deff;
}
}
}
}
}
}
}
.toubu {
display: flex;
.tiao {
width: 3px !important;
height: 15px;
background: #ffbd36;
margin: 6px 5px 0 16px;
}
.hd-box {
font-size: 18px;
font-family: MicrosoftYaHei-Bold, MicrosoftYaHei;
font-weight: bold;
color: #ffffff;
line-height: 24px;
text-shadow: 0px 2px 4px #136791;
}
}
.cpt-command-airway-list .tb-box {
height: 100%;
}
.flex {
display: flex;
}
.uavImg {
width: 20px;
height: 20px;
margin: 0 6px 0 6px;
img {
width: 100%;
height: 100%;
}
}
.fangkuai {
border: 1px solid #43deff;
height: 32px;
background: rgba(13, 50, 92, 0.7);
}
.duanxian {
width: 1px;
height: 22px;
border-left: 1px solid;
border-image: linear-gradient(
180deg,
rgba(67, 222, 255, 0),
rgba(67, 222, 255, 1),
rgba(67, 222, 255, 0)
)
1 1;
}
.el-input__suffix-inner::v-deep {
i {
color: #43deff;
}
}
// 滚动动画
.animate {
padding-left: 20px;
// font-size: 12px;
// color: #000;
display: inline-block;
white-space: nowrap;
animation: 5s wordsLoop linear infinite normal;
}
@keyframes wordsLoop {
0% {
transform: translateX(100%);
-webkit-transform: translateX(100%);
}
100% {
transform: translateX(-100%);
// -webkit-transform: translateX(-100%);
}
}
// @-webkit-keyframes wordsLoop {
// 0% {
// transform: translateX(100%);
// -webkit-transform: translateX(100%);
// }
// 100% {
// transform: translateX(-100%);
// -webkit-transform: translateX(-100%);
// }
// }
.tb-tr::v-deep .td {
padding: 18px 0 !important;
}
// 提示框样式
.td::v-deep .el-tooltip {
background: rgba(2, 19, 96, 0);
border: 0px solid rgba(207, 234, 255, 0.33);
font-family: MicrosoftYaHei;
color: #ffffff;
line-height: 19px;
}
// 空域状态
.status {
font-size: 14px;
font-family: MicrosoftYaHei;
color: #00d45c;
line-height: 19px;
}
//操作状态
.el-tooltip {
opacity: 0.7;
}
.el-tooltip:hover {
opacity: 1;
}
// 页签样式
.zongji {
font-size: 12px;
font-family: MicrosoftYaHei;
color: #b5e5ff;
line-height: 16px;
.tiaoshu {
color: #43deff;
}
}
.douhao {
margin: 0 5px 0 5px;
}
.dangqianye {
margin: 0 20px 0 0;
}
.el-pager::v-deep .number:hover {
background: #00b6ff !important;
border-radius: 2px;
color: #000 !important;
width: 14px;
height: 22px;
line-height: 22px;
}
.el-pagination--small::v-deep .el-pager .number {
font-size: 12px;
font-family: MicrosoftYaHei;
color: #889fb2;
}
.active::v-deep {
color: #000 !important;
}
.btnqueding {
margin: 0 0 0 8px;
width: 79px;
height: 32px;
background: rgba(28, 67, 191, 0.6) !important;
box-shadow: 0px 2px 4px 0px rgba(23, 33, 60, 0.5),
inset 0px 0px 16px 0px rgba(33, 137, 255, 0.4),
inset 0px 0px 4px 0px #00a7ff;
border-radius: 0px;
border: 1px solid;
border-image: linear-gradient(
180deg,
rgba(138, 218, 255, 1),
rgba(82, 179, 255, 0)
)
1 1;
line-height: 1px;
color: #43deff;
}
.btnqueding:hover {
opacity: 0.5 !important;
}
.tb-pagination {
margin: 0 0 19px 0;
}
.zhuan {
font-size: 12px;
font-family: MicrosoftYaHei;
color: #889fb2;
line-height: 16px;
input {
width: 48px;
min-width: 48px;
max-width: auto;
text-align: center;
height: 28px;
background: rgba(12, 13, 20, 0.5);
border-radius: 2px;
border: 1px solid rgba(36, 146, 252, 0.3);
margin: 0 5px 0 5px;
color: #fff;
outline: 0px solid;
}
}
// 说明
.shuo {
margin: 0 0 29px 0;
}
.shuoming {
font-size: 12px;
font-family: MicrosoftYaHei;
color: #43deff;
line-height: 16px;
}
.maohao {
font-size: 12px;
font-family: MicrosoftYaHei;
color: #43deff;
line-height: 16px;
margin: 0 14px 0 5px;
}
.icons {
font-size: 12px;
font-family: MicrosoftYaHei;
color: #b3bbc5;
line-height: 16px;
margin: 0 12px 0 0;
}
.cpt-command-flight-task-explain {
display: flex;
align-items: center;
margin-left: 4px;
// margin-top: 8px;
padding: 0;
margin: 28px 0 29px 0;
.explain_title {
font-family: MicrosoftYaHei;
font-size: 14px;
color: #08c2d1;
}
.explain_box {
display: flex;
}
.explain_box_detail {
margin-right: 15px;
font-size: 12px;
font-family: MicrosoftYaHei;
color: #b3bbc5;
}
}
.waixian {
// border-radius: 6px;
// border: 1px solid #8adaff;
}
.el-tooltip__popper::v-deep .is-dark {
z-index: -100;
}
</style>
\ No newline at end of file
<template>
<div class="taskListBox w380" :class="{ yidong: taskstyle == false }">
<div class="header wih100 h32">
<div class="title ml10">
<img src="~@/assets/images/mount/mount_head.png" />
<div class="taskListBox">
<div class="header">
<div class="title">
<img src="../../assets/images/mount_head.png" />
<div class="font">任务库</div>
</div>
</div>
<div v-show="taskType == 'itemA'" class="pt38 jianju pr">
<div class="flexs">
<span class="cf">任 务 库</span>
<!-- <el-select size="mini" class="w300 mt10 ml10" v-model="flyTypeId" placeholder="请选择任务">
<el-option v-for="item in TaskList" :key="item.id" :label="item.taskTitle" :value="item.id">
</el-option>
</el-select>-->
<el-form class="task-main" label-width="60px">
<el-form-item label="任务库">
<el-tooltip :content="clew" placement="top">
<el-cascader
filterable
popper-class="cpt-observe-mspace-dashboard-airway"
popper-class="mmc"
size="mini"
class="w276 ml10 cpt-observe-mspace-dashboard-airway"
v-model="flyTypeId"
:options="airway_list"
class
style="width: 100%"
v-model="selectedTaskId"
:options="taskListAll"
clearable
:show-all-levels="false"
placeholder="请选择任务"
:props="{
children: 'children',
label: 'taskTitle',
label: 'name',
value: 'id',
emitPath: false,
}"
@change="v_value"
:disabled="taskCate == 3 ? true : false"
@change="onChangeTask"
>
<template slot-scope="{ data }">
<el-tooltip
:disabled="data.taskTitle.length < 11"
class="item"
effect="dark"
:content="data.taskTitle"
placement="top-start"
>
<span>{{ data.taskTitle }}</span>
<el-tooltip class="item" effect="dark" :content="data.name" placement="top-start">
<span>{{ data.name }}</span>
</el-tooltip>
</template>
</el-cascader>
</el-tooltip>
<div class="cf mt20 tc" style="display: flex">
<span class="line_height">
<i style="opacity: 0"></i> 线
</span>
<el-tooltip content="航线名称" placement="top">
<el-input
v-if="flightFlag"
disabled
v-model="flight[0].flightName"
placeholder="请选择航线"
class="ml10 w276 mrg_left6"
size="mini"
></el-input>
<el-button v-else @click="lineshow = true" class="kbt_button"
>选择航线</el-button
>
<!-- <el-select
v-else
size="mini"
class="w276 ml10 mt10"
v-model="flightId"
placeholder="请选择航线"
>
<el-option
v-for="item in flightList"
:key="item.id"
:label="item.title"
:value="item.id"
>
</el-option>
</el-select>-->
</el-tooltip>
</div>
<div>
<div></div>
<div class="btn cf ml18 cp mt40" @click="handClickTask">一键任务</div>
<div class>
<span
v-if="!flightFlag"
style="color: #43deff; bottom: -18px"
class="lh30 dib cp f8 right16 pa"
@click="craeteRoute"
>
<span class="f8"></span> 创建航线
</span>
</div>
</div>
</div>
</div>
<LineList
v-if="lineshow"
@changeLine="changeLine"
@close="lineshow = false"
></LineList>
</el-form-item>
<el-form-item label="航线">
<el-tooltip content="航线名称" placement="top">
<el-input
v-if="isSelectTask || selectedAirway.id !== -1"
disabled
v-model="selectedAirway.name"
placeholder="请选择航线"
class
style="width: 100%"
size="mini"
></el-input>
<el-button v-else class="select-airway__btn" @click="showFlywayDialog = true">选择航线</el-button>
</el-tooltip>
</el-form-item>
<div class="btn" @click="onStartTask">一键任务</div>
<!-- <div class>
<span class="btn__add-line">
<span class="f8"></span> 创建航线
</span>
</div>-->
</el-form>
<LineList v-if="showFlywayDialog" @close="showFlywayDialog = false;" @change="onChangeLine"></LineList>
</div>
</template>
<script>
import API from "@/api";
import LineList from "../lineList";
import LineList from "./components/lineList";
import methods from "./methods";
import { mapGetters } from "vuex";
// 引用bus
import Bus from "@/assets/ligature.js";
import { mapState } from "vuex";
import Vue from "vue";
export default {
name: "taskList",
components: { LineList },
props: {},
inject: ["rootNode", "bus"],
data() {
return {
taskType: "itemA",
rwList: [],
TaskList: [],
// 任务id
flyTypeId: "",
flight: [
{
flightName: "",
},
],
// 选择的任务id
selectedTaskId: [],
// 航线数据
flightList: [],
// 航线id
flightId: "",
flightIdv2: "",
// 航线是否可选
flightFlag: true,
// 航线数据
flightLinefkData: "",
airway_list: [],
lineshow: false,
clew: "任务库", // 飞控任务库提示语
// taskstyle: false,
flightSortic: null,
taskCate: 1,
username: null,
distanceLine: 0,
// 选择的航线
selectedAirway: {
name: "",
id: -1,
},
// 航线选择窗口
showFlywayDialog: false,
clew: "任务库", // 选中任务提示语
};
},
props: {
wsShow: {
type: Boolean,
default: false,
computed: {
...mapState("MMCFlightControlCenter", ["taskList"]),
...mapState("MMCFlightControlCenter/uavApplications", ["uav"]),
taskListAll() {
return [{ name: "选择航线自动生成任务", id: -1 }, ...this.taskList];
},
device: {
type: Object,
default: () => ({}),
/**
* 是否选择任务
*/
isSelectTask() {
return this.selectedTaskId[0] !== -1;
},
taskstyle: {
type: Boolean,
default: false,
/**
* 选择的任务数据
*/
selectedTask() {
let find = this.taskList.find((item) => {
return item.id === this.selectedTaskId[this.selectedTaskId.length - 1];
});
return find;
},
},
inject: ["uav_This"],
watch: {},
async created() {
this.username = this.user_info.username;
await this.list_airway();
await this.initTask();
// 飞控选择其他模块时,关闭航线
// 关键字:关闭预设航线
Bus.$on("uav_Route", () => {
this.close_the_router();
});
// 等待航线上传成功在执行
Bus.$on("take_off", () => {
this.upload_complete();
});
// 修改飞控 无人机 左边'任务库'的位置
// Bus.$on("ydh", (status) => {
// if (status == false) {
// this.taskstyle = false;
// } else {
// this.taskstyle = true;
// }
// });
this.bus.$on("startTask", this.onStartTask);
},
methods: {
...methods,
craeteRoute() {
this.close_the_router();
this.$emit("craeteRoute");
},
v_value(e) {
if (e == null) {
this.clew = "任务库";
sessionStorage.removeItem("waypointList");
}
},
changeLine(id) {
this.flightId = id;
},
async checkUseOperateFn(device) {
// 查看是否有控制权限
let res = await API.FCKERNEL.checkUseOperate({ deviceHardId: device });
if (res.code == 201) {
this.$message.warning(res.msg);
return false;
} else {
return true;
}
},
async initTask() {
let res = await API.FCKERNEL.getTaskAndUserRelation({
sourceType: 0,
deviceHardId: this.device.deviceHardId,
});
if (res.code == 200 && res.list) {
this.list = res.list;
// taskCateId 2 1警情 3临时
this.airway_list[this.list.taskCateId]?.children.push({
id: res.list.taskId,
flightName: res.list.flightName,
flightLineId: res.list.flightId,
flightCourseJson: res.list.flightCourseJson,
userId: res.list.userId,
taskStatus: res.list.taskStatus,
taskTitle: res.list.taskTitle,
taskCateId: res.list.taskCateId,
});
this.showRoute(res.list);
this.flyTypeId = res.list.taskId;
this.taskCate = res.list.taskStatus;
this.flightIdv2 = res.list.flightId;
this.saveFlightLineId(res.list.flightId);
} else {
sessionStorage.removeItem("waypointList");
this.taskCate = 1;
this.flight[0].flightName = null;
this.clew = "任务库";
this.flyTypeId = null;
}
},
async handClickTask() {
let flag = await this.checkUseOperateFn(this.device.deviceHardId);
if (!flag) return;
if (this.flightFlag && this.flyTypeId) {
if (this.uav_This.uav.control.device.stationType == 1) {
this.$emit("getSelf");
} else {
this.handClickTask2();
}
} else {
this.$message.error("请选择任务");
}
/**
* 更改航线事件
*/
onChangeLine(data) {
this.selectedAirway = data;
},
async handClickTask2() {
// this.$emit("uav-location");
// let flag = await this.checkUseOperateFn(this.device.deviceHardId);
// if (!flag) return;
// 航线
// if (this.flightFlag && this.flyTypeId) {
// 局部预警
let checkBeforeTakeOff = await API.DEVICE.checkBeforeTakeOff({
taskId: this.flyTypeId,
});
if (!checkBeforeTakeOff.code) {
this.$emit("Lsdom", checkBeforeTakeOff);
/**
* 一键任务事件
*/
async onStartTask() {
if (this.selectedAirway.id === -1) {
this.$message.warning("请选择航线");
return;
}
// this.$confirm("请确认是否进行一键任务操作?", "安全确认", {
// cancelButtonText: "取消",
// confirmButtonText: "确定",
// customClass: "uav_controlPane",
// showClose: false,
// })
// .then(async () => {
this.getTrue();
// })
// .catch(() => {
// this.$message({
// type: "info",
// message: "已取消操作",
// });
// });
// } else {
// this.$message.error("请选择任务");
// }
},
async getTrue() {
// console.log(this.flightLinefkData,"this.flightLinefkData.labelName");
// this.$emit("changeLableName",this.flightLinefkData.labelName)
// this.$emit("uav-location", 1);
// return
// // 生成架次號
let getFlightSortic = await API.DEVICE.getFlightSortic({
taskId: this.flyTypeId,
deviceHardId: this.uav_This.uav.control.device.deviceHardId,
});
this.flightSortic = getFlightSortic;
if (this.uav_This.uav.control.device.stationType == 1) {
//飞控中心链路
// 上传航线指令
this.$emit("fn", {
type: 521,
data: {
...this.flightLinefkData,
taskId: this.flyTypeId,
flightSortiesID: getFlightSortic,
},
});
// 等待航线上传成功在执行
// 判断是否以一键任务
Bus.$emit("off_take");
} else {
//地面站链路
this.$emit("fun", {
type: 200,
systemCode: "mmc",
state: 1,
username: this.username,
data: {
cmdFunction: 2113,
cmdValue: this.flightId || this.flightIdv2, //航线id
taskId: this.flyTypeId + "",
flightSortieName: getFlightSortic,
},
deviceHardId: this.uav_This.uav.control.device.deviceHardId,
try {
await this.$confirm("请确认是否进行一键任务操作?", "安全确认", {
cancelButtonText: "取消",
confirmButtonText: "确定",
customClass: "uav_controlPane",
showClose: false,
});
// this.upload_complete()
}
},
// 航线上传成功再执行
async upload_complete() {
if (this.uav_This.uav.control.device.stationType == 1) {
// 生成架次號
// let getFlightSortic = await API.DEVICE.getFlightSortic({
// taskId: this.flyTypeId,
// deviceHardId: this.uav_This.uav.control.device.deviceHardId,
// });
// 告诉飞控开始任务,并且把架次号和 任务id传过去
this.startFlight({
taskId: this.flyTypeId,
flightSortiesID: this.flightSortic,
});
// }
// 更改任务状态 status 任务执行状态 默认-1待派发 0表示待执行;3执行中;1执行完成
this.task_update(3);
// if(this.uav_This.uav.control.device.stationType == 1){
// 记录任务
await API.FCKERNEL.addTaskAndUserRelation({
taskId: this.flyTypeId,
sourceType: 0, //机库为1 无人机0
deviceHardId: this.device.deviceHardId,
});
let _this = this;
setTimeout(() => {
_this.$emit("fn", {
data: 0,
type: 522,
});
}, 3000);
} else {
console.log(
this.uav_This.uav.control.device.deviceHardId,
this.flyTypeId,
"4741852963"
);
//地面站链路
//解锁无人机
this.$emit("fun", {
type: 200,
systemCode: "mmc",
state: 1,
username: this.username,
data: {
cmdFunction: 2110,
},
deviceHardId: this.uav_This.uav.control.device.deviceHardId,
});
//预览航线
// this.$emit("fun", {
// type: 200,
// systemCode: "mmc",
// state: 1,
// username: this.username,
// data: {
// cmdControlType: 900,
// cmdFunction: 9001
// },
// deviceHardId: this.uav_This.uav.control.device.deviceHardId,
// });
//一键起飞
this.$emit("fun", {
type: 200,
systemCode: "mmc",
state: 1,
username: this.username,
data: {
cmdFunction: 2111,
cmdValue: 50, //高度
taskId: this.flightId || this.flightIdv2,
},
deviceHardId: this.uav_This.uav.control.device.deviceHardId,
});
// status 任务执行状态 默认-1待派发 0表示待执行;3执行中;1执行完成
let task = await API.DEVICE.task_update({
id: this.flyTypeId,
status: 3,
deviceHardId: this.uav_This.uav.control.device.deviceHardId,
});
// 记录任务
await API.FCKERNEL.addTaskAndUserRelation({
taskId: this.flyTypeId,
sourceType: 0, //机库为1 无人机0
deviceHardId: this.uav_This.uav.control.device.deviceHardId,
});
// 一键起飞任务监听
let res = await API.TASK.flytaskLisener({
taskId: this.flyTypeId,
deviceHardId: this.uav_This.uav.control.device.deviceHardId,
});
//航线模式
this.$emit("fun", {
type: 200,
systemCode: "mmc",
state: 1,
username: this.username,
data: {
cmdFunction: 2115,
},
deviceHardId: this.uav_This.uav.control.device.deviceHardId,
});
}
this.taskCate = 3;
this.$message.success("操作成功");
this.$emit("iconShow");
},
async saveFlightLineId(flightLineId) {
console.log("暂无航线_a", flightLineId);
if (flightLineId) {
// this.$emit("changeLableName","河道巡检")
let res = await API.AIRWAY.GetAirwayInfo(flightLineId);
this.flightLinefkData = res.data;
// console.log(res.data,"res.data");
// delete this.flightLinefkData.flightJson
// console.log(JSON.parse(res.data.flightJson));
let lineData = null;
// console.log(JSON.parse(res.data.flightJson),"JSON.parse(res.data.flightJson)");
if (JSON.parse(res.data.flightJson).points[0].ailist) {
this.flightLinefkData.headingMode = "USING_WAYPOINT_HEADING";
}
if (JSON.parse(res.data.flightJson).waypoints) {
lineData = JSON.parse(res.data.flightJson).waypoints;
this.flightLinefkData.waypointList = lineData;
} else {
lineData = JSON.parse(res.data.flightJson).points;
this.flightLinefkData.waypointList.forEach((val, i) => {
lineData.forEach((val2, j) => {
if (i == j) {
val.waypointActions = val2.actions;
}
});
});
}
delete this.flightLinefkData.flightJson;
console.log(this.flightLinefkData, "flightLinefkData");
if (this.flightLinefkData) {
this.$emit("changeLableName", "");
console.log("zheli");
try {
sessionStorage.setItem(
"waypointList",
JSON.stringify({
uavDeviceId: this.uav_This.uav.control.device.deviceHardId,
wayLineObj: this.flightLinefkData,
flyTypeId: this.flyTypeId,
})
);
} catch (error) {
sessionStorage.removeItem("waypointList");
}
}
}
},
async getFlightLine(id) {
let flightLineData = await API.USER.routesListqq(id);
this.flight[0] = flightLineData;
// 预览航线
this.showRoute(flightLineData);
// 自动生成任务
let task = await API.AIRWAY.addNestAutoTask({
lineId: id,
type: 1,
});
// 重新请求航线
await this.list_airway();
this.flyTypeId = task.id;
console.log(10);
return;
let flightLinefkData = await API.AIRWAY.GetAirwayInfo(id);
this.flightLinefkData = flightLinefkData.data;
},
},
computed: {
...mapGetters(["user_info"]),
task_end_data() {
return this.$store.state.fckernel.task_end_data;
},
},
watch: {
task_end_data: function (val) {
if (this.device.deviceHardId == val.data) {
this.flyTypeId = "";
this.flight = [
{
flightName: "",
},
];
this.taskCate = 1;
this.$message.success("任务已结束!");
}
},
device: function (value) {
this.initTask();
},
flyTypeId: function (value) {
if (window.location.hash.includes("accident")) {
this.$store.commit("fckernel/SET_TASK_ID_YJ", value);
} else {
this.$store.commit("fckernel/SET_TASK_ID", value);
}
if (value) {
if (value == "z1322" || value == "") {
this.flightFlag = false;
this.flightId = "";
this.clew = "任务库";
if (this.selectedAirway.id === -1) {
this.$store.commit(
"MMCFlightControlCenter/uavApplications/setState",
{
key: "airlineData",
value: null,
}
);
} else {
this.flightFlag = true;
let arr = [];
if (this.airway_list[1]?.children) {
arr.push(...this.airway_list[1].children);
}
if (this.airway_list[2]?.children) {
arr.push(...this.airway_list[2].children);
}
if (this.airway_list[3]?.children) {
arr.push(...this.airway_list[3].children);
}
if (arr.length > 0) {
let item = arr.find((item) => item.id === value);
// 提示语的信息
this.clew = item.taskTitle;
this.flight = [item];
if (item.flightLineId) {
this.flightIdv2 = item.flightLineId;
this.saveFlightLineId(item.flightLineId);
this.showRoute(item);
this.$store.commit(
"MMCFlightControlCenter/uavApplications/setState",
{
key: "airlineData",
value: this.selectedAirway,
}
}
);
}
}
},
flightId: function (value) {
if (value) {
// this.saveFlightLineId(value)
this.getFlightLine(value);
}
// this.handleAirLinePreview(this.flight[0], true);
this.$store.dispatch("MMCFlightControlCenter/uavApplications/takeOff");
this.rootNode.$emit(
"startTask",
this.uav,
this.selectedTask,
this.selectedAirway
);
} catch (e) {}
},
"uavData.gps.fixType": function (value) {
if (value == "LOCK_3D_RTK_GPS_LOCK_FIXED") {
this.$message.success("RTK已就绪");
this.fixType = true;
} else {
this.fixType = false;
}
/**
* 更改任务事件
*/
onChangeTask() {
this.selectedAirway = this.selectedTask?.airway || {
name: "",
id: -1,
};
},
},
};
</script>
<style>
.el-cascader-menu__list {
background: rgba(9, 32, 87, 1) !important;
max-height: 300px;
max-width: 327px;
}
.el-cascader-node {
background: rgba(9, 32, 87, 1) !important;
}
</style>
<style lang="scss" scoped>
.yidong {
left: 544px !important;
}
.taskListBox {
position: absolute;
left: 80px;
top: 85px;
min-height: 254px;
width: 380px;
background: rgba(9, 32, 87, 0.7);
// border: 1px solid #70daf9;
border-radius: 10px;
transition: 0.3s;
......@@ -622,6 +199,7 @@ export default {
.title {
display: flex;
align-items: center;
margin-left: 10px;
.font {
font-size: 20px;
font-family: YouSheBiaoTiHei;
......@@ -671,35 +249,21 @@ export default {
font-weight: 700;
}
}
.jianju {
// background: rgba(9, 32, 87, 0.7);
border-radius: 10px 0 0 10px;
display: flex;
justify-content: center;
}
.task-main::v-deep {
padding: 38px 30px;
position: relative;
.taskList {
overflow-y: auto;
.rwtitle {
font-family: MicrosoftYaHei-Bold;
font-size: 14px;
color: #b5e5ff;
padding: 5px 0;
letter-spacing: 0;
font-weight: 700;
background: rgba(87, 96, 138, 0.2);
border: 1px solid rgba(207, 234, 255, 0.33);
.el-form-item__label {
color: #fff;
}
.rwinfo {
color: #ffffff;
background: url("~@/assets/images/observe/fckernel/nest/listBg.png");
background-repeat: no-repeat;
background-size: 100% 100%;
height: 33px;
line-height: 33px;
padding-left: 4px;
.btn__add-line {
position: absolute;
bottom: 20px;
right: 20px;
font-size: 10px;
color: #43deff;
cursor: pointer;
}
}
......@@ -710,37 +274,15 @@ export default {
line-height: 32px;
margin: 0 auto;
margin-bottom: 10px;
// background-image: linear-gradient(
// 180deg,
// #9198ff 0%,
// rgba(45, 81, 153, 0.22) 40%,
// #05091a 100%
// );
// border: 1px solid #70daf9;
// box-shadow: inset 0 0 10px 2px #3f9dff;
background: url("~@/assets/yingkong1027/btn_lan.png") no-repeat;
color: #fff;
background: url("../../assets/images/btn_lan.png") no-repeat;
background-size: 100% 100%;
cursor: pointer;
}
.Titlehideen {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.el-cascader-menu {
width: 200px;
}
.mrg_left6 {
margin-left: 10px;
}
.kbt_button {
margin-left: 10px;
width: 80%;
.select-airway__btn {
width: 100%;
height: 30px;
padding: 0;
}
.line_height {
line-height: 28px;
}
</style>
import API from "@/api";
import { Utils } from "@/lib/cesium";
// import API from "@/api";
import { Utils } from "../../../../../../../../../lib/cesium";
let airline_entitys = [];
let air_line_preview = [];
export default {
createFn() {
this.$emit("createTaskClick");
},
// 航线数据
async list_airway() {
let res = await API.AIRWAY.getApprovedTask();
if (res) {
let jqList = [],
ctList = [],
lsList = [];
for (let i = 0; i < res.length; i++) {
if (res[i].taskCateId == 1) {
jqList.push(res[i]);
}
if (res[i].taskCateId == 2) {
ctList.push(res[i]);
}
if (res[i].taskCateId == 3) {
lsList.push(res[i]);
}
}
let airway_list = [
{
taskTitle: "选择航线自动生成任务",
id: 'z1322'
},
{
id: "警情任务",
taskTitle: "警情任务",
children: jqList,
},
{
id: "常态任务",
taskTitle: "常态任务",
children: ctList,
},
{
id: "临时任务",
taskTitle: "临时紧急任务",
children: lsList,
},
];
this.airway_list = airway_list;
}
let FlightLineList = await API.AIRWAY.Drd({sourceType:1});
this.flightList = FlightLineList
},
// // 获取任务列表
// async init() {
// let res = await API.AIRWAY.getNestApprovedTask();
// this.TaskList = [{
// taskTitle: "选择航线自动生成任务",
// id: 'z1322'
// }, ...res];
// },
// 预览航线
showRoute(item) {
this.distanceLine = 0
this.handleAirLinePreview(item, true)
},
changeBtn(item) {
this.taskType = item;
this.$emit('taskType',item)
if (this.taskType == "itemA") {
this.list_airway()
}
},
close() {
this.$nextTick(async () => {
let viewer = window.viewer;
if (airline_entitys?.length) {
airline_entitys.forEach((item) => {
viewer.entities.remove(item);
});
}
let res = {};
air_line_preview.forEach((item) => {
viewer.entities.remove(item);
});
await this.list_airway();
await this.initTask();
this.flightId = "";
this.flyTypeId = "";
this.flight = [
{
flightName: "",
},
];
this.taskCate = 1
});
},
task_update(status) {
API.DEVICE.task_update({
id: this.flyTypeId,
status,
deviceHardId: this.uav_This.uav.control.device.deviceHardId,
});
},
startFlight(data) {
// 开始任务
this.$emit(
"fn",
{
data,
type: 769,
},
"wrj"
);
},
end(item) {
// 结束任务
this.task_update(4)
this.$emit("fn", this.data[item].data, "wrj");
// 飞控结束任务
this.startFlight(null)
this.flyTypeId = null
this.list_airway()
this.flight = [
{
flightName: "",
},
],
sessionStorage.removeItem("waypointList");
this.$message.success("操作成功");
},
unlock() {
if (this.unlockValue) {
this.ws = new WebSocket("ws://127.0.0.1:8802");
this.ws.onmessage = (e) => {
let reader = new FileReader();
console.log(e.data, 'e.data');
reader.onload = (event) => {
let data = event.currentTarget.result;
data = JSON.parse(data).data;
this.$emit(
"fn",
{
type: 519,
data
}
);
}
reader.readAsText(e.data);
}
// 更改为定点模式
// this.$emit('fn', {
// type: 513,
// data: "POSITION",
// }, "wrj")
this.$message.success("操作成功");
}
},
plan() {
if (this.airwayUploadData.totalWaypointCount) {
return parseInt(
(this.airwayUploadData.uploadedWaypointIndex /
this.airwayUploadData.totalWaypointCount) *
100
);
} else {
return "";
}
},
handle_airway_change() {
if (!this.flyTypeId) return this.$message.warning("请选择任务");
this.$emit("airway-view", this.flight[0]);
},
upload__airway() {
if (!this.flyTypeId) return this.$message.warning("请选择任务");
this.$emit("fn", { type: 521, data: this.flightLineData.data }, "wrj")
this.$message.success("操作成功");
},
// 飞控选择其他模块时,关闭航线
// 关键字:关闭预设航线
async close_the_router(item, state){
......@@ -425,6 +242,4 @@ export default {
});
airline_entitys.push(label_entity);
},
}
\ No newline at end of file
......@@ -65,10 +65,10 @@
</template>
<script>
import Bus from "@/assets/ligature.js";
// import Bus from "@/assets/ligature.js";
import { saveAs } from "file-saver";
import Moment from "moment";
import API from "@/api";
// import API from "@/api";
export default {
props: {
......
<template>
<div class="left-bar" :class="{ collapse: listCollapse }">
<div class="left-bar-item item" @click="closeAI()">
<div class="left-bar-item item" @click="onClickTask">
<img class="left-bar-item__icon" src="./assets/images/task.svg" />
<div class="left-bar-item__text">任务</div>
</div>
<div
class="left-bar-item item"
@click="
openAIList = !openAIList;
$emit('changeTask', false);
"
>
<TaskList class="task-list" v-if="openTask"></TaskList>
<div class="left-bar-item item" @click="onClickAI">
<img class="left-bar-item__icon" src="./assets/images/ai.png" />
<div class="left-bar-item__text">智能识别</div>
</div>
<div class="ai-list" :class="{ active: openAIList }" @click.stop>
<div class="left-bar-item item" @click="switchAI(0)">
<div class="ai-list" :class="{ active: openAIList }">
<div class="left-bar-item item" @click.stop="switchAI(0)">
<img class="left-bar-item__icon" src="./assets/images/faceAI2.png" />
<div class="left-bar-item__text">人脸识别</div>
</div>
<Face v-if="openFace" class="ai-dialog" :uavId="uav.hardId" @close="openFace = false" />
<div class="left-bar-item item" @click="switchAI(1)">
<div class="left-bar-item item" @click.stop="switchAI(1)">
<img class="left-bar-item__icon" src="./assets/images/carAI2.png" />
<div class="left-bar-item__text">车辆识别</div>
</div>
<Car v-if="openPlate" class="ai-dialog" :uavId="uav.hardId" @close="openPlate = false" />
<div class="left-bar-item item" @click="switchAI(2)">
<!-- <div class="left-bar-item item" @click.stop="switchAI(2)">
<img class="left-bar-item__icon" src="./assets/images/traffic.png" />
<div class="left-bar-item__text">交通指引</div>
</div>
<div class="left-bar-item item" @click="switchAI(3)">
<div class="left-bar-item item" @click.stop="switchAI(3)">
<img class="left-bar-item__icon" src="./assets/images/ksjm.png" />
<div class="left-bar-item__text">快速建模</div>
</div>
<Jm v-if="jmflag" :device="device" class="jm-dialog" @close="jmflag = false"></Jm>
<Traffic v-if="openTraffic" class="ai-dialog" :uavId="uav.hardId" @close="openTraffic = false" />
</div> -->
<Face v-if="openFace" class="ai-dialog" :uavId="uav.hardId" @close="openFace = false" />
<Car v-if="openPlate" class="ai-dialog" :uavId="uav.hardId" @close="openPlate = false" />
<Traffic
v-if="openTraffic"
class="ai-dialog"
:uavId="uav.hardId"
@close="openTraffic = false"
/>
<Jm v-if="openModeling" :device="device" class="jm-dialog" @close="openModeling = false"></Jm>
</div>
</div>
</template>
<script>
import { mapState } from "vuex";
import Car from "./components/car";
import Face from "./components/face";
import Jm from "./components/Jm";
import TaskList from "./components/taskList";
import Traffic from "./components/traffic";
export default {
name: "ControlLeft",
components: {
Car,
Jm,
TaskList,
Traffic,
Face,
},
data() {
return {
openTask: false, //打开任务
openAIList: false, //打开AI列表
openTraffic: false, //打开交通指引
openFace: false, //打开人脸识别
openPlate: false, //车牌识别
openModeling: false, //打开建模
};
},
computed: {
...mapState("MMCFlightControlCenter/uavApplications", [
"uav",
]),
...mapState("MMCFlightControlCenter/uavApplications", ["uav"]),
// 收起列表按钮
listCollapse: {
get() {
......@@ -70,6 +83,16 @@ export default {
},
},
methods: {
onClickTask() {
this.openTask = !this.openTask;
this.openAIList = false;
this.closeAI();
},
onClickAI() {
this.openTask = false;
this.openAIList = !this.openAIList;
this.closeAI();
},
/**
* 切换AI功能
*/
......@@ -77,6 +100,7 @@ export default {
this.openFace = false;
this.openPlate = false;
this.openTraffic = false;
this.openModeling = false;
switch (type) {
case 0:
this.openFace = !this.openFace;
......@@ -93,7 +117,7 @@ export default {
this.openTraffic = !this.openTraffic;
break;
case 3:
this.jmflag = !this.jmflag;
this.openModeling = !this.openModeling;
break;
}
......@@ -102,16 +126,22 @@ export default {
* 关闭所有ai
*/
closeAI() {
this.openAIList = false;
this.openFace = false;
this.openPlate = false;
this.openTraffic = false;
this.openModeling = false;
},
},
};
</script>
<style scoped lang="scss">
.task-list {
position: absolute;
left: 60px;
top: -30px;
cursor: initial;
}
.left-bar {
position: absolute;
......@@ -155,14 +185,21 @@ export default {
left: 65px;
top: 62px;
display: none;
gap: 4px;
&.active {
display: flex;
}
.left-bar-item {
margin-right: 4px;
padding-top: 3px;
}
}
}
.ai-dialog {
position: absolute;
top: 56px;
left: 0;
}
</style>
\ No newline at end of file
......@@ -49,7 +49,7 @@
width="30%"
:append-to-body="true"
style="margin-top: 20vh"
custom-class="mmc-dialog"
custom-class="mmc"
>
<div class="endrenwu">
<div class="tishiyu">紧急迫降</div>
......@@ -487,7 +487,7 @@ export default {
width: 100%;
height: 177px;
border: 1px solid #70daf9;
background: rgba(9, 32, 87, 0.7);
background: rgba(9, 32, 87, 0.7) !important;
}
.guideFlight::v-deep {
height: 240px;
......
......@@ -13,6 +13,7 @@
import cesiumLayout from "./components/cesium-layer";
import mapImageSwitch from "./components/mapImageSwitch";
import uavApplications from "./components/uavApplications";
import Vue from 'vue';
export default {
name: "MMCFlightControlCenter",
......@@ -27,10 +28,70 @@ export default {
type: Boolean,
default: false,
},
// 天目将登录用户信息
userInfo: {
type: Object,
default: null,
},
// 任务列表
taskList: {
type: Array,
default() {
return [
/* {
name: '任务',
id: 1,
children: [],
airway: {
name: '航线名称',
id: 1
}
} */
];
},
},
// 航线列表
airwayList: {
type: Array,
default() {
return [
/* {
name: '航线名称',
id: 1,
organizationName: '所属单位',
status: 1 //空域状态 1: 可用 2: 待申请 3: 待审批 4: 通过 5: 驳回
isSafe: 1 //空域状态 1: 安全 2: 待确定
labelName: '航线标签'
} */
];
},
},
},
provide() {
return {
rootNode: this, //根节点实例
bus: new Vue() //bus总线
};
},
watch: {
taskList: {
immediate: true,
handler(newVal) {
this.$store.commit("MMCFlightControlCenter/setState", {
key: "taskList",
value: newVal,
});
},
},
airwayList: {
immediate: true,
handler(newVal) {
this.$store.commit("MMCFlightControlCenter/setState", {
key: "airwayList",
value: newVal,
});
},
},
},
beforeCreate() {
if (!window.$mmc) {
......@@ -110,9 +171,152 @@ export default {
background-color: #182f5c;
}
}
.dialog1027 {
z-index: 1;
.dialog-header {
box-sizing: border-box;
padding-left: 35px;
padding-right: 16px;
background-position: 12px 4px;
height: 32px;
width: 100%;
background: linear-gradient(
180deg,
#9198ff 0%,
rgba(45, 81, 153, 0.45) 40%,
#05091a 100%
);
box-shadow: inset 0px 0px 10px 2px #3f9dff;
border-radius: 10px 10px 0px 0px;
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
.dialog-header__icon {
position: absolute;
left: 12px;
top: 50%;
transform: translate(0, -50%);
background-image: url("./assets/images/jinye.png");
background-size: 100% 100%;
width: 19px;
height: 25px;
}
.dialog-header__title {
display: flex;
align-items: center;
font-size: 20px;
font-family: YouSheBiaoTiHei;
background-image: -webkit-linear-gradient(
right,
#e3aa77,
#f5cda9,
#f9ecd3,
#fcdbb1,
#edb07a
);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
letter-spacing: 0;
font-weight: 700;
}
.dialog-header__close {
font-size: 14px;
font-family: MicrosoftYaHei;
color: #d2dfff;
line-height: 19px;
cursor: pointer;
}
}
.dialog-content {
background: rgba(12, 34, 73, 0.7);
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
border: 1px solid rgba(26, 92, 246, 0.5);
backdrop-filter: blur(1px);
padding: 12px 12px 16px;
width: 100%;
font-size: 14px;
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
font-weight: 400;
color: #ffffff;
box-sizing: border-box;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.dialog-content-item {
margin-bottom: 16px;
display: flex;
.dialog-content__label {
padding-top: 7px;
font-size: 14px;
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
font-weight: 400;
color: #ffffff;
width: 110px;
text-align: right;
}
.dialog-content__text {
padding: 6px 12px;
width: 228px;
background: rgba(2, 23, 61, 1);
border-radius: 2px;
border: 1px solid #315ec7;
font-size: 14px;
font-family: MicrosoftYaHei;
color: #00dfff;
line-height: 19px;
}
}
.el-input__inner {
// height: 32px;
background: #02173d !important;
border-radius: 2px;
border: 1px solid #315ec7 !important;
font-size: 14px;
font-family: MicrosoftYaHei;
color: #ffffff;
}
.el-radio {
color: #fff;
}
.el-scrollbar {
background: #02173d !important;
border: 1px solid #315ec7 !important;
}
.el-textarea {
border: none !important;
}
.el-textarea__inner {
background: #02173d !important;
border: 1px solid #315ec7 !important;
}
.btn-box1027 {
padding: 16px 16px;
width: 100%;
}
}
}
}
.mmc {
.popper__arrow::after {
border-bottom-color: #161d2d !important;
}
// 所有下拉选择框样式
&.el-select-dropdown {
border: none !important;
......@@ -153,10 +357,6 @@ export default {
font-weight: 400 !important;
}
.popper__arrow::after {
border-bottom-color: #161d2d !important;
}
.el-scrollbar {
overflow: hidden;
position: relative;
......@@ -171,5 +371,32 @@ export default {
}
}
}
&.el-cascader__dropdown {
border: 1px solid #315ec7 !important;
.el-cascader-menu__list {
background: rgba(9, 32, 87, 1) !important;
max-height: 300px;
max-width: 327px;
}
.el-cascader-node {
background: rgba(9, 32, 87, 1) !important;
color: #00aeff;
}
}
&.el-dialog {
background: transparent;
.el-dialog__header {
padding: 0;
}
.el-dialog__body {
padding: 0;
}
}
}
</style>
\ No newline at end of file
......@@ -27,6 +27,33 @@ export default {
},
cesium3DModels: [], //cesium的3D模型
listCollapse: false, //无人机或盈巢列表是否折叠
// 任务列表
taskList: [
/* {
name: "任务",
id: 1,
children: [],
airway: {
name: "航线名称1",
id: 1,
content:
'{"filename":"肇庆航线20240318","line":{"baseSpeed":3},"content":[{"uuid":"1nmI-Fo18IagbcVJsia7Q","latitude":23.178153411812204,"longitude":112.57807281336807,"alt":100,"yawAngle":0,"pitchAngle":0,"speed":3,"actions":[]},{"uuid":"9pTbBPlF8iIwbUNqusyHK","latitude":23.17783116525969,"longitude":112.57797543441967,"alt":100,"yawAngle":0,"pitchAngle":0,"speed":3,"actions":[]},{"uuid":"s91IhN22wuaeyG-UQs0XR","latitude":23.17786413506686,"longitude":112.57824336604547,"alt":100,"yawAngle":0,"pitchAngle":0,"speed":3,"actions":[]},{"uuid":"xS_JIl3wxQrhMPdpcjcSn","latitude":23.17820934975604,"longitude":112.5781357731637,"alt":100,"yawAngle":0,"pitchAngle":0,"speed":3,"actions":[]}],"baseSpeed":3,"gimbalYaw":0,"gimbalPitch":0,"alt":100}',
},
}, */
],
// 航线列表
airwayList: [
/* {
name: "航线名称1",
id: 1,
organizationName: "所属单位1",
status: 1, //空域状态 1: 可用 2: 待申请 3: 待审批 4: 通过 5: 驳回
isSafe: 1, //空域状态 1: 安全 2: 待确定
labelName: "航线标签1",
content:
'{"filename":"肇庆航线20240318","line":{"baseSpeed":3},"content":[{"uuid":"1nmI-Fo18IagbcVJsia7Q","latitude":23.178153411812204,"longitude":112.57807281336807,"alt":100,"yawAngle":0,"pitchAngle":0,"speed":3,"actions":[]},{"uuid":"9pTbBPlF8iIwbUNqusyHK","latitude":23.17783116525969,"longitude":112.57797543441967,"alt":100,"yawAngle":0,"pitchAngle":0,"speed":3,"actions":[]},{"uuid":"s91IhN22wuaeyG-UQs0XR","latitude":23.17786413506686,"longitude":112.57824336604547,"alt":100,"yawAngle":0,"pitchAngle":0,"speed":3,"actions":[]},{"uuid":"xS_JIl3wxQrhMPdpcjcSn","latitude":23.17820934975604,"longitude":112.5781357731637,"alt":100,"yawAngle":0,"pitchAngle":0,"speed":3,"actions":[]}],"baseSpeed":3,"gimbalYaw":0,"gimbalPitch":0,"alt":100}',
}, */
],
},
mutations: {
/**
......
......@@ -414,9 +414,6 @@ const actions = {
topic: "PX4/RECEIVE/" + state.uav.hardId,
callback(ok) {
ok && console.log("mqtt订阅主题", "PX4/RECEIVE/" + state.uav.hardId);
dispatch("createUavModel");
dispatch("createAirline");
dispatch("flyToUavModel");
},
});
} else {
......@@ -424,12 +421,6 @@ const actions = {
"MMCGroundStation/subscribe",
state.uav.hardId
);
// 由于地面站连接没响应数据,1秒后再创建飞机对象
setTimeout(() => {
dispatch("createUavModel");
dispatch("createAirline");
dispatch("flyToUavModel");
}, 1000);
}
},
/**
......
<template>
<div>
<el-form>
<el-switch v-model="devMode" active-text="测试环境" inactive-text="正式环境" @change="onSwitch"></el-switch>
<el-form-item label="账号">
<el-input v-model="account"></el-input>
</el-form-item>
......@@ -14,7 +15,15 @@
<el-button>上左</el-button>
</el-tooltip>
<div style="margin-top: 1080px;">
<MMCFlightControlCenter style="width: 1920px; height: 1080px; position: absolute; left: 0; top: 600px;" v-if="userInfo" :userInfo="userInfo" :devMode="true"></MMCFlightControlCenter>
<MMCFlightControlCenter
style="width: 1920px; height: 1080px; position: absolute; left: 0; top: 600px;"
v-if="userInfo"
:userInfo="userInfo"
:devMode="devMode"
:taskList="taskList"
:airwayList="airwayList"
@startTask="onStartTask"
></MMCFlightControlCenter>
</div>
</div>
</template>
......@@ -26,19 +35,92 @@ export default {
name: "fkzx1",
data() {
return {
baseUrl: "https://test.tmj.mmcuav.cn",
devMode: false,
account: "mmctest@admin",
password: "test@Admin001",
userInfo: null,
taskList: [
{
name: "任务1",
id: 1,
children: [
{
name: "任务2",
id: 2,
// children: [],
airway: {
name: "航线名称2",
id: 2,
},
},
],
airway: {
name: "航线名称1",
id: 1,
content:
'{"filename":"肇庆航线20240318","line":{"baseSpeed":3},"content":[{"uuid":"1nmI-Fo18IagbcVJsia7Q","latitude":23.178153411812204,"longitude":112.57807281336807,"alt":100,"yawAngle":0,"pitchAngle":0,"speed":3,"actions":[]},{"uuid":"9pTbBPlF8iIwbUNqusyHK","latitude":23.17783116525969,"longitude":112.57797543441967,"alt":100,"yawAngle":0,"pitchAngle":0,"speed":3,"actions":[]},{"uuid":"s91IhN22wuaeyG-UQs0XR","latitude":23.17786413506686,"longitude":112.57824336604547,"alt":100,"yawAngle":0,"pitchAngle":0,"speed":3,"actions":[]},{"uuid":"xS_JIl3wxQrhMPdpcjcSn","latitude":23.17820934975604,"longitude":112.5781357731637,"alt":100,"yawAngle":0,"pitchAngle":0,"speed":3,"actions":[]}],"baseSpeed":3,"gimbalYaw":0,"gimbalPitch":0,"alt":100}',
},
},
{
name: "任务2",
id: 2,
children: [],
airway: {
name: "航线名称2",
id: 2,
content:
'{"filename":"肇庆航线20240318","line":{"baseSpeed":3},"content":[{"uuid":"1nmI-Fo18IagbcVJsia7Q","latitude":23.178153411812204,"longitude":112.57807281336807,"alt":100,"yawAngle":0,"pitchAngle":0,"speed":3,"actions":[]},{"uuid":"9pTbBPlF8iIwbUNqusyHK","latitude":23.17783116525969,"longitude":112.57797543441967,"alt":100,"yawAngle":0,"pitchAngle":0,"speed":3,"actions":[]},{"uuid":"s91IhN22wuaeyG-UQs0XR","latitude":23.17786413506686,"longitude":112.57824336604547,"alt":100,"yawAngle":0,"pitchAngle":0,"speed":3,"actions":[]},{"uuid":"xS_JIl3wxQrhMPdpcjcSn","latitude":23.17820934975604,"longitude":112.5781357731637,"alt":100,"yawAngle":0,"pitchAngle":0,"speed":3,"actions":[]}],"baseSpeed":3,"gimbalYaw":0,"gimbalPitch":0,"alt":100}',
},
},
],
airwayList: [
{
name: "航线名称1",
id: 1,
organizationName: "所属单位1",
status: 1, //空域状态 1: 可用 2: 待申请 3: 待审批 4: 通过 5: 驳回
isSafe: 1, //空域状态 1: 安全 2: 待确定
labelName: "航线标签1",
content:
'{"filename":"肇庆航线20240318","line":{"baseSpeed":3},"content":[{"uuid":"1nmI-Fo18IagbcVJsia7Q","latitude":23.178153411812204,"longitude":112.57807281336807,"alt":100,"yawAngle":0,"pitchAngle":0,"speed":3,"actions":[]},{"uuid":"9pTbBPlF8iIwbUNqusyHK","latitude":23.17783116525969,"longitude":112.57797543441967,"alt":100,"yawAngle":0,"pitchAngle":0,"speed":3,"actions":[]},{"uuid":"s91IhN22wuaeyG-UQs0XR","latitude":23.17786413506686,"longitude":112.57824336604547,"alt":100,"yawAngle":0,"pitchAngle":0,"speed":3,"actions":[]},{"uuid":"xS_JIl3wxQrhMPdpcjcSn","latitude":23.17820934975604,"longitude":112.5781357731637,"alt":100,"yawAngle":0,"pitchAngle":0,"speed":3,"actions":[]}],"baseSpeed":3,"gimbalYaw":0,"gimbalPitch":0,"alt":100}',
},
{
name: "航线名称2",
id: 2,
organizationName: "所属单位2",
status: 2, //空域状态 1: 可用 2: 待申请 3: 待审批 4: 通过 5: 驳回
isSafe: 2, //空域状态 1: 安全 2: 待确定
labelName: "航线标签2",
content:
'{"filename":"肇庆航线20240318","line":{"baseSpeed":3},"content":[{"uuid":"1nmI-Fo18IagbcVJsia7Q","latitude":23.178153411812204,"longitude":112.57807281336807,"alt":100,"yawAngle":0,"pitchAngle":0,"speed":3,"actions":[]},{"uuid":"9pTbBPlF8iIwbUNqusyHK","latitude":23.17783116525969,"longitude":112.57797543441967,"alt":100,"yawAngle":0,"pitchAngle":0,"speed":3,"actions":[]},{"uuid":"s91IhN22wuaeyG-UQs0XR","latitude":23.17786413506686,"longitude":112.57824336604547,"alt":100,"yawAngle":0,"pitchAngle":0,"speed":3,"actions":[]},{"uuid":"xS_JIl3wxQrhMPdpcjcSn","latitude":23.17820934975604,"longitude":112.5781357731637,"alt":100,"yawAngle":0,"pitchAngle":0,"speed":3,"actions":[]}],"baseSpeed":3,"gimbalYaw":0,"gimbalPitch":0,"alt":100}',
},
],
};
},
computed: {},
async mounted() {},
methods: {
onSwitch() {
if (this.devMode) {
this.account = "mmctest@admin";
this.password = "test@Admin001";
this.baseUrl = "https://test.tmj.mmcuav.cn";
} else {
this.account = "mmcadmin@kbt001";
this.password = "TMJMMC@kbta0227&adm";
this.baseUrl = "https://tmj.mmcuav.cn";
}
},
onStartTask(uav, selectedTask, selectedAirway) {
console.log("一键任务事件", uav, selectedTask, selectedAirway);
// alert("一键任务事件");
},
async login() {
let formData = new FormData();
formData.append("userAccount", this.account);
formData.append("password", Base64.encode(this.password));
let res1 = await fetch("https://test.tmj.mmcuav.cn/crm/login", {
let res1 = await fetch(this.baseUrl + "/crm/login", {
method: "post",
headers: {
// "Content-Type": "multipart/form-data",
......@@ -48,7 +130,7 @@ export default {
let data1 = await res1.json();
if (data1.code == 200) {
await fetch("https://test.tmj.mmcuav.cn/crm/user/platformPermission", {
await fetch(this.baseUrl + "/crm/user/platformPermission", {
method: "get",
headers: {
Token: data1.data.token,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论