diff --git a/src/settings/designSetting.ts b/src/settings/designSetting.ts index f81db879..343e326a 100644 --- a/src/settings/designSetting.ts +++ b/src/settings/designSetting.ts @@ -38,4 +38,7 @@ export const carouselInterval = 4000 export const backgroundImageSize = 5 // 数据请求间隔 -export const requestInterval = 30 \ No newline at end of file +export const requestInterval = 30 + +// 工作区域历史记录存储最大数量 +export const editHistoryMax = 100 \ No newline at end of file diff --git a/src/settings/systemSetting.ts b/src/settings/systemSetting.ts index ac362868..65ccc4b2 100644 --- a/src/settings/systemSetting.ts +++ b/src/settings/systemSetting.ts @@ -1,6 +1,6 @@ import { SettingStoreEnums, ToolsStatusEnum } from '@/store/modules/settingStore/settingStore.d' -// * 系统全局设置 +// * 用户配置项 export const systemSetting = { // 侧边栏折叠是否隐藏全部 [SettingStoreEnums.ASIDE_ALL_COLLAPSED]: true, diff --git a/src/store/modules/chartHistoryStore/chartHistoryStore.ts b/src/store/modules/chartHistoryStore/chartHistoryStore.ts index 1355cd75..9d29fbbe 100644 --- a/src/store/modules/chartHistoryStore/chartHistoryStore.ts +++ b/src/store/modules/chartHistoryStore/chartHistoryStore.ts @@ -2,6 +2,7 @@ import { defineStore } from 'pinia' import { CreateComponentType } from '@/packages/index.d' import { EditCanvasType } from '@/store/modules/chartEditStore/chartEditStore.d' import { loadingStart, loadingFinish, loadingError } from '@/utils' +import { editHistoryMax } from '@/settings/designSetting' import { HistoryStackItemEnum, HistoryActionTypeEnum, @@ -61,7 +62,7 @@ export const useChartHistoryStore = defineStore({ ): void { if (item instanceof Array) this.backStack = [...this.backStack, ...item] else this.backStack.push(item) - this.backStack.splice(0, this.backStack.length - 20) + this.backStack.splice(0, this.backStack.length - editHistoryMax) // 新动作需清空前进栈 if (notClear) return this.clearForwardStack() diff --git a/src/views/chart/ContentEdit/components/EditHistory/index.vue b/src/views/chart/ContentEdit/components/EditHistory/index.vue index 737cfb3e..0cb59501 100644 --- a/src/views/chart/ContentEdit/components/EditHistory/index.vue +++ b/src/views/chart/ContentEdit/components/EditHistory/index.vue @@ -25,7 +25,7 @@ - 最多只保留 20 条记录 + 最多只保留{{ editHistoryMax }}条记录 @@ -37,6 +37,7 @@ import { renderIcon } from '@/utils' import { useChartHistoryStore } from '@/store/modules/chartHistoryStore/chartHistoryStore' import { historyActionTypeName } from '@/store/modules/chartHistoryStore/chartHistoryDefine' import { CreateComponentType } from '@/packages/index.d' +import { editHistoryMax } from '@/settings/designSetting' import { HistoryItemType, HistoryTargetTypeEnum,