新增: Phase2 阶段收尾(Sprint 1-20)
重构:删 5 零引用 crate(df-evolve/plugin/stages/task/traceability)+ 清死模块、ai.rs 拆 11 子 module、ai.ts 拆 6 composable、i18n 拆目录 功能:知识库全栈(df-project/scan + CRUD + 时间线 + 前端)、Settings 拆分、appSettings KV 迁移、模型池、LLM 并发 Semaphore 修复:审批持久化根治、ConditionEngine 默认拒绝、NodeRegistry unimplemented 清除、promote 补偿删除、工具结果截断 50KB、路径校验防 symlink 逃逸 文档:B-03 人工审批设计、决策记录三分档、规格契约自检、经验记录、todo 看板、PROGRESS 更新 详见 PROGRESS.md。src-tauri/儿童每日打卡应用/ 与本项目无关,已排除。
This commit is contained in:
62
src/components/ToolCardList.vue
Normal file
62
src/components/ToolCardList.vue
Normal file
@@ -0,0 +1,62 @@
|
||||
<template>
|
||||
<div class="ai-tool-calls">
|
||||
<ToolCard
|
||||
v-for="tc in toolCalls"
|
||||
:key="tc.id"
|
||||
:tc="tc"
|
||||
:isExpanded="expandedCards.has(tc.id)"
|
||||
:isContentExpanded="expandedTools.has(tc.id)"
|
||||
@toggle="toggleCardExpand"
|
||||
@expand-content="toggleExpand"
|
||||
@approve="(e) => emit('approve', e)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import ToolCard from './ToolCard.vue'
|
||||
import type { AiToolCallInfo } from '../api/types'
|
||||
|
||||
defineProps<{
|
||||
/** 当前消息的工具调用列表 */
|
||||
toolCalls: AiToolCallInfo[]
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
/** 审批按钮 → 父组件转发 store.approveToolCall */
|
||||
approve: [{ id: string; approved: boolean }]
|
||||
}>()
|
||||
|
||||
// 卡片级折叠(整卡 body 显隐,区别于 read_file 内容级)
|
||||
const expandedCards = ref(new Set<string>())
|
||||
// 内容级展开(read_file "展开全部")
|
||||
const expandedTools = ref(new Set<string>())
|
||||
|
||||
function toggleCardExpand(id: string) {
|
||||
if (expandedCards.value.has(id)) expandedCards.value.delete(id)
|
||||
else expandedCards.value.add(id)
|
||||
}
|
||||
|
||||
function toggleExpand(id: string) {
|
||||
if (expandedTools.value.has(id)) expandedTools.value.delete(id)
|
||||
else expandedTools.value.add(id)
|
||||
}
|
||||
|
||||
/** 收起不在 activeIds 中的已完成/已拒绝卡片(供父组件 auto-collapse watch 调用) */
|
||||
function collapseInactive(activeIds: Set<string>): void {
|
||||
if (expandedCards.value.size > 0) {
|
||||
expandedCards.value = new Set([...expandedCards.value].filter(id => activeIds.has(id)))
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ collapseInactive })
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.ai-tool-calls {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user