From 5531d0c737b2e535c8cd5c18158e544fbe2e427a Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Wed, 2 Sep 2026 20:24:35 +0800 Subject: [PATCH] feat: workflow --- ui/AGENTS.md | 4 ++ .../workspace/application/application.ts | 8 +++ ui/src/api/admin/workspace/shared.ts | 8 ++- ui/src/api/admin/workspace/tool/tool.ts | 6 +++ ui/src/api/enums/tool.ts | 2 +- ui/src/views/tool/ToolView.vue | 4 +- .../node-menu/ResourceNodeMenu.vue | 53 +++++++++---------- .../nodes/start-node/index.vue | 5 +- .../nodes/text-to-video-node/index.vue | 2 +- 9 files changed, 55 insertions(+), 37 deletions(-) diff --git a/ui/AGENTS.md b/ui/AGENTS.md index cbe0ae8c1ab..c1a40bee3fe 100644 --- a/ui/AGENTS.md +++ b/ui/AGENTS.md @@ -189,6 +189,10 @@ Keep these behaviors: ## Frontend Implementation Notes - Prefer existing project structure and naming. +- Before changing existing behavior, trace the affected flow and dependent requirements, including + why the current implementation exists. If the requested change is likely to remove a requirement + or introduce a regression, pause before editing, explain the risk, recommend a safer approach, + and wait for confirmation. - Keep UI code typed and data-driven. - Use Lodash `cloneDeep` for deep cloning; do not use `structuredClone`. - Explicitly import APIs used from Vue, Vue Router, and Pinia; do not restore API auto import. diff --git a/ui/src/api/admin/workspace/application/application.ts b/ui/src/api/admin/workspace/application/application.ts index 402a3c868db..e28af47f92c 100644 --- a/ui/src/api/admin/workspace/application/application.ts +++ b/ui/src/api/admin/workspace/application/application.ts @@ -8,6 +8,13 @@ const getPrefix = () => { return `/workspace/${workspaceId}/application` } +/** + * 获取不分页的全部应用 + */ +const getAllApplication = (query?: Dict) => { + return get(`${getPrefix()}`, query) +} + /** 获取工作空间智能体列表。 */ const getApplicationPage = (page: ParamsPage, query?: Dict) => { return get>(`${getPrefix()}/${page.currentPage}/${page.pageSize}`, query) @@ -77,4 +84,5 @@ export default { putBatchDeleteApplications, putBatchMoveApplications, putApplicationPublish, + getAllApplication, } diff --git a/ui/src/api/admin/workspace/shared.ts b/ui/src/api/admin/workspace/shared.ts index 0d9172f2d14..bbfa7ba9f02 100644 --- a/ui/src/api/admin/workspace/shared.ts +++ b/ui/src/api/admin/workspace/shared.ts @@ -13,14 +13,18 @@ const getModelList = (query?: Dict) => { return get(`${getPrefix()}/model`, query) } -/** 获取工作空间共享的工具列表。 */ +/** 获取工作空间共享的分页工具列表。 */ const getToolPage = (page: ParamsPage, query?: Dict) => { return get>(`${getPrefix()}/tool/${page.currentPage}/${page.pageSize}`, query) } +/** 获取工作空间共享的不分页所有工具列表。 */ +const getAllTool = (query?: Dict) => { + return get(`${getPrefix()}/tool`, query) +} /** 获取工作空间共享的知识库列表。 */ const getKnowledgePage = (page: ParamsPage, query?: Dict) => { return get>(`${getPrefix()}/knowledge/${page.currentPage}/${page.pageSize}`, query) } -export default { getKnowledgePage, getModelList, getToolPage } +export default { getKnowledgePage, getModelList, getToolPage, getAllTool } diff --git a/ui/src/api/admin/workspace/tool/tool.ts b/ui/src/api/admin/workspace/tool/tool.ts index 35936d867cb..a41ed578ee6 100644 --- a/ui/src/api/admin/workspace/tool/tool.ts +++ b/ui/src/api/admin/workspace/tool/tool.ts @@ -8,6 +8,11 @@ const getPrefix = () => { return `/workspace/${workspaceId}/tool` } +/** 获取不分页的全部工具列表。 */ +const getAllTool = (query?: Dict) => { + return get<{ tools: ToolItem[] }>(`${getPrefix()}`, query).then(({ tools }) => tools) +} + /** 获取工具分页列表。 */ const getToolPage = (page: ParamsPage, query?: Dict) => { return get>(`${getPrefix()}/${page.currentPage}/${page.pageSize}`, query) @@ -104,4 +109,5 @@ export default { putBatchDeleteTools, putBatchMoveTools, putTool, + getAllTool, } diff --git a/ui/src/api/enums/tool.ts b/ui/src/api/enums/tool.ts index 187edf89932..0d813184951 100644 --- a/ui/src/api/enums/tool.ts +++ b/ui/src/api/enums/tool.ts @@ -1,4 +1,4 @@ -/** 后端 Workspace 工具作用域枚举值。 */ +/** TODO 后端 Workspace 工具作用域枚举值。 */ export const TOOL_SCOPE = { INTERNAL: 'INTERNAL', SHARED: 'SHARED', WORKSPACE: 'WORKSPACE' } as const /** 后端 Workspace 工具类型枚举值。 */ diff --git a/ui/src/views/tool/ToolView.vue b/ui/src/views/tool/ToolView.vue index e05bfe2fa5b..0817da730e3 100644 --- a/ui/src/views/tool/ToolView.vue +++ b/ui/src/views/tool/ToolView.vue @@ -6,7 +6,7 @@ import ToolApi from '@/api/admin/workspace/tool/tool' import SharedApi from '@/api/admin/workspace/shared' import ToolStoreApi from '@/api/admin/tool-store.ts' import type { Dict, FolderItem, OptionItem, ToolItem, ToolStoreResponse, ToolType } from '@/api/types' -import { RESOURCE_TYPE, TOOL_SCOPE, TOOL_TYPE } from '@/api/enums' +import { RESOURCE_TYPE, TOOL_TYPE } from '@/api/enums' import { TOOL_TYPE_OPTIONS, FOLDER_ENTRIES, FOLDER_ENTRY_ID } from '@/constants' import FolderTree from '@/components/business/folder-tree/index.vue' import MoveToDialog from '@/components/business/folder-tree/MoveToDialog.vue' @@ -69,7 +69,7 @@ const toolType = ref('') function loadToolsPage(pagination: { currentPage: number; pageSize: number }) { const request = isShared.value ? SharedApi : ToolApi const folderId = isShared.value ? {} : { folder_id: currentFolder.value.id || FOLDER_ENTRY_ID.ALL } - return request.getToolPage(pagination, { ...toolQuery.value, scope: TOOL_SCOPE.WORKSPACE, tool_type: toolType.value, ...folderId }) + return request.getToolPage(pagination, { ...toolQuery.value, tool_type: toolType.value, ...folderId }) } // 加载工具商店 diff --git a/ui/src/workflow-canvas/node-menu/ResourceNodeMenu.vue b/ui/src/workflow-canvas/node-menu/ResourceNodeMenu.vue index 0567da7e42f..f52616bd4fa 100644 --- a/ui/src/workflow-canvas/node-menu/ResourceNodeMenu.vue +++ b/ui/src/workflow-canvas/node-menu/ResourceNodeMenu.vue @@ -1,11 +1,11 @@