From 232aad600f0dd526e2716de90e3117447fba40c4 Mon Sep 17 00:00:00 2001 From: lihui_ocr Date: Tue, 9 Apr 2024 19:08:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E7=82=B9=E5=87=BB=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E5=88=9B=E5=BB=BA=E8=85=BE=E8=AE=AF=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E5=9D=90=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 1 + src/router/modules/map.ts | 44 +++++++++++++ src/views/map/index.vue | 92 ++++++++++++++++++++++++++++ src/views/task/content/Content.vue | 33 +++++++--- src/views/task/content/TaskTable.vue | 11 +++- 5 files changed, 171 insertions(+), 10 deletions(-) create mode 100644 src/router/modules/map.ts create mode 100644 src/views/map/index.vue diff --git a/index.html b/index.html index 5612d37..12ef035 100644 --- a/index.html +++ b/index.html @@ -119,5 +119,6 @@ + diff --git a/src/router/modules/map.ts b/src/router/modules/map.ts new file mode 100644 index 0000000..51dc66a --- /dev/null +++ b/src/router/modules/map.ts @@ -0,0 +1,44 @@ +import { Layout } from '@/router/constant' +import type { RouteRecordRaw } from 'vue-router' + +/** + * @param name 路由名称, 必须设置,且不能重名 + * @param meta 路由元信息(路由附带扩展信息) + * @param redirect 重定向地址, 访问这个路由时,自定进行重定向 + * @param meta.disabled 禁用整个菜单 + * @param meta.title 菜单名称 + * @param meta.icon 菜单图标 + * @param meta.keepAlive 缓存该路由 + * @param meta.sort 排序越小越排前 + * + */ +const routes: Array = [ + { + path: '/', + name: 'map', + redirect: '/map', + component: Layout, + meta: { + title: '地理位置', + permissions: ['task-main'], + svgname: 'task-approval', + svgsize: 22, + sort: 5, + disabled: true, + hidden: true, + }, + children: [ + { + path: 'map', + name: 'map-main', + meta: { + title: '地理位置', + }, + component: () => import('@/views/map/index.vue'), + }, + + ], + }, +] + +export default routes diff --git a/src/views/map/index.vue b/src/views/map/index.vue new file mode 100644 index 0000000..bd2b8ea --- /dev/null +++ b/src/views/map/index.vue @@ -0,0 +1,92 @@ + + + + + diff --git a/src/views/task/content/Content.vue b/src/views/task/content/Content.vue index d498a8f..68e2b55 100644 --- a/src/views/task/content/Content.vue +++ b/src/views/task/content/Content.vue @@ -271,17 +271,19 @@ async function getTableData() { "拜访小结", "拜访项目类别", ]; - + fieldList.map((v) => { if (userFieldList.includes(v.name)) { - let locationobj = {address:""} - if(v.name=='location'){ - locationobj=JSON.parse(taskDetailInfo.value.ocrPicture[v.name]); - - } + let locationobj = { address: "" }; + if (v.name == "location") { + locationobj = JSON.parse(taskDetailInfo.value.ocrPicture[v.name]); + } const item = { label: v.fieldDesc, - value: v.name=='location'?locationobj.address:taskDetailInfo.value.ocrPicture[v.name], + value: + v.name == "location" + ? locationobj.address + : taskDetailInfo.value.ocrPicture[v.name], key: v.name, blue: blueList.includes(v.fieldDesc), }; @@ -389,6 +391,22 @@ function goBack() { function switchBatch() { setBatch(!batch.value); } + +function getrowValue(e) { + if (e.key == "location") { + let locationobj = JSON.parse(taskDetailInfo.value.ocrPicture.location); + let lat = locationobj.lat.$numberDecimal; + let lng = locationobj.lng.$numberDecimal; + let name = e.value; + const protocol = window.location.protocol; + const hostname = window.location.hostname; + const port = window.location.port; + const hostWithPort = protocol + "//" + hostname + ":" + port + "/"; + window.open( + hostWithPort + "map" + "?name=" + name + "&lat=" + lat + "&lng=" + lng + ); + } +}