@leadal/flowstream-ui-plus 0.0.3 → 0.0.4

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.
@@ -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` 是可选的自定义路由参数对象,可以传一个、多个字段或不传。它会追加到每次候选办理人查询(包括组织树懒加载)中。组件自己的 `processDefinitionId`、`activityId`、`userId` 和 `parentId` 不允许被该对象覆盖。使用 `FlowButtons` 内置发送弹窗或 `getRuntimeService().start()` 时也可传入同名参数。
244
+
234
245
  ## 10. ui-flow-jump
235
246
 
236
247
  `FlowJump` 内置“开始节点 + 办理人”选择弹窗。办理人支持组织树懒加载;如果节点没有配置办理人,组件会回填当前用户。跳转不编辑业务变量,请求中固定提交 `variables: {}`。
@@ -298,6 +309,10 @@ async function submit() {
298
309
  draftUserName: currentUser.name,
299
310
  business: { key: businessId, name: businessName },
300
311
  variables,
312
+ assignmentQueryParams: {
313
+ projectId: currentProject.id,
314
+ tenantId: currentTenant.id,
315
+ },
301
316
  async onBeforeStart(startArgs) {
302
317
  const formData = await openBusinessForm()
303
318
  if (!formData) return false
@@ -331,6 +346,7 @@ async function submit() {
331
346
  - 条件稍后满足时调用 `await flowstream.getRuntimeService().open()`,组件会重新执行 `onBeforeSend`;决定放弃时调用 `close()` 撤销实例并释放会话。
332
347
  - 调用成功后直接打开选择弹窗,业务模板不需要挂载隐藏组件。
333
348
  - 候选办理人可以有多个;`singleAssignee` 默认开启,每个下一节点只能选择一人。
349
+ - 自定义业务路由参数通过 `assignmentQueryParams` 传入,并自动附加到候选办理人查询请求。
334
350
  - 用户确认后由内部发送组件调用 `sendTask()`;`onAfterSend` 参数中的 `sendData.flowNodeAssignees` 是实际发送的下一节点和办理人。
335
351
  - 用户未发送就关闭弹窗时会撤销刚创建的流程实例并释放会话;只有 `onBeforeSend` 返回 `false`、弹窗尚未打开时,才能调用 `open()` 在条件满足后继续。
336
352
  - `processDefinitionId`、`draftUserId`、`draftUserName` 均为必填;快速启动不支持多个首办节点或多个起草人待办。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leadal/flowstream-ui-plus",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "FlowStream workflow components for Vue 3",
5
5
  "type": "module",
6
6
  "main": "dist/flowstream-ui-plus.umd.cjs",