diff --git a/app/Models/WebSocketDialogMsg.php b/app/Models/WebSocketDialogMsg.php index 241bf9d44..901a9cbb3 100644 --- a/app/Models/WebSocketDialogMsg.php +++ b/app/Models/WebSocketDialogMsg.php @@ -410,7 +410,10 @@ class WebSocketDialogMsg extends AbstractModel $already[] = $dialogid; } if ($leaveMessage) { - self::sendMsg(null, $dialogid, 'text', ['text' => $leaveMessage], $user->userid); + $res = self::sendMsg(null, $dialogid, 'text', ['text' => $leaveMessage], $user->userid); + if (Base::isSuccess($res)) { + $msgs[] = $res['data']; + } } } } @@ -429,7 +432,10 @@ class WebSocketDialogMsg extends AbstractModel $msgs[] = $res['data']; } if ($leaveMessage) { - self::sendMsg(null, $dialog->id, 'text', ['text' => $leaveMessage], $user->userid); + $res = self::sendMsg(null, $dialog->id, 'text', ['text' => $leaveMessage], $user->userid); + if (Base::isSuccess($res)) { + $msgs[] = $res['data']; + } } } } diff --git a/resources/assets/js/pages/manage/components/ChatInput/index.vue b/resources/assets/js/pages/manage/components/ChatInput/index.vue index fd9cf0d28..05e7b1112 100755 --- a/resources/assets/js/pages/manage/components/ChatInput/index.vue +++ b/resources/assets/js/pages/manage/components/ChatInput/index.vue @@ -266,6 +266,10 @@ export default { type: Boolean, default: true }, + simpleMode: { + type: Boolean, + default: false + }, options: { type: Object, default: () => ({}) @@ -420,6 +424,9 @@ export default { array.push('record-ready'); } } + if (this.simpleMode) { + array.push('simple-mode'); + } if (this.showMenu) { array.push('show-menu'); } @@ -496,7 +503,9 @@ export default { this.quill.setText('') } } - this.$store.dispatch("saveDialogDraft", {id: this.dialogId, extra_draft_content: this.filterInvalidLine(val)}) + if (!this.simpleMode) { + this.$store.dispatch("saveDialogDraft", {id: this.dialogId, extra_draft_content: this.filterInvalidLine(val)}) + } }, // Watch disabled change @@ -642,7 +651,7 @@ export default { placeholder: this.placeholder, modules: { toolbar: this.$isEEUiApp || this.windowTouch ? false : this.toolbar, - keyboard: { + keyboard: this.simpleMode ? {} : { bindings: { 'short enter': { key: "Enter", @@ -965,13 +974,13 @@ export default { loadInputDraft() { const {extra_draft_content} = this.dialogData; - if (extra_draft_content) { - this.pasteClean = false - this.$emit('input', extra_draft_content) - this.$nextTick(_ => this.pasteClean = true) - } else { + if (this.simpleMode || !extra_draft_content) { this.$emit('input', '') + return } + this.pasteClean = false + this.$emit('input', extra_draft_content) + this.$nextTick(_ => this.pasteClean = true) }, onClickEditor() { diff --git a/resources/assets/js/pages/manage/components/DialogWrapper.vue b/resources/assets/js/pages/manage/components/DialogWrapper.vue index 4b6e4d611..c8c4d601b 100644 --- a/resources/assets/js/pages/manage/components/DialogWrapper.vue +++ b/resources/assets/js/pages/manage/components/DialogWrapper.vue @@ -483,7 +483,23 @@
@@ -731,6 +747,7 @@ export default { forwardhow: false, forwardData: [], forwardLoad: 0, + forwardDialogId: 0, forwardMessage: '', forwardSource: true, @@ -2598,6 +2615,13 @@ export default { if (this.forwardData.length === 0) { $A.messageError("请选择转发对话或成员"); } else { + this.forwardDialogId = 0; + if (this.forwardData.length === 1) { + const {type, userid} = this.forwardData[0]; + if (type === "group" && /^d:/.test(userid)) { + this.forwardDialogId = parseInt(userid.replace(/^d:/, '')); + } + } this.forwardMessage = ''; this.forwardSource = true; this.forwardhow = true; diff --git a/resources/assets/sass/pages/components/chat-input.scss b/resources/assets/sass/pages/components/chat-input.scss index 3996f7844..0671dfe96 100755 --- a/resources/assets/sass/pages/components/chat-input.scss +++ b/resources/assets/sass/pages/components/chat-input.scss @@ -43,6 +43,20 @@ } } + &.simple-mode { + .chat-input-wrapper { + border: 1px solid #e8e8e8; + border-radius: 4px; + .ql-container { + width: 100%; + } + .chat-space, + .chat-toolbar { + display: none; + } + } + } + &.show-menu, &.show-more, &.show-emoji { diff --git a/resources/assets/sass/pages/components/dialog-wrapper.scss b/resources/assets/sass/pages/components/dialog-wrapper.scss index 2c763417d..4e4529719 100644 --- a/resources/assets/sass/pages/components/dialog-wrapper.scss +++ b/resources/assets/sass/pages/components/dialog-wrapper.scss @@ -1897,6 +1897,7 @@ body:not(.window-touch) { .dialog-wrapper-forward-body { .dialog-wrapper { position: relative; + z-index: 1; &.inde-list { border-radius: 0; @@ -1941,6 +1942,8 @@ body:not(.window-touch) { } .leave-message { + position: relative; + z-index: 2; padding-bottom: 16px; textarea {