super-page-runtime 1.0.13 → 1.0.15

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 (338) hide show
  1. package/dist/es/components/index.d.ts +5 -0
  2. package/dist/es/{runtime → components/runtime}/views/assemblys/button/button/button-runtime.vue2.js +1 -1
  3. package/dist/es/{runtime → components/runtime}/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +1 -1
  4. package/dist/es/{runtime → components/runtime}/views/assemblys/chart/column-line/column-line-runtime.vue2.js +1 -1
  5. package/dist/es/{runtime → components/runtime}/views/assemblys/chart/gauge/gauge-runtime.vue2.js +2 -9
  6. package/dist/es/{runtime → components/runtime}/views/assemblys/chart/pie/pie-runtime.vue2.js +1 -1
  7. package/dist/es/{runtime → components/runtime}/views/assemblys/chart/radar/radar-runtime.vue2.js +1 -1
  8. package/dist/es/{runtime → components/runtime}/views/assemblys/chart/scatter/scatter-runtime.vue2.js +1 -1
  9. package/dist/es/{runtime → components/runtime}/views/assemblys/common/export-form-report-dialog.vue.js +3 -9
  10. package/dist/es/{runtime → components/runtime}/views/assemblys/container/collapse/collapse-runtime.vue2.js +0 -1
  11. package/dist/es/{runtime → components/runtime}/views/assemblys/container/container/container-runtime.vue2.js +0 -1
  12. package/dist/es/{runtime → components/runtime}/views/assemblys/container/flex/flex-runtime.vue2.js +0 -1
  13. package/dist/es/{runtime → components/runtime}/views/assemblys/container/form/form-runtime.vue2.js +0 -1
  14. package/dist/es/{runtime → components/runtime}/views/assemblys/container/iframe/iframe-runtime.vue2.js +0 -1
  15. package/dist/es/{runtime → components/runtime}/views/assemblys/container/tabs/tabs-runtime.vue2.js +0 -1
  16. package/dist/es/{runtime → components/runtime}/views/assemblys/container/tools/tools-runtime.vue2.js +0 -1
  17. package/dist/es/{runtime → components/runtime}/views/assemblys/data/table/main-table-runtime.vue.js +4 -5
  18. package/dist/es/{runtime → components/runtime}/views/assemblys/data/table/sub-table-runtime.vue.js +5 -5
  19. package/dist/es/{runtime → components/runtime}/views/assemblys/data/table/table-runtime.vue2.js +0 -5
  20. package/dist/es/{runtime → components/runtime}/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +2 -2
  21. package/dist/es/{runtime → components/runtime}/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +2 -2
  22. package/dist/es/{runtime → components/runtime}/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +1 -5
  23. package/dist/es/{runtime → components/runtime}/views/assemblys/form/divider/divider-runtime.vue2.js +1 -1
  24. package/dist/es/{runtime → components/runtime}/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +1 -1
  25. package/dist/es/{runtime → components/runtime}/views/assemblys/form/input-number/input-number-runtime.vue2.js +2 -2
  26. package/dist/es/{runtime → components/runtime}/views/assemblys/form/input-text/inputtext-runtime.vue2.js +3 -3
  27. package/dist/es/{runtime → components/runtime}/views/assemblys/form/label/label-runtime.vue2.js +10 -4
  28. package/dist/es/{runtime → components/runtime}/views/assemblys/form/link/link-runtime.vue2.js +2 -2
  29. package/dist/es/{runtime → components/runtime}/views/assemblys/form/radio/radio-runtime.vue2.js +2 -2
  30. package/dist/es/{runtime → components/runtime}/views/assemblys/form/rich-text/richtext-runtime.vue2.js +15 -3
  31. package/dist/es/{runtime → components/runtime}/views/assemblys/form/select/select-runtime.vue2.js +2 -2
  32. package/dist/es/{runtime → components/runtime}/views/assemblys/form/switch/switch-runtime.vue2.js +2 -2
  33. package/dist/es/{runtime → components/runtime}/views/assemblys/form/tag/tag-runtime.vue2.js +2 -2
  34. package/dist/es/{runtime → components/runtime}/views/assemblys/form/textarea/textarea-runtime.vue2.js +2 -2
  35. package/dist/es/components/runtime/views/assemblys/object-render.vue.d.ts +1 -1
  36. package/dist/es/{runtime → components/runtime}/views/assemblys/object-render.vue.js +5 -5
  37. package/dist/es/{runtime → components/runtime}/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +2 -2
  38. package/dist/es/components/runtime/views/super-page.vue.d.ts +1 -1
  39. package/dist/es/{runtime → components/runtime}/views/super-page.vue.js +7 -8
  40. package/dist/es/{super-page-dialog → components/super-page-dialog}/super-page-dialog.vue.js +0 -1
  41. package/dist/es/components/wf-editor/wf-editor.css +4 -0
  42. package/dist/es/{wf-editor → components/wf-editor}/wf-editor.vue.js +3 -3
  43. package/dist/es/src/utils/charts/chart-util.js +15 -0
  44. package/dist/es/{components/runtime → src}/utils/events/event-util.d.ts +1 -1
  45. package/dist/lib/components/index.d.ts +5 -0
  46. package/dist/lib/{runtime → components/runtime}/views/assemblys/button/button/button-runtime.vue2.js +1 -1
  47. package/dist/lib/{runtime → components/runtime}/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +1 -1
  48. package/dist/lib/{runtime → components/runtime}/views/assemblys/chart/column-line/column-line-runtime.vue2.js +1 -1
  49. package/dist/lib/{runtime → components/runtime}/views/assemblys/chart/gauge/gauge-runtime.vue2.js +2 -9
  50. package/dist/lib/{runtime → components/runtime}/views/assemblys/chart/pie/pie-runtime.vue2.js +1 -1
  51. package/dist/lib/{runtime → components/runtime}/views/assemblys/chart/radar/radar-runtime.vue2.js +1 -1
  52. package/dist/lib/{runtime → components/runtime}/views/assemblys/chart/scatter/scatter-runtime.vue2.js +1 -1
  53. package/dist/lib/{runtime → components/runtime}/views/assemblys/common/export-form-report-dialog.vue.js +3 -9
  54. package/dist/lib/{runtime → components/runtime}/views/assemblys/container/collapse/collapse-runtime.vue2.js +0 -1
  55. package/dist/lib/{runtime → components/runtime}/views/assemblys/container/container/container-runtime.vue2.js +0 -1
  56. package/dist/lib/{runtime → components/runtime}/views/assemblys/container/flex/flex-runtime.vue2.js +0 -1
  57. package/dist/lib/{runtime → components/runtime}/views/assemblys/container/form/form-runtime.vue2.js +0 -1
  58. package/dist/lib/{runtime → components/runtime}/views/assemblys/container/iframe/iframe-runtime.vue2.js +0 -1
  59. package/dist/lib/{runtime → components/runtime}/views/assemblys/container/tabs/tabs-runtime.vue2.js +0 -1
  60. package/dist/lib/{runtime → components/runtime}/views/assemblys/container/tools/tools-runtime.vue2.js +0 -1
  61. package/dist/lib/{runtime → components/runtime}/views/assemblys/data/table/main-table-runtime.vue.js +4 -5
  62. package/dist/lib/{runtime → components/runtime}/views/assemblys/data/table/sub-table-runtime.vue.js +5 -5
  63. package/dist/lib/{runtime → components/runtime}/views/assemblys/data/table/table-runtime.vue2.js +0 -5
  64. package/dist/lib/{runtime → components/runtime}/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +2 -2
  65. package/dist/lib/{runtime → components/runtime}/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +2 -2
  66. package/dist/lib/{runtime → components/runtime}/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +1 -5
  67. package/dist/lib/{runtime → components/runtime}/views/assemblys/form/divider/divider-runtime.vue2.js +1 -1
  68. package/dist/lib/{runtime → components/runtime}/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +1 -1
  69. package/dist/lib/{runtime → components/runtime}/views/assemblys/form/input-number/input-number-runtime.vue2.js +2 -2
  70. package/dist/lib/{runtime → components/runtime}/views/assemblys/form/input-text/inputtext-runtime.vue2.js +3 -3
  71. package/dist/lib/{runtime → components/runtime}/views/assemblys/form/label/label-runtime.vue2.js +10 -4
  72. package/dist/lib/{runtime → components/runtime}/views/assemblys/form/link/link-runtime.vue2.js +2 -2
  73. package/dist/lib/{runtime → components/runtime}/views/assemblys/form/radio/radio-runtime.vue2.js +2 -2
  74. package/dist/lib/{runtime → components/runtime}/views/assemblys/form/rich-text/richtext-runtime.vue2.js +15 -3
  75. package/dist/lib/{runtime → components/runtime}/views/assemblys/form/select/select-runtime.vue2.js +2 -2
  76. package/dist/lib/{runtime → components/runtime}/views/assemblys/form/switch/switch-runtime.vue2.js +2 -2
  77. package/dist/lib/{runtime → components/runtime}/views/assemblys/form/tag/tag-runtime.vue2.js +2 -2
  78. package/dist/lib/{runtime → components/runtime}/views/assemblys/form/textarea/textarea-runtime.vue2.js +2 -2
  79. package/dist/lib/components/runtime/views/assemblys/object-render.vue.d.ts +1 -1
  80. package/dist/lib/{runtime → components/runtime}/views/assemblys/object-render.vue.js +5 -5
  81. package/dist/lib/{runtime → components/runtime}/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +2 -2
  82. package/dist/lib/components/runtime/views/super-page.vue.d.ts +1 -1
  83. package/dist/lib/{runtime → components/runtime}/views/super-page.vue.js +7 -8
  84. package/dist/lib/{super-page-dialog → components/super-page-dialog}/super-page-dialog.vue.js +0 -1
  85. package/dist/lib/components/wf-editor/wf-editor.css +4 -0
  86. package/dist/lib/{wf-editor → components/wf-editor}/wf-editor.vue.js +3 -3
  87. package/dist/lib/src/utils/charts/chart-util.js +15 -0
  88. package/dist/lib/{components/runtime → src}/utils/events/event-util.d.ts +1 -1
  89. package/lib/components/index.js +8 -0
  90. package/package.json +5 -4
  91. package/src/assets/base.css +86 -0
  92. package/src/assets/chart-themes/theme1.ts +6 -0
  93. package/src/assets/chart-themes/theme2.ts +6 -0
  94. package/src/assets/chart-themes/theme3.ts +6 -0
  95. package/src/assets/images/button/button-group.png +0 -0
  96. package/src/assets/images/button/button.png +0 -0
  97. package/src/assets/images/chart/chart-column.png +0 -0
  98. package/src/assets/images/chart/chart-gauge.png +0 -0
  99. package/src/assets/images/chart/chart-pie.png +0 -0
  100. package/src/assets/images/chart/chart-radar.png +0 -0
  101. package/src/assets/images/chart/chart-scatter.png +0 -0
  102. package/src/assets/images/container/container-card.png +0 -0
  103. package/src/assets/images/container/container-collapse.png +0 -0
  104. package/src/assets/images/container/container-container.png +0 -0
  105. package/src/assets/images/container/container-flex.png +0 -0
  106. package/src/assets/images/container/container-form.png +0 -0
  107. package/src/assets/images/container/container-iframe.png +0 -0
  108. package/src/assets/images/container/container-normal.png +0 -0
  109. package/src/assets/images/container/container-tabs.png +0 -0
  110. package/src/assets/images/container/container-tools.png +0 -0
  111. package/src/assets/images/data/data-process.png +0 -0
  112. package/src/assets/images/data/data-step.png +0 -0
  113. package/src/assets/images/data/data-table-column.png +0 -0
  114. package/src/assets/images/data/data-table.png +0 -0
  115. package/src/assets/images/data/data-timeline.png +0 -0
  116. package/src/assets/images/data/data-tree.png +0 -0
  117. package/src/assets/images/form/form-cascader.png +0 -0
  118. package/src/assets/images/form/form-check.png +0 -0
  119. package/src/assets/images/form/form-color.png +0 -0
  120. package/src/assets/images/form/form-count.png +0 -0
  121. package/src/assets/images/form/form-custom.png +0 -0
  122. package/src/assets/images/form/form-date.png +0 -0
  123. package/src/assets/images/form/form-dept.png +0 -0
  124. package/src/assets/images/form/form-divider.png +0 -0
  125. package/src/assets/images/form/form-file.png +0 -0
  126. package/src/assets/images/form/form-image-upload.png +0 -0
  127. package/src/assets/images/form/form-img.png +0 -0
  128. package/src/assets/images/form/form-input.png +0 -0
  129. package/src/assets/images/form/form-label.png +0 -0
  130. package/src/assets/images/form/form-link.png +0 -0
  131. package/src/assets/images/form/form-radio.png +0 -0
  132. package/src/assets/images/form/form-scan.png +0 -0
  133. package/src/assets/images/form/form-score.png +0 -0
  134. package/src/assets/images/form/form-select.png +0 -0
  135. package/src/assets/images/form/form-slider.png +0 -0
  136. package/src/assets/images/form/form-space.png +0 -0
  137. package/src/assets/images/form/form-switch.png +0 -0
  138. package/src/assets/images/form/form-text.png +0 -0
  139. package/src/assets/images/form/form-textarea.png +0 -0
  140. package/src/assets/images/form/form-transfer.png +0 -0
  141. package/src/assets/images/form/form-zoom.png +0 -0
  142. package/src/assets/images/group-button.png +0 -0
  143. package/src/assets/images/group-chart.png +0 -0
  144. package/src/assets/images/group-container.png +0 -0
  145. package/src/assets/images/group-data.png +0 -0
  146. package/src/assets/images/group-form.png +0 -0
  147. package/src/assets/images/group-workflow.png +0 -0
  148. package/src/assets/images/workflow/workflow-button.png +0 -0
  149. package/src/assets/images/workflow/workflow-history-texts.png +0 -0
  150. package/src/assets/images/workflow/workflow-history.png +0 -0
  151. package/src/assets/images/workflow/workflow-imagehistory.png +0 -0
  152. package/src/assets/images/workflow/workflow-texthistory .png +0 -0
  153. package/src/assets/logo.svg +1 -0
  154. package/src/assets/main.css +1 -0
  155. package/src/i18n/langs/cn.js +52 -0
  156. package/src/i18n/langs/en.js +52 -0
  157. package/src/stores/counter.ts +12 -0
  158. package/src/utils/api/api-util.ts +176 -0
  159. package/src/utils/charts/chart-util.ts +41 -0
  160. package/src/utils/common-util.ts +96 -0
  161. package/src/utils/container-style-util.ts +237 -0
  162. package/src/utils/eventBus.ts +14 -0
  163. package/src/utils/events/event-util.ts +790 -0
  164. package/src/utils/events/jump-page-util.ts +0 -0
  165. package/src/utils/events/standard-event.ts +2075 -0
  166. package/src/utils/events/validator-util.ts +474 -0
  167. package/src/utils/global-refs.ts +160 -0
  168. package/src/utils/interfaces/page-design-types.ts +259 -0
  169. package/src/utils/page-helper-util.ts +850 -0
  170. package/src/utils/page-init-util.ts +291 -0
  171. package/src/utils/page-permission-util.ts +521 -0
  172. package/src/utils/store-util.ts +41 -0
  173. package/src/utils/store.ts +3 -0
  174. package/src/utils/table-utils.ts +31 -0
  175. package/dist/es/index.d.ts +0 -5
  176. package/dist/es/runtime/utils/charts/chart-util.js +0 -15
  177. package/dist/es/wf-editor/wf-editor.css +0 -4
  178. package/dist/lib/index.d.ts +0 -5
  179. package/dist/lib/runtime/utils/charts/chart-util.js +0 -15
  180. package/dist/lib/wf-editor/wf-editor.css +0 -4
  181. /package/dist/es/{index.js → components/index.js} +0 -0
  182. /package/dist/es/{runtime → components/runtime}/index.js +0 -0
  183. /package/dist/es/{runtime → components/runtime}/utils/assemblys-config.js +0 -0
  184. /package/dist/es/{runtime → components/runtime}/views/assemblys/button/button/button-runtime.vue.js +0 -0
  185. /package/dist/es/{runtime → components/runtime}/views/assemblys/button/button-group/buttongroup-runtime.vue.js +0 -0
  186. /package/dist/es/{runtime → components/runtime}/views/assemblys/button/button-group/buttongroup-runtime.vue2.js +0 -0
  187. /package/dist/es/{runtime → components/runtime}/views/assemblys/button/dropdown/dropdown-runtime.vue.js +0 -0
  188. /package/dist/es/{runtime → components/runtime}/views/assemblys/chart/column-line/column-line-runtime.vue.js +0 -0
  189. /package/dist/es/{runtime → components/runtime}/views/assemblys/chart/gauge/gauge-runtime.vue.js +0 -0
  190. /package/dist/es/{runtime → components/runtime}/views/assemblys/chart/pie/pie-runtime.vue.js +0 -0
  191. /package/dist/es/{runtime → components/runtime}/views/assemblys/chart/radar/radar-runtime.vue.js +0 -0
  192. /package/dist/es/{runtime → components/runtime}/views/assemblys/chart/scatter/scatter-runtime.vue.js +0 -0
  193. /package/dist/es/{runtime → components/runtime}/views/assemblys/common/export-form-report-dialog.vue2.js +0 -0
  194. /package/dist/es/{runtime → components/runtime}/views/assemblys/common/remove-signer-dialog.vue.js +0 -0
  195. /package/dist/es/{runtime → components/runtime}/views/assemblys/common/remove-signer-dialog.vue2.js +0 -0
  196. /package/dist/es/{runtime → components/runtime}/views/assemblys/common/task-informition-dialog.vue.js +0 -0
  197. /package/dist/es/{runtime → components/runtime}/views/assemblys/common/task-informition-dialog.vue2.js +0 -0
  198. /package/dist/es/{runtime → components/runtime}/views/assemblys/container/card/card-runtime.vue.js +0 -0
  199. /package/dist/es/{runtime → components/runtime}/views/assemblys/container/card/card-runtime.vue2.js +0 -0
  200. /package/dist/es/{runtime → components/runtime}/views/assemblys/container/collapse/collapse-runtime.vue.js +0 -0
  201. /package/dist/es/{runtime → components/runtime}/views/assemblys/container/container/container-runtime.vue.js +0 -0
  202. /package/dist/es/{runtime → components/runtime}/views/assemblys/container/flex/flex-runtime.vue.js +0 -0
  203. /package/dist/es/{runtime → components/runtime}/views/assemblys/container/form/form-runtime.vue.js +0 -0
  204. /package/dist/es/{runtime → components/runtime}/views/assemblys/container/iframe/iframe-runtime.vue.js +0 -0
  205. /package/dist/es/{runtime → components/runtime}/views/assemblys/container/tabs/tabs-runtime.vue.js +0 -0
  206. /package/dist/es/{runtime → components/runtime}/views/assemblys/container/tools/tools-runtime.vue.js +0 -0
  207. /package/dist/es/{runtime → components/runtime}/views/assemblys/data/table/main-table-runtime.vue2.js +0 -0
  208. /package/dist/es/{runtime → components/runtime}/views/assemblys/data/table/sub-table-runtime.vue2.js +0 -0
  209. /package/dist/es/{runtime → components/runtime}/views/assemblys/data/table/table-runtime.vue.js +0 -0
  210. /package/dist/es/{runtime → components/runtime}/views/assemblys/error-render.vue.js +0 -0
  211. /package/dist/es/{runtime → components/runtime}/views/assemblys/error-render.vue2.js +0 -0
  212. /package/dist/es/{runtime → components/runtime}/views/assemblys/form/checkbox/checkbox-runtime.vue.js +0 -0
  213. /package/dist/es/{runtime → components/runtime}/views/assemblys/form/date-picker/datepicker-runtime.vue.js +0 -0
  214. /package/dist/es/{runtime → components/runtime}/views/assemblys/form/dept-tree/depttree-runtime.vue.js +0 -0
  215. /package/dist/es/{runtime → components/runtime}/views/assemblys/form/divider/divider-runtime.vue.js +0 -0
  216. /package/dist/es/{runtime → components/runtime}/views/assemblys/form/file-upload/fileupload-runtime.vue.js +0 -0
  217. /package/dist/es/{runtime → components/runtime}/views/assemblys/form/input-number/input-number-runtime.vue.js +0 -0
  218. /package/dist/es/{runtime → components/runtime}/views/assemblys/form/input-text/inputtext-runtime.vue.js +0 -0
  219. /package/dist/es/{runtime → components/runtime}/views/assemblys/form/label/label-runtime.vue.js +0 -0
  220. /package/dist/es/{runtime → components/runtime}/views/assemblys/form/link/link-runtime.vue.js +0 -0
  221. /package/dist/es/{runtime → components/runtime}/views/assemblys/form/placeholder/placeholder-runtime.vue.js +0 -0
  222. /package/dist/es/{runtime → components/runtime}/views/assemblys/form/placeholder/placeholder-runtime.vue2.js +0 -0
  223. /package/dist/es/{runtime → components/runtime}/views/assemblys/form/radio/radio-runtime.vue.js +0 -0
  224. /package/dist/es/{runtime → components/runtime}/views/assemblys/form/rich-text/richtext-runtime.vue.js +0 -0
  225. /package/dist/es/{runtime → components/runtime}/views/assemblys/form/select/select-runtime.vue.js +0 -0
  226. /package/dist/es/{runtime → components/runtime}/views/assemblys/form/switch/switch-runtime.vue.js +0 -0
  227. /package/dist/es/{runtime → components/runtime}/views/assemblys/form/tag/tag-runtime.vue.js +0 -0
  228. /package/dist/es/{runtime → components/runtime}/views/assemblys/form/textarea/textarea-runtime.vue.js +0 -0
  229. /package/dist/es/{runtime → components/runtime}/views/assemblys/object-render.vue2.js +0 -0
  230. /package/dist/es/{runtime → components/runtime}/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue.js +0 -0
  231. /package/dist/es/{runtime → components/runtime}/views/super-page.vue2.js +0 -0
  232. /package/dist/es/{super-page-dialog → components/super-page-dialog}/index.js +0 -0
  233. /package/dist/es/{super-page-dialog → components/super-page-dialog}/super-page-dialog.vue2.js +0 -0
  234. /package/dist/es/{wf-editor → components/wf-editor}/index.js +0 -0
  235. /package/dist/es/{assets → src/assets}/chart-themes/theme1.js +0 -0
  236. /package/dist/es/{assets → src/assets}/chart-themes/theme2.js +0 -0
  237. /package/dist/es/{assets → src/assets}/chart-themes/theme3.js +0 -0
  238. /package/dist/es/{components/runtime → src}/utils/api/api-util.d.ts +0 -0
  239. /package/dist/es/{runtime → src}/utils/api/api-util.js +0 -0
  240. /package/dist/es/{components/runtime → src}/utils/common-util.d.ts +0 -0
  241. /package/dist/es/{runtime → src}/utils/common-util.js +0 -0
  242. /package/dist/es/{runtime → src}/utils/events/event-util.js +0 -0
  243. /package/dist/es/{components/runtime → src}/utils/events/standard-event.d.ts +0 -0
  244. /package/dist/es/{runtime → src}/utils/events/standard-event.js +0 -0
  245. /package/dist/es/{components/runtime → src}/utils/events/validator-util.d.ts +0 -0
  246. /package/dist/es/{runtime → src}/utils/events/validator-util.js +0 -0
  247. /package/dist/es/{components/runtime → src}/utils/global-refs.d.ts +0 -0
  248. /package/dist/es/{runtime → src}/utils/global-refs.js +0 -0
  249. /package/dist/es/{components/runtime → src}/utils/interfaces/page-design-types.d.ts +0 -0
  250. /package/dist/es/{runtime → src}/utils/interfaces/page-design-types.js +0 -0
  251. /package/dist/es/{components/runtime → src}/utils/page-helper-util.d.ts +0 -0
  252. /package/dist/es/{runtime → src}/utils/page-helper-util.js +0 -0
  253. /package/dist/es/{components/runtime → src}/utils/page-init-util.d.ts +0 -0
  254. /package/dist/es/{runtime → src}/utils/page-init-util.js +0 -0
  255. /package/dist/es/{components/runtime → src}/utils/store-util.d.ts +0 -0
  256. /package/dist/es/{runtime → src}/utils/store-util.js +0 -0
  257. /package/dist/es/{components/runtime → src}/utils/store.d.ts +0 -0
  258. /package/dist/es/{runtime → src}/utils/store.js +0 -0
  259. /package/dist/es/{runtime → src}/utils/table-utils.js +0 -0
  260. /package/dist/lib/{index.js → components/index.js} +0 -0
  261. /package/dist/lib/{runtime → components/runtime}/index.js +0 -0
  262. /package/dist/lib/{runtime → components/runtime}/utils/assemblys-config.js +0 -0
  263. /package/dist/lib/{runtime → components/runtime}/views/assemblys/button/button/button-runtime.vue.js +0 -0
  264. /package/dist/lib/{runtime → components/runtime}/views/assemblys/button/button-group/buttongroup-runtime.vue.js +0 -0
  265. /package/dist/lib/{runtime → components/runtime}/views/assemblys/button/button-group/buttongroup-runtime.vue2.js +0 -0
  266. /package/dist/lib/{runtime → components/runtime}/views/assemblys/button/dropdown/dropdown-runtime.vue.js +0 -0
  267. /package/dist/lib/{runtime → components/runtime}/views/assemblys/chart/column-line/column-line-runtime.vue.js +0 -0
  268. /package/dist/lib/{runtime → components/runtime}/views/assemblys/chart/gauge/gauge-runtime.vue.js +0 -0
  269. /package/dist/lib/{runtime → components/runtime}/views/assemblys/chart/pie/pie-runtime.vue.js +0 -0
  270. /package/dist/lib/{runtime → components/runtime}/views/assemblys/chart/radar/radar-runtime.vue.js +0 -0
  271. /package/dist/lib/{runtime → components/runtime}/views/assemblys/chart/scatter/scatter-runtime.vue.js +0 -0
  272. /package/dist/lib/{runtime → components/runtime}/views/assemblys/common/export-form-report-dialog.vue2.js +0 -0
  273. /package/dist/lib/{runtime → components/runtime}/views/assemblys/common/remove-signer-dialog.vue.js +0 -0
  274. /package/dist/lib/{runtime → components/runtime}/views/assemblys/common/remove-signer-dialog.vue2.js +0 -0
  275. /package/dist/lib/{runtime → components/runtime}/views/assemblys/common/task-informition-dialog.vue.js +0 -0
  276. /package/dist/lib/{runtime → components/runtime}/views/assemblys/common/task-informition-dialog.vue2.js +0 -0
  277. /package/dist/lib/{runtime → components/runtime}/views/assemblys/container/card/card-runtime.vue.js +0 -0
  278. /package/dist/lib/{runtime → components/runtime}/views/assemblys/container/card/card-runtime.vue2.js +0 -0
  279. /package/dist/lib/{runtime → components/runtime}/views/assemblys/container/collapse/collapse-runtime.vue.js +0 -0
  280. /package/dist/lib/{runtime → components/runtime}/views/assemblys/container/container/container-runtime.vue.js +0 -0
  281. /package/dist/lib/{runtime → components/runtime}/views/assemblys/container/flex/flex-runtime.vue.js +0 -0
  282. /package/dist/lib/{runtime → components/runtime}/views/assemblys/container/form/form-runtime.vue.js +0 -0
  283. /package/dist/lib/{runtime → components/runtime}/views/assemblys/container/iframe/iframe-runtime.vue.js +0 -0
  284. /package/dist/lib/{runtime → components/runtime}/views/assemblys/container/tabs/tabs-runtime.vue.js +0 -0
  285. /package/dist/lib/{runtime → components/runtime}/views/assemblys/container/tools/tools-runtime.vue.js +0 -0
  286. /package/dist/lib/{runtime → components/runtime}/views/assemblys/data/table/main-table-runtime.vue2.js +0 -0
  287. /package/dist/lib/{runtime → components/runtime}/views/assemblys/data/table/sub-table-runtime.vue2.js +0 -0
  288. /package/dist/lib/{runtime → components/runtime}/views/assemblys/data/table/table-runtime.vue.js +0 -0
  289. /package/dist/lib/{runtime → components/runtime}/views/assemblys/error-render.vue.js +0 -0
  290. /package/dist/lib/{runtime → components/runtime}/views/assemblys/error-render.vue2.js +0 -0
  291. /package/dist/lib/{runtime → components/runtime}/views/assemblys/form/checkbox/checkbox-runtime.vue.js +0 -0
  292. /package/dist/lib/{runtime → components/runtime}/views/assemblys/form/date-picker/datepicker-runtime.vue.js +0 -0
  293. /package/dist/lib/{runtime → components/runtime}/views/assemblys/form/dept-tree/depttree-runtime.vue.js +0 -0
  294. /package/dist/lib/{runtime → components/runtime}/views/assemblys/form/divider/divider-runtime.vue.js +0 -0
  295. /package/dist/lib/{runtime → components/runtime}/views/assemblys/form/file-upload/fileupload-runtime.vue.js +0 -0
  296. /package/dist/lib/{runtime → components/runtime}/views/assemblys/form/input-number/input-number-runtime.vue.js +0 -0
  297. /package/dist/lib/{runtime → components/runtime}/views/assemblys/form/input-text/inputtext-runtime.vue.js +0 -0
  298. /package/dist/lib/{runtime → components/runtime}/views/assemblys/form/label/label-runtime.vue.js +0 -0
  299. /package/dist/lib/{runtime → components/runtime}/views/assemblys/form/link/link-runtime.vue.js +0 -0
  300. /package/dist/lib/{runtime → components/runtime}/views/assemblys/form/placeholder/placeholder-runtime.vue.js +0 -0
  301. /package/dist/lib/{runtime → components/runtime}/views/assemblys/form/placeholder/placeholder-runtime.vue2.js +0 -0
  302. /package/dist/lib/{runtime → components/runtime}/views/assemblys/form/radio/radio-runtime.vue.js +0 -0
  303. /package/dist/lib/{runtime → components/runtime}/views/assemblys/form/rich-text/richtext-runtime.vue.js +0 -0
  304. /package/dist/lib/{runtime → components/runtime}/views/assemblys/form/select/select-runtime.vue.js +0 -0
  305. /package/dist/lib/{runtime → components/runtime}/views/assemblys/form/switch/switch-runtime.vue.js +0 -0
  306. /package/dist/lib/{runtime → components/runtime}/views/assemblys/form/tag/tag-runtime.vue.js +0 -0
  307. /package/dist/lib/{runtime → components/runtime}/views/assemblys/form/textarea/textarea-runtime.vue.js +0 -0
  308. /package/dist/lib/{runtime → components/runtime}/views/assemblys/object-render.vue2.js +0 -0
  309. /package/dist/lib/{runtime → components/runtime}/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue.js +0 -0
  310. /package/dist/lib/{runtime → components/runtime}/views/super-page.vue2.js +0 -0
  311. /package/dist/lib/{super-page-dialog → components/super-page-dialog}/index.js +0 -0
  312. /package/dist/lib/{super-page-dialog → components/super-page-dialog}/super-page-dialog.vue2.js +0 -0
  313. /package/dist/lib/{wf-editor → components/wf-editor}/index.js +0 -0
  314. /package/dist/lib/{assets → src/assets}/chart-themes/theme1.js +0 -0
  315. /package/dist/lib/{assets → src/assets}/chart-themes/theme2.js +0 -0
  316. /package/dist/lib/{assets → src/assets}/chart-themes/theme3.js +0 -0
  317. /package/dist/lib/{components/runtime → src}/utils/api/api-util.d.ts +0 -0
  318. /package/dist/lib/{runtime → src}/utils/api/api-util.js +0 -0
  319. /package/dist/lib/{components/runtime → src}/utils/common-util.d.ts +0 -0
  320. /package/dist/lib/{runtime → src}/utils/common-util.js +0 -0
  321. /package/dist/lib/{runtime → src}/utils/events/event-util.js +0 -0
  322. /package/dist/lib/{components/runtime → src}/utils/events/standard-event.d.ts +0 -0
  323. /package/dist/lib/{runtime → src}/utils/events/standard-event.js +0 -0
  324. /package/dist/lib/{components/runtime → src}/utils/events/validator-util.d.ts +0 -0
  325. /package/dist/lib/{runtime → src}/utils/events/validator-util.js +0 -0
  326. /package/dist/lib/{components/runtime → src}/utils/global-refs.d.ts +0 -0
  327. /package/dist/lib/{runtime → src}/utils/global-refs.js +0 -0
  328. /package/dist/lib/{components/runtime → src}/utils/interfaces/page-design-types.d.ts +0 -0
  329. /package/dist/lib/{runtime → src}/utils/interfaces/page-design-types.js +0 -0
  330. /package/dist/lib/{components/runtime → src}/utils/page-helper-util.d.ts +0 -0
  331. /package/dist/lib/{runtime → src}/utils/page-helper-util.js +0 -0
  332. /package/dist/lib/{components/runtime → src}/utils/page-init-util.d.ts +0 -0
  333. /package/dist/lib/{runtime → src}/utils/page-init-util.js +0 -0
  334. /package/dist/lib/{components/runtime → src}/utils/store-util.d.ts +0 -0
  335. /package/dist/lib/{runtime → src}/utils/store-util.js +0 -0
  336. /package/dist/lib/{components/runtime → src}/utils/store.d.ts +0 -0
  337. /package/dist/lib/{runtime → src}/utils/store.js +0 -0
  338. /package/dist/lib/{runtime → src}/utils/table-utils.js +0 -0
