From e75fbadd53aea45454c2607a0305af41eee3caa4 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Fri, 9 Jun 2023 16:52:12 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E8=A7=A6=E5=B1=8F=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E5=AE=9E=E4=BD=93=E9=94=AE=E7=9B=98=E5=9B=9E=E8=BD=A6=E5=8F=91?= =?UTF-8?q?=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/components/ChatInput/index.vue | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/resources/assets/js/pages/manage/components/ChatInput/index.vue b/resources/assets/js/pages/manage/components/ChatInput/index.vue index 6a4888f24..7d33b3c9d 100755 --- a/resources/assets/js/pages/manage/components/ChatInput/index.vue +++ b/resources/assets/js/pages/manage/components/ChatInput/index.vue @@ -357,13 +357,27 @@ export default { } }, computed: { - ...mapState(['cacheProjects', 'cacheTasks', 'cacheUserBasic', 'dialogMsgs', 'cacheDialogs']), + ...mapState([ + 'cacheProjects', + 'cacheTasks', + 'cacheUserBasic', - isEnterSend() { - if (typeof this.enterSend === "boolean") { - return this.enterSend; + 'cacheDialogs', + 'dialogMsgs', + + 'keyboardType', + 'keyboardHeight', + ]), + + isEnterSend({enterSend, keyboardType, keyboardHeight, windowTouch}) { + if (typeof enterSend === "boolean") { + return enterSend; } else { - return !this.windowTouch + // 如果是触屏设备而且虚拟键盘高度小于120时,考虑是实体键盘按键所以回车发送 + if (windowTouch && keyboardType === "show" && keyboardHeight < 120) { + return true; + } + return !windowTouch } },