super-page-runtime 2.2.29-tmp1 → 2.2.29-tmp2

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 (165) hide show
  1. package/dist/es/_virtual/_plugin-vue_export-helper.js +7 -5
  2. package/dist/es/assets/chart-themes/theme1.js +6 -2
  3. package/dist/es/assets/chart-themes/theme2.js +6 -2
  4. package/dist/es/assets/chart-themes/theme3.js +6 -2
  5. package/dist/es/components/runtime/utils/api/api-util.js +7 -4
  6. package/dist/es/components/runtime/utils/api/page-expose-util.js +443 -135
  7. package/dist/es/components/runtime/utils/assemblys-config.js +369 -13
  8. package/dist/es/components/runtime/utils/barcode-util.js +33 -9
  9. package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +306 -122
  10. package/dist/es/components/runtime/utils/charts/chart-gauge-util.js +68 -29
  11. package/dist/es/components/runtime/utils/charts/chart-pie-util.js +152 -69
  12. package/dist/es/components/runtime/utils/charts/chart-radar-util.js +124 -46
  13. package/dist/es/components/runtime/utils/charts/chart-scatter-util.js +99 -38
  14. package/dist/es/components/runtime/utils/charts/chart-util.js +522 -226
  15. package/dist/es/components/runtime/utils/common-util.js +156 -76
  16. package/dist/es/components/runtime/utils/eventBus.js +8 -3
  17. package/dist/es/components/runtime/utils/events/event-util.js +775 -362
  18. package/dist/es/components/runtime/utils/events/print-label.js +140 -73
  19. package/dist/es/components/runtime/utils/events/standard-event.js +2320 -820
  20. package/dist/es/components/runtime/utils/events/validator-util.js +560 -224
  21. package/dist/es/components/runtime/utils/form/date-shortcuts.js +88 -28
  22. package/dist/es/components/runtime/utils/form/scan-util.js +162 -62
  23. package/dist/es/components/runtime/utils/global-refs.js +84 -53
  24. package/dist/es/components/runtime/utils/i18n-util.js +20 -11
  25. package/dist/es/components/runtime/utils/interfaces/page-design-types.js +7 -2
  26. package/dist/es/components/runtime/utils/page-helper-util.js +660 -280
  27. package/dist/es/components/runtime/utils/page-init-util.js +405 -144
  28. package/dist/es/components/runtime/utils/page-permission-util.js +531 -22
  29. package/dist/es/components/runtime/utils/page-store.js +68 -23
  30. package/dist/es/components/runtime/utils/store-util.js +13 -9
  31. package/dist/es/components/runtime/utils/store.js +2 -2
  32. package/dist/es/components/runtime/utils/table-utils.js +81 -40
  33. package/dist/es/components/runtime/utils/tree-utils.js +37 -17
  34. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue.js +2 -2
  35. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +83 -21
  36. package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue.js +2 -2
  37. package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue2.js +46 -14
  38. package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue.js +2 -2
  39. package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +132 -36
  40. package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue.js +2 -2
  41. package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue2.js +18 -4
  42. package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue.js +2 -2
  43. package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue2.js +107 -17
  44. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue.js +2 -2
  45. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +198 -54
  46. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue.js +42 -12
  47. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue2.js +2 -2
  48. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue.js +60 -11
  49. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue2.js +2 -2
  50. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue.js +203 -54
  51. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue2.js +2 -2
  52. package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue.js +4 -4
  53. package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue2.js +162 -46
  54. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue.js +2 -2
  55. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +109 -33
  56. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue.js +2 -2
  57. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +166 -44
  58. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue.js +2 -2
  59. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +117 -33
  60. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue.js +2 -2
  61. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +118 -33
  62. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +599 -253
  63. package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue.js +42 -4
  64. package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue2.js +2 -2
  65. package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue.js +62 -8
  66. package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue2.js +2 -2
  67. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +160 -29
  68. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue2.js +2 -2
  69. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue.js +62 -13
  70. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue2.js +2 -2
  71. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue.js +2 -2
  72. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +594 -213
  73. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +139 -33
  74. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue2.js +2 -2
  75. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue.js +125 -21
  76. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue2.js +2 -2
  77. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue.js +102 -16
  78. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue2.js +2 -2
  79. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue.js +2 -2
  80. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue2.js +81 -18
  81. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue.js +2 -2
  82. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue2.js +82 -17
  83. package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue.js +2 -2
  84. package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue2.js +86 -14
  85. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue.js +2 -2
  86. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +79 -21
  87. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue.js +2 -2
  88. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue2.js +61 -16
  89. package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue.js +2 -2
  90. package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue2.js +37 -10
  91. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue.js +2 -2
  92. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +127 -38
  93. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue.js +2 -2
  94. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +76 -28
  95. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue.js +2 -2
  96. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +178 -63
  97. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +810 -305
  98. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue2.js +2 -2
  99. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +635 -265
  100. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue2.js +2 -2
  101. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue.js +2 -2
  102. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +115 -40
  103. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue.js +2 -2
  104. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +215 -56
  105. package/dist/es/components/runtime/views/assemblys/error-render.vue.js +21 -3
  106. package/dist/es/components/runtime/views/assemblys/error-render.vue2.js +2 -2
  107. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue.js +2 -2
  108. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +154 -43
  109. package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue.js +98 -34
  110. package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue2.js +2 -2
  111. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue.js +2 -2
  112. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +200 -52
  113. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue.js +2 -2
  114. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +239 -70
  115. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue.js +2 -2
  116. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +109 -31
  117. package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue.js +2 -2
  118. package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue2.js +59 -21
  119. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue.js +2 -2
  120. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +188 -56
  121. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue.js +2 -2
  122. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +103 -22
  123. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue.js +2 -2
  124. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +246 -59
  125. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue.js +2 -2
  126. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +174 -34
  127. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue.js +2 -2
  128. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +107 -29
  129. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +4 -4
  130. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue2.js +50 -13
  131. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue.js +2 -2
  132. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +194 -65
  133. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue.js +2 -2
  134. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +249 -89
  135. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue.js +2 -2
  136. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +263 -80
  137. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue.js +2 -2
  138. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue2.js +57 -13
  139. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue.js +2 -2
  140. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +155 -30
  141. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue.js +2 -2
  142. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +129 -40
  143. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue.js +2 -2
  144. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +107 -22
  145. package/dist/es/components/runtime/views/assemblys/home-chart-render.vue.js +188 -89
  146. package/dist/es/components/runtime/views/assemblys/home-chart-render.vue2.js +2 -2
  147. package/dist/es/components/runtime/views/assemblys/object-render.vue.js +272 -133
  148. package/dist/es/components/runtime/views/assemblys/object-render.vue2.js +2 -2
  149. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue.js +2 -2
  150. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue2.js +46 -18
  151. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue.js +2 -2
  152. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue2.js +49 -21
  153. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue.js +2 -2
  154. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +58 -20
  155. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue.js +2 -2
  156. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue2.js +53 -16
  157. package/dist/es/components/runtime/views/home-chart.vue.js +160 -41
  158. package/dist/es/components/runtime/views/home-chart.vue2.js +2 -2
  159. package/dist/es/components/runtime/views/super-page-dialog.vue.js +139 -21
  160. package/dist/es/components/runtime/views/super-page-dialog.vue2.js +2 -2
  161. package/dist/es/components/runtime/views/super-page.vue.js +756 -230
  162. package/dist/es/components/runtime/views/super-page.vue2.js +2 -2
  163. package/dist/es/i18n/langs/cn.js +55 -2
  164. package/dist/es/i18n/langs/en.js +55 -2
  165. package/package.json +2 -2
