优化: aichat 工具体验补强(切生成会话占位气泡治丢首响应/read_symbol符号级提示/失败引导/审批失败toast) + 修复 WorkflowDagDisplay 崩页与 aiChat i18n 缺key

This commit is contained in:
lxy
2026-08-09 21:34:53 +08:00
parent cad76ffdf2
commit 37040616bd
10 changed files with 335 additions and 21 deletions
@@ -91,8 +91,13 @@ const emit = defineEmits<{
}>()
const dag = computed<{ nodes: DagNode[]; edges: EdgeDef[] } | null>(() => {
try { return JSON.parse(props.dagJson) }
catch { return null }
try {
const parsed = JSON.parse(props.dagJson)
// 结构校验:dag_json 可能为 {} / 缺 nodes / nodes 非数组(执行记录无 DAG 或异常),解析成功但
// 缺字段会致下方 for..of 抛 "d.nodes is not iterable"。非预期结构 → null 显示空态而非崩页。
if (!parsed || !Array.isArray(parsed.nodes) || !Array.isArray(parsed.edges)) return null
return parsed as { nodes: DagNode[]; edges: EdgeDef[] }
} catch { return null }
})
const nodeTypeLabel: Record<string, string> = {