super-pages 0.0.1-up → 0.0.2-up

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 (54) hide show
  1. package/README.md +7 -7
  2. package/index.html +13 -13
  3. package/lib/super-pages.css +1 -1
  4. package/lib/super-pages.js +2383 -2297
  5. package/lib/super-pages.umd.cjs +18 -18
  6. package/package.json +28 -25
  7. package/packages/index.js +30 -30
  8. package/packages/super-page/index.js +9 -9
  9. package/packages/super-page/src/button-group.vue +294 -294
  10. package/packages/super-page/src/chart-page.vue +215 -215
  11. package/packages/super-page/src/chart-query-page.vue +163 -163
  12. package/packages/super-page/src/common-form-page.vue +594 -594
  13. package/packages/super-page/src/export-form-report-dialog.vue +145 -145
  14. package/packages/super-page/src/form-head.vue +74 -74
  15. package/packages/super-page/src/form-page.vue +107 -107
  16. package/packages/super-page/src/group-tag.vue +21 -21
  17. package/packages/super-page/src/list-page.vue +1454 -1454
  18. package/packages/super-page/src/list-toolbar-dynamic-source.vue +89 -89
  19. package/packages/super-page/src/list-toolbar-page.vue +377 -377
  20. package/packages/super-page/src/my-button-base.vue +438 -438
  21. package/packages/super-page/src/my-button.vue +196 -196
  22. package/packages/super-page/src/page-custom-component.vue +56 -56
  23. package/packages/super-page/src/remove-signer-dialog.vue +103 -103
  24. package/packages/super-page/src/sub-tab-page.vue +79 -79
  25. package/packages/super-page/src/super-page-component.vue +86 -86
  26. package/packages/super-page/src/super-page.vue +162 -162
  27. package/packages/super-page/src/tab-page.vue +154 -154
  28. package/packages/super-page/src/task-informition-dialog.vue +82 -82
  29. package/packages/super-page/src/util/ListButtonEvent.js +896 -896
  30. package/packages/super-page/src/util/api.js +37 -37
  31. package/packages/super-page/src/util/callEvents.js +62 -62
  32. package/packages/super-page/src/util/chartButtonEvent.js +60 -60
  33. package/packages/super-page/src/util/common-util.js +102 -102
  34. package/packages/super-page/src/util/commonButtonEvent.js +70 -70
  35. package/packages/super-page/src/util/eventBus.js +2 -2
  36. package/packages/super-page/src/util/formButtonEvent.js +509 -509
  37. package/packages/super-page/src/util/store.js +3 -3
  38. package/packages/super-page/src/util/super-page.js +29 -29
  39. package/packages/super-page/src/util/util.js +1491 -1489
  40. package/packages/super-page/src/util/workflowButtonEvent.js +1729 -1729
  41. package/packages/super-page/src/widget-col-page.vue +339 -339
  42. package/packages/super-page/src/widget-page.vue +703 -703
  43. package/packages/super-page/src/widget-sub-tab-pane-page.vue +115 -115
  44. package/packages/super-page/src/widget-tab-pane-page.vue +135 -135
  45. package/packages/super-page/src/workflow-button-group.vue +561 -561
  46. package/packages/super-page/src/workflow-form-page.vue +1310 -1310
  47. package/packages/super-page-dialog/index.js +9 -9
  48. package/packages/super-page-dialog/src/super-page-dialog.vue +200 -200
  49. package/packages/utils/gogocodeTransfer.js +59 -59
  50. package/src/i18n/i18n.js +16 -19
  51. package/src/i18n/langs/cn.js +65 -65
  52. package/src/i18n/langs/en.js +68 -68
  53. package/src/utils/common-util.js +9 -9
  54. package/vite.config.js +36 -36
