From 60befc3362db1b5b3094ec77c2ff4af35d951665 Mon Sep 17 00:00:00 2001 From: huanghao1412 Date: Sat, 17 Aug 2024 11:07:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A2=9E=E5=8A=A0=E7=9B=B8=E5=AF=B9?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 4 ++-- src/store/modules/chartEditStore/chartEditStore.d.ts | 2 +- .../ContentConfigurations/components/ChartEvent/index.vue | 7 +++++-- src/views/preview/hooks/useCustomEvent.hook.ts | 5 ++++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.env b/.env index cad75cf2..49ac8784 100644 --- a/.env +++ b/.env @@ -3,9 +3,9 @@ VITE_DEV_PORT = '8080' # development path # VITE_DEV_PATH = 'http://192.168.0.34:11887' -VITE_DEV_PATH = 'http://192.168.0.34:8102/' +VITE_DEV_PATH = 'http://114.115.222.135:9015/' # VITE_DEV_PATH = 'http://192.168.0.120:3001' -VITE_DEV_TOKEN = '09c7cb6a-ab85-4c92-ad0f-5a25d72d71f7' +VITE_DEV_TOKEN = 'a170d26c-477f-4b17-a344-997a20d3bab0' # production path VITE_PRO_PATH = 'http://192.168.0.235:8177' diff --git a/src/store/modules/chartEditStore/chartEditStore.d.ts b/src/store/modules/chartEditStore/chartEditStore.d.ts index 51144f33..b3e9e5df 100644 --- a/src/store/modules/chartEditStore/chartEditStore.d.ts +++ b/src/store/modules/chartEditStore/chartEditStore.d.ts @@ -395,7 +395,7 @@ export interface commonDataType { // customEvent事件 export interface CustomEventType { click: { - linkHead: 'http://' | 'https://' + linkHead: 'http://' | 'https://' | '/' link: string isBlank: boolean } diff --git a/src/views/chart/ContentConfigurations/components/ChartEvent/index.vue b/src/views/chart/ContentConfigurations/components/ChartEvent/index.vue index d437f042..18bb0c2c 100644 --- a/src/views/chart/ContentConfigurations/components/ChartEvent/index.vue +++ b/src/views/chart/ContentConfigurations/components/ChartEvent/index.vue @@ -69,21 +69,24 @@ const showModal = ref(false) // init() // }) -const linkHeadOptions = ['http://', 'https://'].map(_ => ({label: _, value: _})) +const linkHeadOptions = ['http://', 'https://', '/'].map(_ => ({label: _, value: _})) const finallyLink = computed(() => { return targetData.value.customEvent.click.linkHead + (targetData.value as any).customEvent.click.link }) const handleClick = () => { if(!finallyLink.value) return + let isRelativePath = targetData.value.customEvent.click.linkHead === '/' if(targetData.value.customEvent.click.isBlank) postMessageToParent({ type: 'windowOpen', url: finallyLink.value, - openNew: true + openNew: true, + isRelativePath }) else postMessageToParent({ type: 'windowOpen', url: finallyLink.value, + isRelativePath }) } diff --git a/src/views/preview/hooks/useCustomEvent.hook.ts b/src/views/preview/hooks/useCustomEvent.hook.ts index b31e38b2..4f8edcee 100644 --- a/src/views/preview/hooks/useCustomEvent.hook.ts +++ b/src/views/preview/hooks/useCustomEvent.hook.ts @@ -7,14 +7,17 @@ const bindEvent = (item:any) => { obj = { click: () => { if(!link) return + let isRelativePath = linkHead === '/' if(isBlank) postMessageToParent({ type: 'windowOpen', url: `${linkHead}${link}`, - openNew: true + openNew: true, + isRelativePath }) else postMessageToParent({ type: 'windowOpen', url: `${linkHead}${link}`, + isRelativePath }) } }