接入全景数字地图
Showing
4 changed files
with
96 additions
and
2 deletions
| ... | @@ -178,6 +178,28 @@ const routes: RouteRecordRaw[] = [ | ... | @@ -178,6 +178,28 @@ const routes: RouteRecordRaw[] = [ |
| 178 | } | 178 | } |
| 179 | ] | 179 | ] |
| 180 | }, | 180 | }, |
| 181 | { | ||
| 182 | path: '/data-meta/portraitMap', | ||
| 183 | component: Layout, | ||
| 184 | meta: { | ||
| 185 | title: '全景地图', | ||
| 186 | icon: 'sidebar-videos', | ||
| 187 | }, | ||
| 188 | children: [ | ||
| 189 | { | ||
| 190 | path: '', | ||
| 191 | name: 'portraitMap', | ||
| 192 | component: () => import('@/views/data_meta/portraitMap.vue'), | ||
| 193 | meta: { | ||
| 194 | title: '全景地图', | ||
| 195 | sidebar: false, | ||
| 196 | breadcrumb: false, | ||
| 197 | cache: true, | ||
| 198 | reuse: true | ||
| 199 | }, | ||
| 200 | } | ||
| 201 | ] | ||
| 202 | } | ||
| 181 | ] | 203 | ] |
| 182 | 204 | ||
| 183 | export default routes | 205 | export default routes | ... | ... |
| ... | @@ -177,6 +177,9 @@ const useMenuStore = defineStore( | ... | @@ -177,6 +177,9 @@ const useMenuStore = defineStore( |
| 177 | if ((data== "/data-meta/reports/iframePage" || data== "/data-meta/report/budgetDataIndex") && r.path?.includes('/data-meta/report')) { | 177 | if ((data== "/data-meta/reports/iframePage" || data== "/data-meta/report/budgetDataIndex") && r.path?.includes('/data-meta/report')) { |
| 178 | return true; | 178 | return true; |
| 179 | } | 179 | } |
| 180 | if (data== "/data-meta/portraitMap" && r.path?.includes('/data-meta/portraitMap')) { | ||
| 181 | return true; | ||
| 182 | } | ||
| 180 | if (data.indexOf(`${r.path}/`) === 0 || data === r.path) { | 183 | if (data.indexOf(`${r.path}/`) === 0 || data === r.path) { |
| 181 | return true; | 184 | return true; |
| 182 | } | 185 | } | ... | ... |
| ... | @@ -157,9 +157,9 @@ const useRouteStore = defineStore( | ... | @@ -157,9 +157,9 @@ const useRouteStore = defineStore( |
| 157 | }; | 157 | }; |
| 158 | } | 158 | } |
| 159 | r = routes.find((route: any) => { | 159 | r = routes.find((route: any) => { |
| 160 | return route.path === path || route.path === m.path || `/${route.path}` === m.path || ((path.includes('budgetDataIndex') && path.includes('/data-meta/report') && route.path.includes('/data-meta/report')) || (path.includes('iframePage') && path.includes('/data-meta/report'))); | 160 | return route.path === path || route.path === m.path || `/${route.path}` === m.path || ((path.includes('budgetDataIndex') && path.includes('/data-meta/report') && route.path.includes('/data-meta/report')) || (path.includes('iframePage') && path.includes('/data-meta/report')) || (path.includes('/data-meta/portraitMap') && route.path.includes('/data-meta/portraitMap'))); |
| 161 | }); | 161 | }); |
| 162 | if (r && (path.includes('budgetDataIndex') || path.includes('iframePage'))) { | 162 | if (r && (path.includes('budgetDataIndex') || path.includes('iframePage')) || path.includes('portraitMap')) { |
| 163 | r.path = path; | 163 | r.path = path; |
| 164 | } | 164 | } |
| 165 | if(r && m.icon && m.icon !== "{}") { | 165 | if(r && m.icon && m.icon !== "{}") { | ... | ... |
src/views/data_meta/portraitMap.vue
0 → 100644
| 1 | <route lang="yaml"> | ||
| 2 | # 组件名称 | ||
| 3 | name: "" | ||
| 4 | </route> | ||
| 5 | |||
| 6 | <template> | ||
| 7 | <div class="container_wrap" v-loading="loading"> | ||
| 8 | <iframe :src="link" frameborder="0" @load="iframeLoad"></iframe> | ||
| 9 | </div> | ||
| 10 | </template> | ||
| 11 | |||
| 12 | <script lang="ts" setup name="portraitMap"> | ||
| 13 | |||
| 14 | import { ref, reactive, computed } from "vue"; | ||
| 15 | |||
| 16 | import { JSEncrypt } from 'jsencrypt'; | ||
| 17 | import { useElementSize } from "@vueuse/core"; | ||
| 18 | import useUserStore from '@/store/modules/user' | ||
| 19 | const route = useRoute() | ||
| 20 | |||
| 21 | const encryptor = new JSEncrypt() | ||
| 22 | const publicKey = '-----BEGIN PUBLIC KEY-----MIGeMA0GCSqGSIb3DQEBAQUAA4GMADCBiAKBgFiv3Ko6rOBvWDK96tIExpdyuuQAGgZo0YmQxpT10hD3qu/MnNKlIJgo4+NwUHcwpleKE2DBOxgvCeMtUoP4FDWt8q18X+4+7t8p0D/57NhA0liNKQ/Ise6b5i293ht1XPen3XhR5xIcDNxauQ5vKqdwwzhoonsbJDtbowoinLQbAgMBAAE=-----END PUBLIC KEY-----'; | ||
| 23 | function encrypt(txt) { | ||
| 24 | encryptor.setPublicKey(publicKey) // 设置公钥 | ||
| 25 | return encryptor.encrypt(txt); // 对数据进行加密 | ||
| 26 | } | ||
| 27 | const userStore = useUserStore() | ||
| 28 | const userInfoData = JSON.parse(localStorage.userData) | ||
| 29 | // const url: any = 'https://scm.cs4pl.com/portraitBMap?fUrl=portraitMap'; | ||
| 30 | const url: any = 'http://localhost:8086/portraitBMap?fUrl=portraitBMap'; | ||
| 31 | |||
| 32 | const link = ref('') | ||
| 33 | const loading = ref(true); | ||
| 34 | const iframeLoad = () => { | ||
| 35 | loading.value = false; | ||
| 36 | } | ||
| 37 | |||
| 38 | // 搜索区域的schema | ||
| 39 | onBeforeMount(() => { | ||
| 40 | const loginInfo = JSON.stringify({ | ||
| 41 | username: '13575742649', | ||
| 42 | pwd: '990703', | ||
| 43 | timestamp: new Date().getTime() | ||
| 44 | }) | ||
| 45 | let linkValue = decodeURIComponent(url) + '&loginInfo=' + encodeURI(encrypt(loginInfo)); | ||
| 46 | link.value = linkValue; | ||
| 47 | }); | ||
| 48 | |||
| 49 | onActivated(() => { | ||
| 50 | let tab: any = userStore.tabbar.find((tab: any) => tab.fullPath === route.fullPath); | ||
| 51 | if (tab) { | ||
| 52 | tab.meta.title = route.query.title || '全景地图'; | ||
| 53 | } | ||
| 54 | }) | ||
| 55 | |||
| 56 | </script> | ||
| 57 | |||
| 58 | <style lang="scss" scoped> | ||
| 59 | .container_wrap { | ||
| 60 | width: 100%; | ||
| 61 | height: 100%; | ||
| 62 | padding: 0; | ||
| 63 | |||
| 64 | iframe { | ||
| 65 | width: 100%; | ||
| 66 | height: 100%; | ||
| 67 | } | ||
| 68 | } | ||
| 69 | </style> |
-
Please register or sign in to post a comment