@@ -1,1729 +1,1729 @@
1
- import { setStoreInfo, packageTemplateFiles } from './common-util'
2
- import { updateWithPageValue } from 'imatrix-ui/src/utils/jump-page-utils'
3
- const buttonEvents = {
4
- // 流程表单页面点击扩展按钮
5
- clickWorkflowExtensionButton(
6
- system,
7
- tableName,
8
- model,
9
- definitionId,
10
- emailTemplateCode,
11
- formViewCode,
12
- formViewVersion,
13
- myJsContent,
14
- formNoRuleCode,
15
- successOperation,
16
- dataConversionRule,
17
- autoSetValueData,
18
- button,
19
- needDeleteFileUuid,
20
- entityName,
21
- beanName
22
- ) {
23
- const param = {
24
- entity: model,
25
- system: system,
26
- formViewCode: formViewCode,
27
- formViewVersion: formViewVersion,
28
- tableName: tableName,
29
- emailTemplateCode: emailTemplateCode,
30
- definitionId: definitionId,
31
- completeTaskParam: {
32
- taskId: this.completeTaskParam.taskId,
33
- opinion: this.completeTaskParam.opinion,
34
- },
35
- formNoRuleCode,
36
- entityName,
37
- beanName,
38
- isWorkflowEntity: true,
39
- }
40
- if (this.judgeHeavyList) {
41
- // 判重组合字段配置
42
- param.judgeHeavyList = JSON.stringify(this.judgeHeavyList)
43
- }
44
- if (dataConversionRule) {
45
- param.dataConversionRule = dataConversionRule.join(',')
46
- }
47
- if (autoSetValueData) {
48
- param.autoSetValueData = JSON.stringify(autoSetValueData)
49
- }
50
- if (button && button.taskMap) {
51
- param.taskMap = button.taskMap
52
- }
53
- if (needDeleteFileUuid) {
54
- param.needDeleteFileUuid = needDeleteFileUuid
55
- }
56
- if (button.jumpPage) {
57
- let dataId
58
- if (model) {
59
- dataId = model.id || model.ID
60
- }
61
- this.jumpToPage(
62
- button.jumpPage,
63
- system,
64
- dataId,
65
- model,
66
- this.additionalParamMap,
67
- null,
68
- button.code,
69
- this.pageCode
70
- )
71
- return
72
- }
73
- if (myJsContent && myJsContent !== null && myJsContent !== '') {
74
- // 将js文本转换为函数,并运行
75
- // eslint-disable-next-line no-eval
76
- const buttonFun = eval('(' + myJsContent + ')')
77
- // false表示控制version,true表示不控制version
78
- if (
79
- button &&
80
- button.successOperation &&
81
- button.successOperation === 'noOperation'
82
- ) {
83
- // 如果是按钮操作后是“无操作”,则不控制version的值,否则会报“记录被其它事务修改”的异常
84
- param.unControlVersion = true
85
- }
86
- // 运行方法
87
- const request = buttonFun(this, param)
88
- if (request) {
89
- request.then((commonEntity) => {
90
- // 处理任务办理参数
91
- let result = true
92
- if (commonEntity) {
93
- result = this.dealCompleteTaskParam(
94
- commonEntity,
95
- false,
96
- successOperation,
97
- button.code,
98
- null,
99
- null,
100
- button.isNeedValueMapping
101
- )
102
- }
103
- if (result === true) {
104
- // 提示操作成功
105
- this.$message({
106
- showClose: true,
107
- type: 'success',
108
- message: this.$t('superPageMessage.successfulOperation'),
109
- })
110
- }
111
- })
112
- }
113
- } else {
114
- // 自定义按钮需要回填值时,默认的成功后操作是关闭弹框
115
- let successOperation
116
- if (button.successOperation) {
117
- successOperation = button.successOperation
118
- }
119
- if (!successOperation) {
120
- // 默认是关闭弹框
121
- successOperation = 'closeWindow'
122
- }
123
- this.afterSuccessOperateInForm(successOperation, model, true, true)
124
- }
125
- },
126
- // 按钮组中各按钮的操作
127
- clickWorflowButton(
128
- buttonType,
129
- system,
130
- tableName,
131
- model,
132
- definitionId,
133
- emailTemplateCode,
134
- operationResult,
135
- formViewCode,
136
- formViewVersion,
137
- myEntityName,
138
- myJsContent,
139
- formNoRuleCode,
140
- successOperation,
141
- dataConversionRule,
142
- processEndlogicSetting,
143
- autoSetValueData,
144
- logSettingText,
145
- ids,
146
- isBatchProcessing,
147
- isNeedValueMapping,
148
- taskMap,
149
- needDeleteFileUuid,
150
- beanName,
151
- button
152
- ) {
153
- if (buttonType === 'startInstance' || buttonType === 'update') {
154
- // 表单页面保存按钮操作
155
- this.startInstance(
156
- system,
157
- tableName,
158
- model,
159
- definitionId,
160
- emailTemplateCode,
161
- formViewCode,
162
- formViewVersion,
163
- myEntityName,
164
- myJsContent,
165
- formNoRuleCode,
166
- successOperation,
167
- dataConversionRule,
168
- autoSetValueData,
169
- logSettingText,
170
- buttonType,
171
- isNeedValueMapping,
172
- taskMap,
173
- needDeleteFileUuid,
174
- beanName
175
- )
176
- } else if (buttonType === 'submitProcess') {
177
- // 提交流程
178
- this.submitProcess(
179
- system,
180
- tableName,
181
- model,
182
- definitionId,
183
- emailTemplateCode,
184
- formViewCode,
185
- formViewVersion,
186
- myEntityName,
187
- myJsContent,
188
- formNoRuleCode,
189
- successOperation,
190
- dataConversionRule,
191
- processEndlogicSetting,
192
- autoSetValueData,
193
- logSettingText,
194
- buttonType,
195
- isNeedValueMapping,
196
- taskMap,
197
- needDeleteFileUuid,
198
- beanName
199
- )
200
- } else if (buttonType === 'completeTask') {
201
- // 办理任务
202
- this.complateTask(
203
- system,
204
- tableName,
205
- model,
206
- operationResult,
207
- formViewCode,
208
- formViewVersion,
209
- myEntityName,
210
- myJsContent,
211
- successOperation,
212
- dataConversionRule,
213
- processEndlogicSetting,
214
- autoSetValueData,
215
- logSettingText,
216
- buttonType,
217
- isNeedValueMapping,
218
- taskMap,
219
- needDeleteFileUuid,
220
- beanName
221
- )
222
- } else if (buttonType === 'drawTask') {
223
- // 领取
224
- this.drawTask(
225
- system,
226
- tableName,
227
- model,
228
- formViewCode,
229
- formViewVersion,
230
- myEntityName,
231
- myJsContent,
232
- successOperation,
233
- logSettingText,
234
- buttonType,
235
- isNeedValueMapping,
236
- taskMap,
237
- beanName
238
- )
239
- } else if (buttonType === 'abandonDraw') {
240
- // 放弃领取
241
- this.abandonReceive(
242
- system,
243
- tableName,
244
- model,
245
- formViewCode,
246
- formViewVersion,
247
- myEntityName,
248
- myJsContent,
249
- successOperation,
250
- logSettingText,
251
- buttonType,
252
- isNeedValueMapping,
253
- taskMap,
254
- beanName
255
- )
256
- } else if (buttonType === 'retrieveTask') {
257
- // 取回
258
- this.retrieve(
259
- system,
260
- tableName,
261
- model,
262
- formViewCode,
263
- formViewVersion,
264
- myEntityName,
265
- myJsContent,
266
- successOperation,
267
- logSettingText,
268
- buttonType,
269
- isNeedValueMapping,
270
- taskMap,
271
- beanName
272
- )
273
- } else if (buttonType === 'assignTask') {
274
- // 指派
275
- this.assignTask()
276
- } else if (buttonType.indexOf('#_default_#') === 0) {
277
- if (
278
- buttonType === '#_default_#submit' ||
279
- buttonType === '#_default_#agree' ||
280
- buttonType === '#_default_#disagree'
281
- ) {
282
- // 表示是默认的按钮:“提交”、“同意”、“不同意”
283
- let url
284
- if (buttonType === '#_default_#submit') {
285
- url = '/dsc/workflow-commons/common-submits'
286
- } else if (buttonType === '#_default_#agree') {
287
- url = '/dsc/workflow-commons/common-approves'
288
- } else if (buttonType === '#_default_#disagree') {
289
- url = '/dsc/workflow-commons/common-refuses'
290
- }
291
- const buttonCode = buttonType.substring(buttonType.lastIndexOf('#') + 1)
292
- this.submitForm(
293
- system,
294
- tableName,
295
- model,
296
- formViewCode,
297
- formViewVersion,
298
- myEntityName,
299
- myJsContent,
300
- formNoRuleCode,
301
- successOperation,
302
- dataConversionRule,
303
- autoSetValueData,
304
- url,
305
- logSettingText,
306
- buttonCode,
307
- ids,
308
- isBatchProcessing,
309
- isNeedValueMapping,
310
- taskMap,
311
- needDeleteFileUuid,
312
- beanName,
313
- button ? button.functionCode : ''
314
- )
315
- }
316
- } else if (buttonType === 'addSigner') {
317
- // 加签
318
- this.addSigner()
319
- } else if (buttonType === 'createCopyTask') {
320
- // 抄送
321
- this.createCopyTask()
322
- } else if (buttonType === 'removeSigner') {
323
- // 减签
324
- this.removeSigner(system, myEntityName, model, logSettingText, beanName)
325
- }
326
- },
327
- // 发起流程。保存按钮的操作
328
- startInstance(
329
- system,
330
- tableName,
331
- model,
332
- definitionId,
333
- emailTemplateCode,
334
- formViewCode,
335
- formViewVersion,
336
- myEntityName,
337
- myJsContent,
338
- formNoRuleCode,
339
- successOperation,
340
- dataConversionRule,
341
- autoSetValueData,
342
- logSettingText,
343
- buttonType,
344
- isNeedValueMapping,
345
- taskMap,
346
- needDeleteFileUuid,
347
- beanName
348
- ) {
349
- let path
350
- if (system.standard === false) {
351
- // 表示是自定义系统
352
- path = this.getBaseUrl(system) + '/dsc/workflow-commons'
353
- }
354
- path = this.getRealRestApiPath(path, system)
355
- if (!path) {
356
- this.$message({
357
- showClose: true,
358
- type: 'warning',
359
- message: this.$t('superPageMessage.requestPathEmpty'),
360
- })
361
- return
362
- }
363
- let param = {
364
- entity: model,
365
- formNoRuleCode,
366
- }
367
- if (system.standard === false) {
368
- // 自定义系统时,封装CommonEntity
369
- param = {
370
- entity: model,
371
- tableName: tableName,
372
- emailTemplateCode: emailTemplateCode,
373
- definitionId: definitionId,
374
- formViewCode: formViewCode,
375
- formViewVersion: formViewVersion,
376
- formNoRuleCode,
377
- functionCode: this.permissionPrefix + '.xxx',
378
- }
379
- }
380
- if (this.judgeHeavyList) {
381
- // 判重组合字段配置
382
- param.judgeHeavyList = JSON.stringify(this.judgeHeavyList)
383
- }
384
- if (dataConversionRule) {
385
- param.dataConversionRule = dataConversionRule.join(',')
386
- }
387
- if (autoSetValueData) {
388
- param.autoSetValueData = JSON.stringify(autoSetValueData)
389
- }
390
- if (myEntityName) {
391
- param.entityName = myEntityName
392
- }
393
- if (beanName) {
394
- param.beanName = beanName
395
- }
396
- if (logSettingText) {
397
- param.logSettingText = logSettingText
398
- }
399
- if (!param.systemCode) {
400
- param.systemCode = system.code
401
- }
402
- if (this.dataTypeMap) {
403
- param.dataTypeMap = this.dataTypeMap
404
- }
405
- if (taskMap) {
406
- param.taskMap = taskMap
407
- }
408
- if (needDeleteFileUuid) {
409
- param.needDeleteFileUuid = needDeleteFileUuid
410
- }
411
- if (this.additionalParamMap) {
412
- param.additionalParamMap = this.additionalParamMap
413
- }
414
- // false表示控制version,true表示不控制version
415
- if (successOperation && successOperation === 'noOperation') {
416
- // 如果是按钮操作后是“无操作”,则不控制version的值,否则会报“记录被其它事务修改”的异常
417
- param.unControlVersion = true
418
- }
419
- param.isWorkflowEntity = true
420
- let request
421
- if (myJsContent) {
422
- // 将js文本转换为函数,并运行
423
- // eslint-disable-next-line no-eval
424
- const buttonFun = eval('(' + myJsContent + ')')
425
- // 运行方法
426
- request = buttonFun(this, param)
427
- } else {
428
- if (model.id || model.ID) {
429
- // 表示是修改操作
430
- request = this.$http.put(path, param)
431
- } else {
432
- // 表示是新建操作
433
- request = this.$http.post(path, param)
434
- }
435
- }
436
- if (request) {
437
- request.then((commonEntity) => {
438
- // 处理任务办理参数
439
- let result = true
440
- if (commonEntity) {
441
- result = this.dealCompleteTaskParam(
442
- commonEntity,
443
- false,
444
- successOperation,
445
- buttonType,
446
- null,
447
- null,
448
- isNeedValueMapping
449
- )
450
- }
451
- if (result === true) {
452
- this.$message({
453
- showClose: true,
454
- type: 'success',
455
- message: this.$t('superPageMessage.successfulSave'),
456
- })
457
- }
458
- })
459
- }
460
- },
461
- // 第一环节提交流程
462
- submitProcess(
463
- system,
464
- tableName,
465
- model,
466
- definitionId,
467
- emailTemplateCode,
468
- formViewCode,
469
- formViewVersion,
470
- myEntityName,
471
- myJsContent,
472
- formNoRuleCode,
473
- successOperation,
474
- dataConversionRule,
475
- processEndlogicSetting,
476
- autoSetValueData,
477
- logSettingText,
478
- buttonType,
479
- isNeedValueMapping,
480
- taskMap,
481
- needDeleteFileUuid,
482
- beanName
483
- ) {
484
- let path
485
- if (system.standard === false) {
486
- // 表示是自定义系统
487
- path = this.getBaseUrl(system) + '/dsc/workflow-commons/submit'
488
- }
489
- path = this.getRealRestApiPath(path, system)
490
- if (!path) {
491
- this.$message({
492
- showClose: true,
493
- type: 'warning',
494
- message: this.$t('superPageMessage.requestPathEmpty'),
495
- })
496
- return
497
- }
498
- let param = {
499
- entity: model,
500
- formNoRuleCode,
501
- }
502
- if (system.standard === false) {
503
- // 自定义系统时,封装CommonEntity
504
- param = {
505
- entity: model,
506
- tableName: tableName,
507
- emailTemplateCode: emailTemplateCode,
508
- definitionId: definitionId,
509
- formViewCode: formViewCode,
510
- formViewVersion: formViewVersion,
511
- formNoRuleCode,
512
- functionCode: this.permissionPrefix + '.xxx',
513
- }
514
- }
515
- if (this.judgeHeavyList) {
516
- // 判重组合字段配置
517
- param.judgeHeavyList = JSON.stringify(this.judgeHeavyList)
518
- }
519
- if (dataConversionRule) {
520
- param.dataConversionRule = dataConversionRule.join(',')
521
- }
522
- if (autoSetValueData) {
523
- param.autoSetValueData = JSON.stringify(autoSetValueData)
524
- }
525
- if (myEntityName) {
526
- param.entityName = myEntityName
527
- }
528
- if (beanName) {
529
- param.beanName = beanName
530
- }
531
- if (processEndlogicSetting) {
532
- param.processEndLogicSetting = JSON.stringify(processEndlogicSetting)
533
- }
534
- if (logSettingText) {
535
- param.logSettingText = logSettingText
536
- }
537
- if (!param.systemCode) {
538
- param.systemCode = system.code
539
- }
540
- if (this.dataTypeMap) {
541
- param.dataTypeMap = this.dataTypeMap
542
- }
543
- if (taskMap) {
544
- param.taskMap = taskMap
545
- }
546
- if (needDeleteFileUuid) {
547
- param.needDeleteFileUuid = needDeleteFileUuid
548
- }
549
- if (this.additionalParamMap) {
550
- param.additionalParamMap = this.additionalParamMap
551
- }
552
- param.isWorkflowEntity = true
553
- let request
554
- if (myJsContent) {
555
- // 将js文本转换为函数,并运行
556
- // eslint-disable-next-line no-eval
557
- const buttonFun = eval('(' + myJsContent + ')')
558
- // 运行方法
559
- request = buttonFun(this, param)
560
- } else {
561
- request = this.$http.post(path, param)
562
- }
563
- if (request) {
564
- request.then((commonEntity) => {
565
- // 处理任务办理参数
566
- let result = true
567
- if (commonEntity) {
568
- result = this.dealCompleteTaskParam(
569
- commonEntity,
570
- false,
571
- successOperation,
572
- buttonType,
573
- null,
574
- null,
575
- isNeedValueMapping
576
- )
577
- }
578
- if (result === true) {
579
- this.$message({
580
- showClose: true,
581
- type: 'success',
582
- message: this.$t('superPageMessage.successfulSubmit'),
583
- })
584
- }
585
- })
586
- }
587
- },
588
- // 办理任务
589
- complateTask(
590
- system,
591
- tableName,
592
- model,
593
- operationResult,
594
- formViewCode,
595
- formViewVersion,
596
- myEntityName,
597
- myJsContent,
598
- successOperation,
599
- dataConversionRule,
600
- processEndlogicSetting,
601
- autoSetValueData,
602
- logSettingText,
603
- buttonType,
604
- isNeedValueMapping,
605
- taskMap,
606
- needDeleteFileUuid,
607
- beanName
608
- ) {
609
- let path
610
- if (system.standard === false) {
611
- // 表示是自定义系统
612
- path = this.getBaseUrl(system) + '/dsc/workflow-commons/complete-tasks'
613
- }
614
- path = this.getRealRestApiPath(path, system)
615
- if (!path) {
616
- this.$message({
617
- showClose: true,
618
- type: 'warning',
619
- message: this.$t('superPageMessage.requestPathEmpty'),
620
- })
621
- return
622
- }
623
- let param = {
624
- entity: model,
625
- completeTaskParam: {
626
- operationResult: operationResult,
627
- taskId: this.completeTaskParam.taskId,
628
- opinion: this.completeTaskParam.opinion,
629
- },
630
- }
631
- if (system.standard === false) {
632
- // 自定义系统时,封装CommonEntity
633
- param = {
634
- entity: model,
635
- tableName: tableName,
636
- completeTaskParam: {
637
- operationResult: operationResult,
638
- taskId: this.completeTaskParam.taskId,
639
- opinion: this.completeTaskParam.opinion,
640
- },
641
- formViewCode: formViewCode,
642
- formViewVersion: formViewVersion,
643
- functionCode: this.permissionPrefix + '.xxx',
644
- }
645
- }
646
- if (this.judgeHeavyList) {
647
- // 判重组合字段配置
648
- param.judgeHeavyList = JSON.stringify(this.judgeHeavyList)
649
- }
650
- if (dataConversionRule) {
651
- param.dataConversionRule = dataConversionRule.join(',')
652
- }
653
- if (autoSetValueData) {
654
- param.autoSetValueData = JSON.stringify(autoSetValueData)
655
- }
656
- if (myEntityName) {
657
- param.entityName = myEntityName
658
- }
659
- if (beanName) {
660
- param.beanName = beanName
661
- }
662
- if (processEndlogicSetting) {
663
- param.processEndLogicSetting = JSON.stringify(processEndlogicSetting)
664
- }
665
- if (logSettingText) {
666
- param.logSettingText = logSettingText
667
- }
668
- if (!param.systemCode) {
669
- param.systemCode = system.code
670
- }
671
- if (this.dataTypeMap) {
672
- param.dataTypeMap = this.dataTypeMap
673
- }
674
- if (needDeleteFileUuid) {
675
- param.needDeleteFileUuid = needDeleteFileUuid
676
- }
677
- if (this.additionalParamMap) {
678
- param.additionalParamMap = this.additionalParamMap
679
- }
680
- console.log('办理任务', taskMap)
681
- if (taskMap) {
682
- param.taskMap = taskMap
683
- }
684
- console.log('办理任务param', param)
685
- param.isWorkflowEntity = true
686
- let request
687
- if (myJsContent) {
688
- // 将js文本转换为函数,并运行
689
- // eslint-disable-next-line no-eval
690
- const buttonFun = eval('(' + myJsContent + ')')
691
- // 运行方法
692
- request = buttonFun(this, param)
693
- } else {
694
- request = this.$http.post(path, param)
695
- }
696
- if (request) {
697
- request.then((commonEntity) => {
698
- // 处理任务办理参数
699
- let result = true
700
- if (commonEntity) {
701
- result = this.dealCompleteTaskParam(
702
- commonEntity,
703
- false,
704
- successOperation,
705
- buttonType,
706
- this.completeTaskParam.taskId,
707
- operationResult,
708
- isNeedValueMapping
709
- )
710
- }
711
- if (result === true) {
712
- this.$message({
713
- showClose: true,
714
- type: 'success',
715
- message: this.$t('superPageMessage.successfulCompleteTask'),
716
- })
717
- }
718
- })
719
- }
720
- },
721
- // 处理任务办理参数
722
- dealCompleteTaskParam(
723
- formParam,
724
- isInit,
725
- successOperation,
726
- buttonCode,
727
- taskId,
728
- operationResult,
729
- isNeedValueMapping
730
- ) {
731
- if (formParam) {
732
- // 重新给表单赋值,可以连续保存
733
- if (formParam.entity) {
734
- this.formData = formParam.entity
735
- // 获得表单编码规则解析结果
736
- this.formNo = formParam.formNo
737
- setStoreInfo(this.pageCode, '_formData', this.formData)
738
- }
739
- const completeTaskResult = formParam.completeTaskResult
740
- if (completeTaskResult) {
741
- // 表示有返回结果
742
- const completeTaskTipType = completeTaskResult.completeTaskTipType
743
- if (completeTaskTipType && completeTaskTipType === 'MESSAGE') {
744
- // 表示有业务异常信息
745
- const message = completeTaskResult.content
746
- this.$message({
747
- showClose: true,
748
- type: 'warning',
749
- message: message,
750
- })
751
- return false
752
- }
753
- }
754
- if (formParam.completeTaskParam) {
755
- this.completeTaskParam = formParam.completeTaskParam
756
- setStoreInfo(
757
- this.pageCode,
758
- '_completeTaskParam',
759
- this.completeTaskParam
760
- )
761
- // 字段编辑权限传给表单组件
762
- this.formOptions['fieldPermissions'] =
763
- this.completeTaskParam.fieldPermissions
764
- // 子表操作列编辑权限传给表单组件
765
- this.formOptions['actionPermissions'] =
766
- this.completeTaskParam.actionPermissions
767
- // 流程按钮组组件需要的信息
768
- this.workflowButtonComponent = this.completeTaskParam.buttonComponent
769
- }
770
- setStoreInfo(this.pageCode, '_currentActivityName', formParam.taskName)
771
- }
772
- if (!isInit) {
773
- if (buttonCode) {
774
- // 调用afterClick回调事件
775
- this.callAfterClickButton(
776
- this.formEvents,
777
- this.formViewCode + '__' + buttonCode,
778
- {
779
- params: this.additionalParamMap,
780
- additionalParamMap: this.additionalParamMap,
781
- entity: this.formData,
782
- taskId,
783
- operationResult,
784
- }
785
- )
786
- }
787
- // 不是初始化表单时,才需要刷新表单内容
788
- this.afterSuccessOperateInForm(
789
- successOperation,
790
- this.formData,
791
- isNeedValueMapping,
792
- true
793
- )
794
- }
795
- // 刷新按钮
796
- this.reviewButton()
797
- return true
798
- },
799
- // 办理任务:领取任务、放弃领取任务等等
800
- transactTask(
801
- system,
802
- tableName,
803
- model,
804
- path,
805
- successMessageTip,
806
- nodeName,
807
- nodeId,
808
- formViewCode,
809
- formViewVersion,
810
- myEntityName,
811
- myJsContent,
812
- successOperation,
813
- formNoRuleCode,
814
- dataConversionRule,
815
- autoSetValueData,
816
- assigneeId,
817
- logSettingText,
818
- buttonType,
819
- ids,
820
- isBatchProcessing,
821
- isNeedValueMapping,
822
- taskMap,
823
- needDeleteFileUuid,
824
- beanName,
825
- functionCode
826
- ) {
827
- return new Promise((resolve, reject) => {
828
- path = this.getRealRestApiPath(path, system)
829
- if (!path) {
830
- this.$message({
831
- showClose: true,
832
- type: 'warning',
833
- message: this.$t('superPageMessage.requestPathEmpty'),
834
- })
835
- return
836
- }
837
- let param = {
838
- entity: model,
839
- formNoRuleCode,
840
- }
841
- if (system.standard === false) {
842
- // 自定义系统时,封装CommonEntity
843
- param = {
844
- entity: model,
845
- tableName: tableName,
846
- completeTaskParam: {
847
- taskId: this.completeTaskParam.taskId,
848
- opinion: this.completeTaskParam.opinion,
849
- },
850
- formViewCode: formViewCode,
851
- formViewVersion: formViewVersion,
852
- }
853
- }
854
- if (functionCode) {
855
- param.functionCode = functionCode
856
- } else {
857
- param.functionCode = this.permissionPrefix + '.xxx'
858
- }
859
- if (assigneeId) {
860
- param.assigneeId = assigneeId
861
- }
862
- if (this.judgeHeavyList) {
863
- // 判重组合字段配置
864
- param.judgeHeavyList = JSON.stringify(this.judgeHeavyList)
865
- }
866
- if (nodeName && nodeId) {
867
- param.returnToNodeName = nodeName
868
- param.returnToNodeId = nodeId
869
- }
870
- if (myEntityName) {
871
- param.entityName = myEntityName
872
- }
873
- if (beanName) {
874
- param.beanName = beanName
875
- }
876
- if (dataConversionRule) {
877
- param.dataConversionRule = dataConversionRule.join(',')
878
- }
879
- if (autoSetValueData) {
880
- param.autoSetValueData = JSON.stringify(autoSetValueData)
881
- }
882
- if (logSettingText) {
883
- param.logSettingText = logSettingText
884
- }
885
- if (!param.systemCode) {
886
- param.systemCode = system.code
887
- }
888
- if (this.dataTypeMap) {
889
- param.dataTypeMap = this.dataTypeMap
890
- }
891
- if (this.ids && this.ids.length > 0) {
892
- param.ids = this.ids
893
- }
894
- if (taskMap) {
895
- param.taskMap = taskMap
896
- }
897
- if (needDeleteFileUuid) {
898
- param.needDeleteFileUuid = needDeleteFileUuid
899
- }
900
- if (this.additionalParamMap) {
901
- param.additionalParamMap = this.additionalParamMap
902
- }
903
- param.isBatchProcessing = isBatchProcessing
904
- param.isWorkflowEntity = true
905
- console.log(JSON.stringify(param), 'completeTaskParam--------')
906
- let request
907
- if (myJsContent) {
908
- // 将js文本转换为函数,并运行
909
- // eslint-disable-next-line no-eval
910
- const buttonFun = eval('(' + myJsContent + ')')
911
- // 运行方法
912
- request = buttonFun(this, param)
913
- } else {
914
- request = this.$http.post(path, param)
915
- }
916
- if (request) {
917
- request.then((commonEntity) => {
918
- // 处理任务办理参数
919
- let result = true
920
- if (commonEntity) {
921
- result = this.dealCompleteTaskParam(
922
- commonEntity,
923
- false,
924
- successOperation,
925
- buttonType,
926
- this.completeTaskParam.taskId,
927
- null,
928
- isNeedValueMapping
929
- )
930
- }
931
- if (result === true) {
932
- this.$message({
933
- showClose: true,
934
- type: 'success',
935
- message: this.$t(successMessageTip),
936
- })
937
- }
938
- resolve(true)
939
- })
940
- }
941
- })
942
- },
943
- // 取回任务
944
- retrieve(
945
- system,
946
- tableName,
947
- model,
948
- formViewCode,
949
- formViewVersion,
950
- myEntityName,
951
- myJsContent,
952
- successOperation,
953
- logSettingText,
954
- buttonType,
955
- isNeedValueMapping,
956
- taskMap,
957
- beanName
958
- ) {
959
- let path
960
- if (system.standard === false) {
961
- // 表示是自定义系统
962
- path = this.getBaseUrl(system) + '/dsc/workflow-commons/retrieves'
963
- }
964
- this.transactTask(
965
- system,
966
- tableName,
967
- model,
968
- path,
969
- 'superPageMessage.successfulRetrieve',
970
- false,
971
- false,
972
- formViewCode,
973
- formViewVersion,
974
- myEntityName,
975
- myJsContent,
976
- successOperation,
977
- null,
978
- null,
979
- null,
980
- null,
981
- logSettingText,
982
- buttonType,
983
- null,
984
- null,
985
- isNeedValueMapping,
986
- taskMap,
987
- null,
988
- beanName
989
- )
990
- },
991
- // 领取任务
992
- drawTask(
993
- system,
994
- tableName,
995
- model,
996
- formViewCode,
997
- formViewVersion,
998
- myEntityName,
999
- myJsContent,
1000
- successOperation,
1001
- logSettingText,
1002
- buttonType,
1003
- isNeedValueMapping,
1004
- taskMap,
1005
- beanName
1006
- ) {
1007
- let path
1008
- if (system.standard === false) {
1009
- // 表示是自定义系统
1010
- path = this.getBaseUrl(system) + '/dsc/workflow-commons/draw-tasks'
1011
- }
1012
- this.transactTask(
1013
- system,
1014
- tableName,
1015
- model,
1016
- path,
1017
- 'superPageMessage.successfulDrawTask',
1018
- false,
1019
- false,
1020
- formViewCode,
1021
- formViewVersion,
1022
- myEntityName,
1023
- myJsContent,
1024
- successOperation,
1025
- null,
1026
- null,
1027
- null,
1028
- null,
1029
- logSettingText,
1030
- buttonType,
1031
- null,
1032
- null,
1033
- isNeedValueMapping,
1034
- taskMap,
1035
- null,
1036
- beanName
1037
- )
1038
- },
1039
- // 放弃领取任务
1040
- abandonReceive(
1041
- system,
1042
- tableName,
1043
- model,
1044
- formViewCode,
1045
- formViewVersion,
1046
- myEntityName,
1047
- myJsContent,
1048
- successOperation,
1049
- logSettingText,
1050
- buttonType,
1051
- isNeedValueMapping,
1052
- taskMap,
1053
- beanName
1054
- ) {
1055
- let path
1056
- if (system.standard === false) {
1057
- // 表示是自定义系统
1058
- path = this.getBaseUrl(system) + '/dsc/workflow-commons/abandon-receives'
1059
- }
1060
- this.transactTask(
1061
- system,
1062
- tableName,
1063
- model,
1064
- path,
1065
- 'superPageMessage.successfulAbandonReceive',
1066
- false,
1067
- false,
1068
- formViewCode,
1069
- formViewVersion,
1070
- myEntityName,
1071
- myJsContent,
1072
- successOperation,
1073
- null,
1074
- null,
1075
- null,
1076
- null,
1077
- logSettingText,
1078
- buttonType,
1079
- null,
1080
- null,
1081
- isNeedValueMapping,
1082
- taskMap,
1083
- null,
1084
- beanName
1085
- )
1086
- },
1087
- // 指派
1088
- assign(
1089
- system,
1090
- tableName,
1091
- model,
1092
- formViewCode,
1093
- formViewVersion,
1094
- myEntityName,
1095
- myJsContent,
1096
- successOperation,
1097
- selectNodeInfo,
1098
- isNeedValueMapping,
1099
- beanName
1100
- ) {
1101
- if (selectNodeInfo) {
1102
- let path
1103
- if (system.standard === false) {
1104
- // 表示是自定义系统
1105
- path = this.getBaseUrl(system) + '/dsc/workflow-commons/assigns'
1106
- }
1107
- const assigneeId = selectNodeInfo.id
1108
- ? selectNodeInfo.id
1109
- : selectNodeInfo.ID
1110
- ? selectNodeInfo.ID
1111
- : null
1112
- this.transactTask(
1113
- system,
1114
- tableName,
1115
- model,
1116
- path,
1117
- 'superPageMessage.successfulAssign',
1118
- false,
1119
- false,
1120
- formViewCode,
1121
- formViewVersion,
1122
- myEntityName,
1123
- myJsContent,
1124
- successOperation,
1125
- null,
1126
- null,
1127
- null,
1128
- assigneeId,
1129
- this.logSetting,
1130
- 'assignTask',
1131
- null,
1132
- null,
1133
- isNeedValueMapping,
1134
- null,
1135
- null,
1136
- beanName
1137
- ).then((result) => {
1138
- // 关闭指派用户人员树
1139
- this.selectAssignUser = false
1140
- })
1141
- } else {
1142
- // 关闭指派用户人员树
1143
- this.selectAssignUser = false
1144
- }
1145
- },
1146
- // 任务退回,退回到上一环节
1147
- returnToPreviousTask(
1148
- system,
1149
- tableName,
1150
- model,
1151
- formViewCode,
1152
- formViewVersion,
1153
- myEntityName,
1154
- myJsContent,
1155
- successOperation,
1156
- isNeedValueMapping,
1157
- taskMap,
1158
- beanName
1159
- ) {
1160
- let path
1161
- if (system.standard === false) {
1162
- // 表示是自定义系统
1163
- path =
1164
- this.getBaseUrl(system) +
1165
- '/dsc/workflow-commons/return-to-previous-tasks'
1166
- }
1167
- this.transactTask(
1168
- system,
1169
- tableName,
1170
- model,
1171
- path,
1172
- 'superPageMessage.successfulReturnToPreviousTask',
1173
- false,
1174
- false,
1175
- formViewCode,
1176
- formViewVersion,
1177
- myEntityName,
1178
- myJsContent,
1179
- successOperation,
1180
- null,
1181
- null,
1182
- null,
1183
- null,
1184
- this.logSetting,
1185
- 'returnToPreviousTask',
1186
- null,
1187
- null,
1188
- isNeedValueMapping,
1189
- taskMap,
1190
- null,
1191
- beanName
1192
- )
1193
- },
1194
- // 获得可退回的环节信息集合,只能退回到已办理过的环节
1195
- getTaskInformitions(system, entityName, beanName) {
1196
- let path
1197
- if (system.standard === false) {
1198
- // 表示是自定义系统
1199
- path =
1200
- this.getBaseUrl(system) +
1201
- '/dsc/workflow-commons/returnable-task/' +
1202
- this.completeTaskParam.taskId
1203
- }
1204
- path = this.getRealRestApiPath(path, system)
1205
- if (!path) {
1206
- this.$message({
1207
- showClose: true,
1208
- type: 'warning',
1209
- message: this.$t('superPageMessage.requestPathEmpty'),
1210
- })
1211
- return
1212
- }
1213
- this.showTaskInformitions = false
1214
- const requestParams = {
1215
- entityName,
1216
- beanName,
1217
- additionalParamMap: this.additionalParamMap,
1218
- tableName: this.tableName,
1219
- functionCode: this.permissionPrefix + '.xxx',
1220
- }
1221
- this.$http
1222
- .post(path, requestParams)
1223
- .then((taskInformitions) => {
1224
- // 可退回的环节名称集合
1225
- this.taskInformitions = taskInformitions
1226
- this.showTaskInformitions = true
1227
- })
1228
- .catch((e) => {
1229
- this.showTaskInformitions = false
1230
- })
1231
- },
1232
- // 退回到某环节,只能退回到已办理过的环节
1233
- returnTaskTo(
1234
- system,
1235
- tableName,
1236
- model,
1237
- selectTaskNode,
1238
- formViewCode,
1239
- formViewVersion,
1240
- myEntityName,
1241
- myJsContent,
1242
- successOperation,
1243
- isNeedValueMapping,
1244
- beanName
1245
- ) {
1246
- let path
1247
- if (system.standard === false) {
1248
- // 表示是自定义系统
1249
- path = this.getBaseUrl(system) + '/dsc/workflow-commons/returnTaskTo'
1250
- }
1251
- this.transactTask(
1252
- system,
1253
- tableName,
1254
- model,
1255
- path,
1256
- 'superPageMessage.successfulReturnTaskTo',
1257
- selectTaskNode.nodeName,
1258
- selectTaskNode.nodeId,
1259
- formViewCode,
1260
- formViewVersion,
1261
- myEntityName,
1262
- myJsContent,
1263
- successOperation,
1264
- null,
1265
- null,
1266
- null,
1267
- null,
1268
- this.logSetting,
1269
- 'returnTaskTo',
1270
- null,
1271
- null,
1272
- isNeedValueMapping,
1273
- null,
1274
- null,
1275
- beanName
1276
- )
1277
- },
1278
- // 强制结束流程
1279
- endInstance(
1280
- system,
1281
- tableName,
1282
- model,
1283
- formViewCode,
1284
- formViewVersion,
1285
- myEntityName,
1286
- myJsContent,
1287
- successOperation,
1288
- isNeedValueMapping,
1289
- taskMap,
1290
- beanName
1291
- ) {
1292
- let path
1293
- if (system.standard === false) {
1294
- // 表示是自定义系统
1295
- path = this.getBaseUrl(system) + '/dsc/workflow-commons/end-instance'
1296
- }
1297
- this.transactTask(
1298
- system,
1299
- tableName,
1300
- model,
1301
- path,
1302
- 'superPageMessage.successfulEndInstance',
1303
- false,
1304
- false,
1305
- formViewCode,
1306
- formViewVersion,
1307
- myEntityName,
1308
- myJsContent,
1309
- successOperation,
1310
- null,
1311
- null,
1312
- null,
1313
- null,
1314
- this.logSetting,
1315
- 'endInstance',
1316
- null,
1317
- null,
1318
- isNeedValueMapping,
1319
- taskMap,
1320
- null,
1321
- beanName
1322
- )
1323
- },
1324
- // 流程表单页面(非流程处理的)-提交/同意/不同意
1325
- submitForm(
1326
- system,
1327
- tableName,
1328
- model,
1329
- formViewCode,
1330
- formViewVersion,
1331
- myEntityName,
1332
- myJsContent,
1333
- formNoRuleCode,
1334
- successOperation,
1335
- dataConversionRule,
1336
- autoSetValueData,
1337
- url,
1338
- logSettingText,
1339
- buttonCode,
1340
- ids,
1341
- isBatchProcessing,
1342
- isNeedValueMapping,
1343
- taskMap,
1344
- needDeleteFileUuid,
1345
- beanName,
1346
- functionCode
1347
- ) {
1348
- let path
1349
- if (system.standard === false) {
1350
- // 表示是自定义系统
1351
- path = this.getBaseUrl(system) + url
1352
- }
1353
- this.transactTask(
1354
- system,
1355
- tableName,
1356
- model,
1357
- path,
1358
- 'superPageMessage.successfulOperation',
1359
- false,
1360
- false,
1361
- formViewCode,
1362
- formViewVersion,
1363
- myEntityName,
1364
- myJsContent,
1365
- successOperation,
1366
- formNoRuleCode,
1367
- dataConversionRule,
1368
- autoSetValueData,
1369
- null,
1370
- logSettingText,
1371
- buttonCode,
1372
- ids,
1373
- isBatchProcessing,
1374
- isNeedValueMapping,
1375
- taskMap,
1376
- needDeleteFileUuid,
1377
- beanName,
1378
- functionCode
1379
- )
1380
- },
1381
- // 点击加签后,弹出组织结构树
1382
- addSigner() {
1383
- this.isMulti = true
1384
- this.selectAddSignerUser = true
1385
- },
1386
- // 选择了加签用户后,执行加签接口
1387
- doAddSigner(
1388
- selectNodeInfo,
1389
- myJsContent,
1390
- system,
1391
- entityName,
1392
- beanName,
1393
- dataId,
1394
- model,
1395
- successOperation,
1396
- isNeedValueMapping
1397
- ) {
1398
- if (selectNodeInfo) {
1399
- let path
1400
- if (system.standard === false) {
1401
- // 表示是自定义系统
1402
- path = this.getBaseUrl(system) + '/dsc/workflow-commons/add-signers'
1403
- }
1404
- path = this.getRealRestApiPath(path, system)
1405
- if (!path) {
1406
- this.$message({
1407
- showClose: true,
1408
- type: 'warning',
1409
- message: this.$t('superPageMessage.requestPathEmpty'),
1410
- })
1411
- return
1412
- }
1413
- const requestParams = {
1414
- entityName,
1415
- beanName,
1416
- id: dataId,
1417
- entity: model,
1418
- additionalParamMap: this.additionalParamMap,
1419
- tableName: this.tableName,
1420
- functionCode: this.permissionPrefix + '.xxx',
1421
- isWorkflowEntity: true,
1422
- }
1423
- requestParams.completeTaskParam = {
1424
- taskId: this.completeTaskParam.taskId,
1425
- transactors: selectNodeInfo.loginNames.join(',').split(','),
1426
- systemCode: system.code,
1427
- }
1428
- let request
1429
- if (myJsContent) {
1430
- // 将js文本转换为函数,并运行
1431
- // eslint-disable-next-line no-eval
1432
- const buttonFun = eval('(' + myJsContent + ')')
1433
- // 运行方法
1434
- request = buttonFun(this, requestParams)
1435
- } else {
1436
- request = this.$http.post(path, requestParams)
1437
- }
1438
- if (request) {
1439
- request.then((formParam) => {
1440
- this.$message({
1441
- showClose: true,
1442
- type: 'success',
1443
- message: this.$t('superPageMessage.successfulOperation'),
1444
- })
1445
- // 重新给表单赋值,可以连续保存
1446
- if (formParam.entity) {
1447
- this.formData = formParam.entity
1448
- this.afterSuccessOperateInForm(
1449
- successOperation,
1450
- this.formData,
1451
- isNeedValueMapping,
1452
- true
1453
- )
1454
- }
1455
- // 执行afterClick回调方法
1456
- this.callAfterClickButton(
1457
- this.formEvents,
1458
- this.formViewCode + '__addSigner',
1459
- {
1460
- params: this.additionalParamMap,
1461
- additionalParamMap: this.additionalParamMap,
1462
- entity: this.formData,
1463
- }
1464
- )
1465
- this.selectAddSignerUser = false
1466
- })
1467
- }
1468
- } else {
1469
- this.selectAddSignerUser = false
1470
- }
1471
- },
1472
- // 点击生成抄送任务后,弹出组织结构树
1473
- createCopyTask() {
1474
- this.isMulti = true
1475
- this.selectCopyUser = true
1476
- },
1477
- // 选择了生成抄送任务的用户后,执行生成抄送任务接口
1478
- doCreateCopyTask(selectNodeInfo, myJsContent, system, entityName, beanName) {
1479
- if (selectNodeInfo) {
1480
- let path
1481
- if (system.standard === false) {
1482
- // 表示是自定义系统
1483
- path = this.getBaseUrl(system) + '/dsc/workflow-commons/copies'
1484
- }
1485
- path = this.getRealRestApiPath(path, system)
1486
- if (!path) {
1487
- this.$message({
1488
- showClose: true,
1489
- type: 'warning',
1490
- message: this.$t('superPageMessage.requestPathEmpty'),
1491
- })
1492
- return
1493
- }
1494
- const requestParams = {
1495
- entityName,
1496
- beanName,
1497
- additionalParamMap: this.additionalParamMap,
1498
- tableName: this.tableName,
1499
- functionCode: this.permissionPrefix + '.xxx',
1500
- isWorkflowEntity: true,
1501
- }
1502
- requestParams.completeTaskParam = {
1503
- taskId: this.completeTaskParam.taskId,
1504
- transactors: selectNodeInfo.userIds.join(',').split(','),
1505
- systemCode: system.code,
1506
- }
1507
- let request
1508
- if (myJsContent) {
1509
- // 将js文本转换为函数,并运行
1510
- // eslint-disable-next-line no-eval
1511
- const buttonFun = eval('(' + myJsContent + ')')
1512
- // 运行方法
1513
- request = buttonFun(this, requestParams)
1514
- } else {
1515
- request = this.$http.post(path, requestParams)
1516
- }
1517
- if (request) {
1518
- request.then(() => {
1519
- this.$message({
1520
- showClose: true,
1521
- type: 'success',
1522
- message: this.$t('superPageMessage.successfulOperation'),
1523
- })
1524
- // 执行afterClick回调方法
1525
- this.callAfterClickButton(
1526
- this.formEvents,
1527
- this.formViewCode + '__createCopyTask',
1528
- {
1529
- params: this.additionalParamMap,
1530
- additionalParamMap: this.additionalParamMap,
1531
- entity: this.formData,
1532
- }
1533
- )
1534
- this.selectCopyUser = false
1535
- })
1536
- }
1537
- } else {
1538
- this.selectCopyUser = false
1539
- }
1540
- },
1541
- // 点击减签按钮,显示减签文本框
1542
- removeSigner(system, entityName, entity, logSettingText, beanName) {
1543
- let path
1544
- const param = {}
1545
- if (system.standard === false) {
1546
- // 表示是自定义系统
1547
- path =
1548
- this.getBaseUrl(system) + '/dsc/workflow-commons/get-remove-signers'
1549
- if (logSettingText && logSettingText !== '') {
1550
- param.logSettingText = logSettingText
1551
- }
1552
- param.entityName = entityName
1553
- param.beanName = beanName
1554
- param.systemCode = system.code
1555
- param.entity = entity
1556
- param.additionalParamMap = this.additionalParamMap
1557
- param.tableName = this.tableName
1558
- param.functionCode = this.permissionPrefix + '.xxx'
1559
- } else if (entity.workflowInfo) {
1560
- param.entity = entity
1561
- }
1562
- param.isWorkflowEntity = true
1563
- path = this.getRealRestApiPath(path, system)
1564
- if (!path) {
1565
- this.$message({
1566
- showClose: true,
1567
- type: 'warning',
1568
- message: this.$t('superPageMessage.requestPathEmpty'),
1569
- })
1570
- return
1571
- }
1572
- this.$http.post(path, param).then((activeTasks) => {
1573
- this.activeTasks = activeTasks
1574
- this.showRemoveSigner = true
1575
- })
1576
- },
1577
- // 确定关闭选择减签任务弹框处理
1578
- doRemoveSigners(
1579
- selectRemoveTasks,
1580
- myJsContent,
1581
- system,
1582
- entityName,
1583
- beanName
1584
- ) {
1585
- if (selectRemoveTasks) {
1586
- let path
1587
- if (system.standard === false) {
1588
- // 表示是自定义系统
1589
- path = this.getBaseUrl(system) + '/dsc/workflow-commons/remove-signers'
1590
- }
1591
- path = this.getRealRestApiPath(path, system)
1592
- if (!path) {
1593
- this.$message({
1594
- showClose: true,
1595
- type: 'warning',
1596
- message: this.$t('superPageMessage.requestPathEmpty'),
1597
- })
1598
- return
1599
- }
1600
- const taskIds = selectRemoveTasks.map((task) =>
1601
- task.id ? task.id : task.ID ? task.ID : null
1602
- )
1603
- let request
1604
- if (myJsContent) {
1605
- // 将js文本转换为函数,并运行
1606
- const param = {
1607
- taskIds,
1608
- entityName,
1609
- beanName,
1610
- systemCode: system.code,
1611
- additionalParamMap: this.additionalParamMap,
1612
- tableName: this.tableName,
1613
- functionCode: this.permissionPrefix + '.xxx',
1614
- }
1615
- // eslint-disable-next-line no-eval
1616
- const buttonFun = eval('(' + myJsContent + ')')
1617
- // 运行方法
1618
- request = buttonFun(this, param)
1619
- } else {
1620
- const requestParams = {
1621
- entityName,
1622
- beanName,
1623
- ids: taskIds,
1624
- systemCode: system.code,
1625
- additionalParamMap: this.additionalParamMap,
1626
- tableName: this.tableName,
1627
- functionCode: this.permissionPrefix + '.xxx',
1628
- }
1629
- request = this.$http.post(path, requestParams)
1630
- }
1631
- if (request) {
1632
- request.then(() => {
1633
- this.$message({
1634
- showClose: true,
1635
- type: 'success',
1636
- message: this.$t('superPageMessage.successfulOperation'),
1637
- })
1638
- // 执行afterClick回调方法
1639
- this.callAfterClickButton(
1640
- this.formEvents,
1641
- this.formViewCode + '__removeSigner',
1642
- {
1643
- params: this.additionalParamMap,
1644
- additionalParamMap: this.additionalParamMap,
1645
- entity: this.formData,
1646
- }
1647
- )
1648
- this.showRemoveSigner = false
1649
- })
1650
- }
1651
- } else {
1652
- this.showRemoveSigner = false
1653
- }
1654
- },
1655
- // 显示指派用户人员树
1656
- assignTask() {
1657
- this.isMulti = false
1658
- this.selectAssignUser = true
1659
- },
1660
- updateValues(sourceModel, sourceTableName) {
1661
- // 更新数据
1662
- updateWithPageValue(
1663
- sourceModel,
1664
- sourceTableName,
1665
- this.jumpPageSetting,
1666
- this.formData,
1667
- this.tableName
1668
- )
1669
- let updateValueEventName =
1670
- this.jumpPageSetting && this.jumpPageSetting.updateValueEvent
1671
- ? this.jumpPageSetting.updateValueEvent
1672
- : null
1673
- if (
1674
- this.customEvents &&
1675
- updateValueEventName &&
1676
- updateValueEventName !== null &&
1677
- this.customEvents[updateValueEventName]
1678
- ) {
1679
- this.customEvents[updateValueEventName].call(this, {
1680
- sourceModel,
1681
- sourceTableName,
1682
- jumpPageSetting: this.jumpPageSetting,
1683
- entity: this.formData,
1684
- targetTableName: this.tableName,
1685
- })
1686
- }
1687
- // 更新表单编辑器的表单数据
1688
- this.updateFormData(this.formData)
1689
- },
1690
- // 下载模板
1691
- downloadTemplate(system, button, tableName) {
1692
- let templateUUID
1693
- let templateShowPath
1694
- if (button.templateFiles && button.templateFiles.length > 0) {
1695
- const templateFilesResult = packageTemplateFiles(button.templateFiles)
1696
- templateUUID = templateFilesResult[0].templateUUID
1697
- templateShowPath = templateFilesResult[0].templateShowPath
1698
- } else {
1699
- templateUUID = button.templateUUID
1700
- templateShowPath = button.templateShowPath
1701
- }
1702
- let param = '?1=1'
1703
- if (button && button.functionCode) {
1704
- param += '&functionCode=' + button.functionCode
1705
- }
1706
- if (tableName) {
1707
- param += '&tableName=' + tableName
1708
- }
1709
- // filePath格式如:用户定义的文件名~~服务器上磁盘中存储的文件路径及文件名。例如:user-info.xls~~iMatrix/b03dr45f5h4g.xls
1710
- // let fileShowName = ''
1711
- if (
1712
- templateUUID &&
1713
- templateShowPath &&
1714
- templateUUID !== 'undefined' &&
1715
- templateShowPath !== 'undefined' &&
1716
- templateUUID !== 'null' &&
1717
- templateShowPath !== 'null'
1718
- ) {
1719
- param +=
1720
- '&fileName=' +
1721
- encodeURI(templateUUID) +
1722
- '&showName=' +
1723
- encodeURI(templateShowPath)
1724
- }
1725
- const baseUrl = this.getBaseUrl(system)
1726
- window.open(baseUrl + '/dsc/commons/download-files' + param)
1727
- },
1728
- }
1729
- export default buttonEvents
1
+ import { setStoreInfo, packageTemplateFiles } from './common-util'
2
+ import { updateWithPageValue } from 'imatrix-ui/src/utils/jump-page-utils'
3
+ const buttonEvents = {
4
+ // 流程表单页面点击扩展按钮
5
+ clickWorkflowExtensionButton(
6
+ system,
7
+ tableName,
8
+ model,
9
+ definitionId,
10
+ emailTemplateCode,
11
+ formViewCode,
12
+ formViewVersion,
13
+ myJsContent,
14
+ formNoRuleCode,
15
+ successOperation,
16
+ dataConversionRule,
17
+ autoSetValueData,
18
+ button,
19
+ needDeleteFileUuid,
20
+ entityName,
21
+ beanName
22
+ ) {
23
+ const param = {
24
+ entity: model,
25
+ system: system,
26
+ formViewCode: formViewCode,
27
+ formViewVersion: formViewVersion,
28
+ tableName: tableName,
29
+ emailTemplateCode: emailTemplateCode,
30
+ definitionId: definitionId,
31
+ completeTaskParam: {
32
+ taskId: this.completeTaskParam.taskId,
33
+ opinion: this.completeTaskParam.opinion,
34
+ },
35
+ formNoRuleCode,
36
+ entityName,
37
+ beanName,
38
+ isWorkflowEntity: true,
39
+ }
40
+ if (this.judgeHeavyList) {
41
+ // 判重组合字段配置
42
+ param.judgeHeavyList = JSON.stringify(this.judgeHeavyList)
43
+ }
44
+ if (dataConversionRule) {
45
+ param.dataConversionRule = dataConversionRule.join(',')
46
+ }
47
+ if (autoSetValueData) {
48
+ param.autoSetValueData = JSON.stringify(autoSetValueData)
49
+ }
50
+ if (button && button.taskMap) {
51
+ param.taskMap = button.taskMap
52
+ }
53
+ if (needDeleteFileUuid) {
54
+ param.needDeleteFileUuid = needDeleteFileUuid
55
+ }
56
+ if (button.jumpPage) {
57
+ let dataId
58
+ if (model) {
59
+ dataId = model.id || model.ID
60
+ }
61
+ this.jumpToPage(
62
+ button.jumpPage,
63
+ system,
64
+ dataId,
65
+ model,
66
+ this.additionalParamMap,
67
+ null,
68
+ button.code,
69
+ this.pageCode
70
+ )
71
+ return
72
+ }
73
+ if (myJsContent && myJsContent !== null && myJsContent !== '') {
74
+ // 将js文本转换为函数,并运行
75
+ // eslint-disable-next-line no-eval
76
+ const buttonFun = eval('(' + myJsContent + ')')
77
+ // false表示控制version,true表示不控制version
78
+ if (
79
+ button &&
80
+ button.successOperation &&
81
+ button.successOperation === 'noOperation'
82
+ ) {
83
+ // 如果是按钮操作后是“无操作”,则不控制version的值,否则会报“记录被其它事务修改”的异常
84
+ param.unControlVersion = true
85
+ }
86
+ // 运行方法
87
+ const request = buttonFun(this, param)
88
+ if (request) {
89
+ request.then((commonEntity) => {
90
+ // 处理任务办理参数
91
+ let result = true
92
+ if (commonEntity) {
93
+ result = this.dealCompleteTaskParam(
94
+ commonEntity,
95
+ false,
96
+ successOperation,
97
+ button.code,
98
+ null,
99
+ null,
100
+ button.isNeedValueMapping
101
+ )
102
+ }
103
+ if (result === true) {
104
+ // 提示操作成功
105
+ this.$message({
106
+ showClose: true,
107
+ type: 'success',
108
+ message: this.$t('superPageMessage.successfulOperation'),
109
+ })
110
+ }
111
+ })
112
+ }
113
+ } else {
114
+ // 自定义按钮需要回填值时,默认的成功后操作是关闭弹框
115
+ let successOperation
116
+ if (button.successOperation) {
117
+ successOperation = button.successOperation
118
+ }
119
+ if (!successOperation) {
120
+ // 默认是关闭弹框
121
+ successOperation = 'closeWindow'
122
+ }
123
+ this.afterSuccessOperateInForm(successOperation, model, true, true)
124
+ }
125
+ },
126
+ // 按钮组中各按钮的操作
127
+ clickWorflowButton(
128
+ buttonType,
129
+ system,
130
+ tableName,
131
+ model,
132
+ definitionId,
133
+ emailTemplateCode,
134
+ operationResult,
135
+ formViewCode,
136
+ formViewVersion,
137
+ myEntityName,
138
+ myJsContent,
139
+ formNoRuleCode,
140
+ successOperation,
141
+ dataConversionRule,
142
+ processEndlogicSetting,
143
+ autoSetValueData,
144
+ logSettingText,
145
+ ids,
146
+ isBatchProcessing,
147
+ isNeedValueMapping,
148
+ taskMap,
149
+ needDeleteFileUuid,
150
+ beanName,
151
+ button
152
+ ) {
153
+ if (buttonType === 'startInstance' || buttonType === 'update') {
154
+ // 表单页面保存按钮操作
155
+ this.startInstance(
156
+ system,
157
+ tableName,
158
+ model,
159
+ definitionId,
160
+ emailTemplateCode,
161
+ formViewCode,
162
+ formViewVersion,
163
+ myEntityName,
164
+ myJsContent,
165
+ formNoRuleCode,
166
+ successOperation,
167
+ dataConversionRule,
168
+ autoSetValueData,
169
+ logSettingText,
170
+ buttonType,
171
+ isNeedValueMapping,
172
+ taskMap,
173
+ needDeleteFileUuid,
174
+ beanName
175
+ )
176
+ } else if (buttonType === 'submitProcess') {
177
+ // 提交流程
178
+ this.submitProcess(
179
+ system,
180
+ tableName,
181
+ model,
182
+ definitionId,
183
+ emailTemplateCode,
184
+ formViewCode,
185
+ formViewVersion,
186
+ myEntityName,
187
+ myJsContent,
188
+ formNoRuleCode,
189
+ successOperation,
190
+ dataConversionRule,
191
+ processEndlogicSetting,
192
+ autoSetValueData,
193
+ logSettingText,
194
+ buttonType,
195
+ isNeedValueMapping,
196
+ taskMap,
197
+ needDeleteFileUuid,
198
+ beanName
199
+ )
200
+ } else if (buttonType === 'completeTask') {
201
+ // 办理任务
202
+ this.complateTask(
203
+ system,
204
+ tableName,
205
+ model,
206
+ operationResult,
207
+ formViewCode,
208
+ formViewVersion,
209
+ myEntityName,
210
+ myJsContent,
211
+ successOperation,
212
+ dataConversionRule,
213
+ processEndlogicSetting,
214
+ autoSetValueData,
215
+ logSettingText,
216
+ buttonType,
217
+ isNeedValueMapping,
218
+ taskMap,
219
+ needDeleteFileUuid,
220
+ beanName
221
+ )
222
+ } else if (buttonType === 'drawTask') {
223
+ // 领取
224
+ this.drawTask(
225
+ system,
226
+ tableName,
227
+ model,
228
+ formViewCode,
229
+ formViewVersion,
230
+ myEntityName,
231
+ myJsContent,
232
+ successOperation,
233
+ logSettingText,
234
+ buttonType,
235
+ isNeedValueMapping,
236
+ taskMap,
237
+ beanName
238
+ )
239
+ } else if (buttonType === 'abandonDraw') {
240
+ // 放弃领取
241
+ this.abandonReceive(
242
+ system,
243
+ tableName,
244
+ model,
245
+ formViewCode,
246
+ formViewVersion,
247
+ myEntityName,
248
+ myJsContent,
249
+ successOperation,
250
+ logSettingText,
251
+ buttonType,
252
+ isNeedValueMapping,
253
+ taskMap,
254
+ beanName
255
+ )
256
+ } else if (buttonType === 'retrieveTask') {
257
+ // 取回
258
+ this.retrieve(
259
+ system,
260
+ tableName,
261
+ model,
262
+ formViewCode,
263
+ formViewVersion,
264
+ myEntityName,
265
+ myJsContent,
266
+ successOperation,
267
+ logSettingText,
268
+ buttonType,
269
+ isNeedValueMapping,
270
+ taskMap,
271
+ beanName
272
+ )
273
+ } else if (buttonType === 'assignTask') {
274
+ // 指派
275
+ this.assignTask()
276
+ } else if (buttonType.indexOf('#_default_#') === 0) {
277
+ if (
278
+ buttonType === '#_default_#submit' ||
279
+ buttonType === '#_default_#agree' ||
280
+ buttonType === '#_default_#disagree'
281
+ ) {
282
+ // 表示是默认的按钮:“提交”、“同意”、“不同意”
283
+ let url
284
+ if (buttonType === '#_default_#submit') {
285
+ url = '/dsc/workflow-commons/common-submits'
286
+ } else if (buttonType === '#_default_#agree') {
287
+ url = '/dsc/workflow-commons/common-approves'
288
+ } else if (buttonType === '#_default_#disagree') {
289
+ url = '/dsc/workflow-commons/common-refuses'
290
+ }
291
+ const buttonCode = buttonType.substring(buttonType.lastIndexOf('#') + 1)
292
+ this.submitForm(
293
+ system,
294
+ tableName,
295
+ model,
296
+ formViewCode,
297
+ formViewVersion,
298
+ myEntityName,
299
+ myJsContent,
300
+ formNoRuleCode,
301
+ successOperation,
302
+ dataConversionRule,
303
+ autoSetValueData,
304
+ url,
305
+ logSettingText,
306
+ buttonCode,
307
+ ids,
308
+ isBatchProcessing,
309
+ isNeedValueMapping,
310
+ taskMap,
311
+ needDeleteFileUuid,
312
+ beanName,
313
+ button ? button.functionCode : ''
314
+ )
315
+ }
316
+ } else if (buttonType === 'addSigner') {
317
+ // 加签
318
+ this.addSigner()
319
+ } else if (buttonType === 'createCopyTask') {
320
+ // 抄送
321
+ this.createCopyTask()
322
+ } else if (buttonType === 'removeSigner') {
323
+ // 减签
324
+ this.removeSigner(system, myEntityName, model, logSettingText, beanName)
325
+ }
326
+ },
327
+ // 发起流程。保存按钮的操作
328
+ startInstance(
329
+ system,
330
+ tableName,
331
+ model,
332
+ definitionId,
333
+ emailTemplateCode,
334
+ formViewCode,
335
+ formViewVersion,
336
+ myEntityName,
337
+ myJsContent,
338
+ formNoRuleCode,
339
+ successOperation,
340
+ dataConversionRule,
341
+ autoSetValueData,
342
+ logSettingText,
343
+ buttonType,
344
+ isNeedValueMapping,
345
+ taskMap,
346
+ needDeleteFileUuid,
347
+ beanName
348
+ ) {
349
+ let path
350
+ if (system.standard === false) {
351
+ // 表示是自定义系统
352
+ path = this.getBaseUrl(system) + '/dsc/workflow-commons'
353
+ }
354
+ path = this.getRealRestApiPath(path, system)
355
+ if (!path) {
356
+ this.$message({
357
+ showClose: true,
358
+ type: 'warning',
359
+ message: this.$t('superPageMessage.requestPathEmpty'),
360
+ })
361
+ return
362
+ }
363
+ let param = {
364
+ entity: model,
365
+ formNoRuleCode,
366
+ }
367
+ if (system.standard === false) {
368
+ // 自定义系统时,封装CommonEntity
369
+ param = {
370
+ entity: model,
371
+ tableName: tableName,
372
+ emailTemplateCode: emailTemplateCode,
373
+ definitionId: definitionId,
374
+ formViewCode: formViewCode,
375
+ formViewVersion: formViewVersion,
376
+ formNoRuleCode,
377
+ functionCode: this.permissionPrefix + '.xxx',
378
+ }
379
+ }
380
+ if (this.judgeHeavyList) {
381
+ // 判重组合字段配置
382
+ param.judgeHeavyList = JSON.stringify(this.judgeHeavyList)
383
+ }
384
+ if (dataConversionRule) {
385
+ param.dataConversionRule = dataConversionRule.join(',')
386
+ }
387
+ if (autoSetValueData) {
388
+ param.autoSetValueData = JSON.stringify(autoSetValueData)
389
+ }
390
+ if (myEntityName) {
391
+ param.entityName = myEntityName
392
+ }
393
+ if (beanName) {
394
+ param.beanName = beanName
395
+ }
396
+ if (logSettingText) {
397
+ param.logSettingText = logSettingText
398
+ }
399
+ if (!param.systemCode) {
400
+ param.systemCode = system.code
401
+ }
402
+ if (this.dataTypeMap) {
403
+ param.dataTypeMap = this.dataTypeMap
404
+ }
405
+ if (taskMap) {
406
+ param.taskMap = taskMap
407
+ }
408
+ if (needDeleteFileUuid) {
409
+ param.needDeleteFileUuid = needDeleteFileUuid
410
+ }
411
+ if (this.additionalParamMap) {
412
+ param.additionalParamMap = this.additionalParamMap
413
+ }
414
+ // false表示控制version,true表示不控制version
415
+ if (successOperation && successOperation === 'noOperation') {
416
+ // 如果是按钮操作后是“无操作”,则不控制version的值,否则会报“记录被其它事务修改”的异常
417
+ param.unControlVersion = true
418
+ }
419
+ param.isWorkflowEntity = true
420
+ let request
421
+ if (myJsContent) {
422
+ // 将js文本转换为函数,并运行
423
+ // eslint-disable-next-line no-eval
424
+ const buttonFun = eval('(' + myJsContent + ')')
425
+ // 运行方法
426
+ request = buttonFun(this, param)
427
+ } else {
428
+ if (model.id || model.ID) {
429
+ // 表示是修改操作
430
+ request = this.$http.put(path, param)
431
+ } else {
432
+ // 表示是新建操作
433
+ request = this.$http.post(path, param)
434
+ }
435
+ }
436
+ if (request) {
437
+ request.then((commonEntity) => {
438
+ // 处理任务办理参数
439
+ let result = true
440
+ if (commonEntity) {
441
+ result = this.dealCompleteTaskParam(
442
+ commonEntity,
443
+ false,
444
+ successOperation,
445
+ buttonType,
446
+ null,
447
+ null,
448
+ isNeedValueMapping
449
+ )
450
+ }
451
+ if (result === true) {
452
+ this.$message({
453
+ showClose: true,
454
+ type: 'success',
455
+ message: this.$t('superPageMessage.successfulSave'),
456
+ })
457
+ }
458
+ })
459
+ }
460
+ },
461
+ // 第一环节提交流程
462
+ submitProcess(
463
+ system,
464
+ tableName,
465
+ model,
466
+ definitionId,
467
+ emailTemplateCode,
468
+ formViewCode,
469
+ formViewVersion,
470
+ myEntityName,
471
+ myJsContent,
472
+ formNoRuleCode,
473
+ successOperation,
474
+ dataConversionRule,
475
+ processEndlogicSetting,
476
+ autoSetValueData,
477
+ logSettingText,
478
+ buttonType,
479
+ isNeedValueMapping,
480
+ taskMap,
481
+ needDeleteFileUuid,
482
+ beanName
483
+ ) {
484
+ let path
485
+ if (system.standard === false) {
486
+ // 表示是自定义系统
487
+ path = this.getBaseUrl(system) + '/dsc/workflow-commons/submit'
488
+ }
489
+ path = this.getRealRestApiPath(path, system)
490
+ if (!path) {
491
+ this.$message({
492
+ showClose: true,
493
+ type: 'warning',
494
+ message: this.$t('superPageMessage.requestPathEmpty'),
495
+ })
496
+ return
497
+ }
498
+ let param = {
499
+ entity: model,
500
+ formNoRuleCode,
501
+ }
502
+ if (system.standard === false) {
503
+ // 自定义系统时,封装CommonEntity
504
+ param = {
505
+ entity: model,
506
+ tableName: tableName,
507
+ emailTemplateCode: emailTemplateCode,
508
+ definitionId: definitionId,
509
+ formViewCode: formViewCode,
510
+ formViewVersion: formViewVersion,
511
+ formNoRuleCode,
512
+ functionCode: this.permissionPrefix + '.xxx',
513
+ }
514
+ }
515
+ if (this.judgeHeavyList) {
516
+ // 判重组合字段配置
517
+ param.judgeHeavyList = JSON.stringify(this.judgeHeavyList)
518
+ }
519
+ if (dataConversionRule) {
520
+ param.dataConversionRule = dataConversionRule.join(',')
521
+ }
522
+ if (autoSetValueData) {
523
+ param.autoSetValueData = JSON.stringify(autoSetValueData)
524
+ }
525
+ if (myEntityName) {
526
+ param.entityName = myEntityName
527
+ }
528
+ if (beanName) {
529
+ param.beanName = beanName
530
+ }
531
+ if (processEndlogicSetting) {
532
+ param.processEndLogicSetting = JSON.stringify(processEndlogicSetting)
533
+ }
534
+ if (logSettingText) {
535
+ param.logSettingText = logSettingText
536
+ }
537
+ if (!param.systemCode) {
538
+ param.systemCode = system.code
539
+ }
540
+ if (this.dataTypeMap) {
541
+ param.dataTypeMap = this.dataTypeMap
542
+ }
543
+ if (taskMap) {
544
+ param.taskMap = taskMap
545
+ }
546
+ if (needDeleteFileUuid) {
547
+ param.needDeleteFileUuid = needDeleteFileUuid
548
+ }
549
+ if (this.additionalParamMap) {
550
+ param.additionalParamMap = this.additionalParamMap
551
+ }
552
+ param.isWorkflowEntity = true
553
+ let request
554
+ if (myJsContent) {
555
+ // 将js文本转换为函数,并运行
556
+ // eslint-disable-next-line no-eval
557
+ const buttonFun = eval('(' + myJsContent + ')')
558
+ // 运行方法
559
+ request = buttonFun(this, param)
560
+ } else {
561
+ request = this.$http.post(path, param)
562
+ }
563
+ if (request) {
564
+ request.then((commonEntity) => {
565
+ // 处理任务办理参数
566
+ let result = true
567
+ if (commonEntity) {
568
+ result = this.dealCompleteTaskParam(
569
+ commonEntity,
570
+ false,
571
+ successOperation,
572
+ buttonType,
573
+ null,
574
+ null,
575
+ isNeedValueMapping
576
+ )
577
+ }
578
+ if (result === true) {
579
+ this.$message({
580
+ showClose: true,
581
+ type: 'success',
582
+ message: this.$t('superPageMessage.successfulSubmit'),
583
+ })
584
+ }
585
+ })
586
+ }
587
+ },
588
+ // 办理任务
589
+ complateTask(
590
+ system,
591
+ tableName,
592
+ model,
593
+ operationResult,
594
+ formViewCode,
595
+ formViewVersion,
596
+ myEntityName,
597
+ myJsContent,
598
+ successOperation,
599
+ dataConversionRule,
600
+ processEndlogicSetting,
601
+ autoSetValueData,
602
+ logSettingText,
603
+ buttonType,
604
+ isNeedValueMapping,
605
+ taskMap,
606
+ needDeleteFileUuid,
607
+ beanName
608
+ ) {
609
+ let path
610
+ if (system.standard === false) {
611
+ // 表示是自定义系统
612
+ path = this.getBaseUrl(system) + '/dsc/workflow-commons/complete-tasks'
613
+ }
614
+ path = this.getRealRestApiPath(path, system)
615
+ if (!path) {
616
+ this.$message({
617
+ showClose: true,
618
+ type: 'warning',
619
+ message: this.$t('superPageMessage.requestPathEmpty'),
620
+ })
621
+ return
622
+ }
623
+ let param = {
624
+ entity: model,
625
+ completeTaskParam: {
626
+ operationResult: operationResult,
627
+ taskId: this.completeTaskParam.taskId,
628
+ opinion: this.completeTaskParam.opinion,
629
+ },
630
+ }
631
+ if (system.standard === false) {
632
+ // 自定义系统时,封装CommonEntity
633
+ param = {
634
+ entity: model,
635
+ tableName: tableName,
636
+ completeTaskParam: {
637
+ operationResult: operationResult,
638
+ taskId: this.completeTaskParam.taskId,
639
+ opinion: this.completeTaskParam.opinion,
640
+ },
641
+ formViewCode: formViewCode,
642
+ formViewVersion: formViewVersion,
643
+ functionCode: this.permissionPrefix + '.xxx',
644
+ }
645
+ }
646
+ if (this.judgeHeavyList) {
647
+ // 判重组合字段配置
648
+ param.judgeHeavyList = JSON.stringify(this.judgeHeavyList)
649
+ }
650
+ if (dataConversionRule) {
651
+ param.dataConversionRule = dataConversionRule.join(',')
652
+ }
653
+ if (autoSetValueData) {
654
+ param.autoSetValueData = JSON.stringify(autoSetValueData)
655
+ }
656
+ if (myEntityName) {
657
+ param.entityName = myEntityName
658
+ }
659
+ if (beanName) {
660
+ param.beanName = beanName
661
+ }
662
+ if (processEndlogicSetting) {
663
+ param.processEndLogicSetting = JSON.stringify(processEndlogicSetting)
664
+ }
665
+ if (logSettingText) {
666
+ param.logSettingText = logSettingText
667
+ }
668
+ if (!param.systemCode) {
669
+ param.systemCode = system.code
670
+ }
671
+ if (this.dataTypeMap) {
672
+ param.dataTypeMap = this.dataTypeMap
673
+ }
674
+ if (needDeleteFileUuid) {
675
+ param.needDeleteFileUuid = needDeleteFileUuid
676
+ }
677
+ if (this.additionalParamMap) {
678
+ param.additionalParamMap = this.additionalParamMap
679
+ }
680
+ console.log('办理任务', taskMap)
681
+ if (taskMap) {
682
+ param.taskMap = taskMap
683
+ }
684
+ console.log('办理任务param', param)
685
+ param.isWorkflowEntity = true
686
+ let request
687
+ if (myJsContent) {
688
+ // 将js文本转换为函数,并运行
689
+ // eslint-disable-next-line no-eval
690
+ const buttonFun = eval('(' + myJsContent + ')')
691
+ // 运行方法
692
+ request = buttonFun(this, param)
693
+ } else {
694
+ request = this.$http.post(path, param)
695
+ }
696
+ if (request) {
697
+ request.then((commonEntity) => {
698
+ // 处理任务办理参数
699
+ let result = true
700
+ if (commonEntity) {
701
+ result = this.dealCompleteTaskParam(
702
+ commonEntity,
703
+ false,
704
+ successOperation,
705
+ buttonType,
706
+ this.completeTaskParam.taskId,
707
+ operationResult,
708
+ isNeedValueMapping
709
+ )
710
+ }
711
+ if (result === true) {
712
+ this.$message({
713
+ showClose: true,
714
+ type: 'success',
715
+ message: this.$t('superPageMessage.successfulCompleteTask'),
716
+ })
717
+ }
718
+ })
719
+ }
720
+ },
721
+ // 处理任务办理参数
722
+ dealCompleteTaskParam(
723
+ formParam,
724
+ isInit,
725
+ successOperation,
726
+ buttonCode,
727
+ taskId,
728
+ operationResult,
729
+ isNeedValueMapping
730
+ ) {
731
+ if (formParam) {
732
+ // 重新给表单赋值,可以连续保存
733
+ if (formParam.entity) {
734
+ this.formData = formParam.entity
735
+ // 获得表单编码规则解析结果
736
+ this.formNo = formParam.formNo
737
+ setStoreInfo(this.pageCode, '_formData', this.formData)
738
+ }
739
+ const completeTaskResult = formParam.completeTaskResult
740
+ if (completeTaskResult) {
741
+ // 表示有返回结果
742
+ const completeTaskTipType = completeTaskResult.completeTaskTipType
743
+ if (completeTaskTipType && completeTaskTipType === 'MESSAGE') {
744
+ // 表示有业务异常信息
745
+ const message = completeTaskResult.content
746
+ this.$message({
747
+ showClose: true,
748
+ type: 'warning',
749
+ message: message,
750
+ })
751
+ return false
752
+ }
753
+ }
754
+ if (formParam.completeTaskParam) {
755
+ this.completeTaskParam = formParam.completeTaskParam
756
+ setStoreInfo(
757
+ this.pageCode,
758
+ '_completeTaskParam',
759
+ this.completeTaskParam
760
+ )
761
+ // 字段编辑权限传给表单组件
762
+ this.formOptions['fieldPermissions'] =
763
+ this.completeTaskParam.fieldPermissions
764
+ // 子表操作列编辑权限传给表单组件
765
+ this.formOptions['actionPermissions'] =
766
+ this.completeTaskParam.actionPermissions
767
+ // 流程按钮组组件需要的信息
768
+ this.workflowButtonComponent = this.completeTaskParam.buttonComponent
769
+ }
770
+ setStoreInfo(this.pageCode, '_currentActivityName', formParam.taskName)
771
+ }
772
+ if (!isInit) {
773
+ if (buttonCode) {
774
+ // 调用afterClick回调事件
775
+ this.callAfterClickButton(
776
+ this.formEvents,
777
+ this.formViewCode + '__' + buttonCode,
778
+ {
779
+ params: this.additionalParamMap,
780
+ additionalParamMap: this.additionalParamMap,
781
+ entity: this.formData,
782
+ taskId,
783
+ operationResult,
784
+ }
785
+ )
786
+ }
787
+ // 不是初始化表单时,才需要刷新表单内容
788
+ this.afterSuccessOperateInForm(
789
+ successOperation,
790
+ this.formData,
791
+ isNeedValueMapping,
792
+ true
793
+ )
794
+ }
795
+ // 刷新按钮
796
+ this.reviewButton()
797
+ return true
798
+ },
799
+ // 办理任务:领取任务、放弃领取任务等等
800
+ transactTask(
801
+ system,
802
+ tableName,
803
+ model,
804
+ path,
805
+ successMessageTip,
806
+ nodeName,
807
+ nodeId,
808
+ formViewCode,
809
+ formViewVersion,
810
+ myEntityName,
811
+ myJsContent,
812
+ successOperation,
813
+ formNoRuleCode,
814
+ dataConversionRule,
815
+ autoSetValueData,
816
+ assigneeId,
817
+ logSettingText,
818
+ buttonType,
819
+ ids,
820
+ isBatchProcessing,
821
+ isNeedValueMapping,
822
+ taskMap,
823
+ needDeleteFileUuid,
824
+ beanName,
825
+ functionCode
826
+ ) {
827
+ return new Promise((resolve, reject) => {
828
+ path = this.getRealRestApiPath(path, system)
829
+ if (!path) {
830
+ this.$message({
831
+ showClose: true,
832
+ type: 'warning',
833
+ message: this.$t('superPageMessage.requestPathEmpty'),
834
+ })
835
+ return
836
+ }
837
+ let param = {
838
+ entity: model,
839
+ formNoRuleCode,
840
+ }
841
+ if (system.standard === false) {
842
+ // 自定义系统时,封装CommonEntity
843
+ param = {
844
+ entity: model,
845
+ tableName: tableName,
846
+ completeTaskParam: {
847
+ taskId: this.completeTaskParam.taskId,
848
+ opinion: this.completeTaskParam.opinion,
849
+ },
850
+ formViewCode: formViewCode,
851
+ formViewVersion: formViewVersion,
852
+ }
853
+ }
854
+ if (functionCode) {
855
+ param.functionCode = functionCode
856
+ } else {
857
+ param.functionCode = this.permissionPrefix + '.xxx'
858
+ }
859
+ if (assigneeId) {
860
+ param.assigneeId = assigneeId
861
+ }
862
+ if (this.judgeHeavyList) {
863
+ // 判重组合字段配置
864
+ param.judgeHeavyList = JSON.stringify(this.judgeHeavyList)
865
+ }
866
+ if (nodeName && nodeId) {
867
+ param.returnToNodeName = nodeName
868
+ param.returnToNodeId = nodeId
869
+ }
870
+ if (myEntityName) {
871
+ param.entityName = myEntityName
872
+ }
873
+ if (beanName) {
874
+ param.beanName = beanName
875
+ }
876
+ if (dataConversionRule) {
877
+ param.dataConversionRule = dataConversionRule.join(',')
878
+ }
879
+ if (autoSetValueData) {
880
+ param.autoSetValueData = JSON.stringify(autoSetValueData)
881
+ }
882
+ if (logSettingText) {
883
+ param.logSettingText = logSettingText
884
+ }
885
+ if (!param.systemCode) {
886
+ param.systemCode = system.code
887
+ }
888
+ if (this.dataTypeMap) {
889
+ param.dataTypeMap = this.dataTypeMap
890
+ }
891
+ if (this.ids && this.ids.length > 0) {
892
+ param.ids = this.ids
893
+ }
894
+ if (taskMap) {
895
+ param.taskMap = taskMap
896
+ }
897
+ if (needDeleteFileUuid) {
898
+ param.needDeleteFileUuid = needDeleteFileUuid
899
+ }
900
+ if (this.additionalParamMap) {
901
+ param.additionalParamMap = this.additionalParamMap
902
+ }
903
+ param.isBatchProcessing = isBatchProcessing
904
+ param.isWorkflowEntity = true
905
+ console.log(JSON.stringify(param), 'completeTaskParam--------')
906
+ let request
907
+ if (myJsContent) {
908
+ // 将js文本转换为函数,并运行
909
+ // eslint-disable-next-line no-eval
910
+ const buttonFun = eval('(' + myJsContent + ')')
911
+ // 运行方法
912
+ request = buttonFun(this, param)
913
+ } else {
914
+ request = this.$http.post(path, param)
915
+ }
916
+ if (request) {
917
+ request.then((commonEntity) => {
918
+ // 处理任务办理参数
919
+ let result = true
920
+ if (commonEntity) {
921
+ result = this.dealCompleteTaskParam(
922
+ commonEntity,
923
+ false,
924
+ successOperation,
925
+ buttonType,
926
+ this.completeTaskParam.taskId,
927
+ null,
928
+ isNeedValueMapping
929
+ )
930
+ }
931
+ if (result === true) {
932
+ this.$message({
933
+ showClose: true,
934
+ type: 'success',
935
+ message: this.$t(successMessageTip),
936
+ })
937
+ }
938
+ resolve(true)
939
+ })
940
+ }
941
+ })
942
+ },
943
+ // 取回任务
944
+ retrieve(
945
+ system,
946
+ tableName,
947
+ model,
948
+ formViewCode,
949
+ formViewVersion,
950
+ myEntityName,
951
+ myJsContent,
952
+ successOperation,
953
+ logSettingText,
954
+ buttonType,
955
+ isNeedValueMapping,
956
+ taskMap,
957
+ beanName
958
+ ) {
959
+ let path
960
+ if (system.standard === false) {
961
+ // 表示是自定义系统
962
+ path = this.getBaseUrl(system) + '/dsc/workflow-commons/retrieves'
963
+ }
964
+ this.transactTask(
965
+ system,
966
+ tableName,
967
+ model,
968
+ path,
969
+ 'superPageMessage.successfulRetrieve',
970
+ false,
971
+ false,
972
+ formViewCode,
973
+ formViewVersion,
974
+ myEntityName,
975
+ myJsContent,
976
+ successOperation,
977
+ null,
978
+ null,
979
+ null,
980
+ null,
981
+ logSettingText,
982
+ buttonType,
983
+ null,
984
+ null,
985
+ isNeedValueMapping,
986
+ taskMap,
987
+ null,
988
+ beanName
989
+ )
990
+ },
991
+ // 领取任务
992
+ drawTask(
993
+ system,
994
+ tableName,
995
+ model,
996
+ formViewCode,
997
+ formViewVersion,
998
+ myEntityName,
999
+ myJsContent,
1000
+ successOperation,
1001
+ logSettingText,
1002
+ buttonType,
1003
+ isNeedValueMapping,
1004
+ taskMap,
1005
+ beanName
1006
+ ) {
1007
+ let path
1008
+ if (system.standard === false) {
1009
+ // 表示是自定义系统
1010
+ path = this.getBaseUrl(system) + '/dsc/workflow-commons/draw-tasks'
1011
+ }
1012
+ this.transactTask(
1013
+ system,
1014
+ tableName,
1015
+ model,
1016
+ path,
1017
+ 'superPageMessage.successfulDrawTask',
1018
+ false,
1019
+ false,
1020
+ formViewCode,
1021
+ formViewVersion,
1022
+ myEntityName,
1023
+ myJsContent,
1024
+ successOperation,
1025
+ null,
1026
+ null,
1027
+ null,
1028
+ null,
1029
+ logSettingText,
1030
+ buttonType,
1031
+ null,
1032
+ null,
1033
+ isNeedValueMapping,
1034
+ taskMap,
1035
+ null,
1036
+ beanName
1037
+ )
1038
+ },
1039
+ // 放弃领取任务
1040
+ abandonReceive(
1041
+ system,
1042
+ tableName,
1043
+ model,
1044
+ formViewCode,
1045
+ formViewVersion,
1046
+ myEntityName,
1047
+ myJsContent,
1048
+ successOperation,
1049
+ logSettingText,
1050
+ buttonType,
1051
+ isNeedValueMapping,
1052
+ taskMap,
1053
+ beanName
1054
+ ) {
1055
+ let path
1056
+ if (system.standard === false) {
1057
+ // 表示是自定义系统
1058
+ path = this.getBaseUrl(system) + '/dsc/workflow-commons/abandon-receives'
1059
+ }
1060
+ this.transactTask(
1061
+ system,
1062
+ tableName,
1063
+ model,
1064
+ path,
1065
+ 'superPageMessage.successfulAbandonReceive',
1066
+ false,
1067
+ false,
1068
+ formViewCode,
1069
+ formViewVersion,
1070
+ myEntityName,
1071
+ myJsContent,
1072
+ successOperation,
1073
+ null,
1074
+ null,
1075
+ null,
1076
+ null,
1077
+ logSettingText,
1078
+ buttonType,
1079
+ null,
1080
+ null,
1081
+ isNeedValueMapping,
1082
+ taskMap,
1083
+ null,
1084
+ beanName
1085
+ )
1086
+ },
1087
+ // 指派
1088
+ assign(
1089
+ system,
1090
+ tableName,
1091
+ model,
1092
+ formViewCode,
1093
+ formViewVersion,
1094
+ myEntityName,
1095
+ myJsContent,
1096
+ successOperation,
1097
+ selectNodeInfo,
1098
+ isNeedValueMapping,
1099
+ beanName
1100
+ ) {
1101
+ if (selectNodeInfo) {
1102
+ let path
1103
+ if (system.standard === false) {
1104
+ // 表示是自定义系统
1105
+ path = this.getBaseUrl(system) + '/dsc/workflow-commons/assigns'
1106
+ }
1107
+ const assigneeId = selectNodeInfo.id
1108
+ ? selectNodeInfo.id
1109
+ : selectNodeInfo.ID
1110
+ ? selectNodeInfo.ID
1111
+ : null
1112
+ this.transactTask(
1113
+ system,
1114
+ tableName,
1115
+ model,
1116
+ path,
1117
+ 'superPageMessage.successfulAssign',
1118
+ false,
1119
+ false,
1120
+ formViewCode,
1121
+ formViewVersion,
1122
+ myEntityName,
1123
+ myJsContent,
1124
+ successOperation,
1125
+ null,
1126
+ null,
1127
+ null,
1128
+ assigneeId,
1129
+ this.logSetting,
1130
+ 'assignTask',
1131
+ null,
1132
+ null,
1133
+ isNeedValueMapping,
1134
+ null,
1135
+ null,
1136
+ beanName
1137
+ ).then((result) => {
1138
+ // 关闭指派用户人员树
1139
+ this.selectAssignUser = false
1140
+ })
1141
+ } else {
1142
+ // 关闭指派用户人员树
1143
+ this.selectAssignUser = false
1144
+ }
1145
+ },
1146
+ // 任务退回,退回到上一环节
1147
+ returnToPreviousTask(
1148
+ system,
1149
+ tableName,
1150
+ model,
1151
+ formViewCode,
1152
+ formViewVersion,
1153
+ myEntityName,
1154
+ myJsContent,
1155
+ successOperation,
1156
+ isNeedValueMapping,
1157
+ taskMap,
1158
+ beanName
1159
+ ) {
1160
+ let path
1161
+ if (system.standard === false) {
1162
+ // 表示是自定义系统
1163
+ path =
1164
+ this.getBaseUrl(system) +
1165
+ '/dsc/workflow-commons/return-to-previous-tasks'
1166
+ }
1167
+ this.transactTask(
1168
+ system,
1169
+ tableName,
1170
+ model,
1171
+ path,
1172
+ 'superPageMessage.successfulReturnToPreviousTask',
1173
+ false,
1174
+ false,
1175
+ formViewCode,
1176
+ formViewVersion,
1177
+ myEntityName,
1178
+ myJsContent,
1179
+ successOperation,
1180
+ null,
1181
+ null,
1182
+ null,
1183
+ null,
1184
+ this.logSetting,
1185
+ 'returnToPreviousTask',
1186
+ null,
1187
+ null,
1188
+ isNeedValueMapping,
1189
+ taskMap,
1190
+ null,
1191
+ beanName
1192
+ )
1193
+ },
1194
+ // 获得可退回的环节信息集合,只能退回到已办理过的环节
1195
+ getTaskInformitions(system, entityName, beanName) {
1196
+ let path
1197
+ if (system.standard === false) {
1198
+ // 表示是自定义系统
1199
+ path =
1200
+ this.getBaseUrl(system) +
1201
+ '/dsc/workflow-commons/returnable-task/' +
1202
+ this.completeTaskParam.taskId
1203
+ }
1204
+ path = this.getRealRestApiPath(path, system)
1205
+ if (!path) {
1206
+ this.$message({
1207
+ showClose: true,
1208
+ type: 'warning',
1209
+ message: this.$t('superPageMessage.requestPathEmpty'),
1210
+ })
1211
+ return
1212
+ }
1213
+ this.showTaskInformitions = false
1214
+ const requestParams = {
1215
+ entityName,
1216
+ beanName,
1217
+ additionalParamMap: this.additionalParamMap,
1218
+ tableName: this.tableName,
1219
+ functionCode: this.permissionPrefix + '.xxx',
1220
+ }
1221
+ this.$http
1222
+ .post(path, requestParams)
1223
+ .then((taskInformitions) => {
1224
+ // 可退回的环节名称集合
1225
+ this.taskInformitions = taskInformitions
1226
+ this.showTaskInformitions = true
1227
+ })
1228
+ .catch((e) => {
1229
+ this.showTaskInformitions = false
1230
+ })
1231
+ },
1232
+ // 退回到某环节,只能退回到已办理过的环节
1233
+ returnTaskTo(
1234
+ system,
1235
+ tableName,
1236
+ model,
1237
+ selectTaskNode,
1238
+ formViewCode,
1239
+ formViewVersion,
1240
+ myEntityName,
1241
+ myJsContent,
1242
+ successOperation,
1243
+ isNeedValueMapping,
1244
+ beanName
1245
+ ) {
1246
+ let path
1247
+ if (system.standard === false) {
1248
+ // 表示是自定义系统
1249
+ path = this.getBaseUrl(system) + '/dsc/workflow-commons/returnTaskTo'
1250
+ }
1251
+ this.transactTask(
1252
+ system,
1253
+ tableName,
1254
+ model,
1255
+ path,
1256
+ 'superPageMessage.successfulReturnTaskTo',
1257
+ selectTaskNode.nodeName,
1258
+ selectTaskNode.nodeId,
1259
+ formViewCode,
1260
+ formViewVersion,
1261
+ myEntityName,
1262
+ myJsContent,
1263
+ successOperation,
1264
+ null,
1265
+ null,
1266
+ null,
1267
+ null,
1268
+ this.logSetting,
1269
+ 'returnTaskTo',
1270
+ null,
1271
+ null,
1272
+ isNeedValueMapping,
1273
+ null,
1274
+ null,
1275
+ beanName
1276
+ )
1277
+ },
1278
+ // 强制结束流程
1279
+ endInstance(
1280
+ system,
1281
+ tableName,
1282
+ model,
1283
+ formViewCode,
1284
+ formViewVersion,
1285
+ myEntityName,
1286
+ myJsContent,
1287
+ successOperation,
1288
+ isNeedValueMapping,
1289
+ taskMap,
1290
+ beanName
1291
+ ) {
1292
+ let path
1293
+ if (system.standard === false) {
1294
+ // 表示是自定义系统
1295
+ path = this.getBaseUrl(system) + '/dsc/workflow-commons/end-instance'
1296
+ }
1297
+ this.transactTask(
1298
+ system,
1299
+ tableName,
1300
+ model,
1301
+ path,
1302
+ 'superPageMessage.successfulEndInstance',
1303
+ false,
1304
+ false,
1305
+ formViewCode,
1306
+ formViewVersion,
1307
+ myEntityName,
1308
+ myJsContent,
1309
+ successOperation,
1310
+ null,
1311
+ null,
1312
+ null,
1313
+ null,
1314
+ this.logSetting,
1315
+ 'endInstance',
1316
+ null,
1317
+ null,
1318
+ isNeedValueMapping,
1319
+ taskMap,
1320
+ null,
1321
+ beanName
1322
+ )
1323
+ },
1324
+ // 流程表单页面(非流程处理的)-提交/同意/不同意
1325
+ submitForm(
1326
+ system,
1327
+ tableName,
1328
+ model,
1329
+ formViewCode,
1330
+ formViewVersion,
1331
+ myEntityName,
1332
+ myJsContent,
1333
+ formNoRuleCode,
1334
+ successOperation,
1335
+ dataConversionRule,
1336
+ autoSetValueData,
1337
+ url,
1338
+ logSettingText,
1339
+ buttonCode,
1340
+ ids,
1341
+ isBatchProcessing,
1342
+ isNeedValueMapping,
1343
+ taskMap,
1344
+ needDeleteFileUuid,
1345
+ beanName,
1346
+ functionCode
1347
+ ) {
1348
+ let path
1349
+ if (system.standard === false) {
1350
+ // 表示是自定义系统
1351
+ path = this.getBaseUrl(system) + url
1352
+ }
1353
+ this.transactTask(
1354
+ system,
1355
+ tableName,
1356
+ model,
1357
+ path,
1358
+ 'superPageMessage.successfulOperation',
1359
+ false,
1360
+ false,
1361
+ formViewCode,
1362
+ formViewVersion,
1363
+ myEntityName,
1364
+ myJsContent,
1365
+ successOperation,
1366
+ formNoRuleCode,
1367
+ dataConversionRule,
1368
+ autoSetValueData,
1369
+ null,
1370
+ logSettingText,
1371
+ buttonCode,
1372
+ ids,
1373
+ isBatchProcessing,
1374
+ isNeedValueMapping,
1375
+ taskMap,
1376
+ needDeleteFileUuid,
1377
+ beanName,
1378
+ functionCode
1379
+ )
1380
+ },
1381
+ // 点击加签后,弹出组织结构树
1382
+ addSigner() {
1383
+ this.isMulti = true
1384
+ this.selectAddSignerUser = true
1385
+ },
1386
+ // 选择了加签用户后,执行加签接口
1387
+ doAddSigner(
1388
+ selectNodeInfo,
1389
+ myJsContent,
1390
+ system,
1391
+ entityName,
1392
+ beanName,
1393
+ dataId,
1394
+ model,
1395
+ successOperation,
1396
+ isNeedValueMapping
1397
+ ) {
1398
+ if (selectNodeInfo) {
1399
+ let path
1400
+ if (system.standard === false) {
1401
+ // 表示是自定义系统
1402
+ path = this.getBaseUrl(system) + '/dsc/workflow-commons/add-signers'
1403
+ }
1404
+ path = this.getRealRestApiPath(path, system)
1405
+ if (!path) {
1406
+ this.$message({
1407
+ showClose: true,
1408
+ type: 'warning',
1409
+ message: this.$t('superPageMessage.requestPathEmpty'),
1410
+ })
1411
+ return
1412
+ }
1413
+ const requestParams = {
1414
+ entityName,
1415
+ beanName,
1416
+ id: dataId,
1417
+ entity: model,
1418
+ additionalParamMap: this.additionalParamMap,
1419
+ tableName: this.tableName,
1420
+ functionCode: this.permissionPrefix + '.xxx',
1421
+ isWorkflowEntity: true,
1422
+ }
1423
+ requestParams.completeTaskParam = {
1424
+ taskId: this.completeTaskParam.taskId,
1425
+ transactors: selectNodeInfo.loginNames.join(',').split(','),
1426
+ systemCode: system.code,
1427
+ }
1428
+ let request
1429
+ if (myJsContent) {
1430
+ // 将js文本转换为函数,并运行
1431
+ // eslint-disable-next-line no-eval
1432
+ const buttonFun = eval('(' + myJsContent + ')')
1433
+ // 运行方法
1434
+ request = buttonFun(this, requestParams)
1435
+ } else {
1436
+ request = this.$http.post(path, requestParams)
1437
+ }
1438
+ if (request) {
1439
+ request.then((formParam) => {
1440
+ this.$message({
1441
+ showClose: true,
1442
+ type: 'success',
1443
+ message: this.$t('superPageMessage.successfulOperation'),
1444
+ })
1445
+ // 重新给表单赋值,可以连续保存
1446
+ if (formParam.entity) {
1447
+ this.formData = formParam.entity
1448
+ this.afterSuccessOperateInForm(
1449
+ successOperation,
1450
+ this.formData,
1451
+ isNeedValueMapping,
1452
+ true
1453
+ )
1454
+ }
1455
+ // 执行afterClick回调方法
1456
+ this.callAfterClickButton(
1457
+ this.formEvents,
1458
+ this.formViewCode + '__addSigner',
1459
+ {
1460
+ params: this.additionalParamMap,
1461
+ additionalParamMap: this.additionalParamMap,
1462
+ entity: this.formData,
1463
+ }
1464
+ )
1465
+ this.selectAddSignerUser = false
1466
+ })
1467
+ }
1468
+ } else {
1469
+ this.selectAddSignerUser = false
1470
+ }
1471
+ },
1472
+ // 点击生成抄送任务后,弹出组织结构树
1473
+ createCopyTask() {
1474
+ this.isMulti = true
1475
+ this.selectCopyUser = true
1476
+ },
1477
+ // 选择了生成抄送任务的用户后,执行生成抄送任务接口
1478
+ doCreateCopyTask(selectNodeInfo, myJsContent, system, entityName, beanName) {
1479
+ if (selectNodeInfo) {
1480
+ let path
1481
+ if (system.standard === false) {
1482
+ // 表示是自定义系统
1483
+ path = this.getBaseUrl(system) + '/dsc/workflow-commons/copies'
1484
+ }
1485
+ path = this.getRealRestApiPath(path, system)
1486
+ if (!path) {
1487
+ this.$message({
1488
+ showClose: true,
1489
+ type: 'warning',
1490
+ message: this.$t('superPageMessage.requestPathEmpty'),
1491
+ })
1492
+ return
1493
+ }
1494
+ const requestParams = {
1495
+ entityName,
1496
+ beanName,
1497
+ additionalParamMap: this.additionalParamMap,
1498
+ tableName: this.tableName,
1499
+ functionCode: this.permissionPrefix + '.xxx',
1500
+ isWorkflowEntity: true,
1501
+ }
1502
+ requestParams.completeTaskParam = {
1503
+ taskId: this.completeTaskParam.taskId,
1504
+ transactors: selectNodeInfo.userIds.join(',').split(','),
1505
+ systemCode: system.code,
1506
+ }
1507
+ let request
1508
+ if (myJsContent) {
1509
+ // 将js文本转换为函数,并运行
1510
+ // eslint-disable-next-line no-eval
1511
+ const buttonFun = eval('(' + myJsContent + ')')
1512
+ // 运行方法
1513
+ request = buttonFun(this, requestParams)
1514
+ } else {
1515
+ request = this.$http.post(path, requestParams)
1516
+ }
1517
+ if (request) {
1518
+ request.then(() => {
1519
+ this.$message({
1520
+ showClose: true,
1521
+ type: 'success',
1522
+ message: this.$t('superPageMessage.successfulOperation'),
1523
+ })
1524
+ // 执行afterClick回调方法
1525
+ this.callAfterClickButton(
1526
+ this.formEvents,
1527
+ this.formViewCode + '__createCopyTask',
1528
+ {
1529
+ params: this.additionalParamMap,
1530
+ additionalParamMap: this.additionalParamMap,
1531
+ entity: this.formData,
1532
+ }
1533
+ )
1534
+ this.selectCopyUser = false
1535
+ })
1536
+ }
1537
+ } else {
1538
+ this.selectCopyUser = false
1539
+ }
1540
+ },
1541
+ // 点击减签按钮,显示减签文本框
1542
+ removeSigner(system, entityName, entity, logSettingText, beanName) {
1543
+ let path
1544
+ const param = {}
1545
+ if (system.standard === false) {
1546
+ // 表示是自定义系统
1547
+ path =
1548
+ this.getBaseUrl(system) + '/dsc/workflow-commons/get-remove-signers'
1549
+ if (logSettingText && logSettingText !== '') {
1550
+ param.logSettingText = logSettingText
1551
+ }
1552
+ param.entityName = entityName
1553
+ param.beanName = beanName
1554
+ param.systemCode = system.code
1555
+ param.entity = entity
1556
+ param.additionalParamMap = this.additionalParamMap
1557
+ param.tableName = this.tableName
1558
+ param.functionCode = this.permissionPrefix + '.xxx'
1559
+ } else if (entity.workflowInfo) {
1560
+ param.entity = entity
1561
+ }
1562
+ param.isWorkflowEntity = true
1563
+ path = this.getRealRestApiPath(path, system)
1564
+ if (!path) {
1565
+ this.$message({
1566
+ showClose: true,
1567
+ type: 'warning',
1568
+ message: this.$t('superPageMessage.requestPathEmpty'),
1569
+ })
1570
+ return
1571
+ }
1572
+ this.$http.post(path, param).then((activeTasks) => {
1573
+ this.activeTasks = activeTasks
1574
+ this.showRemoveSigner = true
1575
+ })
1576
+ },
1577
+ // 确定关闭选择减签任务弹框处理
1578
+ doRemoveSigners(
1579
+ selectRemoveTasks,
1580
+ myJsContent,
1581
+ system,
1582
+ entityName,
1583
+ beanName
1584
+ ) {
1585
+ if (selectRemoveTasks) {
1586
+ let path
1587
+ if (system.standard === false) {
1588
+ // 表示是自定义系统
1589
+ path = this.getBaseUrl(system) + '/dsc/workflow-commons/remove-signers'
1590
+ }
1591
+ path = this.getRealRestApiPath(path, system)
1592
+ if (!path) {
1593
+ this.$message({
1594
+ showClose: true,
1595
+ type: 'warning',
1596
+ message: this.$t('superPageMessage.requestPathEmpty'),
1597
+ })
1598
+ return
1599
+ }
1600
+ const taskIds = selectRemoveTasks.map((task) =>
1601
+ task.id ? task.id : task.ID ? task.ID : null
1602
+ )
1603
+ let request
1604
+ if (myJsContent) {
1605
+ // 将js文本转换为函数,并运行
1606
+ const param = {
1607
+ taskIds,
1608
+ entityName,
1609
+ beanName,
1610
+ systemCode: system.code,
1611
+ additionalParamMap: this.additionalParamMap,
1612
+ tableName: this.tableName,
1613
+ functionCode: this.permissionPrefix + '.xxx',
1614
+ }
1615
+ // eslint-disable-next-line no-eval
1616
+ const buttonFun = eval('(' + myJsContent + ')')
1617
+ // 运行方法
1618
+ request = buttonFun(this, param)
1619
+ } else {
1620
+ const requestParams = {
1621
+ entityName,
1622
+ beanName,
1623
+ ids: taskIds,
1624
+ systemCode: system.code,
1625
+ additionalParamMap: this.additionalParamMap,
1626
+ tableName: this.tableName,
1627
+ functionCode: this.permissionPrefix + '.xxx',
1628
+ }
1629
+ request = this.$http.post(path, requestParams)
1630
+ }
1631
+ if (request) {
1632
+ request.then(() => {
1633
+ this.$message({
1634
+ showClose: true,
1635
+ type: 'success',
1636
+ message: this.$t('superPageMessage.successfulOperation'),
1637
+ })
1638
+ // 执行afterClick回调方法
1639
+ this.callAfterClickButton(
1640
+ this.formEvents,
1641
+ this.formViewCode + '__removeSigner',
1642
+ {
1643
+ params: this.additionalParamMap,
1644
+ additionalParamMap: this.additionalParamMap,
1645
+ entity: this.formData,
1646
+ }
1647
+ )
1648
+ this.showRemoveSigner = false
1649
+ })
1650
+ }
1651
+ } else {
1652
+ this.showRemoveSigner = false
1653
+ }
1654
+ },
1655
+ // 显示指派用户人员树
1656
+ assignTask() {
1657
+ this.isMulti = false
1658
+ this.selectAssignUser = true
1659
+ },
1660
+ updateValues(sourceModel, sourceTableName) {
1661
+ // 更新数据
1662
+ updateWithPageValue(
1663
+ sourceModel,
1664
+ sourceTableName,
1665
+ this.jumpPageSetting,
1666
+ this.formData,
1667
+ this.tableName
1668
+ )
1669
+ let updateValueEventName =
1670
+ this.jumpPageSetting && this.jumpPageSetting.updateValueEvent
1671
+ ? this.jumpPageSetting.updateValueEvent
1672
+ : null
1673
+ if (
1674
+ this.customEvents &&
1675
+ updateValueEventName &&
1676
+ updateValueEventName !== null &&
1677
+ this.customEvents[updateValueEventName]
1678
+ ) {
1679
+ this.customEvents[updateValueEventName].call(this, {
1680
+ sourceModel,
1681
+ sourceTableName,
1682
+ jumpPageSetting: this.jumpPageSetting,
1683
+ entity: this.formData,
1684
+ targetTableName: this.tableName,
1685
+ })
1686
+ }
1687
+ // 更新表单编辑器的表单数据
1688
+ this.updateFormData(this.formData)
1689
+ },
1690
+ // 下载模板
1691
+ downloadTemplate(system, button, tableName) {
1692
+ let templateUUID
1693
+ let templateShowPath
1694
+ if (button.templateFiles && button.templateFiles.length > 0) {
1695
+ const templateFilesResult = packageTemplateFiles(button.templateFiles)
1696
+ templateUUID = templateFilesResult[0].templateUUID
1697
+ templateShowPath = templateFilesResult[0].templateShowPath
1698
+ } else {
1699
+ templateUUID = button.templateUUID
1700
+ templateShowPath = button.templateShowPath
1701
+ }
1702
+ let param = '?1=1'
1703
+ if (button && button.functionCode) {
1704
+ param += '&functionCode=' + button.functionCode
1705
+ }
1706
+ if (tableName) {
1707
+ param += '&tableName=' + tableName
1708
+ }
1709
+ // filePath格式如:用户定义的文件名~~服务器上磁盘中存储的文件路径及文件名。例如:user-info.xls~~iMatrix/b03dr45f5h4g.xls
1710
+ // let fileShowName = ''
1711
+ if (
1712
+ templateUUID &&
1713
+ templateShowPath &&
1714
+ templateUUID !== 'undefined' &&
1715
+ templateShowPath !== 'undefined' &&
1716
+ templateUUID !== 'null' &&
1717
+ templateShowPath !== 'null'
1718
+ ) {
1719
+ param +=
1720
+ '&fileName=' +
1721
+ encodeURI(templateUUID) +
1722
+ '&showName=' +
1723
+ encodeURI(templateShowPath)
1724
+ }
1725
+ const baseUrl = this.getBaseUrl(system)
1726
+ window.open(baseUrl + '/dsc/commons/download-files' + param)
1727
+ },
1728
+ }
1729
+ export default buttonEvents