zhaoweijie 00ef22505e feat(agent):重构智能体仓库并优化任务模板交互
-为 public/agent.json 中的每个智能体添加 Classification 字段以支持分类展示
- 新增 AgentRepoList 组件用于渲染智能体列表,提升代码复用性
- 在 src/layout/components/Main/TaskTemplate/AgentRepo/index.vue 中实现基于 Classification 的智能体分组展示逻辑- 移除旧版 popover 方式展示智能体详情,改用新的列表组件统一处理
- 修改任务搜索输入框为 textarea 类型,并优化其聚焦与失焦状态下的样式表现
- 调整任务模板页面布局高度计算方式,确保适配新 UI 结构
-修复任务结果流程图连线方向及透明度判断逻辑,增强可视化准确性- 引入流动动画效果至 jsPlumb 连线,区分 input/output 类型并美化视觉呈现
- 更新配置文件中部分动作类型的配色值,提高界面美观度
- 升级本地存储键名 agents 至 agents-v1,避免
2025-11-03 09:44:14 +08:00

146 lines
3.1 KiB
TypeScript

export interface AgentMapIcon {
name: string
icon: string
color: string
}
// "肾脏病学家": {
// name: "肾脏病学家",
// icon: "doctor",
// color: "#00A2D2",
// },
export const agentMapIcon = new Map<string, AgentMapIcon>()
agentMapIcon.set("船舶设计师", {
name: '船舶设计师',
icon: 'shejishi',
color: '#65AE00',
})
agentMapIcon.set("防护工程专家", {
name: '防护工程专家',
icon: 'engineer',
color: '#B06CFE',
})
agentMapIcon.set("病理生理学家", {
name: '病理生理学家',
icon: 'doctor',
color: '#00A2D2',
})
agentMapIcon.set("药物化学家", {
name: '药物化学家',
icon: 'specialist',
color: '#FF7914',
})
agentMapIcon.set("制剂工程师", {
name: '制剂工程师',
icon: 'medical',
color: '#65AE00',
})
agentMapIcon.set("监管事务专家", {
name: '监管事务专家',
icon: 'researcher',
color: '#0064C4',
})
agentMapIcon.set("物理学家", {
name: '物理学家',
icon: 'specialist',
color: '#B06CFE',
})
agentMapIcon.set("实验材料学家", {
name: '实验材料学家',
icon: 'researcher',
color: '#C01E6A',
})
agentMapIcon.set("计算模拟专家", {
name: '计算模拟专家',
icon: 'researcher',
color: '#FF7914',
})
agentMapIcon.set("腐蚀机理研究员", {
name: '腐蚀机理研究员',
icon: 'specialist',
color: '#00C8D2',
})
agentMapIcon.set("先进材料研发员", {
name: '先进材料研发员',
icon: 'engineer',
color: '#00C8D2',
})
agentMapIcon.set("肾脏病学家", {
name: '肾脏病学家',
icon: 'doctor',
color: '#00A2D2',
})
agentMapIcon.set("临床研究协调员", {
name: '临床研究协调员',
icon: 'renyuan',
color: '#FF7914',
})
agentMapIcon.set("中医药专家", {
name: '中医药专家',
icon: 'medical',
color: '#00C8D2',
})
agentMapIcon.set("药物安全专家", {
name: '药物安全专家',
icon: 'medical',
color: '#65AE00',
})
agentMapIcon.set("二维材料科学家", {
name: '二维材料科学家',
icon: 'shejishi',
color: '#EB6363',
})
agentMapIcon.set("光电物理学家", {
name: '光电物理学家',
icon: 'specialist',
color: '#079EFF',
})
agentMapIcon.set("机器学习专家", {
name: '机器学习专家',
icon: 'researcher',
color: '#8700AE',
})
agentMapIcon.set("流体动力学专家", {
name: '流体动力学专家',
icon: 'specialist',
color: '#EB6363',
})
export function getAgentMapIcon(agentName: string):AgentMapIcon {
return agentMapIcon.get(agentName) ?? agentMapIcon.get('监管事务专家')!
}
export interface AgentMapDuty {
name: string
key: string
color: string
}
// 职责映射
// 提议 评审 改进 总结
export const agentMapDuty: Record<string, AgentMapDuty> = {
Propose: {
name: '提议',
key: 'propose',
color: '#06A3FF',
},
Critique: {
name: '评审',
key: 'review',
color: '#FFFC08',
},
Improve: {
name: '改进',
key: 'improve',
color: '#BF65FF',
},
Finalize: {
name: '总结',
key: 'summary',
color: '#FFA236',
},
}
export function getActionTypeDisplay(type: string) {
return agentMapDuty[type]
}