新增: 批次工作落地(推进链/评估闭环/事件总线/并发/加固) + 技术债清理 + 文档整理
后端: - 工作流推进链(D-03):advance_task/状态机/闸门走 df-nodes Node trait,conditions 条件引擎扩展 - 想法评估闭环:启发式评分+对抗评估,df-ideas/scoring + df-storage/idea_eval_repo + idea 前端打通 - 全局事件数据总线:df-ai/context+context_helpers+augmentation 跨模块解耦 - AI planner/plan_hint/intent:aichat B 路线并行多轮基础 - patch_file 加固(TD-03/04):读改写整体锁防 lost update,expected_hash 合约闭环 - 压缩超时兜底(F-15 卡死根治) - F-09 多会话并发:LlmConcurrency per-conv + streamingGuard 前端守护 + verify 脚本 - 知识注入 DRY/skills/audit 扩展 清理: - aichat 技术债(误报 allow/死导入/过时注释 30 项) - URGENT.md 删除(11 项加急全解决/迁 todo) - 文档整理(todo/待决策/待审查/ARCHITECTURE/INDEX + 总线/技术债审查新文档)
This commit is contained in:
@@ -26,6 +26,19 @@
|
||||
>
|
||||
{{ f.icon }} {{ $t(f.labelKey) }}
|
||||
</button>
|
||||
<!-- 排序切换:score 高分在前 / time 新在前 -->
|
||||
<div class="sort-group">
|
||||
<button
|
||||
class="filter-btn"
|
||||
:class="{ active: sortMode === 'score' }"
|
||||
@click="sortMode = 'score'"
|
||||
>{{ $t('ideas.sortByScore') }}</button>
|
||||
<button
|
||||
class="filter-btn"
|
||||
:class="{ active: sortMode === 'time' }"
|
||||
@click="sortMode = 'time'"
|
||||
>{{ $t('ideas.sortByTime') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 两栏布局 -->
|
||||
@@ -72,6 +85,8 @@
|
||||
@promote="promoteToProject"
|
||||
@delete="deleteCurrentIdea"
|
||||
@status-change="onStatusChange"
|
||||
@update-desc="onUpdateDesc"
|
||||
@update-related="onUpdateRelated"
|
||||
/>
|
||||
|
||||
<!-- 未选择 -->
|
||||
@@ -132,6 +147,8 @@ type FilterKey = 'all' | 'hot' | 'pending' | 'promoted'
|
||||
const activeFilter = ref<FilterKey>('all')
|
||||
const selectedId = ref<string | null>(null)
|
||||
const searchQuery = ref('')
|
||||
// 列表排序:score 高分在前 / time 新在前(默认 score,避免高分灵感被淹没)
|
||||
const sortMode = ref<'score' | 'time'>('score')
|
||||
|
||||
// ── 新建灵感模态框 ──
|
||||
const showCaptureModal = ref(false)
|
||||
@@ -185,7 +202,17 @@ const filteredIdeas = computed(() => {
|
||||
)
|
||||
}
|
||||
|
||||
return ideas
|
||||
// 排序:在过滤+搜索之后、return 之前对最终数组排序
|
||||
// [...ideas] 浅拷贝避免改原数组(store.ideas)
|
||||
const sorted = [...ideas].sort((a, b) => {
|
||||
if (sortMode.value === 'score') {
|
||||
return (b.score ?? 0) - (a.score ?? 0) // 高分在前
|
||||
}
|
||||
// time:created_at 为毫秒字符串,字符串比较即可(同位数字典序等价数值序)
|
||||
return (b.created_at ?? '').localeCompare(a.created_at ?? '') // 新在前
|
||||
})
|
||||
|
||||
return sorted
|
||||
})
|
||||
|
||||
const currentIdea = computed(() => {
|
||||
@@ -278,6 +305,18 @@ async function onStatusChange(newStatus: IdeaStatus) {
|
||||
await store.updateIdea(currentIdea.value.id, 'status', newStatus)
|
||||
}
|
||||
|
||||
// 接收 IdeaDetail 子组件 emit 的 'update-desc'(描述编辑保存)
|
||||
async function onUpdateDesc(desc: string) {
|
||||
if (!currentIdea.value) return
|
||||
await store.updateIdea(currentIdea.value.id, 'description', desc)
|
||||
}
|
||||
|
||||
// 接收 IdeaDetail 子组件 emit 的 'update-related'(关联灵感编辑保存)
|
||||
async function onUpdateRelated(ids: string[]) {
|
||||
if (!currentIdea.value) return
|
||||
await store.updateIdea(currentIdea.value.id, 'related_ids', JSON.stringify(ids))
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await store.loadIdeas()
|
||||
// 从路由参数恢复选中灵感(修复 /ideas/:id 直接访问空白页 B-260615-36)
|
||||
@@ -376,6 +415,13 @@ watch(() => route.params.id, (id) => {
|
||||
border-color: var(--df-accent);
|
||||
}
|
||||
|
||||
/* 排序按钮组(与状态筛选按钮视觉分隔) */
|
||||
.sort-group {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
/* ===== 两栏布局 ===== */
|
||||
.ideas-layout {
|
||||
display: grid;
|
||||
|
||||
Reference in New Issue
Block a user