super-pages 0.0.20-up → 0.0.22-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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "super-pages",
3
3
  "private": false,
4
- "version": "0.0.20-up",
4
+ "version": "0.0.22-up",
5
5
  "type": "module",
6
6
  "main": "./lib/super-pages.js",
7
7
  "scripts": {
@@ -14,15 +14,15 @@
14
14
  "@vitejs/plugin-vue": "^4.2.3",
15
15
  "axios": "^1.6.1",
16
16
  "element-plus": "^2.4.1",
17
- "imatrix-ui": "0.2.7-up",
17
+ "imatrix-ui": "0.2.30-up",
18
18
  "sass": "^1.69.4",
19
- "super-charts-new": "0.0.2-up",
20
- "super-form-editor": "0.0.5-up",
19
+ "super-charts-new": "0.0.19-up",
20
+ "super-form-editor": "0.0.23-up",
21
21
  "vite": "^4.4.5",
22
22
  "vue": "^3.3.4",
23
23
  "vue-i18n": "^9.5.0",
24
24
  "vue-router": "^4.2.5",
25
25
  "vuex": "^4.1.0",
26
- "workflow-editor": "0.0.2-up"
26
+ "workflow-editor": "0.0.17-up"
27
27
  }
28
28
  }
@@ -75,6 +75,7 @@
75
75
  @workflowClick="workflowButtonClick"
76
76
  @prohibi-edit="fnProhibitToEdit"
77
77
  @refreshFrom="refreshFrom"
78
+ @getPageParam="getPageParam"
78
79
  />
79
80
  </template>
80
81
  </span>
@@ -289,6 +290,6 @@ export default {
289
290
  : 'form-bottom-button'
290
291
  },
291
292
  },
292
- emits: ['searchGridData', 'getSystemRef', 'prohibi-edit','click'],
293
+ emits: ['searchGridData', 'getSystemRef', 'prohibi-edit','click', 'workflowClick', 'getPageParam'],
293
294
  }
294
295
  </script>
@@ -498,7 +498,8 @@ export default {
498
498
  systemCode: this.system.code,
499
499
  functionCode: this.permissionPrefix + '.get',
500
500
  }