@@ -1,887 +1,2387 @@
1
- import { deepCopy as e, isWorkflowPage as t, isArrayFn as s, getBaseUrl as o, getRealRestApiPath as n, packageTemplateFiles as a, upperFirstCase as i, getListCode as r } from "../common-util.js";
2
- import c from "agilebuilder-ui/src/utils/request";
3
- import { getI18n as l } from "agilebuilder-ui/src/utils/util";
4
- import { ElMessage as u, ElMessageBox as p } from "element-plus";
5
- import { getToken as d, getSessionCache as m, setSessionCache as g } from "agilebuilder-ui/src/utils/auth";
6
- import { getComponentRef as f } from "../global-refs.js";
7
- import b from "../eventBus.js";
8
- import C from "axios";
9
- import { handleEvent as T, getTableUuid as y, doAfterClickEvent as h } from "./event-util.js";
10
- import { setStoreInfo as P } from "../store-util.js";
11
- import { getPermissionCodes as w, getDefaultValue as k, getModelFields as v } from "../page-init-util.js";
12
- import { updateChartDatasources as M, caculateShowCondition as N, getVariableValue as R, setVariableValue as S } from "../page-helper-util.js";
13
- import I from "./print-label.js";
14
- import { getTableNameByTableUuid as x } from "../table-utils.js";
15
- import { getWorkflowRules as A, packageCustomRules as O } from "./validator-util.js";
16
- import { functions as U } from "../api/page-expose-util.js";
17
- import { usePageContextStore as E } from "../page-store.js";
18
- const _ = { save: function(e2) {
19
- return console.log("表单标准事件保存save--params=", e2), L(e2, false);
20
- }, saveList: function(e2) {
21
- return console.log("列表标准事件保存saveList--params=", e2), L(e2, true);
22
- }, exportForm: function(e2) {
23
- console.log("表单标准事件导出报告exportForm--params=", e2);
24
- const t2 = e2.pageContext.code + "_";
25
- b.$emit(t2 + "export-form-report", e2);
26
- }, exportPDF: function(e2) {
27
- console.log("表单标准事件导出报告exportPDF--params=", e2);
28
- const t2 = e2.pageContext.code + "_";
29
- b.$emit(t2 + "export-pdf-report", e2);
30
- }, submit: function(e2) {
31
- return console.log("表单标准事件提交submit--params=", e2), J(e2, false, "submit", "/dsc/commons/submits");
32
- }, submitList: function(e2) {
33
- return console.log("列表标准事件提交submitList--params=", e2), J(e2, true, "submit", "/dsc/commons/batch-submits");
34
- }, agree: function(e2) {
35
- return console.log("表单标准事件同意agree--params=", e2), J(e2, false, "agree", "/dsc/commons/approves");
36
- }, agreeList: function(e2) {
37
- return console.log("列表标准事件同意agreeList--params=", e2), J(e2, true, "agree", "/dsc/commons/batch-approves");
38
- }, disagree: function(e2) {
39
- return console.log("表单标准事件不同意disagree--params=", e2), J(e2, false, "disagree", "/dsc/commons/refuses");
40
- }, disagreeList: function(e2) {
41
- return console.log("列表标准事件不同意disagreeList--params=", e2), J(e2, true, "disagree", "/dsc/commons/batch-refuses");
42
- }, back: function(e2) {
43
- console.log("表单标准事件返回back--params=", e2);
44
- const t2 = e2.pageContext;
45
- H(t2, t2.entity ? t2.entity.data : {}, !(!e2.configureObj.props || !e2.configureObj.props.base) && e2.configureObj.props.base.isNeedValueMapping);
46
- }, delete: function(e2) {
47
- return console.log("列表标准事件删除delete--params=", e2), function(e3) {
48
- return new Promise((s2, a2) => {
49
- const i2 = e3.ids;
50
- if (!i2 || 0 === i2.length) return u({ showClose: true, type: "warning", message: l().t("superPageRuntimeMessage.pleaseSelectRecord") }), void s2(true);
51
- p.confirm(l().t("superPageRuntimeMessage.whetherToConfirmDeletion"), l().t("superPageRuntimeMessage.tips"), { confirmButtonText: l().t("superPageRuntimeMessage.sure"), cancelButtonText: l().t("superPageRuntimeMessage.cancel"), type: "warning" }).then(() => {
52
- var _a;
53
- const r2 = e3.pageContext, l2 = e3.configureObj, u2 = l2.props.base, p2 = r2.systemCode, d2 = r2.backendUrl, m2 = l2.props.base.tableUuid ? l2.props.base.tableUuid : e3.tableUuid, g2 = x(r2, m2);
54
- let b2 = o(d2, r2.isTest) + "/dsc/commons/" + g2;
55
- b2 = n(b2, p2, d2, r2.isTest);
56
- const C2 = void 0 === u2.isPermission || "true" === u2.isPermission || u2.isPermission, T2 = t(r2), y2 = w(l2, r2), h2 = { ids: i2, functionCode: y2, isPermission: C2 + "", systemCode: p2, isWorkflowEntity: T2, listCodesMap: r2.listCodesMap, pageCode: r2.code, pageVersion: r2.version };
57
- r2.beanName && (h2.beanName = r2.beanName);
58
- const P2 = l2.props.deleteLogicSetting;
59
- P2 && ("object" == typeof P2 ? h2.deleteLogicSetting = JSON.stringify(P2) : "string" == typeof P2 && (h2.deleteLogicSetting = P2));
60
- const k2 = (_a = l2.props.base) == null ? void 0 : _a.logSetting;
61
- k2 && (h2.logSettingText = k2.join(""));
62
- const v2 = l2.props.base.isSafeDelete;
63
- v2 && (h2.isSafeDelete = v2), c.delete(b2, { data: h2 }).then((e4) => {
64
- const t2 = f(r2, m2);
65
- t2 && (t2.isDeleteChange(true), t2.clearSelections()), V(r2, l2, e4, "superPageRuntimeMessage.successfulDelete", true), s2(true);
66
- }).catch((e4) => {
67
- a2(e4);
68
- });
69
- }).catch(() => {
70
- a2();
71
- });
1
+ import { deepCopy, isWorkflowPage, isArrayFn, getBaseUrl, getRealRestApiPath, packageTemplateFiles, upperFirstCase, getListCode } from "../common-util.js";
2
+ import http from "agilebuilder-ui/src/utils/request";
3
+ import { getI18n } from "agilebuilder-ui/src/utils/util";
4
+ import { ElMessage, ElMessageBox } from "element-plus";
5
+ import { getToken, getSessionCache, setSessionCache } from "agilebuilder-ui/src/utils/auth";
6
+ import { getComponentRef } from "../global-refs.js";
7
+ import bus from "../eventBus.js";
8
+ import axios from "axios";
9
+ import { handleEvent, getTableUuid, doAfterClickEvent } from "./event-util.js";
10
+ import { setStoreInfo } from "../store-util.js";
11
+ import { getPermissionCodes, getDefaultValue, getModelFields } from "../page-init-util.js";
12
+ import { updateChartDatasources, caculateShowCondition, getVariableValue, setVariableValue } from "../page-helper-util.js";
13
+ import printLabelUtil from "./print-label.js";
14
+ import { getTableNameByTableUuid } from "../table-utils.js";
15
+ import { getWorkflowRules, packageCustomRules } from "./validator-util.js";
16
+ import { functions } from "../api/page-expose-util.js";
17
+ import { usePageContextStore } from "../page-store.js";
18
+ const standardEvents = {
19
+ // 表单标准事件保存save
20
+ save: function(params) {
21
+ console.log("表单标准事件保存save--params=", params);
22
+ return saveFunc(params, false);
23
+ },
24
+ // 列表标准事件保存saveList
25
+ saveList: function(params) {
26
+ console.log("列表标准事件保存saveList--params=", params);
27
+ return saveFunc(params, true);
28
+ },
29
+ // 表单标准事件导出报告exportForm
30
+ exportForm: function(params) {
31
+ console.log("表单标准事件导出报告exportForm--params=", params);
32
+ const pageContext = params.pageContext;
33
+ const pagCode = pageContext.code;
34
+ const eventPageInfo = pagCode + "_";
35
+ bus.$emit(eventPageInfo + "export-form-report", params);
36
+ },
37
+ // 表单标准事件导出报告exportPDF
38
+ exportPDF: function(params) {
39
+ console.log("表单标准事件导出报告exportPDF--params=", params);
40
+ const pageContext = params.pageContext;
41
+ const pagCode = pageContext.code;
42
+ const eventPageInfo = pagCode + "_";
43
+ bus.$emit(eventPageInfo + "export-pdf-report", params);
44
+ },
45
+ // 表单标准事件提交submit
46
+ submit: function(params) {
47
+ console.log("表单标准事件提交submit--params=", params);
48
+ return submitForm(params, false, "submit", "/dsc/commons/submits");
49
+ },
50
+ // 列表标准事件提交submitList
51
+ submitList: function(params) {
52
+ console.log("列表标准事件提交submitList--params=", params);
53
+ return submitForm(params, true, "submit", "/dsc/commons/batch-submits");
54
+ },
55
+ // 表单标准事件同意agree
56
+ agree: function(params) {
57
+ console.log("表单标准事件同意agree--params=", params);
58
+ return submitForm(params, false, "agree", "/dsc/commons/approves");
59
+ },
60
+ // 列表标准事件同意agreeList
61
+ agreeList: function(params) {
62
+ console.log("列表标准事件同意agreeList--params=", params);
63
+ return submitForm(params, true, "agree", "/dsc/commons/batch-approves");
64
+ },
65
+ // 表单标准事件不同意disagree
66
+ disagree: function(params) {
67
+ console.log("表单标准事件不同意disagree--params=", params);
68
+ return submitForm(params, false, "disagree", "/dsc/commons/refuses");
69
+ },
70
+ // 列表标准事件不同意disagreeList
71
+ disagreeList: function(params) {
72
+ console.log("列表标准事件不同意disagreeList--params=", params);
73
+ return submitForm(params, true, "disagree", "/dsc/commons/batch-refuses");
74
+ },
75
+ // TODO: 待页面跳转功能完善后再实现
76
+ back: function(params) {
77
+ console.log("表单标准事件返回back--params=", params);
78
+ const pageContext = params.pageContext;
79
+ const dataModel = pageContext.entity ? pageContext.entity.data : {};
80
+ const isNeedValueMapping = params.configureObj.props && params.configureObj.props.base ? params.configureObj.props.base.isNeedValueMapping : false;
81
+ closeDialog(pageContext, dataModel, isNeedValueMapping);
82
+ },
83
+ // 列表标准事件删除delete
84
+ delete: function(params) {
85
+ console.log("列表标准事件删除delete--params=", params);
86
+ return deleteFunc(params);
87
+ },
88
+ // 列表标准事件下载导入模板downloadTemplate
89
+ downloadTemplate: function(params) {
90
+ console.log("列表标准事件下载导入模板downloadTemplate--params=", params);
91
+ downloadTemplateFunc(params);
92
+ },
93
+ // 列表标准事件 导入import
94
+ import: function(params) {
95
+ console.log("列表标准事件 导入import--params=", params);
96
+ const pageContext = params.pageContext;
97
+ const pagCode = pageContext.code;
98
+ const eventPageInfo = pagCode + "_";
99
+ bus.$emit(eventPageInfo + "import-file", params);
100
+ },
101
+ // 列表标准事件 导出export
102
+ export: function(params) {
103
+ console.log("列表标准事件 导出export--params=", params);
104
+ return exportFunc(params);
105
+ },
106
+ // 列表标准事件 查询search
107
+ search: function(params) {
108
+ console.log("列表标准事件 刷新列表 search--params=", params);
109
+ const pageContext = params.pageContext;
110
+ const tableUuid = params.tableUuid;
111
+ const gridRef = getComponentRef(pageContext, tableUuid);
112
+ gridRef.refresh();
113
+ },
114
+ showSearch: function(params) {
115
+ console.log("列表标准事件 显示查询区域 showSearch--params=", params);
116
+ const pageContext = params.pageContext;
117
+ const tableUuid = params.tableUuid;
118
+ const gridRef = getComponentRef(pageContext, tableUuid);
119
+ gridRef.showMobileSearch();
120
+ },
121
+ // 流程表单标准事件 暂存workflowSave
122
+ workflowSave: function(params) {
123
+ console.log("流程表单标准事件 暂存workflowSave--params=", params);
124
+ return workflowSaveFunc(params);
125
+ },
126
+ // 流程表单标准事件 提交流程submitProcess
127
+ submitProcess: function(params) {
128
+ console.log("流程表单标准事件 提交流程submitProcess--params=", params);
129
+ return submitProcessFunc(params);
130
+ },
131
+ // 流程表单标准事件 提交任务submitTask
132
+ submitTask: function(params) {
133
+ console.log("流程表单标准事件 提交任务submitTask--params=", params);
134
+ return completeTaskFunc(params, "SUBMIT");
135
+ },
136
+ // 流程表单标准事件 同意approve
137
+ approve: function(params) {
138
+ console.log("流程表单标准事件 同意approve--params=", params);
139
+ return completeTaskFunc(params, "APPROVE");
140
+ },
141
+ // 流程表单标准事件 不同意refuse
142
+ refuse: function(params) {
143
+ console.log("流程表单标准事件 不同意refuse--params=", params);
144
+ return completeTaskFunc(params, "REFUSE");
145
+ },
146
+ // 流程表单标准事件 已阅readed
147
+ readed: function(params) {
148
+ console.log("流程表单标准事件 已阅readed--params=", params);
149
+ return completeTaskFunc(params, "READED");
150
+ },
151
+ // 流程表单标准事件 赞成agreemen
152
+ agreement: function(params) {
153
+ console.log("流程表单标准事件 赞成agreement--params=", params);
154
+ return completeTaskFunc(params, "AGREEMENT");
155
+ },
156
+ // 流程表单标准事件 反对oppose
157
+ oppose: function(params) {
158
+ console.log("流程表单标准事件 反对oppose--params=", params);
159
+ return completeTaskFunc(params, "OPPOSE");
160
+ },
161
+ // 流程表单标准事件 弃权kiken
162
+ kiken: function(params) {
163
+ console.log("流程表单标准事件 弃权kiken--params=", params);
164
+ return completeTaskFunc(params, "KIKEN");
165
+ },
166
+ // 流程表单标准事件 指派assign
167
+ assign: function(params) {
168
+ console.log("流程表单标准事件 指派assign--params=", params);
169
+ return assignTask(params);
170
+ },
171
+ // 流程表单标准事件 抄送copyTask
172
+ copyTask: function(params) {
173
+ console.log("流程表单标准事件 抄送copyTask--params=", params);
174
+ return createCopyTask(params);
175
+ },
176
+ // 流程表单标准事件 加签addSigner
177
+ addSigner: function(params) {
178
+ console.log("流程表单标准事件 加签addSigner--params=", params);
179
+ return addSignerFunc(params);
180
+ },
181
+ // 流程表单标准事件 领取drawTask
182
+ drawTask: function(params) {
183
+ console.log("流程表单标准事件 领取drawTask--params=", params);
184
+ return drawTaskFunc(params);
185
+ },
186
+ // 放弃领取abandonReceive
187
+ abandonReceive: function(params) {
188
+ console.log("流程表单标准事件 放弃领取abandonReceive--params=", params);
189
+ return abandonReceiveFunc(params);
190
+ },
191
+ // 流程表单标准事件 驳回returnToPreviousTask
192
+ returnToPreviousTask: function(params) {
193
+ console.log("流程表单标准事件 驳回returnToPreviousTask--params=", params);
194
+ return returnToPreviousTaskFunc(params);
195
+ },
196
+ // 流程表单标准事件 强制结束endInstance
197
+ endInstance: function(params) {
198
+ console.log("流程表单标准事件 强制结束endInstance--params=", params);
199
+ return endInstanceFunc(params);
200
+ },
201
+ // 流程表单标准事件 退回returnTaskTo
202
+ returnTaskTo: function(params) {
203
+ console.log("流程表单标准事件 退回returnTaskTo--params=", params);
204
+ return returnTaskToFunc(params);
205
+ },
206
+ // 流程表单标准事件 减签removeSigner
207
+ removeSigner: function(params) {
208
+ console.log("流程表单标准事件 减签removeSigner--params=", params);
209
+ return removeSignerfunc(params);
210
+ },
211
+ // 流程表单标准事件 取回retrieveTask
212
+ retrieveTask: function(params) {
213
+ console.log("流程表单标准事件 取回retrieveTask--params=", params);
214
+ return retrieveTaskFunc(params);
215
+ },
216
+ viewDetail: function(params) {
217
+ },
218
+ lineEditCreate: function(params) {
219
+ console.log("列表行编辑 新建lineEditCreate--params=", params);
220
+ return lineEditCreateFunc(params);
221
+ },
222
+ printLabel: function(params) {
223
+ console.log("打印标签 打印标签事件--params=", params);
224
+ return printLabel(params);
225
+ },
226
+ queryCharts: function(params) {
227
+ console.log("查询统计图--params=", params);
228
+ queryPageCharts(params);
229
+ },
230
+ resetCharts: function(params) {
231
+ var _a, _b;
232
+ console.log("重置统计图--params=", params);
233
+ const pageContext = params.pageContext;
234
+ pageContext.entity.data = deepCopy((_a = pageContext.initChartData) == null ? void 0 : _a.data);
235
+ pageContext.entity.page = deepCopy((_b = pageContext.initChartData) == null ? void 0 : _b.page);
236
+ params.isInitChart = true;
237
+ queryPageCharts(params);
238
+ },
239
+ exportCharts: function(params) {
240
+ console.log("导出统计图--params=", params);
241
+ exportPageCharts(params);
242
+ }
243
+ };
244
+ function queryPageCharts(params) {
245
+ const pageContext = params.pageContext;
246
+ const chartConfigs = pageContext.initChartServiceConfigs;
247
+ if (!chartConfigs || chartConfigs.length == 0) {
248
+ console.log("无需要查询的统计图数据");
249
+ return;
250
+ }
251
+ const configure = params.configureObj;
252
+ let runtimeProps = null;
253
+ if (configure && configure.runtime) {
254
+ runtimeProps = configure.runtime.props;
255
+ }
256
+ const hisState = runtimeProps ? runtimeProps.state : void 0;
257
+ if (runtimeProps) {
258
+ runtimeProps.state = "disabled";
259
+ }
260
+ updateChartDatasources(pageContext, chartConfigs, void 0, params.isInitChart).then(() => {
261
+ if (runtimeProps) {
262
+ runtimeProps.state = hisState;
263
+ }
264
+ }).catch(() => {
265
+ if (runtimeProps) {
266
+ runtimeProps.state = hisState;
267
+ }
268
+ });
269
+ }
270
+ function exportPageCharts(params) {
271
+ const pageContext = params.pageContext;
272
+ const allChartUuids = pageContext.allChartUuids;
273
+ if (!allChartUuids || allChartUuids.length == 0) {
274
+ console.log("无需要导出的统计图数据");
275
+ return;
276
+ }
277
+ const configure = params.configureObj;
278
+ let runtimeProps = null;
279
+ if (configure && configure.runtime) {
280
+ runtimeProps = configure.runtime.props;
281
+ }
282
+ const hisState = runtimeProps ? runtimeProps.state : void 0;
283
+ if (runtimeProps) {
284
+ runtimeProps.state = "disabled";
285
+ }
286
+ const exportChartList = [];
287
+ for (let i = 0; i < allChartUuids.length; i++) {
288
+ const chartUuid = allChartUuids[i];
289
+ const componentObj = getComponentRef(pageContext, chartUuid);
290
+ if (componentObj) {
291
+ const chartConfig = componentObj.getConfigure();
292
+ if (chartConfig && chartConfig.exportable && chartConfig._dynamicShowFlag && componentObj.exportChart) {
293
+ exportChartList.push(componentObj.exportChart());
294
+ }
295
+ }
296
+ }
297
+ if (!exportChartList || exportChartList.length == 0) {
298
+ console.log("无需要导出的统计图数据");
299
+ return;
300
+ }
301
+ let exportFileName;
302
+ let pageName = pageContext.label;
303
+ if (!pageName) {
304
+ pageName = pageContext.code;
305
+ }
306
+ exportFileName = pageName;
307
+ const param = {
308
+ reportDataList: exportChartList,
309
+ beanName: pageContext.beanName
310
+ };
311
+ const backendUrl = pageContext.backendUrl;
312
+ let request;
313
+ const baseUrl = getBaseUrl(backendUrl, pageContext.isTest);
314
+ const path = baseUrl + "/dsc/commons/exportChart";
315
+ axios.defaults.headers.common.Authorization = getToken();
316
+ request = axios.post(path, param, { responseType: "blob" });
317
+ request.then((res) => {
318
+ const link = document.createElement("a");
319
+ link.style.display = "none";
320
+ link.href = URL.createObjectURL(res.data);
321
+ link.setAttribute("download", exportFileName + ".xlsx");
322
+ document.body.appendChild(link);
323
+ link.click();
324
+ document.body.removeChild(link);
325
+ }).finally(() => {
326
+ if (runtimeProps) {
327
+ runtimeProps.state = hisState;
328
+ }
329
+ });
330
+ }
331
+ function exportFormReport(pageContext, configureObj, templateFile, isPdf) {
332
+ var _a;
333
+ const templateUUID = templateFile.templateUuid;
334
+ const fileName = templateFile.templateName;
335
+ const systemCode = pageContext.systemCode;
336
+ const logSetting = (_a = configureObj.props.base) == null ? void 0 : _a.logSetting;
337
+ const isWorkflowForm = isWorkflowPage(pageContext);
338
+ const beanName = pageContext.beanName;
339
+ const button = configureObj.props.base;
340
+ const tableName = configureObj.tableName ? configureObj.tableName : pageContext.tableName;
341
+ const backendUrl = pageContext.backendUrl;
342
+ const viewModels = functions.getFormViewData(pageContext);
343
+ console.log("exportFormReport----viewModels=", viewModels);
344
+ const isPermission = button.isPermission === void 0 || button.isPermission === "true" || button.isPermission;
345
+ const functionCodes = getPermissionCodes(configureObj, pageContext);
346
+ const param = {
347
+ entity: viewModels,
348
+ fileName: templateUUID,
349
+ // uuid
350
+ showName: fileName,
351
+ // 下载的文件名称
352
+ beanName,
353
+ isWorkflowForm,
354
+ // 是否是流程表单
355
+ functionCode: functionCodes,
356
+ tableName,
357
+ isPermission: isPermission + "",
358
+ systemCode,
359
+ listCodesMap: pageContext.listCodesMap,
360
+ pageCode: pageContext.code,
361
+ pageVersion: pageContext.version
362
+ };
363
+ if (logSetting) {
364
+ param["logSettingText"] = logSetting.join("");
365
+ }
366
+ const additionalParamMap = getAdditionalParamMap(pageContext);
367
+ param["additionalParamMap"] = additionalParamMap;
368
+ let exportResult;
369
+ if (isPdf) {
370
+ exportResult = exportFormPdf(fileName, backendUrl, param, pageContext.isTest);
371
+ } else {
372
+ exportResult = exportFormReportSuccess(fileName, backendUrl, param, pageContext.isTest);
373
+ }
374
+ if (exportResult) {
375
+ exportResult.then(() => {
376
+ doAfterClickEvent(pageContext, configureObj);
72
377
  });
73
- }(e2);
74
- }, downloadTemplate: function(e2) {
75
- console.log("列表标准事件下载导入模板downloadTemplate--params=", e2), function(e3) {
76
- var _a;
77
- const t2 = e3.pageContext, s2 = e3.configureObj, n2 = s2.props.base, i2 = a(n2.templateFiles);
78
- let r2, c2;
79
- i2 && i2.length > 0 && (r2 = i2[0].templateUuid, c2 = i2[0].templateName);
80
- const l2 = t2.systemCode, u2 = t2.backendUrl, p2 = c2;
81
- let g2 = "?1=1";
82
- r2 && p2 && "undefined" !== r2 && "undefined" !== p2 && "null" !== r2 && "null" !== p2 ? g2 += "&fileName=" + encodeURI(r2) + "&showName=" + encodeURI(p2) : p2 ? g2 += "&showName=" + encodeURI(p2) : t2.label && (g2 += "&showName=" + encodeURI(t2.label) + ".xlsx");
83
- const f2 = (_a = s2.props.base) == null ? void 0 : _a.logSetting;
84
- f2 && (g2 += "&logSettingText=" + f2.join(""));
85
- l2 && (g2 += "&systemCode=" + l2);
86
- const b2 = e3.listCode;
87
- b2 && (g2 += "&listCode=" + b2);
88
- t2.beanName && (g2 += "&beanName=" + t2.beanName);
89
- const C2 = w(s2, t2);
90
- C2 && (g2 += "&functionCode=" + C2);
91
- t2.tableName && (g2 += "&tableName=" + t2.tableName);
92
- t2.code && (g2 += "&pageCode=" + t2.code);
93
- t2.version && (g2 += "&pageVersion=" + t2.version);
94
- const T2 = d();
95
- T2 && (g2 += "&JWT=" + T2);
96
- const y2 = "_RUN_CURRENT_ROLE", h2 = m(y2);
97
- h2 && (g2 += "&" + y2 + "=" + h2);
98
- if (n2) {
99
- g2 += "&isPermission=" + (void 0 === n2.isPermission || "true" === n2.isPermission || n2.isPermission);
100
- }
101
- const P2 = o(u2, t2.isTest);
102
- window.open(P2 + "/dsc/commons/download-files" + g2);
103
- }(e2);
104
- }, import: function(e2) {
105
- console.log("列表标准事件 导入import--params=", e2);
106
- const t2 = e2.pageContext.code + "_";
107
- b.$emit(t2 + "import-file", e2);
108
- }, export: function(e2) {
109
- return console.log("列表标准事件 导出export--params=", e2), function(e3) {
110
- return new Promise((t2, s2) => {
111
- const o2 = e3.pageContext, n2 = e3.configureObj.props.base, a2 = e3.listCode, i2 = e3.selections, r2 = {};
112
- i2 && i2.length > 0 && (r2.data = i2);
113
- let c2 = o2.label;
114
- c2 || (c2 = o2.code);
115
- let l2 = false;
116
- l2 = void 0 !== n2.isAsync && null !== n2.isAsync && n2.isAsync;
117
- const u2 = void 0 === n2.isPermission || "true" === n2.isPermission || n2.isPermission, p2 = w(e3.configureObj, o2), d2 = c2, m2 = { backendUrl: o2.backendUrl, pageContext: o2 };
118
- console.log("exportFunc======exportOptions=", m2), window.$vueApp.config.globalProperties.$exportDataNew(r2, d2, a2, p2, null, m2, l2, o2.code, u2);
378
+ }
379
+ }
380
+ function exportFormReportSuccess(fileName, backendUrl, param, isTest) {
381
+ return new Promise((resolve, reject) => {
382
+ const baseUrl = getBaseUrl(backendUrl, isTest);
383
+ const path = baseUrl + "/dsc/commons/export-reports";
384
+ axios.defaults.headers.common.Authorization = getToken();
385
+ const request = axios.post(path, param, {
386
+ // headers: {
387
+ // 'content-type': 'application/x-www-form-urlencoded'
388
+ // },
389
+ responseType: "blob"
119
390
  });
120
- }(e2);
121
- }, search: function(e2) {
122
- console.log("列表标准事件 刷新列表 search--params=", e2);
123
- const t2 = e2.pageContext, s2 = e2.tableUuid;
124
- f(t2, s2).refresh();
125
- }, showSearch: function(e2) {
126
- console.log("列表标准事件 显示查询区域 showSearch--params=", e2);
127
- const t2 = e2.pageContext, s2 = e2.tableUuid;
128
- f(t2, s2).showMobileSearch();
129
- }, workflowSave: function(e2) {
130
- return console.log("流程表单标准事件 暂存workflowSave--params=", e2), async function(e3) {
131
- return new Promise((t2, s2) => {
132
- const a2 = e3.pageContext, i2 = a2.entity.data, r2 = a2.systemCode, p2 = a2.backendUrl;
133
- let d2 = o(p2, a2.isTest) + "/dsc/workflow-commons";
134
- if (d2 = n(d2, r2, p2, a2.isTest), !d2) return void u({ showClose: true, type: "warning", message: l().t("superPageRuntimeMessage.requestPathEmpty") });
135
- const m2 = K(e3);
136
- let g2;
137
- g2 = i2.id || i2.ID ? c.put(d2, m2) : c.post(d2, m2), g2.then((s3) => {
138
- let o2 = true;
139
- s3 && (o2 = Q(s3, false, a2, e3, null)), true === o2 && u({ showClose: true, type: "success", message: l().t("superPageRuntimeMessage.successfulSave") }), t2(true);
140
- }).catch((e4) => {
141
- s2(e4);
142
- });
391
+ request.then((response) => {
392
+ const blob = new Blob([response.data]);
393
+ let fileNameTwo = "报告.xlsx";
394
+ if (fileName) {
395
+ fileNameTwo = fileName;
396
+ }
397
+ const elink = document.createElement("a");
398
+ elink.download = fileNameTwo;
399
+ elink.style.display = "none";
400
+ elink.target = "_blank";
401
+ elink.href = URL.createObjectURL(blob);
402
+ document.body.appendChild(elink);
403
+ elink.click();
404
+ URL.revokeObjectURL(elink.href);
405
+ document.body.removeChild(elink);
406
+ resolve(true);
407
+ }).catch((error) => {
408
+ reject(error);
143
409
  });
144
- }(e2);
145
- }, submitProcess: function(e2) {
146
- return console.log("流程表单标准事件 提交流程submitProcess--params=", e2), function(e3) {
147
- return new Promise((t2, s2) => {
148
- const a2 = e3.pageContext, i2 = a2.systemCode, r2 = a2.backendUrl;
149
- let p2 = o(r2, a2.isTest) + "/dsc/workflow-commons/submit";
150
- if (p2 = n(p2, i2, r2, a2.isTest), !p2) return void u({ showClose: true, type: "warning", message: l().t("superPageRuntimeMessage.requestPathEmpty") });
151
- const d2 = K(e3), m2 = c.post(p2, d2);
152
- m2 && m2.then((s3) => {
153
- let o2 = true;
154
- s3 && (o2 = Q(s3, false, a2, e3, null)), true === o2 && u({ showClose: true, type: "success", message: l().t("superPageRuntimeMessage.successfulSubmit") }), t2(true);
155
- }).catch((e4) => {
156
- s2(e4);
410
+ });
411
+ }
412
+ function exportFormPdf(fileName, backendUrl, param, isTest) {
413
+ return new Promise((resolve, reject) => {
414
+ const baseUrl = getBaseUrl(backendUrl, isTest);
415
+ const path = baseUrl + "/dsc/commons/export-pdf";
416
+ axios.defaults.headers.common.Authorization = getToken();
417
+ const request = axios.post(path, param, {
418
+ headers: {
419
+ "content-type": "application/json"
420
+ },
421
+ responseType: "blob"
422
+ });
423
+ request.then((response) => {
424
+ const blob = new Blob([response.data]);
425
+ const elink = document.createElement("a");
426
+ elink.download = fileName.substring(0, fileName.lastIndexOf(".")) + ".pdf";
427
+ elink.style.display = "none";
428
+ elink.target = "_blank";
429
+ elink.href = URL.createObjectURL(blob);
430
+ document.body.appendChild(elink);
431
+ elink.click();
432
+ URL.revokeObjectURL(elink.href);
433
+ document.body.removeChild(elink);
434
+ resolve(true);
435
+ }).catch((error) => {
436
+ reject(error);
437
+ });
438
+ });
439
+ }
440
+ function saveFunc(params, isListButton) {
441
+ return new Promise((resolve, reject) => {
442
+ const pageContext = params.pageContext;
443
+ const configureObj = params.configureObj;
444
+ const mainDefaultValueColumns = params.mainDefaultValueColumns;
445
+ const dynamicColumnInfo = params.dynamicColumnInfo;
446
+ const successOperation = configureObj.props.base.successOperation;
447
+ let isUnControlVersion = false;
448
+ if (successOperation && successOperation === "noOperation") {
449
+ isUnControlVersion = true;
450
+ }
451
+ const request = getSaveFormRequest(
452
+ pageContext,
453
+ configureObj,
454
+ "/dsc/commons",
455
+ isUnControlVersion,
456
+ mainDefaultValueColumns,
457
+ dynamicColumnInfo
458
+ );
459
+ if (request) {
460
+ request.then((data) => {
461
+ dealAfterOperate(
462
+ pageContext,
463
+ configureObj,
464
+ data,
465
+ "superPageRuntimeMessage.successfulSave",
466
+ isListButton
467
+ );
468
+ resolve(data);
469
+ }).catch((error) => {
470
+ reject(error);
157
471
  });
472
+ } else {
473
+ reject("保存时request不存在");
474
+ }
475
+ });
476
+ }
477
+ function getCommonFormRequestParam(pageContext, configureObj, isUnControlVersion, mainDefaultValueColumns, dynamicColumnInfo, ids2, row) {
478
+ var _a;
479
+ const isWorkflow = isWorkflowPage(pageContext);
480
+ const systemCode = pageContext.systemCode;
481
+ const isPermission = configureObj.props.base.isPermission === void 0 || configureObj.props.base.isPermission === "true" || configureObj.props.base.isPermission;
482
+ const functionCodes = getPermissionCodes(configureObj, pageContext);
483
+ let entity = row;
484
+ if (!entity) {
485
+ entity = pageContext.entity.data;
486
+ }
487
+ const param = {
488
+ entity,
489
+ tableName: pageContext.tableName,
490
+ formNoRuleCode: pageContext.formNoRuleCode,
491
+ isWorkflowEntity: isWorkflow,
492
+ functionCode: functionCodes,
493
+ isPermission: isPermission + "",
494
+ listCodesMap: pageContext.listCodesMap,
495
+ pageCode: pageContext.code,
496
+ pageVersion: pageContext.version
497
+ };
498
+ if (ids2) {
499
+ param["ids"] = ids2;
500
+ }
501
+ if (pageContext.judgeHeavyList) {
502
+ if (isArrayFn(pageContext.judgeHeavyList)) {
503
+ param["judgeHeavyList"] = JSON.stringify(pageContext.judgeHeavyList);
504
+ } else {
505
+ param["judgeHeavyList"] = pageContext.judgeHeavyList;
506
+ }
507
+ }
508
+ const conversionCodes = configureObj.props.base.conversionCodes;
509
+ if (conversionCodes) {
510
+ if (isArrayFn(conversionCodes)) {
511
+ param["dataConversionRule"] = conversionCodes.join(",");
512
+ } else if (typeof conversionCodes === "string") {
513
+ param["dataConversionRule"] = conversionCodes;
514
+ }
515
+ }
516
+ console.log("getCommonFormRequestParam--------configureObj----", configureObj);
517
+ const autoSetValueData = getButtonAutoSetValueData(configureObj);
518
+ if (autoSetValueData) {
519
+ param["autoSetValueData"] = autoSetValueData;
520
+ }
521
+ const logSetting = (_a = configureObj.props.base) == null ? void 0 : _a.logSetting;
522
+ if (logSetting) {
523
+ param["logSettingText"] = logSetting.join("");
524
+ }
525
+ if (!param["systemCode"]) {
526
+ param["systemCode"] = systemCode;
527
+ }
528
+ const beanName = pageContext.beanName;
529
+ if (beanName) {
530
+ param["beanName"] = beanName;
531
+ }
532
+ if (dynamicColumnInfo) {
533
+ param["dynamicColumnInfo"] = dynamicColumnInfo;
534
+ }
535
+ if (mainDefaultValueColumns) {
536
+ param["mainDefaultValueColumns"] = mainDefaultValueColumns;
537
+ }
538
+ const additionalParamMap = getAdditionalParamMap(pageContext);
539
+ param["additionalParamMap"] = additionalParamMap;
540
+ if (isUnControlVersion !== void 0) {
541
+ param["unControlVersion"] = isUnControlVersion;
542
+ }
543
+ return param;
544
+ }
545
+ function getSaveFormRequestWithRow(pageContext, configureObj, url, isUnControlVersion, mainDefaultValueColumns, dynamicColumnInfo, row, otherParams) {
546
+ const systemCode = pageContext.systemCode;
547
+ const backendUrl = pageContext.backendUrl;
548
+ const param = getCommonFormRequestParam(
549
+ pageContext,
550
+ configureObj,
551
+ isUnControlVersion,
552
+ mainDefaultValueColumns,
553
+ dynamicColumnInfo,
554
+ null,
555
+ row
556
+ );
557
+ if (otherParams) {
558
+ if (otherParams.tableName) {
559
+ param.tableName = otherParams.tableName;
560
+ }
561
+ }
562
+ return getSaveFormRequestByParam(
563
+ systemCode,
564
+ backendUrl,
565
+ param,
566
+ url,
567
+ pageContext.entity.data,
568
+ pageContext.isTest
569
+ );
570
+ }
571
+ function getSaveFormRequest(pageContext, configureObj, url, isUnControlVersion, mainDefaultValueColumns, dynamicColumnInfo) {
572
+ return getSaveFormRequestWithRow(
573
+ pageContext,
574
+ configureObj,
575
+ url,
576
+ isUnControlVersion,
577
+ mainDefaultValueColumns,
578
+ dynamicColumnInfo,
579
+ null,
580
+ null
581
+ );
582
+ }
583
+ function getSaveFormRequestByParam(systemCode, backendUrl, param, url, formData, isTest) {
584
+ const baseUrl = getBaseUrl(backendUrl, isTest);
585
+ let path = baseUrl + url;
586
+ path = getRealRestApiPath(path, systemCode, backendUrl, isTest);
587
+ let request;
588
+ if (formData && (formData.id || formData.ID)) {
589
+ request = http.put(path, param);
590
+ } else {
591
+ request = http.post(path, param);
592
+ }
593
+ return request;
594
+ }
595
+ function dealAfterOperate(pageContext, configureObj, data, successTip, isListButton) {
596
+ const buttonForPageType = getPageType(pageContext, configureObj, isListButton);
597
+ if (buttonForPageType && buttonForPageType === "list") {
598
+ dealAfterWithList(pageContext, configureObj, data, successTip);
599
+ pageContext.canClick = true;
600
+ } else if (buttonForPageType && buttonForPageType === "form") {
601
+ dealAfterWithForm(pageContext, configureObj, data, successTip);
602
+ } else {
603
+ pageContext.canClick = true;
604
+ }
605
+ }
606
+ function getPageType(pageContext, configureObj, isListButton) {
607
+ let pageType;
608
+ if (isListButton === void 0) {
609
+ pageType = configureObj.props.base.tableUuid ? "list" : null;
610
+ } else if (isListButton === false) {
611
+ pageType = "form";
612
+ }
613
+ if (!pageType) {
614
+ pageType = pageContext.pageType;
615
+ }
616
+ return pageType;
617
+ }
618
+ function dealAfterWithForm(pageContext, configureObj, data, successTip) {
619
+ if (data) {
620
+ const commonEntity = data;
621
+ let dataModel;
622
+ if (commonEntity.entity) {
623
+ dataModel = commonEntity.entity;
624
+ }
625
+ if (commonEntity.formNo) {
626
+ pageContext.initFormNo = commonEntity.formNo;
627
+ }
628
+ const totalModel = { ...dataModel, ...pageContext.entity.page };
629
+ afterSuccessOperateInForm(pageContext, configureObj, totalModel);
630
+ } else {
631
+ pageContext.canClick = true;
632
+ }
633
+ if (successTip) {
634
+ ElMessage({
635
+ message: getI18n().t(successTip),
636
+ type: "success",
637
+ showClose: true
158
638
  });
159
- }(e2);
160
- }, submitTask: function(e2) {
161
- return console.log("流程表单标准事件 提交任务submitTask--params=", e2), X(e2, "SUBMIT");
162
- }, approve: function(e2) {
163
- return console.log("流程表单标准事件 同意approve--params=", e2), X(e2, "APPROVE");
164
- }, refuse: function(e2) {
165
- return console.log("流程表单标准事件 不同意refuse--params=", e2), X(e2, "REFUSE");
166
- }, readed: function(e2) {
167
- return console.log("流程表单标准事件 已阅readed--params=", e2), X(e2, "READED");
168
- }, agreement: function(e2) {
169
- return console.log("流程表单标准事件 赞成agreement--params=", e2), X(e2, "AGREEMENT");
170
- }, oppose: function(e2) {
171
- return console.log("流程表单标准事件 反对oppose--params=", e2), X(e2, "OPPOSE");
172
- }, kiken: function(e2) {
173
- return console.log("流程表单标准事件 弃权kiken--params=", e2), X(e2, "KIKEN");
174
- }, assign: function(e2) {
175
- return console.log("流程表单标准事件 指派assign--params=", e2), function(e3) {
176
- const t2 = e3.pageContext, s2 = t2.code + "_";
177
- b.$emit(s2 + "assign-task", e3);
178
- }(e2);
179
- }, copyTask: function(e2) {
180
- return console.log("流程表单标准事件 抄送copyTask--params=", e2), function(e3) {
181
- const t2 = e3.pageContext, s2 = t2.code + "_";
182
- b.$emit(s2 + "copy-task", e3);
183
- }(e2);
184
- }, addSigner: function(e2) {
185
- return console.log("流程表单标准事件 加签addSigner--params=", e2), function(e3) {
186
- const t2 = e3.pageContext, s2 = t2.code + "_";
187
- b.$emit(s2 + "add-signer", e3);
188
- }(e2);
189
- }, drawTask: function(e2) {
190
- return console.log("流程表单标准事件 领取drawTask--params=", e2), function(e3) {
191
- const t2 = e3.pageContext, s2 = t2.backendUrl, n2 = o(s2, t2.isTest) + "/dsc/workflow-commons/draw-tasks", a2 = K(e3);
192
- return ne(e3, a2, n2, "superPageRuntimeMessage.successfulDrawTask");
193
- }(e2);
194
- }, abandonReceive: function(e2) {
195
- return console.log("流程表单标准事件 放弃领取abandonReceive--params=", e2), function(e3) {
196
- const t2 = e3.pageContext, s2 = t2.backendUrl, n2 = o(s2, t2.isTest) + "/dsc/workflow-commons/abandon-receives", a2 = K(e3);
197
- return ne(e3, a2, n2, "superPageRuntimeMessage.successfulAbandonReceive");
198
- }(e2);
199
- }, returnToPreviousTask: function(e2) {
200
- return console.log("流程表单标准事件 驳回returnToPreviousTask--params=", e2), function(e3) {
201
- const t2 = e3.pageContext, s2 = t2.backendUrl, n2 = o(s2, t2.isTest) + "/dsc/workflow-commons/return-to-previous-tasks", a2 = K(e3);
202
- return ne(e3, a2, n2, "superPageRuntimeMessage.successfulReturnToPreviousTask");
203
- }(e2);
204
- }, endInstance: function(e2) {
205
- return console.log("流程表单标准事件 强制结束endInstance--params=", e2), function(e3) {
206
- const t2 = e3.pageContext, s2 = t2.backendUrl, n2 = o(s2, t2.isTest) + "/dsc/workflow-commons/end-instance", a2 = K(e3);
207
- return ne(e3, a2, n2, "superPageRuntimeMessage.successfulEndInstance");
208
- }(e2);
209
- }, returnTaskTo: function(e2) {
210
- return console.log("流程表单标准事件 退回returnTaskTo--params=", e2), function(e3) {
211
- const t2 = e3.pageContext, s2 = t2.code + "_";
212
- b.$emit(s2 + "choose-return-node", e3);
213
- }(e2);
214
- }, removeSigner: function(e2) {
215
- return console.log("流程表单标准事件 减签removeSigner--params=", e2), function(e3) {
216
- const t2 = e3.pageContext, s2 = t2.code + "_";
217
- b.$emit(s2 + "remove-signer", e3);
218
- }(e2);
219
- }, retrieveTask: function(e2) {
220
- return console.log("流程表单标准事件 取回retrieveTask--params=", e2), function(e3) {
221
- const t2 = e3.pageContext, s2 = t2.backendUrl, n2 = o(s2, t2.isTest) + "/dsc/workflow-commons/retrieves", a2 = K(e3);
222
- return ne(e3, a2, n2, "superPageRuntimeMessage.successfulRetrieve");
223
- }(e2);
224
- }, viewDetail: function(e2) {
225
- }, lineEditCreate: function(e2) {
226
- return console.log("列表行编辑 新建lineEditCreate--params=", e2), function(e3) {
227
- const t2 = e3.pageContext, s2 = e3.tableUuid, o2 = f(t2, s2);
228
- o2 && (e3.getDefaultValueFunc = k, o2.createRow(e3.listCode, {}, e3));
229
- }(e2);
230
- }, printLabel: function(e2) {
231
- return console.log("打印标签 打印标签事件--params=", e2), function(e3) {
232
- let t2 = null;
233
- try {
234
- if (t2 = e3.menuItem ? e3.menuItem.templateUuid : e3.configureObj.props.base.template[0].templateUuid, !t2) throw new Error("未找到模板");
235
- } catch (t3) {
236
- console.error("打印标签失败,未在配置中找到找到模板", t3, e3);
237
- }
238
- I.printLabel(e3, t2);
239
- }(e2);
240
- }, queryCharts: function(e2) {
241
- console.log("查询统计图--params=", e2), j(e2);
242
- }, resetCharts: function(t2) {
243
- var _a, _b;
244
- console.log("重置统计图--params=", t2);
245
- const s2 = t2.pageContext;
246
- s2.entity.data = e((_a = s2.initChartData) == null ? void 0 : _a.data), s2.entity.page = e((_b = s2.initChartData) == null ? void 0 : _b.page), t2.isInitChart = true, j(t2);
247
- }, exportCharts: function(e2) {
248
- console.log("导出统计图--params=", e2), function(e3) {
249
- const t2 = e3.pageContext, s2 = t2.allChartUuids;
250
- if (!s2 || 0 == s2.length) return void console.log("无需要导出的统计图数据");
251
- const n2 = e3.configureObj;
252
- let a2 = null;
253
- n2 && n2.runtime && (a2 = n2.runtime.props);
254
- const i2 = a2 ? a2.state : void 0;
255
- a2 && (a2.state = "disabled");
256
- const r2 = [];
257
- for (let e4 = 0; e4 < s2.length; e4++) {
258
- const o2 = s2[e4], n3 = f(t2, o2);
259
- if (n3) {
260
- const e5 = n3.getConfigure();
261
- e5 && e5.exportable && e5._dynamicShowFlag && n3.exportChart && r2.push(n3.exportChart());
262
- }
263
- }
264
- if (!r2 || 0 == r2.length) return void console.log("无需要导出的统计图数据");
265
- let c2, l2 = t2.label;
266
- l2 || (l2 = t2.code);
267
- c2 = l2;
268
- const u2 = { reportDataList: r2, beanName: t2.beanName }, p2 = t2.backendUrl;
269
- let m2;
270
- const g2 = o(p2, t2.isTest) + "/dsc/commons/exportChart";
271
- C.defaults.headers.common.Authorization = d(), m2 = C.post(g2, u2, { responseType: "blob" }), m2.then((e4) => {
272
- const t3 = document.createElement("a");
273
- t3.style.display = "none", t3.href = URL.createObjectURL(e4.data), t3.setAttribute("download", c2 + ".xlsx"), document.body.appendChild(t3), t3.click(), document.body.removeChild(t3);
274
- }).finally(() => {
275
- a2 && (a2.state = i2);
639
+ }
640
+ }
641
+ function afterSuccessOperateInForm(pageContext, configureObj, dataModel) {
642
+ const successOperation = configureObj.props.base.successOperation;
643
+ if (!successOperation || successOperation === null) {
644
+ return;
645
+ }
646
+ const isNeedValueMapping = configureObj.props.base.isNeedValueMapping;
647
+ if (successOperation === "noOperation") {
648
+ if (dataModel) {
649
+ pageContext.entity.data = dataModel;
650
+ }
651
+ pageContext.canClick = true;
652
+ } else if (successOperation === "refresh") {
653
+ if (dataModel && (dataModel.id || dataModel.ID)) {
654
+ refreshPage(pageContext, dataModel.ID ? dataModel.ID : dataModel.id);
655
+ } else {
656
+ pageContext.canClick = true;
657
+ }
658
+ } else if (successOperation === "closeWindow" || successOperation === "closeWindowAndRefresh") {
659
+ closeDialog(pageContext, dataModel, isNeedValueMapping);
660
+ pageContext.canClick = true;
661
+ console.log("afterSuccessOperateInForm--successOperation=--", successOperation);
662
+ }
663
+ }
664
+ function closeDialog(pageContext, dataModel, isNeedValueMapping) {
665
+ const jumpMode = pageContext.entity && pageContext.entity.request ? pageContext.entity.request.jumpMode : null;
666
+ if (jumpMode === "openWindow" || jumpMode === "newTab") {
667
+ if (window.parent) {
668
+ window.parent.close();
669
+ } else {
670
+ window.close();
671
+ }
672
+ } else {
673
+ const sourceTableName = pageContext.tableName;
674
+ const isNeedValueMappingFinal = isNeedValueMapping !== void 0 && isNeedValueMapping === true && dataModel && dataModel !== void 0;
675
+ const parentPageCode = pageContext.entity && pageContext.entity.request ? pageContext.entity.request.parentPageCode : null;
676
+ const eventPageInfo = parentPageCode + "_";
677
+ bus.$emit(eventPageInfo + "close-dialog", {
678
+ isNeedValueMapping: isNeedValueMappingFinal,
679
+ dataModel,
680
+ sourceTableName,
681
+ jumpMode
276
682
  });
277
- }(e2);
278
- } };
279
- function j(e2) {
280
- const t2 = e2.pageContext, s2 = t2.initChartServiceConfigs;
281
- if (!s2 || 0 == s2.length) return void console.log("无需要查询的统计图数据");
282
- const o2 = e2.configureObj;
283
- let n2 = null;
284
- o2 && o2.runtime && (n2 = o2.runtime.props);
285
- const a2 = n2 ? n2.state : void 0;
286
- n2 && (n2.state = "disabled"), M(t2, s2, void 0, e2.isInitChart).then(() => {
287
- n2 && (n2.state = a2);
288
- }).catch(() => {
289
- n2 && (n2.state = a2);
683
+ }
684
+ }
685
+ function updateValuesWhenCloseDialog(parentPageContext, parentConfigureObj, sourceModel, sourceTableName, valueMappings) {
686
+ var _a;
687
+ if (!valueMappings) {
688
+ valueMappings = parentConfigureObj.runtime && parentConfigureObj.runtime.linkPage && parentConfigureObj.runtime.linkPage.valueMappings ? parentConfigureObj.runtime.linkPage.valueMappings : null;
689
+ if (!valueMappings) {
690
+ valueMappings = (_a = parentConfigureObj.props.linkPage) == null ? void 0 : _a.valueMappings;
691
+ }
692
+ }
693
+ const targetTableName = parentPageContext.tableName;
694
+ console.log("update-value66-", sourceModel, sourceTableName);
695
+ updateWithPageValue(sourceModel, valueMappings, parentPageContext);
696
+ handleEvent(null, parentPageContext, parentConfigureObj, "setValue", {
697
+ sourceModel,
698
+ sourceTableName,
699
+ entity: parentPageContext.entity.data,
700
+ targetTableName
290
701
  });
291
702
  }
292
- function D(e2, s2, n2, a2) {
703
+ function updateWithPageValue(sourceModel, valueMappings, parentPageContext) {
704
+ if (sourceModel && sourceModel !== null && valueMappings) {
705
+ let sourceEntity = sourceModel;
706
+ if (Array.isArray(sourceModel) && sourceModel.length > 0) {
707
+ sourceEntity = sourceModel[0];
708
+ }
709
+ valueMappings.forEach((valueMapping) => {
710
+ const sourceField = valueMapping.source;
711
+ if (!sourceField) {
712
+ return;
713
+ }
714
+ const sourceFields = sourceField.split(".");
715
+ const targetValue = getVariableValue(sourceEntity, sourceFields);
716
+ const targetField = valueMapping.target;
717
+ const targetFields = getModelFields(null, targetField);
718
+ setVariableValue(parentPageContext.entity, targetFields, targetValue);
719
+ });
720
+ }
721
+ }
722
+ function dealAfterWithList(pageContext, configureObj, row, successTip) {
723
+ let successOperation = configureObj.props.base.successOperation;
724
+ const isNeedValueMapping = configureObj.props.base.isNeedValueMapping;
725
+ const tableUuid = getTableUuid(pageContext, configureObj);
726
+ if (!successOperation) {
727
+ successOperation = "refresh";
728
+ }
729
+ if (successOperation === "refresh") {
730
+ if (tableUuid) {
731
+ const gridRef = getComponentRef(pageContext, tableUuid);
732
+ gridRef.refresh();
733
+ } else {
734
+ console.error("tableUuid is empty");
735
+ }
736
+ } else if (successOperation === "closeWindow" || successOperation === "closeWindowAndRefresh") {
737
+ const pageData = deepCopy(pageContext.entity.page);
738
+ let dataModel = row;
739
+ if (!dataModel) {
740
+ dataModel = {};
741
+ }
742
+ Object.assign(pageData, dataModel);
743
+ closeDialog(pageContext, pageData, isNeedValueMapping);
744
+ }
745
+ if (successTip) {
746
+ ElMessage({
747
+ message: getI18n().t(successTip),
748
+ type: "success",
749
+ showClose: true
750
+ });
751
+ }
752
+ }
753
+ function refreshFormOrListPage(pageContext, configureObj, isRefreshWhenClosePopup, mySuccessOperation) {
293
754
  var _a;
294
- const i2 = n2.templateUuid, r2 = n2.templateName, c2 = e2.systemCode, l2 = (_a = s2.props.base) == null ? void 0 : _a.logSetting, u2 = t(e2), p2 = e2.beanName, m2 = s2.props.base, g2 = s2.tableName ? s2.tableName : e2.tableName, f2 = e2.backendUrl, b2 = U.getFormViewData(e2);
295
- console.log("exportFormReport----viewModels=", b2);
296
- const T2 = void 0 === m2.isPermission || "true" === m2.isPermission || m2.isPermission, y2 = { entity: b2, fileName: i2, showName: r2, beanName: p2, isWorkflowForm: u2, functionCode: w(s2, e2), tableName: g2, isPermission: T2 + "", systemCode: c2, listCodesMap: e2.listCodesMap, pageCode: e2.code, pageVersion: e2.version };
297
- l2 && (y2.logSettingText = l2.join(""));
298
- const P2 = te(e2);
299
- let k2;
300
- y2.additionalParamMap = P2, k2 = a2 ? function(e3, t2, s3, n3) {
301
- return new Promise((a3, i3) => {
302
- const r3 = o(t2, n3) + "/dsc/commons/export-pdf";
303
- C.defaults.headers.common.Authorization = d();
304
- C.post(r3, s3, { headers: { "content-type": "application/json" }, responseType: "blob" }).then((t3) => {
305
- const s4 = new Blob([t3.data]), o2 = document.createElement("a");
306
- o2.download = e3.substring(0, e3.lastIndexOf(".")) + ".pdf", o2.style.display = "none", o2.target = "_blank", o2.href = URL.createObjectURL(s4), document.body.appendChild(o2), o2.click(), URL.revokeObjectURL(o2.href), document.body.removeChild(o2), a3(true);
307
- }).catch((e4) => {
308
- i3(e4);
755
+ if (configureObj && !configureObj.props.base) {
756
+ configureObj.props.base = {};
757
+ }
758
+ let successOperation = mySuccessOperation;
759
+ if (!successOperation) {
760
+ successOperation = isRefreshWhenClosePopup ? "refresh" : (_a = configureObj.props.base) == null ? void 0 : _a.successOperation;
761
+ }
762
+ console.log(
763
+ "refreshFormOrListPage22=====successOperation=",
764
+ successOperation,
765
+ "isRefreshWhenClosePopup=",
766
+ isRefreshWhenClosePopup
767
+ );
768
+ const buttonForPageType = getPageType(pageContext, configureObj);
769
+ console.log("refreshFormOrListPage22=====buttonForPageType=", buttonForPageType);
770
+ if (buttonForPageType && buttonForPageType === "list" && !successOperation) {
771
+ successOperation = "refresh";
772
+ }
773
+ console.log("refreshFormOrListPage33=====successOperation=", successOperation);
774
+ if (successOperation === "refresh") {
775
+ if (buttonForPageType && buttonForPageType === "list") {
776
+ const tableUuid = getTableUuid(pageContext, configureObj);
777
+ if (tableUuid) {
778
+ const gridRef = getComponentRef(pageContext, tableUuid);
779
+ gridRef.refresh();
780
+ } else {
781
+ console.error("tableUuid is empty");
782
+ }
783
+ } else if (buttonForPageType && buttonForPageType === "form") {
784
+ const dataModel = pageContext.entity.data;
785
+ refreshPage(pageContext, dataModel.ID ? dataModel.ID : dataModel.id);
786
+ }
787
+ }
788
+ }
789
+ function submitForm(params, isListButton, eventName, url) {
790
+ return new Promise((resolve, reject) => {
791
+ const pageContext = params.pageContext;
792
+ const configureObj = params.configureObj;
793
+ const mainDefaultValueColumns = params.mainDefaultValueColumns;
794
+ const dynamicColumnInfo = params.dynamicColumnInfo;
795
+ const ids2 = params.ids;
796
+ const successOperation = configureObj.props.base.successOperation;
797
+ let isUnControlVersion = false;
798
+ if (successOperation && successOperation === "noOperation") {
799
+ isUnControlVersion = true;
800
+ }
801
+ let tableName = pageContext.tableName;
802
+ if (isListButton) {
803
+ const tableUuid = configureObj.props.base.tableUuid ? configureObj.props.base.tableUuid : params.tableUuid;
804
+ tableName = getTableNameByTableUuid(pageContext, tableUuid);
805
+ }
806
+ const request = getSubmitFormRequest(
807
+ pageContext,
808
+ configureObj,
809
+ url,
810
+ isUnControlVersion,
811
+ mainDefaultValueColumns,
812
+ dynamicColumnInfo,
813
+ eventName,
814
+ ids2,
815
+ tableName
816
+ );
817
+ if (request) {
818
+ request.then((data) => {
819
+ dealAfterOperate(
820
+ pageContext,
821
+ configureObj,
822
+ data,
823
+ "superPageRuntimeMessage.successfulSave",
824
+ isListButton
825
+ );
826
+ resolve(data);
827
+ }).catch((error) => {
828
+ reject(error);
309
829
  });
310
- });
311
- }(r2, f2, y2, e2.isTest) : function(e3, t2, s3, n3) {
312
- return new Promise((a3, i3) => {
313
- const r3 = o(t2, n3) + "/dsc/commons/export-reports";
314
- C.defaults.headers.common.Authorization = d();
315
- C.post(r3, s3, { responseType: "blob" }).then((t3) => {
316
- const s4 = new Blob([t3.data]);
317
- let o2 = "报告.xlsx";
318
- e3 && (o2 = e3);
319
- const n4 = document.createElement("a");
320
- n4.download = o2, n4.style.display = "none", n4.target = "_blank", n4.href = URL.createObjectURL(s4), document.body.appendChild(n4), n4.click(), URL.revokeObjectURL(n4.href), document.body.removeChild(n4), a3(true);
321
- }).catch((e4) => {
322
- i3(e4);
830
+ } else {
831
+ reject("request不存在");
832
+ }
833
+ });
834
+ }
835
+ function getSubmitFormRequest(pageContext, configureObj, url, isUnControlVersion, mainDefaultValueColumns, dynamicColumnInfo, eventName, ids2, tableName) {
836
+ return new Promise((resolve, reject) => {
837
+ const buttonName = configureObj.props.base.title;
838
+ const operationI18nTip = "superPageRuntimeMessage.whetherToConfirm" + upperFirstCase(eventName);
839
+ ElMessageBox.confirm(
840
+ getI18n().t(operationI18nTip, { name: buttonName }),
841
+ getI18n().t("superPageRuntimeMessage.tips"),
842
+ {
843
+ confirmButtonText: getI18n().t("superPageRuntimeMessage.sure"),
844
+ cancelButtonText: getI18n().t("superPageRuntimeMessage.cancel"),
845
+ type: "warning"
846
+ }
847
+ ).then(() => {
848
+ const systemCode = pageContext.systemCode;
849
+ const backendUrl = pageContext.backendUrl;
850
+ const param = getCommonFormRequestParam(
851
+ pageContext,
852
+ configureObj,
853
+ isUnControlVersion,
854
+ mainDefaultValueColumns,
855
+ dynamicColumnInfo,
856
+ ids2,
857
+ null
858
+ );
859
+ param.tableName = tableName;
860
+ const baseUrl = getBaseUrl(backendUrl, pageContext.isTest);
861
+ let path = baseUrl + url;
862
+ path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
863
+ http.post(path, param).then((result) => {
864
+ resolve(result);
865
+ }).catch((error) => {
866
+ reject(error);
323
867
  });
868
+ }).catch(() => {
869
+ reject("点击了取消按钮");
324
870
  });
325
- }(r2, f2, y2, e2.isTest), k2 && k2.then(() => {
326
- h(e2, s2);
327
871
  });
328
872
  }
329
- function L(e2, t2) {
330
- return new Promise((s2, o2) => {
331
- const n2 = e2.pageContext, a2 = e2.configureObj, i2 = e2.mainDefaultValueColumns, r2 = e2.dynamicColumnInfo, c2 = a2.props.base.successOperation;
332
- let l2 = false;
333
- c2 && "noOperation" === c2 && (l2 = true);
334
- const u2 = F(n2, a2, "/dsc/commons", l2, i2, r2);
335
- u2 ? u2.then((e3) => {
336
- V(n2, a2, e3, "superPageRuntimeMessage.successfulSave", t2), s2(e3);
337
- }).catch((e3) => {
338
- o2(e3);
339
- }) : o2("保存时request不存在");
873
+ function deleteFunc(params) {
874
+ return new Promise((resolve, reject) => {
875
+ const ids2 = params.ids;
876
+ if (!ids2 || ids2.length === 0) {
877
+ ElMessage({
878
+ showClose: true,
879
+ type: "warning",
880
+ message: getI18n().t("superPageRuntimeMessage.pleaseSelectRecord")
881
+ });
882
+ resolve(true);
883
+ return;
884
+ }
885
+ ElMessageBox.confirm(
886
+ getI18n().t("superPageRuntimeMessage.whetherToConfirmDeletion"),
887
+ getI18n().t("superPageRuntimeMessage.tips"),
888
+ {
889
+ confirmButtonText: getI18n().t("superPageRuntimeMessage.sure"),
890
+ cancelButtonText: getI18n().t("superPageRuntimeMessage.cancel"),
891
+ type: "warning"
892
+ }
893
+ ).then(() => {
894
+ var _a;
895
+ const pageContext = params.pageContext;
896
+ const configureObj = params.configureObj;
897
+ const configureBase = configureObj.props.base;
898
+ const systemCode = pageContext.systemCode;
899
+ const backendUrl = pageContext.backendUrl;
900
+ const tableUuid = configureObj.props.base.tableUuid ? configureObj.props.base.tableUuid : params.tableUuid;
901
+ const tableName = getTableNameByTableUuid(pageContext, tableUuid);
902
+ const baseUrl = getBaseUrl(backendUrl, pageContext.isTest);
903
+ let path = baseUrl + "/dsc/commons/" + tableName;
904
+ path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
905
+ const isPermission = configureBase.isPermission === void 0 || configureBase.isPermission === "true" || configureBase.isPermission;
906
+ const isWorkflow = isWorkflowPage(pageContext);
907
+ const functionCodes = getPermissionCodes(configureObj, pageContext);
908
+ const param = {
909
+ ids: ids2,
910
+ functionCode: functionCodes,
911
+ isPermission: isPermission + "",
912
+ systemCode,
913
+ isWorkflowEntity: isWorkflow,
914
+ listCodesMap: pageContext.listCodesMap,
915
+ pageCode: pageContext.code,
916
+ pageVersion: pageContext.version
917
+ };
918
+ if (pageContext.beanName) {
919
+ param["beanName"] = pageContext.beanName;
920
+ }
921
+ const deleteLogicSetting = configureObj.props.deleteLogicSetting;
922
+ if (deleteLogicSetting) {
923
+ if (typeof deleteLogicSetting === "object") {
924
+ param["deleteLogicSetting"] = JSON.stringify(deleteLogicSetting);
925
+ } else if (typeof deleteLogicSetting === "string") {
926
+ param["deleteLogicSetting"] = deleteLogicSetting;
927
+ }
928
+ }
929
+ const logSetting = (_a = configureObj.props.base) == null ? void 0 : _a.logSetting;
930
+ if (logSetting) {
931
+ param["logSettingText"] = logSetting.join("");
932
+ }
933
+ const isSafeDelete = configureObj.props.base.isSafeDelete;
934
+ if (isSafeDelete) {
935
+ param["isSafeDelete"] = isSafeDelete;
936
+ }
937
+ http.delete(path, {
938
+ data: param
939
+ }).then((data) => {
940
+ const gridRef = getComponentRef(pageContext, tableUuid);
941
+ if (gridRef) {
942
+ gridRef.isDeleteChange(true);
943
+ gridRef.clearSelections();
944
+ }
945
+ dealAfterOperate(
946
+ pageContext,
947
+ configureObj,
948
+ data,
949
+ "superPageRuntimeMessage.successfulDelete",
950
+ true
951
+ );
952
+ resolve(true);
953
+ }).catch((e) => {
954
+ reject(e);
955
+ });
956
+ }).catch(() => {
957
+ reject();
958
+ });
340
959
  });
341
960
  }
342
- function B(e2, o2, n2, a2, i2, r2, c2) {
961
+ function downloadTemplateFunc(params) {
343
962
  var _a;
344
- const l2 = t(e2), u2 = e2.systemCode, p2 = void 0 === o2.props.base.isPermission || "true" === o2.props.base.isPermission || o2.props.base.isPermission, d2 = w(o2, e2);
345
- let m2 = c2;
346
- m2 || (m2 = e2.entity.data);
347
- const g2 = { entity: m2, tableName: e2.tableName, formNoRuleCode: e2.formNoRuleCode, isWorkflowEntity: l2, functionCode: d2, isPermission: p2 + "", listCodesMap: e2.listCodesMap, pageCode: e2.code, pageVersion: e2.version };
348
- r2 && (g2.ids = r2), e2.judgeHeavyList && (s(e2.judgeHeavyList) ? g2.judgeHeavyList = JSON.stringify(e2.judgeHeavyList) : g2.judgeHeavyList = e2.judgeHeavyList);
349
- const f2 = o2.props.base.conversionCodes;
350
- f2 && (s(f2) ? g2.dataConversionRule = f2.join(",") : "string" == typeof f2 && (g2.dataConversionRule = f2)), console.log("getCommonFormRequestParam--------configureObj----", o2);
351
- const b2 = me(o2);
352
- b2 && (g2.autoSetValueData = b2);
353
- const C2 = (_a = o2.props.base) == null ? void 0 : _a.logSetting;
354
- C2 && (g2.logSettingText = C2.join("")), g2.systemCode || (g2.systemCode = u2);
355
- const T2 = e2.beanName;
356
- T2 && (g2.beanName = T2), i2 && (g2.dynamicColumnInfo = i2), a2 && (g2.mainDefaultValueColumns = a2);
357
- const y2 = te(e2);
358
- return g2.additionalParamMap = y2, void 0 !== n2 && (g2.unControlVersion = n2), g2;
359
- }
360
- function W(e2, t2, s2, a2, i2, r2, l2, u2) {
361
- const p2 = e2.systemCode, d2 = e2.backendUrl, m2 = B(e2, t2, a2, i2, r2, null, l2);
362
- return u2 && u2.tableName && (m2.tableName = u2.tableName), function(e3, t3, s3, a3, i3, r3) {
363
- const l3 = o(t3, r3);
364
- let u3, p3 = l3 + a3;
365
- p3 = n(p3, e3, t3, r3), u3 = i3 && (i3.id || i3.ID) ? c.put(p3, s3) : c.post(p3, s3);
366
- return u3;
367
- }(p2, d2, m2, s2, e2.entity.data, e2.isTest);
368
- }
369
- function F(e2, t2, s2, o2, n2, a2) {
370
- return W(e2, t2, s2, o2, n2, a2, null, null);
371
- }
372
- function V(t2, s2, o2, n2, a2) {
373
- const i2 = q(t2, s2, a2);
374
- i2 && "list" === i2 ? (!function(t3, s3, o3, n3) {
375
- let a3 = s3.props.base.successOperation;
376
- const i3 = s3.props.base.isNeedValueMapping, r2 = y(t3, s3);
377
- a3 || (a3 = "refresh");
378
- if ("refresh" === a3) if (r2) {
379
- f(t3, r2).refresh();
380
- } else console.error("tableUuid is empty");
381
- else if ("closeWindow" === a3 || "closeWindowAndRefresh" === a3) {
382
- const s4 = e(t3.entity.page);
383
- let n4 = o3;
384
- n4 || (n4 = {}), Object.assign(s4, n4), H(t3, s4, i3);
385
- }
386
- n3 && u({ message: l().t(n3), type: "success", showClose: true });
387
- }(t2, s2, o2, n2), t2.canClick = true) : i2 && "form" === i2 ? function(e2, t3, s3, o3) {
388
- if (s3) {
389
- const o4 = s3;
390
- let n3;
391
- o4.entity && (n3 = o4.entity), o4.formNo && (e2.initFormNo = o4.formNo);
392
- !function(e3, t4, s4) {
393
- const o5 = t4.props.base.successOperation;
394
- if (!o5 || null === o5) return;
395
- const n4 = t4.props.base.isNeedValueMapping;
396
- "noOperation" === o5 ? (s4 && (e3.entity.data = s4), e3.canClick = true) : "refresh" === o5 ? s4 && (s4.id || s4.ID) ? ue(e3, s4.ID ? s4.ID : s4.id) : e3.canClick = true : "closeWindow" !== o5 && "closeWindowAndRefresh" !== o5 || (H(e3, s4, n4), e3.canClick = true, console.log("afterSuccessOperateInForm--successOperation=--", o5));
397
- }(e2, t3, { ...n3, ...e2.entity.page });
398
- } else e2.canClick = true;
399
- o3 && u({ message: l().t(o3), type: "success", showClose: true });
400
- }(t2, s2, o2, n2) : t2.canClick = true;
401
- }
402
- function q(e2, t2, s2) {
403
- let o2;
404
- return void 0 === s2 ? o2 = t2.props.base.tableUuid ? "list" : null : false === s2 && (o2 = "form"), o2 || (o2 = e2.pageType), o2;
405
- }
406
- function H(e2, t2, s2) {
407
- const o2 = e2.entity && e2.entity.request ? e2.entity.request.jumpMode : null;
408
- if ("openWindow" === o2 || "newTab" === o2) window.parent ? window.parent.close() : window.close();
409
- else {
410
- const n2 = e2.tableName, a2 = void 0 !== s2 && true === s2 && t2 && void 0 !== t2, i2 = (e2.entity && e2.entity.request ? e2.entity.request.parentPageCode : null) + "_";
411
- b.$emit(i2 + "close-dialog", { isNeedValueMapping: a2, dataModel: t2, sourceTableName: n2, jumpMode: o2 });
412
- }
413
- }
414
- function G(e2, t2, s2, o2, n2) {
963
+ const pageContext = params.pageContext;
964
+ const configureObj = params.configureObj;
965
+ const configureBase = configureObj.props.base;
966
+ const templateFilesResult = packageTemplateFiles(configureBase.templateFiles);
967
+ let templateUUID;
968
+ let templateShowPath;
969
+ if (templateFilesResult && templateFilesResult.length > 0) {
970
+ templateUUID = templateFilesResult[0].templateUuid;
971
+ templateShowPath = templateFilesResult[0].templateName;
972
+ }
973
+ const systemCode = pageContext.systemCode;
974
+ const backendUrl = pageContext.backendUrl;
975
+ const showName = templateShowPath;
976
+ let param = "?1=1";
977
+ if (templateUUID && showName && templateUUID !== "undefined" && showName !== "undefined" && templateUUID !== "null" && showName !== "null") {
978
+ param += "&fileName=" + encodeURI(templateUUID) + "&showName=" + encodeURI(showName);
979
+ } else if (showName) {
980
+ param += "&showName=" + encodeURI(showName);
981
+ } else if (pageContext.label) {
982
+ param += "&showName=" + encodeURI(pageContext.label) + ".xlsx";
983
+ }
984
+ const logSetting = (_a = configureObj.props.base) == null ? void 0 : _a.logSetting;
985
+ if (logSetting) {
986
+ param += "&logSettingText=" + logSetting.join("");
987
+ }
988
+ if (systemCode) {
989
+ param += "&systemCode=" + systemCode;
990
+ }
991
+ const listCode = params.listCode;
992
+ if (listCode) {
993
+ param += "&listCode=" + listCode;
994
+ }
995
+ if (pageContext.beanName) {
996
+ param += "&beanName=" + pageContext.beanName;
997
+ }
998
+ const functionCodes = getPermissionCodes(configureObj, pageContext);
999
+ if (functionCodes) {
1000
+ param += "&functionCode=" + functionCodes;
1001
+ }
1002
+ if (pageContext.tableName) {
1003
+ param += "&tableName=" + pageContext.tableName;
1004
+ }
1005
+ if (pageContext.code) {
1006
+ param += "&pageCode=" + pageContext.code;
1007
+ }
1008
+ if (pageContext.version) {
1009
+ param += "&pageVersion=" + pageContext.version;
1010
+ }
1011
+ const token = getToken();
1012
+ if (token) {
1013
+ param += "&JWT=" + token;
1014
+ }
1015
+ const runCurrentRoleKey = "_RUN_CURRENT_ROLE";
1016
+ const currentRole = getSessionCache(runCurrentRoleKey);
1017
+ if (currentRole) {
1018
+ param += "&" + runCurrentRoleKey + "=" + currentRole;
1019
+ }
1020
+ if (configureBase) {
1021
+ const isPermission = configureBase.isPermission === void 0 || configureBase.isPermission === "true" || configureBase.isPermission;
1022
+ param += "&isPermission=" + isPermission;
1023
+ }
1024
+ const baseUrl = getBaseUrl(backendUrl, pageContext.isTest);
1025
+ window.open(baseUrl + "/dsc/commons/download-files" + param);
1026
+ }
1027
+ function doImportFinally(params, fileObj) {
415
1028
  var _a;
416
- n2 || (n2 = t2.runtime && t2.runtime.linkPage && t2.runtime.linkPage.valueMappings ? t2.runtime.linkPage.valueMappings : null) || (n2 = (_a = t2.props.linkPage) == null ? void 0 : _a.valueMappings);
417
- const a2 = e2.tableName;
418
- console.log("update-value66-", s2, o2), function(e3, t3, s3) {
419
- if (e3 && null !== e3 && t3) {
420
- let o3 = e3;
421
- Array.isArray(e3) && e3.length > 0 && (o3 = e3[0]), t3.forEach((e4) => {
422
- const t4 = e4.source;
423
- if (!t4) return;
424
- const n3 = t4.split("."), a3 = R(o3, n3), i2 = e4.target, r2 = v(null, i2);
425
- S(s3.entity, r2, a3);
1029
+ const pageContext = params.pageContext;
1030
+ const buttonConfigureObj = params.configureObj;
1031
+ const tableConfigure = params.tableConfigure;
1032
+ const buttonConfigureBase = buttonConfigureObj.props.base;
1033
+ const tableUuid = buttonConfigureObj.props.base.tableUuid ? buttonConfigureObj.props.base.tableUuid : params.tableUuid;
1034
+ const tableName = getTableNameByTableUuid(pageContext, tableUuid);
1035
+ const param = new FormData();
1036
+ param.append("multipartFile", fileObj);
1037
+ if (tableName) {
1038
+ param.append("tableName", tableName);
1039
+ }
1040
+ if (pageContext.importBeanName) {
1041
+ param.append("importBeanName", pageContext.importBeanName);
1042
+ }
1043
+ if (pageContext.beanName) {
1044
+ param.append("beanName", pageContext.beanName);
1045
+ }
1046
+ const listViewImportDuplicate = (_a = tableConfigure.props.importSetting) == null ? void 0 : _a.listViewImportDuplicate;
1047
+ if (listViewImportDuplicate) {
1048
+ param.append("importDuplicateRule", listViewImportDuplicate);
1049
+ }
1050
+ const judgeHeavyList = pageContext.judgeHeavyList;
1051
+ if (judgeHeavyList) {
1052
+ param.append("judgeHeavyList", JSON.stringify(judgeHeavyList));
1053
+ }
1054
+ const autoSetValueData = getButtonAutoSetValueData(buttonConfigureObj);
1055
+ if (autoSetValueData) {
1056
+ param.append("autoSetValueData", autoSetValueData);
1057
+ }
1058
+ const formNoRuleCode = pageContext.formNoRuleCode;
1059
+ if (formNoRuleCode) {
1060
+ param.append("formNoRuleCode", formNoRuleCode);
1061
+ }
1062
+ const listCode = params.listCode;
1063
+ if (listCode) {
1064
+ param.append("listCode", listCode);
1065
+ }
1066
+ let isAsync = false;
1067
+ if (buttonConfigureBase["isAsync"] !== void 0 && buttonConfigureBase["isAsync"] !== null) {
1068
+ isAsync = buttonConfigureBase.isAsync;
1069
+ } else {
1070
+ isAsync = false;
1071
+ }
1072
+ param.append("isAsync", isAsync + "");
1073
+ param.append("pageCode", pageContext.code);
1074
+ const isWorkflowEntity = isWorkflowPage(pageContext);
1075
+ if (isWorkflowEntity !== null && isWorkflowEntity !== void 0) {
1076
+ param.append("isWorkflowEntity", isWorkflowEntity + "");
1077
+ }
1078
+ const functionCodes = getPermissionCodes(buttonConfigureObj, pageContext);
1079
+ if (functionCodes) {
1080
+ param.append("functionCode", functionCodes);
1081
+ }
1082
+ const additionalParamMap = getAdditionalParamMap(pageContext);
1083
+ param.append("additionalParamMapStr", JSON.stringify(additionalParamMap));
1084
+ const isPermission = buttonConfigureBase.isPermission === void 0 || buttonConfigureBase.isPermission === "true" || buttonConfigureBase.isPermission;
1085
+ param.append("isPermission", isPermission + "");
1086
+ const systemCode = pageContext.systemCode;
1087
+ if (systemCode) {
1088
+ param.append("systemCode", systemCode);
1089
+ }
1090
+ const backendUrl = pageContext.backendUrl;
1091
+ const baseUrl = getBaseUrl(backendUrl, pageContext.isTest);
1092
+ let path = baseUrl + "/dsc/commons/import-data";
1093
+ path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
1094
+ http.post(path, param).then((data) => {
1095
+ if (isAsync) {
1096
+ ElMessage({
1097
+ showClose: true,
1098
+ type: "success",
1099
+ message: getI18n().t("superPageRuntimeMessage.asyncImport")
426
1100
  });
1101
+ } else {
1102
+ let isSuccess = false;
1103
+ if (data) {
1104
+ isSuccess = false;
1105
+ ElMessage({
1106
+ dangerouslyUseHTMLString: true,
1107
+ showClose: true,
1108
+ type: "warning",
1109
+ message: data
1110
+ });
1111
+ } else {
1112
+ ElMessage({
1113
+ showClose: true,
1114
+ type: "success",
1115
+ message: getI18n().t("superPageRuntimeMessage.successfulImport")
1116
+ });
1117
+ isSuccess = true;
1118
+ }
1119
+ dealAfterOperate(pageContext, buttonConfigureObj, data, null, true);
1120
+ pageContext.result = isSuccess;
1121
+ doAfterClickEvent(pageContext, buttonConfigureObj);
427
1122
  }
428
- }(s2, n2, e2), T(null, e2, t2, "setValue", { sourceModel: s2, sourceTableName: o2, entity: e2.entity.data, targetTableName: a2 });
1123
+ }).catch((error) => {
1124
+ console.log("error==", error);
1125
+ });
429
1126
  }
430
- function $(e2, t2, s2, o2) {
431
- var _a;
432
- t2 && !t2.props.base && (t2.props.base = {});
433
- let n2 = o2;
434
- n2 || (n2 = s2 ? "refresh" : (_a = t2.props.base) == null ? void 0 : _a.successOperation), console.log("refreshFormOrListPage22=====successOperation=", n2, "isRefreshWhenClosePopup=", s2);
435
- const a2 = q(e2, t2);
436
- if (console.log("refreshFormOrListPage22=====buttonForPageType=", a2), a2 && "list" === a2 && !n2 && (n2 = "refresh"), console.log("refreshFormOrListPage33=====successOperation=", n2), "refresh" === n2) {
437
- if (a2 && "list" === a2) {
438
- const s3 = y(e2, t2);
439
- if (s3) {
440
- f(e2, s3).refresh();
441
- } else console.error("tableUuid is empty");
442
- } else if (a2 && "form" === a2) {
443
- const t3 = e2.entity.data;
444
- ue(e2, t3.ID ? t3.ID : t3.id);
445
- }
446
- }
447
- }
448
- function J(e2, t2, s2, a2) {
449
- return new Promise((r2, u2) => {
450
- const d2 = e2.pageContext, m2 = e2.configureObj, g2 = e2.mainDefaultValueColumns, f2 = e2.dynamicColumnInfo, b2 = e2.ids, C2 = m2.props.base.successOperation;
451
- let T2 = false;
452
- C2 && "noOperation" === C2 && (T2 = true);
453
- let y2 = d2.tableName;
454
- if (t2) {
455
- const t3 = m2.props.base.tableUuid ? m2.props.base.tableUuid : e2.tableUuid;
456
- y2 = x(d2, t3);
457
- }
458
- const h2 = function(e3, t3, s3, a3, r3, u3, d3, m3, g3) {
459
- return new Promise((f3, b3) => {
460
- const C3 = t3.props.base.title, T3 = "superPageRuntimeMessage.whetherToConfirm" + i(d3);
461
- p.confirm(l().t(T3, { name: C3 }), l().t("superPageRuntimeMessage.tips"), { confirmButtonText: l().t("superPageRuntimeMessage.sure"), cancelButtonText: l().t("superPageRuntimeMessage.cancel"), type: "warning" }).then(() => {
462
- const i2 = e3.systemCode, l2 = e3.backendUrl, p2 = B(e3, t3, a3, r3, u3, m3, null);
463
- p2.tableName = g3;
464
- let d4 = o(l2, e3.isTest) + s3;
465
- d4 = n(d4, i2, l2, e3.isTest), c.post(d4, p2).then((e4) => {
466
- f3(e4);
467
- }).catch((e4) => {
468
- b3(e4);
469
- });
470
- }).catch(() => {
471
- b3("点击了取消按钮");
1127
+ function judgeDataNumber(buttonConfigureObj, ids2) {
1128
+ const buttonConfigureBase = buttonConfigureObj.props.base;
1129
+ if (buttonConfigureBase.conditionsForExecution && buttonConfigureBase.conditionsForExecution !== "") {
1130
+ if (buttonConfigureBase.conditionsForExecution === "one") {
1131
+ if (!ids2 || ids2.length !== 1) {
1132
+ ElMessage({
1133
+ showClose: true,
1134
+ type: "warning",
1135
+ message: getI18n().t("superPageRuntimeMessage.thePreconditionOfTheButtonTo", {
1136
+ message: getI18n().t("superPageRuntimeMessage.onlyOneRecordCanBeselected")
1137
+ })
472
1138
  });
473
- });
474
- }(d2, m2, a2, T2, g2, f2, s2, b2, y2);
475
- h2 ? h2.then((e3) => {
476
- V(d2, m2, e3, "superPageRuntimeMessage.successfulSave", t2), r2(e3);
477
- }).catch((e3) => {
478
- u2(e3);
479
- }) : u2("request不存在");
1139
+ return false;
1140
+ }
1141
+ } else if (buttonConfigureBase.conditionsForExecution === "more") {
1142
+ if (!ids2 || ids2.length <= 0) {
1143
+ ElMessage({
1144
+ showClose: true,
1145
+ type: "warning",
1146
+ message: getI18n().t("superPageRuntimeMessage.thePreconditionOfTheButtonTo", {
1147
+ message: getI18n().t("superPageRuntimeMessage.selectAtLeastOneRecord")
1148
+ })
1149
+ });
1150
+ return false;
1151
+ }
1152
+ }
1153
+ }
1154
+ return true;
1155
+ }
1156
+ function exportFunc(params) {
1157
+ return new Promise((resolve, reject) => {
1158
+ const pageContext = params.pageContext;
1159
+ const configureBase = params.configureObj.props.base;
1160
+ const listCode = params.listCode;
1161
+ const selections = params.selections;
1162
+ const dataParam = {};
1163
+ if (selections && selections.length > 0) {
1164
+ dataParam["data"] = selections;
1165
+ }
1166
+ let pageName = pageContext.label;
1167
+ if (!pageName) {
1168
+ pageName = pageContext.code;
1169
+ }
1170
+ let isAsync = false;
1171
+ if (configureBase["isAsync"] !== void 0 && configureBase["isAsync"] !== null) {
1172
+ isAsync = configureBase.isAsync;
1173
+ } else {
1174
+ isAsync = false;
1175
+ }
1176
+ const isPermission = configureBase.isPermission === void 0 || configureBase.isPermission === "true" || configureBase.isPermission;
1177
+ const functionCodes = getPermissionCodes(params.configureObj, pageContext);
1178
+ const exportFileName = pageName;
1179
+ const exportOptions = {
1180
+ backendUrl: pageContext.backendUrl,
1181
+ pageContext
1182
+ };
1183
+ console.log("exportFunc======exportOptions=", exportOptions);
1184
+ window["$vueApp"].config.globalProperties.$exportDataNew(
1185
+ dataParam,
1186
+ exportFileName,
1187
+ listCode,
1188
+ functionCodes,
1189
+ null,
1190
+ exportOptions,
1191
+ isAsync,
1192
+ pageContext.code,
1193
+ isPermission
1194
+ );
480
1195
  });
481
1196
  }
482
- function z(e2, s2) {
1197
+ function getWorkflowSaveParams(params) {
483
1198
  var _a;
484
- const a2 = e2.pageContext, i2 = e2.configureObj, r2 = e2.tableConfigure, p2 = i2.props.base, d2 = i2.props.base.tableUuid ? i2.props.base.tableUuid : e2.tableUuid, m2 = x(a2, d2), g2 = new FormData();
485
- g2.append("multipartFile", s2), m2 && g2.append("tableName", m2), a2.importBeanName && g2.append("importBeanName", a2.importBeanName), a2.beanName && g2.append("beanName", a2.beanName);
486
- const f2 = (_a = r2.props.importSetting) == null ? void 0 : _a.listViewImportDuplicate;
487
- f2 && g2.append("importDuplicateRule", f2);
488
- const b2 = a2.judgeHeavyList;
489
- b2 && g2.append("judgeHeavyList", JSON.stringify(b2));
490
- const C2 = me(i2);
491
- C2 && g2.append("autoSetValueData", C2);
492
- const T2 = a2.formNoRuleCode;
493
- T2 && g2.append("formNoRuleCode", T2);
494
- const y2 = e2.listCode;
495
- y2 && g2.append("listCode", y2);
496
- let P2 = false;
497
- P2 = void 0 !== p2.isAsync && null !== p2.isAsync && p2.isAsync, g2.append("isAsync", P2 + ""), g2.append("pageCode", a2.code);
498
- const k2 = t(a2);
499
- null != k2 && g2.append("isWorkflowEntity", k2 + "");
500
- const v2 = w(i2, a2);
501
- v2 && g2.append("functionCode", v2);
502
- const M2 = te(a2);
503
- g2.append("additionalParamMapStr", JSON.stringify(M2));
504
- const N2 = void 0 === p2.isPermission || "true" === p2.isPermission || p2.isPermission;
505
- g2.append("isPermission", N2 + "");
506
- const R2 = a2.systemCode;
507
- R2 && g2.append("systemCode", R2);
508
- const S2 = a2.backendUrl;
509
- let I2 = o(S2, a2.isTest) + "/dsc/commons/import-data";
510
- I2 = n(I2, R2, S2, a2.isTest), c.post(I2, g2).then((e3) => {
511
- if (P2) u({ showClose: true, type: "success", message: l().t("superPageRuntimeMessage.asyncImport") });
512
- else {
513
- let t2 = false;
514
- e3 ? (t2 = false, u({ dangerouslyUseHTMLString: true, showClose: true, type: "warning", message: e3 })) : (u({ showClose: true, type: "success", message: l().t("superPageRuntimeMessage.successfulImport") }), t2 = true), V(a2, i2, e3, null, true), a2.result = t2, h(a2, i2);
515
- }
516
- }).catch((e3) => {
517
- console.log("error==", e3);
1199
+ const pageContext = params.pageContext;
1200
+ const configureObj = params.configureObj;
1201
+ const dataModel = pageContext.entity.data;
1202
+ const systemCode = pageContext.systemCode;
1203
+ const permissionPrefix = pageContext.code;
1204
+ let functionCodes = getPermissionCodes(configureObj, pageContext);
1205
+ if (!functionCodes) {
1206
+ functionCodes = permissionPrefix + ".xxx";
1207
+ }
1208
+ if (!dataModel.id && !dataModel.ID) {
1209
+ dataModel["PAGE_CODE"] = pageContext.code;
1210
+ dataModel["PAGE_VERSION"] = pageContext.version;
1211
+ }
1212
+ const param = {
1213
+ entity: dataModel,
1214
+ pageMoel: pageContext.entity.page,
1215
+ formNoRuleCode: pageContext.formNoRuleCode,
1216
+ tableName: pageContext.tableName,
1217
+ emailTemplateCode: pageContext.emailTemplateCode,
1218
+ definitionId: pageContext.definitionId,
1219
+ functionCode: functionCodes,
1220
+ systemCode,
1221
+ listCodesMap: pageContext.listCodesMap,
1222
+ pageCode: pageContext.code,
1223
+ pageVersion: pageContext.version
1224
+ };
1225
+ if (pageContext.completeTaskParam) {
1226
+ param["completeTaskParam"] = {
1227
+ taskId: pageContext.completeTaskParam.taskId,
1228
+ opinion: pageContext.completeTaskParam.opinion
1229
+ };
1230
+ }
1231
+ if (pageContext.judgeHeavyList) {
1232
+ if (isArrayFn(pageContext.judgeHeavyList)) {
1233
+ param["judgeHeavyList"] = JSON.stringify(pageContext.judgeHeavyList);
1234
+ } else {
1235
+ param["judgeHeavyList"] = pageContext.judgeHeavyList;
1236
+ }
1237
+ }
1238
+ const conversionCodes = configureObj.props.base.conversionCodes;
1239
+ if (conversionCodes) {
1240
+ if (isArrayFn(conversionCodes)) {
1241
+ param["dataConversionRule"] = conversionCodes.join(",");
1242
+ } else if (typeof conversionCodes === "string") {
1243
+ param["dataConversionRule"] = conversionCodes;
1244
+ }
1245
+ }
1246
+ console.log("getWorkflowSaveParams----configureObj=", configureObj);
1247
+ const autoSetValueData = getButtonAutoSetValueData(configureObj);
1248
+ if (autoSetValueData) {
1249
+ param["autoSetValueData"] = autoSetValueData;
1250
+ }
1251
+ if (pageContext.beanName) {
1252
+ param["beanName"] = pageContext.beanName;
1253
+ }
1254
+ const logSetting = (_a = configureObj.props.base) == null ? void 0 : _a.logSetting;
1255
+ if (logSetting) {
1256
+ param["logSettingText"] = logSetting.join("");
1257
+ }
1258
+ if (!param.systemCode) {
1259
+ param.systemCode = systemCode;
1260
+ }
1261
+ const additionalParamMap = getAdditionalParamMap(pageContext);
1262
+ param["additionalParamMap"] = additionalParamMap;
1263
+ if (additionalParamMap.ids && additionalParamMap.ids.length > 0) {
1264
+ if (typeof additionalParamMap.ids === "string") {
1265
+ param["ids"] = additionalParamMap.ids.split(",");
1266
+ } else if (Array.isArray(additionalParamMap.ids)) {
1267
+ param["ids"] = additionalParamMap.ids;
1268
+ } else if (typeof ids === "number") {
1269
+ param["ids"] = [additionalParamMap.ids];
1270
+ } else {
1271
+ console.error("ids参数类型错误");
1272
+ }
1273
+ }
1274
+ const successOperation = configureObj.props.base.successOperation;
1275
+ if (successOperation && successOperation === "noOperation") {
1276
+ param["unControlVersion"] = true;
1277
+ }
1278
+ param["isWorkflowEntity"] = true;
1279
+ return param;
1280
+ }
1281
+ async function workflowSaveFunc(params) {
1282
+ return new Promise((resolve, reject) => {
1283
+ const pageContext = params.pageContext;
1284
+ const dataModel = pageContext.entity.data;
1285
+ const systemCode = pageContext.systemCode;
1286
+ const backendUrl = pageContext.backendUrl;
1287
+ let path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons";
1288
+ path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
1289
+ if (!path) {
1290
+ ElMessage({
1291
+ showClose: true,
1292
+ type: "warning",
1293
+ message: getI18n().t("superPageRuntimeMessage.requestPathEmpty")
1294
+ });
1295
+ return;
1296
+ }
1297
+ const param = getWorkflowSaveParams(params);
1298
+ let request;
1299
+ if (dataModel.id || dataModel.ID) {
1300
+ request = http.put(path, param);
1301
+ } else {
1302
+ request = http.post(path, param);
1303
+ }
1304
+ request.then((commonEntity) => {
1305
+ let result = true;
1306
+ if (commonEntity) {
1307
+ result = dealCompleteTaskParam(commonEntity, false, pageContext, params, null);
1308
+ }
1309
+ if (result === true) {
1310
+ ElMessage({
1311
+ showClose: true,
1312
+ type: "success",
1313
+ message: getI18n().t("superPageRuntimeMessage.successfulSave")
1314
+ });
1315
+ }
1316
+ resolve(true);
1317
+ }).catch((error) => {
1318
+ reject(error);
1319
+ });
518
1320
  });
519
1321
  }
520
- function Y(e2, t2) {
521
- const s2 = e2.props.base;
522
- if (s2.conditionsForExecution && "" !== s2.conditionsForExecution) {
523
- if ("one" === s2.conditionsForExecution) {
524
- if (!t2 || 1 !== t2.length) return u({ showClose: true, type: "warning", message: l().t("superPageRuntimeMessage.thePreconditionOfTheButtonTo", { message: l().t("superPageRuntimeMessage.onlyOneRecordCanBeselected") }) }), false;
525
- } else if ("more" === s2.conditionsForExecution && (!t2 || t2.length <= 0)) return u({ showClose: true, type: "warning", message: l().t("superPageRuntimeMessage.thePreconditionOfTheButtonTo", { message: l().t("superPageRuntimeMessage.selectAtLeastOneRecord") }) }), false;
1322
+ function dealCompleteTaskParam(commonEntity, isInit, pageContext, params, operationResult) {
1323
+ const pageCode = pageContext.code;
1324
+ const pageVersion = pageContext.version;
1325
+ let taskId;
1326
+ if (commonEntity) {
1327
+ if (isInit) {
1328
+ pageContext.initFormNo = commonEntity.formNo;
1329
+ pageContext.emailTemplateCode = commonEntity.emailTemplateCode;
1330
+ }
1331
+ if (commonEntity.entity) {
1332
+ pageContext.entity.data = commonEntity.entity;
1333
+ cacheFormDataId(commonEntity.entity.id || commonEntity.entity.ID, pageContext);
1334
+ }
1335
+ const completeTaskResult = commonEntity.completeTaskResult;
1336
+ if (completeTaskResult) {
1337
+ const completeTaskTipType = completeTaskResult.completeTaskTipType;
1338
+ if (completeTaskTipType && completeTaskTipType === "MESSAGE") {
1339
+ const message = completeTaskResult.content;
1340
+ ElMessage({
1341
+ showClose: true,
1342
+ type: "warning",
1343
+ message
1344
+ });
1345
+ return false;
1346
+ }
1347
+ }
1348
+ if (commonEntity.completeTaskParam) {
1349
+ const completeTaskParam = commonEntity.completeTaskParam;
1350
+ taskId = completeTaskParam.taskId;
1351
+ if (params) {
1352
+ params.taskId = taskId;
1353
+ }
1354
+ setStoreInfo(pageCode, pageVersion, "_completeTaskParam", completeTaskParam);
1355
+ pageContext.fieldPermissions = completeTaskParam.fieldPermissions;
1356
+ pageContext.actionPermissions = completeTaskParam.actionPermissions;
1357
+ pageContext.workflowButtonComponent = completeTaskParam.buttonComponent;
1358
+ pageContext.completeTaskParam = completeTaskParam;
1359
+ }
1360
+ if (!pageContext.entity) {
1361
+ pageContext.entity = {};
1362
+ }
1363
+ pageContext.entity.task = commonEntity.taskParamMap;
1364
+ setStoreInfo(pageCode, pageVersion, "_currentActivityName", commonEntity.taskName);
1365
+ }
1366
+ if (params) {
1367
+ params.operationResult = operationResult;
1368
+ }
1369
+ if (!isInit) {
1370
+ dealAfterOperate(pageContext, params.configureObj, commonEntity, null, false);
526
1371
  }
527
1372
  return true;
528
1373
  }
529
- function K(e2) {
530
- var _a;
531
- const t2 = e2.pageContext, o2 = e2.configureObj, n2 = t2.entity.data, a2 = t2.systemCode, i2 = t2.code;
532
- let r2 = w(o2, t2);
533
- r2 || (r2 = i2 + ".xxx"), n2.id || n2.ID || (n2.PAGE_CODE = t2.code, n2.PAGE_VERSION = t2.version);
534
- const c2 = { entity: n2, pageMoel: t2.entity.page, formNoRuleCode: t2.formNoRuleCode, tableName: t2.tableName, emailTemplateCode: t2.emailTemplateCode, definitionId: t2.definitionId, functionCode: r2, systemCode: a2, listCodesMap: t2.listCodesMap, pageCode: t2.code, pageVersion: t2.version };
535
- t2.completeTaskParam && (c2.completeTaskParam = { taskId: t2.completeTaskParam.taskId, opinion: t2.completeTaskParam.opinion }), t2.judgeHeavyList && (s(t2.judgeHeavyList) ? c2.judgeHeavyList = JSON.stringify(t2.judgeHeavyList) : c2.judgeHeavyList = t2.judgeHeavyList);
536
- const l2 = o2.props.base.conversionCodes;
537
- l2 && (s(l2) ? c2.dataConversionRule = l2.join(",") : "string" == typeof l2 && (c2.dataConversionRule = l2)), console.log("getWorkflowSaveParams----configureObj=", o2);
538
- const u2 = me(o2);
539
- u2 && (c2.autoSetValueData = u2), t2.beanName && (c2.beanName = t2.beanName);
540
- const p2 = (_a = o2.props.base) == null ? void 0 : _a.logSetting;
541
- p2 && (c2.logSettingText = p2.join("")), c2.systemCode || (c2.systemCode = a2);
542
- const d2 = te(t2);
543
- c2.additionalParamMap = d2, d2.ids && d2.ids.length > 0 && ("string" == typeof d2.ids ? c2.ids = d2.ids.split(",") : Array.isArray(d2.ids) ? c2.ids = d2.ids : "number" == typeof ids ? c2.ids = [d2.ids] : console.error("ids参数类型错误"));
544
- const m2 = o2.props.base.successOperation;
545
- return m2 && "noOperation" === m2 && (c2.unControlVersion = true), c2.isWorkflowEntity = true, c2;
546
- }
547
- function Q(e2, t2, s2, o2, n2) {
548
- const a2 = s2.code, i2 = s2.version;
549
- let r2;
550
- if (e2) {
551
- t2 && (s2.initFormNo = e2.formNo, s2.emailTemplateCode = e2.emailTemplateCode), e2.entity && (s2.entity.data = e2.entity, function(e3, t3) {
552
- const s3 = te(t3);
553
- e3 && s3 && g(s3._t_ + "_id", e3);
554
- }(e2.entity.id || e2.entity.ID, s2));
555
- const n3 = e2.completeTaskResult;
556
- if (n3) {
557
- const e3 = n3.completeTaskTipType;
558
- if (e3 && "MESSAGE" === e3) {
559
- const e4 = n3.content;
560
- return u({ showClose: true, type: "warning", message: e4 }), false;
561
- }
562
- }
563
- if (e2.completeTaskParam) {
564
- const t3 = e2.completeTaskParam;
565
- r2 = t3.taskId, o2 && (o2.taskId = r2), P(a2, i2, "_completeTaskParam", t3), s2.fieldPermissions = t3.fieldPermissions, s2.actionPermissions = t3.actionPermissions, s2.workflowButtonComponent = t3.buttonComponent, s2.completeTaskParam = t3;
566
- }
567
- s2.entity || (s2.entity = {}), s2.entity.task = e2.taskParamMap, P(a2, i2, "_currentActivityName", e2.taskName);
568
- }
569
- return o2 && (o2.operationResult = n2), t2 || V(s2, o2.configureObj, e2, null, false), true;
570
- }
571
- async function X(e2, t2) {
572
- const s2 = await function(e3) {
573
- return new Promise((t3, s3) => {
574
- var _a, _b, _c, _d;
575
- const o2 = e3.configureObj;
576
- if (o2) {
577
- let s4 = false;
578
- if (((_b = (_a = o2.props) == null ? void 0 : _a.base) == null ? void 0 : _b.isMustOpinion) && (s4 = true), true === s4) {
579
- const t4 = e3.pageContext, n2 = (_d = (_c = o2.props) == null ? void 0 : _c.base) == null ? void 0 : _d.mustOpinionConditions;
580
- s4 = N(t4, o2, n2);
1374
+ function submitProcessFunc(params) {
1375
+ return new Promise((resolve, reject) => {
1376
+ const pageContext = params.pageContext;
1377
+ const systemCode = pageContext.systemCode;
1378
+ const backendUrl = pageContext.backendUrl;
1379
+ let path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/submit";
1380
+ path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
1381
+ if (!path) {
1382
+ ElMessage({
1383
+ showClose: true,
1384
+ type: "warning",
1385
+ message: getI18n().t("superPageRuntimeMessage.requestPathEmpty")
1386
+ });
1387
+ return;
1388
+ }
1389
+ const param = getWorkflowSaveParams(params);
1390
+ const request = http.post(path, param);
1391
+ if (request) {
1392
+ request.then((commonEntity) => {
1393
+ let result = true;
1394
+ if (commonEntity) {
1395
+ result = dealCompleteTaskParam(commonEntity, false, pageContext, params, null);
581
1396
  }
582
- true === s4 ? p.prompt(l().t("superPageRuntimeMessage.pleaseInputOpinion"), l().t("superPageRuntimeMessage.opinion"), { confirmButtonText: l().t("superPageRuntimeMessage.sure"), cancelButtonText: l().t("superPageRuntimeMessage.cancel"), inputType: "textarea", inputValue: null, closeOnClickModal: false, inputValidator: (e4) => !(!e4 || !e4.trim()) || l().t("superPageRuntimeMessage.pleaseInputOpinion") }).then(({ value: e4 }) => {
583
- t3(e4);
584
- }).catch(() => {
585
- t3(false);
586
- }) : t3(true);
587
- } else t3(true);
588
- });
589
- }(e2);
590
- return new Promise((a2, i2) => {
1397
+ if (result === true) {
1398
+ ElMessage({
1399
+ showClose: true,
1400
+ type: "success",
1401
+ message: getI18n().t("superPageRuntimeMessage.successfulSubmit")
1402
+ });
1403
+ }
1404
+ resolve(true);
1405
+ }).catch((error) => {
1406
+ reject(error);
1407
+ });
1408
+ }
1409
+ });
1410
+ }
1411
+ async function completeTaskFunc(params, operationResult) {
1412
+ const validateOpinionResult = await validateOpinion(params);
1413
+ return new Promise((resolve, reject) => {
591
1414
  var _a;
592
- if (s2) {
593
- const r2 = e2.pageContext, p2 = r2.systemCode, d2 = r2.backendUrl, m2 = true === s2 ? (_a = r2.completeTaskParam) == null ? void 0 : _a.opinion : s2;
594
- let g2 = o(d2, r2.isTest) + "/dsc/workflow-commons/complete-tasks";
595
- if (g2 = n(g2, p2, d2, r2.isTest), !g2) return void u({ showClose: true, type: "warning", message: l().t("superPageRuntimeMessage.requestPathEmpty") });
596
- const f2 = K(e2);
597
- f2.completeTaskParam = { operationResult: t2, taskId: r2.completeTaskParam ? r2.completeTaskParam.taskId : null, opinion: m2 || null };
598
- c.post(g2, f2).then((s3) => {
599
- let o2 = true;
600
- s3 && (o2 = Q(s3, false, r2, e2, t2)), true === o2 && u({ showClose: true, type: "success", message: l().t("superPageRuntimeMessage.successfulCompleteTask") }), a2(true);
601
- }).catch((e3) => {
602
- i2(e3);
1415
+ if (validateOpinionResult) {
1416
+ const pageContext = params.pageContext;
1417
+ const systemCode = pageContext.systemCode;
1418
+ const backendUrl = pageContext.backendUrl;
1419
+ const opinion = validateOpinionResult === true ? (_a = pageContext.completeTaskParam) == null ? void 0 : _a.opinion : validateOpinionResult;
1420
+ let path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/complete-tasks";
1421
+ path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
1422
+ if (!path) {
1423
+ ElMessage({
1424
+ showClose: true,
1425
+ type: "warning",
1426
+ message: getI18n().t("superPageRuntimeMessage.requestPathEmpty")
1427
+ });
1428
+ return;
1429
+ }
1430
+ const param = getWorkflowSaveParams(params);
1431
+ param["completeTaskParam"] = {
1432
+ operationResult,
1433
+ taskId: pageContext.completeTaskParam ? pageContext.completeTaskParam.taskId : null,
1434
+ opinion: opinion ? opinion : null
1435
+ };
1436
+ const request = http.post(path, param);
1437
+ request.then((commonEntity) => {
1438
+ let result = true;
1439
+ if (commonEntity) {
1440
+ result = dealCompleteTaskParam(
1441
+ commonEntity,
1442
+ false,
1443
+ pageContext,
1444
+ params,
1445
+ operationResult
1446
+ );
1447
+ }
1448
+ if (result === true) {
1449
+ ElMessage({
1450
+ showClose: true,
1451
+ type: "success",
1452
+ message: getI18n().t("superPageRuntimeMessage.successfulCompleteTask")
1453
+ });
1454
+ }
1455
+ resolve(true);
1456
+ }).catch((error) => {
1457
+ reject(error);
603
1458
  });
604
- } else a2(true);
1459
+ } else {
1460
+ resolve(true);
1461
+ }
605
1462
  });
606
1463
  }
607
- function Z(e2, t2) {
608
- if (t2) {
609
- const s2 = e2.pageContext, n2 = e2.configureObj, a2 = s2.backendUrl, i2 = o(a2, s2.isTest) + "/dsc/workflow-commons/assigns", r2 = t2.id ? t2.id : t2.ID ? t2.ID : null, c2 = K(e2);
610
- c2.assigneeId = r2, ne(e2, c2, i2, "superPageRuntimeMessage.successfulAssign").then((e3) => {
611
- h(s2, n2);
612
- });
1464
+ function validateOpinion(params) {
1465
+ return new Promise((resolve, reject) => {
1466
+ var _a, _b, _c, _d;
1467
+ const configureObj = params.configureObj;
1468
+ if (configureObj) {
1469
+ let isOpinionRequired = false;
1470
+ if ((_b = (_a = configureObj.props) == null ? void 0 : _a.base) == null ? void 0 : _b.isMustOpinion) {
1471
+ isOpinionRequired = true;
1472
+ }
1473
+ if (isOpinionRequired === true) {
1474
+ const pageContext = params.pageContext;
1475
+ const mustOpinionConditions = (_d = (_c = configureObj.props) == null ? void 0 : _c.base) == null ? void 0 : _d.mustOpinionConditions;
1476
+ isOpinionRequired = caculateShowCondition(pageContext, configureObj, mustOpinionConditions);
1477
+ }
1478
+ if (isOpinionRequired === true) {
1479
+ ElMessageBox.prompt(
1480
+ getI18n().t("superPageRuntimeMessage.pleaseInputOpinion"),
1481
+ getI18n().t("superPageRuntimeMessage.opinion"),
1482
+ {
1483
+ confirmButtonText: getI18n().t("superPageRuntimeMessage.sure"),
1484
+ cancelButtonText: getI18n().t("superPageRuntimeMessage.cancel"),
1485
+ // 输入框类型
1486
+ inputType: "textarea",
1487
+ inputValue: null,
1488
+ closeOnClickModal: false,
1489
+ inputValidator: (value) => {
1490
+ if (value && value.trim()) {
1491
+ return true;
1492
+ } else {
1493
+ return getI18n().t("superPageRuntimeMessage.pleaseInputOpinion");
1494
+ }
1495
+ }
1496
+ }
1497
+ ).then(({ value }) => {
1498
+ resolve(value);
1499
+ }).catch(() => {
1500
+ resolve(false);
1501
+ });
1502
+ } else {
1503
+ resolve(true);
1504
+ }
1505
+ } else {
1506
+ resolve(true);
1507
+ }
1508
+ });
1509
+ }
1510
+ function assignTask(params) {
1511
+ const pageContext = params.pageContext;
1512
+ const pagCode = pageContext.code;
1513
+ const eventPageInfo = pagCode + "_";
1514
+ bus.$emit(eventPageInfo + "assign-task", params);
1515
+ }
1516
+ function doAssign(params, selectNodeInfo) {
1517
+ if (selectNodeInfo) {
1518
+ const pageContext = params.pageContext;
1519
+ const configureObj = params.configureObj;
1520
+ const backendUrl = pageContext.backendUrl;
1521
+ const path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/assigns";
1522
+ const assigneeId = selectNodeInfo.id ? selectNodeInfo.id : selectNodeInfo.ID ? selectNodeInfo.ID : null;
1523
+ const requestParam = getWorkflowSaveParams(params);
1524
+ requestParam["assigneeId"] = assigneeId;
1525
+ transactTask(params, requestParam, path, "superPageRuntimeMessage.successfulAssign").then(
1526
+ (result) => {
1527
+ doAfterClickEvent(pageContext, configureObj);
1528
+ }
1529
+ );
613
1530
  }
614
1531
  }
615
- function ee(e2) {
616
- const t2 = e2.pageContext, s2 = t2.entity.data, o2 = t2.systemCode, n2 = t2.code, a2 = te(t2), i2 = void 0 !== s2.ID && null !== s2.ID ? s2.ID : s2.id, r2 = { beanName: t2.beanName, id: i2, entity: s2, additionalParamMap: a2, tableName: t2.tableName, functionCode: n2 + ".xxx", isWorkflowEntity: true, listCodesMap: t2.listCodesMap, pageCode: t2.code, pageVersion: t2.version };
617
- return r2.completeTaskParam = { taskId: t2.completeTaskParam.taskId, systemCode: o2 }, r2;
618
- }
619
- function te(t2) {
620
- if (t2.entity) {
621
- let s2 = e(t2.entity.page);
622
- s2 || (s2 = {});
623
- const o2 = t2.entity.request;
624
- return o2 && Object.assign(s2, o2), s2;
625
- }
626
- }
627
- function se(e2, t2) {
628
- if (t2) {
629
- const s2 = e2.pageContext, a2 = e2.configureObj, i2 = s2.systemCode, r2 = s2.backendUrl;
630
- let p2 = o(r2, s2.isTest) + "/dsc/workflow-commons/add-signers";
631
- if (p2 = n(p2, i2, r2, s2.isTest), !p2) return void u({ showClose: true, type: "warning", message: l().t("superPageRuntimeMessage.requestPathEmpty") });
632
- const d2 = ee(e2);
633
- d2.completeTaskParam.transactors = t2.loginNames.join(",").split(",");
634
- const m2 = c.post(p2, d2);
635
- m2 && m2.then((e3) => {
636
- u({ showClose: true, type: "success", message: l().t("superPageRuntimeMessage.successfulOperation") }), e3.entity && V(s2, a2, e3, null, false), h(s2, a2);
637
- });
1532
+ function getTransactTaskParam(params) {
1533
+ const pageContext = params.pageContext;
1534
+ const dataModel = pageContext.entity.data;
1535
+ const systemCode = pageContext.systemCode;
1536
+ const permissionPrefix = pageContext.code;
1537
+ const additionalParamMap = getAdditionalParamMap(pageContext);
1538
+ const dataId = dataModel.ID !== void 0 && dataModel.ID !== null ? dataModel.ID : dataModel.id;
1539
+ const requestParams = {
1540
+ beanName: pageContext.beanName,
1541
+ id: dataId,
1542
+ entity: dataModel,
1543
+ additionalParamMap,
1544
+ tableName: pageContext.tableName,
1545
+ functionCode: permissionPrefix + ".xxx",
1546
+ isWorkflowEntity: true,
1547
+ listCodesMap: pageContext.listCodesMap,
1548
+ pageCode: pageContext.code,
1549
+ pageVersion: pageContext.version
1550
+ };
1551
+ requestParams["completeTaskParam"] = {
1552
+ taskId: pageContext.completeTaskParam.taskId,
1553
+ systemCode
1554
+ };
1555
+ return requestParams;
1556
+ }
1557
+ function getAdditionalParamMap(pageContext) {
1558
+ if (pageContext.entity) {
1559
+ let additionalParamMap = deepCopy(pageContext.entity.page);
1560
+ if (!additionalParamMap) {
1561
+ additionalParamMap = {};
1562
+ }
1563
+ const requestMap = pageContext.entity.request;
1564
+ if (requestMap) {
1565
+ Object.assign(additionalParamMap, requestMap);
1566
+ }
1567
+ return additionalParamMap;
638
1568
  }
639
1569
  }
640
- function oe(e2, t2) {
641
- if (t2) {
642
- const s2 = e2.pageContext, a2 = e2.configureObj, i2 = s2.systemCode, r2 = s2.backendUrl;
643
- let p2 = o(r2, s2.isTest) + "/dsc/workflow-commons/add-signers";
644
- if (p2 = n(p2, i2, r2, s2.isTest), !p2) return void u({ showClose: true, type: "warning", message: l().t("superPageRuntimeMessage.requestPathEmpty") });
645
- const d2 = ee(e2);
646
- d2.completeTaskParam.transactors = t2.userIds.join(",").split(",");
647
- const m2 = c.post(p2, d2);
648
- m2 && m2.then((e3) => {
649
- u({ showClose: true, type: "success", message: l().t("superPageRuntimeMessage.successfulOperation") }), h(s2, a2);
650
- });
1570
+ function addSignerFunc(params) {
1571
+ const pageContext = params.pageContext;
1572
+ const pagCode = pageContext.code;
1573
+ const eventPageInfo = pagCode + "_";
1574
+ bus.$emit(eventPageInfo + "add-signer", params);
1575
+ }
1576
+ function doAddSigner(params, selectNodeInfo) {
1577
+ if (selectNodeInfo) {
1578
+ const pageContext = params.pageContext;
1579
+ const buttonConfigureObj = params.configureObj;
1580
+ const systemCode = pageContext.systemCode;
1581
+ const backendUrl = pageContext.backendUrl;
1582
+ let path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/add-signers";
1583
+ path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
1584
+ if (!path) {
1585
+ ElMessage({
1586
+ showClose: true,
1587
+ type: "warning",
1588
+ message: getI18n().t("superPageRuntimeMessage.requestPathEmpty")
1589
+ });
1590
+ return;
1591
+ }
1592
+ const requestParams = getTransactTaskParam(params);
1593
+ requestParams["completeTaskParam"].transactors = selectNodeInfo.loginNames.join(",").split(",");
1594
+ const request = http.post(path, requestParams);
1595
+ if (request) {
1596
+ request.then((commonEntity) => {
1597
+ ElMessage({
1598
+ showClose: true,
1599
+ type: "success",
1600
+ message: getI18n().t("superPageRuntimeMessage.successfulOperation")
1601
+ });
1602
+ if (commonEntity.entity) {
1603
+ dealAfterOperate(pageContext, buttonConfigureObj, commonEntity, null, false);
1604
+ }
1605
+ doAfterClickEvent(pageContext, buttonConfigureObj);
1606
+ });
1607
+ }
651
1608
  }
652
1609
  }
653
- function ne(e2, t2, s2, o2) {
654
- return new Promise((a2, i2) => {
655
- const r2 = e2.pageContext, p2 = r2.systemCode, d2 = r2.backendUrl;
656
- if (!(s2 = n(s2, p2, d2, r2.isTest))) return void u({ showClose: true, type: "warning", message: l().t("superPageRuntimeMessage.requestPathEmpty") });
657
- const m2 = c.post(s2, t2);
658
- m2 && m2.then((t3) => {
659
- let s3 = true;
660
- t3 && (s3 = Q(t3, false, r2, e2, null)), true === s3 && u({ showClose: true, type: "success", message: l().t(o2) }), a2(true);
661
- }).catch((e3) => {
662
- i2(e3);
663
- });
664
- });
1610
+ function createCopyTask(params) {
1611
+ const pageContext = params.pageContext;
1612
+ const pagCode = pageContext.code;
1613
+ const eventPageInfo = pagCode + "_";
1614
+ bus.$emit(eventPageInfo + "copy-task", params);
1615
+ }
1616
+ function doCreateCopyTask(params, selectNodeInfo) {
1617
+ if (selectNodeInfo) {
1618
+ const pageContext = params.pageContext;
1619
+ const buttonConfigureObj = params.configureObj;
1620
+ const systemCode = pageContext.systemCode;
1621
+ const backendUrl = pageContext.backendUrl;
1622
+ let path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/add-signers";
1623
+ path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
1624
+ if (!path) {
1625
+ ElMessage({
1626
+ showClose: true,
1627
+ type: "warning",
1628
+ message: getI18n().t("superPageRuntimeMessage.requestPathEmpty")
1629
+ });
1630
+ return;
1631
+ }
1632
+ const requestParams = getTransactTaskParam(params);
1633
+ requestParams["completeTaskParam"].transactors = selectNodeInfo.userIds.join(",").split(",");
1634
+ const request = http.post(path, requestParams);
1635
+ if (request) {
1636
+ request.then((commonEntity) => {
1637
+ ElMessage({
1638
+ showClose: true,
1639
+ type: "success",
1640
+ message: getI18n().t("superPageRuntimeMessage.successfulOperation")
1641
+ });
1642
+ doAfterClickEvent(pageContext, buttonConfigureObj);
1643
+ });
1644
+ }
1645
+ }
665
1646
  }
666
- function ae(e2) {
667
- const t2 = e2.pageContext, s2 = t2.systemCode, a2 = t2.backendUrl, i2 = t2.completeTaskParam;
668
- let r2 = o(a2, t2.isTest) + "/dsc/workflow-commons/returnable-task/" + i2.taskId;
669
- if (r2 = n(r2, s2, a2, t2.isTest), !r2) return void u({ showClose: true, type: "warning", message: l().t("superPageRuntimeMessage.requestPathEmpty") });
670
- const p2 = t2.code, d2 = te(t2), m2 = { beanName: t2.beanName, additionalParamMap: d2, tableName: t2.tableName, functionCode: p2 + ".xxx" };
671
- return c.post(r2, m2);
672
- }
673
- function ie(e2, t2) {
674
- const s2 = e2.pageContext, n2 = e2.configureObj, a2 = s2.backendUrl, i2 = o(a2, s2.isTest) + "/dsc/workflow-commons/returnTaskTo", r2 = K(e2);
675
- t2.nodeName && (r2.returnToNodeName = t2.nodeName), t2.nodeId && (r2.returnToNodeId = t2.nodeId), ne(e2, r2, i2, "superPageRuntimeMessage.successfulReturnTaskTo").then((e3) => {
676
- h(s2, n2);
1647
+ function transactTask(params, requestParam, path, successMessageTip) {
1648
+ return new Promise((resolve, reject) => {
1649
+ const pageContext = params.pageContext;
1650
+ const systemCode = pageContext.systemCode;
1651
+ const backendUrl = pageContext.backendUrl;
1652
+ path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
1653
+ if (!path) {
1654
+ ElMessage({
1655
+ showClose: true,
1656
+ type: "warning",
1657
+ message: getI18n().t("superPageRuntimeMessage.requestPathEmpty")
1658
+ });
1659
+ return;
1660
+ }
1661
+ const request = http.post(path, requestParam);
1662
+ if (request) {
1663
+ request.then((commonEntity) => {
1664
+ let result = true;
1665
+ if (commonEntity) {
1666
+ result = dealCompleteTaskParam(commonEntity, false, pageContext, params, null);
1667
+ }
1668
+ if (result === true) {
1669
+ ElMessage({
1670
+ showClose: true,
1671
+ type: "success",
1672
+ message: getI18n().t(successMessageTip)
1673
+ });
1674
+ }
1675
+ resolve(true);
1676
+ }).catch((error) => {
1677
+ reject(error);
1678
+ });
1679
+ }
677
1680
  });
678
1681
  }
679
- function re(e2) {
680
- const t2 = e2.pageContext, s2 = t2.systemCode, a2 = t2.backendUrl;
681
- let i2 = o(a2, t2.isTest) + "/dsc/workflow-commons/get-remove-signers";
682
- const r2 = K(e2);
683
- if (i2 = n(i2, s2, a2, t2.isTest), i2) return c.post(i2, r2);
684
- u({ showClose: true, type: "warning", message: l().t("superPageRuntimeMessage.requestPathEmpty") });
685
- }
686
- function ce(e2, t2) {
687
- if (t2) {
688
- const s2 = e2.pageContext, a2 = e2.configureObj, i2 = s2.systemCode, r2 = s2.backendUrl;
689
- let p2 = o(r2, s2.isTest) + "/dsc/workflow-commons/remove-signers";
690
- if (p2 = n(p2, i2, r2, s2.isTest), !p2) return void u({ showClose: true, type: "warning", message: l().t("superPageRuntimeMessage.requestPathEmpty") });
691
- const d2 = t2.map((e3) => e3.id ? e3.id : e3.ID ? e3.ID : null), m2 = K(e2);
692
- m2.ids = d2;
693
- const g2 = c.post(p2, m2);
694
- g2 && g2.then((e3) => {
695
- V(s2, a2, e3, "superPageRuntimeMessage.successfulOperation", false), h(s2, a2);
1682
+ function drawTaskFunc(params) {
1683
+ const pageContext = params.pageContext;
1684
+ const backendUrl = pageContext.backendUrl;
1685
+ const path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/draw-tasks";
1686
+ const requestParam = getWorkflowSaveParams(params);
1687
+ return transactTask(params, requestParam, path, "superPageRuntimeMessage.successfulDrawTask");
1688
+ }
1689
+ function abandonReceiveFunc(params) {
1690
+ const pageContext = params.pageContext;
1691
+ const backendUrl = pageContext.backendUrl;
1692
+ const path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/abandon-receives";
1693
+ const requestParam = getWorkflowSaveParams(params);
1694
+ return transactTask(
1695
+ params,
1696
+ requestParam,
1697
+ path,
1698
+ "superPageRuntimeMessage.successfulAbandonReceive"
1699
+ );
1700
+ }
1701
+ function returnToPreviousTaskFunc(params) {
1702
+ const pageContext = params.pageContext;
1703
+ const backendUrl = pageContext.backendUrl;
1704
+ const path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/return-to-previous-tasks";
1705
+ const requestParam = getWorkflowSaveParams(params);
1706
+ return transactTask(
1707
+ params,
1708
+ requestParam,
1709
+ path,
1710
+ "superPageRuntimeMessage.successfulReturnToPreviousTask"
1711
+ );
1712
+ }
1713
+ function endInstanceFunc(params) {
1714
+ const pageContext = params.pageContext;
1715
+ const backendUrl = pageContext.backendUrl;
1716
+ const path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/end-instance";
1717
+ const requestParam = getWorkflowSaveParams(params);
1718
+ return transactTask(params, requestParam, path, "superPageRuntimeMessage.successfulEndInstance");
1719
+ }
1720
+ function returnTaskToFunc(params) {
1721
+ const pageContext = params.pageContext;
1722
+ const pagCode = pageContext.code;
1723
+ const eventPageInfo = pagCode + "_";
1724
+ bus.$emit(eventPageInfo + "choose-return-node", params);
1725
+ }
1726
+ function getTaskInformitions(params) {
1727
+ const pageContext = params.pageContext;
1728
+ const systemCode = pageContext.systemCode;
1729
+ const backendUrl = pageContext.backendUrl;
1730
+ const completeTaskParam = pageContext.completeTaskParam;
1731
+ let path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/returnable-task/" + completeTaskParam.taskId;
1732
+ path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
1733
+ if (!path) {
1734
+ ElMessage({
1735
+ showClose: true,
1736
+ type: "warning",
1737
+ message: getI18n().t("superPageRuntimeMessage.requestPathEmpty")
696
1738
  });
1739
+ return;
697
1740
  }
1741
+ const permissionPrefix = pageContext.code;
1742
+ const additionalParamMap = getAdditionalParamMap(pageContext);
1743
+ const requestParams = {
1744
+ beanName: pageContext.beanName,
1745
+ additionalParamMap,
1746
+ tableName: pageContext.tableName,
1747
+ functionCode: permissionPrefix + ".xxx"
1748
+ };
1749
+ return http.post(path, requestParams);
698
1750
  }
699
- function le(e2, t2, s2) {
700
- let o2 = false;
701
- return e2 && t2 && ("workflowSave" === e2 ? o2 = function(e3) {
702
- if ((void 0 === e3.processState || null === e3.processState || "UNSUBMIT" === e3.processState && "WAIT_TRANSACT" === e3.active) && (void 0 === e3.processState || true === e3.showButtonSave)) return true;
703
- if (e3.processState && "SUBMIT" === e3.processState && "TYPE_READ" !== e3.processingMode && e3.showButtonSave && ("WAIT_TRANSACT" === e3.active || "WAIT_DESIGNATE_TRANSACTOR" === e3.active || "WAIT_CHOICE_TACHE" === e3.active || "DRAW_WAIT" === e3.active)) return true;
704
- return false;
705
- }(t2) : "submitProcess" === e2 ? o2 = function(e3) {
706
- if ((void 0 === e3.processState || null === e3.processState || "UNSUBMIT" === e3.processState && "WAIT_TRANSACT" === e3.active) && (void 0 === e3.processState || true === e3.showButtonSave)) return true;
707
- return false;
708
- }(t2) : "submitTask" === e2 ? o2 = function(e3) {
709
- if (e3.processState && "SUBMIT" === e3.processState && "WAIT_TRANSACT" === e3.active && "EDIT" === e3.processingMode) return true;
710
- return false;
711
- }(t2) : "drawTask" === e2 ? o2 = function(e3) {
712
- if (e3.processState && "SUBMIT" === e3.processState && e3.active && ("DRAW_WAIT" === e3.active || "DEPT_DRAW_WAIT" === e3.active) && e3.showButtonDraw) return true;
713
- return false;
714
- }(t2) : "abandonReceive" === e2 ? o2 = function(e3) {
715
- if (e3.processState && "SUBMIT" === e3.processState && (e3.drawTask && "WAIT_TRANSACT" === e3.active || e3.canAbandonDeptTask && "WAIT_TRANSACT" === e3.active) && e3.showButtonAbandon) return true;
716
- return false;
717
- }(t2) : "approve" === e2 || "refuse" === e2 ? o2 = function(e3) {
718
- if (e3.processState && "SUBMIT" === e3.processState && "WAIT_TRANSACT" === e3.active && ("APPROVE" === e3.processingMode || "COUNTERSIGN" === e3.processingMode)) return true;
719
- return false;
720
- }(t2) : "readed" === e2 ? o2 = function(e3) {
721
- if ("WAIT_TRANSACT" === e3.active && "TYPE_READ" === e3.processingMode) return true;
722
- return false;
723
- }(t2) : "assign" === e2 ? o2 = function(e3) {
724
- if (e3.processState && "SUBMIT" === e3.processState && "TYPE_READ" !== e3.processingMode && ("WAIT_TRANSACT" === e3.active || "DRAW_WAIT" === e3.active)) return true;
725
- return false;
726
- }(t2) : "copyTask" === e2 ? o2 = function(e3) {
727
- if (e3.processState && "SUBMIT" === e3.processState && "WAIT_TRANSACT" === e3.active && "TYPE_READ" !== e3.processingMode && e3.showButtonCopy) return true;
728
- return false;
729
- }(t2) : "addSigner" === e2 ? o2 = function(e3) {
730
- if (e3.processState && "SUBMIT" === e3.processState && "WAIT_TRANSACT" === e3.active && ("APPROVE" === e3.processingMode || "COUNTERSIGN" === e3.processingMode) && "COUNTERSIGN" === e3.processingMode && e3.showButtonAddCounter) return true;
731
- return false;
732
- }(t2) : "removeSigner" === e2 ? o2 = function(e3) {
733
- if (e3.processState && "SUBMIT" === e3.processState && "WAIT_TRANSACT" === e3.active && ("APPROVE" === e3.processingMode || "COUNTERSIGN" === e3.processingMode) && "COUNTERSIGN" === e3.processingMode && e3.showButtonDelCounter) return true;
734
- return false;
735
- }(t2) : "retrieveTask" === e2 ? o2 = function(e3) {
736
- if (e3.processState && "SUBMIT" === e3.processState && function(e4) {
737
- if ("COMPLETED" !== e4.active) return false;
738
- if ("TYPE_READ" === e4.processingMode) return false;
739
- if (!e4.showButtonGetBack) return false;
1751
+ function doReturnTaskTo(params, selectTaskNode) {
1752
+ const pageContext = params.pageContext;
1753
+ const configureObj = params.configureObj;
1754
+ const backendUrl = pageContext.backendUrl;
1755
+ const path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/returnTaskTo";
1756
+ const requestParam = getWorkflowSaveParams(params);
1757
+ if (selectTaskNode.nodeName) {
1758
+ requestParam["returnToNodeName"] = selectTaskNode.nodeName;
1759
+ }
1760
+ if (selectTaskNode.nodeId) {
1761
+ requestParam["returnToNodeId"] = selectTaskNode.nodeId;
1762
+ }
1763
+ transactTask(params, requestParam, path, "superPageRuntimeMessage.successfulReturnTaskTo").then(
1764
+ (result) => {
1765
+ doAfterClickEvent(pageContext, configureObj);
1766
+ }
1767
+ );
1768
+ }
1769
+ function removeSignerfunc(params) {
1770
+ const pageContext = params.pageContext;
1771
+ const pagCode = pageContext.code;
1772
+ const eventPageInfo = pagCode + "_";
1773
+ bus.$emit(eventPageInfo + "remove-signer", params);
1774
+ }
1775
+ function getRemoveSigner(params) {
1776
+ const pageContext = params.pageContext;
1777
+ const systemCode = pageContext.systemCode;
1778
+ const backendUrl = pageContext.backendUrl;
1779
+ let path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/get-remove-signers";
1780
+ const requestParam = getWorkflowSaveParams(params);
1781
+ path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
1782
+ if (!path) {
1783
+ ElMessage({
1784
+ showClose: true,
1785
+ type: "warning",
1786
+ message: getI18n().t("superPageRuntimeMessage.requestPathEmpty")
1787
+ });
1788
+ return;
1789
+ }
1790
+ return http.post(path, requestParam);
1791
+ }
1792
+ function doRemoveSigners(params, selectRemoveTasks) {
1793
+ if (selectRemoveTasks) {
1794
+ const pageContext = params.pageContext;
1795
+ const configureObj = params.configureObj;
1796
+ const systemCode = pageContext.systemCode;
1797
+ const backendUrl = pageContext.backendUrl;
1798
+ let path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/remove-signers";
1799
+ path = getRealRestApiPath(path, systemCode, backendUrl, pageContext.isTest);
1800
+ if (!path) {
1801
+ ElMessage({
1802
+ showClose: true,
1803
+ type: "warning",
1804
+ message: getI18n().t("superPageRuntimeMessage.requestPathEmpty")
1805
+ });
1806
+ return;
1807
+ }
1808
+ const taskIds = selectRemoveTasks.map((task) => task.id ? task.id : task.ID ? task.ID : null);
1809
+ const requestParam = getWorkflowSaveParams(params);
1810
+ requestParam["ids"] = taskIds;
1811
+ const request = http.post(path, requestParam);
1812
+ if (request) {
1813
+ request.then((commonEntity) => {
1814
+ dealAfterOperate(
1815
+ pageContext,
1816
+ configureObj,
1817
+ commonEntity,
1818
+ "superPageRuntimeMessage.successfulOperation",
1819
+ false
1820
+ );
1821
+ doAfterClickEvent(pageContext, configureObj);
1822
+ });
1823
+ }
1824
+ }
1825
+ }
1826
+ function retrieveTaskFunc(params) {
1827
+ const pageContext = params.pageContext;
1828
+ const backendUrl = pageContext.backendUrl;
1829
+ const path = getBaseUrl(backendUrl, pageContext.isTest) + "/dsc/workflow-commons/retrieves";
1830
+ const requestParam = getWorkflowSaveParams(params);
1831
+ return transactTask(params, requestParam, path, "superPageRuntimeMessage.successfulRetrieve");
1832
+ }
1833
+ function lineEditCreateFunc(params) {
1834
+ const pageContext = params.pageContext;
1835
+ const tableUuid = params["tableUuid"];
1836
+ const gridRef = getComponentRef(pageContext, tableUuid);
1837
+ if (gridRef) {
1838
+ params.getDefaultValueFunc = getDefaultValue;
1839
+ gridRef.createRow(params.listCode, {}, params);
1840
+ }
1841
+ }
1842
+ function printLabel(params) {
1843
+ let templateUuid = null;
1844
+ try {
1845
+ if (params.menuItem) {
1846
+ templateUuid = params.menuItem.templateUuid;
1847
+ } else {
1848
+ templateUuid = params.configureObj.props.base.template[0].templateUuid;
1849
+ }
1850
+ if (!templateUuid) {
1851
+ throw new Error("未找到模板");
1852
+ }
1853
+ } catch (e) {
1854
+ console.error("打印标签失败,未在配置中找到找到模板", e, params);
1855
+ }
1856
+ printLabelUtil.printLabel(params, templateUuid);
1857
+ }
1858
+ function isVisibleWorkflowButton(standardEventName, buttonInfo, completeTaskParam) {
1859
+ let isVisible = false;
1860
+ if (standardEventName && buttonInfo) {
1861
+ if (standardEventName === "workflowSave") {
1862
+ isVisible = isVisibleWorkflowSave(buttonInfo);
1863
+ } else if (standardEventName === "submitProcess") {
1864
+ isVisible = isVisibleSubmitProcess(buttonInfo);
1865
+ } else if (standardEventName === "submitTask") {
1866
+ isVisible = isVisibleSubmitTask(buttonInfo);
1867
+ } else if (standardEventName === "drawTask") {
1868
+ isVisible = isVisibleDrawTask(buttonInfo);
1869
+ } else if (standardEventName === "abandonReceive") {
1870
+ isVisible = isVisibleAbandonReceive(buttonInfo);
1871
+ } else if (standardEventName === "approve" || standardEventName === "refuse") {
1872
+ isVisible = isVisibleApproveOrRefuse(buttonInfo);
1873
+ } else if (standardEventName === "readed") {
1874
+ isVisible = isVisibleReaded(buttonInfo);
1875
+ } else if (standardEventName === "assign") {
1876
+ isVisible = isVisibleAssignTask(buttonInfo);
1877
+ } else if (standardEventName === "copyTask") {
1878
+ isVisible = isVisibleCopyTask(buttonInfo);
1879
+ } else if (standardEventName === "addSigner") {
1880
+ isVisible = isVisibleAddSigner(buttonInfo);
1881
+ } else if (standardEventName === "removeSigner") {
1882
+ isVisible = isVisibleRemoveSigner(buttonInfo);
1883
+ } else if (standardEventName === "retrieveTask") {
1884
+ isVisible = isVisibleRetrieveTask(buttonInfo);
1885
+ } else if (standardEventName === "agreement" || standardEventName === "oppose") {
1886
+ isVisible = isVisibleAgreementOrOppose(buttonInfo);
1887
+ } else if (standardEventName === "kiken") {
1888
+ isVisible = isVisibleKiken(buttonInfo);
1889
+ } else if (isShowOtherWorkflowBtn(buttonInfo, completeTaskParam)) {
1890
+ if (standardEventName === "returnToPreviousTask") {
1891
+ isVisible = isVisibleReturnToPreviousTask(buttonInfo);
1892
+ } else {
1893
+ isVisible = true;
1894
+ }
1895
+ }
1896
+ }
1897
+ return isVisible;
1898
+ }
1899
+ function isVisibleWorkflowSave(buttonInfo) {
1900
+ if (typeof buttonInfo["processState"] === "undefined" || buttonInfo["processState"] === null || buttonInfo["processState"] === "UNSUBMIT" && buttonInfo["active"] === "WAIT_TRANSACT") {
1901
+ if (typeof buttonInfo["processState"] === "undefined" || buttonInfo["showButtonSave"] === true) {
740
1902
  return true;
741
- }(e3)) return true;
742
- return false;
743
- }(t2) : "agreement" === e2 || "oppose" === e2 ? o2 = function(e3) {
744
- if (e3.processState && "SUBMIT" === e3.processState && "WAIT_TRANSACT" === e3.active && "VOTE" === e3.processingMode) return true;
1903
+ }
1904
+ }
1905
+ if (buttonInfo["processState"] && buttonInfo["processState"] === "SUBMIT") {
1906
+ if (buttonInfo["processingMode"] !== "TYPE_READ" && buttonInfo["showButtonSave"] && (buttonInfo["active"] === "WAIT_TRANSACT" || buttonInfo["active"] === "WAIT_DESIGNATE_TRANSACTOR" || buttonInfo["active"] === "WAIT_CHOICE_TACHE" || buttonInfo["active"] === "DRAW_WAIT")) {
1907
+ return true;
1908
+ }
1909
+ }
1910
+ return false;
1911
+ }
1912
+ function isVisibleSubmitProcess(buttonInfo) {
1913
+ if (typeof buttonInfo["processState"] === "undefined" || buttonInfo["processState"] === null || buttonInfo["processState"] === "UNSUBMIT" && buttonInfo["active"] === "WAIT_TRANSACT") {
1914
+ if (typeof buttonInfo["processState"] === "undefined" || buttonInfo["showButtonSave"] === true) {
1915
+ return true;
1916
+ }
1917
+ }
1918
+ return false;
1919
+ }
1920
+ function isVisibleSubmitTask(buttonInfo) {
1921
+ if (buttonInfo["processState"] && buttonInfo["processState"] === "SUBMIT") {
1922
+ if (buttonInfo["active"] === "WAIT_TRANSACT" && buttonInfo["processingMode"] === "EDIT") {
1923
+ return true;
1924
+ }
1925
+ }
1926
+ return false;
1927
+ }
1928
+ function isVisibleDrawTask(buttonInfo) {
1929
+ if (buttonInfo["processState"] && buttonInfo["processState"] === "SUBMIT") {
1930
+ if (buttonInfo["active"] && (buttonInfo["active"] === "DRAW_WAIT" || buttonInfo["active"] === "DEPT_DRAW_WAIT") && buttonInfo["showButtonDraw"]) {
1931
+ return true;
1932
+ }
1933
+ }
1934
+ return false;
1935
+ }
1936
+ function isVisibleAbandonReceive(buttonInfo) {
1937
+ if (buttonInfo["processState"] && buttonInfo["processState"] === "SUBMIT") {
1938
+ if ((buttonInfo["drawTask"] && buttonInfo["active"] === "WAIT_TRANSACT" || buttonInfo["canAbandonDeptTask"] && buttonInfo["active"] === "WAIT_TRANSACT") && buttonInfo["showButtonAbandon"]) {
1939
+ return true;
1940
+ }
1941
+ }
1942
+ return false;
1943
+ }
1944
+ function isVisibleApproveOrRefuse(buttonInfo) {
1945
+ if (buttonInfo["processState"] && buttonInfo["processState"] === "SUBMIT") {
1946
+ if (buttonInfo["active"] === "WAIT_TRANSACT" && (buttonInfo["processingMode"] === "APPROVE" || buttonInfo["processingMode"] === "COUNTERSIGN")) {
1947
+ return true;
1948
+ }
1949
+ }
1950
+ return false;
1951
+ }
1952
+ function isVisibleAddSigner(buttonInfo) {
1953
+ if (buttonInfo["processState"] && buttonInfo["processState"] === "SUBMIT") {
1954
+ if (buttonInfo["active"] === "WAIT_TRANSACT" && (buttonInfo["processingMode"] === "APPROVE" || buttonInfo["processingMode"] === "COUNTERSIGN") && buttonInfo["processingMode"] === "COUNTERSIGN" && buttonInfo["showButtonAddCounter"]) {
1955
+ return true;
1956
+ }
1957
+ }
1958
+ return false;
1959
+ }
1960
+ function isVisibleRemoveSigner(buttonInfo) {
1961
+ if (buttonInfo["processState"] && buttonInfo["processState"] === "SUBMIT") {
1962
+ if (buttonInfo["active"] === "WAIT_TRANSACT" && (buttonInfo["processingMode"] === "APPROVE" || buttonInfo["processingMode"] === "COUNTERSIGN") && buttonInfo["processingMode"] === "COUNTERSIGN" && buttonInfo["showButtonDelCounter"]) {
1963
+ return true;
1964
+ }
1965
+ }
1966
+ return false;
1967
+ }
1968
+ function isVisibleAgreementOrOppose(buttonInfo) {
1969
+ if (buttonInfo["processState"] && buttonInfo["processState"] === "SUBMIT") {
1970
+ if (buttonInfo["active"] === "WAIT_TRANSACT" && buttonInfo["processingMode"] === "VOTE") {
1971
+ return true;
1972
+ }
1973
+ }
1974
+ return false;
1975
+ }
1976
+ function isVisibleKiken(buttonInfo) {
1977
+ if (buttonInfo["processState"] && buttonInfo["processState"] === "SUBMIT") {
1978
+ if (buttonInfo["active"] === "WAIT_TRANSACT" && buttonInfo["processingMode"] === "VOTE" && buttonInfo["showButtonKiken"]) {
1979
+ return true;
1980
+ }
1981
+ }
1982
+ return false;
1983
+ }
1984
+ function isVisibleCopyTask(buttonInfo) {
1985
+ if (buttonInfo["processState"] && buttonInfo["processState"] === "SUBMIT") {
1986
+ if (buttonInfo["active"] === "WAIT_TRANSACT" && buttonInfo["processingMode"] !== "TYPE_READ" && buttonInfo["showButtonCopy"]) {
1987
+ return true;
1988
+ }
1989
+ }
1990
+ return false;
1991
+ }
1992
+ function isVisibleAssignTask(buttonInfo) {
1993
+ if (buttonInfo["processState"] && buttonInfo["processState"] === "SUBMIT") {
1994
+ if (buttonInfo["processingMode"] !== "TYPE_READ" && (buttonInfo["active"] === "WAIT_TRANSACT" || buttonInfo["active"] === "DRAW_WAIT")) {
1995
+ return true;
1996
+ }
1997
+ }
1998
+ return false;
1999
+ }
2000
+ function isVisibleRetrieveTask(buttonInfo) {
2001
+ if (buttonInfo["processState"] && buttonInfo["processState"] === "SUBMIT") {
2002
+ if (showRetrieve(buttonInfo)) {
2003
+ return true;
2004
+ }
2005
+ }
2006
+ return false;
2007
+ }
2008
+ function showRetrieve(buttonInfo) {
2009
+ if (buttonInfo["active"] !== "COMPLETED") {
745
2010
  return false;
746
- }(t2) : "kiken" === e2 ? o2 = function(e3) {
747
- if (e3.processState && "SUBMIT" === e3.processState && "WAIT_TRANSACT" === e3.active && "VOTE" === e3.processingMode && e3.showButtonKiken) return true;
2011
+ }
2012
+ if (buttonInfo["processingMode"] === "TYPE_READ") {
748
2013
  return false;
749
- }(t2) : function(e3, t3) {
750
- return e3.processState && "SUBMIT" === e3.processState && "TYPE_READ" !== e3.processingMode && !function(e4) {
751
- const t4 = e4;
752
- let s3 = true;
753
- t4 && (s3 = t4.taskComplete);
754
- return s3;
755
- }(t3);
756
- }(t2, s2) && (o2 = "returnToPreviousTask" !== e2 || function(e3) {
757
- if (e3.rebuttable) return true;
2014
+ }
2015
+ if (!buttonInfo["showButtonGetBack"]) {
758
2016
  return false;
759
- }(t2))), o2;
2017
+ }
2018
+ return true;
2019
+ }
2020
+ function isVisibleReaded(buttonInfo) {
2021
+ if (buttonInfo["active"] === "WAIT_TRANSACT" && buttonInfo["processingMode"] === "TYPE_READ") {
2022
+ return true;
2023
+ }
2024
+ return false;
2025
+ }
2026
+ function isVisibleReturnToPreviousTask(buttonInfo) {
2027
+ if (buttonInfo["rebuttable"]) {
2028
+ return true;
2029
+ }
2030
+ return false;
2031
+ }
2032
+ function isShowOtherWorkflowBtn(buttonInfo, completeTaskParam) {
2033
+ return buttonInfo["processState"] && buttonInfo["processState"] === "SUBMIT" && buttonInfo["processingMode"] !== "TYPE_READ" && !isTaskComplete(completeTaskParam);
2034
+ }
2035
+ function isTaskComplete(completeTaskParam) {
2036
+ const taskParam = completeTaskParam;
2037
+ let taskComplete = true;
2038
+ if (taskParam) {
2039
+ taskComplete = taskParam.taskComplete;
2040
+ }
2041
+ return taskComplete;
2042
+ }
2043
+ function cacheFormDataId(dataId, pageContext) {
2044
+ const additionalParamMap = getAdditionalParamMap(pageContext);
2045
+ if (dataId && additionalParamMap) {
2046
+ setSessionCache(additionalParamMap._t_ + "_id", dataId);
2047
+ }
2048
+ }
2049
+ function refreshPage(pageContext, id) {
2050
+ if (!pageContext.entity.page) {
2051
+ pageContext.entity.page = {};
2052
+ }
2053
+ pageContext.entity.page["_isRefresh"] = true;
2054
+ getFormData(pageContext, id).then((commonEntity) => {
2055
+ pageContext.isRefresh = true;
2056
+ });
760
2057
  }
761
- function ue(e2, t2) {
762
- e2.entity.page || (e2.entity.page = {}), e2.entity.page._isRefresh = true, pe(e2, t2).then((t3) => {
763
- e2.isRefresh = true;
2058
+ function getFormData(pageContext, id, isNeedId) {
2059
+ const pageType = pageContext.pageType;
2060
+ if (pageType && pageType === "form") {
2061
+ console.log("获取表单数据getData--pageContext=", pageContext);
2062
+ pageContext.canClick = false;
2063
+ const isWorkflow = isWorkflowPage(pageContext);
2064
+ if (isWorkflow) {
2065
+ return getWorkflowFormData(pageContext, id, isNeedId);
2066
+ } else {
2067
+ return getCommonFormData(pageContext, id, isNeedId);
2068
+ }
2069
+ } else {
2070
+ return new Promise((resolve, reject) => {
2071
+ resolve(true);
2072
+ });
2073
+ }
2074
+ }
2075
+ function getCommonFormData(pageContext, id, isNeedId) {
2076
+ return new Promise((resolve, reject) => {
2077
+ const systemCode = pageContext.systemCode;
2078
+ const pageCode = pageContext.code;
2079
+ const pageVersion = pageContext.version;
2080
+ const additionalParamMap = getAdditionalParamMap(pageContext);
2081
+ let dataId = id ? id : null;
2082
+ let ids2 = id ? [id] : null;
2083
+ if (isNeedId === void 0 || isNeedId) {
2084
+ if (!dataId) {
2085
+ dataId = additionalParamMap && additionalParamMap.id ? additionalParamMap.id : null;
2086
+ }
2087
+ if (!ids2) {
2088
+ ids2 = additionalParamMap ? additionalParamMap.ids : null;
2089
+ }
2090
+ } else {
2091
+ dataId = null;
2092
+ ids2 = null;
2093
+ additionalParamMap._id = additionalParamMap.id;
2094
+ additionalParamMap.id = null;
2095
+ }
2096
+ const taskId = additionalParamMap ? additionalParamMap.taskId : null;
2097
+ const permissionPrefix = pageCode;
2098
+ console.log("getCommonFormData-----pageContext=", pageContext);
2099
+ const backendUrl = getBaseUrl(pageContext.backendUrl, pageContext.isTest);
2100
+ const param = {
2101
+ pageCode,
2102
+ pageVersion,
2103
+ tableName: pageContext.tableName,
2104
+ formNoRuleCode: pageContext.formNoRuleCode,
2105
+ id: dataId,
2106
+ systemCode,
2107
+ functionCode: permissionPrefix + ".gets",
2108
+ listCodesMap: pageContext.listCodesMap
2109
+ };
2110
+ if (!param.id && additionalParamMap && additionalParamMap._t_ && getSessionCache(additionalParamMap._t_ + "_id")) {
2111
+ param.id = getSessionCache(additionalParamMap._t_ + "_id");
2112
+ }
2113
+ if (ids2) {
2114
+ param["ids"] = formatAdditionalParamMapIds(ids2);
2115
+ }
2116
+ if (pageContext.notIdInitializationList) {
2117
+ param["noIdAndTaskIdInitSetting"] = JSON.stringify(pageContext.notIdInitializationList);
2118
+ }
2119
+ if (additionalParamMap) {
2120
+ param["additionalParamMap"] = additionalParamMap;
2121
+ }
2122
+ if (pageContext.beanName) {
2123
+ param["beanName"] = pageContext.beanName;
2124
+ }
2125
+ if (taskId) {
2126
+ param["taskId"] = taskId;
2127
+ }
2128
+ console.log("getCommonFormData---listCodesMap=", pageContext.listCodesMap);
2129
+ if ((!pageContext.listCodesMap || Object.keys(pageContext.listCodesMap).length === 0) && pageContext.tableUuids) {
2130
+ const listCodesMap = {};
2131
+ pageContext.tableUuids.forEach((tableUuid) => {
2132
+ const listCode = getListCode(pageCode, pageVersion, tableUuid);
2133
+ listCodesMap[listCode] = listCode;
2134
+ });
2135
+ param["listCodesMap"] = listCodesMap;
2136
+ }
2137
+ if (pageContext.refercePropMap) {
2138
+ param["refercePropMap"] = pageContext.refercePropMap;
2139
+ }
2140
+ const urlForView = backendUrl + "/dsc/commons/gets";
2141
+ const pageContextUtil = usePageContextStore();
2142
+ pageContextUtil.restorePageLoadState();
2143
+ handleEvent(null, pageContext, pageContext, "beforeFormLoadData");
2144
+ http.post(urlForView, param).then((commonEntity) => {
2145
+ if (commonEntity) {
2146
+ pageContext.entity.data = commonEntity.entity;
2147
+ pageContext.initFormNo = commonEntity.formNo;
2148
+ }
2149
+ const customRules = pageContext.customRules;
2150
+ const formRules = pageContext.rules;
2151
+ const newFormRules = packageCustomRules(customRules, formRules);
2152
+ pageContext.rules = newFormRules;
2153
+ pageContext.canClick = true;
2154
+ handleEvent(null, pageContext, pageContext, "afterFormLoadData");
2155
+ pageContextUtil.setFormPageDataLoadState(true);
2156
+ resolve(commonEntity);
2157
+ }).catch((error) => {
2158
+ pageContext.canClick = true;
2159
+ reject(error);
2160
+ });
764
2161
  });
765
2162
  }
766
- function pe(e2, s2, n2) {
767
- const a2 = e2.pageType;
768
- if (a2 && "form" === a2) {
769
- console.log("获取表单数据getData--pageContext=", e2), e2.canClick = false;
770
- return t(e2) ? function(e3, t2, s3) {
771
- return new Promise((n3, a3) => {
772
- const i2 = e3.systemCode, l2 = e3.code, u2 = e3.version, p2 = te(e3);
773
- let d2 = t2 || null, g2 = t2 ? [t2] : null;
774
- void 0 === s3 || s3 ? (d2 || (d2 = p2 && p2.id ? p2.id : null), g2 || (g2 = p2 ? p2.ids : null)) : (d2 = null, g2 = null, p2._id = p2.id, p2.id = null);
775
- const f2 = p2 ? p2.taskId : null, b2 = l2, C2 = { pageCode: l2, pageVersion: u2, tableName: e3.tableName, formNoRuleCode: e3.formNoRuleCode, isWorkflowEntity: true, systemCode: i2, functionCode: b2 + ".workflowGets", listCodesMap: e3.listCodesMap };
776
- if (console.log("getWorkflowFormData---listCodesMap=", e3.listCodesMap), (!e3.listCodesMap || 0 === Object.keys(e3.listCodesMap).length) && e3.tableUuids) {
777
- const t3 = {};
778
- e3.tableUuids.forEach((e4) => {
779
- const s4 = r(l2, u2, e4);
780
- t3[s4] = s4;
781
- }), C2.listCodesMap = t3;
782
- }
783
- g2 && (C2.ids = de(g2)), f2 ? C2.taskId = f2 : d2 ? C2.id = d2 : (p2 && p2._t_ && m(p2._t_ + "_id") && (C2.id = m(p2._t_ + "_id")), e3.notIdInitializationList && (C2.noIdAndTaskIdInitSetting = JSON.stringify(e3.notIdInitializationList))), p2 && (C2.additionalParamMap = p2), e3.beanName && (C2.beanName = e3.beanName), e3.refercePropMap && (C2.refercePropMap = e3.refercePropMap);
784
- const y2 = o(e3.backendUrl, e3.isTest) + "/dsc/workflow-commons/gets", h2 = E();
785
- h2.restorePageLoadState(), T(null, e3, e3, "beforeFormLoadData"), c.post(y2, C2).then((t3) => {
786
- e3.definitionId = t3.definitionId, e3.entity.task = t3.taskParamMap, Q(t3, true, e3), e3.workflowRules = A(e3);
787
- const s4 = e3.pageType;
788
- s4 && "form" === s4 && function(e4) {
789
- (function(e5) {
790
- const t4 = /* @__PURE__ */ new Map(), s5 = e5.fieldPermissions;
791
- if (void 0 !== s5) for (let e6 = 0; e6 < s5.length; e6++) {
792
- const o2 = s5[e6].name;
793
- if (o2) if (0 === o2.indexOf("$") && o2.indexOf(".") > 0) {
794
- const n4 = s5[e6], a4 = JSON.parse(JSON.stringify(n4)), i3 = o2.substring(1, o2.indexOf(".")), r2 = o2.substring(o2.indexOf(".") + 1);
795
- if (a4.name = r2, a4 && "all_fields" === a4.name) false === a4.canEdit ? a4.rowIndexes ? t4.set(i3, [{ name: "all_fields", canEdit: false, rowIndexes: a4.rowIndexes }]) : t4.set(i3, [{ name: "all_fields", canEdit: false }]) : a4.rowIndexes ? t4.set(i3, [{ name: "all_fields", canEdit: true, rowIndexes: a4.rowIndexes }]) : t4.set(i3, [{ name: "all_fields", canEdit: true }]);
796
- else {
797
- let e7 = t4.get(i3);
798
- e7 || (e7 = []), e7.push(a4), t4.set(i3, e7);
2163
+ function getWorkflowFormData(pageContext, id, isNeedId) {
2164
+ return new Promise((resolve, reject) => {
2165
+ const systemCode = pageContext.systemCode;
2166
+ const pageCode = pageContext.code;
2167
+ const pageVersion = pageContext.version;
2168
+ const additionalParamMap = getAdditionalParamMap(pageContext);
2169
+ let dataId = id ? id : null;
2170
+ let ids2 = id ? [id] : null;
2171
+ if (isNeedId === void 0 || isNeedId) {
2172
+ if (!dataId) {
2173
+ dataId = additionalParamMap && additionalParamMap.id ? additionalParamMap.id : null;
2174
+ }
2175
+ if (!ids2) {
2176
+ ids2 = additionalParamMap ? additionalParamMap.ids : null;
2177
+ }
2178
+ } else {
2179
+ dataId = null;
2180
+ ids2 = null;
2181
+ additionalParamMap._id = additionalParamMap.id;
2182
+ additionalParamMap.id = null;
2183
+ }
2184
+ const taskId = additionalParamMap ? additionalParamMap.taskId : null;
2185
+ const permissionPrefix = pageCode;
2186
+ const param = {
2187
+ pageCode,
2188
+ pageVersion,
2189
+ tableName: pageContext.tableName,
2190
+ formNoRuleCode: pageContext.formNoRuleCode,
2191
+ isWorkflowEntity: true,
2192
+ systemCode,
2193
+ functionCode: permissionPrefix + ".workflowGets",
2194
+ listCodesMap: pageContext.listCodesMap
2195
+ };
2196
+ console.log("getWorkflowFormData---listCodesMap=", pageContext.listCodesMap);
2197
+ if ((!pageContext.listCodesMap || Object.keys(pageContext.listCodesMap).length === 0) && pageContext.tableUuids) {
2198
+ const listCodesMap = {};
2199
+ pageContext.tableUuids.forEach((tableUuid) => {
2200
+ const listCode = getListCode(pageCode, pageVersion, tableUuid);
2201
+ listCodesMap[listCode] = listCode;
2202
+ });
2203
+ param["listCodesMap"] = listCodesMap;
2204
+ }
2205
+ if (ids2) {
2206
+ param["ids"] = formatAdditionalParamMapIds(ids2);
2207
+ }
2208
+ if (taskId) {
2209
+ param["taskId"] = taskId;
2210
+ } else if (dataId) {
2211
+ param["id"] = dataId;
2212
+ } else {
2213
+ if (additionalParamMap && additionalParamMap._t_ && getSessionCache(additionalParamMap._t_ + "_id")) {
2214
+ param["id"] = getSessionCache(additionalParamMap._t_ + "_id");
2215
+ }
2216
+ if (pageContext.notIdInitializationList) {
2217
+ param["noIdAndTaskIdInitSetting"] = JSON.stringify(pageContext.notIdInitializationList);
2218
+ }
2219
+ }
2220
+ if (additionalParamMap) {
2221
+ param["additionalParamMap"] = additionalParamMap;
2222
+ }
2223
+ if (pageContext.beanName) {
2224
+ param["beanName"] = pageContext.beanName;
2225
+ }
2226
+ if (pageContext.refercePropMap) {
2227
+ param["refercePropMap"] = pageContext.refercePropMap;
2228
+ }
2229
+ const baseUrl = getBaseUrl(pageContext.backendUrl, pageContext.isTest);
2230
+ const urlForView = baseUrl + "/dsc/workflow-commons/gets";
2231
+ const pageContextUtil = usePageContextStore();
2232
+ pageContextUtil.restorePageLoadState();
2233
+ handleEvent(null, pageContext, pageContext, "beforeFormLoadData");
2234
+ http.post(urlForView, param).then((commonEntity) => {
2235
+ pageContext.definitionId = commonEntity.definitionId;
2236
+ pageContext.entity.task = commonEntity.taskParamMap;
2237
+ dealCompleteTaskParam(commonEntity, true, pageContext);
2238
+ pageContext.workflowRules = getWorkflowRules(pageContext);
2239
+ const pageType = pageContext.pageType;
2240
+ if (pageType && pageType === "form") {
2241
+ changePermissionListToMap(pageContext);
2242
+ }
2243
+ pageContext.canClick = true;
2244
+ handleEvent(null, pageContext, pageContext, "afterFormLoadData");
2245
+ pageContextUtil.setFormPageDataLoadState(true);
2246
+ resolve(commonEntity);
2247
+ }).catch((error) => {
2248
+ pageContext.canClick = true;
2249
+ reject(error);
2250
+ });
2251
+ });
2252
+ }
2253
+ function formatAdditionalParamMapIds(ids2) {
2254
+ if (ids2) {
2255
+ if (typeof ids2 === "string") {
2256
+ ids2 = ids2.split(",");
2257
+ } else if (typeof ids2 === "number") {
2258
+ ids2 = [ids2];
2259
+ } else ;
2260
+ }
2261
+ return ids2;
2262
+ }
2263
+ function changePermissionListToMap(pageContext) {
2264
+ changeFieldPermissionToMap(pageContext);
2265
+ changeActionPermissionToMap(pageContext);
2266
+ }
2267
+ function changeFieldPermissionToMap(pageContext) {
2268
+ const fieldPermissionMap = /* @__PURE__ */ new Map();
2269
+ const fieldPermissions = pageContext.fieldPermissions;
2270
+ if (typeof fieldPermissions !== "undefined") {
2271
+ for (let i = 0; i < fieldPermissions.length; i++) {
2272
+ const prop = fieldPermissions[i].name;
2273
+ if (prop) {
2274
+ if (prop.indexOf("$") === 0 && prop.indexOf(".") > 0) {
2275
+ const fieldPermissionOrg = fieldPermissions[i];
2276
+ const fieldPermission = JSON.parse(JSON.stringify(fieldPermissionOrg));
2277
+ const subModelName = prop.substring(1, prop.indexOf("."));
2278
+ const subProp = prop.substring(prop.indexOf(".") + 1);
2279
+ fieldPermission.name = subProp;
2280
+ if (fieldPermission && fieldPermission.name === "all_fields") {
2281
+ if (fieldPermission.canEdit === false) {
2282
+ if (fieldPermission.rowIndexes) {
2283
+ fieldPermissionMap.set(subModelName, [
2284
+ {
2285
+ name: "all_fields",
2286
+ canEdit: false,
2287
+ rowIndexes: fieldPermission.rowIndexes
799
2288
  }
800
- } else t4.set(o2, s5[e6]);
2289
+ ]);
2290
+ } else {
2291
+ fieldPermissionMap.set(subModelName, [{ name: "all_fields", canEdit: false }]);
801
2292
  }
802
- e5.fieldPermissionMap = t4;
803
- })(e4), function(e5) {
804
- const t4 = e5.fieldPermissionMap, s5 = /* @__PURE__ */ new Map(), o2 = e5.actionPermissions;
805
- if (null != o2) {
806
- Object.keys(o2).forEach((e6) => {
807
- const n4 = o2[e6], a4 = t4.get(e6);
808
- if (a4 && a4.length > 0 && "all_fields" === a4[0].name && false === a4[0].canEdit) n4.canUpdate = false, n4.canAdd = false;
809
- else {
810
- const s6 = n4.canUpdate, o3 = n4.updateRowIndexes;
811
- void 0 !== s6 && false === s6 && null != o3 && o3.length > 0 && t4.set(e6, [{ name: "all_fields", canEdit: false, rowIndexes: o3 }]);
2293
+ } else {
2294
+ if (fieldPermission.rowIndexes) {
2295
+ fieldPermissionMap.set(subModelName, [
2296
+ {
2297
+ name: "all_fields",
2298
+ canEdit: true,
2299
+ rowIndexes: fieldPermission.rowIndexes
812
2300
  }
813
- s5.set(e6, n4);
814
- });
2301
+ ]);
2302
+ } else {
2303
+ fieldPermissionMap.set(subModelName, [{ name: "all_fields", canEdit: true }]);
815
2304
  }
816
- e5.actionPermissionMap = s5;
817
- }(e4);
818
- }(e3), e3.canClick = true, T(null, e3, e3, "afterFormLoadData"), h2.setFormPageDataLoadState(true), n3(t3);
819
- }).catch((t3) => {
820
- e3.canClick = true, a3(t3);
821
- });
822
- });
823
- }(e2, s2, n2) : function(e3, t2, s3) {
824
- return new Promise((n3, a3) => {
825
- const i2 = e3.systemCode, l2 = e3.code, u2 = e3.version, p2 = te(e3);
826
- let d2 = t2 || null, g2 = t2 ? [t2] : null;
827
- void 0 === s3 || s3 ? (d2 || (d2 = p2 && p2.id ? p2.id : null), g2 || (g2 = p2 ? p2.ids : null)) : (d2 = null, g2 = null, p2._id = p2.id, p2.id = null);
828
- const f2 = p2 ? p2.taskId : null, b2 = l2;
829
- console.log("getCommonFormData-----pageContext=", e3);
830
- const C2 = o(e3.backendUrl, e3.isTest), y2 = { pageCode: l2, pageVersion: u2, tableName: e3.tableName, formNoRuleCode: e3.formNoRuleCode, id: d2, systemCode: i2, functionCode: b2 + ".gets", listCodesMap: e3.listCodesMap };
831
- if (!y2.id && p2 && p2._t_ && m(p2._t_ + "_id") && (y2.id = m(p2._t_ + "_id")), g2 && (y2.ids = de(g2)), e3.notIdInitializationList && (y2.noIdAndTaskIdInitSetting = JSON.stringify(e3.notIdInitializationList)), p2 && (y2.additionalParamMap = p2), e3.beanName && (y2.beanName = e3.beanName), f2 && (y2.taskId = f2), console.log("getCommonFormData---listCodesMap=", e3.listCodesMap), (!e3.listCodesMap || 0 === Object.keys(e3.listCodesMap).length) && e3.tableUuids) {
832
- const t3 = {};
833
- e3.tableUuids.forEach((e4) => {
834
- const s4 = r(l2, u2, e4);
835
- t3[s4] = s4;
836
- }), y2.listCodesMap = t3;
2305
+ }
2306
+ } else {
2307
+ let subTableFieldPermission = fieldPermissionMap.get(subModelName);
2308
+ if (subTableFieldPermission) {
2309
+ subTableFieldPermission.push(fieldPermission);
2310
+ } else {
2311
+ subTableFieldPermission = [];
2312
+ subTableFieldPermission.push(fieldPermission);
2313
+ }
2314
+ fieldPermissionMap.set(subModelName, subTableFieldPermission);
2315
+ }
2316
+ } else {
2317
+ fieldPermissionMap.set(prop, fieldPermissions[i]);
837
2318
  }
838
- e3.refercePropMap && (y2.refercePropMap = e3.refercePropMap);
839
- const h2 = C2 + "/dsc/commons/gets", P2 = E();
840
- P2.restorePageLoadState(), T(null, e3, e3, "beforeFormLoadData"), c.post(h2, y2).then((t3) => {
841
- t3 && (e3.entity.data = t3.entity, e3.initFormNo = t3.formNo);
842
- const s4 = e3.customRules, o2 = e3.rules, a4 = O(s4, o2);
843
- e3.rules = a4, e3.canClick = true, T(null, e3, e3, "afterFormLoadData"), P2.setFormPageDataLoadState(true), n3(t3);
844
- }).catch((t3) => {
845
- e3.canClick = true, a3(t3);
846
- });
847
- });
848
- }(e2, s2, n2);
2319
+ }
2320
+ }
849
2321
  }
850
- return new Promise((e3, t2) => {
851
- e3(true);
852
- });
2322
+ pageContext.fieldPermissionMap = fieldPermissionMap;
853
2323
  }
854
- function de(e2) {
855
- return e2 && ("string" == typeof e2 ? e2 = e2.split(",") : "number" == typeof e2 && (e2 = [e2])), e2;
2324
+ function changeActionPermissionToMap(pageContext) {
2325
+ const fieldPermissionMap = pageContext.fieldPermissionMap;
2326
+ const actionPermissionMap = /* @__PURE__ */ new Map();
2327
+ const actionPermissions = pageContext.actionPermissions;
2328
+ if (typeof actionPermissions !== "undefined" && actionPermissions !== null) {
2329
+ const subModelNames = Object.keys(actionPermissions);
2330
+ subModelNames.forEach((subModelName) => {
2331
+ const oneTableActionPermission = actionPermissions[subModelName];
2332
+ const subTableFieldPermission = fieldPermissionMap.get(subModelName);
2333
+ if (subTableFieldPermission && subTableFieldPermission.length > 0 && subTableFieldPermission[0].name === "all_fields" && subTableFieldPermission[0].canEdit === false) {
2334
+ oneTableActionPermission.canUpdate = false;
2335
+ oneTableActionPermission.canAdd = false;
2336
+ } else {
2337
+ const canUpdate = oneTableActionPermission.canUpdate;
2338
+ const updateRowIndexes = oneTableActionPermission.updateRowIndexes;
2339
+ if (canUpdate !== void 0 && canUpdate === false && updateRowIndexes !== void 0 && updateRowIndexes !== null && updateRowIndexes.length > 0) {
2340
+ fieldPermissionMap.set(subModelName, [
2341
+ {
2342
+ name: "all_fields",
2343
+ canEdit: false,
2344
+ rowIndexes: updateRowIndexes
2345
+ }
2346
+ ]);
2347
+ }
2348
+ }
2349
+ actionPermissionMap.set(subModelName, oneTableActionPermission);
2350
+ });
2351
+ }
2352
+ pageContext.actionPermissionMap = actionPermissionMap;
856
2353
  }
857
- function me(e2) {
858
- const t2 = e2.props.setValueList;
859
- if (t2) {
860
- if (s(t2) && t2.length > 0) return JSON.stringify(t2);
861
- if ("string" == typeof t2 && "[]" !== t2) return t2;
2354
+ function getButtonAutoSetValueData(configureObj) {
2355
+ const autoSetValueData = configureObj.props.setValueList;
2356
+ if (autoSetValueData) {
2357
+ if (isArrayFn(autoSetValueData) && autoSetValueData.length > 0) {
2358
+ return JSON.stringify(autoSetValueData);
2359
+ } else if (typeof autoSetValueData === "string" && autoSetValueData !== "[]") {
2360
+ return autoSetValueData;
2361
+ }
862
2362
  }
863
2363
  return null;
864
2364
  }
865
2365
  export {
866
- V as dealAfterOperate,
867
- Q as dealCompleteTaskParam,
868
- se as doAddSigner,
869
- Z as doAssign,
870
- oe as doCreateCopyTask,
871
- z as doImportFinally,
872
- ce as doRemoveSigners,
873
- ie as doReturnTaskTo,
874
- D as exportFormReport,
875
- te as getAdditionalParamMap,
876
- pe as getFormData,
877
- re as getRemoveSigner,
878
- F as getSaveFormRequest,
879
- W as getSaveFormRequestWithRow,
880
- ae as getTaskInformitions,
881
- le as isVisibleWorkflowButton,
882
- Y as judgeDataNumber,
883
- $ as refreshFormOrListPage,
884
- ue as refreshPage,
885
- _ as standardEvents,
886
- G as updateValuesWhenCloseDialog
2366
+ dealAfterOperate,
2367
+ dealCompleteTaskParam,
2368
+ doAddSigner,
2369
+ doAssign,
2370
+ doCreateCopyTask,
2371
+ doImportFinally,
2372
+ doRemoveSigners,
2373
+ doReturnTaskTo,
2374
+ exportFormReport,
2375
+ getAdditionalParamMap,
2376
+ getFormData,
2377
+ getRemoveSigner,
2378
+ getSaveFormRequest,
2379
+ getSaveFormRequestWithRow,
2380
+ getTaskInformitions,
2381
+ isVisibleWorkflowButton,
2382
+ judgeDataNumber,
2383
+ refreshFormOrListPage,
2384
+ refreshPage,
2385
+ standardEvents,
2386
+ updateValuesWhenCloseDialog
887
2387
  };