@leadal/flowstream-ui-plus 0.0.4 → 0.0.6
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 +14 -5
- package/dist/flowstream-ui-plus.js +2834 -2808
- package/dist/flowstream-ui-plus.umd.cjs +10 -10
- package/dist/index.d.ts +27 -8
- package/dist/style.css +1 -1
- package/docs//346/216/245/345/205/245/346/226/207/346/241/243.md +13 -4
- package/package.json +1 -1
|
@@ -171,7 +171,7 @@ const diagramRef = ref<InstanceType<typeof FlowDiagram>>()
|
|
|
171
171
|
|
|
172
172
|
## 8. ui-flow-buttons 与 ui-flow-button
|
|
173
173
|
|
|
174
|
-
`FlowButtons` 根据当前工作项请求可用操作。可直接传 `workId`;如果业务详情只有流程实例,则传 `processInstanceId + dealUserId`,组件会自行查询该用户在该实例中的待办。发送和跳转默认在组件内部打开完整弹窗;保存、启动等业务表单相关动作通过 `execute-action` 交给宿主处理。任务拾取在传入 `dealUserId` 后由组件完成;前/后加签内置机构人员单选弹窗,`taskId`
|
|
174
|
+
`FlowButtons` 根据当前工作项请求可用操作。可直接传 `workId`;如果业务详情只有流程实例,则传 `processInstanceId + dealUserId`,组件会自行查询该用户在该实例中的待办。发送和跳转默认在组件内部打开完整弹窗;保存、启动等业务表单相关动作通过 `execute-action` 交给宿主处理。任务拾取在传入 `dealUserId` 后由组件完成;前/后加签内置机构人员单选弹窗,`taskId` 可显式传入或由待办自动解析。自定义操作优先显示接口返回的 `label`,并兼容流程定义绑定数据中的 `operateLabel`;两者均为空时使用操作标识作为按钮文字。
|
|
175
175
|
|
|
176
176
|
```vue
|
|
177
177
|
<ui-flow-buttons
|
|
@@ -189,9 +189,16 @@ const diagramRef = ref<InstanceType<typeof FlowDiagram>>()
|
|
|
189
189
|
@after-action="handleAfterAction"
|
|
190
190
|
@execute-action="handleAction"
|
|
191
191
|
@error="handleError"
|
|
192
|
-
|
|
192
|
+
>
|
|
193
|
+
<template #append>
|
|
194
|
+
<el-button link type="primary" @click="handlePrint">打印</el-button>
|
|
195
|
+
<el-button link type="primary" @click="handleExport">导出</el-button>
|
|
196
|
+
</template>
|
|
197
|
+
</ui-flow-buttons>
|
|
193
198
|
```
|
|
194
199
|
|
|
200
|
+
`append` 插槽位于整个流程按钮列表之后,只渲染一次,适合追加打印、导出等业务按钮。插槽参数包含当前流程操作 `actions` 和加载状态 `loading`。
|
|
201
|
+
|
|
195
202
|
流程操作成功后会触发 `after-action(action, result, context)`;也兼容 `afterAction` 函数型 prop。`context` 包含当前待办字段,发送和跳转完成后还包含实际请求数据 `requestData`,宿主可据此同步业务状态并刷新列表。加签人员树只允许选择 `ntype=user` 的机构人员,部门节点仅用于展开。
|
|
196
203
|
|
|
197
204
|
单按钮子组件可按需使用:
|
|
@@ -240,7 +247,7 @@ function handleAction(action: string) {
|
|
|
240
247
|
|
|
241
248
|
推荐通过 `v-model` 控制弹窗,避免宿主依赖组件实例;实例仍公开 `open()`、`close()`、`getNextNode()`、`assembleData()` 和 `send()`。组件通过 `nodeAssistant` 请求 `POST /flowstream/server/assignment/event/query` 加载下一节点候选人,并在确认时直接提交 `/flowstream/server/task/event/send`。
|
|
242
249
|
|
|
243
|
-
`assignmentQueryParams`
|
|
250
|
+
`assignmentQueryParams` 是可选的扩展路由参数对象,可以传一个、多个字段或不传。组件会在每次候选办理人查询(包括组织树懒加载)中将其整体放入 `extendParams`;请求根对象中的 `processDefinitionId`、`activityId`、`userId`、`parentId` 和 `ntype` 由组件维护。使用 `FlowButtons` 内置发送/跳转弹窗或 `getRuntimeService().start()` 时也可传入同名参数。
|
|
244
251
|
|
|
245
252
|
## 10. ui-flow-jump
|
|
246
253
|
|
|
@@ -252,6 +259,7 @@ import { ref } from 'vue'
|
|
|
252
259
|
import { FlowJump } from '@leadal/flowstream-ui-plus'
|
|
253
260
|
|
|
254
261
|
const jumpVisible = ref(false)
|
|
262
|
+
const assignmentQueryParams = { deptCode: 'D1001' }
|
|
255
263
|
</script>
|
|
256
264
|
|
|
257
265
|
<template>
|
|
@@ -261,6 +269,7 @@ const jumpVisible = ref(false)
|
|
|
261
269
|
:process-instance-id="task.processInstanceId"
|
|
262
270
|
:work-id="task.workId"
|
|
263
271
|
:deal-user="{ id: currentUserId, name: currentUserName }"
|
|
272
|
+
:assignment-query-params="assignmentQueryParams"
|
|
264
273
|
:show-trigger="false"
|
|
265
274
|
@before-jump="handleBeforeJump"
|
|
266
275
|
@after-jump="handleAfterJump"
|
|
@@ -346,7 +355,7 @@ async function submit() {
|
|
|
346
355
|
- 条件稍后满足时调用 `await flowstream.getRuntimeService().open()`,组件会重新执行 `onBeforeSend`;决定放弃时调用 `close()` 撤销实例并释放会话。
|
|
347
356
|
- 调用成功后直接打开选择弹窗,业务模板不需要挂载隐藏组件。
|
|
348
357
|
- 候选办理人可以有多个;`singleAssignee` 默认开启,每个下一节点只能选择一人。
|
|
349
|
-
- 自定义业务路由参数通过 `assignmentQueryParams`
|
|
358
|
+
- 自定义业务路由参数通过 `assignmentQueryParams` 传入,并作为候选办理人查询请求的 `extendParams` 字段发送。
|
|
350
359
|
- 用户确认后由内部发送组件调用 `sendTask()`;`onAfterSend` 参数中的 `sendData.flowNodeAssignees` 是实际发送的下一节点和办理人。
|
|
351
360
|
- 用户未发送就关闭弹窗时会撤销刚创建的流程实例并释放会话;只有 `onBeforeSend` 返回 `false`、弹窗尚未打开时,才能调用 `open()` 在条件满足后继续。
|
|
352
361
|
- `processDefinitionId`、`draftUserId`、`draftUserName` 均为必填;快速启动不支持多个首办节点或多个起草人待办。
|