From 2e9e972826fa88e68201f0ef5a4704b6119106b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E5=AD=94=E6=B3=89?= Date: Thu, 9 Mar 2023 10:38:57 +0800 Subject: [PATCH 01/27] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0query=E5=8F=82=E6=95=B0=E7=9A=84=E6=97=B6=E5=80=99ID?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=BC=82=E5=B8=B8=EF=BC=8C=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E5=89=8D=E7=BD=AE=E5=AE=88=E5=8D=AB=E6=8A=8A=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E5=8F=82=E6=95=B0=E6=94=BE=E5=85=A5window.ro?= =?UTF-8?q?ute.params=EF=BC=8C=E5=90=8E=E7=BB=ADAPI=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=8F=AF=E4=BB=A5=E6=8B=BC=E6=8E=A5=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit http://localhost:3000/#/chart/preview/792622755697790976?t=123 动态请求参数中使用javascript: return window.route?.params?.t --- src/router/router-guards.ts | 7 +++++++ src/utils/router.ts | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/router/router-guards.ts b/src/router/router-guards.ts index aedb0667..7d2a885d 100644 --- a/src/router/router-guards.ts +++ b/src/router/router-guards.ts @@ -5,6 +5,13 @@ import { loginCheck } from '@/utils' export function createRouterGuards(router: Router) { // 前置 router.beforeEach(async (to, from, next) => { + // http://localhost:3000/#/chart/preview/792622755697790976?t=123 + // 把外部动态参数放入window.route.params,后续API动态接口可以用window.route?.params?.t来拼接参数 + // @ts-ignore + if (!window.route) window.route = {params: {}} + // @ts-ignore + Object.assign(window.route.params, to.query) + const Loading = window['$loading']; Loading && Loading.start(); const isErrorPage = router.getRoutes().findIndex((item) => item.name === to.name); diff --git a/src/utils/router.ts b/src/utils/router.ts index f2a9c696..ea17d78a 100644 --- a/src/utils/router.ts +++ b/src/utils/router.ts @@ -159,7 +159,8 @@ export const fetchRouteParams = () => { */ export const fetchRouteParamsLocation = () => { try { - return document.location.hash.split('/').pop() || '' + // 防止添加query参数的时候,解析ID异常 + return document.location.hash.split('?')[0].split('/').pop() || '' } catch (error) { window['$message'].warning('查询路由信息失败,请联系管理员!') return '' @@ -190,4 +191,4 @@ export const loginCheck = () => { } catch (error) { return false } -} \ No newline at end of file +} \ No newline at end of file From 93350f0f6a4e1d9ff8288c1b13c9f09dbb46cd54 Mon Sep 17 00:00:00 2001 From: xiangmaoshuo <544437819@qq.com> Date: Thu, 9 Mar 2023 18:26:50 +0800 Subject: [PATCH 02/27] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E6=97=B6=E6=A8=A1=E7=B3=8A=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EchartsRendererSetting.vue | 45 +++++++++++++++++++ .../Pages/ChartItemSetting/GlobalSetting.vue | 41 +++++++++++++++++ src/hooks/useCanvasInitOptions.hook.ts | 26 +++++++++++ .../Charts/Bars/BarCommon/index.vue | 4 ++ .../Charts/Bars/BarCrossrange/index.vue | 4 ++ .../Charts/Lines/LineCommon/index.vue | 4 ++ .../Charts/Lines/LineGradientSingle/index.vue | 5 ++- .../Charts/Lines/LineGradients/index.vue | 5 ++- .../Charts/Lines/LineLinearSingle/index.vue | 5 ++- .../components/Charts/Maps/MapBase/index.vue | 5 ++- .../components/Charts/Mores/Funnel/index.vue | 5 ++- .../components/Charts/Mores/Heatmap/index.vue | 5 ++- .../components/Charts/Mores/Radar/index.vue | 5 ++- .../components/Charts/Mores/TreeMap/index.vue | 5 ++- .../Charts/Mores/WaterPolo/index.vue | 5 ++- .../Charts/Pies/PieCircle/index.vue | 5 ++- .../Charts/Pies/PieCommon/index.vue | 5 ++- .../Charts/Scatters/ScatterCommon/index.vue | 4 ++ .../ScatterLogarithmicRegression/index.vue | 4 ++ .../Informations/Mores/WordCloud/config.vue | 3 +- .../Informations/Mores/WordCloud/index.vue | 4 ++ src/settings/chartThemes/index.ts | 5 ++- src/views/preview/hooks/useScale.hook.ts | 18 +++++++- 23 files changed, 202 insertions(+), 15 deletions(-) create mode 100644 src/components/Pages/ChartItemSetting/EchartsRendererSetting.vue create mode 100644 src/hooks/useCanvasInitOptions.hook.ts diff --git a/src/components/Pages/ChartItemSetting/EchartsRendererSetting.vue b/src/components/Pages/ChartItemSetting/EchartsRendererSetting.vue new file mode 100644 index 00000000..f7624fef --- /dev/null +++ b/src/components/Pages/ChartItemSetting/EchartsRendererSetting.vue @@ -0,0 +1,45 @@ + + diff --git a/src/components/Pages/ChartItemSetting/GlobalSetting.vue b/src/components/Pages/ChartItemSetting/GlobalSetting.vue index 35a74235..a416e69c 100644 --- a/src/components/Pages/ChartItemSetting/GlobalSetting.vue +++ b/src/components/Pages/ChartItemSetting/GlobalSetting.vue @@ -1,4 +1,34 @@