501
- if (!param.id && sessionStorage.getItem(this.$route.query._t_) && sessionStorage.getItem(this.$route.query._t_ + '_id')) {
501
+ if (!param.id &&
502
+ this.$route.query._t_ && sessionStorage.getItem(this.$route.query._t_ + '_id')) {
502
503
  param.id = sessionStorage.getItem(this.$route.query._t_ + '_id')
503
504
  }
504
505
  if (this.ids) {
@@ -12,7 +12,7 @@
12
12
  prop="templateShowPath"
13
13
  >
14
14
  <template v-slot="scope">
15
- {{ formatTemplateShowPath(scope.row.templateShowPath) }}
15
+ {{ scope.row.templateShowPath }}
16
16
  </template>
17
17
  </el-table-column>
18
18
  <el-table-column
@@ -55,23 +55,26 @@ export default {
55
55
  },
56
56
  },
57
57
  data() {
58
- let templateFiles = []
59
- if (this.button.templateFiles && this.button.templateFiles.length > 0) {
60
- templateFiles = packageTemplateFiles(this.button.templateFiles)
61
- } else if (this.button.templateUUID && this.button.templateShowPath) {
62
- templateFiles.push({
63
- templateUUID: this.button.templateUUID,
64
- templateShowPath: this.button.templateShowPath,
65
- })
66
- }
67
58
  return {
68
- templateFiles,
59
+ templateFiles: [],
69
60
  fields: [],
70
61
  prefix: '${',
71
62
  suffix: '}',
72
63
  }
73
64
  },
74
- created() {},
65
+ created () { },
66
+ mounted () {
67
+ if (this.button.templateFiles && this.button.templateFiles.length > 0) {
68
+ this.templateFiles = packageTemplateFiles(this.button.templateFiles)
69
+ } else if (this.button.templateUUID && this.button.templateShowPath) {
70
+ this.templateFiles.push({ templateUUID: this.button.templateUUID, templateShowPath: this.button.templateShowPath })
71
+ }
72
+ this.templateFiles.forEach((item) => {
73
+ if (item && item.templateShowPath) {
74
+ item.templateShowPath = this.formatTemplateShowPath(item.templateShowPath)
75
+ }
76
+ })
77
+ },
75
78
  methods: {
76
79
  getFileds(templateShowPath) {
77
80
  console.log('templateShowPath', templateShowPath)
@@ -126,11 +129,6 @@ export default {
126
129
  return templateShowPath
127
130
  },
128
131
  exportForm(row) {
129
- if (row['templateShowPath']) {
130
- row['templateShowPath'] = this.formatTemplateShowPath(
131
- row['templateShowPath']
132
- )
133
- }
134
132
  $emit(this, 'before-export-form-report', row)
135
133
  },
136
134
  previewExportForm(row) {
@@ -454,7 +454,8 @@ export default {
454
454
  if (that.$refs.grid) {
455
455
  that.$refs.grid.closePageDialog({
456
456
  entity: popEntity,
457
- pageCode: popPageCode,
457
+ pageCode: popPageCode,
458
+ jumpInfo: jumpInfo
458
459
  })
459
460
  }
460
461
  }
@@ -24,6 +24,7 @@
24
24
  @refresh-tab="refreshTab"
25
25
  @refresh-from="refreshFrom"
26
26
  @click="clickMyButton(button)"
27
+ @getPageParam="getPageParam"
27
28
  />
28
29
  <el-button
29
30
  v-else
@@ -52,11 +53,14 @@
52
53
  <span v-else>
53
54
  <export-pdf-button
54
55
  v-if="showPdfButton"
56
+ :button="button"
55
57
  :pdf-template-code="button.pdfTemplateCode"
56
58
  :entity="formData"
59
+ :disabled="disabled"
57
60
  :base-props="button"
58
61
  :watermark-setting="watermarkSetting"
59
62
  :befoer-open="befoerOpenPdf"
63
+ @click="$emit('click', button)"
60
64
  @closePreview="closePreview"
61
65
  />
62
66
  </span>
@@ -430,12 +434,13 @@ export default {
430
434
  null,
431
435
  null,
432
436
  workflowButton,
433
- clickParam.completeTaskParam
437
+ clickParam.completeTaskParam,
438
+ clickParam
434
439
  )
435
440
  }
436
441
  },
437
442
  },
438
- emits: ['click', 'prohibi-edit'],
443
+ emits: ['click', 'prohibi-edit', 'workflowClick', 'getPageParam'],
439
444
  }
440
445
  </script>
441
446
 
@@ -19,6 +19,7 @@
19
19
  @workflowClick="workflowButtonClick"
20
20
  @prohibi-edit="fnProhibitToEdit"
21
21
  @refreshFrom="refreshFrom"
22
+ @getPageParam="getPageParam"
22
23
  />
23
24
  <my-button-base
24
25
  v-else
@@ -40,6 +41,7 @@
40
41
  @workflowClick="workflowButtonClick"
41
42
  @prohibi-edit="fnProhibitToEdit"
42
43
  @refreshFrom="refreshFrom"
44
+ @getPageParam="getPageParam"
43
45
  />
44
46
  </span>
45
47
  </template>
@@ -191,6 +193,6 @@ export default {
191
193
  $emit(this, 'prohibi-edit', data)
192
194
  },
193
195
  },
194
- emits: ['prohibi-edit','click'],
196
+ emits: ['prohibi-edit','click', 'workflowClick', 'getPageParam'],
195
197
  }
196
198
  </script>
@@ -64,7 +64,7 @@ export function isShouldAddBorder(pageSettingList) {
64
64
  return false
65
65
  }
66
66
 
