mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-15 13:22:49 +00:00
perf: 回复消息时自动@提及
This commit is contained in:
parent
006fc43498
commit
4038d9560f
@ -27,7 +27,7 @@
|
||||
<!-- 回复、修改 -->
|
||||
<div v-if="quoteData" class="chat-quote">
|
||||
<div v-if="quoteUpdate" class="quote-label">{{$L('编辑消息')}}</div>
|
||||
<UserAvatar v-else :userid="quoteData.userid" :show-icon="false" :show-name="true"/>
|
||||
<UserAvatar v-else :userid="quoteData.userid" :userResult="onQuoteUserResult" :show-icon="false" :show-name="true"/>
|
||||
<div class="quote-desc no-dark-content">{{$A.getMsgSimpleDesc(quoteData)}}</div>
|
||||
<i class="taskfont" @click.stop="cancelQuote"></i>
|
||||
</div>
|
||||
@ -1276,6 +1276,26 @@ export default {
|
||||
this.setQuote(0)
|
||||
},
|
||||
|
||||
onQuoteUserResult(data) {
|
||||
if (this.dialogData.type !== 'group') {
|
||||
return
|
||||
}
|
||||
if (this.quoteUpdate || !this.quoteData) {
|
||||
return
|
||||
}
|
||||
if (this.userId === data.userid || this.quoteData.userid !== data.userid) {
|
||||
return
|
||||
}
|
||||
if (new RegExp(`<span[^>]*?class="mention"[^>]*?data-id="${data.userid}"[^>]*?>`).test(this.$refs.editor.firstChild.innerHTML)) {
|
||||
return
|
||||
}
|
||||
this.addMention({
|
||||
denotationChar: "@",
|
||||
id: data.userid,
|
||||
value: data.nickname,
|
||||
})
|
||||
},
|
||||
|
||||
openMenu(char) {
|
||||
if (!this.quill) {
|
||||
return;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user