fix(缺陷管理): 评论@用户消息通知有误

--bug=1039290 --user=宋昌昌 【消息管理】缺陷评论@用户a-用户a收到通知未显示@我的 https://www.tapd.cn/55049933/s/1498581
This commit is contained in:
song-cc-rock 2024-04-16 17:16:44 +08:00 committed by 刘瑞斌
parent 0023824099
commit 477b7fdae5
1 changed files with 3 additions and 9 deletions

View File

@ -208,11 +208,11 @@
</div> </div>
<CommentInput <CommentInput
v-if="activeTab === 'comment' && hasAnyPermission(['PROJECT_BUG:READ+COMMENT'])" v-if="activeTab === 'comment' && hasAnyPermission(['PROJECT_BUG:READ+COMMENT'])"
v-model:notice-user-ids="noticeUserIds"
:content="commentContent" :content="commentContent"
is-show-avatar is-show-avatar
:upload-image="handleUploadImage" :upload-image="handleUploadImage"
is-use-bottom is-use-bottom
:notice-user-ids="noticeUserIds"
:preview-url="EditorPreviewFileUrl" :preview-url="EditorPreviewFileUrl"
@publish="publishHandler" @publish="publishHandler"
/> />
@ -612,20 +612,14 @@
}; };
async function publishHandler(currentContent: string) { async function publishHandler(currentContent: string) {
const regex = /data-id="([^"]*)"/g;
const matchesNotifier = currentContent.match(regex);
let notifiers = '';
if (matchesNotifier?.length) {
notifiers = matchesNotifier.map((match) => match.replace('data-id="', '').replace('"', '')).join(';');
}
try { try {
const params = { const params = {
bugId: detailInfo.value.id, bugId: detailInfo.value.id,
notifier: notifiers, notifier: noticeUserIds.value.join(';'),
replyUser: '', replyUser: '',
parentId: '', parentId: '',
content: currentContent, content: currentContent,
event: notifiers ? 'AT' : 'COMMENT', // (: COMMENT; @: AT; /@: REPLY;) event: noticeUserIds.value.join(';') ? 'AT' : 'COMMENT', // (: COMMENT; @: AT; /@: REPLY;)
}; };
await createOrUpdateComment(params as CommentParams); await createOrUpdateComment(params as CommentParams);
Message.success(t('common.publishSuccessfully')); Message.success(t('common.publishSuccessfully'));