67
- export function packageTemplateFiles(templateFiles) {
67
+ export function packageTemplateFiles (templateFiles) {
68
68
  if (!templateFiles) {
69
69
  return templateFiles
70
70
  }
@@ -74,22 +74,17 @@ export function packageTemplateFiles(templateFiles) {
74
74
  let templateFilesResult = []
75
75
  let fileCodes = []
76
76
  const fileSeperate = '~-~-'
77
- templateFiles.forEach((template) => {
77
+ templateFiles.forEach(template => {
78
78
  let showName = template.templateShowPath
79
79
  if (showName.indexOf(fileSeperate) > 0) {
80
80
  // 表示是多语言模板
81
81
  const fileCode = showName.substring(0, showName.indexOf(fileSeperate))
82
- const fileLanguage = showName.substring(
83
- showName.indexOf(fileSeperate) + fileSeperate.length,
84
- showName.lastIndexOf(fileSeperate)
85
- )
86
- const fileName = showName.substring(
87
- showName.lastIndexOf(fileSeperate) + fileSeperate.length
88
- )
82
+ const fileLanguage = showName.substring(showName.indexOf(fileSeperate) + fileSeperate.length, showName.lastIndexOf(fileSeperate))
83
+ const fileName = showName.substring(showName.lastIndexOf(fileSeperate) + fileSeperate.length)
89
84
  if (currentLocale === fileLanguage && fileCodes.indexOf(fileCode) < 0) {
90
85
  templateFilesResult.push({
91
86
  templateUUID: template.templateUUID,
92
- templateShowPath: fileName,
87
+ templateShowPath: fileName
93
88
  })
94
89
  fileCodes.push(fileCode)
95
90
  }
@@ -621,40 +621,49 @@ const Util = {
621
621
  }
622
622
  if (isPromise(beforeClickResult)) {
623
623
  beforeClickResult.then((result) => {
624
- if (result) {
625
- this.exportFormReportSuccess(
626
- templateUUID,
627
- fileName,
628
- myJsContent,
629
- entityName,
630
- system,
631
- logSettingText,
632
- taskMap,
633
- additionalParamMap,
634
- isWorkflowForm,
635
- beanName,
636
- button,
637
- tableName,
638
- param
639
- )
624
+ if (result) {
625
+ if (button.code === 'exportPDF') {
626
+ this.exportFormPdf(fileName, myJsContent, system, param)
627
+ } else {
628
+ this.exportFormReportSuccess(
629
+ templateUUID,
630
+ fileName,
631
+ myJsContent,
632
+ entityName,
633
+ system,
634
+ logSettingText,
635
+ taskMap,
636
+ additionalParamMap,
637
+ isWorkflowForm,
638
+ beanName,
639
+ button,
640
+ tableName,
641
+ param
642
+ )
643
+ }
644
+
640
645
  }
641
646
  })
642
- } else {
643
- this.exportFormReportSuccess(
644
- templateUUID,
645
- fileName,
646
- myJsContent,
647
- entityName,
648
- system,
649
- logSettingText,
650
- taskMap,
651
- additionalParamMap,
652
- isWorkflowForm,
653
- beanName,
654
- button,
655
- tableName,
656
- param
657
- )
647
+ } else {
648
+ if (button.code === 'exportPDF') {
649
+ this.exportFormPdf(fileName, myJsContent, system, param)
650
+ } else {
651
+ this.exportFormReportSuccess(
652
+ templateUUID,
653
+ fileName,
654
+ myJsContent,
655
+ entityName,
656
+ system,
657
+ logSettingText,
658
+ taskMap,
659
+ additionalParamMap,
660
+ isWorkflowForm,
661
+ beanName,
662
+ button,
663
+ tableName,
664
+ param
665
+ )
666
+ }
658
667
  }
659
668
  })
660
669
  }
@@ -723,6 +732,48 @@ const Util = {
723
732
  entity: this.formData,
724
733
  }
725
734
  )
735
+ })
736
+ },
737
+ // 导出报告按钮实现
738
+ exportFormPdf (fileName, myJsContent, system, param) {
739
+ let request
740
+ if (myJsContent) {
741
+ // 将js文本转换为函数,并运行
742
+ // eslint-disable-next-line no-eval
743
+ const buttonFun = eval('(' + myJsContent + ')')
744
+ // 运行方法
745
+ request = buttonFun(this, param)
746
+ } else {
747
+ const baseUrl = this.getBaseUrl(system)
748
+ const path = baseUrl + '/dsc/commons/export-pdf'
749
+ axios.defaults.headers.common.Authorization = getToken()
750
+ request = axios.post(
751
+ path,
752
+ param, {
753
+ responseType: 'blob'
754
+ }, {
755
+ headers: {
756
+ 'content-type': 'application/x-www-form-urlencoded'
757
+ }
758
+ }
759
+ )
760
+ }
761
+ request.then((response) => {
762
+ const blob = new Blob([response.data])
763
+ const elink = document.createElement('a')
764
+ elink.download = fileName.substring(0, fileName.lastIndexOf('.')) + '.pdf'
765
+ elink.style.display = 'none'
766
+ elink.target = '_blank'
767
+ elink.href = URL.createObjectURL(blob)
768
+ document.body.appendChild(elink)
769
+ elink.click()
770
+ URL.revokeObjectURL(elink.href) // 释放URL对象
771
+ document.body.removeChild(elink)
772
+ // 调用afterClick回调事件
773
+ this.callAfterClickButton(this.formEvents, this.formViewCode + '__exportForm', {
774
+ params: this.additionalParamMap,
775
+ entity: this.formData
776
+ })
726
777
  })
727
778
  },
728
779
  // 首字母大写
@@ -753,7 +804,7 @@ const Util = {
753
804
  $emit(this, 'click', button)
754
805
  },
755
806
  // 流程页面中按钮点击事件
756
- workflowButtonClick(event, param, eventSetting, button, completeTaskParam) {
807
+ workflowButtonClick(event, param, eventSetting, button, completeTaskParam, clickParam) {
757
808
  $emit(
758
809
  this,
759
810
  'workflowClick',
@@ -761,7 +812,8 @@ const Util = {
761
812
  param,
762
813
  eventSetting,
763
814
  button,
764
- completeTaskParam
815
+ completeTaskParam,
816
+ clickParam
765
817
  )
766
818
  },
767
819
  // 是否是查看详情页面
@@ -1040,7 +1092,8 @@ const Util = {
1040
1092
  return
1041
1093
  }
1042
1094
  const jumpInfoObj = JSON.parse(jumpInfo)
1043
- const jumpMode = jumpInfoObj.jumpMode
1095
+ const jumpMode = jumpInfoObj.jumpMode
1096
+ jumpInfoObj.successOperation = successOperation
1044
1097
  if (jumpMode === 'popup') {
1045
1098
  // 弹框Dialog
1046
1099
  // 弹框所属的页面
@@ -1522,6 +1575,12 @@ const Util = {
1522
1575
  tabCode = getStoreInfo(this.pageCode, '_activeTab')
1523
1576
  }
1524
1577
  $emit(eventBus, this.pageCode + '-refresh-tab', { tabCode:tabCode, entity:entity })
1525
- },
1578
+ },
1579
+ // 流程页面中按钮点击事件
1580
+ getPageParam (key, callback) {
1581
+ this.$emit('getPageParam', key, val => {
1582
+ callback(this[key])
1583
+ })
1584
+ }
1526
1585
  }
1527
1586
  export default Util
@@ -1228,6 +1228,22 @@ const buttonEvents = {
1228
1228
  .catch((e) => {
1229
1229
  this.showTaskInformitions = false
1230
1230
  })
1231
+ },
1232
+ // 自定义退回某环节
1233
+ customReturnTaskTo (model, selectTaskNode) {
1234
+ this.returnTaskTo(
1235
+ this.system,
1236
+ this.tableName,
1237
+ model,
1238
+ selectTaskNode,
1239
+ this.formViewCode,
1240
+ this.formViewVersion,
1241
+ this.entityName,
1242
+ this.myJsContent,
1243
+ this.successOperation,
1244
+ this.isNeedValueMapping,
1245
+ this.beanName
1246
+ )
1231
1247
  },
1232
1248
  // 退回到某环节,只能退回到已办理过的环节
1233
1249
  returnTaskTo(
@@ -68,19 +68,23 @@
68
68
  v-if="col.baseSetting.type === 'workflowHistoryList'"
69
69
  ref="historyList"
70
70
  :workflow-id="workflowId"
71
- :max-height="col.options.height"
71
+ :style="{maxHeight:maxHeight+'px'}"
72
72
  />
73
73
  <workflow-history
74
74
  v-else-if="col.baseSetting.type === 'workflowHistoryGraph'"
75
75
  :id="workflowId"
76
76
  ref="historyGraph"
77
+ :style="{maxHeight:maxHeight+'px'}"
77
78
  />
78
79
  </template>
79
80
  <template v-else>
80
81
  {{ $t('superPage.unSubmitProcess') }}
81
82
  </template>
82
83
  </template>
83
- <div v-else-if="col.baseSetting.type === 'label'">
84
+ <div
85
+ v-else-if="col.baseSetting.type === 'label'"
86
+ :id="col.baseSetting.componentCode"
87
+ >
84
88
  {{ col.baseSetting.label }}
85
89
  </div>
86
90
  <div
@@ -195,7 +199,8 @@ export default {
195
199
  permission,
196
200
  permissionPrefix,
197
201
  additionalParamMap: null, // 解析好的附加参数
198
- isTabChartView, // 是否是图表tab页签页面,如果是,图表显示时不需要使用card显示。
202
+ isTabChartView, // 是否是图表tab页签页面,如果是,图表显示时不需要使用card显示。
203
+ maxHeight: window.innerHeight - 120,
199
204
  }
200
205
  },
201
206
  computed: {
@@ -28,13 +28,13 @@
28
28
  <template v-slot:after>
29
29
  <template v-if="formButtonPosition === 'bottomRight'">
30
30
  <span
31
- v-if="!isTaskComplete() && getCurrentActivityName()"
31
+ v-if="currentActivityName"
32
32
  :style="{
33
33
  'margin-left': '5px',
34
34
  color: workNameColor ? workNameColor : 'red',
35
35
  }"
36
36
  >{{ $t('superPage.currentActivityName') }}
37
- {{ getCurrentActivityName() }}</span
37
+ {{ currentActivityName }}</span
38
38
  >
39
39
  <el-button
40
40
  v-if="isBackButton && isTaskInput"
@@ -135,6 +135,7 @@
135
135
  @workflowClick="workflowButtonClick"
136
136
  @prohibi-edit="fnProhibitToEdit"
137
137
  @refreshFrom="refreshFrom"
138
+ @getPageParam="getPageParam"
138
139
  />
139
140
  </span>
140
141
  </template>
@@ -162,13 +163,13 @@
162
163
  {{ backButtonName }}
163
164
  </el-button>
164
165
  <span
165
- v-if="!isTaskComplete() && getCurrentActivityName()"
166
+ v-if="currentActivityName"
166
167
  :style="{
167
168
  'margin-left': '5px',
168
169
  color: workNameColor ? workNameColor : 'red',
169
170
  }"
170
171
  >{{ $t('superPage.currentActivityName') }}
171
- {{ getCurrentActivityName() }}</span
172
+ {{ currentActivityName }}</span
172
173
  >
173
174
  </template>
174
175
  </template>
@@ -183,6 +184,7 @@ import { mapGetters } from 'vuex'
183
184
  import Util from './util/util'
184
185
  import myButtonBase from './my-button-base'
185
186
  import { getStoreInfo } from './util/common-util'
187
+ import { getValueByField } from 'imatrix-ui/src/utils/util'
186
188
  export default {
187
189
  name: 'MyWorkflowButtonGroup',
188
190
  components: {
@@ -361,7 +363,8 @@ export default {
361
363
  } else {
362
364
  this.buttons = tempButtons
363
365
  }
364
- }
366
+ }
367
+ this.getCurrentActivityName()
365
368
  },
