From e592811b7616ae2e039bbc92cbc9436e6376c6b4 Mon Sep 17 00:00:00 2001 From: "xinxin.wu" Date: Thu, 29 Feb 2024 14:19:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=94=A8=E4=BE=8B=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E4=BE=8Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/business/ms-comment/input.vue | 31 +++++++++++++++++-- .../business/ms-comment/locale/en-US.ts | 2 +- .../business/ms-comment/locale/zh-CN.ts | 2 +- .../pure/ms-rich-text/MsRichText.vue | 4 ++- .../pure/ms-rich-text/locale/en-US.ts | 1 + .../pure/ms-rich-text/locale/zh-CN.ts | 1 + frontend/src/hooks/useLeaveUnSaveTip.ts | 5 ++- frontend/src/locale/zh-CN/common.ts | 2 +- .../components/caseTable.vue | 21 ++++++------- .../tabContent/tabBug/linkDefectDrawer.vue | 16 +++++++--- .../tabContent/tabBug/tabDefect.vue | 8 ++--- .../tabContent/tabDemand/demand.vue | 2 +- .../tabDemand/thirdDemandDrawer.vue | 2 +- 13 files changed, 69 insertions(+), 28 deletions(-) diff --git a/frontend/src/components/business/ms-comment/input.vue b/frontend/src/components/business/ms-comment/input.vue index 21e46b497f..791c69d73f 100644 --- a/frontend/src/components/business/ms-comment/input.vue +++ b/frontend/src/components/business/ms-comment/input.vue @@ -8,9 +8,19 @@ >
- +
- +
{{ t('common.cancel') }} {{ t('common.publish') }} @@ -56,6 +66,23 @@ currentContent.value = ''; emit('cancel'); }; + + function handleGlobalKeyDown(event: any) { + if (event.key === 'Enter' && event.ctrlKey) { + if (currentContent.value.trim().length) { + emit('publish', currentContent.value); + isActive.value = false; + currentContent.value = ''; + } + } + } + + onMounted(() => { + window.addEventListener('keydown', handleGlobalKeyDown); + }); + onBeforeUnmount(() => { + window.removeEventListener('keydown', handleGlobalKeyDown); + });