ui-process-h5 0.1.40 → 1.0.1

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.
Files changed (58) hide show
  1. package/build/configure/README.md +83 -42
  2. package/build/configure/package.json +3 -2
  3. package/package.json +5 -2
  4. package/src/App.vue +87 -16
  5. package/src/assets/js/auth.js +36 -12
  6. package/src/assets/js/request.js +80 -71
  7. package/src/assets/js/utils.js +2 -1
  8. package/src/assets/status/check.png +0 -0
  9. package/src/assets/status/del.png +0 -0
  10. package/src/main.js +14 -12
  11. package/src/packages/attchUpload/index.js +19 -16
  12. package/src/packages/attchUpload/index.scss +10 -3
  13. package/src/packages/downSelect/index.js +25 -7
  14. package/src/packages/downSelect/index.scss +4 -0
  15. package/src/packages/downSelect/index.vue +6 -3
  16. package/src/packages/popup/index.js +17 -5
  17. package/src/packages/popup/index.scss +0 -1
  18. package/src/packages/popup/index.vue +1 -0
  19. package/src/packages/preview/index.vue +1 -1
  20. package/src/packages/previewImage/index.js +125 -2
  21. package/src/packages/previewImage/index.scss +19 -2
  22. package/src/packages/previewImage/index.vue +25 -4
  23. package/src/packages/process/index.js +299 -55
  24. package/src/packages/process/index.scss +12 -1
  25. package/src/packages/process/index.vue +114 -40
  26. package/src/packages/process/operation/backNode.vue +117 -25
  27. package/src/packages/process/operation/cancel.vue +133 -14
  28. package/src/packages/process/operation/ccTask.vue +46 -34
  29. package/src/packages/process/operation/complete.vue +729 -91
  30. package/src/packages/process/operation/counterSign.vue +130 -25
  31. package/src/packages/process/operation/delegateTask.vue +130 -23
  32. package/src/packages/process/operation/msgList.vue +174 -0
  33. package/src/packages/process/operation/restart.vue +15 -4
  34. package/src/packages/submitPopup/index.js +407 -59
  35. package/src/packages/submitPopup/index.scss +51 -46
  36. package/src/packages/submitPopup/index.vue +21 -5
  37. package/src/packages/tab/index.js +34 -5
  38. package/src/packages/tab/index.scss +2 -1
  39. package/src/packages/tab/index.vue +7 -7
  40. package/src/packages/tip/index.js +8 -2
  41. package/src/packages/tip/index.scss +39 -0
  42. package/src/packages/tip/index.vue +1 -1
  43. package/src/packages/viewAttchList/index.js +16 -14
  44. package/vite.config.ts +101 -72
  45. package/ui-process-h5/README.md +0 -171
  46. package/ui-process-h5/package.json +0 -27
  47. package/ui-process-h5/scripts/postinstall.mjs +0 -14
  48. package/ui-process-h5/scripts/switch-cli.mjs +0 -4
  49. package/ui-process-h5/scripts/utils.mjs +0 -60
  50. package/ui-process-h5/v2/style.css +0 -1
  51. package/ui-process-h5/v2/ui-process-h5.js +0 -13467
  52. package/ui-process-h5/v2/ui-process-h5.umd.cjs +0 -67
  53. package/ui-process-h5/v2.7/style.css +0 -1
  54. package/ui-process-h5/v2.7/ui-process-h5.js +0 -12844
  55. package/ui-process-h5/v2.7/ui-process-h5.umd.cjs +0 -67
  56. package/ui-process-h5/v3/style.css +0 -1
  57. package/ui-process-h5/v3/ui-process-h5.js +0 -10336
  58. package/ui-process-h5/v3/ui-process-h5.umd.cjs +0 -55
