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 + ); + } +}