super-pages 0.0.1-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 (57) hide show
  1. package/README.md +7 -0
  2. package/index.html +13 -0
  3. package/lib/super-pages.css +1 -0
  4. package/lib/super-pages.js +16016 -0
  5. package/lib/super-pages.umd.cjs +35 -0
  6. package/lib/vite.svg +1 -0
  7. package/package.json +25 -0
  8. package/packages/index.js +30 -0
  9. package/packages/super-page/index.js +9 -0
  10. package/packages/super-page/src/button-group.vue +294 -0
  11. package/packages/super-page/src/chart-page.vue +215 -0
  12. package/packages/super-page/src/chart-query-page.vue +163 -0
  13. package/packages/super-page/src/common-form-page.vue +594 -0
  14. package/packages/super-page/src/export-form-report-dialog.vue +145 -0
  15. package/packages/super-page/src/form-head.vue +74 -0
  16. package/packages/super-page/src/form-page.vue +107 -0
  17. package/packages/super-page/src/group-tag.vue +21 -0
  18. package/packages/super-page/src/list-page.vue +1454 -0
  19. package/packages/super-page/src/list-toolbar-dynamic-source.vue +89 -0
  20. package/packages/super-page/src/list-toolbar-page.vue +377 -0
  21. package/packages/super-page/src/my-button-base.vue +438 -0
  22. package/packages/super-page/src/my-button.vue +196 -0
  23. package/packages/super-page/src/page-custom-component.vue +56 -0
  24. package/packages/super-page/src/remove-signer-dialog.vue +103 -0
  25. package/packages/super-page/src/sub-tab-page.vue +79 -0
  26. package/packages/super-page/src/super-page-component.vue +86 -0
  27. package/packages/super-page/src/super-page.vue +162 -0
  28. package/packages/super-page/src/tab-page.vue +154 -0
  29. package/packages/super-page/src/task-informition-dialog.vue +82 -0
  30. package/packages/super-page/src/util/ListButtonEvent.js +896 -0
  31. package/packages/super-page/src/util/api.js +37 -0
  32. package/packages/super-page/src/util/callEvents.js +62 -0
  33. package/packages/super-page/src/util/chartButtonEvent.js +60 -0
  34. package/packages/super-page/src/util/common-util.js +102 -0
  35. package/packages/super-page/src/util/commonButtonEvent.js +70 -0
  36. package/packages/super-page/src/util/eventBus.js +2 -0
  37. package/packages/super-page/src/util/formButtonEvent.js +509 -0
  38. package/packages/super-page/src/util/store.js +3 -0
  39. package/packages/super-page/src/util/super-page.js +29 -0
  40. package/packages/super-page/src/util/util.js +1489 -0
  41. package/packages/super-page/src/util/workflowButtonEvent.js +1729 -0
  42. package/packages/super-page/src/widget-col-page.vue +339 -0
  43. package/packages/super-page/src/widget-page.vue +703 -0
  44. package/packages/super-page/src/widget-sub-tab-pane-page.vue +115 -0
  45. package/packages/super-page/src/widget-tab-pane-page.vue +135 -0
  46. package/packages/super-page/src/workflow-button-group.vue +561 -0
  47. package/packages/super-page/src/workflow-form-page.vue +1310 -0
  48. package/packages/super-page-dialog/index.js +9 -0
  49. package/packages/super-page-dialog/src/super-page-dialog.vue +200 -0
  50. package/packages/utils/gogocodeTransfer.js +59 -0
  51. package/public/vite.svg +1 -0
  52. package/src/i18n/i18n.js +19 -0
  53. package/src/i18n/langs/cn.js +65 -0
  54. package/src/i18n/langs/en.js +68 -0
  55. package/src/styles/index.scss +4 -0
  56. package/src/utils/common-util.js +9 -0
  57. package/vite.config.js +36 -0
