From 88516d949154398b54b6e605bb19f413a66d3bc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=94=E8=B7=91=E7=9A=84=E9=9D=A2=E6=9D=A1?= <1262327911@qq.com> Date: Fri, 3 Jun 2022 18:53:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=E7=B2=98=E8=B4=B4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/router.ts | 15 ++++++-- .../ContentHeader/headerRightBtn/index.vue | 34 ++++++++----------- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/src/utils/router.ts b/src/utils/router.ts index a748830a..5a117357 100644 --- a/src/utils/router.ts +++ b/src/utils/router.ts @@ -1,6 +1,6 @@ import { useRoute } from 'vue-router' import { ResultEnum, RequestHttpHeaderEnum } from '@/enums/httpEnum' -import { ErrorPageNameMap, PageEnum } from '@/enums/pageEnum' +import { ErrorPageNameMap, PageEnum, PreviewEnum } from '@/enums/pageEnum' import { docPath, giteeSourceCodePath } from '@/settings/pathConst' import { SystemStoreEnum, SystemStoreUserInfoEnum } from '@/store/modules/systemStore/systemStore.d' import { StorageEnum } from '@/enums/storageEnum' @@ -199,4 +199,15 @@ export const loginCheck = () => { } catch (error) { return false } -} \ No newline at end of file +} + +/** + * * 预览地址 + * @returns + */ + export const previewPath = () => { + const { origin, pathname } = document.location + const path = fetchPathByName(PreviewEnum.CHART_PREVIEW_NAME, 'href') + const previewPath = `${origin}${pathname}${path}/${fetchRouteParamsLocation()}` + return previewPath +} \ No newline at end of file diff --git a/src/views/chart/ContentHeader/headerRightBtn/index.vue b/src/views/chart/ContentHeader/headerRightBtn/index.vue index ef56ac28..600c11e3 100644 --- a/src/views/chart/ContentHeader/headerRightBtn/index.vue +++ b/src/views/chart/ContentHeader/headerRightBtn/index.vue @@ -31,7 +31,7 @@ {{ previewPath() }} - + 复制地址 @@ -52,6 +52,7 @@