mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-24 10:20:31 +00:00
fix: 会话列表待办完成消息显示最后完成者
This commit is contained in:
parent
8ab810c670
commit
1aa9984535
@ -110,9 +110,9 @@
|
|||||||
<div class="last-text"><span>{{formatDraft(getDialogDraft(dialog.id)?.content)}}</span></div>
|
<div class="last-text"><span>{{formatDraft(getDialogDraft(dialog.id)?.content)}}</span></div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<template v-if="dialog.type=='group' && dialog.last_msg && dialog.last_msg.userid">
|
<template v-if="dialog.type=='group' && dialog.last_msg && getLastMsgSenderId(dialog.last_msg)">
|
||||||
<div v-if="dialog.last_msg.userid == userId" class="last-self">{{$L('你')}}</div>
|
<div v-if="getLastMsgSenderId(dialog.last_msg) == userId" class="last-self">{{$L('你')}}</div>
|
||||||
<UserAvatar v-else :userid="dialog.last_msg.userid" :show-name="true" :show-icon="false"/>
|
<UserAvatar v-else :userid="getLastMsgSenderId(dialog.last_msg)" :show-name="true" :show-icon="false"/>
|
||||||
</template>
|
</template>
|
||||||
<div class="last-text">
|
<div class="last-text">
|
||||||
<em v-if="formatMsgEmojiDesc(dialog.last_msg)">{{formatMsgEmojiDesc(dialog.last_msg)}}</em>
|
<em v-if="formatMsgEmojiDesc(dialog.last_msg)">{{formatMsgEmojiDesc(dialog.last_msg)}}</em>
|
||||||
@ -656,6 +656,19 @@ export default {
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
transformEmojiToHtml,
|
transformEmojiToHtml,
|
||||||
|
|
||||||
|
// 获取会话列表中消息的"有效发送者ID"
|
||||||
|
// 对于待办完成消息(多人完成),取最后完成者
|
||||||
|
getLastMsgSenderId(lastMsg) {
|
||||||
|
if (lastMsg?.type === 'todo' && lastMsg.msg?.action === 'done') {
|
||||||
|
const doneUserIds = lastMsg.msg?.data?.done_userids;
|
||||||
|
if (Array.isArray(doneUserIds) && doneUserIds.length > 0) {
|
||||||
|
return doneUserIds[0]; // done_userids 倒序,第一个是最后完成者
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return lastMsg?.userid;
|
||||||
|
},
|
||||||
|
|
||||||
listTouch() {
|
listTouch() {
|
||||||
if (this.$refs.navMenu?.visible) {
|
if (this.$refs.navMenu?.visible) {
|
||||||
this.$refs.navMenu.hide()
|
this.$refs.navMenu.hide()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user