feat: 更新数字人创作页面以支持技能选择功能

- 在节点库项中新增技能选择选项,允许用户为节点指定技能
- 更新API请求路径,统一为'/ai-agent'前缀
- 优化动态表单逻辑,确保根据节点类型正确显示技能选择器
- 移除冗余的文件上传函数,改为导入公共上传函数以简化代码结构
This commit is contained in:
2026-05-08 19:06:36 +08:00
parent 0c6cfe5c17
commit 8cc5f4be64
10 changed files with 1251 additions and 2285 deletions

View File

@@ -0,0 +1,117 @@
import request from '/@/utils/request';
// Skill 技能项
export interface SkillItem {
id: number;
name: string;
description: string;
category: string;
fileName: string;
fileUrl: string;
createdAt: string;
updatedAt: string;
}
// Skill 列表响应
export interface SkillListResponse {
list: SkillItem[];
total: number;
}
// 创建 Skill 参数
export interface CreateSkillParams {
name?: string;
description?: string;
category?: string;
fileName?: string;
fileUrl?: string;
[property: string]: any;
}
// 系统技能列表查询参数
export interface SkillListParams {
pageNum?: number;
pageSize?: number;
keyword?: string;
Total?: number;
}
// 用户技能列表查询参数
export interface UserSkillListParams {
pageNum?: number;
pageSize?: number;
keyword?: string;
Total?: number;
}
/**
* 获取 Skill 系统技能列表
*/
export function getSkillList(params?: SkillListParams, config?: any) {
return request<SkillListResponse>({
url: '/ai-agent/skill/template/list',
method: 'get',
params,
...config,
});
}
/**
* 创建 Skill 系统技能
*/
export function createSkill(data: CreateSkillParams, config?: any) {
return request({
url: '/ai-agent/skill/template/create',
method: 'post',
data,
...config,
});
}
/**
* 删除 Skill 系统技能
*/
export function deleteSkill(id: number, config?: any) {
return request({
url: '/ai-agent/skill/template/delete',
method: 'delete',
data: { id },
...config,
});
}
/**
* 获取 Skill 用户技能列表
*/
export function getUserSkillList(params?: UserSkillListParams, config?: any) {
return request<SkillListResponse>({
url: '/ai-agent/skill/user/list',
method: 'get',
params,
...config,
});
}
/**
* 创建 Skill 用户技能
*/
export function createUserSkill(data: CreateSkillParams, config?: any) {
return request({
url: '/ai-agent/skill/user/create',
method: 'post',
data,
...config,
});
}
/**
* 删除 Skill 用户技能
*/
export function deleteUserSkill(id: number, config?: any) {
return request({
url: '/ai-agent/skill/user/delete',
method: 'delete',
data: { id },
...config,
});
}