优化: aichat 工具体验补强(切生成会话占位气泡治丢首响应/read_symbol符号级提示/失败引导/审批失败toast) + 修复 WorkflowDagDisplay 崩页与 aiChat i18n 缺key
This commit is contained in:
@@ -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> = {
|
||||
|
||||
Reference in New Issue
Block a user