refactor: 移除bot消息组件中的mentionedItems相关代码,简化组件逻辑

This commit is contained in:
wizardchen
2025-12-22 12:21:36 +08:00
committed by lyingbug
parent 1ac663fc3f
commit 86347d4c16
2 changed files with 1 additions and 87 deletions
+1 -13
View File
@@ -7,7 +7,7 @@
<usermsg :content="session.content" :mentioned_items="session.mentioned_items"></usermsg>
</div>
<div v-if="session.role == 'assistant'">
<botmsg :content="session.content" :session="session" :user-query="getUserQuery(id)" :mentioned-items="getUserMentionedItems(id)" @scroll-bottom="scrollToBottom"
<botmsg :content="session.content" :session="session" :user-query="getUserQuery(id)" @scroll-bottom="scrollToBottom"
:isFirstEnter="isFirstEnter"></botmsg>
</div>
</div>
@@ -93,18 +93,6 @@ const getUserQuery = (index) => {
}
return '';
};
// 获取用户消息的 mentioned_items(用于 bot 消息显示)
const getUserMentionedItems = (index) => {
if (index <= 0) {
return [];
}
const previous = messagesList[index - 1];
if (previous && previous.role === 'user') {
return previous.mentioned_items || [];
}
return [];
};
watch([() => route.params], (newvalue) => {
isFirstEnter.value = true;
if (newvalue[0].chatid) {