@@ -21,7 +21,7 @@ export default defineComponent({
21
21
  },
22
22
  // 请求
23
23
  request: {
24
- type: Function,
24
+ type: [Function, Object],
25
25
  default: () => {
26
26
  return { get: () => {}, post: () => {}, upload: () => {} };
27
27
  },
@@ -67,6 +67,25 @@ export default defineComponent({
67
67
  type: String,
68
68
  default: "测试",
69
69
  },
70
+ // 送审
71
+ showType: {
72
+ type: String,
73
+ default: "all",
74
+ },
75
+ beforeFunction: {
76
+ type: Function,
77
+ default: null,
78
+ },
79
+ manual: {
80
+ type: Boolean,
81
+ default: false,
82
+ },
83
+ // 自定义参数列表
84
+ selfList: {
85
+ type: Array,
86
+ default: () => [],
87
+ },
88
+ //
70
89
  },
71
90
  data() {
72
91
  return {
@@ -85,9 +104,11 @@ export default defineComponent({
85
104
  /* businessId: this.param.businessKey, */
86
105
  codeType: [3], // 可选类型 1-主体 2-部门 3-人员
87
106
  multiple: false, // 是否多选
107
+ checkedArray: [],
88
108
  },
89
109
 
90
110
  multiNodeParticipant: {},
111
+ personListCopy: {},
91
112
  partNode: {},
92
113
  personObjId: "",
93
114
 
@@ -99,7 +120,17 @@ export default defineComponent({
99
120
  statusTips: false,
100
121
  typeTips: "success",
101
122
  firstPerson: [],
102
- //
123
+ selectDefaultValue: "",
124
+
125
+ // 监听复制
126
+ businessTypeData: "",
127
+ idData: "",
128
+ processNameData: "",
129
+ titleData: "",
130
+ todoParameterData: {},
131
+
132
+ humanPerformerName: "",
133
+ btnLoading: false,
103
134
  };
104
135
  },
105
136
  watch: {
@@ -107,52 +138,175 @@ export default defineComponent({
107
138
  async handler(val, preVal) {
108
139
  this.show = val;
109
140
  this.$emit("update:visible", this.show);
141
+ if (val) {
142
+ this.handleOption();
143
+ }
144
+ },
145
+ },
146
+ // 业务类型
147
+ businessType: {
148
+ handler(val, preVal) {
149
+ this.businessTypeData = val;
150
+ },
151
+ immediate: true,
152
+ },
153
+ // 业务id
154
+ id: {
155
+ handler(val, preVal) {
156
+ this.idData = val;
157
+ },
158
+ immediate: true,
159
+ },
160
+ // 业务查询
161
+ processName: {
162
+ handler(val, preVal) {
163
+ this.processNameData = val;
164
+ },
165
+ immediate: true,
166
+ },
167
+ // 标题
168
+ title: {
169
+ handler(val, preVal) {
170
+ this.titleData = val;
171
+ },
172
+ immediate: true,
173
+ },
174
+ //
175
+ todoParameter: {
176
+ handler(val, preVal) {
177
+ this.todoParameterData = val;
178
+ },
179
+ immediate: true,
180
+ deep: true,
181
+ },
182
+ // 自定义流程选择
183
+ selfList: {
184
+ handler(val, preVal) {
185
+ if (val && val.length) {
186
+ this.option = val;
187
+ this.checkedItem = this.option[0];
188
+ this.selectDefaultValue = this.checkedItem.id;
189
+ this.$emit("change", this.checkedItem, this.option);
190
+ }
191
+ },
192
+ immediate: true,
193
+ deep: true,
194
+ },
195
+ resubmit: {
196
+ handler(val, preVal) {
197
+ if (val) {
198
+ this.getProcessInstance();
199
+ }
200
+ },
201
+ },
202
+ },
203
+
204
+ methods: {
205
+ async handleOption() {
206
+ // 流程列表 getProcessInstanceByBusinessKey
207
+ this.checkedItem = {};
208
+ this.firstPerson = [];
209
+ this.personList = [];
210
+
211
+ if (this.selfList && this.selfList.length) {
212
+ return;
213
+ }
214
+
215
+ this.handleTips("", true, "loading");
216
+ await this.request
217
+ .get("/aws/repository/getProcessDefList", {
218
+ params: {
219
+ appId: this.appId,
220
+ processGroupName: this.processNameData,
221
+ },
222
+ })
223
+ .then((res) => {
224
+ if (res.code == 200) {
225
+ this.option = res.data;
226
+ if (res.data && res.data.length) {
227
+ this.handleTips("", true, "success");
228
+ this.checkedItem = this.option[0];
229
+ this.selectDefaultValue = this.checkedItem.id;
230
+ this.$emit("change", this.checkedItem, this.option);
231
+ this.handlefirstNode(this.checkedItem.id);
232
+ this.getProcessInstance();
233
+ this.getDiagramUrl();
234
+ } else {
235
+ this.handleTips("暂无流程节点信息", true, "error");
236
+ this.option = [];
237
+ }
238
+ }
239
+ });
240
+ },
110
241
 
111
- // 流程列表
242
+ async getProcessInstance() {
243
+ if (this.id) {
112
244
  await this.request
113
- .get("/aws/repository/getProcessDefList", {
114
- params: {
115
- appId: this.appId,
116
- },
245
+ .get("/aws/pis/getProcessInstanceByBusinessKey", {
246
+ params: { businessKey: this.id },
117
247
  })
118
248
  .then((res) => {
119
- console.log("获取流程::", res);
120
249
  if (res.code == 200) {
121
- this.option = res.data;
122
- this.checkedItem = this.option[0];
123
- this.getAfferentParticipantNodeList();
124
- this.getDiagramUrl();
250
+ this.processId = res.data.id;
251
+ if (this.processId) {
252
+ this.option.map((v, i) => {
253
+ // console.log("sc:::", v , res.data);
254
+ if (v.id === res.data.processDefId) {
255
+ this.checkedItem = v;
256
+ this.selectDefaultValue = this.checkedItem.id;
257
+ this.$emit(
258
+ "change",
259
+ this.checkedItem,
260
+ this.option
261
+ );
262
+ this.handlefirstNode(
263
+ this.checkedItem.id
264
+ );
265
+ this.getDiagramUrl();
266
+ }
267
+ });
268
+ }
125
269
  }
126
270
  });
127
-
128
- // 第一个流程节点
271
+ }
272
+ },
273
+ async handlefirstNode(data) {
274
+ // 第一个流程节点
275
+ if (data) {
129
276
  await this.request
130
277
  .get("/aws/repository/getFirstProcessNode", {
131
278
  params: {
132
- processDefId: this.checkedItem.id,
279
+ processDefId: data,
133
280
  },
134
281
  })
135
282
  .then((res) => {
136
283
  // console.log("getFirstProcessNode", res);
137
284
  if (res.code === 200) {
138
285
  this.firstPerson = res.data;
286
+ this.getAfferentParticipantNodeList();
287
+ } else {
288
+ this.firstPerson = [];
289
+ this.getAfferentParticipantNodeList();
139
290
  }
291
+ })
292
+ .catch((error) => {
293
+ this.firstPerson = [];
294
+ this.getAfferentParticipantNodeList();
140
295
  });
141
- },
142
- immediate: true,
296
+ }
143
297
  },
144
- },
145
-
146
- methods: {
147
- handleChange(item) {
148
- console.log("当前选择::::", item);
298
+ async handleChange(item, items) {
299
+ this.handleTips("", true, "loading");
300
+ console.log("当前选择::::", item, items);
149
301
  this.checkedItem = item;
150
- this.getAfferentParticipantNodeList();
302
+ this.handlefirstNode(this.checkedItem.id);
151
303
  this.getDiagramUrl();
304
+ this.$emit("change", item, items);
305
+ this.$refs.topTips.handleClose();
152
306
  },
153
307
  // 获取当前流程下所有节点
154
- getAfferentParticipantNodeList() {
155
- this.request
308
+ async getAfferentParticipantNodeList() {
309
+ await this.request
156
310
  .get("/aws/repository/getAfferentParticipantNodeList", {
157
311
  params: {
158
312
  processDefId: this.checkedItem.id,
@@ -160,8 +314,22 @@ export default defineComponent({
160
314
  })
161
315
  .then((res) => {
162
316
  if (res.code == 200) {
163
- this.personList = res.data.slice(1);
317
+ if (this.firstPerson && this.firstPerson.length) {
318
+ console.log(
319
+ "选中节点L::",
320
+ this.personList,
321
+ this.firstPerson
322
+ );
323
+ this.personList = res.data.filter(
324
+ (item) =>
325
+ !this.firstPerson.some(
326
+ (item2) => item2.id == item.id
327
+ )
328
+ );
329
+ }
330
+ this.$emit("change", this.checkedItem, this.option);
164
331
  }
332
+ this.$refs.topTips.handleClose();
165
333
  });
166
334
  },
167
335
  // 获取流程图
@@ -182,44 +350,203 @@ export default defineComponent({
182
350
  },
183
351
  // 呼出选人
184
352
  handleOpenPerson(item) {
185
- console.log("选人弹窗", item);
353
+ // console.log("选人弹窗", item);
186
354
  this.visiblePerson = true;
187
355
  this.personObjId = item.id;
356
+ this.humanPerformerName = item.humanPerformerName;
357
+ if (item.humanPerformerName === "任意指定") {
358
+ this.entity = {
359
+ source: "1",
360
+ type: "0",
361
+ request: this.request,
362
+ codeType: [3],
363
+ multiple:
364
+ item.type == "InclusiveGatewayModel" ||
365
+ item.loopCardinality > 1,
366
+ maxMultiple: item.loopCardinality
367
+ ? item.loopCardinality
368
+ : item.loopCardinality,
369
+ checkedArray: [],
370
+ };
371
+ console.log(this.multiNodeParticipant[item.id]);
372
+ if (
373
+ !(
374
+ this.multiNodeParticipant[item.id] &&
375
+ this.multiNodeParticipant[item.id].length
376
+ )
377
+ ) {
378
+ this.entity.checkedArray = [];
379
+ } else {
380
+ this.entity.checkedArray = this.personListCopy[item.id].map(
381
+ (e) => ({
382
+ uid: e.uid,
383
+ type: e.type,
384
+ deptId: this.handleLastStr(
385
+ e.ancestors,
386
+ e.subjectId
387
+ ),
388
+ })
389
+ );
390
+ }
391
+ } else if (item.humanPerformerName === "固定部门") {
392
+ let deptCode;
393
+ item.routeTxt.departmentIds.map((v, i) => {
394
+ deptCode = v.rangeId;
395
+ });
396
+
397
+ this.entity = {
398
+ source: "1",
399
+ type: "0",
400
+ request: this.request,
401
+ codeType: [3],
402
+ deptCode: deptCode,
403
+ multiple:
404
+ item.type == "InclusiveGatewayModel" ||
405
+ item.loopCardinality > 1,
406
+ maxMultiple: item.loopCardinality
407
+ ? item.loopCardinality
408
+ : item.loopCardinality,
409
+ };
410
+
411
+ if (
412
+ !(
413
+ this.multiNodeParticipant[item.id] &&
414
+ this.multiNodeParticipant[item.id].length
415
+ )
416
+ ) {
417
+ this.entity.checkedArray = [];
418
+ } else {
419
+ this.entity.checkedArray = this.personListCopy[item.id].map(
420
+ (e) => ({
421
+ uid: e.uid,
422
+ type: e.type,
423
+ deptId: deptCode,
424
+ })
425
+ );
426
+ }
427
+ } else if (item.humanPerformerName === "固定单位") {
428
+ let subjectName;
429
+
430
+ item.routeTxt.companyIds.map((v, i) => {
431
+ subjectName = v.name;
432
+ });
433
+
434
+ this.entity = {
435
+ source: "1",
436
+ type: "0",
437
+ request: this.request,
438
+ codeType: [3],
439
+ multiple:
440
+ item.type == "InclusiveGatewayModel" ||
441
+ item.loopCardinality > 1,
442
+ maxMultiple: item.loopCardinality
443
+ ? item.loopCardinality
444
+ : item.loopCardinality,
445
+ subjectName: subjectName,
446
+ };
447
+
448
+ if (
449
+ !(
450
+ this.multiNodeParticipant[item.id] &&
451
+ this.multiNodeParticipant[item.id].length
452
+ )
453
+ ) {
454
+ this.entity.checkedArray = [];
455
+ } else {
456
+ this.entity.checkedArray = this.personListCopy[item.id].map(
457
+ (e) => ({
458
+ uid: e.uid,
459
+ type: e.type,
460
+ deptId: this.handleLastStr(
461
+ e.ancestors,
462
+ e.subjectId
463
+ ),
464
+ subjectName: e.ancestorNames.slice(
465
+ 0,
466
+ e.ancestorNames.indexOf("/")
467
+ ),
468
+ })
469
+ );
470
+ }
471
+ }
188
472
  },
189
473
  handleCallback(res) {
474
+ console.log("参数::::", res);
475
+ this.personListCopy[this.personObjId] = res;
476
+ this.entity.checkedArray = res.map((e) => ({
477
+ uid: e.uid,
478
+ type: e.type,
479
+ deptId: this.handleLastStr(e.ancestors, e.subjectId),
480
+ subjectName:
481
+ this.humanPerformerName === "固定单位"
482
+ ? e.ancestorNames.slice(0, e.ancestorNames.indexOf("/"))
483
+ : "",
484
+ }));
485
+
190
486
  this.multiNodeParticipant[this.personObjId] = [];
191
487
  this.partNode[this.personObjId] = [];
192
488
  res.map((v, i) => {
193
489
  this.multiNodeParticipant[this.personObjId].push(v.uid);
194
490
  this.partNode[this.personObjId].push(v.name);
195
491
  });
196
- console.log("callback_OK", res, this.multiNodeParticipant);
492
+ this.visiblePerson = false;
493
+ // console.log("callback_OK", res, this.multiNodeParticipant);
197
494
  },
198
495
  handleCancel() {
199
- console.log("cancel_No");
496
+ // console.log("cancel_No");
497
+ },
498
+ handleLastStr(str, subjectId) {
499
+ return str.split(",")[str.split(",").length - 1] !== subjectId
500
+ ? str.split(",")[str.split(",").length - 1]
501
+ : "";
200
502
  },
201
503
  async handleSumbit() {
504
+ if (this.btnLoading) {
505
+ return;
506
+ }
507
+
508
+ this.btnLoading = true;
202
509
  // 验证
203
- if (this.firstPerson && this.firstPerson.length) {
204
- if (!this.multiNodeParticipant[this.firstPerson[0].id]) {
205
- this.handleTips(
206
- `${this.firstPerson[0].name}节点未选择审批人`,
207
- true,
208
- "error"
209
- );
210
- return;
211
- }
510
+ if (
511
+ this.firstPerson &&
512
+ this.firstPerson.length &&
513
+ !this.firstPerson[0].routeTxt.userNames &&
514
+ this.firstPerson[0].humanPerformerName !== "固定账户" &&
515
+ this.firstPerson[0].humanPerformerName !== "与流程申请人相关" &&
516
+ (!this.multiNodeParticipant[this.firstPerson[0].id] ||
517
+ !this.multiNodeParticipant[this.firstPerson[0].id].length)
518
+ ) {
519
+ this.handleTips(
520
+ `${this.firstPerson[0].name}节点未选择审批人`,
521
+ true,
522
+ "error"
523
+ );
524
+ this.btnLoading = false;
525
+ return;
212
526
  }
213
527
 
528
+ // 送审前执行事件
529
+ if (this.beforeFunction) {
530
+ await this.beforeFunction();
531
+ if (this.manual) {
532
+ this.btnLoading = false;
533
+ }
534
+ }
535
+ if (!this.manual) {
536
+ this.$nextTick(async () => {
537
+ await this.handleSongshen();
538
+ });
539
+ }
540
+ },
541
+ handleSongshen() {
214
542
  // 送审
215
- this.handleTips("", true, "loading");
543
+ this.btnLoading = true;
216
544
  if (this.resubmit) {
217
- console.log("送审重新提交", this.multiNodeParticipant);
218
- await this.request
545
+ // console.log("送审重新提交", this.multiNodeParticipant);
546
+ this.handleTips("", true, "loading");
547
+ this.request
219
548
  .post("/aws/pis/reactivate", {
220
- processInstId:
221
- this.processId ||
222
- "572405e4-e0dc-40fc-9a95-2b20f5bdfbf1",
549
+ processInstId: this.processId,
223
550
  isClearHistory: this.isClearHistory,
224
551
  reactivateReason: "重新提交",
225
552
  multiNodeParticipant: this.multiNodeParticipant,
@@ -227,36 +554,48 @@ export default defineComponent({
227
554
  .then((res) => {
228
555
  if (res.code == 200) {
229
556
  this.show = false;
557
+ this.$emit("update:visible", this.show);
230
558
  this.handleTips("提交成功!", false, "success");
559
+ this.$emit("successFn");
560
+ this.btnLoading = false;
231
561
  } else {
232
562
  this.handleTips(res.msg, true, "error");
563
+ this.btnLoading = false;
233
564
  }
234
565
  })
235
566
  .catch((error) => {
236
567
  this.handleTips(error.msg, true, "error");
568
+ this.btnLoading = false;
237
569
  });
238
570
  } else {
239
- console.log("送审首次提交", this.multiNodeParticipant);
240
- await this.request
241
- .post("/aws/pis/createAndStart", {
242
- title: this.title,
243
- processDefId: this.checkedItem.id,
244
- processBusinessKey: this.id,
245
- showType: "app",
246
- businessType: this.businessType,
247
- multiNodeParticipant: this.multiNodeParticipant,
248
- todoParameter: this.todoParameter,
249
- })
571
+ this.handleTips("", true, "loading");
572
+ let params = {
573
+ title: this.titleData,
574
+ processDefId: this.checkedItem.id,
575
+ processBusinessKey: this.idData,
576
+ showType: this.showType,
577
+ businessType: this.businessTypeData,
578
+ multiNodeParticipant: this.multiNodeParticipant,
579
+ todoParameter: this.todoParameterData,
580
+ };
581
+ if (!this.checkedItem.id) {
582
+ this.$refs.topTips.handleClose();
583
+ this.btnLoading = false;
584
+ return;
585
+ }
586
+ this.request
587
+ .post("/aws/pis/createAndStart", params)
250
588
  .then((res) => {
251
589
  if (res.code === 200) {
252
590
  this.show = false;
591
+ this.$emit("update:visible", this.show);
253
592
  this.handleTips("提交成功!", false, "success");
593
+ this.$emit("successFn");
594
+ this.btnLoading = false;
254
595
  } else if (res.code == 499) {
255
596
  this.request
256
597
  .post("/aws/pis/reactivate", {
257
- processInstId:
258
- this.processId ||
259
- "572405e4-e0dc-40fc-9a95-2b20f5bdfbf1",
598
+ processInstId: this.processId,
260
599
  isClearHistory: this.isClearHistory,
261
600
  reactivateReason: "重新提交",
262
601
  multiNodeParticipant: this
@@ -265,24 +604,31 @@ export default defineComponent({
265
604
  .then((res) => {
266
605
  if (res.code == 200) {
267
606
  this.show = false;
607
+ this.$emit("update:visible", this.show);
268
608
  this.handleTips(
269
609
  "提交成功!",
270
610
  false,
271
611
  "success"
272
612
  );
613
+ this.$emit("successFn");
614
+ this.btnLoading = false;
273
615
  } else {
274
616
  this.handleTips(res.msg, true, "error");
617
+ this.btnLoading = false;
275
618
  }
276
619
  })
277
620
  .catch((error) => {
278
621
  this.handleTips(error.msg, true, "error");
622
+ this.btnLoading = false;
279
623
  });
280
624
  } else {
281
625
  this.handleTips(res.msg, true, "error");
626
+ this.btnLoading = false;
282
627
  }
283
628
  })
284
629
  .catch((error) => {
285
630
  this.handleTips(error.msg, true, "error");
631
+ this.btnLoading = false;
286
632
  });
287
633
  }
288
634
  },
@@ -290,7 +636,9 @@ export default defineComponent({
290
636
  this.textTips = text;
291
637
  this.statusTips = status;
292
638
  this.typeTips = type;
293
- this.$refs.topTips.handleOpen();
639
+ if (this.$refs.topTips) {
640
+ this.$refs.topTips.handleOpen();
641
+ }
294
642
  },
295
643
  },
296
644
  });