feat: 完成大部分功能开发

This commit is contained in:
2025-07-01 00:00:31 +08:00
parent ac5e68f5a5
commit ac549bd939
17 changed files with 278 additions and 382 deletions

View File

@@ -23,6 +23,11 @@ const collapseActive = ref<string[]>(
historyMessages.value.map((msg, idx) => String(msg.id ?? idx))
);
// 过滤出type为voice的聊天消息
const filteredMessages = computed(() =>
historyMessages.value.filter((msg) => msg.type === "voice")
);
const getName = (msg: Message, idx: number) => String(msg.id ?? idx);
// TODO: bugfix: 未能正确展开
@@ -135,7 +140,7 @@ onMounted(() => {
</div>
<!-- 默认消息 历史消息 -->
<div
v-for="(msg, idx) in historyMessages"
v-for="(msg, idx) in filteredMessages"
:key="idx"
class="flex items-start mb-4"
>
@@ -217,7 +222,7 @@ onMounted(() => {
:positive-button-props="{ type: 'error' }"
positive-text="清除"
negative-text="取消"
@positive-click="chatStore.clearHistoryMessages"
@positive-click="chatStore.clearHistoryMessages('voice')"
@negative-click="() => {}"
>
<template #icon>