@@ -0,0 +1,509 @@
1
+ import { updateWithPageValue } from 'imatrix-ui/src/utils/jump-page-utils'
2
+ import { packageTemplateFiles } from './common-util'
3
+ const buttonEvents = {
4
+ // 按钮组中各按钮的操作
5
+ clickFormButton(
6
+ button,
7
+ system,
8
+ formCode,
9
+ formVersion,
10
+ tableName,
11
+ formData,
12
+ entityName,
13
+ myJsContent,
14
+ formNoRuleCode,
15
+ ids,
16
+ isBatchProcessing,
17
+ needDeleteFileUuidS,
18
+ additionalParamMap,
19
+ beanName
20
+ ) {
21
+ if (
22
+ typeof button.isExtension !== 'undefined' &&
23
+ button.isExtension === true
24
+ ) {
25
+ // 表示是扩展按钮
26
+ const param = {
27
+ entity: formData,
28
+ formViewCode: formCode,
29
+ formViewVersion: formVersion,
30
+ tableName: tableName,
31
+ formNoRuleCode,
32
+ entityName,
33
+ beanName,
34
+ }
35
+ if (this.judgeHeavyList) {
36
+ // 判重组合字段配置
37
+ param.judgeHeavyList = JSON.stringify(this.judgeHeavyList)
38
+ }
39
+ if (button.logSetting) {
40
+ // 判重组合字段配置
41
+ param.logSettingText = button.logSetting
42
+ }
43
+ if (button && button.taskMap) {
44
+ param.button = button.taskMap
45
+ }
46
+ if (!param.systemCode) {
47
+ param.systemCode = system.code
48
+ }
49
+ if (additionalParamMap) {
50
+ param.additionalParamMap = additionalParamMap
51
+ }
52
+ if (
53
+ button.successOperation &&
54
+ button.successOperation === 'noOperation'
55
+ ) {
56
+ // 如果是按钮操作后是“无操作”,则不控制version的值,否则会报“记录被其它事务修改”的异常
57
+ param.unControlVersion = true
58
+ }
59
+ if (myJsContent && myJsContent !== null && myJsContent !== '') {
60
+ // 将js文本转换为函数,并运行
61
+ // eslint-disable-next-line no-eval
62
+ const buttonFun = eval('(' + myJsContent + ')')
63
+ // 运行方法
64
+ const request = buttonFun(this, param)
65
+ if (request) {
66
+ request.then((data) => {
67
+ if (data) {
68
+ this.dealAfterSaveForm(
69
+ data,
70
+ system.standard,
71
+ 'superPageMessage.successfulOperation',
72
+ button.successOperation,
73
+ button.code,
74
+ button ? button.isNeedValueMapping : false
75
+ )
76
+ }
77
+ })
78
+ }
79
+ } else {
80
+ // 自定义按钮默认的成功后操作是关闭弹框
81
+ let successOperation
82
+ if (button.successOperation) {
83
+ successOperation = button.successOperation
84
+ }
85
+ if (!successOperation) {
86
+ // 默认是关闭弹框
87
+ successOperation = 'closeWindow'
88
+ }
89
+ this.afterSuccessOperateInForm(successOperation, formData, true, false)
90
+ }
91
+ } else {
92
+ if (button.code === 'saveForm') {
93
+ // 表单页面保存按钮操作(无流程)
94
+ this.saveForm(
95
+ system,
96
+ button,
97
+ formCode,
98
+ formVersion,
99
+ tableName,
100
+ formData,
101
+ entityName,
102
+ myJsContent,
103
+ formNoRuleCode,
104
+ needDeleteFileUuidS,
105
+ additionalParamMap,
106
+ beanName
107
+ )
108
+ } else if (button.code === 'exportForm') {
109
+ // 表单页面导出报告按钮操作
110
+ if (button.isPreviewFormReport) {
111
+ button.isPreviewFormReport = false
112
+ this.previewFormReport(
113
+ button.templateUUID,
114
+ button.templateShowPath,
115
+ myJsContent,
116
+ entityName,
117
+ system,
118
+ button.logSetting,
119
+ button.taskMap,
120
+ additionalParamMap,
121
+ false,
122
+ beanName,
123
+ this.permissionPrefix + '.createPreviewFile',
124
+ tableName
125
+ )
126
+ } else {
127
+ this.exportFormReport(
128
+ button.templateUUID,
129
+ button.templateShowPath,
130
+ myJsContent,
131
+ entityName,
132
+ system,
133
+ button.logSetting,
134
+ button.taskMap,
135
+ additionalParamMap,
136
+ false,
137
+ beanName,
138
+ button,
139
+ tableName
140
+ )
141
+ }
142
+ } else if (button.code === 'back') {
143
+ // 表单页面返回按钮操作
144
+ // util中关闭页面处理
145
+ this.closePage(this.pageCode, button.successOperation, formData)
146
+ } else if (
147
+ button.code === 'submit' ||
148
+ button.code === 'agree' ||
149
+ button.code === 'disagree'
150
+ ) {
151
+ // 表单页面中提交/同意/不同意
152
+ let url
153
+ if (button.code === 'submit') {
154
+ url = '/dsc/commons/submits'
155
+ } else if (button.code === 'agree') {
156
+ url = '/dsc/commons/approves'
157
+ } else if (button.code === 'disagree') {
158
+ url = '/dsc/commons/refuses'
159
+ }
160
+ this.submitForm(
161
+ formData,
162
+ system,
163
+ tableName,
164
+ entityName,
165
+ myJsContent,
166
+ button,
167
+ formNoRuleCode,
168
+ url,
169
+ ids,
170
+ isBatchProcessing,
171
+ needDeleteFileUuidS,
172
+ additionalParamMap,
173
+ beanName
174
+ )
175
+ }
176
+ }
177
+ },
178
+ saveForm(
179
+ system,
180
+ button,
181
+ formViewCode,
182
+ formViewVersion,
183
+ tableName,
184
+ formData,
185
+ entityName,
186
+ myJsContent,
187
+ formNoRuleCode,
188
+ needDeleteFileUuidS,
189
+ additionalParamMap,
190
+ beanName
191
+ ) {
192
+ // false表示控制version,true表示不控制version
193
+ let isUnControlVersion = false
194
+ if (button.successOperation && button.successOperation === 'noOperation') {
195
+ // 如果是按钮操作后是“无操作”,则不控制version的值,否则会报“记录被其它事务修改”的异常
196
+ isUnControlVersion = true
197
+ }
198
+ const request = this.getSaveFormRequest(
199
+ system,
200
+ button.restfulApiPath,
201
+ formViewCode,
202
+ formViewVersion,
203
+ tableName,
204
+ formData,
205
+ entityName,
206
+ myJsContent,
207
+ formNoRuleCode,
208
+ button.dataConversionRule,
209
+ button.autoSetValueData,
210
+ '/dsc/commons',
211
+ button.logSetting,
212
+ null,
213
+ null,
214
+ button.taskMap,
215
+ needDeleteFileUuidS,
216
+ additionalParamMap,
217
+ beanName,
218
+ false,
219
+ button.functionCode,
220
+ isUnControlVersion
221
+ )
222
+ if (request) {
223
+ request.then((data) => {
224
+ this.dealAfterSaveForm(
225
+ data,
226
+ system.standard,
227
+ 'superPageMessage.successfulSave',
228
+ button.successOperation,
229
+ button.code,
230
+ button.isNeedValueMapping
231
+ )
232
+ })
233
+ }
234
+ },
235
+ dealAfterSaveForm(
236
+ data,
237
+ isStandardSystem,
238
+ successTip,
239
+ successOperation,
240
+ buttonCode,
241
+ isNeedValueMapping
242
+ ) {
243
+ if (data) {
244
+ let entity
245
+ if (isStandardSystem === false) {
246
+ if (data.entity) {
247
+ entity = data.entity
248
+ }
249
+ if (data.formNo) {
250
+ // 获得表单编码规则解析结果
251
+ this.formNo = data.formNo
252
+ }
253
+ } else {
254
+ entity = data
255
+ }
256
+ // 调用afterClick回调事件
257
+ this.callAfterClickButton(
258
+ this.formEvents,
259
+ this.formViewCode + '__' + buttonCode,
260
+ {
261
+ params: this.additionalParamMap,
262
+ additionalParamMap: this.additionalParamMap,
263
+ entity: entity,
264
+ }
265
+ )
266
+ this.afterSuccessOperateInForm(
267
+ successOperation,
268
+ entity,
269
+ isNeedValueMapping,
270
+ false
271
+ )
272
+ }
273
+ // 刷新按钮
274
+ this.reviewButton()
275
+ this.$message.success(this.$t(successTip))
276
+ },
277
+ // 表单页面(非流程)-提交/同意/不同意
278
+ getSubmitFormRequest(
279
+ formData,
280
+ system,
281
+ restfulApiPath,
282
+ tableName,
283
+ entityName,
284
+ myJsContent,
285
+ button,
286
+ formNoRuleCode,
287
+ url,
288
+ buttonCode,
289
+ ids,
290
+ isBatchProcessing,
291
+ needDeleteFileUuidS,
292
+ additionalParamMap,
293
+ beanName,
294
+ isWorkflow
295
+ ) {
296
+ const operationI18nTip =
297
+ 'superPageMessage.whetherToConfirm' + this.upperFirstCase(buttonCode)
298
+ this.$confirm(
299
+ this.$t(operationI18nTip, { name: button.label }),
300
+ this.$t('superPageMessage.tips'),
301
+ {
302
+ confirmButtonText: this.$t('superPageMessage.sure'),
303
+ cancelButtonText: this.$t('superPageMessage.cancel'),
304
+ type: 'warning',
305
+ }
306
+ )
307
+ .then(() => {
308
+ const param = {
309
+ entity: formData,
310
+ tableName: tableName,
311
+ formNoRuleCode,
312
+ functionCode: button.functionCode,
313
+ }
314
+ if (this.judgeHeavyList) {
315
+ // 判重组合字段配置
316
+ param.judgeHeavyList = JSON.stringify(this.judgeHeavyList)
317
+ }
318
+ if (button.dataConversionRule) {
319
+ param.dataConversionRule = button.dataConversionRule.join(',')
320
+ }
321
+ if (button.autoSetValueData) {
322
+ param.autoSetValueData = JSON.stringify(button.autoSetValueData)
323
+ }
324
+ if (button.logSetting) {
325
+ param.logSettingText = button.logSetting
326
+ }
327
+ if (button.taskMap) {
328
+ param.taskMap = button.taskMap
329
+ }
330
+ if (!param.systemCode) {
331
+ param.systemCode = system.code
332
+ }
333
+ if (entityName) {
334
+ // 表示需要重写后台保存的实现
335
+ param.entityName = entityName
336
+ }
337
+ if (beanName) {
338
+ // 表示需要重写后台保存的实现
339
+ param.beanName = beanName
340
+ }
341
+ if (ids && ids.length > 0) {
342
+ param.ids = ids
343
+ }
344
+ if (needDeleteFileUuidS) {
345
+ param.needDeleteFileUuidS = needDeleteFileUuidS
346
+ }
347
+ if (additionalParamMap) {
348
+ param.additionalParamMap = additionalParamMap
349
+ }
350
+ if (isWorkflow !== undefined && isWorkflow !== null) {
351
+ param.isWorkflowEntity = isWorkflow
352
+ }
353
+ // false表示控制version,true表示不控制version
354
+ if (
355
+ button.successOperation &&
356
+ button.successOperation === 'noOperation'
357
+ ) {
358
+ // 如果是按钮操作后是“无操作”,则不控制version的值,否则会报“记录被其它事务修改”的异常
359
+ param.unControlVersion = true
360
+ }
361
+ param.isBatchProcessing = isBatchProcessing
362
+ const request = this.getSaveFormRequestByParam(
363
+ system,
364
+ restfulApiPath,
365
+ param,
366
+ myJsContent,
367
+ url
368
+ )
369
+ if (request) {
370
+ request
371
+ .then((data) => {
372
+ this.dealAfterSaveForm(
373
+ data,
374
+ system.standard,
375
+ 'superPageMessage.successfulOperation',
376
+ button.successOperation,
377
+ button.code,
378
+ button.isNeedValueMapping
379
+ )
380
+ })
381
+ .catch((e) => {
382
+ console.log('getSubmitFormRequest error', e)
383
+ })
384
+ }
385
+ return request
386
+ })
387
+ .catch(() => {
388
+ // 点击取消按钮的回调
389
+ })
390
+ },
391
+ // 表单页面-提交/同意/不同意
392
+ submitForm(
393
+ formData,
394
+ system,
395
+ tableName,
396
+ entityName,
397
+ myJsContent,
398
+ button,
399
+ formNoRuleCode,
400
+ url,
401
+ ids,
402
+ isBatchProcessing,
403
+ needDeleteFileUuidS,
404
+ additionalParamMap,
405
+ beanName
406
+ ) {
407
+ const request = this.getSubmitFormRequest(
408
+ formData,
409
+ system,
410
+ button.restfulApiPath,
411
+ tableName,
412
+ entityName,
413
+ myJsContent,
414
+ button,
415
+ formNoRuleCode,
416
+ url,
417
+ button.code,
418
+ ids,
419
+ isBatchProcessing,
420
+ needDeleteFileUuidS,
421
+ additionalParamMap,
422
+ beanName,
423
+ false
424
+ )
425
+ if (request) {
426
+ request
427
+ .then((data) => {
428
+ this.dealAfterSaveForm(
429
+ data,
430
+ system.standard,
431
+ 'superPageMessage.successfulOperation',
432
+ button.successOperation,
433
+ button.code,
434
+ button.isNeedValueMapping
435
+ )
436
+ })
437
+ .catch((e) => {})
438
+ }
439
+ },
440
+ updateValues(sourceModel, sourceTableName) {
441
+ // 更新数据
442
+ updateWithPageValue(
443
+ sourceModel,
444
+ sourceTableName,
445
+ this.jumpPageSetting,
446
+ this.formData,
447
+ this.tableName
448
+ )
449
+ let updateValueEventName =
450
+ this.jumpPageSetting && this.jumpPageSetting.updateValueEvent
451
+ ? this.jumpPageSetting.updateValueEvent
452
+ : null
453
+ if (
454
+ this.customEvents &&
455
+ updateValueEventName &&
456
+ updateValueEventName !== null &&
457
+ this.customEvents[updateValueEventName]
458
+ ) {
459
+ this.customEvents[updateValueEventName].call(this, {
460
+ sourceModel,
461
+ sourceTableName,
462
+ jumpPageSetting: this.jumpPageSetting,
463
+ entity: this.formData,
464
+ targetTableName: this.tableName,
465
+ })
466
+ }
467
+ // 更新表单编辑器的表单数据
468
+ this.updateFormData(this.formData)
469
+ },
470
+ // 下载模板
471
+ downloadTemplate(system, button, tableName) {
472
+ let templateUUID
473
+ let templateShowPath
474
+ if (button.templateFiles && button.templateFiles.length > 0) {
475
+ const templateFilesResult = packageTemplateFiles(button.templateFiles)
476
+ templateUUID = templateFilesResult[0].templateUUID
477
+ templateShowPath = templateFilesResult[0].templateShowPath
478
+ } else {
479
+ templateUUID = button.templateUUID
480
+ templateShowPath = button.templateShowPath
481
+ }
482
+ let param = '?1=1'
483
+ if (button && button.functionCode) {
484
+ param += '&functionCode=' + button.functionCode
485
+ }
486
+ if (tableName) {
487
+ param += '&tableName=' + tableName
488
+ }
489
+ // filePath格式如:用户定义的文件名~~服务器上磁盘中存储的文件路径及文件名。例如:user-info.xls~~iMatrix/b03dr45f5h4g.xls
490
+ // let fileShowName = ''
491
+ if (
492
+ templateUUID &&
493
+ templateShowPath &&
494
+ templateUUID !== 'undefined' &&
495
+ templateShowPath !== 'undefined' &&
496
+ templateUUID !== 'null' &&
497
+ templateShowPath !== 'null'
498
+ ) {
499
+ param +=
500
+ '&fileName=' +
501
+ encodeURI(templateUUID) +
502
+ '&showName=' +
503
+ encodeURI(templateShowPath)
504
+ }
505
+ const baseUrl = this.getBaseUrl(system)
506
+ window.open(baseUrl + '/dsc/commons/download-files' + param)
507
+ },
508
+ }
509
+ export default buttonEvents
@@ -0,0 +1,3 @@
1
+ // 用于存放表单数据、是否是预览状态、系统信息
2
+ const store = new Map()
3
+ export default store
@@ -0,0 +1,29 @@
1
+ import * as Vue from 'vue'
2
+ const superPageService = {
3
+ getPageSetting(code) {
4
+ return this.$http.get(
5
+ window.$vueApp.config.globalProperties.baseAPI +
6
+ '/component/super-pages/' +
7
+ code
8
+ )
9
+ },
10
+ getSystemWatermark(code) {
11
+ return this.$http.get(
12
+ window.$vueApp.config.globalProperties.baseAPI +
13
+ '/component/super-pages/getWatermark/' +
14
+ code
15
+ )
16
+ },
17
+ getPageSettingTest() {
18
+ // return this.$http.get('http://localhost:8080/test/list-page.json')
19
+ // return this.$http.get('http://localhost:8080/test/form-page.json')
20
+ // return this.$http.get('http://localhost:8080/test/workflow-form-page.json')
21
+ // return this.$http.get('http://localhost:8080/test/chart-page.json')
22
+ // return this.$http.get('http://localhost:8080/test/tab-page.json')
23
+ // return this.$http.get('http://localhost:8080/test/workflow-history-page.json')
24
+ return this.$http.get(
25
+ 'http://localhost:8080/test/other-component-page.json'
26
+ )
27
+ },
28
+ }
29
+ export default superPageService