@blueking/bkflow-canvas-editor 1.1.0-beta.28 → 1.1.0-beta.29

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 CHANGED
@@ -407,6 +407,15 @@ interface SelectPanelConfig {
407
407
  | `back` | - | 返回按钮点击时触发 |
408
408
  | `createVariable` | `{ keyword, cursorIndex }` | 请求新建全局变量时触发 |
409
409
 
410
+ #### Slots
411
+
412
+ | 插槽名 | 作用域参数 | 说明 |
413
+ | ------------------ | ------------------------------------------- | ---------------------------------------------------------------------- |
414
+ | `header` | - | 自定义头部左侧标题区 |
415
+ | `headerActions` | `{ savePending, canMutateFlow }` | 头部右侧操作区追加宿主自定义按钮,排在内置「保存」「执行流程」之后 |
416
+ | `inputParams` | 见 `FlowView` | 自定义节点输入参数表单 |
417
+ | `customFormContent`| 见 `FlowView` | 自定义创建任务侧滑表单内容 |
418
+
410
419
  #### 权限矩阵
411
420
 
412
421
  `permissions` 默认拒绝,四种组合如下:
@@ -418,7 +427,17 @@ interface SelectPanelConfig {
418
427
  | `false` | `true` | 只读画布 + 全流程/单节点调试(调试期间流程本就不可编辑) |
419
428
  | `true` | `true` | 可编辑、保存与完整调试;调试运行中锁定编辑(画布转 `view`)|
420
429
 
421
- `permissions.canExecute` 独立控制头部“执行流程”按钮。流程存在未保存修改时,确认保存成功后才会打开创建任务侧滑;`customFormContent` 插槽与 `FlowView` 一致。
430
+ `permissions.canExecute` 独立控制头部“执行流程”按钮的显示,为 `false` 时按钮不渲染。流程存在未保存修改时,确认保存成功后才会打开创建任务侧滑;`customFormContent` 插槽与 `FlowView` 一致。
431
+
432
+ 头部右侧按钮区在 `canEdit`、`canExecute` 均为 `false` 且未传 `headerActions` 插槽时整体不渲染。宿主若要按状态控制自定义按钮的显隐,可在插槽模板上直接加 `v-if`,插槽未传入时按钮区不会留下空白:
433
+
434
+ ```vue
435
+ <FlowDetail :flow-id="flowId" :api-config="apiConfig" :permissions="permissions">
436
+ <template v-if="permissions.canEdit" #headerActions>
437
+ <bk-button @click="handleExitEdit">退出编辑</bk-button>
438
+ </template>
439
+ </FlowDetail>
440
+ ```
422
441
 
423
442
  #### 调试能力
424
443