feat: add health-management and medical-consultation team templates
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -124,6 +124,20 @@ export function createTechDocTemplate(workspaceId?: string) {
|
||||
})
|
||||
}
|
||||
|
||||
/** 一键创建健康管理团队模板 */
|
||||
export function createHealthManagementTemplate(workspaceId?: string) {
|
||||
return api.post('/api/v1/teams/template/health-management', null, {
|
||||
params: workspaceId ? { workspace_id: workspaceId } : {},
|
||||
})
|
||||
}
|
||||
|
||||
/** 一键创建医疗咨询团队模板 */
|
||||
export function createMedicalConsultationTemplate(workspaceId?: string) {
|
||||
return api.post('/api/v1/teams/template/medical-consultation', null, {
|
||||
params: workspaceId ? { workspace_id: workspaceId } : {},
|
||||
})
|
||||
}
|
||||
|
||||
/** 添加团队成员 */
|
||||
export function addMember(teamId: string, data: {
|
||||
agent_id: string
|
||||
|
||||
@@ -25,6 +25,12 @@
|
||||
<el-button type="info" @click="handleCreateTechDocTemplate" :loading="creatingTechDocTemplate">
|
||||
<el-icon><MagicStick /></el-icon> 技术文档团队
|
||||
</el-button>
|
||||
<el-button type="primary" @click="handleCreateHealthTemplate" :loading="creatingHealthTemplate" plain>
|
||||
<el-icon><MagicStick /></el-icon> 健康管理团队
|
||||
</el-button>
|
||||
<el-button type="primary" @click="handleCreateMedicalTemplate" :loading="creatingMedicalTemplate" plain>
|
||||
<el-icon><MagicStick /></el-icon> 医疗咨询团队
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="toolbar-right">
|
||||
<el-select v-model="selectedTeamId" placeholder="加载已有团队" clearable style="width: 220px" @change="handleLoadTeam">
|
||||
@@ -293,7 +299,9 @@ import {
|
||||
} from '@element-plus/icons-vue'
|
||||
import {
|
||||
listTeams, getTeam, createTeam, updateTeam, createSoftwareCompanyTemplate,
|
||||
createEducationTrainingTemplate, createPlatformEngineeringTemplate, createTechDocTemplate, addMember, removeMember, executeProject, getPresetRoles,
|
||||
createEducationTrainingTemplate, createPlatformEngineeringTemplate, createTechDocTemplate,
|
||||
createHealthManagementTemplate, createMedicalConsultationTemplate,
|
||||
addMember, removeMember, executeProject, getPresetRoles,
|
||||
} from '@/api/teams'
|
||||
import api from '@/api'
|
||||
import { marked } from 'marked'
|
||||
@@ -326,6 +334,8 @@ const creatingTemplate = ref(false)
|
||||
const creatingEduTemplate = ref(false)
|
||||
const creatingPlatformTemplate = ref(false)
|
||||
const creatingTechDocTemplate = ref(false)
|
||||
const creatingHealthTemplate = ref(false)
|
||||
const creatingMedicalTemplate = ref(false)
|
||||
const loadingTeams = ref(false)
|
||||
|
||||
// Agent
|
||||
@@ -594,6 +604,60 @@ async function handleCreateTechDocTemplate() {
|
||||
}
|
||||
}
|
||||
|
||||
// 一键创建健康管理团队模板
|
||||
async function handleCreateHealthTemplate() {
|
||||
creatingHealthTemplate.value = true
|
||||
try {
|
||||
const res = await createHealthManagementTemplate()
|
||||
const team = (res.data as any)?.data
|
||||
if (team) {
|
||||
currentTeamId.value = team.id; teamName.value = team.name
|
||||
await loadAgents()
|
||||
const slots: Record<string, any> = {}
|
||||
if (team.members) {
|
||||
for (const m of team.members) {
|
||||
const agent = agents.value.find(a => a.id === m.agent_id)
|
||||
if (agent) slots[m.role] = { ...agent, is_lead: m.is_lead, member_id: m.id }
|
||||
}
|
||||
}
|
||||
roleSlots.value = slots
|
||||
ElMessage.success('健康管理团队创建成功!')
|
||||
}
|
||||
await loadTeams()
|
||||
} catch (e: any) {
|
||||
ElMessage.error(e?.response?.data?.detail || '创建模板失败')
|
||||
} finally {
|
||||
creatingHealthTemplate.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 一键创建医疗咨询团队模板
|
||||
async function handleCreateMedicalTemplate() {
|
||||
creatingMedicalTemplate.value = true
|
||||
try {
|
||||
const res = await createMedicalConsultationTemplate()
|
||||
const team = (res.data as any)?.data
|
||||
if (team) {
|
||||
currentTeamId.value = team.id; teamName.value = team.name
|
||||
await loadAgents()
|
||||
const slots: Record<string, any> = {}
|
||||
if (team.members) {
|
||||
for (const m of team.members) {
|
||||
const agent = agents.value.find(a => a.id === m.agent_id)
|
||||
if (agent) slots[m.role] = { ...agent, is_lead: m.is_lead, member_id: m.id }
|
||||
}
|
||||
}
|
||||
roleSlots.value = slots
|
||||
ElMessage.success('医疗咨询团队创建成功!')
|
||||
}
|
||||
await loadTeams()
|
||||
} catch (e: any) {
|
||||
ElMessage.error(e?.response?.data?.detail || '创建模板失败')
|
||||
} finally {
|
||||
creatingMedicalTemplate.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 拖拽
|
||||
function onDragStart(agent: Agent) {
|
||||
draggingAgent = agent
|
||||
|
||||
Reference in New Issue
Block a user