From 4141d004093e69ca7d5c4efe28c16b53d660c357 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, 17 Sep 2022 22:40:24 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E6=A0=8F=E5=B1=95=E7=A4=BA=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/GoSystemSet/index.vue | 7 ++ src/settings/systemSetting.ts | 4 +- .../modules/settingStore/settingStore.d.ts | 9 ++ .../modules/settingStore/settingStore.ts | 5 +- .../components/EditTools/index.vue | 102 +++++++++++------- 5 files changed, 85 insertions(+), 42 deletions(-) diff --git a/src/components/GoSystemSet/index.vue b/src/components/GoSystemSet/index.vue index 68cc8061..282fe84a 100644 --- a/src/components/GoSystemSet/index.vue +++ b/src/components/GoSystemSet/index.vue @@ -115,6 +115,13 @@ const list = reactive([ desc: '', value: '' }, + { + key: SettingStoreEnums.CHART_TOOLS_STATUS_HIDE, + value: settingStore.getChartToolsStatusHide, + type: 'switch', + name: '隐藏工具栏', + desc: '鼠标移入时,会展示切换到展开模式', + }, { key: SettingStoreEnums.CHART_TOOLS_STATUS, value: settingStore.getChartToolsStatus, diff --git a/src/settings/systemSetting.ts b/src/settings/systemSetting.ts index 65ccc4b2..84eb65d9 100644 --- a/src/settings/systemSetting.ts +++ b/src/settings/systemSetting.ts @@ -13,5 +13,7 @@ export const systemSetting = { // 图表拖拽时的吸附距离(px) [SettingStoreEnums.CHART_ALIGN_RANGE]: 10, // 图表工具栏状态(侧边工具状态) - [SettingStoreEnums.CHART_TOOLS_STATUS]: ToolsStatusEnum.ASIDE + [SettingStoreEnums.CHART_TOOLS_STATUS]: ToolsStatusEnum.ASIDE, + // 图表工具栏状态隐藏(刚开始不隐藏) + [SettingStoreEnums.CHART_TOOLS_STATUS_HIDE]: false, } \ No newline at end of file diff --git a/src/store/modules/settingStore/settingStore.d.ts b/src/store/modules/settingStore/settingStore.d.ts index 5da4dfe6..09ba684f 100644 --- a/src/store/modules/settingStore/settingStore.d.ts +++ b/src/store/modules/settingStore/settingStore.d.ts @@ -4,12 +4,20 @@ export enum ToolsStatusEnum { } export enum SettingStoreEnums { + // 拖拽页面左侧表单分类只有一项的时候是否隐藏 HIDE_PACKAGE_ONE_CATEGORY = 'hidePackageOneCategory', + // 切换语言是否进行路由刷新 CHANGE_LANG_RELOAD = 'changeLangReload', + // 侧边栏折叠是否隐藏全部 ASIDE_ALL_COLLAPSED = 'asideAllCollapsed', + // 图表移动时按方向键移动的距离 CHART_MOVE_DISTANCE = 'chartMoveDistance', + // 图表拖拽时的吸附距离(px) CHART_ALIGN_RANGE = 'chartAlignRange', + // 图表工具栏状态(侧边工具状态) CHART_TOOLS_STATUS = 'chartToolsStatus', + // 图表工具栏状态隐藏 + CHART_TOOLS_STATUS_HIDE = 'chartToolsStatusHide' } export interface SettingStoreType { @@ -19,4 +27,5 @@ export interface SettingStoreType { [SettingStoreEnums.CHART_MOVE_DISTANCE]: number [SettingStoreEnums.CHART_ALIGN_RANGE]: number [SettingStoreEnums.CHART_TOOLS_STATUS]: ToolsStatusEnum + [SettingStoreEnums.CHART_TOOLS_STATUS_HIDE]: boolean } diff --git a/src/store/modules/settingStore/settingStore.ts b/src/store/modules/settingStore/settingStore.ts index 775cd132..4a90f7ae 100644 --- a/src/store/modules/settingStore/settingStore.ts +++ b/src/store/modules/settingStore/settingStore.ts @@ -35,7 +35,10 @@ export const useSettingStore = defineStore({ }, getChartToolsStatus(): ToolsStatusEnum { return this.chartToolsStatus - } + }, + getChartToolsStatusHide(): boolean { + return this.chartToolsStatusHide + }, }, actions: { setItem( diff --git a/src/views/chart/ContentEdit/components/EditTools/index.vue b/src/views/chart/ContentEdit/components/EditTools/index.vue index d824aabd..80c96308 100644 --- a/src/views/chart/ContentEdit/components/EditTools/index.vue +++ b/src/views/chart/ContentEdit/components/EditTools/index.vue @@ -1,38 +1,26 @@