@leadal/flowstream-ui-plus 0.0.3 → 0.0.5
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 +16 -2
- package/dist/flowstream-ui-plus.js +1770 -1753
- package/dist/flowstream-ui-plus.umd.cjs +10 -10
- package/dist/index.d.ts +56 -7
- package/dist/style.css +1 -1
- package/docs//346/216/245/345/205/245/346/226/207/346/241/243.md +18 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -146,6 +146,7 @@ configureWorkflow({
|
|
|
146
146
|
| `dealUserId` | 当前用户 ID;自动解析待办和拾取任务时使用 | `string` | 条件 | — |
|
|
147
147
|
| `dealUserName` | 当前用户名称 | `string` | 否 | — |
|
|
148
148
|
| `variables` | 发送、办毕时提交的流程变量 | `Record<string, unknown>` | 否 | `{}` |
|
|
149
|
+
| `assignmentQueryParams` | 通过 `extendParams` 转发给扩展路由的查询参数 | `Record<string, unknown>` | 否 | `{}` |
|
|
149
150
|
| `autoResolveWork` | 未传 `workId` 时自动查询当前用户待办 | `boolean` | 否 | `true` |
|
|
150
151
|
| `autoHandleDialogs` | 在组件内部处理发送和跳转弹窗 | `boolean` | 否 | `true` |
|
|
151
152
|
| `forceSingleAssignee` | 每个下一节点仅允许选择一名办理人 | `boolean` | 否 | `false`|
|
|
@@ -347,7 +348,7 @@ function handleWork({ action, workData }: {
|
|
|
347
348
|
- 填写审批意见;
|
|
348
349
|
- 确认后调用任务发送接口,成功后关闭弹窗并提示“发送成功”。
|
|
349
350
|
|
|
350
|
-
办理人候选数据通过 `POST /flowstream/server/assignment/event/query`
|
|
351
|
+
办理人候选数据通过 `POST /flowstream/server/assignment/event/query` 加载。业务路由需要额外上下文时,可通过 `assignmentQueryParams` 传入任意数量的扩展参数,也可以不传;组件会将其整体放入请求体的 `extendParams`。请求根对象中的 `processDefinitionId`、`activityId`、`userId`、`parentId` 和 `ntype` 始终由组件维护。
|
|
351
352
|
|
|
352
353
|
#### 1) 属性定义(Properties)
|
|
353
354
|
|
|
@@ -359,6 +360,7 @@ function handleWork({ action, workData }: {
|
|
|
359
360
|
| `workId` | 当前工作项 ID | `string \| number` | 是 | — |
|
|
360
361
|
| `processInstanceId` | 流程实例 ID | `string \| number` | 否 | `''` |
|
|
361
362
|
| `variables` | 当前业务流程变量 | `Record<string, unknown>` | 否 | `{}` |
|
|
363
|
+
| `assignmentQueryParams` | 通过 `extendParams` 转发给扩展路由的查询参数 | `Record<string, unknown>` | 否 | `{}` |
|
|
362
364
|
| `dealUser` | 当前用户,可传 `id` 或 `userId` | `object` | 否 | `{}` |
|
|
363
365
|
| `bpmnXml` | BPMN XML;用于辅助判断下一节点是单人还是多人办理 | `string` | 否 | `''` |
|
|
364
366
|
| `showTrigger` | 是否显示组件自身的发送按钮 | `boolean` | 否 | `true` |
|
|
@@ -406,6 +408,10 @@ import { ref } from 'vue'
|
|
|
406
408
|
import { FlowButtons, FlowSend } from '@leadal/flowstream-ui-plus'
|
|
407
409
|
|
|
408
410
|
const sendVisible = ref(false)
|
|
411
|
+
const assignmentQueryParams = {
|
|
412
|
+
projectId: currentProject.id,
|
|
413
|
+
tenantId: currentTenant.id,
|
|
414
|
+
}
|
|
409
415
|
|
|
410
416
|
function handleFlowAction(action: string) {
|
|
411
417
|
if (action === 'taskSend') sendVisible.value = true
|
|
@@ -436,6 +442,7 @@ function handleAfterSend() {
|
|
|
436
442
|
:work-id="task.workId"
|
|
437
443
|
:deal-user="currentUser"
|
|
438
444
|
:variables="variables"
|
|
445
|
+
:assignment-query-params="assignmentQueryParams"
|
|
439
446
|
:show-trigger="false"
|
|
440
447
|
default-opinion="同意"
|
|
441
448
|
@after-send="handleAfterSend"
|
|
@@ -460,6 +467,7 @@ function handleAfterSend() {
|
|
|
460
467
|
| `workId` | 当前待办工作项 ID | `string \| number` | 确认跳转时是 |
|
|
461
468
|
| `processInstanceId` | 流程实例 ID(预留上下文) | `string \| number` | 否 |
|
|
462
469
|
| `dealUser` | 当前用户,支持 `{ id, userId, name }` | `object` | 否 |
|
|
470
|
+
| `assignmentQueryParams` | 通过 `extendParams` 转发给扩展路由的查询参数 | `Record<string, unknown>` | 否 |
|
|
463
471
|
| `modelValue` | 弹窗显示状态,支持 `v-model` | `boolean` | 否 |
|
|
464
472
|
| `showTrigger` | 是否显示组件自带跳转按钮,默认 `true` | `boolean` | 否 |
|
|
465
473
|
| `dialogTitle` | 弹窗标题,默认“跳转” | `string` | 否 |
|
|
@@ -497,6 +505,7 @@ import { ref } from 'vue'
|
|
|
497
505
|
import { FlowJump } from '@leadal/flowstream-ui-plus'
|
|
498
506
|
|
|
499
507
|
const jumpVisible = ref(false)
|
|
508
|
+
const assignmentQueryParams = { deptCode: 'D1001' }
|
|
500
509
|
</script>
|
|
501
510
|
|
|
502
511
|
<template>
|
|
@@ -506,6 +515,7 @@ const jumpVisible = ref(false)
|
|
|
506
515
|
:process-instance-id="task.processInstanceId"
|
|
507
516
|
:work-id="task.workId"
|
|
508
517
|
:deal-user="currentUser"
|
|
518
|
+
:assignment-query-params="assignmentQueryParams"
|
|
509
519
|
:show-trigger="false"
|
|
510
520
|
@before-jump="handleBeforeJump"
|
|
511
521
|
@after-jump="handleAfterJump"
|
|
@@ -679,6 +689,10 @@ async function submitBusiness() {
|
|
|
679
689
|
name: borrowTitle,
|
|
680
690
|
},
|
|
681
691
|
variables,
|
|
692
|
+
assignmentQueryParams: {
|
|
693
|
+
projectId: currentProject.id,
|
|
694
|
+
tenantId: currentTenant.id,
|
|
695
|
+
},
|
|
682
696
|
async onBeforeStart(startArgs) {
|
|
683
697
|
// 可执行同步校验,也可以 await 业务项目自己的表单弹窗。
|
|
684
698
|
const formData = await openBusinessForm()
|
|
@@ -744,6 +758,6 @@ await flowstream.getRuntimeService().start({
|
|
|
744
758
|
})
|
|
745
759
|
```
|
|
746
760
|
|
|
747
|
-
业务弹窗通过右上角关闭、路由离开或组件卸载时也必须 `resolve(false)`,避免 `start()` 一直处于等待状态。`singleAssignee` 默认为 `true`,也可在启动参数中传入 `dialogTitle`、`dialogWidth`、`defaultOpinion` 和 `
|
|
761
|
+
业务弹窗通过右上角关闭、路由离开或组件卸载时也必须 `resolve(false)`,避免 `start()` 一直处于等待状态。`singleAssignee` 默认为 `true`,也可在启动参数中传入 `dialogTitle`、`dialogWidth`、`defaultOpinion`、`bpmnXml` 和 `assignmentQueryParams`。
|
|
748
762
|
|
|
749
763
|
`quickStart()`、`getFirstHandleNodes()`、`nextSendNode()`、`nodeAssistant()` 和 `sendTask()` 仍作为底层 API 导出,供组件内部及高级扩展使用;普通业务项目应优先调用 `flowstream.getRuntimeService().start()`,不要自行复制流程编排。
|