From 75291a9febf96b9a66cf8f94d87cc26dad021248 Mon Sep 17 00:00:00 2001 From: MTrun <1262327911@qq.com> Date: Tue, 22 Mar 2022 10:33:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=20=E4=BF=AE=E6=94=B9=E5=BF=AB=E6=8D=B7?= =?UTF-8?q?=E9=94=AE=E5=8A=9F=E8=83=BD=E4=B8=8E=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/chartEditStore/chartEditStore.ts | 4 +++- .../ContentEdit/components/EditBottom/index.vue | 10 +++++----- src/views/chart/hooks/useKeyboard.hook.ts | 15 +++++++++------ 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/store/modules/chartEditStore/chartEditStore.ts b/src/store/modules/chartEditStore/chartEditStore.ts index 8d745e62..bda5db74 100644 --- a/src/store/modules/chartEditStore/chartEditStore.ts +++ b/src/store/modules/chartEditStore/chartEditStore.ts @@ -4,6 +4,7 @@ import { CreateComponentType } from '@/packages/index.d' import debounce from 'lodash/debounce' import cloneDeep from 'lodash/cloneDeep' import { defaultTheme, globalThemeJson } from '@/settings/chartThemes/index' +import { RequestHttpEnum } from '@/enums/httpEnum' // 记录记录 import { useChartHistoryStoreStore } from '@/store/modules/chartHistoryStore/chartHistoryStore' import { HistoryActionTypeEnum, HistoryItemType, HistoryTargetTypeEnum } from '@/store/modules/chartHistoryStore/chartHistoryStore.d' @@ -84,9 +85,10 @@ export const useChartEditStore = defineStore({ // 全局配置 chartThemeSetting: globalThemeJson }, - // 数据请求处理 + // 数据请求处理(需存储给后端) requestConfig: { requestDataType: RequestDataTypeEnum.STATIC, + requestHttpType: RequestHttpEnum.GET, requestUrl: undefined, requestInterval: 10 }, diff --git a/src/views/chart/ContentEdit/components/EditBottom/index.vue b/src/views/chart/ContentEdit/components/EditBottom/index.vue index 8f69a91c..3fd155dd 100644 --- a/src/views/chart/ContentEdit/components/EditBottom/index.vue +++ b/src/views/chart/ContentEdit/components/EditBottom/index.vue @@ -139,23 +139,23 @@ const shortcutKeyOptions = [ value: '1' }, { - label: 'Delete 删除', + label: 'Alt + Delete 删除', value: '2' }, { - label: 'Ctrl + C 复制', + label: 'Alt + C 复制', value: '3' }, { - label: 'Ctrl + X 剪切', + label: 'Alt + X 剪切', value: '4' }, { - label: 'Ctrl + Z 后退', + label: 'Alt + Z 后退', value: '5' }, { - label: 'Ctrl + Shift + Z 前进', + label: 'Alt + Shift + Z 前进', value: '6' } ] diff --git a/src/views/chart/hooks/useKeyboard.hook.ts b/src/views/chart/hooks/useKeyboard.hook.ts index 4ecfe806..04bb67cd 100644 --- a/src/views/chart/hooks/useKeyboard.hook.ts +++ b/src/views/chart/hooks/useKeyboard.hook.ts @@ -21,19 +21,22 @@ const KeyboardHandle = (e: KeyboardEvent) => { const key = e.key.toLowerCase() // 删除 - if (key === keyboardValue.delete) { - chartEditStore.removeComponentList() - return - } + // if (key === keyboardValue.delete) { + // chartEditStore.removeComponentList() + // return + // } // 前进 - if (e.ctrlKey && e.shiftKey && key == keyboardValue.back) { + if (e.altKey && e.shiftKey && key == keyboardValue.back) { chartEditStore.setForward() return } - if (e.ctrlKey) { + if (e.altKey) { switch (key) { + // 删除 + case keyboardValue.delete: chartEditStore.removeComponentList() + break; // 复制 case keyboardValue.copy: chartEditStore.setCopy() break;