mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 11:19:56 +00:00
perf: 转发消息至群聊时支持@留言
This commit is contained in:
parent
053daa621b
commit
a6708a26a6
@ -410,7 +410,10 @@ class WebSocketDialogMsg extends AbstractModel
|
|||||||
$already[] = $dialogid;
|
$already[] = $dialogid;
|
||||||
}
|
}
|
||||||
if ($leaveMessage) {
|
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'];
|
$msgs[] = $res['data'];
|
||||||
}
|
}
|
||||||
if ($leaveMessage) {
|
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'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -266,6 +266,10 @@ export default {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
},
|
},
|
||||||
|
simpleMode: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
options: {
|
options: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({})
|
default: () => ({})
|
||||||
@ -420,6 +424,9 @@ export default {
|
|||||||
array.push('record-ready');
|
array.push('record-ready');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this.simpleMode) {
|
||||||
|
array.push('simple-mode');
|
||||||
|
}
|
||||||
if (this.showMenu) {
|
if (this.showMenu) {
|
||||||
array.push('show-menu');
|
array.push('show-menu');
|
||||||
}
|
}
|
||||||
@ -496,7 +503,9 @@ export default {
|
|||||||
this.quill.setText('')
|
this.quill.setText('')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!this.simpleMode) {
|
||||||
this.$store.dispatch("saveDialogDraft", {id: this.dialogId, extra_draft_content: this.filterInvalidLine(val)})
|
this.$store.dispatch("saveDialogDraft", {id: this.dialogId, extra_draft_content: this.filterInvalidLine(val)})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Watch disabled change
|
// Watch disabled change
|
||||||
@ -642,7 +651,7 @@ export default {
|
|||||||
placeholder: this.placeholder,
|
placeholder: this.placeholder,
|
||||||
modules: {
|
modules: {
|
||||||
toolbar: this.$isEEUiApp || this.windowTouch ? false : this.toolbar,
|
toolbar: this.$isEEUiApp || this.windowTouch ? false : this.toolbar,
|
||||||
keyboard: {
|
keyboard: this.simpleMode ? {} : {
|
||||||
bindings: {
|
bindings: {
|
||||||
'short enter': {
|
'short enter': {
|
||||||
key: "Enter",
|
key: "Enter",
|
||||||
@ -965,13 +974,13 @@ export default {
|
|||||||
|
|
||||||
loadInputDraft() {
|
loadInputDraft() {
|
||||||
const {extra_draft_content} = this.dialogData;
|
const {extra_draft_content} = this.dialogData;
|
||||||
if (extra_draft_content) {
|
if (this.simpleMode || !extra_draft_content) {
|
||||||
|
this.$emit('input', '')
|
||||||
|
return
|
||||||
|
}
|
||||||
this.pasteClean = false
|
this.pasteClean = false
|
||||||
this.$emit('input', extra_draft_content)
|
this.$emit('input', extra_draft_content)
|
||||||
this.$nextTick(_ => this.pasteClean = true)
|
this.$nextTick(_ => this.pasteClean = true)
|
||||||
} else {
|
|
||||||
this.$emit('input', '')
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onClickEditor() {
|
onClickEditor() {
|
||||||
|
|||||||
@ -483,7 +483,23 @@
|
|||||||
</Scrollbar>
|
</Scrollbar>
|
||||||
</div>
|
</div>
|
||||||
<div class="leave-message">
|
<div class="leave-message">
|
||||||
<Input type="textarea" :autosize="{minRows: 1,maxRows: 3}" v-model="forwardMessage" :placeholder="$L('留言')" clearable />
|
<ChatInput
|
||||||
|
v-if="forwardDialogId > 0"
|
||||||
|
v-model="forwardMessage"
|
||||||
|
:dialog-id="forwardDialogId"
|
||||||
|
:emoji-bottom="windowPortrait"
|
||||||
|
:maxlength="200000"
|
||||||
|
:placeholder="$L('留言')"
|
||||||
|
disabled-record
|
||||||
|
simple-mode/>
|
||||||
|
<Input
|
||||||
|
v-else
|
||||||
|
type="textarea"
|
||||||
|
:autosize="{minRows: 1,maxRows: 3}"
|
||||||
|
v-model="forwardMessage"
|
||||||
|
:maxlength="200000"
|
||||||
|
:placeholder="$L('留言')"
|
||||||
|
clearable/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -731,6 +747,7 @@ export default {
|
|||||||
forwardhow: false,
|
forwardhow: false,
|
||||||
forwardData: [],
|
forwardData: [],
|
||||||
forwardLoad: 0,
|
forwardLoad: 0,
|
||||||
|
forwardDialogId: 0,
|
||||||
forwardMessage: '',
|
forwardMessage: '',
|
||||||
forwardSource: true,
|
forwardSource: true,
|
||||||
|
|
||||||
@ -2598,6 +2615,13 @@ export default {
|
|||||||
if (this.forwardData.length === 0) {
|
if (this.forwardData.length === 0) {
|
||||||
$A.messageError("请选择转发对话或成员");
|
$A.messageError("请选择转发对话或成员");
|
||||||
} else {
|
} 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.forwardMessage = '';
|
||||||
this.forwardSource = true;
|
this.forwardSource = true;
|
||||||
this.forwardhow = true;
|
this.forwardhow = true;
|
||||||
|
|||||||
@ -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-menu,
|
||||||
&.show-more,
|
&.show-more,
|
||||||
&.show-emoji {
|
&.show-emoji {
|
||||||
|
|||||||
@ -1897,6 +1897,7 @@ body:not(.window-touch) {
|
|||||||
.dialog-wrapper-forward-body {
|
.dialog-wrapper-forward-body {
|
||||||
.dialog-wrapper {
|
.dialog-wrapper {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
|
||||||
&.inde-list {
|
&.inde-list {
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
@ -1941,6 +1942,8 @@ body:not(.window-touch) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.leave-message {
|
.leave-message {
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
padding-bottom: 16px;
|
padding-bottom: 16px;
|
||||||
|
|
||||||
textarea {
|
textarea {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user