From f1a6cfb975648d665f82a9a4975a12b20dfef674 Mon Sep 17 00:00:00 2001 From: freshman-white <2514756131@qq.com> Date: Wed, 6 Sep 2023 17:56:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E8=88=AA=E7=BA=BF=E5=BA=93=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=92=8C=E8=8B=B1=E4=B8=93=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wayline.ts | 6 ++ src/assets/icons/line.svg | 1 + src/components/GMap.vue | 54 +++++++++++++--- src/components/MediaPanel.vue | 21 ++++-- src/components/common/sidebar.vue | 12 ++-- src/components/common/topbar.vue | 2 +- src/components/livestream-newOthers.vue | 4 +- src/components/task/CreatePlan.vue | 54 +++++++++------- src/components/task/TaskPanel.vue | 35 +++++----- src/pages/page-web/index.vue | 2 +- src/pages/page-web/projects/layer.vue | 10 +-- src/pages/page-web/projects/task.vue | 2 +- src/pages/page-web/projects/tsa.vue | 14 ++-- src/pages/page-web/projects/wayline.vue | 86 +++++++++++++++++++++---- src/store/index.ts | 9 +++ src/types/task.ts | 10 +-- 16 files changed, 226 insertions(+), 96 deletions(-) create mode 100644 src/assets/icons/line.svg diff --git a/src/api/wayline.ts b/src/api/wayline.ts index a917804..474e413 100644 --- a/src/api/wayline.ts +++ b/src/api/wayline.ts @@ -135,3 +135,9 @@ export const uploadMediaFileNow = async function (workspaceId: string, jobId: st const result = await request.post(url) return result.data } +// 获取指定航线 +export const getNevigationLine = async function (workspaceId: string, id: any): Promise> { + const url = `${HTTP_PREFIX}/workspaces/${workspaceId}/waylines/get/${id}` + const result = await request.get(url) + return result.data +} diff --git a/src/assets/icons/line.svg b/src/assets/icons/line.svg new file mode 100644 index 0000000..c06947d --- /dev/null +++ b/src/assets/icons/line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/GMap.vue b/src/components/GMap.vue index 762993f..03f5be0 100644 --- a/src/components/GMap.vue +++ b/src/components/GMap.vue @@ -20,6 +20,15 @@ + +
+
+
航线长度
{{(nevigationInformation.line_length/1).toFixed(0)}}m
+
预计执行时间
{{getTime(nevigationInformation.scheduled_time)}}
+
航点
{{nevigationInformation.geometry_point_size}}
+ +
+
@@ -556,7 +565,12 @@ export default defineComponent({ const osdVisible = computed(() => { return store.state.osdVisible }) - + const nevigationVisible = computed(() => { + return store.state.nevigationVisible + }) + const nevigationInformation = computed(() => { + return store.state.nevigationInformation + }) watch(() => store.state.deviceStatusEvent, data => { if (Object.keys(data.deviceOnline).length !== 0) { @@ -663,9 +677,9 @@ export default defineComponent({ function play () { // routeName.value = 'LiveOthers' showLive.value = !showLive.value - nextTick(() => { - showLive.value ? liveStreamRef.value.onStart() : liveStreamRef.value.onStop() - }) + if (!showLive.value) { + liveStreamRef.value.onStop() + } } // dock 控制面板 @@ -721,6 +735,7 @@ export default defineComponent({ // console.log(store.state.coverList) } async function postPolygonResource (obj) { + console.log(obj, 'hafhhaf') const req = getPoygonResource(obj) setLayers(req) updateCoordinates('gcj02-wgs84', req) @@ -839,7 +854,13 @@ export default defineComponent({ } } } - + function getTime (data:any) { + if (data >= 60) { + return `${(data / 60).toFixed()}m${(data % 60).toFixed()}s` + } else { + return `${data.toFixed()}s` + } + } return { draw, play, @@ -848,7 +869,10 @@ export default defineComponent({ // routeName, mouseMode, drawVisible, + nevigationInformation, + nevigationVisible, osdVisible, + getTime, pin, state, M30, @@ -874,7 +898,21 @@ export default defineComponent({ .g-map-wrapper { height: 100%; width: 100%; - + .g-nevigation{ + position: absolute; + bottom: 60px; + width: 100%; + .nevigation-content{ + display:flex; + justify-content: center; + color:#666; + font-weight: 500; + font-size:26px; + &>div{ + padding-right: 20px; + } + } + } .g-action-panel { position: absolute; top: 16px; @@ -911,10 +949,10 @@ export default defineComponent({ left: 10px; top: 10px; width: 480px; - /* background: #000; */ + background: #000; color: #fff; border-radius: 2px; - /* opacity: 0.8; */ + // opacity: 0.8; .content-padding{ padding:16px; .video-btn{ diff --git a/src/components/MediaPanel.vue b/src/components/MediaPanel.vue index 7a575f1..4496bdd 100644 --- a/src/components/MediaPanel.vue +++ b/src/components/MediaPanel.vue @@ -1,5 +1,5 @@