Skip to content

Commit ebb2c0a

Browse files
feat: workflow
1 parent d34f6ae commit ebb2c0a

17 files changed

Lines changed: 609 additions & 395 deletions

File tree

Lines changed: 3 additions & 0 deletions
Loading

‎ui/src/views/VIEW_README.md‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,3 +273,28 @@ Dialog。新增或重命名文件时,应同步更新所有导入和页面功
273273
- Element Plus 登录表单通过 `formEl.validate((valid, fields) => {})` 回调处理校验结果。
274274
- LDAP 与本地账号登录保留清晰的条件分支,请求结果使用 `.then().catch()` 处理;未经明确要求,
275275
不改写为 `try/catch` 或额外抽象登录提交流程。
276+
277+
## 工作流页面布局
278+
279+
`workflow/components/WorkflowViewLayout.vue` 由 `ApplicationWorkflowView` 和 `ToolWorkflowView`
280+
共同使用,统一全屏容器、页面头部、返回按钮、标题和保存时间展示。通过 `loading`、`title`、
281+
`saveTime` 传入展示状态,点击返回按钮触发 `back` 事件。
282+
283+
`actions` 插槽用于添加组件、保存、调试等页面操作,默认插槽放置画布及页面浮层;画布继续使用
284+
`min-h-0 flex-1` 占满头部下方空间。页面保留画布 Ref、资源与模式配置、接口调用、保存和退出确认
285+
逻辑,布局组件只负责展示。
286+
287+
## 工作流默认模型设置
288+
289+
`workflow/components/DefaultModelSetting.vue` 维护默认模型面板,按模型类型组织本地暂存配置。
290+
调用方通过 `show` 控制显示,通过 `v-model` 接收保存后的配置,通过 `save` 执行页面持久化,
291+
通过 `close` 关闭面板。只读场景传入 `readonly`。编辑与参数弹窗不直接修改父级配置;有修改时
292+
点击面板外会区分保存、丢弃和取消。
293+
294+
模型查询通过必填的完整 `modelApi` 对象执行(类型使用 `typeof ModelApi`),可用 `modelQuery`
295+
补充资源范围需要的查询参数;调用方负责选择 API,组件不从 URL 推断资源范围。供应商列表通过
296+
当前公共供应商接口查询。模型选择及参数设置复用 `ModelSelect`,重排序模型隐藏参数入口。
297+
298+
传入 `workflowRef` 后支持“应用到所有节点”:只切换节点的模型来源,保留自定义模型 ID 和参数,
299+
递归处理循环体,并保留基本信息节点中关闭的语音/长期记忆配置及浏览器语音播放模式。
300+
该操作修改画布,由页面原有保存流程持久化,不自动提交面板内暂存的默认模型设置。

‎ui/src/views/application/create-application/template.ts‎

