@pactor-app/skills 1.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +40 -0
  3. package/package.json +26 -0
  4. package/pactor/SKILL.md +373 -0
  5. package/pactor/references/dsl-authoring.md +448 -0
  6. package/prd-to-app/SKILL.md +75 -0
  7. package/prd-to-app/references/acceptance-checklist.md +47 -0
  8. package/prd-to-app/references/component-mapping.md +41 -0
  9. package/prd-to-app/references/mock-data-routes.md +66 -0
  10. package/prd-to-app/references/page-templates.md +274 -0
  11. package/prd-to-app/references/project-structure.md +89 -0
  12. package/prd-to-app/references/theme-and-style.md +41 -0
  13. package/prd-to-app/template/README.md +26 -0
  14. package/prd-to-app/template/app/[[...slug]]/page.tsx +7 -0
  15. package/prd-to-app/template/app/api/auth/login/route.ts +32 -0
  16. package/prd-to-app/template/app/api/auth/logout/route.ts +22 -0
  17. package/prd-to-app/template/app/api/data/[...parts]/route.ts +118 -0
  18. package/prd-to-app/template/app/api/public/pages/[id]/route.ts +40 -0
  19. package/prd-to-app/template/app/api/sitemap/route.ts +21 -0
  20. package/prd-to-app/template/app/api/users/route.ts +57 -0
  21. package/prd-to-app/template/app/favicon.ico +0 -0
  22. package/prd-to-app/template/app/globals.css +248 -0
  23. package/prd-to-app/template/app/layout.tsx +49 -0
  24. package/prd-to-app/template/app/login.css +122 -0
  25. package/prd-to-app/template/eslint.config.mjs +18 -0
  26. package/prd-to-app/template/next-env.d.ts +7 -0
  27. package/prd-to-app/template/next.config.js +32 -0
  28. package/prd-to-app/template/package.json +34 -0
  29. package/prd-to-app/template/pnpm-lock.yaml +6854 -0
  30. package/prd-to-app/template/pnpm-workspace.yaml +7 -0
  31. package/prd-to-app/template/postcss.config.mjs +7 -0
  32. package/prd-to-app/template/public/file.svg +1 -0
  33. package/prd-to-app/template/public/globe.svg +1 -0
  34. package/prd-to-app/template/public/next.svg +1 -0
  35. package/prd-to-app/template/public/skins/chenwunaifu.css +111 -0
  36. package/prd-to-app/template/public/skins/taijingshenlin.css +109 -0
  37. package/prd-to-app/template/public/skins/xuanzhimoyun.css +110 -0
  38. package/prd-to-app/template/public/vercel.svg +1 -0
  39. package/prd-to-app/template/public/window.svg +1 -0
  40. package/prd-to-app/template/scripts/build.mjs +35 -0
  41. package/prd-to-app/template/src/pactor/App.tsx +55 -0
  42. package/prd-to-app/template/src/pactor/actions.ts +438 -0
  43. package/prd-to-app/template/src/pactor/components/card-links.tsx +86 -0
  44. package/prd-to-app/template/src/pactor/components/chip-filter.tsx +89 -0
  45. package/prd-to-app/template/src/pactor/components/chip-node.tsx +46 -0
  46. package/prd-to-app/template/src/pactor/components/debug-chat.tsx +189 -0
  47. package/prd-to-app/template/src/pactor/components/index.ts +28 -0
  48. package/prd-to-app/template/src/pactor/components/log-status.tsx +64 -0
  49. package/prd-to-app/template/src/pactor/components/status-badge.tsx +46 -0
  50. package/prd-to-app/template/src/pactor/components/theme-switcher.tsx +136 -0
  51. package/prd-to-app/template/src/pactor/config.ts +28 -0
  52. package/prd-to-app/template/src/pactor/mocks/audit-mock.ts +403 -0
  53. package/prd-to-app/template/src/pactor/mocks/call-logs-mock.ts +875 -0
  54. package/prd-to-app/template/src/pactor/mocks/client-debug-mock.ts +188 -0
  55. package/prd-to-app/template/src/pactor/mocks/client-templates-mock.ts +497 -0
  56. package/prd-to-app/template/src/pactor/mocks/clients-mock.ts +483 -0
  57. package/prd-to-app/template/src/pactor/mocks/costs-mock.ts +406 -0
  58. package/prd-to-app/template/src/pactor/mocks/dashboard-mock.ts +192 -0
  59. package/prd-to-app/template/src/pactor/mocks/model-debug-mock.ts +144 -0
  60. package/prd-to-app/template/src/pactor/mocks/models-mock.ts +799 -0
  61. package/prd-to-app/template/src/pactor/mocks/ops-usage-mock.ts +806 -0
  62. package/prd-to-app/template/src/pactor/mocks/providers-mock.ts +424 -0
  63. package/prd-to-app/template/src/pactor/mocks/routes-mock.ts +604 -0
  64. package/prd-to-app/template/src/pactor/services.ts +185 -0
  65. package/prd-to-app/template/src/pactor/skin.ts +52 -0
  66. package/prd-to-app/template/src/server/accounts.ts +63 -0
  67. package/prd-to-app/template/src/server/cors.ts +34 -0
  68. package/prd-to-app/template/src/server/sitemap.ts +176 -0
  69. package/prd-to-app/template/src/server/yaml/common/dashboard.yaml +498 -0
  70. package/prd-to-app/template/src/server/yaml/common/login.yaml +84 -0
  71. package/prd-to-app/template/src/server/yaml/provider/provider-create.yaml +340 -0
  72. package/prd-to-app/template/src/server/yaml/provider/provider-detail.yaml +780 -0
  73. package/prd-to-app/template/src/server/yaml/provider/provider-edit.yaml +366 -0
  74. package/prd-to-app/template/src/server/yaml/provider/provider-list.yaml +1989 -0
  75. package/prd-to-app/template/src/server/yaml/route/route-create.yaml +511 -0
  76. package/prd-to-app/template/src/server/yaml/route/route-detail.yaml +610 -0
  77. package/prd-to-app/template/src/server/yaml/route/route-edit.yaml +809 -0
  78. package/prd-to-app/template/src/server/yaml/route/route-list.yaml +1793 -0
  79. package/prd-to-app/template/src/server/yaml/sitemap.yaml +250 -0
  80. package/prd-to-app/template/tsconfig.json +34 -0
