@blueking/bkflow-canvas-editor 0.0.35-beta.9 → 0.1.0-beta.2
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.
- package/README.md +133 -64
- package/dist/index.cjs.js +35 -35
- package/dist/index.d.ts +968 -0
- package/dist/index.esm.js +15743 -15421
- package/dist/style.css +1 -1
- package/package.json +5 -6
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# bkflow-canvas-editor
|
|
2
2
|
|
|
3
|
-
bkflow
|
|
3
|
+
bkflow流程编辑组件,支持流程的编辑、查看、调试以及创建并执行任务。
|
|
4
4
|
|
|
5
5
|
## 安装
|
|
6
6
|
|
|
@@ -64,19 +64,20 @@ npm install @blueking/bkflow-canvas-editor
|
|
|
64
64
|
|
|
65
65
|
#### Props
|
|
66
66
|
|
|
67
|
-
| 参数 | 类型
|
|
68
|
-
| ------------------- |
|
|
69
|
-
| `flowId` | `string`
|
|
70
|
-
| `apiConfig` | `FlowApiConfig`
|
|
71
|
-
| `permissions` | `{ canEdit?: boolean
|
|
72
|
-
| `thumbnail` | `boolean`
|
|
73
|
-
| `enableVersion` | `boolean`
|
|
74
|
-
| `flowVersion` | `string`
|
|
75
|
-
| `showHeaderActions` | `boolean`
|
|
76
|
-
| `defaultZoom` | `number`
|
|
77
|
-
| `bkflowSaasUrl` | `string`
|
|
78
|
-
| `onEdit` | `() => void`
|
|
79
|
-
| `onBack` | `() => void`
|
|
67
|
+
| 参数 | 类型 | 默认值 | 说明 |
|
|
68
|
+
| ------------------- | ---------------------------------------------- | ------------------ | -------------------------------------------------------------------------------------------- |
|
|
69
|
+
| `flowId` | `string` | - | **必需**,流程 ID |
|
|
70
|
+
| `apiConfig` | `FlowApiConfig` | - | **必需**,API 配置对象,详见 [API 配置](#api-配置) |
|
|
71
|
+
| `permissions` | `{ canEdit?: boolean }` | `{ canEdit: true }` | 权限配置对象,`canEdit` 控制头部编辑按钮是否使用禁用样式 |
|
|
72
|
+
| `thumbnail` | `boolean` | `false` | 缩略图模式,启用后只显示画布内容,不显示顶部 header 和操作按钮,禁用节点点击事件 |
|
|
73
|
+
| `enableVersion` | `boolean` | `false` | 是否开启流程版本功能,开启后会根据 `flowVersion` 的值获取对应版本的流程数据 |
|
|
74
|
+
| `flowVersion` | `string` | - | 流程版本号,仅在 `enableVersion` 为 `true` 时生效。为空时表示草稿版本,不为空时表示指定版本 |
|
|
75
|
+
| `showHeaderActions` | `boolean` | `true` | 是否显示头部操作按钮(编辑、执行流程、调试),仅在非缩略图模式下生效 |
|
|
76
|
+
| `defaultZoom` | `number` | `1` | x6 画布的默认缩放比例,用于控制画布的初始显示效果。取值范围建议在 0.25 到 1.5 之间 |
|
|
77
|
+
| `bkflowSaasUrl` | `string` | - | bkflow-saas-url,用于设置 `$.context.site_url` 的值,供插件内部使用 |
|
|
78
|
+
| `onEdit` | `() => void` | - | 编辑按钮点击回调(可选,也可以通过 `@edit` 事件监听) |
|
|
79
|
+
| `onBack` | `() => void` | - | 返回按钮点击回调(可选,也可以通过 `@back` 事件监听) |
|
|
80
|
+
| `onExecuteSuccess` | `(taskId: number, templateId: number) => void` | - | 执行成功回调(可选) |
|
|
80
81
|
|
|
81
82
|
#### Slots
|
|
82
83
|
|
|
@@ -111,24 +112,24 @@ npm install @blueking/bkflow-canvas-editor
|
|
|
111
112
|
|
|
112
113
|
#### Props
|
|
113
114
|
|
|
114
|
-
| 参数
|
|
115
|
-
|
|
|
116
|
-
| `flowId`
|
|
117
|
-
| `apiConfig`
|
|
118
|
-
| `permissions`
|
|
119
|
-
| `enableDebug`
|
|
120
|
-
| `enableVersion`
|
|
121
|
-
| `flowVersion`
|
|
122
|
-
| `onDebugConfirm`
|
|
123
|
-
| `useCustomDebugConfirm`
|
|
124
|
-
| `
|
|
125
|
-
| `onSave`
|
|
126
|
-
| `onSaveSuccess`
|
|
127
|
-
| `onBack`
|
|
128
|
-
| `onBeforeLeave`
|
|
129
|
-
| `defaultZoom`
|
|
130
|
-
| `bkflowSaasUrl`
|
|
131
|
-
| `enableThirdPlugin`
|
|
115
|
+
| 参数 | 类型 | 默认值 | 说明 |
|
|
116
|
+
| ----------------------- | -------------------------------------------------------------------------------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------- |
|
|
117
|
+
| `flowId` | `string` | - | **必需**,流程 ID |
|
|
118
|
+
| `apiConfig` | `FlowApiConfig` | - | **必需**,API 配置对象,详见 [API 配置](#api-配置) |
|
|
119
|
+
| `permissions` | `{ canSave?: boolean }` | `{ canSave: true }` | 权限配置对象,`canSave` 控制头部保存按钮是否可点击 |
|
|
120
|
+
| `enableDebug` | `boolean` | `false` | 是否启用调试功能,启用后显示可点击的调试按钮 |
|
|
121
|
+
| `enableVersion` | `boolean` | `false` | 是否开启流程版本功能,开启后会根据 `flowVersion` 的值获取对应版本的流程数据 |
|
|
122
|
+
| `flowVersion` | `string` | - | 流程版本号,仅在 `enableVersion` 为 `true` 时生效。为空时表示草稿版本,不为空时表示指定版本 |
|
|
123
|
+
| `onDebugConfirm` | `(formData: { name: string, variablesValue: Record<string, any> }) => Promise<void> \| void` | - | 调试面板确定按钮回调(可选) |
|
|
124
|
+
| `useCustomDebugConfirm` | `boolean` | `false` | 是否使用自定义回调替代调试面板原有逻辑。为 `true` 时只执行 `onDebugConfirm`,为 `false` 时在原有逻辑后执行 `onDebugConfirm` |
|
|
125
|
+
| `selectPanelConfig` | `SelectPanelConfig` | - | 插件选择面板配置(可选),详见 [SelectPanelConfig](#selectpanelconfig) |
|
|
126
|
+
| `onSave` | `(flowData: FlowTemplate) => void` | - | 保存回调(可选,也可以通过 `@save` 事件监听) |
|
|
127
|
+
| `onSaveSuccess` | `() => void` | - | 保存成功回调(可选,也可以通过 `@saveSuccess` 事件监听) |
|
|
128
|
+
| `onBack` | `() => void` | - | 返回按钮点击回调(可选,也可以通过 `@back` 事件监听) |
|
|
129
|
+
| `onBeforeLeave` | `(isEdited: boolean) => Promise<boolean>` | - | 离开前回调,返回 `false` 可阻止离开 |
|
|
130
|
+
| `defaultZoom` | `number` | `1` | x6 画布的默认缩放比例,用于控制画布的初始显示效果。取值范围建议在 0.25 到 1.5 之间 |
|
|
131
|
+
| `bkflowSaasUrl` | `string` | - | bkflow-saas-url,用于设置 `$.context.site_url` 的值,供插件内部使用 |
|
|
132
|
+
| `enableThirdPlugin` | `boolean` | `true` | 是否启用第三方插件。设置为 `false` 时,将不加载第三方插件列表和详情,只显示内置插件 |
|
|
132
133
|
|
|
133
134
|
#### Slots
|
|
134
135
|
|
|
@@ -159,11 +160,12 @@ npm install @blueking/bkflow-canvas-editor
|
|
|
159
160
|
|
|
160
161
|
#### Events
|
|
161
162
|
|
|
162
|
-
| 事件名
|
|
163
|
-
|
|
|
164
|
-
| `save`
|
|
165
|
-
| `saveSuccess`
|
|
166
|
-
| `back`
|
|
163
|
+
| 事件名 | 参数 | 说明 |
|
|
164
|
+
| ------------------ | ------------------------ | ---------------------------------- |
|
|
165
|
+
| `save` | `flowData: FlowTemplate` | 保存时触发,参数为流程数据 |
|
|
166
|
+
| `saveSuccess` | - | 保存成功时触发 |
|
|
167
|
+
| `back` | - | 点击返回按钮时触发 |
|
|
168
|
+
| `debugBeforeClose` | - | 调试面板关闭前触发,用于清理数据 |
|
|
167
169
|
|
|
168
170
|
#### 暴露的方法
|
|
169
171
|
|
|
@@ -176,17 +178,18 @@ npm install @blueking/bkflow-canvas-editor
|
|
|
176
178
|
|
|
177
179
|
---
|
|
178
180
|
|
|
179
|
-
###
|
|
181
|
+
### SelectPanelConfig 类型
|
|
180
182
|
|
|
181
|
-
|
|
183
|
+
插件选择面板配置类型,用于配置插件选择面板中的按钮跳转链接和文本。
|
|
182
184
|
|
|
183
185
|
#### 类型定义
|
|
184
186
|
|
|
185
187
|
```typescript
|
|
186
|
-
interface
|
|
187
|
-
agentApplyUrl?: string; // "点击申请" 按钮跳转链接(可选)
|
|
188
|
+
interface SelectPanelConfig {
|
|
189
|
+
agentApplyUrl?: string; // 智能体插件分组,"点击申请" 按钮跳转链接(可选)
|
|
188
190
|
agentResourceUrl?: string; // "智能体" 按钮跳转链接(可选)
|
|
189
191
|
agentButtonText?: string; // "智能体" 按钮文本(可选,默认为 "智能体")
|
|
192
|
+
knowledgebaseResourceUrl?: string; // 知识库插件分组,"知识库" 按钮跳转链接(可选)
|
|
190
193
|
}
|
|
191
194
|
```
|
|
192
195
|
|
|
@@ -197,19 +200,20 @@ interface AgentSelectPanelConfig {
|
|
|
197
200
|
<FlowEdit
|
|
198
201
|
:flow-id="flowId"
|
|
199
202
|
:api-config="apiConfig"
|
|
200
|
-
:
|
|
203
|
+
:select-panel-config="{
|
|
201
204
|
agentApplyUrl: 'https://example.com/apply',
|
|
202
205
|
agentResourceUrl: 'https://example.com/agent',
|
|
203
206
|
agentButtonText: '创建智能体',
|
|
207
|
+
knowledgebaseResourceUrl: 'https://example.com/knowledgebase',
|
|
204
208
|
}" />
|
|
205
209
|
</template>
|
|
206
210
|
```
|
|
207
211
|
|
|
208
212
|
#### 说明
|
|
209
213
|
|
|
210
|
-
- 如果 `
|
|
214
|
+
- 如果 `selectPanelConfig` 未提供或某个字段未提供,组件将使用默认的路由跳转行为
|
|
211
215
|
- `agentButtonText` 默认值为 "智能体"
|
|
212
|
-
- 配置通过 Vue 的 provide/inject 机制全局提供,子组件可以直接通过 `
|
|
216
|
+
- 配置通过 Vue 的 provide/inject 机制全局提供,子组件可以直接通过 `useSelectPanelConfig()` 获取
|
|
213
217
|
|
|
214
218
|
---
|
|
215
219
|
|
|
@@ -227,21 +231,23 @@ interface AgentSelectPanelConfig {
|
|
|
227
231
|
| `editable` | `boolean` | `true` | 是否可编辑 |
|
|
228
232
|
| `showFlowEntry` | `boolean` | `false` | 是否显示流程入口 |
|
|
229
233
|
| `bkflowSaasUrl` | `string` | - | bkflow-saas-url,用于设置 `$.context.site_url` 的值,供插件内部使用 |
|
|
230
|
-
| `onExecuteSuccess` | `(taskId:
|
|
234
|
+
| `onExecuteSuccess` | `(taskId: number, templateId: number) => void` | - | 执行成功回调 |
|
|
231
235
|
|
|
232
236
|
#### Events
|
|
233
237
|
|
|
234
|
-
| 事件名
|
|
235
|
-
|
|
|
236
|
-
| `confirm`
|
|
237
|
-
| `close`
|
|
238
|
-
| `update:show`
|
|
238
|
+
| 事件名 | 参数 | 说明 |
|
|
239
|
+
| -------------- | ------------------------------------ | ------------------------ |
|
|
240
|
+
| `confirm` | `taskId: number, templateId: number` | 执行确认时触发 |
|
|
241
|
+
| `close` | - | 关闭面板时触发 |
|
|
242
|
+
| `update:show` | `show: boolean` | 显示状态更新时触发 |
|
|
243
|
+
| `before-close` | - | 面板关闭前触发 |
|
|
244
|
+
| `view-flow` | - | 点击查看排障流程按钮触发 |
|
|
239
245
|
|
|
240
246
|
---
|
|
241
247
|
|
|
242
248
|
### FlowDebug 组件
|
|
243
249
|
|
|
244
|
-
流程调试组件,用于调试流程任务。基于 `FlowExecute`
|
|
250
|
+
流程调试组件,用于调试流程任务。基于 `FlowExecute` 组件实现,但增加了自定义表单插槽、自定义确定按钮回调及版本控制支持。
|
|
245
251
|
|
|
246
252
|
#### Props
|
|
247
253
|
|
|
@@ -255,7 +261,9 @@ interface AgentSelectPanelConfig {
|
|
|
255
261
|
| `bkflowSaasUrl` | `string` | - | bkflow-saas-url,用于设置 `$.context.site_url` 的值,供插件内部使用 |
|
|
256
262
|
| `onConfirm` | `(formData: { name: string, variablesValue: Record<string, any> }) => Promise<void> \| void` | - | 自定义确定按钮回调(可选) |
|
|
257
263
|
| `useCustomConfirm` | `boolean` | `false` | 是否使用自定义回调替代原有逻辑。为 `true` 时只执行 `onConfirm`,为 `false` 时在原有逻辑后执行 `onConfirm` |
|
|
258
|
-
| `onExecuteSuccess` | `(taskId:
|
|
264
|
+
| `onExecuteSuccess` | `(taskId: number, templateId: number) => void` | - | 执行成功回调(可选,仅在 `useCustomConfirm` 为 `false` 时生效) |
|
|
265
|
+
| `enableVersion` | `boolean` | `false` | 是否开启流程版本功能,开启后会根据 `flowVersion` 的值获取对应版本的流程数据 |
|
|
266
|
+
| `flowVersion` | `string` | - | 流程版本号,仅在 `enableVersion` 为 `true` 时生效。为空时表示草稿版本,不为空时表示指定版本 |
|
|
259
267
|
|
|
260
268
|
#### Slots
|
|
261
269
|
|
|
@@ -265,11 +273,12 @@ interface AgentSelectPanelConfig {
|
|
|
265
273
|
|
|
266
274
|
#### Events
|
|
267
275
|
|
|
268
|
-
| 事件名
|
|
269
|
-
|
|
|
270
|
-
| `confirm`
|
|
271
|
-
| `close`
|
|
272
|
-
| `update:show`
|
|
276
|
+
| 事件名 | 参数 | 说明 |
|
|
277
|
+
| -------------- | ------------------------------------ | ------------------------------------------------------- |
|
|
278
|
+
| `confirm` | `taskId: number, templateId: number` | 执行确认时触发(仅在 `useCustomConfirm` 为 `false` 时) |
|
|
279
|
+
| `close` | - | 关闭面板时触发 |
|
|
280
|
+
| `update:show` | `show: boolean` | 显示状态更新时触发 |
|
|
281
|
+
| `before-close` | - | 面板关闭前触发,用于清理数据 |
|
|
273
282
|
|
|
274
283
|
#### 使用说明
|
|
275
284
|
|
|
@@ -278,6 +287,7 @@ interface AgentSelectPanelConfig {
|
|
|
278
287
|
- 当 `useCustomConfirm` 为 `false`(默认)时,`onConfirm` 会在原有的执行逻辑(创建任务并执行)完成后调用
|
|
279
288
|
- 当 `useCustomConfirm` 为 `true` 时,点击确定按钮只会执行 `onConfirm` 回调,不会执行原有的创建和执行任务逻辑
|
|
280
289
|
- **表单验证**:无论使用哪种模式,都会先进行表单验证,验证通过后才会执行相应逻辑
|
|
290
|
+
- **版本控制**:当 `enableVersion` 为 `true` 时,会使用与 FlowView/FlowEdit 相同的版本数据获取逻辑,确保调试时使用正确版本的流程数据
|
|
281
291
|
|
|
282
292
|
---
|
|
283
293
|
|
|
@@ -290,7 +300,7 @@ interface AgentSelectPanelConfig {
|
|
|
290
300
|
<FlowEdit
|
|
291
301
|
:flow-id="flowId"
|
|
292
302
|
:api-config="apiConfig"
|
|
293
|
-
:permissions="{
|
|
303
|
+
:permissions="{ canSave: true }"
|
|
294
304
|
@save="handleSave"
|
|
295
305
|
@save-success="handleSaveSuccess"
|
|
296
306
|
@back="handleBack" />
|
|
@@ -332,7 +342,7 @@ interface AgentSelectPanelConfig {
|
|
|
332
342
|
ref="flowEditRef"
|
|
333
343
|
:flow-id="flowId"
|
|
334
344
|
:api-config="apiConfig"
|
|
335
|
-
:permissions="{
|
|
345
|
+
:permissions="{ canSave: true }"
|
|
336
346
|
@save="handleSave">
|
|
337
347
|
<!-- 自定义输入参数组件 -->
|
|
338
348
|
<template
|
|
@@ -469,7 +479,7 @@ interface AgentSelectPanelConfig {
|
|
|
469
479
|
|
|
470
480
|
### 使用流程版本功能
|
|
471
481
|
|
|
472
|
-
|
|
482
|
+
当需要查看、编辑或调试特定版本的流程时,可以使用版本功能:
|
|
473
483
|
|
|
474
484
|
```vue
|
|
475
485
|
<template>
|
|
@@ -481,12 +491,25 @@ interface AgentSelectPanelConfig {
|
|
|
481
491
|
|
|
482
492
|
<!-- 编辑指定版本的流程 -->
|
|
483
493
|
<FlowEdit :flow-id="flowId" :api-config="apiConfig" :enable-version="true" :flow-version="'v1.0.0'" />
|
|
494
|
+
|
|
495
|
+
<!-- 调试草稿版本的流程 -->
|
|
496
|
+
<FlowDebug :flow-id="flowId" :show="isDebugShow" :api-config="apiConfig" :enable-version="true" />
|
|
497
|
+
|
|
498
|
+
<!-- 调试指定版本的流程 -->
|
|
499
|
+
<FlowDebug
|
|
500
|
+
:flow-id="flowId"
|
|
501
|
+
:show="isDebugShow"
|
|
502
|
+
:api-config="apiConfig"
|
|
503
|
+
:enable-version="true"
|
|
504
|
+
:flow-version="'v1.0.0'" />
|
|
484
505
|
</template>
|
|
485
506
|
|
|
486
507
|
<script setup>
|
|
487
|
-
import {
|
|
508
|
+
import { ref } from 'vue';
|
|
509
|
+
import { FlowView, FlowEdit, FlowDebug } from 'bkflow-canvas-editor';
|
|
488
510
|
|
|
489
511
|
const flowId = '123';
|
|
512
|
+
const isDebugShow = ref(false);
|
|
490
513
|
const apiConfig = {
|
|
491
514
|
scopeData: {
|
|
492
515
|
scope_type: 'space',
|
|
@@ -571,6 +594,7 @@ interface AgentSelectPanelConfig {
|
|
|
571
594
|
</template>
|
|
572
595
|
|
|
573
596
|
<script setup>
|
|
597
|
+
import { ref } from 'vue';
|
|
574
598
|
import { FlowView, FlowEdit, FlowExecute, FlowDebug } from 'bkflow-canvas-editor';
|
|
575
599
|
|
|
576
600
|
const flowId = '123';
|
|
@@ -593,7 +617,7 @@ interface AgentSelectPanelConfig {
|
|
|
593
617
|
|
|
594
618
|
```vue
|
|
595
619
|
<template>
|
|
596
|
-
<FlowEdit :flow-id="flowId" :api-config="apiConfig" :
|
|
620
|
+
<FlowEdit :flow-id="flowId" :api-config="apiConfig" :enable-third-plugin="false" />
|
|
597
621
|
</template>
|
|
598
622
|
|
|
599
623
|
<script setup>
|
|
@@ -859,6 +883,43 @@ interface AgentSelectPanelConfig {
|
|
|
859
883
|
</script>
|
|
860
884
|
```
|
|
861
885
|
|
|
886
|
+
#### 使用版本控制的调试
|
|
887
|
+
|
|
888
|
+
```vue
|
|
889
|
+
<template>
|
|
890
|
+
<!-- 调试草稿版本的流程 -->
|
|
891
|
+
<FlowDebug
|
|
892
|
+
:flow-id="flowId"
|
|
893
|
+
:show="isDebugShow"
|
|
894
|
+
:api-config="apiConfig"
|
|
895
|
+
:enable-version="true"
|
|
896
|
+
@close="isDebugShow = false" />
|
|
897
|
+
|
|
898
|
+
<!-- 调试指定版本的流程 -->
|
|
899
|
+
<FlowDebug
|
|
900
|
+
:flow-id="flowId"
|
|
901
|
+
:show="isDebugShow"
|
|
902
|
+
:api-config="apiConfig"
|
|
903
|
+
:enable-version="true"
|
|
904
|
+
:flow-version="'v1.0.0'"
|
|
905
|
+
@close="isDebugShow = false" />
|
|
906
|
+
</template>
|
|
907
|
+
|
|
908
|
+
<script setup>
|
|
909
|
+
import { ref } from 'vue';
|
|
910
|
+
import { FlowDebug } from 'bkflow-canvas-editor';
|
|
911
|
+
|
|
912
|
+
const flowId = '123';
|
|
913
|
+
const isDebugShow = ref(false);
|
|
914
|
+
const apiConfig = {
|
|
915
|
+
scopeData: {
|
|
916
|
+
scope_type: 'space',
|
|
917
|
+
scope_value: 123,
|
|
918
|
+
},
|
|
919
|
+
};
|
|
920
|
+
</script>
|
|
921
|
+
```
|
|
922
|
+
|
|
862
923
|
## API 配置
|
|
863
924
|
|
|
864
925
|
### FlowApiConfig
|
|
@@ -873,6 +934,8 @@ interface FlowApiConfig {
|
|
|
873
934
|
axiosInstance?: AxiosInstance;
|
|
874
935
|
/** axios 配置(可选,用于创建新的 axios 实例) */
|
|
875
936
|
axiosConfig?: AxiosRequestConfig;
|
|
937
|
+
/** CSRF cookie 名称(可选,用于创建新的 axios 实例时设置 xsrfCookieName) */
|
|
938
|
+
xsrfCookieName?: string;
|
|
876
939
|
/** 作用域数据(必需,由外部传入) */
|
|
877
940
|
scopeData: {
|
|
878
941
|
scope_type: string;
|
|
@@ -907,7 +970,7 @@ interface FlowApiConfig {
|
|
|
907
970
|
|
|
908
971
|
### 流程版本功能说明
|
|
909
972
|
|
|
910
|
-
当 `enableVersion` 为 `true`
|
|
973
|
+
当 `enableVersion` 为 `true` 时,FlowView、FlowEdit 和 FlowDebug 组件会使用版本相关的 API 来获取流程数据:
|
|
911
974
|
|
|
912
975
|
1. **总是先调用 `fetchFlowDetail`**:获取基础流程详情数据
|
|
913
976
|
2. **根据 `flowVersion` 的值决定是否调用版本接口**:
|
|
@@ -916,6 +979,8 @@ interface FlowApiConfig {
|
|
|
916
979
|
|
|
917
980
|
这种设计确保了即使在使用版本功能时,也能获取到完整的流程基础信息,同时用版本特定的数据覆盖相应字段。
|
|
918
981
|
|
|
982
|
+
> **注意**:FlowEdit 组件会将 `enableVersion` 和 `flowVersion` 自动透传给内嵌的 FlowDebug 组件,因此在 FlowEdit 中启用版本功能后,调试面板也会自动使用对应版本的流程数据。
|
|
983
|
+
|
|
919
984
|
## 类型定义
|
|
920
985
|
|
|
921
986
|
所有类型定义都可以从包中导入:
|
|
@@ -934,7 +999,7 @@ import type {
|
|
|
934
999
|
PluginInputDataItem,
|
|
935
1000
|
UniformApiPluginInputsItem,
|
|
936
1001
|
PluginDetailCommon,
|
|
937
|
-
|
|
1002
|
+
SelectPanelConfig,
|
|
938
1003
|
// ... 更多类型
|
|
939
1004
|
} from 'bkflow-canvas-editor';
|
|
940
1005
|
```
|
|
@@ -984,6 +1049,10 @@ resolve: {
|
|
|
984
1049
|
- `FlowEdit` 组件的 `enableDebug` props 默认为 `false`,设置为 `true` 后才会显示可点击的调试按钮
|
|
985
1050
|
- 点击调试按钮会打开 `FlowDebug` 组件,该组件提供了与 `FlowExecute` 相同的交互,但支持自定义表单插槽和自定义确定按钮回调
|
|
986
1051
|
- `FlowDebug` 组件的 `useCustomConfirm` 为 `false` 时,会先执行原有的创建和执行任务逻辑,然后执行 `onConfirm` 回调;为 `true` 时,只执行 `onConfirm` 回调
|
|
1052
|
+
11. **版本控制**:
|
|
1053
|
+
- FlowView、FlowEdit、FlowDebug 三个组件均支持 `enableVersion` 和 `flowVersion` props
|
|
1054
|
+
- FlowEdit 会自动将版本相关 props 透传给内嵌的 FlowDebug 组件
|
|
1055
|
+
- 版本功能依赖 `fetchFlowDraftDetail` 和 `fetchFlowDetailByVersion` 两个 API 方法
|
|
987
1056
|
|
|
988
1057
|
## License
|
|
989
1058
|
|