super-pages 0.0.6-up → 0.0.8-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/lib/super-pages.js +1 -1
  2. package/lib/super-pages.umd.cjs +1 -1
  3. package/package.json +12 -2
  4. package/index.html +0 -13
  5. package/packages/index.js +0 -30
  6. package/packages/super-page/index.js +0 -9
  7. package/packages/super-page/src/button-group.vue +0 -294
  8. package/packages/super-page/src/chart-page.vue +0 -215
  9. package/packages/super-page/src/chart-query-page.vue +0 -163
  10. package/packages/super-page/src/common-form-page.vue +0 -594
  11. package/packages/super-page/src/export-form-report-dialog.vue +0 -145
  12. package/packages/super-page/src/form-head.vue +0 -74
  13. package/packages/super-page/src/form-page.vue +0 -107
  14. package/packages/super-page/src/group-tag.vue +0 -21
  15. package/packages/super-page/src/list-page.vue +0 -1453
  16. package/packages/super-page/src/list-toolbar-dynamic-source.vue +0 -89
  17. package/packages/super-page/src/list-toolbar-page.vue +0 -377
  18. package/packages/super-page/src/my-button-base.vue +0 -438
  19. package/packages/super-page/src/my-button.vue +0 -196
  20. package/packages/super-page/src/page-custom-component.vue +0 -56
  21. package/packages/super-page/src/remove-signer-dialog.vue +0 -103
  22. package/packages/super-page/src/sub-tab-page.vue +0 -79
  23. package/packages/super-page/src/super-page-component.vue +0 -86
  24. package/packages/super-page/src/super-page.vue +0 -162
  25. package/packages/super-page/src/tab-page.vue +0 -154
  26. package/packages/super-page/src/task-informition-dialog.vue +0 -82
  27. package/packages/super-page/src/util/ListButtonEvent.js +0 -896
  28. package/packages/super-page/src/util/api.js +0 -37
  29. package/packages/super-page/src/util/callEvents.js +0 -62
  30. package/packages/super-page/src/util/chartButtonEvent.js +0 -60
  31. package/packages/super-page/src/util/common-util.js +0 -102
  32. package/packages/super-page/src/util/commonButtonEvent.js +0 -70
  33. package/packages/super-page/src/util/eventBus.js +0 -8
  34. package/packages/super-page/src/util/formButtonEvent.js +0 -509
  35. package/packages/super-page/src/util/store.js +0 -3
  36. package/packages/super-page/src/util/super-page.js +0 -29
  37. package/packages/super-page/src/util/util.js +0 -1491
  38. package/packages/super-page/src/util/workflowButtonEvent.js +0 -1729
  39. package/packages/super-page/src/widget-col-page.vue +0 -339
  40. package/packages/super-page/src/widget-page.vue +0 -703
  41. package/packages/super-page/src/widget-sub-tab-pane-page.vue +0 -115
  42. package/packages/super-page/src/widget-tab-pane-page.vue +0 -135
  43. package/packages/super-page/src/workflow-button-group.vue +0 -561
  44. package/packages/super-page/src/workflow-form-page.vue +0 -1310
  45. package/packages/super-page-dialog/index.js +0 -9
  46. package/packages/super-page-dialog/src/super-page-dialog.vue +0 -200
  47. package/packages/utils/gogocodeTransfer.js +0 -59
  48. package/public/vite.svg +0 -1
  49. package/src/i18n/i18n.js +0 -16
  50. package/src/i18n/langs/cn.js +0 -65
  51. package/src/i18n/langs/en.js +0 -68
  52. package/src/styles/index.scss +0 -4
  53. package/src/utils/common-util.js +0 -9
  54. package/vite.config.js +0 -36