366
369
  methods: {
367
370
  ...Util,
@@ -397,7 +400,11 @@ export default {
397
400
  }
398
401
  },
399
402
  getCurrentActivityName() {
400
- return getStoreInfo(this.pageCode, '_currentActivityName')
403
+ let formData
404
+ if (this.myFormDataFun) {
405
+ formData = this.myFormDataFun()
406
+ this.currentActivityName = getValueByField(formData, 'current_activity_name')
407
+ }
401
408
  },
402
409
  updateButton(workflowButtonComponent) {
403
410
  console.log(this.workflowButtonComponent)
@@ -413,7 +420,7 @@ export default {
413
420
  const buttonInfo = this.packageButtonInfoForVisible()
414
421
  this.buttonInfo = Object.assign({}, workflowButtonComponent, buttonInfo)
415
422
  // 待领取时不显示暂存按钮
416
- if (this.buttonInfo['active'] === 'DRAW_WAIT') {
423
+ if (this.buttonInfo['active'] === 'DRAW_WAIT' || this.buttonInfo['active'] === 'DEPT_DRAW_WAIT') {
417
424
  this.buttonInfo['isShowButtonSave'] = false
418
425
  this.buttonInfo['showButtonSave'] = false
419
426
  }
@@ -556,6 +563,6 @@ export default {
556
563
  $emit(this, 'prohibi-edit', data)
557
564
  },
558
565
  },
559
- emits: ['workflowClick', 'prohibi-edit','click'],
566
+ emits: ['workflowClick', 'prohibi-edit','click', 'workflowClick', 'getPageParam'],
560
567
  }
561
568
  </script>
@@ -34,6 +34,7 @@
34
34
  @click="clickWorkflowExtensionButtonOn"
35
35
  @refreshFrom="clickRefreshFrom"
36
36
  @prohibi-edit="fnProhibitToEdit"
37
+ @getPageParam="getFormPageParam"
37
38
  />
38
39
  <form-head
39
40
  v-if="formTitle || formNo || formNoLabel"
@@ -392,7 +393,8 @@ export default {
392
393
  operation,
393
394
  eventSetting,
394
395
  workflowButton,
395
- completeTaskParam
396
+ completeTaskParam,
397
+ clickParam
396
398
  ) {
397
399
  console.log('clickWorkflowButtonOn-eventSetting', eventSetting)
398
400
  // console.log('----clickWorkflowButton---', event, operation, eventSetting, workflowButton)
@@ -538,7 +540,10 @@ export default {
538
540
  if (event === 'returnTaskTo') {
539
541
  // 退回按钮
540
542
  this.dataConversionRule = dataConversionRule
541
- this.getTaskInformitions(this.system, this.entityName, this.beanName)
543
+ this.getTaskInformitions(this.system, this.entityName, this.beanName)
544
+ } else if (event === 'customReturnTaskTo') {
545
+ // 自定义退回按钮
546
+ this.customReturnTaskTo(model, clickParam.selectTaskNode)
542
547
  } else if (event === 'returnToPreviousTask') {
543
548
  // 驳回
544
549
  this.returnToPreviousTask(
@@ -635,7 +640,7 @@ export default {
635
640
  let isEnableRequired = false
636
641
  if (
637
642
  typeof button.isRequired === 'undefined' &&
638
- button.code === 'exportForm'
643
+ (button.code === 'exportForm' || button.code === 'exportPDF')
639
644
  ) {
640
645
  // 导出报告按钮不验证表单
641
646
  isEnableRequired = false
@@ -756,8 +761,8 @@ export default {
756
761
  this.beanName,
757
762
  button
758
763
  )
759
- } else if (button.code === 'exportForm') {
760
- // 表示点了“导出报告”
764
+ } else if (button.code === 'exportForm' || button.code === 'exportPDF') {
765
+ // 表示点了“导出报告“或导出pdf
761
766
  this.exportFormReport(
762
767
  button.templateUUID,
763
768
  button.templateShowPath,
@@ -987,7 +992,7 @@ export default {
987
992
  // 修改页面
988
993
  param.id = this.dataId
989
994
  } else {
990
- if (sessionStorage.getItem(this.$route.query._t_) && sessionStorage.getItem(this.$route.query._t_ + '_id')) {
995
+ if (this.$route.query._t_ && sessionStorage.getItem(this.$route.query._t_ + '_id')) {
991
996
  param.id = sessionStorage.getItem(this.$route.query._t_ + '_id')
992
997
  }
993
998
  // 新建页面
@@ -1302,7 +1307,10 @@ export default {
1302
1307
  this.reviewButton(entity)
1303
1308
  return this.$refs.superForm.refresMainTableFields(entity)
1304
1309
  }
1305
- },
1310
+ },
1311
+ getFormPageParam (key, callback) {
1312
+ callback(this[key])
1313
+ }
1306
1314
  },
1307
1315
  emits: [],
1308
1316
  }