@@ -0,0 +1,809 @@
1
+ dsl: "1.0"
2
+ page:
3
+ id: route-edit
4
+ title: 编辑路由
5
+ name: routeForm
6
+ description: 创建或修改 Route:基本信息、入口配置与模型路由策略
7
+ dataSources:
8
+ detail:
9
+ type: http
10
+ autoLoad: true
11
+ request:
12
+ method: GET
13
+ url: /api/data/routes/${route.params.code}
14
+ body:
15
+ type: Page
16
+ children:
17
+ - type: Breadcrumb
18
+ props:
19
+ items:
20
+ - label: 模型路由
21
+ - label: 路由
22
+ href: /routes
23
+ - label: ${data.detail.name}
24
+ href: /routes/${route.params.code}
25
+ - label: 编辑
26
+ - type: Card
27
+ children:
28
+ - type: Flex
29
+ props:
30
+ direction: vertical
31
+ gap: small
32
+ children:
33
+ - type: Typography
34
+ props:
35
+ variant: h3
36
+ text: 编辑路由 — ${data.detail.name}
37
+ - type: Typography
38
+ props:
39
+ variant: muted
40
+ text: 在单一页面完成路由配置:基本信息、请求路径、协议格式与模型调度策略。不使用画布,不配置降级。
41
+ - type: Form
42
+ when: ${data.detail != null}
43
+ props:
44
+ layout: vertical
45
+ initialValues:
46
+ code: ${data.detail.code}
47
+ name: ${data.detail.name}
48
+ type: ${data.detail.type}
49
+ alias: ${data.detail.alias}
50
+ tags: ${data.detail.tagsText}
51
+ description: ${data.detail.description}
52
+ path: ${data.detail.path}
53
+ protocol: ${data.detail.protocol}
54
+ operation: ${data.detail.operation}
55
+ strategy: ${data.detail.strategy}
56
+ stickySession: "${data.detail.stickySession ? 'on' : 'off'}"
57
+ healthFilter: "${data.detail.healthFilter ? 'on' : 'off'}"
58
+ events:
59
+ onSubmit:
60
+ - action: message
61
+ params:
62
+ messageType: success
63
+ text: 路由已保存并启用(演示:静态页面不落库)
64
+ - action: navigate
65
+ params:
66
+ to: /routes/${route.params.code}
67
+ children:
68
+ - type: Flex
69
+ props:
70
+ direction: vertical
71
+ gap: middle
72
+ children:
73
+ - type: Card
74
+ props:
75
+ title: ① 基本信息
76
+ children:
77
+ - type: Grid
78
+ props:
79
+ columns: 2
80
+ gap: 16
81
+ children:
82
+ - type: Field
83
+ props:
84
+ label: 路由名称
85
+ required: true
86
+ children:
87
+ - type: Input
88
+ props:
89
+ name: name
90
+ className: w-full
91
+ placeholder: 展示名,如 推理模型默认路由
92
+ rules:
93
+ - required: true
94
+ message: 请输入路由名称
95
+ - type: Field
96
+ children:
97
+ - type: Flex
98
+ props:
99
+ justify: space-between
100
+ align: center
101
+ className: w-full mb-3.5
102
+ children:
103
+ - type: Flex
104
+ props:
105
+ align: center
106
+ className: gap-0.5
107
+ children:
108
+ - type: Text
109
+ props:
110
+ text: "*"
111
+ className: text-destructive text-sm leading-none
112
+ - type: Label
113
+ props:
114
+ text: 路由标识
115
+ - type: Text
116
+ props:
117
+ text: 路由标识 创建后不可修改
118
+ type: secondary
119
+ className: text-xs leading-none
120
+ - type: Input
121
+ props:
122
+ name: code
123
+ className: w-full
124
+ placeholder: 小写 + 数字 + 连字符,如 reasoning-default
125
+ disabled: true
126
+ rules:
127
+ - required: true
128
+ message: 请输入路由标识
129
+ - type: Field
130
+ props:
131
+ label: 类型
132
+ required: true
133
+ children:
134
+ - type: RadioGroup
135
+ props:
136
+ name: type
137
+ direction: horizontal
138
+ options:
139
+ - label: 单模型
140
+ value: single
141
+ - label: 多模型池
142
+ value: pool
143
+ - label: 条件路由
144
+ value: conditional
145
+ className: mt-2
146
+ - type: Field
147
+ props:
148
+ label: 逻辑模型 Alias
149
+ children:
150
+ - type: Input
151
+ props:
152
+ name: alias
153
+ className: w-full
154
+ placeholder: 对外暴露的模型名,如 reasoning
155
+ - type: Field
156
+ props:
157
+ label: 标签
158
+ children:
159
+ - type: Input
160
+ props:
161
+ name: tags
162
+ className: w-full
163
+ placeholder: 逗号分隔:reasoning, premium
164
+ - type: Field
165
+ props:
166
+ label: 描述
167
+ children:
168
+ - type: Textarea
169
+ props:
170
+ name: description
171
+ className: w-full
172
+ rows: 3
173
+ - type: Card
174
+ props:
175
+ title: ② 入口配置
176
+ children:
177
+ - type: Grid
178
+ props:
179
+ columns: 2
180
+ gap: 16
181
+ children:
182
+ - type: Field
183
+ props:
184
+ label: 请求路径
185
+ required: true
186
+ children:
187
+ - type: Input
188
+ props:
189
+ name: path
190
+ className: w-full
191
+ placeholder: /v1/chat/completions
192
+ rules:
193
+ - required: true
194
+ message: 请输入请求路径
195
+ - type: Field
196
+ props:
197
+ label: 协议格式
198
+ required: true
199
+ children:
200
+ - type: Select
201
+ props:
202
+ name: protocol
203
+ className: w-full [&>span]:w-full [&_[data-slot=select-trigger]]:w-full
204
+ options:
205
+ - label: OpenAI / Chat Completions
206
+ value: OpenAI / Chat Completions
207
+ - label: OpenAI / Responses
208
+ value: OpenAI / Responses
209
+ - label: Anthropic / Messages
210
+ value: Anthropic / Messages
211
+ - label: OpenAI / Embeddings
212
+ value: OpenAI / Embeddings
213
+ rules:
214
+ - required: true
215
+ message: 请选择协议格式
216
+ - type: Field
217
+ props:
218
+ label: Ingress Operation
219
+ children:
220
+ - type: Input
221
+ props:
222
+ name: operation
223
+ className: w-full
224
+ disabled: true
225
+ - type: Button
226
+ props:
227
+ text: 查看协议说明
228
+ icon: eye
229
+ size: small
230
+ variant: link
231
+ className: p-0 h-auto mt-1
232
+ events:
233
+ onClick:
234
+ - id: schemaView
235
+ action: overlay.open
236
+ params:
237
+ overlay:
238
+ type: modal
239
+ title: 协议说明
240
+ width: 560
241
+ content:
242
+ type: Flex
243
+ props:
244
+ direction: vertical
245
+ gap: middle
246
+ children:
247
+ - type: Alert
248
+ props:
249
+ showIcon: true
250
+ variant: info
251
+ message: Ingress Protocol 描述对外请求格式,与 Model「提供商」Tab 中的上游协议无关。
252
+ - type: Text
253
+ props:
254
+ text: '{ "model": "reasoning", "messages": [{ "role": "user", "content": "..."
255
+ }] }'
256
+ className: font-mono text-sm
257
+ - type: Card
258
+ props:
259
+ title: ③ 模型与路由策略
260
+ children:
261
+ - type: Flex
262
+ props:
263
+ justify: space-between
264
+ align: center
265
+ children:
266
+ - type: Text
267
+ props:
268
+ text: 配置模型列表与调度策略;C / M 留空继承 Model「提供商」配置
269
+ type: secondary
270
+ className: text-sm
271
+ - type: Button
272
+ props:
273
+ text: 添加模型
274
+ icon: plus
275
+ variant: primary
276
+ size: small
277
+ events:
278
+ onClick:
279
+ - id: modelResult
280
+ action: overlay.open
281
+ params:
282
+ overlay:
283
+ type: modal
284
+ title: 添加模型
285
+ width: 560
286
+ content:
287
+ type: Form
288
+ props:
289
+ name: routeModel
290
+ initialValues:
291
+ status: enabled
292
+ events:
293
+ onSubmit:
294
+ - action: overlay.close
295
+ params:
296
+ payload:
297
+ ok: true
298
+ children:
299
+ - type: Flex
300
+ props:
301
+ direction: vertical
302
+ gap: middle
303
+ align: stretch
304
+ children:
305
+ - type: Grid
306
+ props:
307
+ columns: 2
308
+ gap: 16
309
+ className: "[&>[data-slot=grid-item]:first-child]:col-span-full"
310
+ children:
311
+ - type: Field
312
+ props:
313
+ label: Model
314
+ required: true
315
+ children:
316
+ - type: Select
317
+ props:
318
+ name: model
319
+ className: w-full [&>span]:w-full [&_[data-slot=select-trigger]]:w-full
320
+ options:
321
+ - label: GPT-5(gpt-5)
322
+ value: gpt-5
323
+ - label: Qwen3.5 Flash(qwen3.5-flash)
324
+ value: qwen3.5-flash
325
+ - label: Qwen3-VL Plus(qwen3-vl-plus)
326
+ value: qwen3-vl-plus
327
+ - label: Gemini 3 Flash(gemini-3-flash)
328
+ value: gemini-3-flash
329
+ rules:
330
+ - required: true
331
+ message: 请选择 Model
332
+ - type: Field
333
+ props:
334
+ label: 权重
335
+ children:
336
+ - type: NumberInput
337
+ props:
338
+ name: weight
339
+ className: w-full
340
+ min: 0
341
+ precision: 0
342
+ placeholder: "50"
343
+ - type: Field
344
+ props:
345
+ label: 优先级
346
+ children:
347
+ - type: Select
348
+ props:
349
+ name: priority
350
+ className: w-full [&>span]:w-full [&_[data-slot=select-trigger]]:w-full
351
+ options:
352
+ - label: P0
353
+ value: P0
354
+ - label: P1
355
+ value: P1
356
+ - label: P2
357
+ value: P2
358
+ - type: Field
359
+ props:
360
+ label: 供应成本倍率 C
361
+ children:
362
+ - type: NumberInput
363
+ props:
364
+ name: costRate
365
+ className: w-full
366
+ min: 0
367
+ step: 0.1
368
+ placeholder: 留空继承 Model 提供商配置
369
+ - type: Field
370
+ props:
371
+ label: 用户计费倍率 M
372
+ children:
373
+ - type: NumberInput
374
+ props:
375
+ name: billingRate
376
+ className: w-full
377
+ min: 0
378
+ step: 0.1
379
+ placeholder: 留空继承
380
+ - type: Field
381
+ props:
382
+ label: 状态
383
+ children:
384
+ - type: RadioGroup
385
+ props:
386
+ name: status
387
+ direction: horizontal
388
+ options:
389
+ - label: 启用
390
+ value: enabled
391
+ - label: 停用
392
+ value: disabled
393
+ - type: Flex
394
+ props:
395
+ justify: end
396
+ gap: middle
397
+ children:
398
+ - type: Button
399
+ props:
400
+ text: 取消
401
+ events:
402
+ onClick:
403
+ - action: overlay.close
404
+ - type: Button
405
+ props:
406
+ text: 确认添加
407
+ variant: primary
408
+ submit: true
409
+ - action: if
410
+ params:
411
+ condition: ${actions.modelResult.ok}
412
+ then:
413
+ - action: message
414
+ params:
415
+ messageType: success
416
+ text: 模型已添加(演示:不落库)
417
+ - type: Grid
418
+ props:
419
+ columns: 2
420
+ gap: 16
421
+ className: mt-4 [&>[data-slot=grid-item]:first-child]:col-span-full
422
+ children:
423
+ - type: Field
424
+ props:
425
+ label: 模型路由策略
426
+ required: true
427
+ children:
428
+ - type: Select
429
+ props:
430
+ name: strategy
431
+ className: w-full [&>span]:w-full [&_[data-slot=select-trigger]]:w-full
432
+ options:
433
+ - label: 加权轮询 (WEIGHTED)
434
+ value: WEIGHTED
435
+ - label: 哈希分配 (HASH)
436
+ value: HASH
437
+ - label: 优先级 (PRIORITY)
438
+ value: PRIORITY
439
+ - label: 轮询 (ROUND_ROBIN)
440
+ value: ROUND_ROBIN
441
+ - label: 随机 (RANDOM)
442
+ value: RANDOM
443
+ - label: 固定 (FIXED)
444
+ value: FIXED
445
+ rules:
446
+ - required: true
447
+ message: 请选择模型路由策略
448
+ - type: Field
449
+ props:
450
+ label: 粘性 Session
451
+ children:
452
+ - type: RadioGroup
453
+ props:
454
+ name: stickySession
455
+ direction: horizontal
456
+ options:
457
+ - label: 开启
458
+ value: on
459
+ - label: 关闭
460
+ value: off
461
+ className: mt-2
462
+ - type: Field
463
+ props:
464
+ label: 健康过滤
465
+ children:
466
+ - type: RadioGroup
467
+ props:
468
+ name: healthFilter
469
+ direction: horizontal
470
+ options:
471
+ - label: 仅调度 HEALTHY 实例
472
+ value: on
473
+ - label: 关闭
474
+ value: off
475
+ className: mt-2
476
+ - type: Table
477
+ props:
478
+ dataSource: ${data.detail.models}
479
+ rowKey: modelCode
480
+ pagination: false
481
+ className: mt-4
482
+ columns:
483
+ - title: Model
484
+ dataIndex: modelName
485
+ - title: Provider 摘要
486
+ dataIndex: providerSummary
487
+ - title: 权重
488
+ cell:
489
+ type: Text
490
+ props:
491
+ text: ${row.weight}
492
+ className: tabular-nums
493
+ - title: 优先级
494
+ dataIndex: priority
495
+ - title: C
496
+ cell:
497
+ type: Text
498
+ props:
499
+ text: "${row.costRate == null ? '继承' : '×' + row.costRate}"
500
+ - title: M
501
+ cell:
502
+ type: Text
503
+ props:
504
+ text: "${row.billingRate == null ? '继承' : '×' + row.billingRate}"
505
+ - title: 状态
506
+ cell:
507
+ type: StatusBadge
508
+ props:
509
+ status: ${row.status}
510
+ - title: 操作
511
+ cell:
512
+ type: Flex
513
+ props:
514
+ align: center
515
+ gap: small
516
+ children:
517
+ - type: Button
518
+ props:
519
+ text: 编辑
520
+ icon: pencil
521
+ size: small
522
+ events:
523
+ onClick:
524
+ - id: modelResult
525
+ action: overlay.open
526
+ params:
527
+ overlay:
528
+ type: modal
529
+ title: 编辑模型
530
+ width: 560
531
+ content:
532
+ type: Form
533
+ props:
534
+ name: routeModel
535
+ initialValues:
536
+ status: enabled
537
+ events:
538
+ onSubmit:
539
+ - action: overlay.close
540
+ params:
541
+ payload:
542
+ ok: true
543
+ children:
544
+ - type: Flex
545
+ props:
546
+ direction: vertical
547
+ gap: middle
548
+ align: stretch
549
+ children:
550
+ - type: Grid
551
+ props:
552
+ columns: 2
553
+ gap: 16
554
+ className: "[&>[data-slot=grid-item]:first-child]:col-span-full"
555
+ children:
556
+ - type: Field
557
+ props:
558
+ label: Model
559
+ required: true
560
+ children:
561
+ - type: Select
562
+ props:
563
+ name: model
564
+ className: w-full [&>span]:w-full [&_[data-slot=select-trigger]]:w-full
565
+ options:
566
+ - label: GPT-5(gpt-5)
567
+ value: gpt-5
568
+ - label: Qwen3.5 Flash(qwen3.5-flash)
569
+ value: qwen3.5-flash
570
+ - label: Qwen3-VL Plus(qwen3-vl-plus)
571
+ value: qwen3-vl-plus
572
+ - label: Gemini 3 Flash(gemini-3-flash)
573
+ value: gemini-3-flash
574
+ rules:
575
+ - required: true
576
+ message: 请选择 Model
577
+ - type: Field
578
+ props:
579
+ label: 权重
580
+ children:
581
+ - type: NumberInput
582
+ props:
583
+ name: weight
584
+ className: w-full
585
+ min: 0
586
+ precision: 0
587
+ placeholder: "50"
588
+ - type: Field
589
+ props:
590
+ label: 优先级
591
+ children:
592
+ - type: Select
593
+ props:
594
+ name: priority
595
+ className: w-full [&>span]:w-full [&_[data-slot=select-trigger]]:w-full
596
+ options:
597
+ - label: P0
598
+ value: P0
599
+ - label: P1
600
+ value: P1
601
+ - label: P2
602
+ value: P2
603
+ - type: Field
604
+ props:
605
+ label: 供应成本倍率 C
606
+ children:
607
+ - type: NumberInput
608
+ props:
609
+ name: costRate
610
+ className: w-full
611
+ min: 0
612
+ step: 0.1
613
+ placeholder: 留空继承 Model 提供商配置
614
+ - type: Field
615
+ props:
616
+ label: 用户计费倍率 M
617
+ children:
618
+ - type: NumberInput
619
+ props:
620
+ name: billingRate
621
+ className: w-full
622
+ min: 0
623
+ step: 0.1
624
+ placeholder: 留空继承
625
+ - type: Field
626
+ props:
627
+ label: 状态
628
+ children:
629
+ - type: RadioGroup
630
+ props:
631
+ name: status
632
+ direction: horizontal
633
+ options:
634
+ - label: 启用
635
+ value: enabled
636
+ - label: 停用
637
+ value: disabled
638
+ - type: Flex
639
+ props:
640
+ justify: end
641
+ gap: middle
642
+ children:
643
+ - type: Button
644
+ props:
645
+ text: 取消
646
+ events:
647
+ onClick:
648
+ - action: overlay.close
649
+ - type: Button
650
+ props:
651
+ text: 确认添加
652
+ variant: primary
653
+ submit: true
654
+ - type: Button
655
+ props:
656
+ text: 移除
657
+ icon: trash-2
658
+ size: small
659
+ danger: true
660
+ events:
661
+ onClick:
662
+ - action: message
663
+ params:
664
+ messageType: info
665
+ text: 移除模型:${row.modelName}(演示:不落库)
666
+ - type: Text
667
+ props:
668
+ text: 权重合计 ${data.detail.weightTotal}(启用项) · 建议 WEIGHTED 时合计 100
669
+ type: secondary
670
+ className: text-sm mt-4
671
+ - type: Flex
672
+ props:
673
+ justify: space-between
674
+ className: mt-4
675
+ children:
676
+ - type: Button
677
+ props:
678
+ text: 删除路由
679
+ icon: trash-2
680
+ danger: true
681
+ events:
682
+ onClick:
683
+ - id: delCfm
684
+ action: overlay.open
685
+ params:
686
+ overlay:
687
+ type: modal
688
+ title: 确认删除路由
689
+ width: 480
690
+ content:
691
+ type: Flex
692
+ props:
693
+ direction: vertical
694
+ gap: middle
695
+ children:
696
+ - type: Text
697
+ props:
698
+ size: small
699
+ text: 删除后,该路由将从模型路由中移除,且不可恢复。
700
+ - type: Flex
701
+ props:
702
+ direction: vertical
703
+ gap: small
704
+ children:
705
+ - type: Text
706
+ props:
707
+ text: 影响范围:
708
+ strong: true
709
+ - type: Text
710
+ props:
711
+ text: · 关联模型:${data.detail.models.length} 个
712
+ type: secondary
713
+ - type: Text
714
+ when: ${data.detail.models.length > 0}
715
+ props:
716
+ size: small
717
+ text: ⚠ 存在关联模型时,删除会导致对应入口的调用失败,建议先解除模型引用。
718
+ type: warning
719
+ - type: Flex
720
+ props:
721
+ justify: end
722
+ gap: middle
723
+ children:
724
+ - type: Button
725
+ props:
726
+ text: 取消
727
+ events:
728
+ onClick:
729
+ - action: overlay.close
730
+ - type: Button
731
+ props:
732
+ text: 确认删除
733
+ variant: primary
734
+ danger: true
735
+ events:
736
+ onClick:
737
+ - action: overlay.close
738
+ params:
739
+ payload:
740
+ ok: true
741
+ - action: if
742
+ params:
743
+ condition: ${actions.delCfm.ok}
744
+ then:
745
+ - action: message
746
+ params:
747
+ messageType: success
748
+ text: 路由已删除(演示)
749
+ - action: navigate
750
+ params:
751
+ to: /routes
752
+ - type: Flex
753
+ props:
754
+ align: center
755
+ gap: middle
756
+ children:
757
+ - type: Button
758
+ props:
759
+ text: 取消
760
+ icon: x
761
+ events:
762
+ onClick:
763
+ - action: navigate
764
+ params:
765
+ to: /routes/${route.params.code}
766
+ - type: Button
767
+ props:
768
+ text: 模拟调用
769
+ icon: zap
770
+ events:
771
+ onClick:
772
+ - action: message
773
+ params:
774
+ messageType: info
775
+ text: 模拟调用:用当前未保存配置演算命中模型与策略(演示)
776
+ - type: Button
777
+ props:
778
+ text: 保存草稿
779
+ icon: save
780
+ events:
781
+ onClick:
782
+ - action: message
783
+ params:
784
+ messageType: success
785
+ text: 草稿已保存(演示:静态页面不落库)
786
+ - action: navigate
787
+ params:
788
+ to: /routes/${route.params.code}
789
+ - type: Button
790
+ props:
791
+ text: 保存并启用
792
+ icon: check-circle
793
+ variant: primary
794
+ submit: true
795
+ - type: Empty
796
+ when: ${data.detail == null && !dataStatus.detail.loading}
797
+ props:
798
+ title: 未找到路由
799
+ description: 路由标识「${route.params.code}」不存在或已被删除
800
+ children:
801
+ - type: Button
802
+ props:
803
+ text: 返回列表
804
+ variant: primary
805
+ events:
806
+ onClick:
807
+ - action: navigate
808
+ params:
809
+ to: /routes