刘妍 2 months ago
commit 16847ae996

@ -117,7 +117,7 @@
"mapbox-gl": "^3.3.0",
"mapbox-gl-draw-snap-mode": "^0.2.0",
"mapbox-gl-utils": "^0.44.0",
"mars3d": "^3.7.0",
"mars3d": "^3.10.0",
"mars3d-cesium": "^1.113.0",
"mars3d-space": "^3.7.0",
"min-dash": "^4.2.1",

@ -39,9 +39,10 @@ import { XMLParser, XMLBuilder } from 'fast-xml-parser';
const emits = defineEmits(["updateAirLineLise"])
// add edit detail
const editMode = ref("add");
// 线
const airLineForm = ref({
"id": null,
"airLineName": null,
@ -64,12 +65,16 @@ const airLineForm = ref({
"folder": null
});
//
const currentFolder = ref(null);
//
const setCurrentFolder = (folder)=>{
currentFolder.value = folder;
importAirLineShow.value = true;
}
const flyToTherePosition = ref({
lng:null,
lat:null,
@ -80,6 +85,7 @@ const flyToTherePosition = ref({
const flyToThere = (e)=>{
}
const planListShow = ref(true);
const workPlanFormShow = ref(false);
const ariLineShow = ref(true);
@ -160,7 +166,6 @@ const handlerCreateAirLineForm = (form)=>{
}
const successCreatePlan = ()=>{
workPlanFormShow.value = false;
ariLineShow.value = false;
@ -168,8 +173,6 @@ const successCreatePlan = ()=>{
planListShow.value = true;
}
// 线退
const exitDraw = ()=>{
planListShow.value = false;

@ -28,10 +28,11 @@
</template>
<script setup lang="ts">
import {} from "vue"
import { defineProps } from "vue"
import { BasicTable, useTable, TableAction } from '@/components/Table';
import { columns, searchFormSchema, levelOptions, modelOptions } from './utils'
import { GetManageDeviceHmsList } from '@/api/demo/device'
const props = defineProps(['deviceWarningInfo'])
const [registerTable, { reload, expandAll, getForm}] = useTable({
title: '告警信息',
api: GetManageDeviceHmsList,
@ -55,6 +56,7 @@ const [registerTable, { reload, expandAll, getForm}] = useTable({
params.endTime = params.time[1]
}
params.time = null
params.getway = props.deviceWarningInfo.gateWay
return params
},
afterFetch(data) {

@ -25,7 +25,7 @@
icon: 'ant-design:file-search-outlined',
onClick: () => {
console.log('deviceInfoList',deviceInfoList)
deviceWarningDrawer = true
openDeviceWarningDrawer(record)
},
},
{
@ -55,7 +55,7 @@
<FeedbackDrawer />
</a-drawer>
<a-drawer class="device-warning" v-model:open="deviceWarningDrawer" title="告警信息" width="70%" :closable="false">
<DeviceWarning />
<DeviceWarning :deviceWarningInfo="deviceWarningInfo"/>
</a-drawer>
<a-drawer class="feedback-drawer" title="设备运维" v-model:open="deviceControl" width="45%" style="background:#f0f1f2" :closable="false">
<!-- <DeviceControl :deviceInfoList="deviceInfoList" :controlSN="controlSN" :controlChildSN="controlChildSN"/> -->
@ -136,6 +136,7 @@ const editDeviceModal = ref(false)
const editDeviceDate = ref({})
const controlChildSN = ref()
const controlItemDetsils = ref()
const deviceWarningInfo = ref()
watch(() => [afterFetch.value, props.connected], ([newAfterFetch, newConnected], [oldAfterFetch, oldConnected]) => {
// console.log(newAfterFetch,newConnected)
// console.log(getDataSource())
@ -253,6 +254,10 @@ const delDevice = (record) => {
},
});
}
const openDeviceWarningDrawer = (record) => {
deviceWarningInfo.value = record
deviceWarningDrawer.value = true
}
</script>
<style lang="scss" scoped>

@ -40,8 +40,8 @@
<div class="filter-button" @click="pageQuery.AirLineType = 'mapping2d';getAirList();">
<svg t="1749104746320" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7498" width="24" height="24"><path d="M918.485333 261.930667L857.813333 208.64a20.992 20.992 0 0 0-27.008 0L770.133333 261.973333a15.36 15.36 0 0 0 0 23.68 20.48 20.48 0 0 0 13.482667 4.906667 20.48 20.48 0 0 0 13.525333-4.906667l15.36-13.482666v141.994666c0 15.402667 14.250667 27.904 31.786667 27.904 17.578667 0 31.829333-12.501333 31.829333-27.904V272.128l15.36 13.482667a20.48 20.48 0 0 0 13.482667 4.906666 20.48 20.48 0 0 0 13.525333-4.906666 15.36 15.36 0 0 0 0-23.68z m-277.461333 159.146666c0 15.445333 14.250667 27.946667 31.829333 27.946667s31.829333-12.501333 31.829334-27.946667V346.325333c0-31.786667-11.349333-61.952-31.914667-84.906666a115.328 115.328 0 0 0-85.632-38.698667c-32.426667 0-63.573333 14.08-85.632 38.698667a126.848 126.848 0 0 0-31.914667 84.906666v335.530667c0 36.693333-24.704 67.754667-53.888 67.754667-29.226667 0-53.930667-31.061333-53.930666-67.754667V355.498667l0.469333-7.68 0.042667-1.493334c0-31.786667-11.306667-61.952-31.914667-84.906666a115.328 115.328 0 0 0-85.632-38.698667c-32.384 0-63.573333 14.08-85.632 38.698667a126.848 126.848 0 0 0-31.914667 84.906666v138.496c0 15.402667 14.250667 27.904 31.829334 27.904s31.829333-12.501333 31.829333-27.904V346.325333c0-36.693333 24.704-67.754667 53.888-67.754666 29.013333 0 53.589333 30.634667 53.930667 67.072l-0.512 8.405333v327.808c0 31.786667 11.306667 61.952 31.914666 84.906667a115.328 115.328 0 0 0 85.632 38.698666c32.384 0 63.573333-14.08 85.632-38.698666a126.848 126.848 0 0 0 31.914667-84.906667V346.325333c0-36.693333 24.661333-67.754667 53.888-67.754666 29.226667 0 53.888 31.018667 53.888 67.754666V421.12z" p-id="7499" fill="#ffffff"></path><path d="M858.453333 786.432l72.106667-122.624a27.861333 27.861333 0 0 0 0-28.288l-72.106667-122.624a28.928 28.928 0 0 0-24.96-14.165333h-144.128a28.928 28.928 0 0 0-24.96 14.165333l-72.106666 122.624a27.861333 27.861333 0 0 0 0 28.288l72.106666 122.624c5.12 8.746667 14.634667 14.165333 24.96 14.165333h144.128a28.928 28.928 0 0 0 24.96-14.165333z m-152.32-231.04h110.805334l55.466666 94.293333-55.466666 94.293334H706.133333l-55.424-94.293334 55.466667-94.293333z" p-id="7500" fill="#ffffff"></path><path d="M703.786667 650.410667a57.173333 57.173333 0 0 0 57.642666 56.618666 57.173333 57.173333 0 0 0 57.642667-56.618666 57.173333 57.173333 0 0 0-57.642667-56.618667 57.173333 57.173333 0 0 0-57.642666 56.618667z m57.6 14.165333q1.408 0 2.816-0.298667 1.408-0.256 2.688-0.810666 1.322667-0.512 2.517333-1.28 1.194667-0.768 2.176-1.749334 1.024-1.024 1.792-2.133333 0.810667-1.194667 1.322667-2.474667 0.554667-1.28 0.853333-2.645333 0.256-1.365333 0.256-2.773333t-0.256-2.773334q-0.298667-1.365333-0.853333-2.645333-0.512-1.28-1.28-2.432-0.853333-1.194667-1.834667-2.133333-0.981333-1.024-2.176-1.792-1.194667-0.768-2.517333-1.28-1.28-0.554667-2.688-0.853334-1.408-0.256-2.816-0.256t-2.816 0.256q-1.365333 0.298667-2.688 0.853334-1.28 0.512-2.517334 1.28-1.152 0.768-2.133333 1.749333-1.024 0.981333-1.834667 2.133333-0.768 1.194667-1.322666 2.474667-0.554667 1.28-0.853334 2.645333-0.256 1.365333-0.256 2.773334t0.298667 2.773333q0.256 1.365333 0.810667 2.645333t1.322666 2.432q0.810667 1.152 1.792 2.133334 1.024 1.024 2.176 1.792 1.194667 0.768 2.517334 1.28 1.28 0.554667 2.688 0.853333 1.408 0.256 2.816 0.256z" p-id="7501" fill="#ffffff"></path><path d="M162.389333 510.464a43.690667 43.690667 0 1 1 0 87.381333 43.690667 43.690667 0 0 1 0-87.381333z m0-37.632c-44.8 0-81.322667 36.48-81.322666 81.322667 0 44.8 36.48 81.322667 81.322666 81.322666s81.322667-36.48 81.322667-81.322666-36.48-81.322667-81.322667-81.322667z" p-id="7502" fill="#ffffff"></path><path d="M234.112 554.154667q0-29.653333-21.034667-50.688t-50.688-21.034667q-29.653333 0-50.688 21.034667-20.992 21.034667-20.992 50.688t20.992 50.645333q21.034667 21.034667 50.688 21.034667t50.688-21.034667q21.034667-20.992 21.034667-50.645333z m19.2 0q0 37.589333-26.666667 64.256-26.624 26.666667-64.256 26.666666-37.589333 0-64.256-26.666666t-26.666666-64.256q0-37.632 26.666666-64.256 26.666667-26.666667 64.256-26.666667 37.632 0 64.256 26.666667 26.666667 26.624 26.666667 64.256z m-144.213333 0q0-22.101333 15.616-37.717334t37.674666-15.616q22.101333 0 37.717334 15.616t15.616 37.717334q0 22.058667-15.616 37.674666t-37.717334 15.616q-22.058667 0-37.674666-15.616t-15.616-37.674666z m19.2 0q0 14.08 9.984 24.106666 9.984 9.984 24.106666 9.984 14.122667 0 24.106667-9.984 9.984-9.984 9.984-24.106666 0-14.122667-9.984-24.106667-9.984-9.984-24.106667-9.984-14.08 0-24.106666 9.984-9.984 9.984-9.984 24.106667z" p-id="7503" fill="#ffffff"></path></svg>
</div>
<div class="filter-button">
<svg t="1749104685102" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6766" width="24" height="24"><path d="M712.313523 0.469118v51.176544c-208.544417 0-446.600641 148.795802-446.600641 279.040107 0 41.197118 9.552955 70.367748 31.68681 107.342801l7.25001 11.600017 17.314731 27.422098 3.497064 5.714714c31.729457 53.820666 34.075049 100.007497-2.004415 164.959061-51.38978 92.458956-145.682562 173.914956-282.281288 244.965057l-18.039731 9.211778L0.234559 856.098288c137.920786-68.960393 230.507684-146.919329 278.485694-233.237099 26.867686-48.404481 25.502978-75.314814 2.644122-114.123694l-21.579443-34.20299-6.22648-10.107367c-26.611803-44.438299-39.022115-81.882471-39.022114-133.741369 0-162.059056 255.669485-324.629878 485.878638-330.088709L712.313523 0.469118z m49.470659 185.514973l22.901504 45.717712-18.892674 9.638249-16.845613 9.083837c-68.661863 38.126525-82.053059 63.288326-72.329516 121.757528 3.539711 21.110324 17.442672 42.775061 44.566241 71.092749l8.316188 8.529424 9.595602 9.425014 31.089751 29.852984c59.876557 57.744201 90.3266 98.514847 104.058973 153.231102 20.129441 80.645704 21.408854 148.326684 2.857357 203.000292l-3.966182 10.747074-47.508892-19.020616c18.039732-45.120653 18.039732-105.850152-1.066178-182.316438-10.022073-40.088293-33.307401-72.926575-80.219233-119.411936l-42.34859-40.813294-12.282371-12.154429a601.06851 601.06851 0 0 1-5.458831-5.62942c-33.648578-35.141227-52.498605-64.525093-58.128025-98.131023-14.926492-89.644246 14.07355-130.628129 114.592812-183.809088l21.067677-10.832368zM574.904502 797.970264v50.579484h-29.852984v-50.622131h29.852984z m0-136.513432v85.29424h-29.852984v-85.29424h29.852984z m-25.161801-139.882554c14.627962 30.492691 23.072092 58.767731 24.863271 87.511891l-29.852984 1.833826c-1.450002-24.479447-8.827954-49.172129-21.92062-76.466286z m-68.278039-119.028112l7.505893 14.286786 35.269168 58.213318-25.588272 15.352964-31.302986-51.517721a446.856524 446.856524 0 0 1-12.538253-22.858857l26.65445-13.47649zM458.264629 268.719504l25.75886 15.09708a192.082629 192.082629 0 0 0-15.99267 34.927991c-4.264712 12.836783-5.117654 24.820624-2.985298 37.955937l-29.426513 4.861772a106.191329 106.191329 0 0 1 4.136771-52.370663c4.776477-14.07355 11.002957-27.55004 18.50885-40.472117z m104.186914-99.282496l15.011786 25.844155a284.712174 284.712174 0 0 0-64.013327 49.641248l-21.707384-20.513265a314.351922 314.351922 0 0 1 70.708925-54.972138z m131.011953-51.261838l7.25001 29.000041a533.515472 533.515472 0 0 0-78.811878 26.014744l-11.642663-27.507393c25.588272-10.875016 53.436841-20.044146 83.161884-27.507392z" fill="#ffffff" p-id="6767"></path></svg>
<div class="filter-button" @click="resetQueryList();">
<svg t="1753150393228" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4469" width="24" height="24"><path d="M502.714987 58.258904l-126.531056-54.617723a52.797131 52.797131 0 0 0-41.873587 96.855428A447.865322 447.865322 0 0 0 392.02307 946.707184a61.535967 61.535967 0 0 0 13.83649 1.820591 52.797131 52.797131 0 0 0 13.65443-103.773672 342.453118 342.453118 0 0 1-31.678278-651.771485l-8.374718 19.480321a52.615072 52.615072 0 0 0 27.855039 69.182448 51.522718 51.522718 0 0 0 20.572675 4.369418A52.797131 52.797131 0 0 0 476.498481 254.882703L530.205907 127.441352a52.979191 52.979191 0 0 0-27.49092-69.182448zM962.960326 509.765407A448.775617 448.775617 0 0 0 643.992829 68.090094a52.797131 52.797131 0 1 0-30.403866 101.042786A342.635177 342.635177 0 0 1 674.578753 801.059925a52.615072 52.615072 0 0 0-92.30395-50.612422l-71.913335 117.246043a52.433013 52.433013 0 0 0 17.295612 72.82363l117.063985 72.823629a52.797131 52.797131 0 1 0 54.617722-89.755123l-16.021198-10.013249A448.593558 448.593558 0 0 0 962.960326 509.765407z" fill="#ffffff" p-id="4470"></path></svg>
</div>
<div class="filter-button" @click="showSearchInput = !showSearchInput;getAirList();">
<svg t="1750122415214" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4744" width="24" height="24"><path d="M670.528 760.96a384 384 0 1 1 90.496-90.496l180.224 180.288a64 64 0 0 1-90.496 90.496l-180.224-180.224zM448 704a256 256 0 1 0 0-512 256 256 0 0 0 0 512z" fill="#ffffff" p-id="4745"></path></svg>
@ -67,20 +67,21 @@
</div>
<div>
<a-directory-tree
multiple
:tree-data="treeData"
:defaultExpandAll="true"
:autoExpandParent="true"
:field-names="fieldNames"
>
<template #title="{ data }">
<span @click="folderClick(data)">{{ data.path }}</span>
<span class="tree-node-actions" @click="deleteFolder(data)">
<DeleteOutlined />
</span>
</template>
</a-directory-tree>
multiple
:tree-data="treeData"
:defaultExpandAll="true"
:autoExpandParent="true"
:field-names="fieldNames"
:expandedKeys="expandedKeys"
>
<template #title="{ data }">
<span @click="folderClick(data)">{{ data.path }}</span>
<span class="tree-node-actions" @click="deleteFolder(data)">
<DeleteOutlined />
</span>
</template>
</a-directory-tree>
</div>
</div>
<div class="routers-list">
@ -114,6 +115,9 @@
<a-menu-item @click="toEditAirLine(item)">
<a href="javascript:;">编辑</a>
</a-menu-item>
<a-menu-item @click="downloadAirLine(item)">
<a href="javascript:;">下载</a>
</a-menu-item>
<a-menu-item @click="deletePlan(item.id)">
<a href="javascript:;">删除</a>
</a-menu-item>
@ -241,6 +245,7 @@
key: 'id',
children: 'children'
})
//
const importAirLineShow = ref(false);
const fileList = ref([]);
@ -375,35 +380,29 @@
// importAirLineShow.value = true;
}
const expandedKeys = ref<string[]>(['0-0', '0-1']);
const expandedKeys = ref<string[]>([]);
const selectedKeys = ref<string[]>([]);
const treeData = ref(
[
{
title: '默认文件夹',
key: '1',
children: [
{
title: '面状航线',
key: '2',
isLeaf: true,
},
{
title: '航点航线',
key: '3',
isLeaf: true,
},
],
}
]
)
const treeData = ref()
const getFolder = async () => {
let res = await getListAirLineFolder({});
treeData.value = res;
console.log("treeData",treeData.value);
treeData.value = recursionTreeData(res);
}
//
const recursionTreeData = (data) => {
for(let i=0;i<data.length;i++){
data[i].isLeaf = true;
expandedKeys.value?.push(data[i].id);
if(data[i].children && data[i].children.length>0){
recursionTreeData(data[i].children)
}
}
return data;
}
getFolder();
@ -428,8 +427,25 @@
ariLineList.value = res.items;
}
getAirList();
//
const resetQueryList = () => {
pageQuery.value = {
Ascending:false,
UavTypeId:null,
AirLineType:null,
AirLineName:null,
Folder:null,
page:1,
limit:10,
key:null,
};
getAirList();
}
const editLine = ()=>{
}
@ -541,6 +557,11 @@
}
}
// 线
const downloadAirLine = (item) => {
window.open(item.wpml,"_blank");
}
</script>
<style scoped>
.container{

@ -212,7 +212,7 @@
import {ref,defineEmits,defineProps,watch} from 'vue'
import { SaveOutlined,LeftOutlined } from '@ant-design/icons-vue';
import {missionConfigOptions,folderConfigOptions} from '../waylineConfig/index.ts';
import {uploadXmlFile,addAirLine} from '@/api/sys/workplan';
import {uploadXmlFile,addAirLine,editAirLine} from '@/api/sys/workplan';
import { message } from 'ant-design-vue';
import { XMLParser, XMLBuilder } from 'fast-xml-parser';
import JSZip from "jszip";
@ -226,8 +226,29 @@ import {uavModel,calculateHeight,calculateGsd,calculateSpacing} from '../lib/cal
const emits = defineEmits(["setFlyPoint","exitDraw","calculatParamChange"])
const props = defineProps(["airInfo","polygonAirForm","airPoints","airLineForm","waylineInfo"])
// const props = defineProps(["airInfo","polygonAirForm","airPoints","airLineForm","waylineInfo"])
const props = defineProps({
"airInfo":{
type:Object
},
"polygonAirForm":{
type:Object
},
"airPoints":{
type:Object
},
"airLineForm":{
type:Object
},
"waylineInfo":{
type:Object
},
"editModel":{
type:String,
default:"add"
}
})
const airInfo = ref({
area:0.0,
@ -293,36 +314,34 @@ const onOverlayYChange = ()=>{
// 线
const missionConfig = ref(
{
"flyToWaylineMode": "safely",
"finishAction": "goHome",
"exitOnRCLost": "executeLostAction",
"executeRCLostAction": "goBack",
"takeOffSecurityHeight": 20,
"globalTransitionalSpeed": 15,
"globalRTHHeight": 100,
"droneInfo": {
"flyToWaylineMode": "safely", // safely pointToPoint
"finishAction": "goHome", // 线
"exitOnRCLost": "executeLostAction", // 线
"executeRCLostAction": "goBack", //
"takeOffSecurityHeight": 20, //
"globalTransitionalSpeed": 15, // 线
"globalRTHHeight": 100, //
"droneInfo": { //
"droneEnumValue": 100,
"droneSubEnumValue": 1
},
"autoRerouteInfo": {
"autoRerouteInfo": { // 线
"transitionalAutoRerouteMode": 1,
"missionAutoRerouteMode": 1
},
"waylineAvoidLimitAreaMode": 0,
"payloadInfo": {
"payloadEnumValue": 99,
"payloadInfo": { //
"payloadEnumValue": 99, //
"payloadSubEnumValue": 2,
"payloadPositionIndex": 0
"payloadPositionIndex": 0 //
}
}
)
console.log("props.waylineInfo",props.waylineInfo);
//
// if(props.waylineInfo){
// missionConfig.value = props.waylineInfo.missionConfig
// }
if(props.waylineInfo){
missionConfig.value = props.waylineInfo.missionConfig
}
watch(
@ -340,7 +359,7 @@ const folder = ref({
"waylineId": 0,
"distance": 1391.755859375,
"duration": 200.941531419754,
"autoFlightSpeed": 8.2,
"autoFlightSpeed": 8.2, // 线
"startActionGroup": {
"action": [
{
@ -406,6 +425,8 @@ if(props.waylineInfo){
folder.value = props.waylineInfo.Folder
}
//
const pointInfo = {
"Point": {
@ -522,9 +543,9 @@ const handlerPointInfo = ()=>{
"Point": {
"coordinates": item.lng+","+item.lat //
},
"index": index, //
"index": index, //
"executeHeight": item.alt, //
"waypointSpeed": 12.7125370218057, //
"waypointSpeed": 12.7125370218057, //
"waypointHeadingParam": { //
"waypointHeadingMode": "followWayline", // 线
"waypointHeadingAngle": -96.9990577342362,
@ -618,7 +639,6 @@ const handlerPointInfo = ()=>{
"waypointWorkType": 0
}
placemarkArray.push(point);
});
folder.value.Placemark = placemarkArray;
@ -739,7 +759,17 @@ const handlerCreateFile =async (xmlString3)=>{
if(res){
submitForm.value.wpml = res.path;
let addAirLineRes =await addAirLine(submitForm.value);
let addAirLineRes = null;
if(props.editModel == 'add'){
addAirLineRes =await addAirLine(submitForm.value);
}else if(props.editModel == 'edit'){
addAirLineRes =await editAirLine(submitForm.value);
}
if(addAirLineRes){
message.success("操作成功!");
backPage();
@ -766,7 +796,7 @@ const convertXmlToKmz =async (waylineStr,templateStr)=>{
// 3. KMZ (ZIP)
const kmzBlob = await zip.generateAsync({ type: "blob" });
saveAs(kmzBlob, "output.kmz");
// saveAs(kmzBlob, "output.kmz");
return kmzBlob;
}

@ -122,7 +122,7 @@
@change="handleRepeatTypeChange"
>
<a-select-option value="date"></a-select-option>
<a-select-option value="week"></a-select-option>
<!-- <a-select-option value="week"></a-select-option> -->
<!-- <a-select-option value="month"></a-select-option> -->
</a-select>
</div>
@ -208,7 +208,53 @@ import { Modal, message } from 'ant-design-vue';
const formRef = ref();
const labelCol = { span: 24 };
const wrapperCol = { span: 24 };
const props = defineProps(["checkedAriLine","checkedDronePort","formData"]);
const props = defineProps({
"checkedAriLine":{
type:Object
},
"checkedDronePort":{
type:Object
},
"formData":{
type:Object,
default: ()=>({
"id": null,
"taskName": null,
"taskType": 0,
"taskAirLineName": null,
"taskDronePortName": null,
"taskDronePort": null,
"taskAirLine": null,
"returnAltitude": 0,
"lossOfControlAction": 0,
"continuationMode": null,
"aiInspection": null,
"status": 0,
"periodicFormula": null,
"airLineId": null,
"createId": 0,
"createTime": "",
"waylinePrecisionType": 0,
"scheduledStartTime": "",
"scheduledEndTime": "",
"executeTime": "",
"completedTime": "",
"planExecuteDuration": 0,
"actualExecuteDuration": 0,
"workspaceId": null,
"expectedFileCount": 0,
"uploadedFileCount": 0,
"flightId": null,
"reason": null
})
},
"editMode":{
type:String,
default:"add"
}
});
@ -254,14 +300,18 @@ const handlerDisplayCronTime = ()=>{
console.log("cronArray",cronArray);
let days = cronArray[3].split("-")
repeatTime.value.date = [cronArray[6]+"-"+days[0]+"-"+cronArray[3], cronArray[6]+"-"+days[1]+"-"+cronArray[3]]
repeatTime.value.date = [cronArray[6]+"-"+cronArray[4]+"-"+days[0], cronArray[6]+"-"+cronArray[4]+"-"+days[1]]
console.log(" repeatTime.value.date", repeatTime.value.date);
repeatTime.value.time = cronArray[2]+":"+cronArray[1]+":"+cronArray[0]
}
}
//
handlerDisplayCronTime();
if(props.formData){
handlerDisplayCronTime();
}
const handleOk = ()=>{

@ -22,6 +22,7 @@
<airPolygon
@setFlyPoint="setFlyPoint"
:airInfo="airInfo"
:editModel="props.editMode"
:polygonAirForm="polygonAirForm"
:airLineForm="props.airLineForm"
:waylineInfo="props.waylineInfo"
@ -42,7 +43,7 @@
<script lang="ts" setup>
import { ref, onMounted, defineProps, watch, defineEmits } from 'vue';
import { message } from 'ant-design-vue';
import { GeojsonToWkt } from '@/components/MapboxMaps/src/WktGeojsonTransform';
import { GeojsonToWkt,WktToGeojson } from '@/components/MapboxMaps/src/WktGeojsonTransform';
import { buildUUID } from '@/utils/uuid';
import airPoint from './airPoint.vue';
import * as mars3d from 'mars3d';
@ -103,6 +104,97 @@
},
"waylineInfo":{
type:Object,
default: () => ({
"missionConfig":{
"flyToWaylineMode": "safely", // safely pointToPoint
"finishAction": "goHome", // 线
"exitOnRCLost": "executeLostAction", // 线
"executeRCLostAction": "goBack", //
"takeOffSecurityHeight": 20, //
"globalTransitionalSpeed": 15, // 线
"globalRTHHeight": 100, //
"droneInfo": { //
"droneEnumValue": 100,
"droneSubEnumValue": 1
},
"autoRerouteInfo": { // 线
"transitionalAutoRerouteMode": 1,
"missionAutoRerouteMode": 1
},
"waylineAvoidLimitAreaMode": 0,
"payloadInfo": { //
"payloadEnumValue": 99, //
"payloadSubEnumValue": 2,
"payloadPositionIndex": 0 //
}
},
"Folder":{
"templateId": 0,
"executeHeightMode": "WGS84",
"waylineId": 0,
"distance": 1391.755859375,
"duration": 200.941531419754,
"autoFlightSpeed": 8.2, // 线
"startActionGroup": {
"action": [
{
"actionId": 0,
"actionActuatorFunc": "gimbalRotate",
"actionActuatorFuncParam": {
"gimbalHeadingYawBase": "aircraft",
"gimbalRotateMode": "absoluteAngle",
"gimbalPitchRotateEnable": 1,
"gimbalPitchRotateAngle": -90,
"gimbalRollRotateEnable": 0,
"gimbalRollRotateAngle": 0,
"gimbalYawRotateEnable": 1,
"gimbalYawRotateAngle": 0,
"gimbalRotateTimeEnable": 0,
"gimbalRotateTime": 10,
"payloadPositionIndex": 0
}
},
{
"actionId": 1,
"actionActuatorFunc": "hover",
"actionActuatorFuncParam": {
"hoverTime": 0.5
}
},
{
"actionId": 2,
"actionActuatorFunc": "setFocusType",
"actionActuatorFuncParam": {
"cameraFocusType": "manual",
"payloadPositionIndex": 0
}
},
{
"actionId": 3,
"actionActuatorFunc": "focus",
"actionActuatorFuncParam": {
"focusX": 0,
"focusY": 0,
"focusRegionWidth": 0,
"focusRegionHeight": 0,
"isPointFocus": 0,
"isInfiniteFocus": 1,
"payloadPositionIndex": 0,
"isCalibrationFocus": 0
}
},
{
"actionId": 4,
"actionActuatorFunc": "hover",
"actionActuatorFuncParam": {
"hoverTime": 1
}
}
]
},
Placemark:[]
}
})
},
"workPlanFormShow":{
type:Boolean
@ -273,20 +365,27 @@ const generatePreviewPoint = (placemark)=>{
airPointConfigShow.value = true;
};
///////////////////////////////////////////////////////////////////////////
let map: mars3d.Map; //
let graphicLayer: mars3d.layer.GraphicLayer;
//
let drawGraphicLayer:mars3d.layer.GraphicLayer;
let takeOffPointGraphicLayer:mars3d.layer.GraphicLayer;
let uavGraphicLayer: mars3d.layer.GraphicLayer;
// 线
//
let polygonGraphicLayer: mars3d.layer.GraphicLayer;
// 线
let polygonLineGraphicLayer: mars3d.layer.GeoJsonLayer;
//
//
let textLabelGraphicLayer: mars3d.layer.GraphicLayer;
//
let stickGroundPointLayer: mars3d.layer.GraphicLayer;
// 线
@ -294,6 +393,7 @@ const generatePreviewPoint = (placemark)=>{
//
let homeStartGraphic;
let homeStartGraphicLive;
let graphic = null;
@ -302,16 +402,23 @@ const generatePreviewPoint = (placemark)=>{
//
graphicLayer ? graphicLayer.clear() : null;
drawGraphicLayer ? drawGraphicLayer.clear() : null;
takeOffPointGraphicLayer ? takeOffPointGraphicLayer.clear() : null;
stickGroundPointLayer ? stickGroundPointLayer.clear() : null;
lineGroundPointLayer ? lineGroundPointLayer.clear() : null;
labelGraphicLayer ? labelGraphicLayer.clear() : null;
textLabelGraphicLayer ? textLabelGraphicLayer.clear() : null;
polygonGraphicLayer ? polygonGraphicLayer.clear() : null;
polygonLineGraphicLayer ? polygonLineGraphicLayer.clear() : null;
airPoints.value = [];
props.airLineForm.airLineType = null;
airPointConfigShow.value = false;
emits('exitDraw');
@ -536,15 +643,15 @@ const initMap = () => {
//
drawGraphicLayer = new mars3d.layer.GraphicLayer({
takeOffPointGraphicLayer = new mars3d.layer.GraphicLayer({
isAutoEditing:true,
})
drawGraphicLayer.on(mars3d.EventType.editMovePoint, function (event) {
takeOffPointGraphicLayer.on(mars3d.EventType.editMovePoint, function (event) {
flyPointMove(event);
});
map.addLayer(drawGraphicLayer);
map.addLayer(takeOffPointGraphicLayer);
//
stickGroundPointLayer = new mars3d.layer.GraphicLayer({
@ -566,7 +673,7 @@ const initMap = () => {
});
// 线
//
polygonGraphicLayer = new mars3d.layer.GraphicLayer({
isAutoEditing: true, //
});
@ -586,6 +693,7 @@ const initMap = () => {
})
map.addLayer(polygonGraphicLayer);
//
// handlerDrawStartPoint();
@ -671,13 +779,15 @@ const loadChangGuangLayer = ()=>{
///////////////////////////////////////////////////////////////////////////
//
const startPosition = ref(null);
// [lng,lat,alt]
const startPosition = ref(null);
//
const setFlyPoint = async () => {
drawGraphicLayer ? drawGraphicLayer.clear() : null;
const graphic = await drawGraphicLayer.startDraw({
takeOffPointGraphicLayer ? takeOffPointGraphicLayer.clear() : null;
const graphic = await takeOffPointGraphicLayer.startDraw({
type: 'billboardP',
style: {
image: '/map/start.png',
@ -742,6 +852,7 @@ const handlerGetLngLatHeight = (e)=>{
const polygonGeoJson = ref();
//
const polygonCalculateParams = ref({
"gsd": 0,
"overlapY": 70,
@ -755,7 +866,6 @@ const polygonCalculateParams = ref({
//
const handlerDrawPolygon = async () => {
const graphic = await polygonGraphicLayer.startDraw({
type: 'polygon',
style: {
@ -776,6 +886,13 @@ const handlerDrawPolygon = async () => {
let polygon = turf.polygon([coordinates]);
let polygonWkt = GeojsonToWkt(polygon['geometry']);
props.airLineForm.flyToFirstPointMode = polygonWkt;
console.log("props.airLineForm",props.airLineForm);
let spceing = parseFloat(polygonCalculateParams.value?.spacing) / 10000;
let lines = generateScanLines(polygon,spceing, 0);
@ -792,7 +909,11 @@ const handlerPolygonEdit = (e)=>{
let coordinates = e.graphic.toJSON().positions;
coordinates.push(coordinates[0]);
if(props.editMode == 'add'){
coordinates.push(coordinates[0]);
}
console.log("coordinates",coordinates);
polygonGeoJson.value = coordinates;
@ -859,14 +980,18 @@ const handlerDrawPolygonLine = (lines) => {
polygonGraphicLayer.addGraphic(graphic);
}
//
//
lines.geometry.coordinates.unshift([
polygonAirForm.value.startingPoint[0],
polygonAirForm.value.startingPoint[1],
polygonAirForm.value.startingPoint[2] + parseFloat(polygonCalculateParams.value.safeyFlyHeight),
]);
//
lines.geometry.coordinates.unshift(polygonAirForm.value.startingPoint);
if (polygonLineGraphicLayer) {
polygonLineGraphicLayer.clear();
polygonLineGraphicLayer.loadGeoJSON(lines);
@ -881,6 +1006,7 @@ const handlerDrawPolygonLine = (lines) => {
width: 2.0,
color: '#0aed8b',
// clampToGround: true,
extrudedHeight: 100, //
},
},
flyTo: true,
@ -1062,7 +1188,7 @@ const handlerRemovePolygonArea = () => {
polygonLineGraphicLayer.clear();
}
labelGraphicLayer ? labelGraphicLayer.clear() : null;
textLabelGraphicLayer ? textLabelGraphicLayer.clear() : null;
polygonGeoJson.value = null;
@ -1114,7 +1240,6 @@ const updatePolygonLineByParams = ()=>{
// 线
const polygonBorderInfo = ref([]);
let labelGraphicLayer:mars3d.layer.GraphicLayer;
//
const handlerGetPolygonBorderInfo = (polygonCoords) => {
@ -1139,22 +1264,22 @@ const handlerGetPolygonBorderInfo = (polygonCoords) => {
});
}
handlerLoadLabelGraphicLayer(edgeLengths);
handlerLoadtextLabelGraphicLayer(edgeLengths);
return edgeLengths;
}
//
const handlerLoadLabelGraphicLayer = (info) => {
const handlerLoadtextLabelGraphicLayer = (info) => {
if(labelGraphicLayer == null){
labelGraphicLayer = new mars3d.layer.GraphicLayer({
if(textLabelGraphicLayer == null){
textLabelGraphicLayer = new mars3d.layer.GraphicLayer({
isAutoEditing:false
})
map.addLayer(labelGraphicLayer);
map.addLayer(textLabelGraphicLayer);
}else{
labelGraphicLayer.clear();
textLabelGraphicLayer.clear();
}
info?.forEach((item,index)=>{
const graphic = new mars3d.graphic.LabelEntity({
position: [item.center[0], item.center[1], 0],
@ -1174,7 +1299,7 @@ const handlerLoadLabelGraphicLayer = (info) => {
},
attr: { remark: "示例1" }
})
labelGraphicLayer.addGraphic(graphic)
textLabelGraphicLayer.addGraphic(graphic)
})
}
@ -1185,7 +1310,7 @@ const handlerEditPolygonAirLine =async () => {
polygonAirForm.value.startingPoint = [props.airLineForm.taskOffLng,props.airLineForm.taskOffLat];
//
drawGraphicLayer ? drawGraphicLayer.clear() : null;
takeOffPointGraphicLayer ? takeOffPointGraphicLayer.clear() : null;
let startFlyGraphic = new mars3d.graphic.BillboardEntity({
position:[props.airLineForm.taskOffLng,props.airLineForm.taskOffLat],
style: {
@ -1203,9 +1328,43 @@ const handlerEditPolygonAirLine =async () => {
clampToGround: true,
},
})
drawGraphicLayer.addGraphic(startFlyGraphic);
takeOffPointGraphicLayer.addGraphic(startFlyGraphic);
startPosition.value = [props.airLineForm.taskOffLng,props.airLineForm.taskOffLat,71]
//
let areaJson = WktToGeojson(props.airLineForm.flyToFirstPointMode)
polygonGeoJson.value = areaJson.coordinates[0];
let geojsonData = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": areaJson,
},
]
}
polygonGraphicLayer ? polygonGraphicLayer.clear() : null;
polygonGraphicLayer.loadGeoJSON(geojsonData,{
type: 'polygon',
flyTo:true,
style: {
color: '#408eff',
opacity: 0.3,
outline: true,
outlineColor: '#408eff',
outlineWidth: 3.0,
clampToGround: true,
},
})
//
handlerGetPolygonBorderInfo(areaJson.coordinates[0])
// 线
let placemark = props.waylineInfo?.Folder?.Placemark
@ -1235,11 +1394,6 @@ const handlerEditPolygonAirLine =async () => {
handlerDrawPolygonLine(line);
//
// 线
updatePolygonLineByParams();
}
///////////////////////////////线////////////////////////////////////////////
@ -1984,7 +2138,7 @@ const clearAllLayer = () => {
polygonLineGraphicLayer ? polygonLineGraphicLayer.clear() : null;
//
labelGraphicLayer ? labelGraphicLayer.clear() : null;
textLabelGraphicLayer ? textLabelGraphicLayer.clear() : null;
airPoints.value = [];
polygonGeoJson.value = null;

@ -29,7 +29,6 @@
<aircraft @checkAriLine="checkDronePort" @closeAirCraft="closeAirCraft" ></aircraft>
</div>
<!-- 航线计算 -->
</div>

Loading…
Cancel
Save