@@ -1,896 +0,0 @@
1
- import { $on, $off, $once, $emit } from '../../../utils/gogocodeTransfer'
2
- import { updateWithPageValue } from 'imatrix-ui/src/utils/jump-page-utils'
3
- import { getStoreInfo, packageTemplateFiles, setStoreInfo } from './common-util'
4
- const buttonEvents = {
5
- // 按钮组中各按钮的操作
6
- clickButton(
7
- button,
8
- system,
9
- listCode,
10
- ids,
11
- tableName,
12
- entityName,
13
- myJsContent,
14
- entities,
15
- deleteLogicSetting,
16
- formNoRuleCode,
17
- importRuleCode,
18
- beanName,
19
- isWorkflow,
20
- uuid
21
- ) {
22
- if (
23
- typeof button.isExtension !== 'undefined' &&
24
- button.isExtension === true
25
- ) {
26
- // 表示是扩展按钮
27
- const param = {
28
- listCode,
29
- ids,
30
- tableName,
31
- entityName,
32
- beanName,
33
- entities,
34
- listToolbarFormData: this.listToolbarFormData,
35
- }
36
- const judgeFlag = this.judgeDataNumber(button, ids, false)
37
- if (!judgeFlag) {
38
- return
39
- }
40
- if (this.judgeHeavyList) {
41
- // 判重组合字段配置
42
- param.judgeHeavyList = JSON.stringify(this.judgeHeavyList)
43
- }
44
- if (button.autoSetValueData) {
45
- param.autoSetValueData = JSON.stringify(button.autoSetValueData)
46
- }
47
- if (button.logSetting) {
48
- param.logSettingText = button.logSetting
49
- }
50
- if (button.taskMap) {
51
- param.taskMap = button.taskMap
52
- }
53
- if (!param.systemCode) {
54
- param.systemCode = system.code
55
- }
56
- if (formNoRuleCode) {
57
- param.formNoRuleCode = formNoRuleCode
58
- }
59
- if (importRuleCode) {
60
- param.importRuleCode = importRuleCode
61
- }
62
- if (this.additionalParamMap) {
63
- param.additionalParamMap = this.additionalParamMap
64
- }
65
- if (button.jumpPage) {
66
- let entity
67
- let dataId
68
- if (ids && ids.length > 0) {
69
- dataId = ids[0]
70
- }
71
- if (entities && entities.length > 0) {
72
- entity = entities[0]
73
- }
74
- this.jumpToPage(
75
- button.jumpPage,
76
- system,
77
- dataId,
78
- entity,
79
- this.additionalParamMap,
80
- ids,
81
- button.code,
82
- this.pageCode
83
- )
84
- return
85
- }
86
- if (myJsContent && myJsContent !== null && myJsContent !== '') {
87
- // 将js文本转换为函数,并运行
88
- // eslint-disable-next-line no-eval
89
- const buttonFun = eval('(' + myJsContent + ')')
90
- // 运行方法
91
- const request = buttonFun(this, param)
92
- if (request) {
93
- request.then((data) => {
94
- // 刷新列表组件
95
- this.refreshMyList(
96
- button.successOperation,
97
- button.isNeedValueMapping,
98
- entities
99
- )
100
- this.$message({
101
- showClose: true,
102
- type: 'success',
103
- message: this.$t('superPageMessage.successfulOperation'),
104
- })
105
- // afterClick回调方法
106
- this.callAfterClickButton(
107
- this.listEvents,
108
- this.listCode + '__' + button.code,
109
- {
110
- params: this.additionalParamMap,
111
- additionalParamMap: this.additionalParamMap,
112
- entity: entities,
113
- }
114
- )
115
- })
116
- }
117
- } else if (
118
- button &&
119
- button.isNeedValueMapping !== undefined &&
120
- button.isNeedValueMapping === true
121
- ) {
122
- // 自定义按钮需要回填值时,默认的成功后操作是关闭弹框
123
- let successOperation
124
- if (button.successOperation) {
125
- successOperation = button.successOperation
126
- }
127
- if (!successOperation) {
128
- // 默认是关闭弹框
129
- successOperation = 'closeWindow'
130
- }
131
- this.refreshMyList(successOperation, true, entities)
132
- } else {
133
- let successOperation
134
- if (button.successOperation) {
135
- successOperation = button.successOperation
136
- }
137
- if (!successOperation) {
138
- // 默认是关闭弹框
139
- successOperation = 'closeWindow'
140
- }
141
- this.refreshMyList(successOperation, false, entities)
142
- }
143
- } else {
144
- // 表示是标准按钮
145
- if (button.code === 'refresh') {
146
- this.refreshMyList(
147
- button.successOperation,
148
- button.isNeedValueMapping,
149
- entities
150
- )
151
- } else if (button.code === 'create') {
152
- this.create(button.jumpPage, system, button, entities)
153
- } else if (button.code === 'update') {
154
- const judgeFlag = this.judgeDataNumber(button, ids, true)
155
- if (!judgeFlag) {
156
- return
157
- }
158
- // 列表-修改按钮 或 行编辑的修改按钮 或 查看详情按钮
159
- let dataId
160
- let entity
161
- if (ids && ids.length === 1) {
162
- dataId = ids[0]
163
- }
164
- if (entities && entities.length > 0) {
165
- entity = entities[0]
166
- }
167
- this.update(button.jumpPage, system, dataId, button, ids, entity)
168
- } else if (button.code === 'delete') {
169
- // 列表-删除按钮 或 行编辑的删除按钮
170
- if (!ids || ids.length === 0) {
171
- this.$message({
172
- showClose: true,
173
- type: 'warning',
174
- message: this.$t('superPageMessage.pleaseSelectRecord'),
175
- })
176
- return
177
- }
178
- this.delete(
179
- ids,
180
- system,
181
- button.restfulApiPath,
182
- tableName,
183
- entityName,
184
- myJsContent,
185
- button,
186
- deleteLogicSetting,
187
- entities,
188
- beanName,
189
- isWorkflow
190
- )
191
- } else if (button.code === 'downloadTemplate') {
192
- let templateUUID
193
- let templateShowPath
194
- if (button.templateFiles && button.templateFiles.length > 0) {
195
- const templateFilesResult = packageTemplateFiles(button.templateFiles)
196
- templateUUID = templateFilesResult[0].templateUUID
197
- templateShowPath = templateFilesResult[0].templateShowPath
198
- } else {
199
- templateUUID = button.templateUUID
200
- templateShowPath = button.templateShowPath
201
- }
202
- this.downloadTemplate(
203
- templateUUID,
204
- templateShowPath,
205
- tableName,
206
- importRuleCode,
207
- system,
208
- button.logSetting,
209
- listCode,
210
- entityName,
211
- beanName,
212
- button
213
- )
214
- } else if (button.code === 'export') {
215
- // 是否异步
216
- let isAsync = false
217
- if (button.hasOwnProperty('isAsync')) {
218
- isAsync = button.isAsync
219
- } else {
220
- isAsync = false
221
- }
222
- // 页面编码 this.pageCode
223
- this.export(listCode, button.functionCode, uuid, isAsync, this.pageCode)
224
- } else if (button.code === 'viewDetail') {
225
- // 查看详情
226
- let dataId
227
- if (ids && ids.length === 1) {
228
- dataId = ids[0]
229
- }
230
- if (!dataId) {
231
- this.$message({
232
- showClose: true,
233
- type: 'warning',
234
- message: this.$t('superPageMessage.pleaseSelectRecord'),
235
- })
236
- return
237
- }
238
- this.viewDetail(button.jumpPage, system, dataId, button, null)
239
- } else if (
240
- button.code === 'submit' ||
241
- button.code === 'agree' ||
242
- button.code === 'disagree'
243
- ) {
244
- // 提交 || 同意 || 不同意
245
- if (!ids || ids.length === 0) {
246
- this.$message({
247
- showClose: true,
248
- type: 'warning',
249
- message: this.$t('superPageMessage.pleaseSelectRecord'),
250
- })
251
- return
252
- }
253
- this.submitGrid(
254
- ids,
255
- system,
256
- button.restfulApiPath,
257
- tableName,
258
- entityName,
259
- myJsContent,
260
- button,
261
- formNoRuleCode,
262
- button.code,
263
- entities && entities.length > 0 ? entities[0] : null,
264
- this.additionalParamMap,
265
- entities,
266
- beanName,
267
- isWorkflow
268
- )
269
- }
270
- }
271
- },
272
- judgeDataNumber(button, ids, isDefaultOne) {
273
- if (button.conditionsForExecution && button.conditionsForExecution !== '') {
274
- if (button.conditionsForExecution === 'one') {
275
- if (!ids || ids.length !== 1) {
276
- // 提示有问题
277
- this.$message({
278
- showClose: true,
279
- type: 'warning',
280
- message: this.$t('superPageMessage.thePreconditionOfTheButtonTo', {
281
- message: this.$t('superPageMessage.onlyOneRecordCanBeselected'),
282
- }),
283
- })
284
- return false
285
- }
286
- } else if (button.conditionsForExecution === 'more') {
287
- if (!ids || ids.length <= 0) {
288
- // 提示有问题
289
- this.$message({
290
- showClose: true,
291
- type: 'warning',
292
- message: this.$t('superPageMessage.thePreconditionOfTheButtonTo', {
293
- message: this.$t('superPageMessage.selectAtLeastOneRecord'),
294
- }),
295
- })
296
- return false
297
- }
298
- }
299
- } else if (isDefaultOne !== undefined && isDefaultOne === true) {
300
- // 没有设置执行前,默认是必选一条。
301
- if (!ids || ids.length !== 1) {
302
- this.$message({
303
- showClose: true,
304
- type: 'warning',
305
- message: this.$t('superPageMessage.pleaseSelectRecord'),
306
- })
307
- return false
308
- }
309
- }
310
- return true
311
- },
312
- refreshMyList(successOperation, isNeedValueMapping, row) {
313
- if (!successOperation) {
314
- successOperation = 'refresh'
315
- }
316
- console.log('refreshMyList--')
317
- // this.$emit('update-value', { name: '111', type: '类型1' }, this.tableName)
318
- if (successOperation === 'refresh') {
319
- // 刷新列表
320
- this.$refs.grid.refresh()
321
- } else if (
322
- successOperation === 'closeWindow' ||
323
- successOperation === 'closeWindowAndRefresh'
324
- ) {
325
- // 关闭弹框Dialog
326
- if (
327
- isNeedValueMapping !== undefined &&
328
- isNeedValueMapping === true &&
329
- row &&
330
- row !== undefined
331
- ) {
332
- // 如果需要回填值,将事件抛出,让父页面捕获,直到弹框页面捕获
333
- const jumpInfo = sessionStorage.getItem(this.pageCode + '-jumpMode')
334
- console.log('---update-value-closePage---jumpInfo=', jumpInfo)
335
- let rowIndex
336
- if (jumpInfo) {
337
- const jumpInfoObj = JSON.parse(jumpInfo)
338
- // 该弹框页面的父页面是列表组件的某记录时,用于回填列表记录值使用
339
- rowIndex = jumpInfoObj.rowIndex
340
- }
341
- $emit(this, 'update-value', row, this.tableName, rowIndex)
342
- }
343
- this.closePage(this.pageCode, successOperation)
344
- }
345
- },
346
- // 列表-新建
347
- create(jumpPage, system, button, entities) {
348
- console.log('create-------this.pageCode=', this.pageCode)
349
- this.jumpToPage(
350
- jumpPage,
351
- system,
352
- null,
353
- entities && entities.length > 0 ? entities[0] : null,
354
- this.additionalParamMap,
355
- null,
356
- button.code,
357
- this.pageCode
358
- )
359
- },
360
- // 列表-修改
361
- update(jumpPage, system, dataId, button, ids, entity) {
362
- this.jumpToPage(
363
- jumpPage,
364
- system,
365
- dataId,
366
- entity,
367
- this.additionalParamMap,
368
- ids,
369
- button.code,
370
- this.pageCode
371
- )
372
- },
373
- // 查看详情
374
- viewDetail(jumpPage, system, dataId, button, row) {
375
- this.jumpToPage(
376
- jumpPage,
377
- system,
378
- dataId,
379
- row,
380
- this.additionalParamMap,
381
- null,
382
- button.code,
383
- this.pageCode
384
- )
385
- // // 控制当是修改按钮的弹框关闭时,刷新列表页面数据
386
- setStoreInfo(this.pageCode, 'openPageButton', 'viewDetail')
387
- },
388
- // 列表-删除
389
- delete(
390
- ids,
391
- system,
392
- restfulApiPath,
393
- tableName,
394
- entityName,
395
- myJsContent,
396
- button,
397
- deleteLogicSetting,
398
- entities,
399
- beanName,
400
- isWorkflowEntity
401
- ) {
402
- this.$confirm(
403
- this.$t('superPageMessage.whetherToConfirmDeletion'),
404
- this.$t('superPageMessage.tips'),
405
- {
406
- confirmButtonText: this.$t('superPageMessage.sure'),
407
- cancelButtonText: this.$t('superPageMessage.cancel'),
408
- type: 'warning',
409
- }
410
- )
411
- .then(() => {
412
- let path = restfulApiPath
413
- if (system.standard === false && !path) {
414
- // 自定义系统
415
- const baseUrl = this.getBaseUrl(system)
416
- path = baseUrl + '/dsc/commons/' + tableName
417
- }
418
- path = this.getRealRestApiPath(path, system)
419
- const param = {
420
- ids: ids,
421
- functionCode: button.functionCode,
422
- }
423
- if (entityName) {
424
- // 表示需要重写删除的实现
425
- param.entityName = entityName
426
- }
427
- if (beanName) {
428
- // 表示需要重写删除的实现
429
- param.beanName = beanName
430
- }
431
- if (deleteLogicSetting) {
432
- param.deleteLogicSetting = JSON.stringify(deleteLogicSetting)
433
- }
434
- if (button.logSetting) {
435
- param.logSettingText = button.logSetting
436
- }
437
- if (button.isSafeDelete) {
438
- param.isSafeDelete = button.isSafeDelete
439
- }
440
- if (button.taskMap) {
441
- param.taskMap = button.taskMap
442
- }
443
- if (!param.systemCode) {
444
- param.systemCode = system.code
445
- }
446
- param.isWorkflowEntity = isWorkflowEntity
447
- let request
448
- if (myJsContent) {
449
- // 将js文本转换为函数,并运行
450
- // eslint-disable-next-line no-eval
451
- const buttonFun = eval('(' + myJsContent + ')')
452
- // 运行方法
453
- request = buttonFun(this, param)
454
- } else {
455
- request = this.$http.delete(path, {
456
- data: param,
457
- })
458
- }
459
- if (request) {
460
- // button.loading = true
461
- request
462
- .then((data) => {
463
- this.$refs.grid.isDeleteChange(true)
464
- // 刷新列表组件
465
- this.refreshMyList(button.successOperation)
466
- this.$message({
467
- showClose: true,
468
- type: 'success',
469
- message: this.$t('superPageMessage.successfulDelete'),
470
- })
471
- // afterClick回调方法
472
- this.callAfterClickButton(
473
- this.listEvents,
474
- this.listCode + '__' + button.code,
475
- {
476
- params: this.additionalParamMap,
477
- additionalParamMap: this.additionalParamMap,
478
- entity: this.selections,
479
- }
480
- )
481
- this.selections = []
482
- // button.loading = false
483
- })
484
- .catch((e) => {
485
- // 注释原因:抛出BusinessException时,删除按钮的loading状态不会清除
486
- // button.loading = false
487
- })
488
- }
489
- })
490
- .catch(() => {})
491
- },
492
- // 下载模板
493
- downloadTemplate(
494
- templateUUID,
495
- showName,
496
- tableName,
497
- importRuleCode,
498
- system,
499
- logSettingText,
500
- listCode,
501
- entityName,
502
- beanName,
503
- button
504
- ) {
505
- // filePath格式如:用户定义的文件名~~服务器上磁盘中存储的文件路径及文件名。例如:user-info.xls~~iMatrix/b03dr45f5h4g.xls
506
- // let fileShowName = ''
507
- if (!showName && button.templateI18nLable) {
508
- showName = button.templateI18nLable
509
- }
510
- let param = '?1=1'
511
- if (
512
- templateUUID &&
513
- showName &&
514
- templateUUID !== 'undefined' &&
515
- showName !== 'undefined' &&
516
- templateUUID !== 'null' &&
517
- showName !== 'null'
518
- ) {
519
- param +=
520
- '&fileName=' +
521
- encodeURI(templateUUID) +
522
- '&showName=' +
523
- encodeURI(showName)
524
- } else if (showName) {
525
- param += '&showName=' + encodeURI(showName)
526
- }
527
- if (logSettingText && logSettingText !== '') {
528
- param += '&logSettingText=' + logSettingText
529
- }
530
- if (system && system.code) {
531
- param += '&systemCode=' + system.code
532
- }
533
- if (importRuleCode) {
534
- param += '&importCode=' + importRuleCode
535
- // fileShowName = importRuleCode
536
- }
537
- if (listCode) {
538
- param += '&listCode=' + listCode
539
- // fileShowName = listCode
540
- }
541
- if (entityName) {
542
- param += '&entityName=' + entityName
543
- }
544
- if (beanName) {
545
- param += '&beanName=' + beanName
546
- }
547
- if (button && button.functionCode) {
548
- param += '&functionCode=' + button.functionCode
549
- }
550
- if (tableName) {
551
- param += '&tableName=' + tableName
552
- }
553
- const baseUrl = this.getBaseUrl(system)
554
- window.open(baseUrl + '/dsc/commons/download-files' + param)
555
- },
556
- doImportFinally(
557
- system,
558
- restfulApiPath,
559
- tableName,
560
- entityName,
561
- myJsContent,
562
- button,
563
- listViewImportDuplicate,
564
- fileObj,
565
- judgeHeavyList,
566
- formNoRuleCode,
567
- importRuleCode,
568
- listCode,
569
- beanName,
570
- pageCode,
571
- importBeanName
572
- ) {
573
- const param = new FormData()
574
- param.append('multipartFile', fileObj)
575
- if (tableName) {
576
- param.append('tableName', tableName)
577
- }
578
- if (entityName) {
579
- // 表示需要重写导入的实现
580
- param.append('entityName', entityName)
581
- }
582
- if (importBeanName) {
583
- // 表示导入业务处理类
584
- param.append('importBeanName', importBeanName)
585
- }
586
- if (beanName) {
587
- // 后台业务处理类配置
588
- param.append('beanName', beanName)
589
- }
590
- if (listViewImportDuplicate) {
591
- // 导入重复规则
592
- // update(更新)/skip(跳过)/termination(中止导入)
593
- param.append('importDuplicateRule', listViewImportDuplicate)
594
- }
595
- if (judgeHeavyList) {
596
- // 判重组合字段配置
597
- param.append('judgeHeavyList', JSON.stringify(judgeHeavyList))
598
- }
599
- if (formNoRuleCode) {
600
- // 表单编码规则
601
- param.append('formNoRuleCode', formNoRuleCode)
602
- }
603
- if (importRuleCode) {
604
- // 导入规则编码
605
- param.append('importRuleCode', importRuleCode)
606
- }
607
- if (listCode) {
608
- // 列表编码
609
- param.append('listCode', listCode)
610
- }
611
- let isAsync = false
612
- if (button.hasOwnProperty('isAsync')) {
613
- // 是否异步
614
- isAsync = button.isAsync
615
- } else {
616
- isAsync = false
617
- }
618
- param.append('isAsync', isAsync)
619
- // 页面编码
620
- param.append('pageCode', pageCode)
621
- const isWorkflowEntity = getStoreInfo(
622
- this.pageCode,
623
- tableName + '_isProcess'
624
- )
625
- if (isWorkflowEntity !== null && isWorkflowEntity !== undefined) {
626
- param.append('isWorkflowEntity', isWorkflowEntity)
627
- }
628
- if (button.functionCode) {
629
- param.append('functionCode', button.functionCode)
630
- }
631
- if (this.additionalParamMap) {
632
- // 将工具栏解析
633
- if (
634
- this.listToolbarFormData !== undefined &&
635
- this.listToolbarFormData !== {} &&
636
- this.listToolbarFormData !== null
637
- ) {
638
- for (const key in this.listToolbarFormData) {
639
- this.additionalParamMap[key] = this.listToolbarFormData[key]
640
- }
641
- }
642
- // 必须转成字符串,无法传对象到后台
643
- param.append(
644
- 'additionalParamMapStr',
645
- JSON.stringify(this.additionalParamMap)
646
- )
647
- }
648
-
649
- let path = restfulApiPath
650
- if (system.standard === false && !path) {
651
- // 表示是自定义系统
652
- const baseUrl = this.getBaseUrl(system)
653
- path = baseUrl + '/dsc/commons/import-data'
654
- }
655
- path = this.getRealRestApiPath(path, system)
656
- let request
657
- if (myJsContent) {
658
- // 将js文本转换为函数,并运行
659
- // eslint-disable-next-line no-eval
660
- const buttonFun = eval('(' + myJsContent + ')')
661
- // 运行方法
662
- request = buttonFun(this, param)
663
- } else {
664
- request = this.$http.post(path, param)
665
- }
666
- if (request) {
667
- button.importing = true
668
- request
669
- .then((data) => {
670
- if (isAsync) {
671
- this.$message({
672
- showClose: true,
673
- type: 'success',
674
- message: this.$t('superPageMessage.asyncImport'),
675
- })
676
- } else {
677
- let isSuccess = false
678
- if (data) {
679
- isSuccess = false
680
- this.$message({
681
- dangerouslyUseHTMLString: true,
682
- showClose: true,
683
- type: 'warning',
684
- message: data,
685
- })
686
- } else {
687
- // 刷新列表组件
688
- this.$message({
689
- showClose: true,
690
- type: 'success',
691
- message: this.$t('superPageMessage.successfulImport'),
692
- })
693
- isSuccess = true
694
- }
695
- this.refreshMyList(button.successOperation)
696
- // afterClick回调方法
697
- this.callAfterClickButton(
698
- this.listEvents,
699
- this.listCode + '__' + button.code,
700
- {
701
- params: this.additionalParamMap,
702
- additionalParamMap: this.additionalParamMap,
703
- result: isSuccess,
704
- }
705
- )
706
- }
707
- button.importing = false
708
- })
709
- .catch((error) => {
710
- button.importing = false
711
- console.log('error==', error)
712
- })
713
- }
714
- },
715
- // 列表-导出。导出台账数据,有查询条件则导出查询条件对应的数据,没有查询条件则导出所有记录
716
- export(listCode, functionCode, uuid, isAsync, pageCode) {
717
- const dataParam = {}
718
- if (this.selections && this.selections.length > 0) {
719
- dataParam.data = this.selections
720
- }
721
- let exportFileName
722
- let pageName = getStoreInfo(this.pageCode, '_pageNameI18n')
723
- if (!pageName) {
724
- pageName = getStoreInfo(this.pageCode, '_pageName')
725
- }
726
- if (!pageName) {
727
- pageName = this.pageCode
728
- }
729
- exportFileName = pageName
730
- this.$exportDataNew(
731
- dataParam,
732
- exportFileName,
733
- listCode,
734
- functionCode,
735
- uuid,
736
- null,
737
- isAsync,
738
- pageCode
739
- )
740
- // afterClick回调方法
741
- this.callAfterClickButton(this.listEvents, this.listCode + '__export', {
742
- params: this.additionalParamMap,
743
- additionalParamMap: this.additionalParamMap,
744
- })
745
- },
746
- // 列表-提交/同意/不同意
747
- submitGrid(
748
- ids,
749
- system,
750
- restfulApiPath,
751
- tableName,
752
- entityName,
753
- myJsContent,
754
- button,
755
- formNoRuleCode,
756
- buttonCode,
757
- entity,
758
- additionalParamMap,
759
- entities,
760
- beanName,
761
- isWorkflow
762
- ) {
763
- const operationI18nTip =
764
- 'superPageMessage.whetherToConfirm' + this.upperFirstCase(buttonCode)
765
- this.$confirm(
766
- this.$t(operationI18nTip, { name: button.label }),
767
- this.$t('superPageMessage.tips'),
768
- {
769
- confirmButtonText: this.$t('superPageMessage.sure'),
770
- cancelButtonText: this.$t('superPageMessage.cancel'),
771
- type: 'warning',
772
- }
773
- )
774
- .then(() => {
775
- const param = {
776
- ids: ids,
777
- formNoRuleCode,
778
- tableName: tableName,
779
- functionCode: button.functionCode,
780
- }
781
- if (this.judgeHeavyList) {
782
- // 判重组合字段配置
783
- param.judgeHeavyList = JSON.stringify(this.judgeHeavyList)
784
- }
785
- if (button.dataConversionRule) {
786
- param.dataConversionRule = button.dataConversionRule.join(',')
787
- }
788
- if (button.autoSetValueData) {
789
- param.autoSetValueData = JSON.stringify(button.autoSetValueData)
790
- }
791
- if (button.logSetting) {
792
- param.logSettingText = button.logSetting
793
- }
794
- if (!param.systemCode) {
795
- param.systemCode = system.code
796
- }
797
- if (button.taskMap) {
798
- param.taskMap = button.taskMap
799
- }
800
- if (entityName) {
801
- // 表示需要重写后台保存的实现
802
- param.entityName = entityName
803
- }
804
- if (beanName) {
805
- // 表示需要重写后台保存的实现
806
- param.beanName = beanName
807
- }
808
- if (additionalParamMap) {
809
- param.additionalParamMap = additionalParamMap
810
- }
811
- param.isWorkflowEntity = isWorkflow
812
- let url
813
- if (button.code === 'submit') {
814
- url = '/dsc/commons/batch-submits'
815
- } else if (button.code === 'agree') {
816
- url = '/dsc/commons/batch-approves'
817
- } else if (button.code === 'disagree') {
818
- url = '/dsc/commons/batch-refuses'
819
- }
820
- const request = this.getSaveFormRequestByParam(
821
- system,
822
- restfulApiPath,
823
- param,
824
- myJsContent,
825
- url
826
- )
827
- if (request) {
828
- button.loading = true
829
- request
830
- .then((data) => {
831
- // 刷新列表组件
832
- this.refreshMyList(button.successOperation)
833
- this.$message({
834
- showClose: true,
835
- type: 'success',
836
- message: this.$t('superPageMessage.successfulOperation'),
837
- })
838
- // afterClick回调方法
839
- this.callAfterClickButton(
840
- this.listEvents,
841
- this.listCode + '__' + button.code,
842
- {
843
- params: this.additionalParamMap,
844
- additionalParamMap: this.additionalParamMap,
845
- }
846
- )
847
- button.loading = false
848
- })
849
- .catch((e) => {
850
- this.refreshMyList(button.successOperation)
851
- button.loading = false
852
- })
853
- }
854
- })
855
- .catch((error) => {
856
- console.log(error)
857
- })
858
- },
859
- // 获得字段类型集合
860
- getDataTypeMapRequest(system, tableName) {
861
- const baseUrl = this.getBaseUrl(system)
862
- return this.$http.get(
863
- baseUrl + '/dsc/commons/tables/' + tableName + '/data-types'
864
- )
865
- },
866
- updateValues(sourceModel, sourceTableName) {
867
- console.log('update-value66-', sourceModel, sourceTableName)
868
- // 更新数据
869
- updateWithPageValue(
870
- sourceModel,
871
- sourceTableName,
872
- this.jumpPageSetting,
873
- this.editRow,
874
- this.tableName
875
- )
876
- const updateValueEventName =
877
- this.jumpPageSetting && this.jumpPageSetting.updateValueEvent
878
- ? this.jumpPageSetting.updateValueEvent
879
- : null
880
- if (
881
- this.customEvents &&
882
- updateValueEventName &&
883
- updateValueEventName !== null &&
884
- this.customEvents[updateValueEventName]
885
- ) {
886
- this.customEvents[updateValueEventName].call(this, {
887
- sourceModel,
888
- sourceTableName,
889
- jumpPageSetting: this.jumpPageSetting,
890
- entity: this.editRow,
891
- targetTableName: this.tableName,
892
- })
893
- }
894
- },
895
- }
896
- export default buttonEvents