fix: 完成系统向智能体数据链路切换

- 切换工作台、聊天历史、资源候选与公共调用到 Agent

- 加固资源绑定、删除保护及发布运行并发控制

- 隔离旧 Bot 专属服务和组件并保留兼容入口
This commit is contained in:
2026-07-31 14:24:15 +08:00
parent f0aba1eddd
commit f872eac1f9
114 changed files with 5997 additions and 874 deletions

View File

@@ -41,7 +41,7 @@ defineExpose({
openDialog,
});
type ResourceType = '' | 'BOT' | 'KNOWLEDGE' | 'WORKFLOW';
type ResourceType = '' | 'AGENT' | 'BOT' | 'KNOWLEDGE' | 'WORKFLOW';
type ActionType = '' | 'DELETE' | 'OFFLINE' | 'PUBLISH';
type ScopeType = 'CATEGORY' | 'DEPT';
type FlowStatus = 'DISABLED' | 'ENABLED';
@@ -88,7 +88,7 @@ interface FlowFormModel {
}
const RESOURCE_OPTIONS = [
{ label: $t('approval.resource.bot'), value: 'BOT' },
{ label: $t('approval.resource.agent'), value: 'AGENT' },
{ label: $t('approval.resource.workflow'), value: 'WORKFLOW' },
{ label: $t('approval.resource.knowledge'), value: 'KNOWLEDGE' },
];
@@ -128,6 +128,7 @@ const deptTreeOptions = ref<any[]>([]);
const roleOptions = ref<SelectOption[]>([]);
const accountOptions = ref<SelectOption[]>([]);
const categoryOptions = ref<Record<Exclude<ResourceType, ''>, SelectOption[]>>({
AGENT: [],
BOT: [],
KNOWLEDGE: [],
WORKFLOW: [],
@@ -188,7 +189,7 @@ function buildDefaultForm(): FlowFormModel {
name: '',
priority: 100,
remark: '',
resourceType: 'BOT',
resourceType: 'AGENT',
scopes: [],
status: 'ENABLED',
steps: [buildDefaultStep()],
@@ -236,7 +237,7 @@ async function openDialog(row: any = {}) {
name: res.data?.name || '',
priority: Number(res.data?.priority || 100),
remark: res.data?.remark || '',
resourceType: res.data?.resourceType || 'BOT',
resourceType: res.data?.resourceType || 'AGENT',
scopes: (res.data?.scopes || []).map((item: any) => ({
id: item.id,
includeChildren: item.includeChildren === 1,
@@ -279,8 +280,8 @@ async function ensureCategoryOptions() {
if (categoryLoaded.value) {
return;
}
const [botRes, workflowRes, knowledgeRes] = await Promise.all([
api.get('/api/v1/botCategory/list', {
const [agentRes, workflowRes, knowledgeRes] = await Promise.all([
api.get('/api/v1/agentCategory/list', {
params: { sortKey: 'sortNo', sortType: 'asc' },
}),
api.get('/api/v1/workflowCategory/list', {
@@ -291,7 +292,8 @@ async function ensureCategoryOptions() {
}),
]);
categoryOptions.value = {
BOT: normalizeCategoryOptions(botRes.data, 'categoryName'),
AGENT: normalizeCategoryOptions(agentRes.data, 'categoryName'),
BOT: [],
KNOWLEDGE: normalizeCategoryOptions(knowledgeRes.data, 'categoryName'),
WORKFLOW: normalizeCategoryOptions(workflowRes.data, 'categoryName'),
};