@@ -0,0 +1,2075 @@
1
+ import {
2
+ isArrayFn,
3
+ getBaseUrl,
4
+ getRealRestApiPath,
5
+ upperFirstCase,
6
+ packageTemplateFiles
7
+ } from '../common-util'
8
+ import http from 'agilebuilder-ui/src/utils/request'
9
+ import { getI18n } from 'agilebuilder-ui/src/utils/util'
10
+ import { ElMessage, ElMessageBox } from 'element-plus'
11
+ import { useRoute } from 'vue-router'
12
+ import { setSessionCache, getToken } from 'agilebuilder-ui/src/utils/auth'
13
+ import { getComponentRef } from '../../utils/global-refs'
14
+ // import eventBus from '../eventBus'
15
+ import axios from 'axios'
16
+ import { doAfterClickEvent } from './event-util'
17
+ import { setStoreInfo } from '../store-util'
18
+
19
+ export const standardEvents = {
20
+ // 表单标准事件保存save
21
+ save: function (params) {
22
+ console.log('表单标准事件保存save--params=', params)
23
+ return saveFunc(params, false)
24
+ },
25
+ // 列表标准事件保存saveList
26
+ saveList: function (params) {
27
+ console.log('列表标准事件保存saveList--params=', params)
28
+ return saveFunc(params, true)
29
+ },
30
+ // 表单标准事件导出报告exportForm
31
+ exportForm: function (params) {
32
+ console.log('表单标准事件导出报告exportForm--params=', params)
33
+ const pageContext = params.pageContext
34
+ const pagCode = pageContext.code
35
+ const eventPageInfo = pagCode + '_'
36
+ window['$eventBus'].$emit(eventPageInfo + 'export-form-report', params)
37
+ },
38
+ // 表单标准事件导出报告exportPDF
39
+ exportPDF: function (params) {
40
+ console.log('表单标准事件导出报告exportPDF--params=', params)
41
+ const pageContext = params.pageContext
42
+ const pagCode = pageContext.code
43
+ const eventPageInfo = pagCode + '_'
44
+ // TODO: 导出pdf功能待实现
45
+ // window['$eventBus'].$emit(eventPageInfo +'export-pdf-report', params)
46
+ },
47
+ // 表单标准事件提交submit
48
+ submit: function (params) {
49
+ console.log('表单标准事件提交submit--params=', params)
50
+ return submitForm(params, false, 'submit', '/dsc/commons/submits')
51
+ },
52
+ // 列表标准事件提交submitList
53
+ submitList: function (params) {
54
+ console.log('列表标准事件提交submitList--params=', params)
55
+ return submitForm(params, true, 'submit', '/dsc/commons/batch-submits')
56
+ },
57
+ // 表单标准事件同意agree
58
+ agree: function (params) {
59
+ console.log('表单标准事件同意agree--params=', params)
60
+ return submitForm(params, false, 'agree', '/dsc/commons/approves')
61
+ },
62
+ // 列表标准事件同意agreeList
63
+ agreeList: function (params) {
64
+ console.log('列表标准事件同意agreeList--params=', params)
65
+ return submitForm(params, true, 'agree', '/dsc/commons/batch-approves')
66
+ },
67
+ // 表单标准事件不同意disagree
68
+ disagree: function (params) {
69
+ console.log('表单标准事件不同意disagree--params=', params)
70
+ return submitForm(params, false, 'disagree', '/dsc/commons/refuses')
71
+ },
72
+ // 列表标准事件不同意disagreeList
73
+ disagreeList: function (params) {
74
+ console.log('列表标准事件不同意disagreeList--params=', params)
75
+ return submitForm(params, true, 'disagree', '/dsc/commons/batch-refuses')
76
+ },
77
+ // TODO: 待页面跳转功能完善后再实现
78
+ back: function (params) {
79
+ console.log('表单标准事件返回back--params=', params)
80
+ // this.closePage(this.pageCode, button.successOperation, formData)
81
+ },
82
+ // 列表标准事件删除delete
83
+ delete: function (params) {
84
+ console.log('列表标准事件删除delete--params=', params)
85
+ return deleteFunc(params)
86
+ },
87
+ // 列表标准事件下载导入模板downloadTemplate
88
+ downloadTemplate: function (params) {
89
+ console.log('列表标准事件下载导入模板downloadTemplate--params=', params)
90
+ downloadTemplateFunc(params)
91
+ },
92
+ // 列表标准事件 导入import
93
+ import: function (params) {
94
+ console.log('列表标准事件 导入import--params=', params)
95
+ const pageContext = params.pageContext
96
+ const pagCode = pageContext.code
97
+ const eventPageInfo = pagCode + '_'
98
+ window['$eventBus'].$emit(eventPageInfo + 'import-file', params)
99
+ },
100
+ // 列表标准事件 导出export
101
+ export: function (params) {
102
+ console.log('列表标准事件 导出export--params=', params)
103
+ return exportFunc(params)
104
+ },
105
+ // 列表标准事件 查询search
106
+ search: function (params) {
107
+ console.log('列表标准事件 查询search--params=', params)
108
+ const pageContext = params.pageContext
109
+ const tableUuid = params.tableUuid
110
+ const gridRef = getComponentRef(pageContext, tableUuid)
111
+ gridRef.refresh()
112
+ },
113
+ // 流程表单标准事件 暂存workflowSave
114
+ workflowSave: function (params) {
115
+ console.log('流程表单标准事件 暂存workflowSave--params=', params)
116
+ return workflowSaveFunc(params)
117
+ },
118
+ // 流程表单标准事件 提交流程submitProcess
119
+ submitProcess: function (params) {
120
+ console.log('流程表单标准事件 提交流程submitProcess--params=', params)
121
+ return submitProcessFunc(params)
122
+ },
123
+ // 流程表单标准事件 提交任务submitTask
124
+ submitTask: function (params) {
125
+ console.log('流程表单标准事件 提交任务submitTask--params=', params)
126
+ return completeTaskFunc(params, 'SUBMIT')
127
+ },
128
+ // 流程表单标准事件 同意approve
129
+ approve: function (params) {
130
+ console.log('流程表单标准事件 同意approve--params=', params)
131
+ return completeTaskFunc(params, 'APPROVE')
132
+ },
133
+ // 流程表单标准事件 不同意refuse
134
+ refuse: function (params) {
135
+ console.log('流程表单标准事件 不同意refuse--params=', params)
136
+ return completeTaskFunc(params, 'REFUSE')
137
+ },
138
+ // 流程表单标准事件 已阅readed
139
+ readed: function (params) {
140
+ console.log('流程表单标准事件 已阅readed--params=', params)
141
+ return completeTaskFunc(params, 'READED')
142
+ },
143
+ // 流程表单标准事件 赞成agreemen
144
+ agreement: function (params) {
145
+ console.log('流程表单标准事件 赞成agreement--params=', params)
146
+ return completeTaskFunc(params, 'AGREEMENT')
147
+ },
148
+ // 流程表单标准事件 反对oppose
149
+ oppose: function (params) {
150
+ console.log('流程表单标准事件 反对oppose--params=', params)
151
+ return completeTaskFunc(params, 'OPPOSE')
152
+ },
153
+ // 流程表单标准事件 弃权kiken
154
+ kiken: function (params) {
155
+ console.log('流程表单标准事件 弃权kiken--params=', params)
156
+ return completeTaskFunc(params, 'KIKEN')
157
+ },
158
+ // 流程表单标准事件 指派assign
159
+ assign: function (params) {
160
+ console.log('流程表单标准事件 指派assign--params=', params)
161
+ return assignTask(params)
162
+ },
163
+ // 流程表单标准事件 抄送copyTask
164
+ copyTask: function (params) {
165
+ console.log('流程表单标准事件 抄送copyTask--params=', params)
166
+ return createCopyTask(params)
167
+ },
168
+ // 流程表单标准事件 加签addSigner
169
+ addSigner: function (params) {
170
+ console.log('流程表单标准事件 加签addSigner--params=', params)
171
+ return addSignerFunc(params)
172
+ },
173
+ // 流程表单标准事件 领取drawTask
174
+ drawTask: function (params) {
175
+ console.log('流程表单标准事件 领取drawTask--params=', params)
176
+ return drawTaskFunc(params)
177
+ },
178
+ // 放弃领取abandonReceive
179
+ abandonReceive: function (params) {
180
+ console.log('流程表单标准事件 放弃领取abandonReceive--params=', params)
181
+ return abandonReceiveFunc(params)
182
+ },
183
+ // 流程表单标准事件 驳回returnToPreviousTask
184
+ returnToPreviousTask: function (params) {
185
+ console.log('流程表单标准事件 驳回returnToPreviousTask--params=', params)
186
+ return returnToPreviousTaskFunc(params)
187
+ },
188
+ // 流程表单标准事件 强制结束endInstance
189
+ endInstance: function (params) {
190
+ console.log('流程表单标准事件 强制结束endInstance--params=', params)
191
+ return endInstanceFunc(params)
192
+ },
193
+ // 流程表单标准事件 退回returnTaskTo
194
+ returnTaskTo: function (params) {
195
+ console.log('流程表单标准事件 退回returnTaskTo--params=', params)
196
+ return returnTaskToFunc(params)
197
+ },
198
+ // 流程表单标准事件 减签removeSigner
199
+ removeSigner: function (params) {
200
+ console.log('流程表单标准事件 减签removeSigner--params=', params)
201
+ return removeSignerfunc(params)
202
+ },
203
+ // 流程表单标准事件 取回retrieveTask
204
+ retrieveTask: function (params) {
205
+ console.log('流程表单标准事件 取回retrieveTask--params=', params)
206
+ return retrieveTaskFunc(params)
207
+ },
208
+ viewDetail: function (params) {
209
+ // TODO: 查看详情,打开表单所有字段禁止编辑的功能
210
+ },
211
+ lineEditCreate: function (params) {
212
+ console.log('列表行编辑 新建lineEditCreate--params=', params)
213
+ return lineEditCreateFunc(params)
214
+ }
215
+ }
216
+
217
+ // 导出报告按钮实现
218
+ export function exportFormReport(pageContext, configureObj, templateFile, isPdf) {
219
+ const templateUUID = templateFile.templateUUID
220
+ const fileName = templateFile.templateShowPath
221
+ const system = pageContext.system
222
+ const logSetting = configureObj.props.logSetting
223
+ const additionalParamMap = pageContext.entity.request
224
+ const isWorkflowForm = pageContext.workflowCode ? true : false
225
+ const beanName = pageContext.beanName
226
+ const button = configureObj.props.base
227
+ const tableName = configureObj.tableName
228
+
229
+ // 通过getViewModels获得处理了下拉框、复选框的值之后的表单数据,用于导出报告使用
230
+ // TODO: this.$refs.superForm.getViewModels()待实现
231
+ // this.$refs.superForm.getViewModels().then(async (viewModels) => {
232
+ // TODO: viewModels获得方式待实现,处理下拉框值处理、值为数组的字段的值
233
+ const viewModels = pageContext.entity.data
234
+ const isPermission =
235
+ button.isPermission === undefined || button.isPermission === 'true' || button.isPermission
236
+ const param = {
237
+ entity: viewModels,
238
+ fileName: templateUUID, // uuid
239
+ showName: fileName, // 下载的文件名称
240
+ beanName,
241
+ isWorkflowForm, // 是否是流程表单
242
+ functionCode: button.functionCode,
243
+ tableName,
244
+ isPermission: isPermission + '',
245
+ systemCode: system.code,
246
+ tableNames: pageContext.tableNames
247
+ }
248
+ // 添加日志
249
+ if (logSetting) {
250
+ param['logSettingText'] = logSetting
251
+ }
252
+ if (additionalParamMap) {
253
+ param['additionalParamMap'] = additionalParamMap
254
+ }
255
+ let exportResult
256
+ if (isPdf) {
257
+ exportResult = exportFormPdf(fileName, system, param)
258
+ } else {
259
+ exportResult = exportFormReportSuccess(fileName, system, param)
260
+ }
261
+ if (exportResult) {
262
+ exportResult.then(() => {
263
+ doAfterClickEvent(pageContext, configureObj)
264
+ })
265
+ }
266
+ // })
267
+ }
268
+ function exportFormReportSuccess(fileName, system, param) {
269
+ return new Promise((resolve, reject) => {
270
+ const baseUrl = getBaseUrl(system)
271
+ const path = baseUrl + '/dsc/commons/export-reports'
272
+ axios.defaults.headers.common.Authorization = getToken()
273
+ const request = axios.post(path, param, {
274
+ headers: {
275
+ 'content-type': 'application/x-www-form-urlencoded'
276
+ },
277
+ responseType: 'blob'
278
+ })
279
+ request
280
+ .then((response) => {
281
+ const blob = new Blob([response.data])
282
+ let fileNameTwo = '报告.xlsx'
283
+ if (fileName) {
284
+ fileNameTwo = fileName
285
+ }
286
+ const elink = document.createElement('a')
287
+ elink.download = fileNameTwo
288
+ elink.style.display = 'none'
289
+ elink.target = '_blank'
290
+ elink.href = URL.createObjectURL(blob)
291
+ document.body.appendChild(elink)
292
+ elink.click()
293
+ URL.revokeObjectURL(elink.href) // 释放URL对象
294
+ document.body.removeChild(elink)
295
+ resolve(true)
296
+ })
297
+ .catch((error) => {
298
+ reject(error)
299
+ })
300
+ })
301
+ }
302
+
303
+ // 导出报告按钮实现
304
+ function exportFormPdf(fileName, system, param) {
305
+ return new Promise((resolve, reject) => {
306
+ const baseUrl = getBaseUrl(system)
307
+ const path = baseUrl + '/dsc/commons/export-pdf'
308
+ axios.defaults.headers.common.Authorization = getToken()
309
+ const request = axios.post(path, param, {
310
+ headers: {
311
+ 'content-type': 'application/x-www-form-urlencoded'
312
+ },
313
+ responseType: 'blob'
314
+ })
315
+ request
316
+ .then((response) => {
317
+ const blob = new Blob([response.data])
318
+ const elink = document.createElement('a')
319
+ elink.download = fileName.substring(0, fileName.lastIndexOf('.')) + '.pdf'
320
+ elink.style.display = 'none'
321
+ elink.target = '_blank'
322
+ elink.href = URL.createObjectURL(blob)
323
+ document.body.appendChild(elink)
324
+ elink.click()
325
+ URL.revokeObjectURL(elink.href) // 释放URL对象
326
+ document.body.removeChild(elink)
327
+ resolve(true)
328
+ })
329
+ .catch((error) => {
330
+ reject(error)
331
+ })
332
+ })
333
+ }
334
+
335
+ function saveFunc(params, isListButton) {
336
+ return new Promise((resolve, reject) => {
337
+ const pageContext = params.pageContext
338
+ const configureObj = params.configureObj
339
+ // 行编辑保存需要的
340
+ const mainDefaultValueColumns = params.mainDefaultValueColumns
341
+ // 列表动态列信息
342
+ const dynamicColumnInfo = params.dynamicColumnInfo
343
+ // 成功后页面处理方式
344
+ const successOperation = configureObj.props.base.successOperation
345
+ // false表示控制version,true表示不控制version
346
+ let isUnControlVersion = false
347
+ if (successOperation && successOperation === 'noOperation') {
348
+ // 如果是按钮操作后是“无操作”,则不控制version的值,否则会报“记录被其它事务修改”的异常
349
+ isUnControlVersion = true
350
+ }
351
+ const request = getSaveFormRequest(
352
+ pageContext,
353
+ configureObj,
354
+ '/dsc/commons',
355
+ isUnControlVersion,
356
+ mainDefaultValueColumns,
357
+ dynamicColumnInfo
358
+ )
359
+ if (request) {
360
+ request
361
+ .then((data) => {
362
+ dealAfterOperate(
363
+ pageContext,
364
+ configureObj,
365
+ data,
366
+ 'superPageRuntimeMessage.successfulSave',
367
+ isListButton
368
+ )
369
+ resolve(data)
370
+ })
371
+ .catch((error) => {
372
+ reject(error)
373
+ })
374
+ } else {
375
+ reject('保存时request不存在')
376
+ }
377
+ })
378
+ }
379
+
380
+ // 自定义系统时,封装CommonEntity参数
381
+ function getCommonFormRequestParam(
382
+ pageContext,
383
+ configureObj,
384
+ isUnControlVersion,
385
+ mainDefaultValueColumns,
386
+ dynamicColumnInfo,
387
+ ids
388
+ ) {
389
+ const isWorkflow = pageContext.workflowCode ? true : false
390
+ const system = pageContext.system
391
+ // 自定义系统时,封装CommonEntity
392
+ const isPermission =
393
+ configureObj.props.base.isPermission === undefined ||
394
+ configureObj.props.base.isPermission === 'true' ||
395
+ configureObj.props.base.isPermission
396
+ const param = {
397
+ entity: pageContext.entity.data,
398
+ pageModel: pageContext.entity.page,
399
+ tableName: pageContext.tableName,
400
+ formNoRuleCode: pageContext.formNoRuleCode,
401
+ isWorkflowEntity: isWorkflow,
402
+ functionCode: configureObj.props.base.functionCode,
403
+ isPermission: isPermission + '',
404
+ tableNames: pageContext.tableNames
405
+ }
406
+ if (ids) {
407
+ param['ids'] = ids
408
+ }
409
+ if (pageContext.judgeHeavyList) {
410
+ // 判重组合字段配置
411
+ if (isArrayFn(pageContext.judgeHeavyList)) {
412
+ param['judgeHeavyList'] = JSON.stringify(pageContext.judgeHeavyList)
413
+ } else {
414
+ param['judgeHeavyList'] = pageContext.judgeHeavyList
415
+ }
416
+ }
417
+ const conversionCodes = configureObj.props.base.conversionCodes
418
+ if (conversionCodes) {
419
+ // 数据转换规则
420
+ if (isArrayFn(conversionCodes)) {
421
+ param['dataConversionRule'] = conversionCodes.join(',')
422
+ } else if (typeof conversionCodes === 'string') {
423
+ param['dataConversionRule'] = conversionCodes
424
+ }
425
+ }
426
+ const autoSetValueData = configureObj.props.base.setValueList
427
+ if (autoSetValueData) {
428
+ // 自动设值
429
+ if (isArrayFn(autoSetValueData)) {
430
+ param['autoSetValueData'] = autoSetValueData.join(',')
431
+ } else if (typeof autoSetValueData === 'string') {
432
+ param['autoSetValueData'] = autoSetValueData
433
+ }
434
+ }
435
+ // 添加日志
436
+ const logSetting = configureObj.props.logSetting
437
+ if (logSetting) {
438
+ param['logSettingText'] = logSetting
439
+ }
440
+ if (!param['systemCode']) {
441
+ param['systemCode'] = system.code
442
+ }
443
+ const beanName = configureObj.props.base.beanName
444
+ if (beanName) {
445
+ // 表示需要重写后台保存的实现
446
+ param['beanName'] = beanName
447
+ }
448
+ // TODO: needDeleteFileUuid后面再完善,表单中删除的附件,且没有实时删除数据库中的附件时
449
+ // if (needDeleteFileUuidS) {
450
+ // param.needDeleteFileUuidS = needDeleteFileUuidS
451
+ // }
452
+ // TODO: 根据数据表缓存dataTypeMap到redis中,提升保存速度,修改后台接口,前端不需要传了
453
+ // if (this.dataTypeMap) {
454
+ // param.dataTypeMap = this.dataTypeMap
455
+ // }
456
+ if (dynamicColumnInfo) {
457
+ param['dynamicColumnInfo'] = dynamicColumnInfo
458
+ }
459
+ if (mainDefaultValueColumns) {
460
+ param['mainDefaultValueColumns'] = mainDefaultValueColumns
461
+ }
462
+ const additionalParamMap = pageContext.entity.request
463
+ if (additionalParamMap) {
464
+ param['additionalParamMap'] = additionalParamMap
465
+ }
466
+ if (isUnControlVersion !== undefined) {
467
+ param['unControlVersion'] = isUnControlVersion
468
+ }
469
+ return param
470
+ }
471
+
472
+ // 获得普通表单保存时的request请求,表单页面和行编辑保存时使用了
473
+ export function getSaveFormRequest(
474
+ pageContext,
475
+ configureObj,
476
+ url,
477
+ isUnControlVersion,
478
+ mainDefaultValueColumns,
479
+ dynamicColumnInfo
480
+ ) {
481
+ const system = pageContext.system
482
+ // 自定义系统时,封装CommonEntity
483
+ const param = getCommonFormRequestParam(
484
+ pageContext,
485
+ configureObj,
486
+ isUnControlVersion,
487
+ mainDefaultValueColumns,
488
+ dynamicColumnInfo,
489
+ null
490
+ )
491
+ return getSaveFormRequestByParam(system, param, url, pageContext.entity.data)
492
+ }
493
+
494
+ // 获得普通表单保存时的request请求,表单页面和行编辑保存时使用了
495
+ function getSaveFormRequestByParam(system, param, url, formData) {
496
+ // 表示是自定义系统
497
+ const baseUrl = getBaseUrl(system)
498
+ let path = baseUrl + url
499
+ path = getRealRestApiPath(path, system)
500
+ let request
501
+ if (formData && (formData.id || formData.ID)) {
502
+ // 表示是修改操作
503
+ request = http.put(path, param)
504
+ } else {
505
+ // 表示是新建操作
506
+ request = http.post(path, param)
507
+ }
508
+ return request
509
+ }
510
+ /**
511
+ * 按钮执行后页面处理方式:刷新、关闭弹框等等
512
+ * @param pageContext
513
+ * @param configureObj
514
+ * @param data
515
+ * @param successTip
516
+ * @param isListButton
517
+ */
518
+ export function dealAfterOperate(
519
+ pageContext,
520
+ configureObj,
521
+ data,
522
+ successTip,
523
+ isListButton?: boolean
524
+ ) {
525
+ if (isListButton === undefined) {
526
+ isListButton = configureObj.props.base.tableUuid ? true : false
527
+ }
528
+ if (isListButton) {
529
+ // 表示是列表的按钮
530
+ dealAfterWithList(pageContext, configureObj, data, successTip)
531
+ } else {
532
+ // 表示是表单的按钮
533
+ dealAfterWithForm(pageContext, configureObj, data, successTip)
534
+ }
535
+ }
536
+
537
+ function dealAfterWithForm(pageContext, configureObj, data, successTip) {
538
+ if (data) {
539
+ const commonEntity = data
540
+ let dataModel
541
+ if (commonEntity.entity) {
542
+ dataModel = commonEntity.entity
543
+ }
544
+ if (commonEntity.formNo) {
545
+ // 获得表单编码规则解析结果
546
+ // TODO: 临时表单编码处理
547
+ pageContext.initFormNo = commonEntity.formNo
548
+ }
549
+ afterSuccessOperateInForm(pageContext, configureObj, dataModel)
550
+ }
551
+ // TODO: 刷新按钮
552
+ // this.reviewButton()
553
+ if (successTip) {
554
+ ElMessage({
555
+ message: getI18n().t(successTip),
556
+ type: 'success',
557
+ showClose: true
558
+ })
559
+ }
560
+ }
561
+
562
+ // 表单页面“成功后” 操作
563
+ function afterSuccessOperateInForm(pageContext, configureObj, dataModel) {
564
+ let successOperation = configureObj.props.base.successOperation
565
+ const isNeedValueMapping = configureObj.props.base.isNeedValueMapping
566
+ console.log(
567
+ 'afterSuccessOperateInForm---successOperation=-',
568
+ successOperation,
569
+ dataModel,
570
+ isNeedValueMapping
571
+ )
572
+ const isWorkflowForm = pageContext.workflowCode ? true : false
573
+ if (!successOperation || successOperation === '' || successOperation === null) {
574
+ // 如果没有配置“成功后”操作,则默认是刷新
575
+ successOperation = 'refresh'
576
+ }
577
+ if (successOperation === 'noOperation') {
578
+ // 无操作时,更新表单内容
579
+ // 必须加这个代码,否则会导致表单不能连续保存
580
+ if (dataModel) {
581
+ // TODO: 保存后刷新表单的记录是否这样更新,需要测试
582
+ pageContext.entity.data = dataModel
583
+ // this.$refs.superForm.refresh(formData)
584
+ }
585
+ } else if (successOperation === 'refresh') {
586
+ // 重新加载表单,解决子表权限问题
587
+ if (dataModel && (dataModel.id || dataModel.ID)) {
588
+ // dataId 是父组件传过来的字段,直接赋值控制台会报错
589
+ // this.dataId = formData.ID == null ? formData.id : formData.ID
590
+ const dataIdSessio = dataModel.ID == null ? dataModel.id : dataModel.ID
591
+ const route = useRoute()
592
+ if (route.query._t_) {
593
+ setSessionCache(route.query._t_ + '_id', dataIdSessio)
594
+ }
595
+ // TODO: 回调事件刷新
596
+ // if (isWorkflowForm) {
597
+ // this.initWorkflowFormData()
598
+ // } else {
599
+ // this.getDscFormData()
600
+ // }
601
+ }
602
+ } else if (successOperation === 'closeWindow' || successOperation === 'closeWindowAndRefresh') {
603
+ // 关闭弹框Dialog
604
+ console.log('afterSuccessOperateInForm--successOperation=--', successOperation)
605
+ // TODO: 待页面功能完成后再加
606
+ // if (
607
+ // isNeedValueMapping !== undefined &&
608
+ // isNeedValueMapping === true &&
609
+ // formData &&
610
+ // formData !== undefined
611
+ // ) {
612
+ // // 如果需要回填值,将事件抛出,让父页面捕获,直到弹框页面捕获
613
+ // let jumpInfo = sessionStorage.getItem(this.pageCode + '-jumpMode')
614
+ // // console.log('---update-value-afterSuccessOperateInForm---jumpInfo=', jumpInfo)
615
+ // let rowIndex
616
+ // if (jumpInfo) {
617
+ // const jumpInfoObj = JSON.parse(jumpInfo)
618
+ // // 该弹框页面的父页面是列表组件的某记录时,用于回填列表记录值使用
619
+ // rowIndex = jumpInfoObj.rowIndex
620
+ // }
621
+ // $emit(this, 'update-value', formData, this.tableName, rowIndex)
622
+ // }
623
+ // this.closePage(this.pageCode, successOperation, formData)
624
+ }
625
+ }
626
+
627
+ function dealAfterWithList(pageContext, configureObj, row, successTip) {
628
+ let successOperation = configureObj.props.base.successOperation
629
+ const isNeedValueMapping = configureObj.props.base.isNeedValueMapping
630
+ const tableUuid = configureObj.props.base.tableUuid
631
+ if (!successOperation) {
632
+ successOperation = 'refresh'
633
+ }
634
+ console.log('dealAfterWithList--')
635
+ if (successOperation === 'refresh') {
636
+ // 刷新列表
637
+ if (tableUuid) {
638
+ const gridRef = getComponentRef(pageContext, tableUuid)
639
+ gridRef.refresh()
640
+ } else {
641
+ console.error('tableUuid is empty')
642
+ }
643
+ } else if (successOperation === 'closeWindow' || successOperation === 'closeWindowAndRefresh') {
644
+ // 关闭弹框Dialog
645
+ // TODO: 待页面功能完成后再加
646
+ // if (
647
+ // isNeedValueMapping !== undefined &&
648
+ // isNeedValueMapping === true &&
649
+ // row &&
650
+ // row !== undefined
651
+ // ) {
652
+ // // 如果需要回填值,将事件抛出,让父页面捕获,直到弹框页面捕获
653
+ // const jumpInfo = sessionStorage.getItem(this.pageCode + '-jumpMode')
654
+ // console.log('---update-value-closePage---jumpInfo=', jumpInfo)
655
+ // let rowIndex
656
+ // if (jumpInfo) {
657
+ // const jumpInfoObj = JSON.parse(jumpInfo)
658
+ // // 该弹框页面的父页面是列表组件的某记录时,用于回填列表记录值使用
659
+ // rowIndex = jumpInfoObj.rowIndex
660
+ // }
661
+ // $emit(this, 'update-value', row, this.tableName, rowIndex)
662
+ // }
663
+ // this.closePage(this.pageCode, successOperation)
664
+ }
665
+ if (successTip) {
666
+ ElMessage({
667
+ message: getI18n().t(successTip),
668
+ type: 'success',
669
+ showClose: true
670
+ })
671
+ }
672
+ }
673
+ /**
674
+ *
675
+ * @param params
676
+ * @param isListButton
677
+ * @param eventName submit、agree、disagree,国际化时使用
678
+ * @returns
679
+ */
680
+ function submitForm(params, isListButton, eventName, url) {
681
+ return new Promise((resolve, reject) => {
682
+ const pageContext = params.pageContext
683
+ const configureObj = params.configureObj
684
+ // 行编辑保存需要的
685
+ const mainDefaultValueColumns = params.mainDefaultValueColumns
686
+ // 列表动态列信息
687
+ const dynamicColumnInfo = params.dynamicColumnInfo
688
+ // 列表选中记录id集合
689
+ const ids = params.ids
690
+ // 成功后页面处理方式
691
+ const successOperation = configureObj.props.base.successOperation
692
+ // false表示控制version,true表示不控制version
693
+ let isUnControlVersion = false
694
+ if (successOperation && successOperation === 'noOperation') {
695
+ // 如果是按钮操作后是“无操作”,则不控制version的值,否则会报“记录被其它事务修改”的异常
696
+ isUnControlVersion = true
697
+ }
698
+ const request = getSubmitFormRequest(
699
+ pageContext,
700
+ configureObj,
701
+ url,
702
+ isUnControlVersion,
703
+ mainDefaultValueColumns,
704
+ dynamicColumnInfo,
705
+ eventName,
706
+ ids
707
+ )
708
+ if (request) {
709
+ request
710
+ .then((data) => {
711
+ dealAfterOperate(
712
+ pageContext,
713
+ configureObj,
714
+ data,
715
+ 'superPageRuntimeMessage.successfulSave',
716
+ isListButton
717
+ )
718
+ resolve(data)
719
+ })
720
+ .catch((error) => {
721
+ reject(error)
722
+ })
723
+ } else {
724
+ reject('request不存在')
725
+ }
726
+ })
727
+ }
728
+
729
+ function getSubmitFormRequest(
730
+ pageContext,
731
+ configureObj,
732
+ url,
733
+ isUnControlVersion,
734
+ mainDefaultValueColumns,
735
+ dynamicColumnInfo,
736
+ eventName,
737
+ ids
738
+ ) {
739
+ return new Promise((resolve, reject) => {
740
+ // TODO: 按钮名称国际化显示
741
+ const buttonName = configureObj.props.base.title
742
+ const operationI18nTip = 'superPageRuntimeMessage.whetherToConfirm' + upperFirstCase(eventName)
743
+ ElMessageBox.confirm(
744
+ getI18n().t(operationI18nTip, { name: buttonName }),
745
+ getI18n().t('superPageRuntimeMessage.tips'),
746
+ {
747
+ confirmButtonText: getI18n().t('superPageRuntimeMessage.sure'),
748
+ cancelButtonText: getI18n().t('superPageRuntimeMessage.cancel'),
749
+ type: 'warning'
750
+ }
751
+ )
752
+ .then(() => {
753
+ const system = pageContext.system
754
+ // 自定义系统时,封装CommonEntity
755
+ const param = getCommonFormRequestParam(
756
+ pageContext,
757
+ configureObj,
758
+ isUnControlVersion,
759
+ mainDefaultValueColumns,
760
+ dynamicColumnInfo,
761
+ ids
762
+ )
763
+ getSaveFormRequestByParam(system, param, url, pageContext.entity.data)
764
+ .then((result) => {
765
+ resolve(result)
766
+ })
767
+ .catch((error) => {
768
+ reject(error)
769
+ })
770
+ })
771
+ .catch(() => {
772
+ // 点击取消按钮的回调
773
+ reject('点击了取消按钮')
774
+ })
775
+ })
776
+ }
777
+
778
+ // 列表工具栏删除按钮
779
+ function deleteFunc(params) {
780
+ return new Promise((resolve, reject) => {
781
+ const ids = params.ids
782
+ if (!ids || ids.length === 0) {
783
+ ElMessage({
784
+ showClose: true,
785
+ type: 'warning',
786
+ message: getI18n().t('superPageRuntimeMessage.pleaseSelectRecord')
787
+ })
788
+ return
789
+ }
790
+ ElMessageBox.confirm(
791
+ getI18n().t('superPageRuntimeMessage.whetherToConfirmDeletion'),
792
+ getI18n().t('superPageRuntimeMessage.tips'),
793
+ {
794
+ confirmButtonText: getI18n().t('superPageRuntimeMessage.sure'),
795
+ cancelButtonText: getI18n().t('superPageRuntimeMessage.cancel'),
796
+ type: 'warning'
797
+ }
798
+ )
799
+ .then(() => {
800
+ const pageContext = params.pageContext
801
+ const configureObj = params.configureObj
802
+ const system = pageContext.entity.system
803
+ const tableName = pageContext.tableName
804
+ const configureBase = configureObj.props.base
805
+ // 自定义系统
806
+ const baseUrl = getBaseUrl(system)
807
+ let path = baseUrl + '/dsc/commons/' + tableName
808
+ path = getRealRestApiPath(path, system)
809
+ const isPermission =
810
+ configureBase.isPermission === undefined ||
811
+ configureBase.isPermission === 'true' ||
812
+ configureBase.isPermission
813
+ const isWorkflow = pageContext.workflowCode ? true : false
814
+ const param = {
815
+ ids: ids,
816
+ functionCode: configureBase.functionCode,
817
+ isPermission: isPermission + '',
818
+ systemCode: system.code,
819
+ isWorkflowEntity: isWorkflow,
820
+ tableNames: pageContext.tableNames
821
+ }
822
+ if (configureBase.beanName) {
823
+ // 表示需要重写删除的实现
824
+ param['beanName'] = configureBase.beanName
825
+ }
826
+ const deleteLogicSetting = configureObj.props.deleteLogicSetting
827
+ if (deleteLogicSetting) {
828
+ if (typeof deleteLogicSetting === 'object') {
829
+ param['deleteLogicSetting'] = JSON.stringify(deleteLogicSetting)
830
+ } else if (typeof deleteLogicSetting === 'string') {
831
+ param['deleteLogicSetting'] = deleteLogicSetting
832
+ }
833
+ }
834
+ const logSetting = configureObj.props.logSetting
835
+ if (logSetting) {
836
+ param['logSettingText'] = logSetting
837
+ }
838
+ const isSafeDelete = configureObj.props.base.isSafeDelete
839
+ if (isSafeDelete) {
840
+ param['isSafeDelete'] = isSafeDelete
841
+ }
842
+ http
843
+ .delete(path, {
844
+ data: param
845
+ })
846
+ .then((data) => {
847
+ const gridRef = getComponentRef(pageContext, params.tableUuid)
848
+ if (gridRef) {
849
+ gridRef.isDeleteChange(true)
850
+ gridRef.clearSelections()
851
+ }
852
+ dealAfterOperate(
853
+ pageContext,
854
+ configureObj,
855
+ data,
856
+ 'superPageRuntimeMessage.successfulDelete',
857
+ true
858
+ )
859
+ resolve(true)
860
+ })
861
+ .catch((e) => {
862
+ // 注释原因:抛出BusinessException时,删除按钮的loading状态不会清除
863
+ reject(e)
864
+ })
865
+ })
866
+ .catch(() => {
867
+ reject()
868
+ })
869
+ })
870
+ }
871
+ // 列表工具栏下载导入模板功能
872
+ function downloadTemplateFunc(params) {
873
+ const pageContext = params.pageContext
874
+ const configureObj = params.configureObj
875
+ const configureBase = configureObj.props.base
876
+ const templateFilesResult = packageTemplateFiles(configureBase.templateFiles)
877
+ let templateUUID
878
+ let templateShowPath
879
+ if (templateFilesResult && templateFilesResult.length > 0) {
880
+ templateUUID = templateFilesResult[0].templateUUID
881
+ templateShowPath = templateFilesResult[0].templateShowPath
882
+ }
883
+ const system = pageContext.system
884
+ // filePath格式如:用户定义的文件名~~服务器上磁盘中存储的文件路径及文件名。例如:user-info.xls~~iMatrix/b03dr45f5h4g.xls
885
+ const showName = templateShowPath
886
+ let param = '?1=1'
887
+ if (
888
+ templateUUID &&
889
+ showName &&
890
+ templateUUID !== 'undefined' &&
891
+ showName !== 'undefined' &&
892
+ templateUUID !== 'null' &&
893
+ showName !== 'null'
894
+ ) {
895
+ param += '&fileName=' + encodeURI(templateUUID) + '&showName=' + encodeURI(showName)
896
+ } else if (showName) {
897
+ param += '&showName=' + encodeURI(showName)
898
+ }
899
+ const logSetting = configureObj.props.logSetting
900
+ if (logSetting && logSetting !== '') {
901
+ param += '&logSettingText=' + logSetting
902
+ }
903
+ if (system && system.code) {
904
+ param += '&systemCode=' + system.code
905
+ }
906
+ const listCode = params.listCode
907
+ if (listCode) {
908
+ param += '&listCode=' + listCode
909
+ }
910
+ if (pageContext.beanName) {
911
+ param += '&beanName=' + pageContext.beanName
912
+ }
913
+ if (configureBase.functionCode) {
914
+ param += '&functionCode=' + configureBase.functionCode
915
+ }
916
+ if (pageContext.tableName) {
917
+ param += '&tableName=' + pageContext.tableName
918
+ }
919
+ if (configureBase) {
920
+ const isPermission =
921
+ configureBase.isPermission === undefined ||
922
+ configureBase.isPermission === 'true' ||
923
+ configureBase.isPermission
924
+ param += '&isPermission=' + isPermission
925
+ }
926
+ const baseUrl = getBaseUrl(system)
927
+ window.open(baseUrl + '/dsc/commons/download-files' + param)
928
+ }
929
+
930
+ // 列表工具栏 导入功能
931
+ export function doImportFinally(params, fileObj) {
932
+ const pageContext = params.pageContext
933
+ const buttonConfigureObj = params.configureObj
934
+ const tableConfigure = params.tableConfigure
935
+ const tableName = pageContext.tableName
936
+ const buttonConfigureBase = buttonConfigureObj.props.base
937
+ const param = new FormData()
938
+ param.append('multipartFile', fileObj)
939
+ if (tableName) {
940
+ param.append('tableName', tableName)
941
+ }
942
+ if (pageContext.importBeanName) {
943
+ // 表示导入业务处理类
944
+ param.append('importBeanName', pageContext.importBeanName)
945
+ }
946
+ if (pageContext.beanName) {
947
+ // 后台业务处理类配置
948
+ param.append('beanName', pageContext.beanName)
949
+ }
950
+ const listViewImportDuplicate = tableConfigure.props.listViewImportDuplicate
951
+ if (listViewImportDuplicate) {
952
+ // 导入重复规则
953
+ // update(更新)/skip(跳过)/termination(中止导入)
954
+ param.append('importDuplicateRule', listViewImportDuplicate)
955
+ }
956
+ const judgeHeavyList = pageContext.judgeHeavyList
957
+ if (judgeHeavyList) {
958
+ // 判重组合字段配置
959
+ param.append('judgeHeavyList', JSON.stringify(judgeHeavyList))
960
+ }
961
+ const formNoRuleCode = pageContext.formNoRuleCode
962
+ if (formNoRuleCode) {
963
+ // 表单编码规则
964
+ param.append('formNoRuleCode', formNoRuleCode)
965
+ }
966
+ const listCode = params.listCode
967
+ if (listCode) {
968
+ // 列表编码
969
+ param.append('listCode', listCode)
970
+ }
971
+ let isAsync = false
972
+ if (buttonConfigureBase['isAsync'] !== undefined && buttonConfigureBase['isAsync'] !== null) {
973
+ // 是否异步
974
+ isAsync = buttonConfigureBase.isAsync
975
+ } else {
976
+ isAsync = false
977
+ }
978
+ param.append('isAsync', isAsync + '')
979
+ // 页面编码
980
+ param.append('pageCode', pageContext.code)
981
+ const isWorkflowEntity = pageContext.workflowCode ? true : false
982
+ if (isWorkflowEntity !== null && isWorkflowEntity !== undefined) {
983
+ param.append('isWorkflowEntity', isWorkflowEntity + '')
984
+ }
985
+ if (buttonConfigureBase.functionCode) {
986
+ param.append('functionCode', buttonConfigureBase.functionCode)
987
+ }
988
+ const additionalParamMap = pageContext.entity.request
989
+ if (additionalParamMap) {
990
+ // 必须转成字符串,无法传对象到后台
991
+ param.append('additionalParamMapStr', JSON.stringify(additionalParamMap))
992
+ }
993
+ const isPermission =
994
+ buttonConfigureBase.isPermission === undefined ||
995
+ buttonConfigureBase.isPermission === 'true' ||
996
+ buttonConfigureBase.isPermission
997
+ param.append('isPermission', isPermission + '')
998
+ const system = pageContext.entity.system
999
+ // 表示是自定义系统
1000
+ const baseUrl = getBaseUrl(system)
1001
+ let path = baseUrl + '/dsc/commons/import-data'
1002
+ path = getRealRestApiPath(path, system)
1003
+ // TODO:列表工具栏导入按钮loading状态如何控制??
1004
+ // button.importing = true
1005
+ http
1006
+ .post(path, param)
1007
+ .then((data) => {
1008
+ if (isAsync) {
1009
+ ElMessage({
1010
+ showClose: true,
1011
+ type: 'success',
1012
+ message: getI18n().t('superPageRuntimeMessage.asyncImport')
1013
+ })
1014
+ } else {
1015
+ let isSuccess = false
1016
+ if (data) {
1017
+ isSuccess = false
1018
+ ElMessage({
1019
+ dangerouslyUseHTMLString: true,
1020
+ showClose: true,
1021
+ type: 'warning',
1022
+ message: data
1023
+ })
1024
+ } else {
1025
+ // 刷新列表组件
1026
+ ElMessage({
1027
+ showClose: true,
1028
+ type: 'success',
1029
+ message: getI18n().t('superPageRuntimeMessage.successfulImport')
1030
+ })
1031
+ isSuccess = true
1032
+ }
1033
+ dealAfterOperate(pageContext, buttonConfigureObj, data, null, true)
1034
+ pageContext.result = isSuccess
1035
+ // 执行后事件
1036
+ doAfterClickEvent(pageContext, buttonConfigureObj)
1037
+ }
1038
+ // button.importing = false
1039
+ })
1040
+ .catch((error) => {
1041
+ // button.importing = false
1042
+ console.log('error==', error)
1043
+ })
1044
+ }
1045
+
1046
+ export function judgeDataNumber(buttonConfigureObj, ids) {
1047
+ const buttonConfigureBase = buttonConfigureObj.props.base
1048
+ if (
1049
+ buttonConfigureBase.conditionsForExecution &&
1050
+ buttonConfigureBase.conditionsForExecution !== ''
1051
+ ) {
1052
+ if (buttonConfigureBase.conditionsForExecution === 'one') {
1053
+ if (!ids || ids.length !== 1) {
1054
+ // 提示有问题
1055
+ ElMessage({
1056
+ showClose: true,
1057
+ type: 'warning',
1058
+ message: getI18n().t('superPageRuntimeMessage.thePreconditionOfTheButtonTo', {
1059
+ message: getI18n().t('superPageRuntimeMessage.onlyOneRecordCanBeselected')
1060
+ })
1061
+ })
1062
+ return false
1063
+ }
1064
+ } else if (buttonConfigureBase.conditionsForExecution === 'more') {
1065
+ if (!ids || ids.length <= 0) {
1066
+ // 提示有问题
1067
+ ElMessage({
1068
+ showClose: true,
1069
+ type: 'warning',
1070
+ message: getI18n().t('superPageRuntimeMessage.thePreconditionOfTheButtonTo', {
1071
+ message: getI18n().t('superPageRuntimeMessage.selectAtLeastOneRecord')
1072
+ })
1073
+ })
1074
+ return false
1075
+ }
1076
+ }
1077
+ }
1078
+ return true
1079
+ }
1080
+ // 列表-导出。导出台账数据,有查询条件则导出查询条件对应的数据,没有查询条件则导出所有记录
1081
+ function exportFunc(params) {
1082
+ return new Promise((resolve, reject) => {
1083
+ const pageContext = params.pageContext
1084
+ const configureBase = params.configureObj.props.base
1085
+ const listCode = params.listCode
1086
+ const selections = params.selections
1087
+ const dataParam = {}
1088
+ if (selections && selections.length > 0) {
1089
+ dataParam['data'] = selections
1090
+ }
1091
+ // TODO: 国际化页面名称
1092
+ let pageName = pageContext.label
1093
+ if (!pageName) {
1094
+ pageName = pageContext.code
1095
+ }
1096
+ let isAsync = false
1097
+ if (configureBase['isAsync'] !== undefined && configureBase['isAsync'] !== null) {
1098
+ // 是否异步
1099
+ isAsync = configureBase.isAsync
1100
+ } else {
1101
+ isAsync = false
1102
+ }
1103
+ const isPermission =
1104
+ configureBase.isPermission === undefined ||
1105
+ configureBase.isPermission === 'true' ||
1106
+ configureBase.isPermission
1107
+ const exportFileName = pageName
1108
+ window['$vueApp'].config.globalProperties.$exportDataNew(
1109
+ dataParam,
1110
+ exportFileName,
1111
+ listCode,
1112
+ configureBase.functionCode,
1113
+ null,
1114
+ null,
1115
+ isAsync,
1116
+ pageContext.code,
1117
+ isPermission
1118
+ )
1119
+ })
1120
+ }
1121
+ // 获得流程办理参数
1122
+ function getWorkflowSaveParams(params) {
1123
+ const pageContext = params.pageContext
1124
+ const configureObj = params.configureObj
1125
+ const dataModel = pageContext.entity.data
1126
+ const system = pageContext.entity.system
1127
+ // TODO: 后台生成资源时规则是"系统编码.页面编码.xxx"
1128
+ const permissionPrefix = system.code + '.' + pageContext.code
1129
+ let functionCode = configureObj.props.base.functionCode
1130
+ if (!functionCode) {
1131
+ functionCode = permissionPrefix + '.xxx'
1132
+ }
1133
+ if (!dataModel.id && !dataModel.ID) {
1134
+ // 表示是新建操作,需要将页面编码和页面版本传给后端接口
1135
+ dataModel['pageCode'] = pageContext.code
1136
+ dataModel['pageVersion'] = pageContext.version
1137
+ }
1138
+ const param = {
1139
+ entity: dataModel,
1140
+ pageMoel: pageContext.entity.page,
1141
+ formNoRuleCode: pageContext.formNoRuleCode,
1142
+ tableName: pageContext.tableName,
1143
+ emailTemplateCode: pageContext.emailTemplateCode,
1144
+ definitionId: pageContext.definitionId,
1145
+ functionCode: functionCode,
1146
+ systemCode: system.code,
1147
+ tableNames: pageContext.tableNames
1148
+ }
1149
+ if (pageContext.completeTaskParam) {
1150
+ param['completeTaskParam'] = {
1151
+ taskId: pageContext.completeTaskParam.taskId,
1152
+ opinion: pageContext.completeTaskParam.opinion
1153
+ }
1154
+ }
1155
+ if (pageContext.judgeHeavyList) {
1156
+ // 判重组合字段配置
1157
+ if (isArrayFn(pageContext.judgeHeavyList)) {
1158
+ param['judgeHeavyList'] = JSON.stringify(pageContext.judgeHeavyList)
1159
+ } else {
1160
+ param['judgeHeavyList'] = pageContext.judgeHeavyList
1161
+ }
1162
+ }
1163
+ const conversionCodes = configureObj.props.base.conversionCodes
1164
+ if (conversionCodes) {
1165
+ // 数据转换规则
1166
+ if (isArrayFn(conversionCodes)) {
1167
+ param['dataConversionRule'] = conversionCodes.join(',')
1168
+ } else if (typeof conversionCodes === 'string') {
1169
+ param['dataConversionRule'] = conversionCodes
1170
+ }
1171
+ }
1172
+ const autoSetValueData = configureObj.props.base.setValueList
1173
+ if (autoSetValueData) {
1174
+ // 自动设值
1175
+ if (isArrayFn(autoSetValueData)) {
1176
+ param['autoSetValueData'] = autoSetValueData.join(',')
1177
+ } else if (typeof autoSetValueData === 'string') {
1178
+ param['autoSetValueData'] = autoSetValueData
1179
+ }
1180
+ }
1181
+ if (pageContext.beanName) {
1182
+ param['beanName'] = pageContext.beanName
1183
+ }
1184
+ const logSetting = configureObj.props.logSetting
1185
+ if (logSetting) {
1186
+ param['logSettingText'] = logSetting
1187
+ }
1188
+ if (!param.systemCode) {
1189
+ param.systemCode = system.code
1190
+ }
1191
+ // TODO: needDeleteFileUuid后面再完善,表单中删除的附件,且没有实时删除数据库中的附件时
1192
+ // if (needDeleteFileUuid) {
1193
+ // param.needDeleteFileUuid = needDeleteFileUuid
1194
+ // }
1195
+ // TODO: 根据数据表缓存dataTypeMap到redis中,提升保存速度,修改后台接口,前端不需要传了
1196
+ // if (this.dataTypeMap) {
1197
+ // param.dataTypeMap = this.dataTypeMap
1198
+ // }
1199
+ const additionalParamMap = pageContext.entity.request
1200
+ if (additionalParamMap) {
1201
+ param['additionalParamMap'] = additionalParamMap
1202
+ if (additionalParamMap.ids && additionalParamMap.ids.length > 0) {
1203
+ // 路由query中的参数ids
1204
+ param['ids'] = additionalParamMap.ids
1205
+ }
1206
+ }
1207
+ // 成功后页面处理方式
1208
+ const successOperation = configureObj.props.base.successOperation
1209
+ // false表示控制version,true表示不控制version
1210
+ if (successOperation && successOperation === 'noOperation') {
1211
+ // 如果是按钮操作后是“无操作”,则不控制version的值,否则会报“记录被其它事务修改”的异常
1212
+ param['unControlVersion'] = true
1213
+ }
1214
+ param['isWorkflowEntity'] = true
1215
+ // TODO: 暂时不知道表单页面什么情况会用这个配置,先不实现了
1216
+ // param.isBatchProcessing = isBatchProcessing
1217
+ return param
1218
+ }
1219
+
1220
+ // 流程表单暂存功能
1221
+ function workflowSaveFunc(params) {
1222
+ return new Promise((resolve, reject) => {
1223
+ const pageContext = params.pageContext
1224
+ const dataModel = pageContext.entity.data
1225
+ const system = pageContext.entity.system
1226
+ let path = getBaseUrl(system) + '/dsc/workflow-commons'
1227
+ path = getRealRestApiPath(path, system)
1228
+ if (!path) {
1229
+ ElMessage({
1230
+ showClose: true,
1231
+ type: 'warning',
1232
+ message: getI18n().t('superPageRuntimeMessage.requestPathEmpty')
1233
+ })
1234
+ return
1235
+ }
1236
+ // 自定义系统时,封装CommonEntity
1237
+ const param = getWorkflowSaveParams(params)
1238
+ let request
1239
+ if (dataModel.id || dataModel.ID) {
1240
+ // 表示是修改操作
1241
+ request = http.put(path, param)
1242
+ } else {
1243
+ // 表示是新建操作
1244
+ request = http.post(path, param)
1245
+ }
1246
+ request
1247
+ .then((commonEntity) => {
1248
+ // 处理任务办理参数
1249
+ let result = true
1250
+ if (commonEntity) {
1251
+ result = dealCompleteTaskParam(commonEntity, false, pageContext, params, null)
1252
+ }
1253
+ if (result === true) {
1254
+ ElMessage({
1255
+ showClose: true,
1256
+ type: 'success',
1257
+ message: getI18n().t('superPageRuntimeMessage.successfulSave')
1258
+ })
1259
+ }
1260
+ resolve(true)
1261
+ })
1262
+ .catch((error) => {
1263
+ reject(error)
1264
+ })
1265
+ })
1266
+ }
1267
+
1268
+ export function dealCompleteTaskParam(
1269
+ commonEntity,
1270
+ isInit,
1271
+ pageContext,
1272
+ params?: any,
1273
+ operationResult?: any
1274
+ ) {
1275
+ const pageCode = pageContext.code
1276
+ const pageVersion = pageContext.version
1277
+ const formParam = commonEntity
1278
+ let taskId
1279
+ if (formParam) {
1280
+ // 重新给表单赋值,可以连续保存
1281
+ if (isInit && formParam.entity) {
1282
+ // TODO: 保存后刷新表单的记录是否这样更新,需要测试
1283
+ pageContext.entity.data = formParam.entity
1284
+ // this.formData = formParam.entity
1285
+ // setStoreInfo(this.pageCode, '_formData', this.formData)
1286
+
1287
+ // 获得表单编码规则解析结果
1288
+ // TODO: 临时表单编码处理
1289
+ pageContext.initFormNo = commonEntity.formNo
1290
+
1291
+ pageContext.emailTemplateCode = commonEntity.emailTemplateCode
1292
+ }
1293
+ const completeTaskResult = formParam.completeTaskResult
1294
+ if (completeTaskResult) {
1295
+ // 表示有返回结果
1296
+ const completeTaskTipType = completeTaskResult.completeTaskTipType
1297
+ if (completeTaskTipType && completeTaskTipType === 'MESSAGE') {
1298
+ // 表示有业务异常信息
1299
+ const message = completeTaskResult.content
1300
+ ElMessage({
1301
+ showClose: true,
1302
+ type: 'warning',
1303
+ message: message
1304
+ })
1305
+ return false
1306
+ }
1307
+ }
1308
+ if (formParam.completeTaskParam) {
1309
+ const completeTaskParam = formParam.completeTaskParam
1310
+ taskId = completeTaskParam.taskId
1311
+ if (params) {
1312
+ params.taskId = taskId
1313
+ }
1314
+ setStoreInfo(pageCode, pageVersion, '_completeTaskParam', completeTaskParam)
1315
+ // TODO: 确定这样写使用有效
1316
+ // 字段编辑权限传给表单组件
1317
+ pageContext.fieldPermissions = completeTaskParam.fieldPermissions
1318
+ // 子表操作列编辑权限传给表单组件
1319
+ pageContext.actionPermissions = completeTaskParam.actionPermissions
1320
+ // 流程按钮组组件需要的信息
1321
+ pageContext.workflowButtonComponent = completeTaskParam.buttonComponent
1322
+ pageContext.completeTaskParam = completeTaskParam
1323
+ }
1324
+ setStoreInfo(pageCode, pageVersion, '_currentActivityName', formParam.taskName)
1325
+ }
1326
+ if (params) {
1327
+ params.operationResult = operationResult
1328
+ }
1329
+ if (!isInit) {
1330
+ // 不是初始化表单时,才需要刷新表单内容
1331
+ dealAfterOperate(pageContext, params.configureObj, commonEntity, null, false)
1332
+ }
1333
+ // TODO: 刷新按钮
1334
+ // this.reviewButton()
1335
+ return true
1336
+ }
1337
+
1338
+ // 提交流程
1339
+ function submitProcessFunc(params) {
1340
+ return new Promise((resolve, reject) => {
1341
+ const pageContext = params.pageContext
1342
+ const system = pageContext.entity.system
1343
+ let path = getBaseUrl(system) + '/dsc/workflow-commons/submit'
1344
+ path = getRealRestApiPath(path, system)
1345
+ if (!path) {
1346
+ ElMessage({
1347
+ showClose: true,
1348
+ type: 'warning',
1349
+ message: getI18n().t('superPageRuntimeMessage.requestPathEmpty')
1350
+ })
1351
+ return
1352
+ }
1353
+ // 自定义系统时,封装CommonEntity
1354
+ const param = getWorkflowSaveParams(params)
1355
+ const request = http.post(path, param)
1356
+ if (request) {
1357
+ request
1358
+ .then((commonEntity) => {
1359
+ // 处理任务办理参数
1360
+ let result = true
1361
+ if (commonEntity) {
1362
+ result = dealCompleteTaskParam(commonEntity, false, pageContext, params, null)
1363
+ }
1364
+ if (result === true) {
1365
+ ElMessage({
1366
+ showClose: true,
1367
+ type: 'success',
1368
+ message: getI18n().t('superPageRuntimeMessage.successfulSubmit')
1369
+ })
1370
+ }
1371
+ resolve(true)
1372
+ })
1373
+ .catch((error) => {
1374
+ reject(error)
1375
+ })
1376
+ }
1377
+ })
1378
+ }
1379
+
1380
+ // 办理任务实现
1381
+ function completeTaskFunc(params, operationResult) {
1382
+ return new Promise((resolve, reject) => {
1383
+ const pageContext = params.pageContext
1384
+ const system = pageContext.entity.system
1385
+ let path = getBaseUrl(system) + '/dsc/workflow-commons/complete-tasks'
1386
+ path = getRealRestApiPath(path, system)
1387
+ if (!path) {
1388
+ ElMessage({
1389
+ showClose: true,
1390
+ type: 'warning',
1391
+ message: getI18n().t('superPageRuntimeMessage.requestPathEmpty')
1392
+ })
1393
+ return
1394
+ }
1395
+ const param = getWorkflowSaveParams(params)
1396
+ param['completeTaskParam'] = {
1397
+ operationResult: operationResult,
1398
+ taskId: pageContext.completeTaskParam ? pageContext.completeTaskParam.taskId : null,
1399
+ opinion: pageContext.completeTaskParam ? pageContext.completeTaskParam.opinion : null
1400
+ }
1401
+ const request = http.post(path, param)
1402
+ request
1403
+ .then((commonEntity) => {
1404
+ // 处理任务办理参数
1405
+ let result = true
1406
+ if (commonEntity) {
1407
+ result = dealCompleteTaskParam(commonEntity, false, pageContext, params, operationResult)
1408
+ }
1409
+ if (result === true) {
1410
+ ElMessage({
1411
+ showClose: true,
1412
+ type: 'success',
1413
+ message: getI18n().t('superPageRuntimeMessage.successfulCompleteTask')
1414
+ })
1415
+ }
1416
+ resolve(true)
1417
+ })
1418
+ .catch((error) => {
1419
+ reject(error)
1420
+ })
1421
+ })
1422
+ }
1423
+
1424
+ // 指派,显示选人树
1425
+ function assignTask(params) {
1426
+ const pageContext = params.pageContext
1427
+ const pagCode = pageContext.code
1428
+ const eventPageInfo = pagCode + '_'
1429
+ window['$eventBus'].$emit(eventPageInfo + 'assign-task', params)
1430
+ }
1431
+
1432
+ // 执行指派功能
1433
+ export function doAssign(params, selectNodeInfo) {
1434
+ if (selectNodeInfo) {
1435
+ const pageContext = params.pageContext
1436
+ const configureObj = params.configureObj
1437
+ const system = pageContext.entity.system
1438
+ const path = getBaseUrl(system) + '/dsc/workflow-commons/assigns'
1439
+ const assigneeId = selectNodeInfo.id
1440
+ ? selectNodeInfo.id
1441
+ : selectNodeInfo.ID
1442
+ ? selectNodeInfo.ID
1443
+ : null
1444
+ const requestParam = getWorkflowSaveParams(params)
1445
+ requestParam['assigneeId'] = assigneeId
1446
+ transactTask(params, requestParam, path, 'superPageRuntimeMessage.successfulAssign').then(
1447
+ (result) => {
1448
+ // 执行后事件
1449
+ doAfterClickEvent(pageContext, configureObj)
1450
+ }
1451
+ )
1452
+ }
1453
+ }
1454
+
1455
+ function getTransactTaskParam(params) {
1456
+ const pageContext = params.pageContext
1457
+ const dataModel = pageContext.entity.data
1458
+ const pageModel = pageContext.entity.page
1459
+ const system = pageContext.entity.system
1460
+ const permissionPrefix = system.code + '.' + pageContext.code
1461
+ const additionalParamMap = pageContext.entity.request
1462
+ const dataId = dataModel.ID !== undefined && dataModel.ID !== null ? dataModel.ID : dataModel.id
1463
+ const requestParams = {
1464
+ beanName: pageContext.beanName,
1465
+ id: dataId,
1466
+ entity: dataModel,
1467
+ pageModel: pageModel,
1468
+ additionalParamMap: additionalParamMap,
1469
+ tableName: pageContext.tableName,
1470
+ functionCode: permissionPrefix + '.xxx',
1471
+ isWorkflowEntity: true,
1472
+ tableNames: pageContext.tableNames
1473
+ }
1474
+ requestParams['completeTaskParam'] = {
1475
+ taskId: pageContext.completeTaskParam.taskId,
1476
+ systemCode: system.code
1477
+ }
1478
+ }
1479
+
1480
+ // 加签,显示选人树
1481
+ function addSignerFunc(params) {
1482
+ const pageContext = params.pageContext
1483
+ const pagCode = pageContext.code
1484
+ const eventPageInfo = pagCode + '_'
1485
+ window['$eventBus'].$emit(eventPageInfo + 'add-signer', params)
1486
+ }
1487
+
1488
+ // 执行加签功能
1489
+ export function doAddSigner(params, selectNodeInfo) {
1490
+ if (selectNodeInfo) {
1491
+ const pageContext = params.pageContext
1492
+ const buttonConfigureObj = params.configureObj
1493
+ const system = pageContext.entity.system
1494
+ let path = getBaseUrl(system) + '/dsc/workflow-commons/add-signers'
1495
+ path = getRealRestApiPath(path, system)
1496
+ if (!path) {
1497
+ ElMessage({
1498
+ showClose: true,
1499
+ type: 'warning',
1500
+ message: getI18n().t('superPageRuntimeMessage.requestPathEmpty')
1501
+ })
1502
+ return
1503
+ }
1504
+ const requestParams = getTransactTaskParam(params)
1505
+ requestParams['completeTaskParam'].transactors = selectNodeInfo.loginNames.join(',').split(',')
1506
+ const request = http.post(path, requestParams)
1507
+ if (request) {
1508
+ request.then((commonEntity) => {
1509
+ ElMessage({
1510
+ showClose: true,
1511
+ type: 'success',
1512
+ message: getI18n().t('superPageRuntimeMessage.successfulOperation')
1513
+ })
1514
+ // 重新给表单赋值,可以连续保存
1515
+ if (commonEntity.entity) {
1516
+ dealAfterOperate(pageContext, buttonConfigureObj, commonEntity, null, false)
1517
+ }
1518
+ // 执行afterClick回调方法
1519
+ doAfterClickEvent(pageContext, buttonConfigureObj)
1520
+ })
1521
+ }
1522
+ }
1523
+ }
1524
+
1525
+ // 点击生成抄送任务后,弹出组织结构树
1526
+ function createCopyTask(params) {
1527
+ const pageContext = params.pageContext
1528
+ const pagCode = pageContext.code
1529
+ const eventPageInfo = pagCode + '_'
1530
+ window['$eventBus'].$emit(eventPageInfo + 'copy-task', params)
1531
+ }
1532
+
1533
+ // 选择了生成抄送任务的用户后,执行生成抄送任务接口
1534
+ export function doCreateCopyTask(params, selectNodeInfo) {
1535
+ if (selectNodeInfo) {
1536
+ const pageContext = params.pageContext
1537
+ const buttonConfigureObj = params.configureObj
1538
+ const system = pageContext.entity.system
1539
+ let path = getBaseUrl(system) + '/dsc/workflow-commons/add-signers'
1540
+ path = getRealRestApiPath(path, system)
1541
+ if (!path) {
1542
+ ElMessage({
1543
+ showClose: true,
1544
+ type: 'warning',
1545
+ message: getI18n().t('superPageRuntimeMessage.requestPathEmpty')
1546
+ })
1547
+ return
1548
+ }
1549
+ const requestParams = getTransactTaskParam(params)
1550
+ requestParams['completeTaskParam'].transactors = selectNodeInfo.userIds.join(',').split(',')
1551
+ const request = http.post(path, requestParams)
1552
+ if (request) {
1553
+ request.then((commonEntity) => {
1554
+ ElMessage({
1555
+ showClose: true,
1556
+ type: 'success',
1557
+ message: getI18n().t('superPageRuntimeMessage.successfulOperation')
1558
+ })
1559
+ // 执行afterClick回调方法
1560
+ doAfterClickEvent(pageContext, buttonConfigureObj)
1561
+ })
1562
+ }
1563
+ }
1564
+ }
1565
+
1566
+ function transactTask(params, requestParam, path, successMessageTip) {
1567
+ return new Promise((resolve, reject) => {
1568
+ const pageContext = params.pageContext
1569
+ const system = pageContext.entity.system
1570
+ path = getRealRestApiPath(path, system)
1571
+ if (!path) {
1572
+ ElMessage({
1573
+ showClose: true,
1574
+ type: 'warning',
1575
+ message: getI18n().t('superPageRuntimeMessage.requestPathEmpty')
1576
+ })
1577
+ return
1578
+ }
1579
+ const request = http.post(path, requestParam)
1580
+ if (request) {
1581
+ request
1582
+ .then((commonEntity) => {
1583
+ // 处理任务办理参数
1584
+ let result = true
1585
+ if (commonEntity) {
1586
+ result = dealCompleteTaskParam(commonEntity, false, pageContext, params, null)
1587
+ }
1588
+ if (result === true) {
1589
+ ElMessage({
1590
+ showClose: true,
1591
+ type: 'success',
1592
+ message: getI18n().t(successMessageTip)
1593
+ })
1594
+ }
1595
+ resolve(true)
1596
+ })
1597
+ .catch((error) => {
1598
+ reject(error)
1599
+ })
1600
+ }
1601
+ })
1602
+ }
1603
+ // 领取功能
1604
+ function drawTaskFunc(params) {
1605
+ const pageContext = params.pageContext
1606
+ const system = pageContext.entity.system
1607
+ const path = getBaseUrl(system) + '/dsc/workflow-commons/draw-tasks'
1608
+ const requestParam = getWorkflowSaveParams(params)
1609
+ return transactTask(params, requestParam, path, 'superPageRuntimeMessage.successfulDrawTask')
1610
+ }
1611
+
1612
+ // 放弃领取功能
1613
+ function abandonReceiveFunc(params) {
1614
+ const pageContext = params.pageContext
1615
+ const system = pageContext.entity.system
1616
+ const path = getBaseUrl(system) + '/dsc/workflow-commons/abandon-receives'
1617
+ const requestParam = getWorkflowSaveParams(params)
1618
+ return transactTask(
1619
+ params,
1620
+ requestParam,
1621
+ path,
1622
+ 'superPageRuntimeMessage.successfulAbandonReceive'
1623
+ )
1624
+ }
1625
+
1626
+ // 驳回功能
1627
+ function returnToPreviousTaskFunc(params) {
1628
+ const pageContext = params.pageContext
1629
+ const system = pageContext.entity.system
1630
+ const path = getBaseUrl(system) + '/dsc/workflow-commons/return-to-previous-tasks'
1631
+ const requestParam = getWorkflowSaveParams(params)
1632
+ return transactTask(
1633
+ params,
1634
+ requestParam,
1635
+ path,
1636
+ 'superPageRuntimeMessage.successfulReturnToPreviousTask'
1637
+ )
1638
+ }
1639
+ // 强制结束功能
1640
+ function endInstanceFunc(params) {
1641
+ const pageContext = params.pageContext
1642
+ const system = pageContext.entity.system
1643
+ const path = getBaseUrl(system) + '/dsc/workflow-commons/end-instance'
1644
+ const requestParam = getWorkflowSaveParams(params)
1645
+ return transactTask(params, requestParam, path, 'superPageRuntimeMessage.successfulEndInstance')
1646
+ }
1647
+
1648
+ // 退回功能,弹出环节选择
1649
+ function returnTaskToFunc(params) {
1650
+ const pageContext = params.pageContext
1651
+ const pagCode = pageContext.code
1652
+ const eventPageInfo = pagCode + '_'
1653
+ window['$eventBus'].$emit(eventPageInfo + 'choose-return-node', params)
1654
+ }
1655
+
1656
+ // 获得可退回的环节信息集合,只能退回到已办理过的环节
1657
+ export function getTaskInformitions(params) {
1658
+ const pageContext = params.pageContext
1659
+ const system = pageContext.entity.system
1660
+ const completeTaskParam = pageContext.completeTaskParam
1661
+ let path =
1662
+ getBaseUrl(system) + '/dsc/workflow-commons/returnable-task/' + completeTaskParam.taskId
1663
+ path = getRealRestApiPath(path, system)
1664
+ if (!path) {
1665
+ ElMessage({
1666
+ showClose: true,
1667
+ type: 'warning',
1668
+ message: getI18n().t('superPageRuntimeMessage.requestPathEmpty')
1669
+ })
1670
+ return
1671
+ }
1672
+ const permissionPrefix = system.code + '.' + pageContext.code
1673
+ const additionalParamMap = pageContext.entity.request
1674
+ const requestParams = {
1675
+ beanName: pageContext.beanName,
1676
+ additionalParamMap: additionalParamMap,
1677
+ tableName: pageContext.tableName,
1678
+ functionCode: permissionPrefix + '.xxx'
1679
+ }
1680
+ return http.post(path, requestParams)
1681
+ }
1682
+
1683
+ // 执行退回环节功能
1684
+ export function doReturnTaskTo(params, selectTaskNode) {
1685
+ const pageContext = params.pageContext
1686
+ const configureObj = params.configureObj
1687
+ const system = pageContext.entity.system
1688
+ const path = getBaseUrl(system) + '/dsc/workflow-commons/returnTaskTo'
1689
+ const requestParam = getWorkflowSaveParams(params)
1690
+ if (selectTaskNode.nodeName) {
1691
+ requestParam['returnToNodeName'] = selectTaskNode.nodeName
1692
+ }
1693
+ if (selectTaskNode.nodeId) {
1694
+ requestParam['returnToNodeId'] = selectTaskNode.nodeId
1695
+ }
1696
+ transactTask(params, requestParam, path, 'superPageRuntimeMessage.successfulReturnTaskTo').then(
1697
+ (result) => {
1698
+ // 执行后事件
1699
+ doAfterClickEvent(pageContext, configureObj)
1700
+ }
1701
+ )
1702
+ }
1703
+
1704
+ // 减签功能,弹出可减签的任务列表
1705
+ function removeSignerfunc(params) {
1706
+ const pageContext = params.pageContext
1707
+ const pagCode = pageContext.code
1708
+ const eventPageInfo = pagCode + '_'
1709
+ window['$eventBus'].$emit(eventPageInfo + 'remove-signer', params)
1710
+ }
1711
+
1712
+ // 点击减签按钮,显示减签文本框
1713
+ export function getRemoveSigner(params) {
1714
+ const pageContext = params.pageContext
1715
+ const system = pageContext.entity.system
1716
+ let path = getBaseUrl(system) + '/dsc/workflow-commons/get-remove-signers'
1717
+ const requestParam = getWorkflowSaveParams(params)
1718
+ path = getRealRestApiPath(path, system)
1719
+ if (!path) {
1720
+ ElMessage({
1721
+ showClose: true,
1722
+ type: 'warning',
1723
+ message: getI18n().t('superPageRuntimeMessage.requestPathEmpty')
1724
+ })
1725
+ return
1726
+ }
1727
+ return http.post(path, requestParam)
1728
+ }
1729
+
1730
+ // 执行减签功能
1731
+ export function doRemoveSigners(params, selectRemoveTasks) {
1732
+ if (selectRemoveTasks) {
1733
+ const pageContext = params.pageContext
1734
+ const configureObj = params.configureObj
1735
+ const system = pageContext.entity.system
1736
+ let path = getBaseUrl(system) + '/dsc/workflow-commons/remove-signers'
1737
+ path = getRealRestApiPath(path, system)
1738
+ if (!path) {
1739
+ this.$message({
1740
+ showClose: true,
1741
+ type: 'warning',
1742
+ message: this.$t('superPageRuntimeMessage.requestPathEmpty')
1743
+ })
1744
+ return
1745
+ }
1746
+ const taskIds = selectRemoveTasks.map((task) => (task.id ? task.id : task.ID ? task.ID : null))
1747
+ const requestParam = getWorkflowSaveParams(params)
1748
+ requestParam['ids'] = taskIds
1749
+ const request = http.post(path, requestParam)
1750
+ if (request) {
1751
+ request.then((commonEntity) => {
1752
+ dealAfterOperate(
1753
+ pageContext,
1754
+ configureObj,
1755
+ commonEntity,
1756
+ 'superPageRuntimeMessage.successfulOperation',
1757
+ false
1758
+ )
1759
+ // 执行后事件
1760
+ doAfterClickEvent(pageContext, configureObj)
1761
+ })
1762
+ }
1763
+ }
1764
+ }
1765
+
1766
+ // 取回按钮
1767
+ function retrieveTaskFunc(params) {
1768
+ const pageContext = params.pageContext
1769
+ const system = pageContext.entity.system
1770
+ const path = getBaseUrl(system) + '/dsc/workflow-commons/retrieves'
1771
+ const requestParam = getWorkflowSaveParams(params)
1772
+ return transactTask(params, requestParam, path, 'superPageRuntimeMessage.successfulRetrieve')
1773
+ }
1774
+
1775
+ function lineEditCreateFunc(params) {
1776
+ const pageContext = params.pageContext
1777
+ const tableUuid = params['tableUuid']
1778
+ const gridRef = getComponentRef(pageContext, tableUuid)
1779
+ if (gridRef) {
1780
+ gridRef.createRow(params)
1781
+ }
1782
+ }
1783
+
1784
+ export function isVisibleWorkflowButton(standardEventName, buttonInfo, completeTaskParam) {
1785
+ let isVisible = false
1786
+ if (standardEventName && buttonInfo) {
1787
+ if (standardEventName === 'workflowSave') {
1788
+ // 是否显示暂存
1789
+ isVisible = isVisibleWorkflowSave(buttonInfo)
1790
+ } else if (standardEventName === 'submitProcess') {
1791
+ // 是否显示提交流程
1792
+ isVisible = isVisibleSubmitProcess(buttonInfo)
1793
+ } else if (standardEventName === 'submitTask') {
1794
+ // 是否显示提交任务
1795
+ isVisible = isVisibleSubmitTask(buttonInfo)
1796
+ } else if (standardEventName === 'drawTask') {
1797
+ // 是否显示领取
1798
+ isVisible = isVisibleDrawTask(buttonInfo)
1799
+ } else if (standardEventName === 'abandonReceive') {
1800
+ // 是否显示放弃领取
1801
+ isVisible = isVisibleAbandonReceive(buttonInfo)
1802
+ } else if (standardEventName === 'approve' || standardEventName === 'refuse') {
1803
+ // 是否显示同意 或 不同意
1804
+ isVisible = isVisibleApproveOrRefuse(buttonInfo)
1805
+ } else if (standardEventName === 'readed') {
1806
+ // 是否显示已阅
1807
+ isVisible = isVisibleReaded(buttonInfo)
1808
+ } else if (standardEventName === 'assign') {
1809
+ // 是否显示指派
1810
+ isVisible = isVisibleAssignTask(buttonInfo)
1811
+ } else if (standardEventName === 'copyTask') {
1812
+ // 是否显示抄送
1813
+ isVisible = isVisibleCopyTask(buttonInfo)
1814
+ } else if (standardEventName === 'addSigner') {
1815
+ // 是否显示加签
1816
+ isVisible = isVisibleAddSigner(buttonInfo)
1817
+ } else if (standardEventName === 'removeSigner') {
1818
+ // 是否显示减签
1819
+ isVisible = isVisibleRemoveSigner(buttonInfo)
1820
+ } else if (standardEventName === 'retrieveTask') {
1821
+ // 是否显示取回
1822
+ isVisible = isVisibleRetrieveTask(buttonInfo)
1823
+ } else if (standardEventName === 'agreement' || standardEventName === 'oppose') {
1824
+ // 是否显示 赞成或反对
1825
+ isVisible = isVisibleAgreementOrOppose(buttonInfo)
1826
+ } else if (standardEventName === 'kiken') {
1827
+ // 是否显示弃权
1828
+ isVisible = isVisibleKiken(buttonInfo)
1829
+ } else if (isShowOtherWorkflowBtn(buttonInfo, completeTaskParam)) {
1830
+ if (standardEventName === 'returnToPreviousTask') {
1831
+ // 是否显示驳回
1832
+ isVisible = isVisibleReturnToPreviousTask(buttonInfo)
1833
+ } else {
1834
+ // 是否显示 退回、强制结束
1835
+ isVisible = true
1836
+ }
1837
+ }
1838
+ }
1839
+
1840
+ return isVisible
1841
+ }
1842
+
1843
+ // 是否显示 暂存 按钮
1844
+ function isVisibleWorkflowSave(buttonInfo) {
1845
+ if (
1846
+ typeof buttonInfo['processState'] === 'undefined' ||
1847
+ buttonInfo['processState'] === null ||
1848
+ (buttonInfo['processState'] === 'UNSUBMIT' && buttonInfo['active'] === 'WAIT_TRANSACT')
1849
+ ) {
1850
+ if (
1851
+ typeof buttonInfo['processState'] === 'undefined' ||
1852
+ buttonInfo['showButtonSave'] === true
1853
+ ) {
1854
+ return true
1855
+ }
1856
+ }
1857
+ if (buttonInfo['processState'] && buttonInfo['processState'] === 'SUBMIT') {
1858
+ if (
1859
+ buttonInfo['processingMode'] !== 'TYPE_READ' &&
1860
+ buttonInfo['showButtonSave'] &&
1861
+ (buttonInfo['active'] === 'WAIT_TRANSACT' ||
1862
+ buttonInfo['active'] === 'WAIT_DESIGNATE_TRANSACTOR' ||
1863
+ buttonInfo['active'] === 'WAIT_CHOICE_TACHE' ||
1864
+ buttonInfo['active'] === 'DRAW_WAIT')
1865
+ ) {
1866
+ return true
1867
+ }
1868
+ }
1869
+ return false
1870
+ }
1871
+
1872
+ // 是否显示 提交流程 按钮
1873
+ function isVisibleSubmitProcess(buttonInfo) {
1874
+ if (
1875
+ typeof buttonInfo['processState'] === 'undefined' ||
1876
+ buttonInfo['processState'] === null ||
1877
+ (buttonInfo['processState'] === 'UNSUBMIT' && buttonInfo['active'] === 'WAIT_TRANSACT')
1878
+ ) {
1879
+ if (
1880
+ typeof buttonInfo['processState'] === 'undefined' ||
1881
+ buttonInfo['showButtonSave'] === true
1882
+ ) {
1883
+ return true
1884
+ }
1885
+ }
1886
+ return false
1887
+ }
1888
+ // 是否显示 提交任务 按钮
1889
+ function isVisibleSubmitTask(buttonInfo) {
1890
+ if (buttonInfo['processState'] && buttonInfo['processState'] === 'SUBMIT') {
1891
+ if (buttonInfo['active'] === 'WAIT_TRANSACT' && buttonInfo['processingMode'] === 'EDIT') {
1892
+ return true
1893
+ }
1894
+ }
1895
+ return false
1896
+ }
1897
+ // 是否显示 领取 按钮
1898
+ function isVisibleDrawTask(buttonInfo) {
1899
+ if (buttonInfo['processState'] && buttonInfo['processState'] === 'SUBMIT') {
1900
+ if (
1901
+ buttonInfo['active'] &&
1902
+ (buttonInfo['active'] === 'DRAW_WAIT' || buttonInfo['active'] === 'DEPT_DRAW_WAIT') &&
1903
+ buttonInfo['showButtonDraw']
1904
+ ) {
1905
+ return true
1906
+ }
1907
+ }
1908
+ return false
1909
+ }
1910
+
1911
+ // 是否显示 放弃领取 按钮
1912
+ function isVisibleAbandonReceive(buttonInfo) {
1913
+ if (buttonInfo['processState'] && buttonInfo['processState'] === 'SUBMIT') {
1914
+ if (
1915
+ ((buttonInfo['drawTask'] && buttonInfo['active'] === 'WAIT_TRANSACT') ||
1916
+ (buttonInfo['canAbandonDeptTask'] && buttonInfo['active'] === 'WAIT_TRANSACT')) &&
1917
+ buttonInfo['showButtonAbandon']
1918
+ ) {
1919
+ return true
1920
+ }
1921
+ }
1922
+ return false
1923
+ }
1924
+
1925
+ // 是否显示 同意或不同意 按钮
1926
+ function isVisibleApproveOrRefuse(buttonInfo) {
1927
+ if (buttonInfo['processState'] && buttonInfo['processState'] === 'SUBMIT') {
1928
+ if (
1929
+ buttonInfo['active'] === 'WAIT_TRANSACT' &&
1930
+ (buttonInfo['processingMode'] === 'APPROVE' || buttonInfo['processingMode'] === 'COUNTERSIGN')
1931
+ ) {
1932
+ return true
1933
+ }
1934
+ }
1935
+ return false
1936
+ }
1937
+
1938
+ // 是否显示 加签 按钮
1939
+ function isVisibleAddSigner(buttonInfo) {
1940
+ if (buttonInfo['processState'] && buttonInfo['processState'] === 'SUBMIT') {
1941
+ if (
1942
+ buttonInfo['active'] === 'WAIT_TRANSACT' &&
1943
+ (buttonInfo['processingMode'] === 'APPROVE' ||
1944
+ buttonInfo['processingMode'] === 'COUNTERSIGN') &&
1945
+ buttonInfo['processingMode'] === 'COUNTERSIGN' &&
1946
+ buttonInfo['showButtonAddCounter']
1947
+ ) {
1948
+ return true
1949
+ }
1950
+ }
1951
+ return false
1952
+ }
1953
+ // 是否显示 减签 按钮
1954
+ function isVisibleRemoveSigner(buttonInfo) {
1955
+ if (buttonInfo['processState'] && buttonInfo['processState'] === 'SUBMIT') {
1956
+ if (
1957
+ buttonInfo['active'] === 'WAIT_TRANSACT' &&
1958
+ (buttonInfo['processingMode'] === 'APPROVE' ||
1959
+ buttonInfo['processingMode'] === 'COUNTERSIGN') &&
1960
+ buttonInfo['processingMode'] === 'COUNTERSIGN' &&
1961
+ buttonInfo['showButtonDelCounter']
1962
+ ) {
1963
+ return true
1964
+ }
1965
+ }
1966
+ return false
1967
+ }
1968
+
1969
+ // 是否显示 赞成或反对 按钮
1970
+ function isVisibleAgreementOrOppose(buttonInfo) {
1971
+ if (buttonInfo['processState'] && buttonInfo['processState'] === 'SUBMIT') {
1972
+ if (buttonInfo['active'] === 'WAIT_TRANSACT' && buttonInfo['processingMode'] === 'VOTE') {
1973
+ return true
1974
+ }
1975
+ }
1976
+ return false
1977
+ }
1978
+
1979
+ // 是否显示 弃权 按钮
1980
+ function isVisibleKiken(buttonInfo) {
1981
+ if (buttonInfo['processState'] && buttonInfo['processState'] === 'SUBMIT') {
1982
+ if (
1983
+ buttonInfo['active'] === 'WAIT_TRANSACT' &&
1984
+ buttonInfo['processingMode'] === 'VOTE' &&
1985
+ buttonInfo['showButtonKiken']
1986
+ ) {
1987
+ return true
1988
+ }
1989
+ }
1990
+ return false
1991
+ }
1992
+
1993
+ // 是否显示 抄送 按钮
1994
+ function isVisibleCopyTask(buttonInfo) {
1995
+ if (buttonInfo['processState'] && buttonInfo['processState'] === 'SUBMIT') {
1996
+ if (
1997
+ buttonInfo['active'] === 'WAIT_TRANSACT' &&
1998
+ buttonInfo['processingMode'] !== 'TYPE_READ' &&
1999
+ buttonInfo['showButtonCopy']
2000
+ ) {
2001
+ return true
2002
+ }
2003
+ }
2004
+ return false
2005
+ }
2006
+
2007
+ // 是否显示 指派 按钮
2008
+ function isVisibleAssignTask(buttonInfo) {
2009
+ if (buttonInfo['processState'] && buttonInfo['processState'] === 'SUBMIT') {
2010
+ if (
2011
+ buttonInfo['processingMode'] !== 'TYPE_READ' &&
2012
+ (buttonInfo['active'] === 'WAIT_TRANSACT' || buttonInfo['active'] === 'DRAW_WAIT')
2013
+ ) {
2014
+ return true
2015
+ }
2016
+ }
2017
+ return false
2018
+ }
2019
+
2020
+ // 是否显示 取回 按钮
2021
+ function isVisibleRetrieveTask(buttonInfo) {
2022
+ if (buttonInfo['processState'] && buttonInfo['processState'] === 'SUBMIT') {
2023
+ if (showRetrieve(buttonInfo)) {
2024
+ return true
2025
+ }
2026
+ }
2027
+ return false
2028
+ }
2029
+
2030
+ function showRetrieve(buttonInfo) {
2031
+ if (buttonInfo['active'] !== 'COMPLETED') {
2032
+ return false
2033
+ }
2034
+ if (buttonInfo['processingMode'] === 'TYPE_READ') {
2035
+ return false
2036
+ }
2037
+ if (!buttonInfo['showButtonGetBack']) {
2038
+ return false
2039
+ }
2040
+ return true
2041
+ }
2042
+
2043
+ // 是否显示 已阅 按钮
2044
+ function isVisibleReaded(buttonInfo) {
2045
+ if (buttonInfo['active'] === 'WAIT_TRANSACT' && buttonInfo['processingMode'] === 'TYPE_READ') {
2046
+ return true
2047
+ }
2048
+ return false
2049
+ }
2050
+ // 是否显示 驳回 按钮
2051
+ function isVisibleReturnToPreviousTask(buttonInfo) {
2052
+ if (buttonInfo['rebuttable']) {
2053
+ return true
2054
+ }
2055
+ return false
2056
+ }
2057
+
2058
+ // 是否显示 驳回、退回、强制结束按钮
2059
+ function isShowOtherWorkflowBtn(buttonInfo, completeTaskParam) {
2060
+ return (
2061
+ buttonInfo['processState'] &&
2062
+ buttonInfo['processState'] === 'SUBMIT' &&
2063
+ buttonInfo['processingMode'] !== 'TYPE_READ' &&
2064
+ !isTaskComplete(completeTaskParam)
2065
+ )
2066
+ }
2067
+
2068
+ function isTaskComplete(completeTaskParam) {
2069
+ const taskParam = completeTaskParam
2070
+ let taskComplete = true
2071
+ if (taskParam) {
2072
+ taskComplete = taskParam.taskComplete
2073
+ }
2074
+ return taskComplete
2075
+ }