Lines changed: 60 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ export const applicationTemplate = {
109109
},
110110
],
111111
},
112+
fields: [
113+
{
114+
label: '\u7528\u6237\u95ee\u9898',
115+
value: 'question',
116+
},
117+
],
112118
height: 456,
113119
showNode: true,
114120
stepName: '\u5f00\u59cb',
@@ -168,8 +174,8 @@ export const applicationTemplate = {
168174
},
169175
},
170176
{
171-
x: 1674.3959141131284,
172-
y: 355.1933576515028,
177+
x: 1822.6628761517477,
178+
y: 376.8206988860253,
173179
id: '420a6e4f-44ff-4847-bb81-0923630846b5',
174180
type: 'condition-node',
175181
properties: {
@@ -182,7 +188,7 @@ export const applicationTemplate = {
182188
},
183189
],
184190
},
185-
height: 521,
191+
height: 569,
186192
showNode: true,
187193
stepName: '\u5224\u65ad\u5668',
188194
condition: 'AND',
@@ -225,24 +231,24 @@ export const applicationTemplate = {
225231
{
226232
id: '7887',
227233
index: 0,
228-
height: 131,
234+
height: 139,
229235
},
230236
{
231237
id: '6847',
232238
index: 1,
233-
height: 131,
239+
height: 139,
234240
},
235241
{
236242
id: '2794',
237243
index: 2,
238-
height: 53,
244+
height: 85,
239245
},
240246
],
241247
},
242248
},
243249
{
244-
x: 2355.996367613652,
245-
y: -103.96767312799687,
250+
x: 2487.238292469783,
251+
y: -96.76253793813842,
246252
id: '36a440a9-5b00-4d82-b13a-8e7819112918',
247253
type: 'reply-node',
248254
properties: {
@@ -269,8 +275,8 @@ export const applicationTemplate = {
269275
},
270276
},
271277
{
272-
x: 2359.3250515262043,
273-
y: 660.4876603554833,
278+
x: 2488.3008451532673,
279+
y: 660.574819248909,
274280
id: 'f7c3b4a2-cb80-4e47-b050-7fef0315daaf',
275281
type: 'ai-chat-node',
276282
properties: {
@@ -323,8 +329,8 @@ export const applicationTemplate = {
323329
},
324330
},
325331
{
326-
x: 2361.1510484115624,
327-
y: 1489.7353190606702,
332+
x: 2489.758837821939,
333+
y: 1491.5462871796265,
328334
id: '04dd6c1e-95f9-4757-bb3e-134d503fce54',
329335
type: 'reply-node',
330336
properties: {
@@ -392,8 +398,8 @@ export const applicationTemplate = {
392398
id: '6a8d23d9-5179-424e-80c2-f08d37cdb8d4',
393399
type: 'app-edge',
394400
endPoint: {
395-
x: 1514.3959141131284,
396-
y: 355.1933576515028,
401+
x: 1522.6628761517477,
402+
y: 376.8206988860253,
397403
},
398404
pointsList: [
399405
{
@@ -405,12 +411,12 @@ export const applicationTemplate = {
405411
y: 443.29042897959704,
406412
},
407413
{
408-
x: 1414.3959141131284,
409-
y: 355.1933576515028,
414+
x: 1422.6628761517477,
415+
y: 376.8206988860253,
410416
},
411417
{
412-
x: 1514.3959141131284,
413-
y: 355.1933576515028,
418+
x: 1522.6628761517477,
419+
y: 376.8206988860253,
414420
},
415421
],
416422
properties: {},
@@ -427,31 +433,31 @@ export const applicationTemplate = {
427433
id: '56006748-d9fe-491b-a14b-04fd568cac08',
428434
type: 'app-edge',
429435
endPoint: {
430-
x: 2195.996367613652,
431-
y: -103.96767312799687,
436+
x: 2327.238292469783,
437+
y: -96.76253793813842,
432438
},
433439
pointsList: [
434440
{
435-
x: 1834.3959141131284,
436-
y: 235.19335765150282,
441+
x: 2122.662876151749,
442+
y: 236.8206988860253,
437443
},
438444
{
439-
x: 1934.3959141131284,
440-
y: 235.19335765150282,
445+
x: 2222.662876151749,
446+
y: 236.8206988860253,
441447
},
442448
{
443-
x: 2095.996367613652,
444-
y: -103.96767312799687,
449+
x: 2227.238292469783,
450+
y: -96.76253793813842,
445451
},
446452
{
447-
x: 2195.996367613652,
448-
y: -103.96767312799687,
453+
x: 2327.238292469783,
454+
y: -96.76253793813842,
449455
},
450456
],
451457
properties: {},
452458
startPoint: {
453-
x: 1834.3959141131284,
454-
y: 235.19335765150282,
459+
x: 2122.662876151749,
460+
y: 236.8206988860253,
455461
},
456462
sourceNodeId: '420a6e4f-44ff-4847-bb81-0923630846b5',
457463
targetNodeId: '36a440a9-5b00-4d82-b13a-8e7819112918',
@@ -462,31 +468,31 @@ export const applicationTemplate = {
462468
id: '9bc8721b-07aa-4730-9347-910ed64e26b9',
463469
type: 'app-edge',
464470
endPoint: {
465-
x: 2199.3250515262043,
466-
y: 660.4876603554833,
471+
x: 2328.3008451532673,
472+
y: 660.574819248909,
467473
},
468474
pointsList: [
469475
{
470-
x: 1834.3959141131284,
471-
y: 374.1933576515028,
476+
x: 2122.662876151749,
477+
y: 383.8206988860253,
472478
},
473479
{
474-
x: 1934.3959141131284,
475-
y: 374.1933576515028,
480+
x: 2222.662876151749,
481+
y: 383.8206988860253,
476482
},
477483
{
478-
x: 2099.3250515262043,
479-
y: 660.4876603554833,
484+
x: 2228.3008451532673,
485+
y: 660.574819248909,
480486
},
481487
{
482-
x: 2199.3250515262043,
483-
y: 660.4876603554833,
488+
x: 2328.3008451532673,
489+
y: 660.574819248909,
484490
},
485491
],
486492
properties: {},
487493
startPoint: {
488-
x: 1834.3959141131284,
489-
y: 374.1933576515028,
494+
x: 2122.662876151749,
495+
y: 383.8206988860253,
490496
},
491497
sourceNodeId: '420a6e4f-44ff-4847-bb81-0923630846b5',
492498
targetNodeId: 'f7c3b4a2-cb80-4e47-b050-7fef0315daaf',
@@ -497,31 +503,31 @@ export const applicationTemplate = {
497503
id: 'c276a5b6-ec29-4ab9-b911-a0a929ff193f',
498504
type: 'app-edge',
499505
endPoint: {
500-
x: 2201.1510484115624,
501-
y: 1489.7353190606702,
506+
x: 2329.758837821939,
507+
y: 1491.5462871796265,
502508
},
503509
pointsList: [
504510
{
505-
x: 1834.3959141131284,
506-
y: 474.1933576515028,
511+
x: 2122.662876151749,
512+
y: 503.8206988860254,
507513
},
508514
{
509-
x: 1934.3959141131284,
510-
y: 474.1933576515028,
515+
x: 2222.662876151749,
516+
y: 503.8206988860254,
511517
},
512518
{
513-
x: 2101.1510484115624,
514-
y: 1489.7353190606702,
519+
x: 2229.758837821939,
520+
y: 1491.5462871796265,
515521
},
516522
{
517-
x: 2201.1510484115624,
518-
y: 1489.7353190606702,
523+
x: 2329.758837821939,
524+
y: 1491.5462871796265,
519525
},
520526
],
521527
properties: {},
522528
startPoint: {
523-
x: 1834.3959141131284,
524-
y: 474.1933576515028,
529+
x: 2122.662876151749,
530+
y: 503.8206988860254,
525531
},
526532
sourceNodeId: '420a6e4f-44ff-4847-bb81-0923630846b5',
527533
targetNodeId: '04dd6c1e-95f9-4757-bb3e-134d503fce54',

0 commit comments

Comments
 (0)