From abbd0e097c5227e16aadf9a18e16f7b2b150a4df Mon Sep 17 00:00:00 2001 From: kuaifan Date: Sun, 19 Mar 2023 20:26:45 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E8=8D=89=E7=A8=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/components/ChatInput/index.vue | 18 +++-- .../assets/js/pages/manage/messenger.vue | 72 +++++++++---------- resources/assets/js/store/actions.js | 43 ++++++++--- .../assets/sass/pages/page-messenger.scss | 14 ++++ 4 files changed, 93 insertions(+), 54 deletions(-) diff --git a/resources/assets/js/pages/manage/components/ChatInput/index.vue b/resources/assets/js/pages/manage/components/ChatInput/index.vue index 02b961b59..c5f9fc8d4 100755 --- a/resources/assets/js/pages/manage/components/ChatInput/index.vue +++ b/resources/assets/js/pages/manage/components/ChatInput/index.vue @@ -435,14 +435,14 @@ export default { this.userCache = null; this.taskList = null; this.fileList = {}; - this.$emit('input', this.getInputCache()) + this.loadInputCache() }, taskId() { this.userList = null; this.userCache = null; this.taskList = null; this.fileList = {}; - this.$emit('input', this.getInputCache()) + this.loadInputCache() }, showEmoji(val) { @@ -516,7 +516,7 @@ export default { if (this.isFocus) { return } - this.$emit('input', this.getInputCache()) + this.loadInputCache() }, wrapperHeight(newVal, oldVal) { @@ -637,7 +637,7 @@ export default { if (this.value) { this.setContent(this.value) } else { - this.$emit('input', this.getInputCache()) + this.loadInputCache() } // Mark model as touched if editor lost focus @@ -806,9 +806,15 @@ export default { this.pasteClean = bool }, - getInputCache() { + loadInputCache() { const item = this.dialogInputCache.find(item => item.key == this.cacheKey); - return item ? item.cache : ''; + if (item) { + this.pasteClean = false + this.$emit('input', item.cache) + this.$nextTick(_ => this.pasteClean = true) + } else { + this.$emit('input', '') + } }, onClickEditor() { diff --git a/resources/assets/js/pages/manage/messenger.vue b/resources/assets/js/pages/manage/messenger.vue index 19957b20b..ba686233c 100644 --- a/resources/assets/js/pages/manage/messenger.vue +++ b/resources/assets/js/pages/manage/messenger.vue @@ -89,14 +89,20 @@ {{$A.formatTime(dialog.last_at)}}
-