diff --git a/resources/assets/js/pages/manage/components/ChatInput/index.vue b/resources/assets/js/pages/manage/components/ChatInput/index.vue index be42bc7d8..9bd89b78c 100755 --- a/resources/assets/js/pages/manage/components/ChatInput/index.vue +++ b/resources/assets/js/pages/manage/components/ChatInput/index.vue @@ -288,6 +288,10 @@ export default { type: String, default: "top" }, + replyMsgAutoMention: { + type: Boolean, + default: true + }, }, data() { return { @@ -1314,7 +1318,22 @@ export default { cancelQuote() { if (this.quoteUpdate) { + // 取消修改 this.$emit('input', '') + } else { + // 取消回复 + if (this.$refs.editor.firstChild.querySelectorAll('img').length === 0) { + const quoteDiv = document.createElement('div') + quoteDiv.innerHTML = this.$refs.editor.firstChild.innerHTML + quoteDiv.querySelectorAll("span.mention").forEach(span => { + if (span.getAttribute("data-id") == this.quoteData.userid) { + span.innerHTML = ""; + } + }) + if (!quoteDiv.innerText.replace(/\s/g, '')) { + this.$emit('input', '') + } + } } this.setQuote(0) }, @@ -1323,7 +1342,10 @@ export default { if (this.dialogData.type !== 'group') { return } - if (this.quoteUpdate || !this.quoteData) { + if (this.quoteUpdate || !this.quoteData || !this.replyMsgAutoMention) { + return + } + if (data.bot && !$A.rightExists(data.email, '@bot.system')) { return } if (this.userId === data.userid || this.quoteData.userid !== data.userid) { diff --git a/resources/assets/js/pages/manage/components/DialogWrapper.vue b/resources/assets/js/pages/manage/components/DialogWrapper.vue index b9d0c3d9c..3d8c29f15 100644 --- a/resources/assets/js/pages/manage/components/DialogWrapper.vue +++ b/resources/assets/js/pages/manage/components/DialogWrapper.vue @@ -263,6 +263,7 @@ :emoji-bottom="windowPortrait" :maxlength="200000" :placeholder="$L('输入消息...')" + :reply-msg-auto-mention="replyMsgAutoMention" @on-focus="onEventFocus" @on-blur="onEventBlur" @on-more="onEventMore" @@ -861,6 +862,7 @@ export default { selectedTextStatus: false, // 是否选择文本 scrollToBottomRefresh: false, // 滚动到底部重新获取消息 androidKeyboardVisible: false, // Android键盘是否可见 + replyMsgAutoMention: false, // 允许回复消息后自动@ } }, @@ -1490,6 +1492,7 @@ export default { this.positionShow = false this.msgPrepared = false this.scrollToBottomRefresh = false + this.replyMsgAutoMention = false this.allMsgs = this.allMsgList this.errorId = 0 // @@ -3030,6 +3033,7 @@ export default { }, onReply(type) { + this.replyMsgAutoMention = true this.setQuote(this.operateItem.id, type) this.inputFocus() },