@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
|
@@ -179,6 +179,10 @@ const diagramRef = ref<InstanceType<typeof FlowDiagram>>()
|
|
|
179
179
|
:process-definition-id="task.processDefinitionId"
|
|
180
180
|
:deal-user-id="loginUser.id"
|
|
181
181
|
:deal-user-name="loginUser.name"
|
|
182
|
+
:assignment-query-params="{
|
|
183
|
+
projectId: currentProject.id,
|
|
184
|
+
tenantId: currentTenant.id,
|
|
185
|
+
}"
|
|
182
186
|
force-single-assignee
|
|
183
187
|
:before-action="validateBeforeAction"
|
|
184
188
|
:after-action="reloadAfterAction"
|
|
@@ -206,6 +210,10 @@ import { ref } from 'vue'
|
|
|
206
210
|
import { FlowSend } from '@leadal/flowstream-ui-plus'
|
|
207
211
|
|
|
208
212
|
const sendVisible = ref(false)
|
|
213
|
+
const assignmentQueryParams = {
|
|
214
|
+
projectId: currentProject.id,
|
|
215
|
+
tenantId: currentTenant.id,
|
|
216
|
+
}
|
|
209
217
|
|
|
210
218
|
function handleAction(action: string) {
|
|
211
219
|
if (action === 'taskSend') sendVisible.value = true
|
|
@@ -222,6 +230,7 @@ function handleAction(action: string) {
|
|
|
222
230
|
:deal-user="currentUser"
|
|
223
231
|
:show-trigger="false"
|
|
224
232
|
:variables="variables"
|
|
233
|
+
:assignment-query-params="assignmentQueryParams"
|
|
225
234
|
@before-send="handleBeforeSend"
|
|
226
235
|
@after-send="handleAfterSend"
|
|
227
236
|
@error="handleError"
|
|
@@ -231,6 +240,8 @@ function handleAction(action: string) {
|
|
|
231
240
|
|
|
232
241
|
推荐通过 `v-model` 控制弹窗,避免宿主依赖组件实例;实例仍公开 `open()`、`close()`、`getNextNode()`、`assembleData()` 和 `send()`。组件通过 `nodeAssistant` 请求 `POST /flowstream/server/assignment/event/query` 加载下一节点候选人,并在确认时直接提交 `/flowstream/server/task/event/send`。
|
|
233
242
|
|
|
243
|
+
`assignmentQueryParams` 是可选的扩展路由参数对象,可以传一个、多个字段或不传。组件会在每次候选办理人查询(包括组织树懒加载)中将其整体放入 `extendParams`;请求根对象中的 `processDefinitionId`、`activityId`、`userId`、`parentId` 和 `ntype` 由组件维护。使用 `FlowButtons` 内置发送/跳转弹窗或 `getRuntimeService().start()` 时也可传入同名参数。
|
|
244
|
+
|
|
234
245
|
## 10. ui-flow-jump
|
|
235
246
|
|
|
236
247
|
`FlowJump` 内置“开始节点 + 办理人”选择弹窗。办理人支持组织树懒加载;如果节点没有配置办理人,组件会回填当前用户。跳转不编辑业务变量,请求中固定提交 `variables: {}`。
|
|
@@ -241,6 +252,7 @@ import { ref } from 'vue'
|
|
|
241
252
|
import { FlowJump } from '@leadal/flowstream-ui-plus'
|
|
242
253
|
|
|
243
254
|
const jumpVisible = ref(false)
|
|
255
|
+
const assignmentQueryParams = { deptCode: 'D1001' }
|
|
244
256
|
</script>
|
|
245
257
|
|
|
246
258
|
<template>
|
|
@@ -250,6 +262,7 @@ const jumpVisible = ref(false)
|
|
|
250
262
|
:process-instance-id="task.processInstanceId"
|
|
251
263
|
:work-id="task.workId"
|
|
252
264
|
:deal-user="{ id: currentUserId, name: currentUserName }"
|
|
265
|
+
:assignment-query-params="assignmentQueryParams"
|
|
253
266
|
:show-trigger="false"
|
|
254
267
|
@before-jump="handleBeforeJump"
|
|
255
268
|
@after-jump="handleAfterJump"
|
|
@@ -298,6 +311,10 @@ async function submit() {
|
|
|
298
311
|
draftUserName: currentUser.name,
|
|
299
312
|
business: { key: businessId, name: businessName },
|
|
300
313
|
variables,
|
|
314
|
+
assignmentQueryParams: {
|
|
315
|
+
projectId: currentProject.id,
|
|
316
|
+
tenantId: currentTenant.id,
|
|
317
|
+
},
|
|
301
318
|
async onBeforeStart(startArgs) {
|
|
302
319
|
const formData = await openBusinessForm()
|
|
303
320
|
if (!formData) return false
|
|
@@ -331,6 +348,7 @@ async function submit() {
|
|
|
331
348
|
- 条件稍后满足时调用 `await flowstream.getRuntimeService().open()`,组件会重新执行 `onBeforeSend`;决定放弃时调用 `close()` 撤销实例并释放会话。
|
|
332
349
|
- 调用成功后直接打开选择弹窗,业务模板不需要挂载隐藏组件。
|
|
333
350
|
- 候选办理人可以有多个;`singleAssignee` 默认开启,每个下一节点只能选择一人。
|
|
351
|
+
- 自定义业务路由参数通过 `assignmentQueryParams` 传入,并作为候选办理人查询请求的 `extendParams` 字段发送。
|
|
334
352
|
- 用户确认后由内部发送组件调用 `sendTask()`;`onAfterSend` 参数中的 `sendData.flowNodeAssignees` 是实际发送的下一节点和办理人。
|
|
335
353
|
- 用户未发送就关闭弹窗时会撤销刚创建的流程实例并释放会话;只有 `onBeforeSend` 返回 `false`、弹窗尚未打开时,才能调用 `open()` 在条件满足后继续。
|
|
336
354
|
- `processDefinitionId`、`draftUserId`、`draftUserName` 均为必填;快速启动不支持多个首办节点或多个起草人待办。
|