diff --git a/ui/src/assets/workflow/icon_condition.svg b/ui/src/assets/workflow/icon_condition.svg new file mode 100644 index 00000000000..2bc80a2125e --- /dev/null +++ b/ui/src/assets/workflow/icon_condition.svg @@ -0,0 +1,3 @@ + + + diff --git a/ui/src/views/VIEW_README.md b/ui/src/views/VIEW_README.md index 569983e7dc3..174fea5632d 100644 --- a/ui/src/views/VIEW_README.md +++ b/ui/src/views/VIEW_README.md @@ -273,3 +273,28 @@ Dialog。新增或重命名文件时,应同步更新所有导入和页面功 - Element Plus 登录表单通过 `formEl.validate((valid, fields) => {})` 回调处理校验结果。 - LDAP 与本地账号登录保留清晰的条件分支,请求结果使用 `.then().catch()` 处理;未经明确要求, 不改写为 `try/catch` 或额外抽象登录提交流程。 + +## 工作流页面布局 + +`workflow/components/WorkflowViewLayout.vue` 由 `ApplicationWorkflowView` 和 `ToolWorkflowView` +共同使用,统一全屏容器、页面头部、返回按钮、标题和保存时间展示。通过 `loading`、`title`、 +`saveTime` 传入展示状态,点击返回按钮触发 `back` 事件。 + +`actions` 插槽用于添加组件、保存、调试等页面操作,默认插槽放置画布及页面浮层;画布继续使用 +`min-h-0 flex-1` 占满头部下方空间。页面保留画布 Ref、资源与模式配置、接口调用、保存和退出确认 +逻辑,布局组件只负责展示。 + +## 工作流默认模型设置 + +`workflow/components/DefaultModelSetting.vue` 维护默认模型面板,按模型类型组织本地暂存配置。 +调用方通过 `show` 控制显示,通过 `v-model` 接收保存后的配置,通过 `save` 执行页面持久化, +通过 `close` 关闭面板。只读场景传入 `readonly`。编辑与参数弹窗不直接修改父级配置;有修改时 +点击面板外会区分保存、丢弃和取消。 + +模型查询通过必填的完整 `modelApi` 对象执行(类型使用 `typeof ModelApi`),可用 `modelQuery` +补充资源范围需要的查询参数;调用方负责选择 API,组件不从 URL 推断资源范围。供应商列表通过 +当前公共供应商接口查询。模型选择及参数设置复用 `ModelSelect`,重排序模型隐藏参数入口。 + +传入 `workflowRef` 后支持“应用到所有节点”:只切换节点的模型来源,保留自定义模型 ID 和参数, +递归处理循环体,并保留基本信息节点中关闭的语音/长期记忆配置及浏览器语音播放模式。 +该操作修改画布,由页面原有保存流程持久化,不自动提交面板内暂存的默认模型设置。 diff --git a/ui/src/views/application/create-application/template.ts b/ui/src/views/application/create-application/template.ts index 3160cc90277..f2cca49a79e 100644 --- a/ui/src/views/application/create-application/template.ts +++ b/ui/src/views/application/create-application/template.ts @@ -109,6 +109,12 @@ export const applicationTemplate = { }, ], }, + fields: [ + { + label: '\u7528\u6237\u95ee\u9898', + value: 'question', + }, + ], height: 456, showNode: true, stepName: '\u5f00\u59cb', @@ -168,8 +174,8 @@ export const applicationTemplate = { }, }, { - x: 1674.3959141131284, - y: 355.1933576515028, + x: 1822.6628761517477, + y: 376.8206988860253, id: '420a6e4f-44ff-4847-bb81-0923630846b5', type: 'condition-node', properties: { @@ -182,7 +188,7 @@ export const applicationTemplate = { }, ], }, - height: 521, + height: 569, showNode: true, stepName: '\u5224\u65ad\u5668', condition: 'AND', @@ -225,24 +231,24 @@ export const applicationTemplate = { { id: '7887', index: 0, - height: 131, + height: 139, }, { id: '6847', index: 1, - height: 131, + height: 139, }, { id: '2794', index: 2, - height: 53, + height: 85, }, ], }, }, { - x: 2355.996367613652, - y: -103.96767312799687, + x: 2487.238292469783, + y: -96.76253793813842, id: '36a440a9-5b00-4d82-b13a-8e7819112918', type: 'reply-node', properties: { @@ -269,8 +275,8 @@ export const applicationTemplate = { }, }, { - x: 2359.3250515262043, - y: 660.4876603554833, + x: 2488.3008451532673, + y: 660.574819248909, id: 'f7c3b4a2-cb80-4e47-b050-7fef0315daaf', type: 'ai-chat-node', properties: { @@ -323,8 +329,8 @@ export const applicationTemplate = { }, }, { - x: 2361.1510484115624, - y: 1489.7353190606702, + x: 2489.758837821939, + y: 1491.5462871796265, id: '04dd6c1e-95f9-4757-bb3e-134d503fce54', type: 'reply-node', properties: { @@ -392,8 +398,8 @@ export const applicationTemplate = { id: '6a8d23d9-5179-424e-80c2-f08d37cdb8d4', type: 'app-edge', endPoint: { - x: 1514.3959141131284, - y: 355.1933576515028, + x: 1522.6628761517477, + y: 376.8206988860253, }, pointsList: [ { @@ -405,12 +411,12 @@ export const applicationTemplate = { y: 443.29042897959704, }, { - x: 1414.3959141131284, - y: 355.1933576515028, + x: 1422.6628761517477, + y: 376.8206988860253, }, { - x: 1514.3959141131284, - y: 355.1933576515028, + x: 1522.6628761517477, + y: 376.8206988860253, }, ], properties: {}, @@ -427,31 +433,31 @@ export const applicationTemplate = { id: '56006748-d9fe-491b-a14b-04fd568cac08', type: 'app-edge', endPoint: { - x: 2195.996367613652, - y: -103.96767312799687, + x: 2327.238292469783, + y: -96.76253793813842, }, pointsList: [ { - x: 1834.3959141131284, - y: 235.19335765150282, + x: 2122.662876151749, + y: 236.8206988860253, }, { - x: 1934.3959141131284, - y: 235.19335765150282, + x: 2222.662876151749, + y: 236.8206988860253, }, { - x: 2095.996367613652, - y: -103.96767312799687, + x: 2227.238292469783, + y: -96.76253793813842, }, { - x: 2195.996367613652, - y: -103.96767312799687, + x: 2327.238292469783, + y: -96.76253793813842, }, ], properties: {}, startPoint: { - x: 1834.3959141131284, - y: 235.19335765150282, + x: 2122.662876151749, + y: 236.8206988860253, }, sourceNodeId: '420a6e4f-44ff-4847-bb81-0923630846b5', targetNodeId: '36a440a9-5b00-4d82-b13a-8e7819112918', @@ -462,31 +468,31 @@ export const applicationTemplate = { id: '9bc8721b-07aa-4730-9347-910ed64e26b9', type: 'app-edge', endPoint: { - x: 2199.3250515262043, - y: 660.4876603554833, + x: 2328.3008451532673, + y: 660.574819248909, }, pointsList: [ { - x: 1834.3959141131284, - y: 374.1933576515028, + x: 2122.662876151749, + y: 383.8206988860253, }, { - x: 1934.3959141131284, - y: 374.1933576515028, + x: 2222.662876151749, + y: 383.8206988860253, }, { - x: 2099.3250515262043, - y: 660.4876603554833, + x: 2228.3008451532673, + y: 660.574819248909, }, { - x: 2199.3250515262043, - y: 660.4876603554833, + x: 2328.3008451532673, + y: 660.574819248909, }, ], properties: {}, startPoint: { - x: 1834.3959141131284, - y: 374.1933576515028, + x: 2122.662876151749, + y: 383.8206988860253, }, sourceNodeId: '420a6e4f-44ff-4847-bb81-0923630846b5', targetNodeId: 'f7c3b4a2-cb80-4e47-b050-7fef0315daaf', @@ -497,31 +503,31 @@ export const applicationTemplate = { id: 'c276a5b6-ec29-4ab9-b911-a0a929ff193f', type: 'app-edge', endPoint: { - x: 2201.1510484115624, - y: 1489.7353190606702, + x: 2329.758837821939, + y: 1491.5462871796265, }, pointsList: [ { - x: 1834.3959141131284, - y: 474.1933576515028, + x: 2122.662876151749, + y: 503.8206988860254, }, { - x: 1934.3959141131284, - y: 474.1933576515028, + x: 2222.662876151749, + y: 503.8206988860254, }, { - x: 2101.1510484115624, - y: 1489.7353190606702, + x: 2229.758837821939, + y: 1491.5462871796265, }, { - x: 2201.1510484115624, - y: 1489.7353190606702, + x: 2329.758837821939, + y: 1491.5462871796265, }, ], properties: {}, startPoint: { - x: 1834.3959141131284, - y: 474.1933576515028, + x: 2122.662876151749, + y: 503.8206988860254, }, sourceNodeId: '420a6e4f-44ff-4847-bb81-0923630846b5', targetNodeId: '04dd6c1e-95f9-4757-bb3e-134d503fce54', diff --git a/ui/src/views/workflow/ApplicationWorkflowView.vue b/ui/src/views/workflow/ApplicationWorkflowView.vue index 161605217e1..0359407e67c 100644 --- a/ui/src/views/workflow/ApplicationWorkflowView.vue +++ b/ui/src/views/workflow/ApplicationWorkflowView.vue @@ -8,12 +8,12 @@ import { cloneDeep } from 'lodash' import ApplicationApi from '@/api/admin/workspace/application/application.ts' import { RESOURCE_TYPE } from '@/api/enums' import type { ApplicationDetail } from '@/api/types' -import { datetimeFormat } from '@/utils/time' import { MsgConfirm, MsgSuccess } from '@/utils/message' import WorkflowCanvas from '@/workflow-canvas/index.vue' import { defaultApplicationNodes } from '@/workflow-canvas/config/node-mapping' import { WorkflowMode, type ShapeItem } from '@/workflow-canvas/types' -import WorkflowComponentMenu from './components/WorkflowComponentMenu.vue' +import CreateNodeMenu from './components/CreateNodeMenu.vue' +import WorkflowViewLayout from './components/WorkflowViewLayout.vue' import Conversation from '@/components/conversation/index.vue' defineOptions({ name: 'ApplicationWorkflowView' }) @@ -35,10 +35,6 @@ function handleAddNode(shapeItem: ShapeItem) { workflowRef.value?.addNode(shapeItem) } -function handleDragNode(shapeItem: ShapeItem, event: PointerEvent) { - workflowRef.value?.onmousedown(shapeItem, event) -} - /* 智能体工作流加载与保存 */ const applicationDetail = ref() const loading = ref(false) @@ -247,58 +243,41 @@ onMounted(() => { +