@jari-ace/element-plus-component 0.6.2 → 0.6.3

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.
@@ -1,7 +1,7 @@
1
1
  import { ref, watch, computed, nextTick } from 'vue';
2
2
  import { useTaskQueryApi, useFlowDefinitionApi } from '@jari-ace/app-bolts';
3
3
  import { createAxiosWithoutCache, useLoading } from '@jari-ace/app-bolts';
4
- import { ElMessage, ElTag, ElCard, ElButton, ElTimeline, ElTimelineItem, ElEmpty, ElIcon, ElResult } from 'element-plus';
4
+ import { ElMessage, ElTag, ElCard, ElButton, ElTimeline, ElTimelineItem, ElEmpty, ElIcon, ElResult, ElDialog, ElScrollbar } from 'element-plus';
5
5
  import { JaButton } from '../button';
6
6
  import { JaUserInfoTag } from '../userTag';
7
7
  import { ArrowLeft, ArrowRight } from '@element-plus/icons-vue';
@@ -16,11 +16,13 @@ export default ((__VLS_props, __VLS_ctx, __VLS_expose, __VLS_setup = (async () =
16
16
  const props = withDefaults(defineProps(), {
17
17
  appName: undefined,
18
18
  flowKey: undefined,
19
+ bizTag: undefined,
19
20
  startNodeKey: undefined,
20
21
  taskInstanceId: undefined,
21
22
  width: undefined,
22
23
  height: undefined,
23
- defaultCollapsed: false
24
+ defaultCollapsed: false,
25
+ isNewForm: false
24
26
  });
25
27
  const dialogVisible = defineModel({
26
28
  default: false
@@ -136,32 +138,62 @@ export default ((__VLS_props, __VLS_ctx, __VLS_expose, __VLS_setup = (async () =
136
138
  return '未知状态';
137
139
  }
138
140
  };
141
+ const actualFlowKey = ref(props.flowKey);
142
+ const flowSelectionDialogVisible = ref(false);
143
+ const selectableFlows = ref([]);
144
+ const selectableFlowParams = ref([]);
139
145
  // 监听dialogVisible变化
140
146
  watch(() => dialogVisible.value, async (newValue) => {
141
147
  resetState();
148
+ actualFlowKey.value = props.flowKey;
142
149
  if (newValue) {
143
150
  emits('open');
144
- // 等待下一个事件循环,确保父组件的open事件处理完成(可能包含异步loadData)
151
+ //等待状态同步
145
152
  await nextTick();
146
- loadFlowFormParam();
153
+ if (props.taskId) {
154
+ // 场景一:通过 taskId 打开,直接加载
155
+ loadFlowFormParam();
156
+ }
157
+ else if (props.isNewForm) {
158
+ // 场景二:明确是新表单发起流程,不等待 formId,直接加载流程定义
159
+ loadFlowFormParam();
160
+ }
161
+ else if (props.formData?.flowFormId) {
162
+ // 场景三:非新表单,且一开始就已经有 formId,直接加载
163
+ loadFlowFormParam();
164
+ }
165
+ // 场景四:非新表单且没有 formId,什么都不做,等待 formData.flowFormId 的 watcher 触发
147
166
  }
148
167
  else {
149
168
  emits('closed');
150
169
  }
151
170
  });
171
+ // 监听 formData 的 flowFormId 变化,用于处理异步加载表单数据的场景
172
+ watch(() => props.formData?.flowFormId, (newFormId, oldFormId) => {
173
+ // 只有在 dialog 打开的情况下,且从无到有,或者发生了变化,且没有 taskId 的时候,才重新加载流程参数
174
+ if (dialogVisible.value && !props.taskId && !props.isNewForm && newFormId && newFormId !== oldFormId) {
175
+ // 避免重复加载,可以先重置
176
+ resetState();
177
+ actualFlowKey.value = props.flowKey;
178
+ loadFlowFormParam();
179
+ }
180
+ });
152
181
  // 重置状态
153
182
  const resetState = () => {
154
183
  error.value = '';
155
184
  flowFormParam.value = undefined;
185
+ selectableFlows.value = [];
186
+ selectableFlowParams.value = [];
187
+ actualFlowKey.value = undefined;
156
188
  };
157
189
  // 加载流程表单参数
158
190
  const loadFlowFormParam = async () => {
159
191
  resetState();
160
192
  const formId = props.formData?.flowFormId;
161
193
  // 检查参数
162
- // 必须提供 taskId,或者 appName 和 flowKey
163
- if (!props.taskId && !(props.appName && props.flowKey)) {
164
- ElMessage.error('参数错误: 必须提供taskId或appName、flowKey和flowFormId');
194
+ // 必须提供 taskId,或者 appName 和 (flowKey 或 bizTag)
195
+ if (!props.taskId && !(props.appName && (props.flowKey || props.bizTag))) {
196
+ ElMessage.error('参数错误: 必须提供taskId或appName、flowKey/bizTag和flowFormId');
165
197
  return;
166
198
  }
167
199
  try {
@@ -169,19 +201,41 @@ export default ((__VLS_props, __VLS_ctx, __VLS_expose, __VLS_setup = (async () =
169
201
  // 优先使用Id
170
202
  flowFormParam.value = await taskQueryApi.getTaskInstanceById(props.taskId);
171
203
  }
172
- else if (formId) {
204
+ else if (formId && props.flowKey) {
173
205
  // 使用appName、flowKey、formId
174
- flowFormParam.value = await taskQueryApi.getTaskByFormIdAndAppAndFlowKey(formId, props.appName, props.flowKey);
206
+ const param = await taskQueryApi.getTaskByFormIdAndAppAndFlowKey(formId, props.appName, props.flowKey);
207
+ if (param && param.flowDefinition) {
208
+ flowFormParam.value = param;
209
+ }
210
+ else {
211
+ // 兜底:如果没查到流程参数或者只有表单数据没有流程实例,按照新建模式加载流程定义
212
+ const flowDefinition = await flowDefinitionApi.getEffectiveDefinition(props.appName, props.flowKey);
213
+ flowFormParam.value = {
214
+ flowDefinition: flowDefinition,
215
+ };
216
+ }
217
+ }
218
+ else if (formId && props.bizTag) {
219
+ // formId 存在,但没有 flowKey,有 bizTag,查询可能存在的多个流程参数
220
+ const params = await taskQueryApi.getTasksByFormIdAndAppAndBizTag(formId, props.appName, props.bizTag);
221
+ if (!params || params.length === 0 || !params.some(p => p.flowDefinition)) {
222
+ // 兜底:如果没查到,或者查出来的都没有流程定义,直接按照没有formId走新建模式处理
223
+ await loadNewFlowParamWithBizTag();
224
+ }
225
+ else if (params.length === 1) {
226
+ flowFormParam.value = params[0];
227
+ actualFlowKey.value = params[0].flowDefinition?.flowKey;
228
+ }
229
+ else {
230
+ // 多于1个,不立即弹出选择框,先存起来,留到点击"发起工作"时再选
231
+ selectableFlowParams.value = params;
232
+ selectableFlows.value = params.map(p => p.flowDefinition);
233
+ return;
234
+ }
175
235
  }
176
236
  else {
177
- // 新建模式:只有 appName 和 flowKey,没有 formId
178
- // 获取流程定义
179
- const flowDefinition = await flowDefinitionApi.getEffectiveDefinition(props.appName, props.flowKey);
180
- // 构造部分 flowFormParam
181
- flowFormParam.value = {
182
- flowDefinition: flowDefinition,
183
- // 其他字段为空
184
- };
237
+ // 新建模式
238
+ await loadNewFlowParamWithBizTag();
185
239
  }
186
240
  }
187
241
  catch (e) {
@@ -189,6 +243,63 @@ export default ((__VLS_props, __VLS_ctx, __VLS_expose, __VLS_setup = (async () =
189
243
  error.value = e.message;
190
244
  }
191
245
  };
246
+ const loadNewFlowParamWithBizTag = async () => {
247
+ let keyToUse = props.flowKey;
248
+ if (!keyToUse && props.bizTag) {
249
+ // 根据 bizTag 查询当前生效的可用流程
250
+ const res = await flowDefinitionApi.getEffectiveDefinitionsByBizTag(props.appName, props.bizTag);
251
+ if (!res || res.length === 0) {
252
+ throw new Error(`未找到业务标签为 ${props.bizTag} 的生效可用流程定义`);
253
+ }
254
+ else if (res.length === 1) {
255
+ keyToUse = res[0].flowKey;
256
+ }
257
+ else {
258
+ // 弹出选择对话框的动作延迟到点击发起工作
259
+ selectableFlows.value = res;
260
+ return;
261
+ }
262
+ }
263
+ actualFlowKey.value = keyToUse;
264
+ // 获取流程定义
265
+ const flowDefinition = await flowDefinitionApi.getEffectiveDefinition(props.appName, keyToUse);
266
+ // 构造部分 flowFormParam
267
+ flowFormParam.value = {
268
+ flowDefinition: flowDefinition,
269
+ // 其他字段为空
270
+ };
271
+ };
272
+ const handleSelectFlow = async (flow) => {
273
+ flowSelectionDialogVisible.value = false;
274
+ actualFlowKey.value = flow.flowKey;
275
+ try {
276
+ if (selectableFlowParams.value.length > 0) {
277
+ // 已经有完整的流程参数了,直接使用
278
+ const param = selectableFlowParams.value.find(p => p.flowDefinition?.flowKey === flow.flowKey);
279
+ if (param) {
280
+ flowFormParam.value = param;
281
+ // 选择了之后,直接执行原先因为需要选择而暂停的 发起/提交流程 操作
282
+ await executeForward();
283
+ return;
284
+ }
285
+ }
286
+ // 否则作为新建模式加载最新流程定义
287
+ const flowDefinition = await flowDefinitionApi.getEffectiveDefinition(props.appName, flow.flowKey);
288
+ flowFormParam.value = {
289
+ flowDefinition: flowDefinition,
290
+ };
291
+ // 选择了之后,直接执行原先因为需要选择而暂停的 发起/提交流程 操作
292
+ await executeForward();
293
+ }
294
+ catch (e) {
295
+ ElMessage.error(e.message || '加载流程信息失败');
296
+ error.value = e.message;
297
+ }
298
+ };
299
+ const handleCancelFlowSelection = () => {
300
+ flowSelectionDialogVisible.value = false;
301
+ // 取消选择不再关闭整个表单,只是取消本次的发起动作
302
+ };
192
303
  // 底部按钮处理
193
304
  const handleSave = async () => {
194
305
  saving.value = true;
@@ -198,7 +309,7 @@ export default ((__VLS_props, __VLS_ctx, __VLS_expose, __VLS_setup = (async () =
198
309
  taskId: flowFormParam.value?.taskInstance?.id || '',
199
310
  processRequestType: "SAVE_FORM",
200
311
  appName: props.appName || '',
201
- flowKey: props.flowKey || '',
312
+ flowKey: actualFlowKey.value || '',
202
313
  startNodeKey: props.startNodeKey || '',
203
314
  forwardTo: []
204
315
  },
@@ -209,7 +320,8 @@ export default ((__VLS_props, __VLS_ctx, __VLS_expose, __VLS_setup = (async () =
209
320
  saving.value = false;
210
321
  }
211
322
  };
212
- const handleForward = async () => {
323
+ // 实际执行保存并转发的核心逻辑
324
+ const executeForward = async () => {
213
325
  saving.value = true;
214
326
  try {
215
327
  const p = flowFormParam.value;
@@ -218,7 +330,7 @@ export default ((__VLS_props, __VLS_ctx, __VLS_expose, __VLS_setup = (async () =
218
330
  taskId: p?.taskInstance?.id || '',
219
331
  processRequestType: p?.taskInstance ? "FORWARD" : "INITIATE",
220
332
  appName: props.appName || '',
221
- flowKey: props.flowKey || '',
333
+ flowKey: actualFlowKey.value || '',
222
334
  startNodeKey: props.startNodeKey || '',
223
335
  forwardTo: []
224
336
  },
@@ -230,15 +342,25 @@ export default ((__VLS_props, __VLS_ctx, __VLS_expose, __VLS_setup = (async () =
230
342
  saving.value = false;
231
343
  }
232
344
  };
345
+ const handleForward = async () => {
346
+ // 如果需要选择流程,并且还没有确定实际使用的 flowKey,则弹出选择对话框
347
+ if (selectableFlows.value.length > 1 && !actualFlowKey.value) {
348
+ flowSelectionDialogVisible.value = true;
349
+ return;
350
+ }
351
+ await executeForward();
352
+ };
233
353
  debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
234
354
  const __VLS_withDefaultsArg = (function (t) { return t; })({
235
355
  appName: undefined,
236
356
  flowKey: undefined,
357
+ bizTag: undefined,
237
358
  startNodeKey: undefined,
238
359
  taskInstanceId: undefined,
239
360
  width: undefined,
240
361
  height: undefined,
241
- defaultCollapsed: false
362
+ defaultCollapsed: false,
363
+ isNewForm: false
242
364
  });
243
365
  const __VLS_fnComponent = (await import('vue')).defineComponent({
244
366
  __typeEmits: {},
@@ -264,6 +386,8 @@ export default ((__VLS_props, __VLS_ctx, __VLS_expose, __VLS_setup = (async () =
264
386
  /** @type {__VLS_StyleScopedClasses['side-panel-header']} */ ;
265
387
  /** @type {__VLS_StyleScopedClasses['collapse-btn']} */ ;
266
388
  /** @type {__VLS_StyleScopedClasses['comment-content']} */ ;
389
+ /** @type {__VLS_StyleScopedClasses['flow-selection-card']} */ ;
390
+ /** @type {__VLS_StyleScopedClasses['flow-selection-card']} */ ;
267
391
  // CSS variable injection
268
392
  // CSS variable injection end
269
393
  if (__VLS_ctx.dialogVisible) {
@@ -446,26 +570,12 @@ export default ((__VLS_props, __VLS_ctx, __VLS_expose, __VLS_setup = (async () =
446
570
  }
447
571
  var __VLS_23;
448
572
  }
449
- else if (__VLS_ctx.flowFormParam) {
573
+ else {
450
574
  __VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({});
451
575
  var __VLS_32 = {
452
576
  flowParam: (__VLS_ctx.flowFormParam),
453
577
  };
454
578
  }
455
- else {
456
- __VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
457
- ...{ class: "no-form-tip" },
458
- });
459
- const __VLS_34 = {}.ElEmpty;
460
- /** @type {[typeof __VLS_components.ElEmpty, typeof __VLS_components.elEmpty, ]} */ ;
461
- // @ts-ignore
462
- const __VLS_35 = __VLS_asFunctionalComponent(__VLS_34, new __VLS_34({
463
- description: "暂无表单内容",
464
- }));
465
- const __VLS_36 = __VLS_35({
466
- description: "暂无表单内容",
467
- }, ...__VLS_functionalComponentArgsRest(__VLS_35));
468
- }
469
579
  __VLS_asFunctionalElement(__VLS_intrinsicElements.aside, __VLS_intrinsicElements.aside)({
470
580
  ...{ class: "side-panel" },
471
581
  ...{ class: ({ 'collapsed': __VLS_ctx.sidePanelCollapsed }) },
@@ -483,59 +593,59 @@ export default ((__VLS_props, __VLS_ctx, __VLS_expose, __VLS_setup = (async () =
483
593
  ...{ class: "collapse-btn" },
484
594
  title: (__VLS_ctx.sidePanelCollapsed ? '展开' : '收起'),
485
595
  });
486
- const __VLS_38 = {}.ElIcon;
596
+ const __VLS_34 = {}.ElIcon;
487
597
  /** @type {[typeof __VLS_components.ElIcon, typeof __VLS_components.elIcon, typeof __VLS_components.ElIcon, typeof __VLS_components.elIcon, ]} */ ;
488
598
  // @ts-ignore
489
- const __VLS_39 = __VLS_asFunctionalComponent(__VLS_38, new __VLS_38({}));
490
- const __VLS_40 = __VLS_39({}, ...__VLS_functionalComponentArgsRest(__VLS_39));
491
- __VLS_41.slots.default;
599
+ const __VLS_35 = __VLS_asFunctionalComponent(__VLS_34, new __VLS_34({}));
600
+ const __VLS_36 = __VLS_35({}, ...__VLS_functionalComponentArgsRest(__VLS_35));
601
+ __VLS_37.slots.default;
492
602
  if (!__VLS_ctx.sidePanelCollapsed) {
493
- const __VLS_42 = {}.ArrowRight;
603
+ const __VLS_38 = {}.ArrowRight;
494
604
  /** @type {[typeof __VLS_components.ArrowRight, ]} */ ;
495
605
  // @ts-ignore
496
- const __VLS_43 = __VLS_asFunctionalComponent(__VLS_42, new __VLS_42({}));
497
- const __VLS_44 = __VLS_43({}, ...__VLS_functionalComponentArgsRest(__VLS_43));
606
+ const __VLS_39 = __VLS_asFunctionalComponent(__VLS_38, new __VLS_38({}));
607
+ const __VLS_40 = __VLS_39({}, ...__VLS_functionalComponentArgsRest(__VLS_39));
498
608
  }
499
609
  else {
500
- const __VLS_46 = {}.ArrowLeft;
610
+ const __VLS_42 = {}.ArrowLeft;
501
611
  /** @type {[typeof __VLS_components.ArrowLeft, ]} */ ;
502
612
  // @ts-ignore
503
- const __VLS_47 = __VLS_asFunctionalComponent(__VLS_46, new __VLS_46({}));
504
- const __VLS_48 = __VLS_47({}, ...__VLS_functionalComponentArgsRest(__VLS_47));
613
+ const __VLS_43 = __VLS_asFunctionalComponent(__VLS_42, new __VLS_42({}));
614
+ const __VLS_44 = __VLS_43({}, ...__VLS_functionalComponentArgsRest(__VLS_43));
505
615
  }
506
- var __VLS_41;
616
+ var __VLS_37;
507
617
  __VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
508
618
  ...{ class: "side-panel-content" },
509
619
  });
510
620
  __VLS_asFunctionalDirective(__VLS_directives.vShow)(null, { ...__VLS_directiveBindingRestFields, value: (!__VLS_ctx.sidePanelCollapsed) }, null, null);
511
621
  if (__VLS_ctx.sortedTasks.length > 0) {
512
- const __VLS_50 = {}.ElTimeline;
622
+ const __VLS_46 = {}.ElTimeline;
513
623
  /** @type {[typeof __VLS_components.ElTimeline, typeof __VLS_components.elTimeline, typeof __VLS_components.ElTimeline, typeof __VLS_components.elTimeline, ]} */ ;
514
624
  // @ts-ignore
515
- const __VLS_51 = __VLS_asFunctionalComponent(__VLS_50, new __VLS_50({}));
516
- const __VLS_52 = __VLS_51({}, ...__VLS_functionalComponentArgsRest(__VLS_51));
517
- __VLS_53.slots.default;
625
+ const __VLS_47 = __VLS_asFunctionalComponent(__VLS_46, new __VLS_46({}));
626
+ const __VLS_48 = __VLS_47({}, ...__VLS_functionalComponentArgsRest(__VLS_47));
627
+ __VLS_49.slots.default;
518
628
  for (const [task, index] of __VLS_getVForSourceType((__VLS_ctx.sortedTasks))) {
519
- const __VLS_54 = {}.ElTimelineItem;
629
+ const __VLS_50 = {}.ElTimelineItem;
520
630
  /** @type {[typeof __VLS_components.ElTimelineItem, typeof __VLS_components.elTimelineItem, typeof __VLS_components.ElTimelineItem, typeof __VLS_components.elTimelineItem, ]} */ ;
521
631
  // @ts-ignore
522
- const __VLS_55 = __VLS_asFunctionalComponent(__VLS_54, new __VLS_54({
632
+ const __VLS_51 = __VLS_asFunctionalComponent(__VLS_50, new __VLS_50({
523
633
  key: (index),
524
634
  timestamp: (__VLS_ctx.formatFriendlyTime(task.finishTime)),
525
635
  placement: "top",
526
636
  }));
527
- const __VLS_56 = __VLS_55({
637
+ const __VLS_52 = __VLS_51({
528
638
  key: (index),
529
639
  timestamp: (__VLS_ctx.formatFriendlyTime(task.finishTime)),
530
640
  placement: "top",
531
- }, ...__VLS_functionalComponentArgsRest(__VLS_55));
532
- __VLS_57.slots.default;
533
- const __VLS_58 = {}.ElCard;
641
+ }, ...__VLS_functionalComponentArgsRest(__VLS_51));
642
+ __VLS_53.slots.default;
643
+ const __VLS_54 = {}.ElCard;
534
644
  /** @type {[typeof __VLS_components.ElCard, typeof __VLS_components.elCard, typeof __VLS_components.ElCard, typeof __VLS_components.elCard, ]} */ ;
535
645
  // @ts-ignore
536
- const __VLS_59 = __VLS_asFunctionalComponent(__VLS_58, new __VLS_58({}));
537
- const __VLS_60 = __VLS_59({}, ...__VLS_functionalComponentArgsRest(__VLS_59));
538
- __VLS_61.slots.default;
646
+ const __VLS_55 = __VLS_asFunctionalComponent(__VLS_54, new __VLS_54({}));
647
+ const __VLS_56 = __VLS_55({}, ...__VLS_functionalComponentArgsRest(__VLS_55));
648
+ __VLS_57.slots.default;
539
649
  __VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
540
650
  ...{ class: "task-info" },
541
651
  });
@@ -546,23 +656,23 @@ export default ((__VLS_props, __VLS_ctx, __VLS_expose, __VLS_setup = (async () =
546
656
  ...{ class: "handler-name" },
547
657
  });
548
658
  (task.handlerName || '未知');
549
- const __VLS_62 = {}.ElTooltip;
659
+ const __VLS_58 = {}.ElTooltip;
550
660
  /** @type {[typeof __VLS_components.ElTooltip, typeof __VLS_components.elTooltip, typeof __VLS_components.ElTooltip, typeof __VLS_components.elTooltip, ]} */ ;
551
661
  // @ts-ignore
552
- const __VLS_63 = __VLS_asFunctionalComponent(__VLS_62, new __VLS_62({
662
+ const __VLS_59 = __VLS_asFunctionalComponent(__VLS_58, new __VLS_58({
553
663
  content: (__VLS_ctx.formatDate(task.finishTime)),
554
664
  placement: "top",
555
665
  }));
556
- const __VLS_64 = __VLS_63({
666
+ const __VLS_60 = __VLS_59({
557
667
  content: (__VLS_ctx.formatDate(task.finishTime)),
558
668
  placement: "top",
559
- }, ...__VLS_functionalComponentArgsRest(__VLS_63));
560
- __VLS_65.slots.default;
669
+ }, ...__VLS_functionalComponentArgsRest(__VLS_59));
670
+ __VLS_61.slots.default;
561
671
  __VLS_asFunctionalElement(__VLS_intrinsicElements.span, __VLS_intrinsicElements.span)({
562
672
  ...{ class: "task-status" },
563
673
  });
564
674
  (__VLS_ctx.getTaskStatus(task.state));
565
- var __VLS_65;
675
+ var __VLS_61;
566
676
  if (task.comment) {
567
677
  __VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
568
678
  ...{ class: "task-comment" },
@@ -586,60 +696,60 @@ export default ((__VLS_props, __VLS_ctx, __VLS_expose, __VLS_setup = (async () =
586
696
  ...{ class: "comment-content empty" },
587
697
  });
588
698
  }
589
- var __VLS_61;
590
699
  var __VLS_57;
700
+ var __VLS_53;
591
701
  }
592
- var __VLS_53;
702
+ var __VLS_49;
593
703
  }
594
704
  else {
595
705
  __VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
596
706
  ...{ class: "no-history-tip" },
597
707
  });
598
- const __VLS_66 = {}.ElEmpty;
708
+ const __VLS_62 = {}.ElEmpty;
599
709
  /** @type {[typeof __VLS_components.ElEmpty, typeof __VLS_components.elEmpty, ]} */ ;
600
710
  // @ts-ignore
601
- const __VLS_67 = __VLS_asFunctionalComponent(__VLS_66, new __VLS_66({
711
+ const __VLS_63 = __VLS_asFunctionalComponent(__VLS_62, new __VLS_62({
602
712
  description: "暂无办理历史",
603
713
  imageSize: (100),
604
714
  }));
605
- const __VLS_68 = __VLS_67({
715
+ const __VLS_64 = __VLS_63({
606
716
  description: "暂无办理历史",
607
717
  imageSize: (100),
608
- }, ...__VLS_functionalComponentArgsRest(__VLS_67));
718
+ }, ...__VLS_functionalComponentArgsRest(__VLS_63));
609
719
  }
610
720
  __VLS_asFunctionalElement(__VLS_intrinsicElements.footer, __VLS_intrinsicElements.footer)({
611
721
  ...{ class: "flow-shell-footer" },
612
722
  });
613
- const __VLS_70 = {}.JaButton;
723
+ const __VLS_66 = {}.JaButton;
614
724
  /** @type {[typeof __VLS_components.JaButton, typeof __VLS_components.jaButton, typeof __VLS_components.JaButton, typeof __VLS_components.jaButton, ]} */ ;
615
725
  // @ts-ignore
616
- const __VLS_71 = __VLS_asFunctionalComponent(__VLS_70, new __VLS_70({
726
+ const __VLS_67 = __VLS_asFunctionalComponent(__VLS_66, new __VLS_66({
617
727
  ...{ 'onClick': {} },
618
728
  shortcut: "Ctrl+S",
619
729
  tooltip: "保存",
620
730
  loading: (__VLS_ctx.saving),
621
731
  disabled: (__VLS_ctx.saving),
622
732
  }));
623
- const __VLS_72 = __VLS_71({
733
+ const __VLS_68 = __VLS_67({
624
734
  ...{ 'onClick': {} },
625
735
  shortcut: "Ctrl+S",
626
736
  tooltip: "保存",
627
737
  loading: (__VLS_ctx.saving),
628
738
  disabled: (__VLS_ctx.saving),
629
- }, ...__VLS_functionalComponentArgsRest(__VLS_71));
630
- let __VLS_74;
631
- let __VLS_75;
632
- let __VLS_76;
633
- const __VLS_77 = {
739
+ }, ...__VLS_functionalComponentArgsRest(__VLS_67));
740
+ let __VLS_70;
741
+ let __VLS_71;
742
+ let __VLS_72;
743
+ const __VLS_73 = {
634
744
  onClick: (__VLS_ctx.handleSave)
635
745
  };
636
- __VLS_73.slots.default;
637
- var __VLS_73;
746
+ __VLS_69.slots.default;
747
+ var __VLS_69;
638
748
  if (__VLS_ctx.showForwardButton) {
639
- const __VLS_78 = {}.JaButton;
749
+ const __VLS_74 = {}.JaButton;
640
750
  /** @type {[typeof __VLS_components.JaButton, typeof __VLS_components.jaButton, typeof __VLS_components.JaButton, typeof __VLS_components.jaButton, ]} */ ;
641
751
  // @ts-ignore
642
- const __VLS_79 = __VLS_asFunctionalComponent(__VLS_78, new __VLS_78({
752
+ const __VLS_75 = __VLS_asFunctionalComponent(__VLS_74, new __VLS_74({
643
753
  ...{ 'onClick': {} },
644
754
  type: "danger",
645
755
  shortcut: "Ctrl+F",
@@ -647,27 +757,139 @@ export default ((__VLS_props, __VLS_ctx, __VLS_expose, __VLS_setup = (async () =
647
757
  loading: (__VLS_ctx.saving),
648
758
  disabled: (__VLS_ctx.saving),
649
759
  }));
650
- const __VLS_80 = __VLS_79({
760
+ const __VLS_76 = __VLS_75({
651
761
  ...{ 'onClick': {} },
652
762
  type: "danger",
653
763
  shortcut: "Ctrl+F",
654
764
  tooltip: ('保存并' + (__VLS_ctx.flowFormParam?.taskInstance ? '结束当前工作步骤办理' : '发起工作')),
655
765
  loading: (__VLS_ctx.saving),
656
766
  disabled: (__VLS_ctx.saving),
657
- }, ...__VLS_functionalComponentArgsRest(__VLS_79));
658
- let __VLS_82;
659
- let __VLS_83;
660
- let __VLS_84;
661
- const __VLS_85 = {
767
+ }, ...__VLS_functionalComponentArgsRest(__VLS_75));
768
+ let __VLS_78;
769
+ let __VLS_79;
770
+ let __VLS_80;
771
+ const __VLS_81 = {
662
772
  onClick: (__VLS_ctx.handleForward)
663
773
  };
664
- __VLS_81.slots.default;
665
- (__VLS_ctx.flowFormParam?.taskInstance ? "办理结束" : "发起工作");
666
- var __VLS_81;
774
+ __VLS_77.slots.default;
775
+ (__VLS_ctx.flowFormParam?.taskInstance ? "办理结束" : "发起流程");
776
+ var __VLS_77;
667
777
  }
668
- var __VLS_86 = {
778
+ var __VLS_82 = {
669
779
  flowParam: (__VLS_ctx.flowFormParam),
670
780
  };
781
+ const __VLS_84 = {}.ElDialog;
782
+ /** @type {[typeof __VLS_components.ElDialog, typeof __VLS_components.elDialog, typeof __VLS_components.ElDialog, typeof __VLS_components.elDialog, ]} */ ;
783
+ // @ts-ignore
784
+ const __VLS_85 = __VLS_asFunctionalComponent(__VLS_84, new __VLS_84({
785
+ modelValue: (__VLS_ctx.flowSelectionDialogVisible),
786
+ title: "选择流程",
787
+ width: "500px",
788
+ closeOnClickModal: (false),
789
+ showClose: (false),
790
+ alignCenter: true,
791
+ appendToBody: true,
792
+ }));
793
+ const __VLS_86 = __VLS_85({
794
+ modelValue: (__VLS_ctx.flowSelectionDialogVisible),
795
+ title: "选择流程",
796
+ width: "500px",
797
+ closeOnClickModal: (false),
798
+ showClose: (false),
799
+ alignCenter: true,
800
+ appendToBody: true,
801
+ }, ...__VLS_functionalComponentArgsRest(__VLS_85));
802
+ __VLS_87.slots.default;
803
+ const __VLS_88 = {}.ElScrollbar;
804
+ /** @type {[typeof __VLS_components.ElScrollbar, typeof __VLS_components.elScrollbar, typeof __VLS_components.ElScrollbar, typeof __VLS_components.elScrollbar, ]} */ ;
805
+ // @ts-ignore
806
+ const __VLS_89 = __VLS_asFunctionalComponent(__VLS_88, new __VLS_88({
807
+ maxHeight: "50vh",
808
+ }));
809
+ const __VLS_90 = __VLS_89({
810
+ maxHeight: "50vh",
811
+ }, ...__VLS_functionalComponentArgsRest(__VLS_89));
812
+ __VLS_91.slots.default;
813
+ __VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
814
+ ...{ class: "flow-selection-list" },
815
+ });
816
+ for (const [flow] of __VLS_getVForSourceType((__VLS_ctx.selectableFlows))) {
817
+ const __VLS_92 = {}.ElCard;
818
+ /** @type {[typeof __VLS_components.ElCard, typeof __VLS_components.elCard, typeof __VLS_components.ElCard, typeof __VLS_components.elCard, ]} */ ;
819
+ // @ts-ignore
820
+ const __VLS_93 = __VLS_asFunctionalComponent(__VLS_92, new __VLS_92({
821
+ ...{ 'onClick': {} },
822
+ key: (flow.flowKey),
823
+ ...{ class: "flow-selection-card" },
824
+ shadow: "hover",
825
+ }));
826
+ const __VLS_94 = __VLS_93({
827
+ ...{ 'onClick': {} },
828
+ key: (flow.flowKey),
829
+ ...{ class: "flow-selection-card" },
830
+ shadow: "hover",
831
+ }, ...__VLS_functionalComponentArgsRest(__VLS_93));
832
+ let __VLS_96;
833
+ let __VLS_97;
834
+ let __VLS_98;
835
+ const __VLS_99 = {
836
+ onClick: (...[$event]) => {
837
+ if (!(__VLS_ctx.dialogVisible))
838
+ return;
839
+ __VLS_ctx.handleSelectFlow(flow);
840
+ }
841
+ };
842
+ __VLS_95.slots.default;
843
+ __VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
844
+ ...{ class: "flow-card-content" },
845
+ });
846
+ __VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
847
+ ...{ class: "flow-caption" },
848
+ });
849
+ (flow.flowCaption);
850
+ __VLS_asFunctionalElement(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({
851
+ ...{ class: "flow-key" },
852
+ });
853
+ (flow.flowKey);
854
+ const __VLS_100 = {}.ElIcon;
855
+ /** @type {[typeof __VLS_components.ElIcon, typeof __VLS_components.elIcon, typeof __VLS_components.ElIcon, typeof __VLS_components.elIcon, ]} */ ;
856
+ // @ts-ignore
857
+ const __VLS_101 = __VLS_asFunctionalComponent(__VLS_100, new __VLS_100({}));
858
+ const __VLS_102 = __VLS_101({}, ...__VLS_functionalComponentArgsRest(__VLS_101));
859
+ __VLS_103.slots.default;
860
+ const __VLS_104 = {}.ArrowRight;
861
+ /** @type {[typeof __VLS_components.ArrowRight, ]} */ ;
862
+ // @ts-ignore
863
+ const __VLS_105 = __VLS_asFunctionalComponent(__VLS_104, new __VLS_104({}));
864
+ const __VLS_106 = __VLS_105({}, ...__VLS_functionalComponentArgsRest(__VLS_105));
865
+ var __VLS_103;
866
+ var __VLS_95;
867
+ }
868
+ var __VLS_91;
869
+ {
870
+ const { footer: __VLS_thisSlot } = __VLS_87.slots;
871
+ __VLS_asFunctionalElement(__VLS_intrinsicElements.span, __VLS_intrinsicElements.span)({
872
+ ...{ class: "dialog-footer" },
873
+ });
874
+ const __VLS_108 = {}.ElButton;
875
+ /** @type {[typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ]} */ ;
876
+ // @ts-ignore
877
+ const __VLS_109 = __VLS_asFunctionalComponent(__VLS_108, new __VLS_108({
878
+ ...{ 'onClick': {} },
879
+ }));
880
+ const __VLS_110 = __VLS_109({
881
+ ...{ 'onClick': {} },
882
+ }, ...__VLS_functionalComponentArgsRest(__VLS_109));
883
+ let __VLS_112;
884
+ let __VLS_113;
885
+ let __VLS_114;
886
+ const __VLS_115 = {
887
+ onClick: (__VLS_ctx.handleCancelFlowSelection)
888
+ };
889
+ __VLS_111.slots.default;
890
+ var __VLS_111;
891
+ }
892
+ var __VLS_87;
671
893
  }
672
894
  /** @type {__VLS_StyleScopedClasses['flow-shell-wrapper']} */ ;
673
895
  /** @type {__VLS_StyleScopedClasses['flow-shell-container']} */ ;
@@ -691,7 +913,6 @@ export default ((__VLS_props, __VLS_ctx, __VLS_expose, __VLS_setup = (async () =
691
913
  /** @type {__VLS_StyleScopedClasses['main-content']} */ ;
692
914
  /** @type {__VLS_StyleScopedClasses['content-wrapper']} */ ;
693
915
  /** @type {__VLS_StyleScopedClasses['error-tip']} */ ;
694
- /** @type {__VLS_StyleScopedClasses['no-form-tip']} */ ;
695
916
  /** @type {__VLS_StyleScopedClasses['side-panel']} */ ;
696
917
  /** @type {__VLS_StyleScopedClasses['collapsed']} */ ;
697
918
  /** @type {__VLS_StyleScopedClasses['side-panel-header']} */ ;
@@ -710,8 +931,14 @@ export default ((__VLS_props, __VLS_ctx, __VLS_expose, __VLS_setup = (async () =
710
931
  /** @type {__VLS_StyleScopedClasses['empty']} */ ;
711
932
  /** @type {__VLS_StyleScopedClasses['no-history-tip']} */ ;
712
933
  /** @type {__VLS_StyleScopedClasses['flow-shell-footer']} */ ;
934
+ /** @type {__VLS_StyleScopedClasses['flow-selection-list']} */ ;
935
+ /** @type {__VLS_StyleScopedClasses['flow-selection-card']} */ ;
936
+ /** @type {__VLS_StyleScopedClasses['flow-card-content']} */ ;
937
+ /** @type {__VLS_StyleScopedClasses['flow-caption']} */ ;
938
+ /** @type {__VLS_StyleScopedClasses['flow-key']} */ ;
939
+ /** @type {__VLS_StyleScopedClasses['dialog-footer']} */ ;
713
940
  // @ts-ignore
714
- var __VLS_33 = __VLS_32, __VLS_87 = __VLS_86;
941
+ var __VLS_33 = __VLS_32, __VLS_83 = __VLS_82;
715
942
  var __VLS_dollars;
716
943
  const __VLS_self = (await import('vue')).defineComponent({
717
944
  setup() {
@@ -724,6 +951,8 @@ export default ((__VLS_props, __VLS_ctx, __VLS_expose, __VLS_setup = (async () =
724
951
  ElEmpty: ElEmpty,
725
952
  ElIcon: ElIcon,
726
953
  ElResult: ElResult,
954
+ ElDialog: ElDialog,
955
+ ElScrollbar: ElScrollbar,
727
956
  JaButton: JaButton,
728
957
  JaUserInfoTag: JaUserInfoTag,
729
958
  ArrowLeft: ArrowLeft,
@@ -744,7 +973,11 @@ export default ((__VLS_props, __VLS_ctx, __VLS_expose, __VLS_setup = (async () =
744
973
  formatFriendlyTime: formatFriendlyTime,
745
974
  getFlowStatus: getFlowStatus,
746
975
  getTaskStatus: getTaskStatus,
976
+ flowSelectionDialogVisible: flowSelectionDialogVisible,
977
+ selectableFlows: selectableFlows,
747
978
  loadFlowFormParam: loadFlowFormParam,
979
+ handleSelectFlow: handleSelectFlow,
980
+ handleCancelFlowSelection: handleCancelFlowSelection,
748
981
  handleSave: handleSave,
749
982
  handleForward: handleForward,
750
983
  };