From 29384a37445c5d68ddf494b0a03d540cc7e6fbfa 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: Sat, 12 Nov 2022 15:37:41 +0800 Subject: [PATCH 1/8] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E9=83=A8=E5=88=86?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E9=85=8D=E7=BD=AE=E7=BC=BA=E5=A4=B1?= =?UTF-8?q?=E6=B7=B1=E6=8B=B7=E8=B4=9D=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/packages/components/Charts/Lines/LineCommon/config.ts | 3 ++- .../components/Charts/Lines/LineGradientSingle/config.ts | 3 ++- src/packages/components/Charts/Lines/LineGradients/config.ts | 3 ++- .../components/Charts/Lines/LineLinearSingle/config.ts | 3 ++- src/packages/components/Charts/Maps/MapBase/config.ts | 3 ++- src/packages/components/Charts/Pies/PieCircle/config.ts | 3 ++- src/packages/components/Charts/Pies/PieCommon/config.ts | 3 ++- 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/packages/components/Charts/Lines/LineCommon/config.ts b/src/packages/components/Charts/Lines/LineCommon/config.ts index 5b275ba0..917a5064 100644 --- a/src/packages/components/Charts/Lines/LineCommon/config.ts +++ b/src/packages/components/Charts/Lines/LineCommon/config.ts @@ -2,6 +2,7 @@ import { echartOptionProfixHandle, PublicConfigClass } from '@/packages/public' import { LineCommonConfig } from './index' import { CreateComponentType } from '@/packages/index.d' import { defaultTheme, chartColorsSearch } from '@/settings/chartThemes/index' +import cloneDeep from 'lodash/cloneDeep' import dataJson from './data.json' export const includes = ['legend', 'xAxis', 'yAxis', 'grid'] @@ -47,7 +48,7 @@ export const option = { export default class Config extends PublicConfigClass implements CreateComponentType { public key: string = LineCommonConfig.key - public chartConfig = LineCommonConfig + public chartConfig = cloneDeep(LineCommonConfig) // 图表配置项 public option = echartOptionProfixHandle(option, includes) } diff --git a/src/packages/components/Charts/Lines/LineGradientSingle/config.ts b/src/packages/components/Charts/Lines/LineGradientSingle/config.ts index dea1397a..592b704d 100644 --- a/src/packages/components/Charts/Lines/LineGradientSingle/config.ts +++ b/src/packages/components/Charts/Lines/LineGradientSingle/config.ts @@ -3,6 +3,7 @@ import { LineGradientSingleConfig } from './index' import { CreateComponentType } from '@/packages/index.d' import { graphic } from 'echarts/core' import { defaultTheme, chartColorsSearch } from '@/settings/chartThemes/index' +import cloneDeep from 'lodash/cloneDeep' import dataJson from './data.json' export const includes = ['legend', 'xAxis', 'yAxis', 'grid'] @@ -58,7 +59,7 @@ const options = { export default class Config extends PublicConfigClass implements CreateComponentType { public key: string = LineGradientSingleConfig.key - public chartConfig = LineGradientSingleConfig + public chartConfig = cloneDeep(LineGradientSingleConfig) // 图表配置项 public option = echartOptionProfixHandle(options, includes) } diff --git a/src/packages/components/Charts/Lines/LineGradients/config.ts b/src/packages/components/Charts/Lines/LineGradients/config.ts index 2037ce5f..d470bab5 100644 --- a/src/packages/components/Charts/Lines/LineGradients/config.ts +++ b/src/packages/components/Charts/Lines/LineGradients/config.ts @@ -3,6 +3,7 @@ import { LineGradientsConfig } from './index' import { CreateComponentType } from '@/packages/index.d' import { graphic } from 'echarts/core' import { defaultTheme, chartColorsSearch } from '@/settings/chartThemes/index' +import cloneDeep from 'lodash/cloneDeep' import dataJson from './data.json' export const includes = ['legend', 'xAxis', 'yAxis', 'grid'] @@ -85,7 +86,7 @@ const option = { export default class Config extends PublicConfigClass implements CreateComponentType { public key: string = LineGradientsConfig.key - public chartConfig = LineGradientsConfig + public chartConfig = cloneDeep(LineGradientsConfig) // 图表配置项 public option = echartOptionProfixHandle(option, includes) } diff --git a/src/packages/components/Charts/Lines/LineLinearSingle/config.ts b/src/packages/components/Charts/Lines/LineLinearSingle/config.ts index fbeb875f..abcb2a31 100644 --- a/src/packages/components/Charts/Lines/LineLinearSingle/config.ts +++ b/src/packages/components/Charts/Lines/LineLinearSingle/config.ts @@ -2,6 +2,7 @@ import { echartOptionProfixHandle, PublicConfigClass } from '@/packages/public' import { LineLinearSingleConfig } from './index' import { CreateComponentType } from '@/packages/index.d' import { defaultTheme, chartColorsSearch } from '@/settings/chartThemes/index' +import cloneDeep from 'lodash/cloneDeep' import dataJson from './data.json' export const includes = ['legend', 'xAxis', 'yAxis', 'grid'] @@ -54,7 +55,7 @@ export const option = { export default class Config extends PublicConfigClass implements CreateComponentType { public key: string = LineLinearSingleConfig.key - public chartConfig = LineLinearSingleConfig + public chartConfig = cloneDeep(LineLinearSingleConfig) // 图表配置项 public option = echartOptionProfixHandle(option, includes) } diff --git a/src/packages/components/Charts/Maps/MapBase/config.ts b/src/packages/components/Charts/Maps/MapBase/config.ts index 36663256..888fe6b7 100644 --- a/src/packages/components/Charts/Maps/MapBase/config.ts +++ b/src/packages/components/Charts/Maps/MapBase/config.ts @@ -2,6 +2,7 @@ import { echartOptionProfixHandle, PublicConfigClass } from '@/packages/public' import { MapBaseConfig } from './index' import { chartInitConfig } from '@/settings/designSetting' import { CreateComponentType } from '@/packages/index.d' +import cloneDeep from 'lodash/cloneDeep' import dataJson from './data.json' export const includes = [] @@ -151,6 +152,6 @@ export const MapDefaultConfig = { ...option } export default class Config extends PublicConfigClass implements CreateComponentType { public key: string = MapBaseConfig.key public attr = { ...chartInitConfig, w: 750, h: 800, zIndex: -1 } - public chartConfig = MapBaseConfig + public chartConfig = cloneDeep(MapBaseConfig) public option = echartOptionProfixHandle(option, includes) } diff --git a/src/packages/components/Charts/Pies/PieCircle/config.ts b/src/packages/components/Charts/Pies/PieCircle/config.ts index 15954a3d..cbee4975 100644 --- a/src/packages/components/Charts/Pies/PieCircle/config.ts +++ b/src/packages/components/Charts/Pies/PieCircle/config.ts @@ -1,6 +1,7 @@ import { echartOptionProfixHandle, PublicConfigClass } from '@/packages/public' import { PieCircleConfig } from './index' import { CreateComponentType } from '@/packages/index.d' +import cloneDeep from 'lodash/cloneDeep' export const includes = [] @@ -57,7 +58,7 @@ const option = { export default class Config extends PublicConfigClass implements CreateComponentType { public key: string = PieCircleConfig.key - public chartConfig = PieCircleConfig + public chartConfig = cloneDeep(PieCircleConfig) // 图表配置项 public option = echartOptionProfixHandle(option, includes) diff --git a/src/packages/components/Charts/Pies/PieCommon/config.ts b/src/packages/components/Charts/Pies/PieCommon/config.ts index 1af07f40..068450b6 100644 --- a/src/packages/components/Charts/Pies/PieCommon/config.ts +++ b/src/packages/components/Charts/Pies/PieCommon/config.ts @@ -1,6 +1,7 @@ import { echartOptionProfixHandle, PublicConfigClass } from '@/packages/public' import { PieCommonConfig } from './index' import { CreateComponentType } from '@/packages/index.d' +import cloneDeep from 'lodash/cloneDeep' import dataJson from './data.json' export const includes = ['legend'] @@ -61,7 +62,7 @@ const option = { export default class Config extends PublicConfigClass implements CreateComponentType { public key: string = PieCommonConfig.key - public chartConfig = PieCommonConfig + public chartConfig = cloneDeep(PieCommonConfig) // 图表配置项 public option = echartOptionProfixHandle(option, includes) From 1bd67a6ea7a9a2b62660fabbd00de04b2b974ccb 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: Sat, 12 Nov 2022 16:10:14 +0800 Subject: [PATCH 2/8] =?UTF-8?q?chore:=20=E8=BD=AC=E7=A7=BBmaster-fetch?= =?UTF-8?q?=E5=88=86=E6=94=AF=E8=8E=B7=E5=8F=96id=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E5=88=B0dev=E5=88=86=E6=94=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/router.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/utils/router.ts b/src/utils/router.ts index f2bf6142..f2a9c696 100644 --- a/src/utils/router.ts +++ b/src/utils/router.ts @@ -153,6 +153,19 @@ export const fetchRouteParams = () => { } } +/** + * * 通过硬解析获取当前路由下的参数 + * @returns object + */ + export const fetchRouteParamsLocation = () => { + try { + return document.location.hash.split('/').pop() || '' + } catch (error) { + window['$message'].warning('查询路由信息失败,请联系管理员!') + return '' + } +} + /** * * 回到主页面 * @param confirm From 2f2d87826cb9fa25289ceedde5e4ee4c95a5e734 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: Sat, 12 Nov 2022 16:16:03 +0800 Subject: [PATCH 3/8] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E8=8E=B7?= =?UTF-8?q?=E5=8F=96id=20=E7=9A=84=E6=97=A7=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/chart/ContentEdit/components/EditTools/index.vue | 5 ++--- src/views/chart/ContentHeader/headerTitle/index.vue | 6 ++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/views/chart/ContentEdit/components/EditTools/index.vue b/src/views/chart/ContentEdit/components/EditTools/index.vue index 9c5627ea..4bb39d79 100644 --- a/src/views/chart/ContentEdit/components/EditTools/index.vue +++ b/src/views/chart/ContentEdit/components/EditTools/index.vue @@ -66,7 +66,7 @@ import { ref, computed, h, watch } from 'vue' import { useSettingStore } from '@/store/modules/settingStore/settingStore' import { ToolsStatusEnum } from '@/store/modules/settingStore/settingStore.d' import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' -import { fetchPathByName, routerTurnByPath, setSessionStorage, getLocalStorage } from '@/utils' +import { fetchRouteParamsLocation, fetchPathByName, routerTurnByPath, setSessionStorage, getLocalStorage } from '@/utils' import { editToJsonInterval } from '@/settings/designSetting' import { EditEnum, ChartEnum } from '@/enums/pageEnum' import { StorageEnum } from '@/enums/storageEnum' @@ -143,8 +143,7 @@ const editHandle = () => { // 获取id路径 const path = fetchPathByName(EditEnum.CHART_EDIT_NAME, 'href') if (!path) return - let { id } = routerParamsInfo.params as any - id = typeof id === 'string' ? id : id[0] + const id = fetchRouteParamsLocation() updateToSession(id) routerTurnByPath(path, [id], undefined, true) }, 1000) diff --git a/src/views/chart/ContentHeader/headerTitle/index.vue b/src/views/chart/ContentHeader/headerTitle/index.vue index 5ac70dc8..6d0d4eae 100644 --- a/src/views/chart/ContentHeader/headerTitle/index.vue +++ b/src/views/chart/ContentHeader/headerTitle/index.vue @@ -30,7 +30,7 @@ diff --git a/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartEventBaseHandle/index.ts b/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartEventBaseHandle/index.ts new file mode 100644 index 00000000..d45f2f12 --- /dev/null +++ b/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartEventBaseHandle/index.ts @@ -0,0 +1,3 @@ +import ChartEventBaseHandle from './index.vue' + +export { ChartEventBaseHandle } diff --git a/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartEventBaseHandle/index.vue b/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartEventBaseHandle/index.vue new file mode 100644 index 00000000..bfe0157f --- /dev/null +++ b/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartEventBaseHandle/index.vue @@ -0,0 +1,214 @@ + + + + + diff --git a/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartEventMonacoEditor/index.ts b/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartEventMonacoEditor/index.ts deleted file mode 100644 index b6d23e30..00000000 --- a/src/views/chart/ContentConfigurations/components/ChartEvent/components/ChartEventMonacoEditor/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import ChartEventMonacoEditor from './index.vue' - -export { ChartEventMonacoEditor } diff --git a/src/views/chart/ContentConfigurations/components/ChartEvent/components/index.scss b/src/views/chart/ContentConfigurations/components/ChartEvent/components/index.scss new file mode 100644 index 00000000..8cd67cf8 --- /dev/null +++ b/src/views/chart/ContentConfigurations/components/ChartEvent/components/index.scss @@ -0,0 +1,51 @@ +/* 外层也要使用 */ +.func-keyword { + color: #b478cf; +} + +.func-annotate { + color: #70c0e8; +} + +@include go('chart-data-monaco-editor') { + .func-keyNameWord { + color: #70c0e8; + } + .tab-tip { + font-size: 12px; + } + &.n-card.n-modal, + .n-card { + @extend .go-background-filter; + } +} +@include deep() { + .n-layout, + .n-layout-sider { + background-color: transparent; + } + .collapse-show-box { + .n-card__content { + padding-left: 20px; + padding-right: 10px; + } + } + .go-editor-area { + max-height: 530px; + } + .checkbox--hidden:checked { + & + label { + .n-icon { + transition: all 0.3s; + transform: rotate(180deg); + } + } + & ~ .go-editor-area { + display: none; + } + } + // 优化代码换行 + .n-code > pre { + white-space: break-spaces; + } +} diff --git a/src/views/chart/ContentConfigurations/components/ChartEvent/index.vue b/src/views/chart/ContentConfigurations/components/ChartEvent/index.vue index a5335f5e..05e5ce4d 100644 --- a/src/views/chart/ContentConfigurations/components/ChartEvent/index.vue +++ b/src/views/chart/ContentConfigurations/components/ChartEvent/index.vue @@ -5,20 +5,15 @@ 组件 id: {{ targetData.id }} - -
- 【单击、双击、移入、移出】在开发中,即将上线! -
- (备注:高级事件模块可自行实现上述功能) -
-
- + +