diff --git a/Yi.Ai.Vue3/src/pages/chat/layouts/chatWithId/index.vue b/Yi.Ai.Vue3/src/pages/chat/layouts/chatWithId/index.vue index e0a50833..e89ef196 100644 --- a/Yi.Ai.Vue3/src/pages/chat/layouts/chatWithId/index.vue +++ b/Yi.Ai.Vue3/src/pages/chat/layouts/chatWithId/index.vue @@ -6,7 +6,7 @@ import type { BubbleListInstance } from 'vue-element-plus-x/types/BubbleList'; import type { FilesCardProps } from 'vue-element-plus-x/types/FilesCard'; import type { ThinkingStatus } from 'vue-element-plus-x/types/Thinking'; import type { UnifiedMessage } from '@/utils/apiFormatConverter'; -import { ArrowLeftBold, ArrowRightBold, Clock, Delete, Document, DocumentCopy, Edit, Loading, Refresh } from '@element-plus/icons-vue'; +import { ArrowLeftBold, ArrowRightBold, Delete, Document, DocumentCopy, Edit, Loading, Refresh } from '@element-plus/icons-vue'; import { ElIcon, ElMessage } from 'element-plus'; import { useHookFetch } from 'hook-fetch/vue'; import mammoth from 'mammoth'; @@ -532,13 +532,9 @@ function enterDeleteMode(item?: MessageItem) { selectedMessageIds.value = []; deleteTargetMessage.value = item || null; - // 如果指定了消息,自动选中该消息及其之后的所有消息 + // 如果指定了消息,只自动选中当前点击的这条消息 if (item && item.id) { - const itemIndex = bubbleItems.value.findIndex(msg => msg.key === item.key); - if (itemIndex !== -1) { - const messagesToDelete = bubbleItems.value.slice(itemIndex); - selectedMessageIds.value = messagesToDelete.filter(msg => msg.id).map(msg => msg.id!); - } + selectedMessageIds.value = [item.id]; } } @@ -1282,7 +1278,6 @@ onUnmounted(() => {