super-page-runtime 2.2.26 → 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 -68
  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 -36
  14. package/dist/es/components/runtime/utils/charts/chart-util.js +522 -224
  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 -72
  19. package/dist/es/components/runtime/utils/events/standard-event.js +2320 -808
  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 -61
  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 -279
  27. package/dist/es/components/runtime/utils/page-init-util.js +406 -141
  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 -50
  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 -7
  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 -52
  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 -32
  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 -43
  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 -32
  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 -32
  62. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +597 -246
  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 -212
  73. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +139 -29
  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 -61
  97. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +810 -302
  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 -262
  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 -42
  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 -68
  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 +245 -57
  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 -32
  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 -28
  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 -64
  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 -88
  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 -40
  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 -20
  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 +754 -226
  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,875 +1,2387 @@
1
- import { deepCopy as e, isWorkflowPage as t, isArrayFn as s, getBaseUrl as n, getRealRestApiPath as o, packageTemplateFiles as i, upperFirstCase as a, getListCode as r } from "../common-util.js";
2
- import c from "agilebuilder-ui/src/utils/request";
3
- import { getI18n as u } from "agilebuilder-ui/src/utils/util";
4
- import { ElMessage as l, ElMessageBox as p } from "element-plus";
5
- import { getToken as d, getSessionCache as m, setSessionCache as f } from "agilebuilder-ui/src/utils/auth";
6
- import { getComponentRef as g } 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 N } from "../page-init-util.js";
12
- import { updateChartDatasources as M, caculateShowCondition as R, getVariableValue as v, 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 U } from "./validator-util.js";
16
- import { functions as O } from "../api/page-expose-util.js";
17
- import { usePageContextStore as E } from "../page-store.js";
18
- const _ = { save: function(e2) {
19
- return L(e2, false);
20
- }, saveList: function(e2) {
21
- return L(e2, true);
22
- }, exportForm: function(e2) {
23
- const t2 = e2.pageContext.code + "_";
24
- b.$emit(t2 + "export-form-report", e2);
25
- }, exportPDF: function(e2) {
26
- const t2 = e2.pageContext.code + "_";
27
- b.$emit(t2 + "export-pdf-report", e2);
28
- }, submit: function(e2) {
29
- return J(e2, false, "submit", "/dsc/commons/submits");
30
- }, submitList: function(e2) {
31
- return J(e2, true, "submit", "/dsc/commons/batch-submits");
32
- }, agree: function(e2) {
33
- return J(e2, false, "agree", "/dsc/commons/approves");
34
- }, agreeList: function(e2) {
35
- return J(e2, true, "agree", "/dsc/commons/batch-approves");
36
- }, disagree: function(e2) {
37
- return J(e2, false, "disagree", "/dsc/commons/refuses");
38
- }, disagreeList: function(e2) {
39
- return J(e2, true, "disagree", "/dsc/commons/batch-refuses");
40
- }, back: function(e2) {
41
- const t2 = e2.pageContext;
42
- H(t2, t2.entity ? t2.entity.data : {}, !(!e2.configureObj.props || !e2.configureObj.props.base) && e2.configureObj.props.base.isNeedValueMapping);
43
- }, delete: function(e2) {
44
- return function(e3) {
45
- return new Promise((s2, i2) => {
46
- const a2 = e3.ids;
47
- if (!a2 || 0 === a2.length) return l({ showClose: true, type: "warning", message: u().t("superPageRuntimeMessage.pleaseSelectRecord") }), void s2(true);
48
- p.confirm(u().t("superPageRuntimeMessage.whetherToConfirmDeletion"), u().t("superPageRuntimeMessage.tips"), { confirmButtonText: u().t("superPageRuntimeMessage.sure"), cancelButtonText: u().t("superPageRuntimeMessage.cancel"), type: "warning" }).then(() => {
49
- var _a;
50
- const r2 = e3.pageContext, u2 = e3.configureObj, l2 = u2.props.base, p2 = r2.systemCode, d2 = r2.backendUrl, m2 = u2.props.base.tableUuid ? u2.props.base.tableUuid : e3.tableUuid, f2 = x(r2, m2);
51
- let b2 = n(d2, r2.isTest) + "/dsc/commons/" + f2;
52
- b2 = o(b2, p2, d2, r2.isTest);
53
- const C2 = void 0 === l2.isPermission || "true" === l2.isPermission || l2.isPermission, T2 = t(r2), y2 = w(u2, r2), h2 = { ids: a2, functionCode: y2, isPermission: C2 + "", systemCode: p2, isWorkflowEntity: T2, listCodesMap: r2.listCodesMap, pageCode: r2.code, pageVersion: r2.version };
54
- r2.beanName && (h2.beanName = r2.beanName);
55
- const P2 = u2.props.deleteLogicSetting;
56
- P2 && ("object" == typeof P2 ? h2.deleteLogicSetting = JSON.stringify(P2) : "string" == typeof P2 && (h2.deleteLogicSetting = P2));
57
- const k2 = (_a = u2.props.base) == null ? void 0 : _a.logSetting;
58
- k2 && (h2.logSettingText = k2.join(""));
59
- const N2 = u2.props.base.isSafeDelete;
60
- N2 && (h2.isSafeDelete = N2), c.delete(b2, { data: h2 }).then((e4) => {
61
- const t2 = g(r2, m2);
62
- t2 && (t2.isDeleteChange(true), t2.clearSelections()), F(r2, u2, e4, "superPageRuntimeMessage.successfulDelete", true), s2(true);
63
- }).catch((e4) => {
64
- i2(e4);
65
- });
66
- }).catch(() => {
67
- i2();
68
- });
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);
69
377
  });
70
- }(e2);
71
- }, downloadTemplate: function(e2) {
72
- !function(e3) {
73
- var _a;
74
- const t2 = e3.pageContext, s2 = e3.configureObj, o2 = s2.props.base, a2 = i(o2.templateFiles);
75
- let r2, c2;
76
- a2 && a2.length > 0 && (r2 = a2[0].templateUuid, c2 = a2[0].templateName);
77
- const u2 = t2.systemCode, l2 = t2.backendUrl, p2 = c2;
78
- let f2 = "?1=1";
79
- r2 && p2 && "undefined" !== r2 && "undefined" !== p2 && "null" !== r2 && "null" !== p2 ? f2 += "&fileName=" + encodeURI(r2) + "&showName=" + encodeURI(p2) : p2 ? f2 += "&showName=" + encodeURI(p2) : t2.label && (f2 += "&showName=" + encodeURI(t2.label) + ".xlsx");
80
- const g2 = (_a = s2.props.base) == null ? void 0 : _a.logSetting;
81
- g2 && (f2 += "&logSettingText=" + g2.join(""));
82
- u2 && (f2 += "&systemCode=" + u2);
83
- const b2 = e3.listCode;
84
- b2 && (f2 += "&listCode=" + b2);
85
- t2.beanName && (f2 += "&beanName=" + t2.beanName);
86
- const C2 = w(s2, t2);
87
- C2 && (f2 += "&functionCode=" + C2);
88
- t2.tableName && (f2 += "&tableName=" + t2.tableName);
89
- t2.code && (f2 += "&pageCode=" + t2.code);
90
- t2.version && (f2 += "&pageVersion=" + t2.version);
91
- const T2 = d();
92
- T2 && (f2 += "&JWT=" + T2);
93
- const y2 = "_RUN_CURRENT_ROLE", h2 = m(y2);
94
- h2 && (f2 += "&" + y2 + "=" + h2);
95
- if (o2) {
96
- f2 += "&isPermission=" + (void 0 === o2.isPermission || "true" === o2.isPermission || o2.isPermission);
97
- }
98
- const P2 = n(l2, t2.isTest);
99
- window.open(P2 + "/dsc/commons/download-files" + f2);
100
- }(e2);
101
- }, import: function(e2) {
102
- const t2 = e2.pageContext.code + "_";
103
- b.$emit(t2 + "import-file", e2);
104
- }, export: function(e2) {
105
- return function(e3) {
106
- return new Promise((t2, s2) => {
107
- const n2 = e3.pageContext, o2 = e3.configureObj.props.base, i2 = e3.listCode, a2 = e3.selections, r2 = {};
108
- a2 && a2.length > 0 && (r2.data = a2);
109
- let c2 = n2.label;
110
- c2 || (c2 = n2.code);
111
- let u2 = false;
112
- u2 = void 0 !== o2.isAsync && null !== o2.isAsync && o2.isAsync;
113
- const l2 = void 0 === o2.isPermission || "true" === o2.isPermission || o2.isPermission, p2 = w(e3.configureObj, n2), d2 = c2, m2 = { backendUrl: n2.backendUrl, pageContext: n2 };
114
- window.$vueApp.config.globalProperties.$exportDataNew(r2, d2, i2, p2, null, m2, u2, n2.code, l2);
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"
115
390
  });
116
- }(e2);
117
- }, search: function(e2) {
118
- const t2 = e2.pageContext, s2 = e2.tableUuid;
119
- g(t2, s2).refresh();
120
- }, showSearch: function(e2) {
121
- const t2 = e2.pageContext, s2 = e2.tableUuid;
122
- g(t2, s2).showMobileSearch();
123
- }, workflowSave: function(e2) {
124
- return async function(e3) {
125
- return new Promise((t2, s2) => {
126
- const i2 = e3.pageContext, a2 = i2.entity.data, r2 = i2.systemCode, p2 = i2.backendUrl;
127
- let d2 = n(p2, i2.isTest) + "/dsc/workflow-commons";
128
- if (d2 = o(d2, r2, p2, i2.isTest), !d2) return void l({ showClose: true, type: "warning", message: u().t("superPageRuntimeMessage.requestPathEmpty") });
129
- const m2 = K(e3);
130
- let f2;
131
- f2 = a2.id || a2.ID ? c.put(d2, m2) : c.post(d2, m2), f2.then((s3) => {
132
- let n2 = true;
133
- s3 && (n2 = Q(s3, false, i2, e3, null)), true === n2 && l({ showClose: true, type: "success", message: u().t("superPageRuntimeMessage.successfulSave") }), t2(true);
134
- }).catch((e4) => {
135
- s2(e4);
136
- });
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);
137
409
  });
138
- }(e2);
139
- }, submitProcess: function(e2) {
140
- return function(e3) {
141
- return new Promise((t2, s2) => {
142
- const i2 = e3.pageContext, a2 = i2.systemCode, r2 = i2.backendUrl;
143
- let p2 = n(r2, i2.isTest) + "/dsc/workflow-commons/submit";
144
- if (p2 = o(p2, a2, r2, i2.isTest), !p2) return void l({ showClose: true, type: "warning", message: u().t("superPageRuntimeMessage.requestPathEmpty") });
145
- const d2 = K(e3), m2 = c.post(p2, d2);
146
- m2 && m2.then((s3) => {
147
- let n2 = true;
148
- s3 && (n2 = Q(s3, false, i2, e3, null)), true === n2 && l({ showClose: true, type: "success", message: u().t("superPageRuntimeMessage.successfulSubmit") }), t2(true);
149
- }).catch((e4) => {
150
- 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);
151
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
152
638
  });
153
- }(e2);
154
- }, submitTask: function(e2) {
155
- return X(e2, "SUBMIT");
156
- }, approve: function(e2) {
157
- return X(e2, "APPROVE");
158
- }, refuse: function(e2) {
159
- return X(e2, "REFUSE");
160
- }, readed: function(e2) {
161
- return X(e2, "READED");
162
- }, agreement: function(e2) {
163
- return X(e2, "AGREEMENT");
164
- }, oppose: function(e2) {
165
- return X(e2, "OPPOSE");
166
- }, kiken: function(e2) {
167
- return X(e2, "KIKEN");
168
- }, assign: function(e2) {
169
- return function(e3) {
170
- const t2 = e3.pageContext, s2 = t2.code + "_";
171
- b.$emit(s2 + "assign-task", e3);
172
- }(e2);
173
- }, copyTask: function(e2) {
174
- return function(e3) {
175
- const t2 = e3.pageContext, s2 = t2.code + "_";
176
- b.$emit(s2 + "copy-task", e3);
177
- }(e2);
178
- }, addSigner: function(e2) {
179
- return function(e3) {
180
- const t2 = e3.pageContext, s2 = t2.code + "_";
181
- b.$emit(s2 + "add-signer", e3);
182
- }(e2);
183
- }, drawTask: function(e2) {
184
- return function(e3) {
185
- const t2 = e3.pageContext, s2 = t2.backendUrl, o2 = n(s2, t2.isTest) + "/dsc/workflow-commons/draw-tasks", i2 = K(e3);
186
- return oe(e3, i2, o2, "superPageRuntimeMessage.successfulDrawTask");
187
- }(e2);
188
- }, abandonReceive: function(e2) {
189
- return function(e3) {
190
- const t2 = e3.pageContext, s2 = t2.backendUrl, o2 = n(s2, t2.isTest) + "/dsc/workflow-commons/abandon-receives", i2 = K(e3);
191
- return oe(e3, i2, o2, "superPageRuntimeMessage.successfulAbandonReceive");
192
- }(e2);
193
- }, returnToPreviousTask: function(e2) {
194
- return function(e3) {
195
- const t2 = e3.pageContext, s2 = t2.backendUrl, o2 = n(s2, t2.isTest) + "/dsc/workflow-commons/return-to-previous-tasks", i2 = K(e3);
196
- return oe(e3, i2, o2, "superPageRuntimeMessage.successfulReturnToPreviousTask");
197
- }(e2);
198
- }, endInstance: function(e2) {
199
- return function(e3) {
200
- const t2 = e3.pageContext, s2 = t2.backendUrl, o2 = n(s2, t2.isTest) + "/dsc/workflow-commons/end-instance", i2 = K(e3);
201
- return oe(e3, i2, o2, "superPageRuntimeMessage.successfulEndInstance");
202
- }(e2);
203
- }, returnTaskTo: function(e2) {
204
- return function(e3) {
205
- const t2 = e3.pageContext, s2 = t2.code + "_";
206
- b.$emit(s2 + "choose-return-node", e3);
207
- }(e2);
208
- }, removeSigner: function(e2) {
209
- return function(e3) {
210
- const t2 = e3.pageContext, s2 = t2.code + "_";
211
- b.$emit(s2 + "remove-signer", e3);
212
- }(e2);
213
- }, retrieveTask: function(e2) {
214
- return function(e3) {
215
- const t2 = e3.pageContext, s2 = t2.backendUrl, o2 = n(s2, t2.isTest) + "/dsc/workflow-commons/retrieves", i2 = K(e3);
216
- return oe(e3, i2, o2, "superPageRuntimeMessage.successfulRetrieve");
217
- }(e2);
218
- }, viewDetail: function(e2) {
219
- }, lineEditCreate: function(e2) {
220
- return function(e3) {
221
- const t2 = e3.pageContext, s2 = e3.tableUuid, n2 = g(t2, s2);
222
- n2 && (e3.getDefaultValueFunc = k, n2.createRow(e3.listCode, {}, e3));
223
- }(e2);
224
- }, printLabel: function(e2) {
225
- return function(e3) {
226
- let t2 = null;
227
- try {
228
- if (t2 = e3.menuItem ? e3.menuItem.templateUuid : e3.configureObj.props.base.template[0].templateUuid, !t2) throw new Error("未找到模板");
229
- } catch (e4) {
230
- }
231
- I.printLabel(e3, t2);
232
- }(e2);
233
- }, queryCharts: function(e2) {
234
- j(e2);
235
- }, resetCharts: function(t2) {
236
- var _a, _b;
237
- const s2 = t2.pageContext;
238
- 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);
239
- }, exportCharts: function(e2) {
240
- !function(e3) {
241
- const t2 = e3.pageContext, s2 = t2.allChartUuids;
242
- if (!s2 || 0 == s2.length) return;
243
- const o2 = e3.configureObj;
244
- let i2 = null;
245
- o2 && o2.runtime && (i2 = o2.runtime.props);
246
- const a2 = i2 ? i2.state : void 0;
247
- i2 && (i2.state = "disabled");
248
- const r2 = [];
249
- for (let e4 = 0; e4 < s2.length; e4++) {
250
- const n2 = s2[e4], o3 = g(t2, n2);
251
- if (o3) {
252
- const e5 = o3.getConfigure();
253
- e5 && e5.exportable && e5._dynamicShowFlag && o3.exportChart && r2.push(o3.exportChart());
254
- }
255
- }
256
- if (!r2 || 0 == r2.length) return;
257
- let c2, u2 = t2.label;
258
- u2 || (u2 = t2.code);
259
- c2 = u2;
260
- const l2 = { reportDataList: r2, beanName: t2.beanName }, p2 = t2.backendUrl;
261
- let m2;
262
- const f2 = n(p2, t2.isTest) + "/dsc/commons/exportChart";
263
- C.defaults.headers.common.Authorization = d(), m2 = C.post(f2, l2, { responseType: "blob" }), m2.then((e4) => {
264
- const t3 = document.createElement("a");
265
- 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);
266
- }).finally(() => {
267
- i2 && (i2.state = a2);
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
268
682
  });
269
- }(e2);
270
- } };
271
- function j(e2) {
272
- const t2 = e2.pageContext, s2 = t2.initChartServiceConfigs;
273
- if (!s2 || 0 == s2.length) return;
274
- const n2 = e2.configureObj;
275
- let o2 = null;
276
- n2 && n2.runtime && (o2 = n2.runtime.props);
277
- const i2 = o2 ? o2.state : void 0;
278
- o2 && (o2.state = "disabled"), M(t2, s2, void 0, e2.isInitChart).then(() => {
279
- o2 && (o2.state = i2);
280
- }).catch(() => {
281
- o2 && (o2.state = i2);
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
282
701
  });
283
702
  }
284
- function D(e2, s2, o2, i2) {
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) {
285
754
  var _a;
286
- const a2 = o2.templateUuid, r2 = o2.templateName, c2 = e2.systemCode, u2 = (_a = s2.props.base) == null ? void 0 : _a.logSetting, l2 = t(e2), p2 = e2.beanName, m2 = s2.props.base, f2 = s2.tableName ? s2.tableName : e2.tableName, g2 = e2.backendUrl, b2 = O.getFormViewData(e2), T2 = void 0 === m2.isPermission || "true" === m2.isPermission || m2.isPermission, y2 = { entity: b2, fileName: a2, showName: r2, beanName: p2, isWorkflowForm: l2, functionCode: w(s2, e2), tableName: f2, isPermission: T2 + "", systemCode: c2, listCodesMap: e2.listCodesMap, pageCode: e2.code, pageVersion: e2.version };
287
- u2 && (y2.logSettingText = u2.join(""));
288
- const P2 = te(e2);
289
- let k2;
290
- y2.additionalParamMap = P2, k2 = i2 ? function(e3, t2, s3, o3) {
291
- return new Promise((i3, a3) => {
292
- const r3 = n(t2, o3) + "/dsc/commons/export-pdf";
293
- C.defaults.headers.common.Authorization = d();
294
- C.post(r3, s3, { headers: { "content-type": "application/json" }, responseType: "blob" }).then((t3) => {
295
- const s4 = new Blob([t3.data]), n2 = document.createElement("a");
296
- n2.download = e3.substring(0, e3.lastIndexOf(".")) + ".pdf", n2.style.display = "none", n2.target = "_blank", n2.href = URL.createObjectURL(s4), document.body.appendChild(n2), n2.click(), URL.revokeObjectURL(n2.href), document.body.removeChild(n2), i3(true);
297
- }).catch((e4) => {
298
- a3(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);
299
829
  });
300
- });
301
- }(r2, g2, y2, e2.isTest) : function(e3, t2, s3, o3) {
302
- return new Promise((i3, a3) => {
303
- const r3 = n(t2, o3) + "/dsc/commons/export-reports";
304
- C.defaults.headers.common.Authorization = d();
305
- C.post(r3, s3, { responseType: "blob" }).then((t3) => {
306
- const s4 = new Blob([t3.data]);
307
- let n2 = "报告.xlsx";
308
- e3 && (n2 = e3);
309
- const o4 = document.createElement("a");
310
- o4.download = n2, o4.style.display = "none", o4.target = "_blank", o4.href = URL.createObjectURL(s4), document.body.appendChild(o4), o4.click(), URL.revokeObjectURL(o4.href), document.body.removeChild(o4), i3(true);
311
- }).catch((e4) => {
312
- a3(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);
313
867
  });
868
+ }).catch(() => {
869
+ reject("点击了取消按钮");
314
870
  });
315
- }(r2, g2, y2, e2.isTest), k2 && k2.then(() => {
316
- h(e2, s2);
317
871
  });
318
872
  }
319
- function L(e2, t2) {
320
- return new Promise((s2, n2) => {
321
- const o2 = e2.pageContext, i2 = e2.configureObj, a2 = e2.mainDefaultValueColumns, r2 = e2.dynamicColumnInfo, c2 = i2.props.base.successOperation;
322
- let u2 = false;
323
- c2 && "noOperation" === c2 && (u2 = true);
324
- const l2 = V(o2, i2, "/dsc/commons", u2, a2, r2);
325
- l2 ? l2.then((e3) => {
326
- F(o2, i2, e3, "superPageRuntimeMessage.successfulSave", t2), s2(e3);
327
- }).catch((e3) => {
328
- n2(e3);
329
- }) : n2("保存时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
+ });
330
959
  });
331
960
  }
332
- function B(e2, n2, o2, i2, a2, r2, c2) {
961
+ function downloadTemplateFunc(params) {
333
962
  var _a;
334
- const u2 = t(e2), l2 = e2.systemCode, p2 = void 0 === n2.props.base.isPermission || "true" === n2.props.base.isPermission || n2.props.base.isPermission, d2 = w(n2, e2);
335
- let m2 = c2;
336
- m2 || (m2 = e2.entity.data);
337
- const f2 = { entity: m2, tableName: e2.tableName, formNoRuleCode: e2.formNoRuleCode, isWorkflowEntity: u2, functionCode: d2, isPermission: p2 + "", listCodesMap: e2.listCodesMap, pageCode: e2.code, pageVersion: e2.version };
338
- r2 && (f2.ids = r2), e2.judgeHeavyList && (s(e2.judgeHeavyList) ? f2.judgeHeavyList = JSON.stringify(e2.judgeHeavyList) : f2.judgeHeavyList = e2.judgeHeavyList);
339
- const g2 = n2.props.base.conversionCodes;
340
- g2 && (s(g2) ? f2.dataConversionRule = g2.join(",") : "string" == typeof g2 && (f2.dataConversionRule = g2));
341
- const b2 = me(n2);
342
- b2 && (f2.autoSetValueData = b2);
343
- const C2 = (_a = n2.props.base) == null ? void 0 : _a.logSetting;
344
- C2 && (f2.logSettingText = C2.join("")), f2.systemCode || (f2.systemCode = l2);
345
- const T2 = e2.beanName;
346
- T2 && (f2.beanName = T2), a2 && (f2.dynamicColumnInfo = a2), i2 && (f2.mainDefaultValueColumns = i2);
347
- const y2 = te(e2);
348
- return f2.additionalParamMap = y2, void 0 !== o2 && (f2.unControlVersion = o2), f2;
349
- }
350
- function W(e2, t2, s2, i2, a2, r2, u2, l2) {
351
- const p2 = e2.systemCode, d2 = e2.backendUrl, m2 = B(e2, t2, i2, a2, r2, null, u2);
352
- return l2 && l2.tableName && (m2.tableName = l2.tableName), function(e3, t3, s3, i3, a3, r3) {
353
- const u3 = n(t3, r3);
354
- let l3, p3 = u3 + i3;
355
- p3 = o(p3, e3, t3, r3), l3 = a3 && (a3.id || a3.ID) ? c.put(p3, s3) : c.post(p3, s3);
356
- return l3;
357
- }(p2, d2, m2, s2, e2.entity.data, e2.isTest);
358
- }
359
- function V(e2, t2, s2, n2, o2, i2) {
360
- return W(e2, t2, s2, n2, o2, i2, null, null);
361
- }
362
- function F(t2, s2, n2, o2, i2) {
363
- const a2 = q(t2, s2, i2);
364
- a2 && "list" === a2 ? (!function(t3, s3, n3, o3) {
365
- let i3 = s3.props.base.successOperation;
366
- const a3 = s3.props.base.isNeedValueMapping, r2 = y(t3, s3);
367
- i3 || (i3 = "refresh");
368
- if ("refresh" === i3) {
369
- if (r2) {
370
- g(t3, r2).refresh();
371
- }
372
- } else if ("closeWindow" === i3 || "closeWindowAndRefresh" === i3) {
373
- const s4 = e(t3.entity.page);
374
- let o4 = n3;
375
- o4 || (o4 = {}), Object.assign(s4, o4), H(t3, s4, a3);
376
- }
377
- o3 && l({ message: u().t(o3), type: "success", showClose: true });
378
- }(t2, s2, n2, o2), t2.canClick = true) : a2 && "form" === a2 ? function(e2, t3, s3, n3) {
379
- if (s3) {
380
- const n4 = s3;
381
- let o3;
382
- n4.entity && (o3 = n4.entity), n4.formNo && (e2.initFormNo = n4.formNo);
383
- !function(e3, t4, s4) {
384
- const n5 = t4.props.base.successOperation;
385
- if (!n5 || null === n5) return;
386
- const o4 = t4.props.base.isNeedValueMapping;
387
- "noOperation" === n5 ? (s4 && (e3.entity.data = s4), e3.canClick = true) : "refresh" === n5 ? s4 && (s4.id || s4.ID) ? le(e3, s4.ID ? s4.ID : s4.id) : e3.canClick = true : "closeWindow" !== n5 && "closeWindowAndRefresh" !== n5 || (H(e3, s4, o4), e3.canClick = true);
388
- }(e2, t3, { ...o3, ...e2.entity.page });
389
- } else e2.canClick = true;
390
- n3 && l({ message: u().t(n3), type: "success", showClose: true });
391
- }(t2, s2, n2, o2) : t2.canClick = true;
392
- }
393
- function q(e2, t2, s2) {
394
- let n2;
395
- return void 0 === s2 ? n2 = t2.props.base.tableUuid ? "list" : null : false === s2 && (n2 = "form"), n2 || (n2 = e2.pageType), n2;
396
- }
397
- function H(e2, t2, s2) {
398
- const n2 = e2.entity && e2.entity.request ? e2.entity.request.jumpMode : null;
399
- if ("openWindow" === n2 || "newTab" === n2) window.parent ? window.parent.close() : window.close();
400
- else {
401
- const o2 = e2.tableName, i2 = void 0 !== s2 && true === s2 && t2 && void 0 !== t2, a2 = (e2.entity && e2.entity.request ? e2.entity.request.parentPageCode : null) + "_";
402
- b.$emit(a2 + "close-dialog", { isNeedValueMapping: i2, dataModel: t2, sourceTableName: o2, jumpMode: n2 });
403
- }
404
- }
405
- function G(e2, t2, s2, n2, o2) {
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) {
406
1028
  var _a;
407
- o2 || (o2 = t2.runtime && t2.runtime.linkPage && t2.runtime.linkPage.valueMappings ? t2.runtime.linkPage.valueMappings : null) || (o2 = (_a = t2.props.linkPage) == null ? void 0 : _a.valueMappings);
408
- const i2 = e2.tableName;
409
- !function(e3, t3, s3) {
410
- if (e3 && null !== e3 && t3) {
411
- let n3 = e3;
412
- Array.isArray(e3) && e3.length > 0 && (n3 = e3[0]), t3.forEach((e4) => {
413
- const t4 = e4.source;
414
- if (!t4) return;
415
- const o3 = t4.split("."), i3 = v(n3, o3), a2 = e4.target, r2 = N(null, a2);
416
- S(s3.entity, r2, i3);
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")
417
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);
418
1122
  }
419
- }(s2, o2, e2), T(null, e2, t2, "setValue", { sourceModel: s2, sourceTableName: n2, entity: e2.entity.data, targetTableName: i2 });
1123
+ }).catch((error) => {
1124
+ console.log("error==", error);
1125
+ });
420
1126
  }
421
- function $(e2, t2, s2, n2) {
422
- var _a;
423
- t2 && !t2.props.base && (t2.props.base = {});
424
- let o2 = n2;
425
- o2 || (o2 = s2 ? "refresh" : (_a = t2.props.base) == null ? void 0 : _a.successOperation);
426
- const i2 = q(e2, t2);
427
- if (i2 && "list" === i2 && !o2 && (o2 = "refresh"), "refresh" === o2) {
428
- if (i2 && "list" === i2) {
429
- const s3 = y(e2, t2);
430
- if (s3) {
431
- g(e2, s3).refresh();
432
- }
433
- } else if (i2 && "form" === i2) {
434
- const t3 = e2.entity.data;
435
- le(e2, t3.ID ? t3.ID : t3.id);
436
- }
437
- }
438
- }
439
- function J(e2, t2, s2, i2) {
440
- return new Promise((r2, l2) => {
441
- const d2 = e2.pageContext, m2 = e2.configureObj, f2 = e2.mainDefaultValueColumns, g2 = e2.dynamicColumnInfo, b2 = e2.ids, C2 = m2.props.base.successOperation;
442
- let T2 = false;
443
- C2 && "noOperation" === C2 && (T2 = true);
444
- let y2 = d2.tableName;
445
- if (t2) {
446
- const t3 = m2.props.base.tableUuid ? m2.props.base.tableUuid : e2.tableUuid;
447
- y2 = x(d2, t3);
448
- }
449
- const h2 = function(e3, t3, s3, i3, r3, l3, d3, m3, f3) {
450
- return new Promise((g3, b3) => {
451
- const C3 = t3.props.base.title, T3 = "superPageRuntimeMessage.whetherToConfirm" + a(d3);
452
- p.confirm(u().t(T3, { name: C3 }), u().t("superPageRuntimeMessage.tips"), { confirmButtonText: u().t("superPageRuntimeMessage.sure"), cancelButtonText: u().t("superPageRuntimeMessage.cancel"), type: "warning" }).then(() => {
453
- const a2 = e3.systemCode, u2 = e3.backendUrl, p2 = B(e3, t3, i3, r3, l3, m3, null);
454
- p2.tableName = f3;
455
- let d4 = n(u2, e3.isTest) + s3;
456
- d4 = o(d4, a2, u2, e3.isTest), c.post(d4, p2).then((e4) => {
457
- g3(e4);
458
- }).catch((e4) => {
459
- b3(e4);
460
- });
461
- }).catch(() => {
462
- 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
+ })
463
1138
  });
464
- });
465
- }(d2, m2, i2, T2, f2, g2, s2, b2, y2);
466
- h2 ? h2.then((e3) => {
467
- F(d2, m2, e3, "superPageRuntimeMessage.successfulSave", t2), r2(e3);
468
- }).catch((e3) => {
469
- l2(e3);
470
- }) : l2("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
+ );
471
1195
  });
472
1196
  }
473
- function z(e2, s2) {
1197
+ function getWorkflowSaveParams(params) {
474
1198
  var _a;
475
- const i2 = e2.pageContext, a2 = e2.configureObj, r2 = e2.tableConfigure, p2 = a2.props.base, d2 = a2.props.base.tableUuid ? a2.props.base.tableUuid : e2.tableUuid, m2 = x(i2, d2), f2 = new FormData();
476
- f2.append("multipartFile", s2), m2 && f2.append("tableName", m2), i2.importBeanName && f2.append("importBeanName", i2.importBeanName), i2.beanName && f2.append("beanName", i2.beanName);
477
- const g2 = (_a = r2.props.importSetting) == null ? void 0 : _a.listViewImportDuplicate;
478
- g2 && f2.append("importDuplicateRule", g2);
479
- const b2 = i2.judgeHeavyList;
480
- b2 && f2.append("judgeHeavyList", JSON.stringify(b2));
481
- const C2 = me(a2);
482
- C2 && f2.append("autoSetValueData", C2);
483
- const T2 = i2.formNoRuleCode;
484
- T2 && f2.append("formNoRuleCode", T2);
485
- const y2 = e2.listCode;
486
- y2 && f2.append("listCode", y2);
487
- let P2 = false;
488
- P2 = void 0 !== p2.isAsync && null !== p2.isAsync && p2.isAsync, f2.append("isAsync", P2 + ""), f2.append("pageCode", i2.code);
489
- const k2 = t(i2);
490
- null != k2 && f2.append("isWorkflowEntity", k2 + "");
491
- const N2 = w(a2, i2);
492
- N2 && f2.append("functionCode", N2);
493
- const M2 = te(i2);
494
- f2.append("additionalParamMapStr", JSON.stringify(M2));
495
- const R2 = void 0 === p2.isPermission || "true" === p2.isPermission || p2.isPermission;
496
- f2.append("isPermission", R2 + "");
497
- const v2 = i2.systemCode;
498
- v2 && f2.append("systemCode", v2);
499
- const S2 = i2.backendUrl;
500
- let I2 = n(S2, i2.isTest) + "/dsc/commons/import-data";
501
- I2 = o(I2, v2, S2, i2.isTest), c.post(I2, f2).then((e3) => {
502
- if (P2) l({ showClose: true, type: "success", message: u().t("superPageRuntimeMessage.asyncImport") });
503
- else {
504
- let t2 = false;
505
- e3 ? (t2 = false, l({ dangerouslyUseHTMLString: true, showClose: true, type: "warning", message: e3 })) : (l({ showClose: true, type: "success", message: u().t("superPageRuntimeMessage.successfulImport") }), t2 = true), F(i2, a2, e3, null, true), i2.result = t2, h(i2, a2);
506
- }
507
- }).catch((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
+ });
508
1320
  });
509
1321
  }
510
- function Y(e2, t2) {
511
- const s2 = e2.props.base;
512
- if (s2.conditionsForExecution && "" !== s2.conditionsForExecution) {
513
- if ("one" === s2.conditionsForExecution) {
514
- if (!t2 || 1 !== t2.length) return l({ showClose: true, type: "warning", message: u().t("superPageRuntimeMessage.thePreconditionOfTheButtonTo", { message: u().t("superPageRuntimeMessage.onlyOneRecordCanBeselected") }) }), false;
515
- } else if ("more" === s2.conditionsForExecution && (!t2 || t2.length <= 0)) return l({ showClose: true, type: "warning", message: u().t("superPageRuntimeMessage.thePreconditionOfTheButtonTo", { message: u().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);
516
1371
  }
517
1372
  return true;
518
1373
  }
519
- function K(e2) {
520
- var _a;
521
- const t2 = e2.pageContext, n2 = e2.configureObj, o2 = t2.entity.data, i2 = t2.systemCode, a2 = t2.code;
522
- let r2 = w(n2, t2);
523
- r2 || (r2 = a2 + ".xxx"), o2.id || o2.ID || (o2.PAGE_CODE = t2.code, o2.PAGE_VERSION = t2.version);
524
- const c2 = { entity: o2, pageMoel: t2.entity.page, formNoRuleCode: t2.formNoRuleCode, tableName: t2.tableName, emailTemplateCode: t2.emailTemplateCode, definitionId: t2.definitionId, functionCode: r2, systemCode: i2, listCodesMap: t2.listCodesMap, pageCode: t2.code, pageVersion: t2.version };
525
- 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);
526
- const u2 = n2.props.base.conversionCodes;
527
- u2 && (s(u2) ? c2.dataConversionRule = u2.join(",") : "string" == typeof u2 && (c2.dataConversionRule = u2));
528
- const l2 = me(n2);
529
- l2 && (c2.autoSetValueData = l2), t2.beanName && (c2.beanName = t2.beanName);
530
- const p2 = (_a = n2.props.base) == null ? void 0 : _a.logSetting;
531
- p2 && (c2.logSettingText = p2.join("")), c2.systemCode || (c2.systemCode = i2);
532
- const d2 = te(t2);
533
- 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]));
534
- const m2 = n2.props.base.successOperation;
535
- return m2 && "noOperation" === m2 && (c2.unControlVersion = true), c2.isWorkflowEntity = true, c2;
536
- }
537
- function Q(e2, t2, s2, n2, o2) {
538
- const i2 = s2.code, a2 = s2.version;
539
- let r2;
540
- if (e2) {
541
- t2 && (s2.initFormNo = e2.formNo, s2.emailTemplateCode = e2.emailTemplateCode), e2.entity && (s2.entity.data = e2.entity, function(e3, t3) {
542
- const s3 = te(t3);
543
- e3 && s3 && f(s3._t_ + "_id", e3);
544
- }(e2.entity.id || e2.entity.ID, s2));
545
- const o3 = e2.completeTaskResult;
546
- if (o3) {
547
- const e3 = o3.completeTaskTipType;
548
- if (e3 && "MESSAGE" === e3) {
549
- const e4 = o3.content;
550
- return l({ showClose: true, type: "warning", message: e4 }), false;
551
- }
552
- }
553
- if (e2.completeTaskParam) {
554
- const t3 = e2.completeTaskParam;
555
- r2 = t3.taskId, n2 && (n2.taskId = r2), P(i2, a2, "_completeTaskParam", t3), s2.fieldPermissions = t3.fieldPermissions, s2.actionPermissions = t3.actionPermissions, s2.workflowButtonComponent = t3.buttonComponent, s2.completeTaskParam = t3;
556
- }
557
- s2.entity || (s2.entity = {}), s2.entity.task = e2.taskParamMap, P(i2, a2, "_currentActivityName", e2.taskName);
558
- }
559
- return n2 && (n2.operationResult = o2), t2 || F(s2, n2.configureObj, e2, null, false), true;
560
- }
561
- async function X(e2, t2) {
562
- const s2 = await function(e3) {
563
- return new Promise((t3, s3) => {
564
- var _a, _b, _c, _d;
565
- const n2 = e3.configureObj;
566
- if (n2) {
567
- let s4 = false;
568
- if (((_b = (_a = n2.props) == null ? void 0 : _a.base) == null ? void 0 : _b.isMustOpinion) && (s4 = true), true === s4) {
569
- const t4 = e3.pageContext, o2 = (_d = (_c = n2.props) == null ? void 0 : _c.base) == null ? void 0 : _d.mustOpinionConditions;
570
- s4 = R(t4, n2, o2);
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);
571
1396
  }
572
- true === s4 ? p.prompt(u().t("superPageRuntimeMessage.pleaseInputOpinion"), u().t("superPageRuntimeMessage.opinion"), { confirmButtonText: u().t("superPageRuntimeMessage.sure"), cancelButtonText: u().t("superPageRuntimeMessage.cancel"), inputType: "textarea", inputValue: null, closeOnClickModal: false, inputValidator: (e4) => !(!e4 || !e4.trim()) || u().t("superPageRuntimeMessage.pleaseInputOpinion") }).then(({ value: e4 }) => {
573
- t3(e4);
574
- }).catch(() => {
575
- t3(false);
576
- }) : t3(true);
577
- } else t3(true);
578
- });
579
- }(e2);
580
- return new Promise((i2, a2) => {
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) => {
581
1414
  var _a;
582
- if (s2) {
583
- const r2 = e2.pageContext, p2 = r2.systemCode, d2 = r2.backendUrl, m2 = true === s2 ? (_a = r2.completeTaskParam) == null ? void 0 : _a.opinion : s2;
584
- let f2 = n(d2, r2.isTest) + "/dsc/workflow-commons/complete-tasks";
585
- if (f2 = o(f2, p2, d2, r2.isTest), !f2) return void l({ showClose: true, type: "warning", message: u().t("superPageRuntimeMessage.requestPathEmpty") });
586
- const g2 = K(e2);
587
- g2.completeTaskParam = { operationResult: t2, taskId: r2.completeTaskParam ? r2.completeTaskParam.taskId : null, opinion: m2 || null };
588
- c.post(f2, g2).then((s3) => {
589
- let n2 = true;
590
- s3 && (n2 = Q(s3, false, r2, e2, t2)), true === n2 && l({ showClose: true, type: "success", message: u().t("superPageRuntimeMessage.successfulCompleteTask") }), i2(true);
591
- }).catch((e3) => {
592
- a2(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);
593
1458
  });
594
- } else i2(true);
1459
+ } else {
1460
+ resolve(true);
1461
+ }
595
1462
  });
596
1463
  }
597
- function Z(e2, t2) {
598
- if (t2) {
599
- const s2 = e2.pageContext, o2 = e2.configureObj, i2 = s2.backendUrl, a2 = n(i2, s2.isTest) + "/dsc/workflow-commons/assigns", r2 = t2.id ? t2.id : t2.ID ? t2.ID : null, c2 = K(e2);
600
- c2.assigneeId = r2, oe(e2, c2, a2, "superPageRuntimeMessage.successfulAssign").then((e3) => {
601
- h(s2, o2);
602
- });
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
+ );
603
1530
  }
604
1531
  }
605
- function ee(e2) {
606
- const t2 = e2.pageContext, s2 = t2.entity.data, n2 = t2.systemCode, o2 = t2.code, i2 = te(t2), a2 = void 0 !== s2.ID && null !== s2.ID ? s2.ID : s2.id, r2 = { beanName: t2.beanName, id: a2, entity: s2, additionalParamMap: i2, tableName: t2.tableName, functionCode: o2 + ".xxx", isWorkflowEntity: true, listCodesMap: t2.listCodesMap, pageCode: t2.code, pageVersion: t2.version };
607
- return r2.completeTaskParam = { taskId: t2.completeTaskParam.taskId, systemCode: n2 }, r2;
608
- }
609
- function te(t2) {
610
- if (t2.entity) {
611
- let s2 = e(t2.entity.page);
612
- s2 || (s2 = {});
613
- const n2 = t2.entity.request;
614
- return n2 && Object.assign(s2, n2), s2;
615
- }
616
- }
617
- function se(e2, t2) {
618
- if (t2) {
619
- const s2 = e2.pageContext, i2 = e2.configureObj, a2 = s2.systemCode, r2 = s2.backendUrl;
620
- let p2 = n(r2, s2.isTest) + "/dsc/workflow-commons/add-signers";
621
- if (p2 = o(p2, a2, r2, s2.isTest), !p2) return void l({ showClose: true, type: "warning", message: u().t("superPageRuntimeMessage.requestPathEmpty") });
622
- const d2 = ee(e2);
623
- d2.completeTaskParam.transactors = t2.loginNames.join(",").split(",");
624
- const m2 = c.post(p2, d2);
625
- m2 && m2.then((e3) => {
626
- l({ showClose: true, type: "success", message: u().t("superPageRuntimeMessage.successfulOperation") }), e3.entity && F(s2, i2, e3, null, false), h(s2, i2);
627
- });
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;
628
1568
  }
629
1569
  }
630
- function ne(e2, t2) {
631
- if (t2) {
632
- const s2 = e2.pageContext, i2 = e2.configureObj, a2 = s2.systemCode, r2 = s2.backendUrl;
633
- let p2 = n(r2, s2.isTest) + "/dsc/workflow-commons/add-signers";
634
- if (p2 = o(p2, a2, r2, s2.isTest), !p2) return void l({ showClose: true, type: "warning", message: u().t("superPageRuntimeMessage.requestPathEmpty") });
635
- const d2 = ee(e2);
636
- d2.completeTaskParam.transactors = t2.userIds.join(",").split(",");
637
- const m2 = c.post(p2, d2);
638
- m2 && m2.then((e3) => {
639
- l({ showClose: true, type: "success", message: u().t("superPageRuntimeMessage.successfulOperation") }), h(s2, i2);
640
- });
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
+ }
641
1608
  }
642
1609
  }
643
- function oe(e2, t2, s2, n2) {
644
- return new Promise((i2, a2) => {
645
- const r2 = e2.pageContext, p2 = r2.systemCode, d2 = r2.backendUrl;
646
- if (!(s2 = o(s2, p2, d2, r2.isTest))) return void l({ showClose: true, type: "warning", message: u().t("superPageRuntimeMessage.requestPathEmpty") });
647
- const m2 = c.post(s2, t2);
648
- m2 && m2.then((t3) => {
649
- let s3 = true;
650
- t3 && (s3 = Q(t3, false, r2, e2, null)), true === s3 && l({ showClose: true, type: "success", message: u().t(n2) }), i2(true);
651
- }).catch((e3) => {
652
- a2(e3);
653
- });
654
- });
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
+ }
655
1646
  }
656
- function ie(e2) {
657
- const t2 = e2.pageContext, s2 = t2.systemCode, i2 = t2.backendUrl, a2 = t2.completeTaskParam;
658
- let r2 = n(i2, t2.isTest) + "/dsc/workflow-commons/returnable-task/" + a2.taskId;
659
- if (r2 = o(r2, s2, i2, t2.isTest), !r2) return void l({ showClose: true, type: "warning", message: u().t("superPageRuntimeMessage.requestPathEmpty") });
660
- const p2 = t2.code, d2 = te(t2), m2 = { beanName: t2.beanName, additionalParamMap: d2, tableName: t2.tableName, functionCode: p2 + ".xxx" };
661
- return c.post(r2, m2);
662
- }
663
- function ae(e2, t2) {
664
- const s2 = e2.pageContext, o2 = e2.configureObj, i2 = s2.backendUrl, a2 = n(i2, s2.isTest) + "/dsc/workflow-commons/returnTaskTo", r2 = K(e2);
665
- t2.nodeName && (r2.returnToNodeName = t2.nodeName), t2.nodeId && (r2.returnToNodeId = t2.nodeId), oe(e2, r2, a2, "superPageRuntimeMessage.successfulReturnTaskTo").then((e3) => {
666
- h(s2, o2);
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
+ }
667
1680
  });
668
1681
  }
669
- function re(e2) {
670
- const t2 = e2.pageContext, s2 = t2.systemCode, i2 = t2.backendUrl;
671
- let a2 = n(i2, t2.isTest) + "/dsc/workflow-commons/get-remove-signers";
672
- const r2 = K(e2);
673
- if (a2 = o(a2, s2, i2, t2.isTest), a2) return c.post(a2, r2);
674
- l({ showClose: true, type: "warning", message: u().t("superPageRuntimeMessage.requestPathEmpty") });
675
- }
676
- function ce(e2, t2) {
677
- if (t2) {
678
- const s2 = e2.pageContext, i2 = e2.configureObj, a2 = s2.systemCode, r2 = s2.backendUrl;
679
- let p2 = n(r2, s2.isTest) + "/dsc/workflow-commons/remove-signers";
680
- if (p2 = o(p2, a2, r2, s2.isTest), !p2) return void l({ showClose: true, type: "warning", message: u().t("superPageRuntimeMessage.requestPathEmpty") });
681
- const d2 = t2.map((e3) => e3.id ? e3.id : e3.ID ? e3.ID : null), m2 = K(e2);
682
- m2.ids = d2;
683
- const f2 = c.post(p2, m2);
684
- f2 && f2.then((e3) => {
685
- F(s2, i2, e3, "superPageRuntimeMessage.successfulOperation", false), h(s2, i2);
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")
686
1738
  });
1739
+ return;
687
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);
688
1750
  }
689
- function ue(e2, t2, s2) {
690
- let n2 = false;
691
- return e2 && t2 && ("workflowSave" === e2 ? n2 = function(e3) {
692
- if ((void 0 === e3.processState || null === e3.processState || "UNSUBMIT" === e3.processState && "WAIT_TRANSACT" === e3.active) && (void 0 === e3.processState || true === e3.showButtonSave)) return true;
693
- 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;
694
- return false;
695
- }(t2) : "submitProcess" === e2 ? n2 = function(e3) {
696
- if ((void 0 === e3.processState || null === e3.processState || "UNSUBMIT" === e3.processState && "WAIT_TRANSACT" === e3.active) && (void 0 === e3.processState || true === e3.showButtonSave)) return true;
697
- return false;
698
- }(t2) : "submitTask" === e2 ? n2 = function(e3) {
699
- if (e3.processState && "SUBMIT" === e3.processState && "WAIT_TRANSACT" === e3.active && "EDIT" === e3.processingMode) return true;
700
- return false;
701
- }(t2) : "drawTask" === e2 ? n2 = function(e3) {
702
- if (e3.processState && "SUBMIT" === e3.processState && e3.active && ("DRAW_WAIT" === e3.active || "DEPT_DRAW_WAIT" === e3.active) && e3.showButtonDraw) return true;
703
- return false;
704
- }(t2) : "abandonReceive" === e2 ? n2 = function(e3) {
705
- if (e3.processState && "SUBMIT" === e3.processState && (e3.drawTask && "WAIT_TRANSACT" === e3.active || e3.canAbandonDeptTask && "WAIT_TRANSACT" === e3.active) && e3.showButtonAbandon) return true;
706
- return false;
707
- }(t2) : "approve" === e2 || "refuse" === e2 ? n2 = function(e3) {
708
- if (e3.processState && "SUBMIT" === e3.processState && "WAIT_TRANSACT" === e3.active && ("APPROVE" === e3.processingMode || "COUNTERSIGN" === e3.processingMode)) return true;
709
- return false;
710
- }(t2) : "readed" === e2 ? n2 = function(e3) {
711
- if ("WAIT_TRANSACT" === e3.active && "TYPE_READ" === e3.processingMode) return true;
712
- return false;
713
- }(t2) : "assign" === e2 ? n2 = function(e3) {
714
- if (e3.processState && "SUBMIT" === e3.processState && "TYPE_READ" !== e3.processingMode && ("WAIT_TRANSACT" === e3.active || "DRAW_WAIT" === e3.active)) return true;
715
- return false;
716
- }(t2) : "copyTask" === e2 ? n2 = function(e3) {
717
- if (e3.processState && "SUBMIT" === e3.processState && "WAIT_TRANSACT" === e3.active && "TYPE_READ" !== e3.processingMode && e3.showButtonCopy) return true;
718
- return false;
719
- }(t2) : "addSigner" === e2 ? n2 = function(e3) {
720
- if (e3.processState && "SUBMIT" === e3.processState && "WAIT_TRANSACT" === e3.active && ("APPROVE" === e3.processingMode || "COUNTERSIGN" === e3.processingMode) && "COUNTERSIGN" === e3.processingMode && e3.showButtonAddCounter) return true;
721
- return false;
722
- }(t2) : "removeSigner" === e2 ? n2 = function(e3) {
723
- if (e3.processState && "SUBMIT" === e3.processState && "WAIT_TRANSACT" === e3.active && ("APPROVE" === e3.processingMode || "COUNTERSIGN" === e3.processingMode) && "COUNTERSIGN" === e3.processingMode && e3.showButtonDelCounter) return true;
724
- return false;
725
- }(t2) : "retrieveTask" === e2 ? n2 = function(e3) {
726
- if (e3.processState && "SUBMIT" === e3.processState && function(e4) {
727
- if ("COMPLETED" !== e4.active) return false;
728
- if ("TYPE_READ" === e4.processingMode) return false;
729
- 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) {
730
1902
  return true;
731
- }(e3)) return true;
732
- return false;
733
- }(t2) : "agreement" === e2 || "oppose" === e2 ? n2 = function(e3) {
734
- 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") {
735
2010
  return false;
736
- }(t2) : "kiken" === e2 ? n2 = function(e3) {
737
- if (e3.processState && "SUBMIT" === e3.processState && "WAIT_TRANSACT" === e3.active && "VOTE" === e3.processingMode && e3.showButtonKiken) return true;
2011
+ }
2012
+ if (buttonInfo["processingMode"] === "TYPE_READ") {
738
2013
  return false;
739
- }(t2) : function(e3, t3) {
740
- return e3.processState && "SUBMIT" === e3.processState && "TYPE_READ" !== e3.processingMode && !function(e4) {
741
- const t4 = e4;
742
- let s3 = true;
743
- t4 && (s3 = t4.taskComplete);
744
- return s3;
745
- }(t3);
746
- }(t2, s2) && (n2 = "returnToPreviousTask" !== e2 || function(e3) {
747
- if (e3.rebuttable) return true;
2014
+ }
2015
+ if (!buttonInfo["showButtonGetBack"]) {
748
2016
  return false;
749
- }(t2))), n2;
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
+ });
750
2057
  }
751
- function le(e2, t2) {
752
- e2.entity.page || (e2.entity.page = {}), e2.entity.page._isRefresh = true, pe(e2, t2).then((t3) => {
753
- 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
+ });
754
2161
  });
755
2162
  }
756
- function pe(e2, s2, o2) {
757
- const i2 = e2.pageType;
758
- if (i2 && "form" === i2) {
759
- e2.canClick = false;
760
- return t(e2) ? function(e3, t2, s3) {
761
- return new Promise((o3, i3) => {
762
- const a2 = e3.systemCode, u2 = e3.code, l2 = e3.version, p2 = te(e3);
763
- let d2 = t2 || null, f2 = t2 ? [t2] : null;
764
- void 0 === s3 || s3 ? (d2 || (d2 = p2 && p2.id ? p2.id : null), f2 || (f2 = p2 ? p2.ids : null)) : (d2 = null, f2 = null, p2._id = p2.id, p2.id = null);
765
- const g2 = p2 ? p2.taskId : null, b2 = u2, C2 = { pageCode: u2, pageVersion: l2, tableName: e3.tableName, formNoRuleCode: e3.formNoRuleCode, isWorkflowEntity: true, systemCode: a2, functionCode: b2 + ".workflowGets", listCodesMap: e3.listCodesMap };
766
- if ((!e3.listCodesMap || 0 === Object.keys(e3.listCodesMap).length) && e3.tableUuids) {
767
- const t3 = {};
768
- e3.tableUuids.forEach((e4) => {
769
- const s4 = r(u2, l2, e4);
770
- t3[s4] = s4;
771
- }), C2.listCodesMap = t3;
772
- }
773
- f2 && (C2.ids = de(f2)), g2 ? C2.taskId = g2 : 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);
774
- const y2 = n(e3.backendUrl, e3.isTest) + "/dsc/workflow-commons/gets", h2 = E();
775
- h2.restorePageLoadState(), T(null, e3, e3, "beforeFormLoadData"), c.post(y2, C2).then((t3) => {
776
- e3.definitionId = t3.definitionId, e3.entity.task = t3.taskParamMap, Q(t3, true, e3), e3.workflowRules = A(e3);
777
- const s4 = e3.pageType;
778
- s4 && "form" === s4 && function(e4) {
779
- (function(e5) {
780
- const t4 = /* @__PURE__ */ new Map(), s5 = e5.fieldPermissions;
781
- if (void 0 !== s5) for (let e6 = 0; e6 < s5.length; e6++) {
782
- const n2 = s5[e6].name;
783
- if (n2) if (0 === n2.indexOf("$") && n2.indexOf(".") > 0) {
784
- const o4 = s5[e6], i4 = JSON.parse(JSON.stringify(o4)), a3 = n2.substring(1, n2.indexOf(".")), r2 = n2.substring(n2.indexOf(".") + 1);
785
- if (i4.name = r2, i4 && "all_fields" === i4.name) false === i4.canEdit ? i4.rowIndexes ? t4.set(a3, [{ name: "all_fields", canEdit: false, rowIndexes: i4.rowIndexes }]) : t4.set(a3, [{ name: "all_fields", canEdit: false }]) : i4.rowIndexes ? t4.set(a3, [{ name: "all_fields", canEdit: true, rowIndexes: i4.rowIndexes }]) : t4.set(a3, [{ name: "all_fields", canEdit: true }]);
786
- else {
787
- let e7 = t4.get(a3);
788
- e7 || (e7 = []), e7.push(i4), t4.set(a3, 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
789
2288
  }
790
- } else t4.set(n2, s5[e6]);
2289
+ ]);
2290
+ } else {
2291
+ fieldPermissionMap.set(subModelName, [{ name: "all_fields", canEdit: false }]);
791
2292
  }
792
- e5.fieldPermissionMap = t4;
793
- })(e4), function(e5) {
794
- const t4 = e5.fieldPermissionMap, s5 = /* @__PURE__ */ new Map(), n2 = e5.actionPermissions;
795
- if (null != n2) {
796
- Object.keys(n2).forEach((e6) => {
797
- const o4 = n2[e6], i4 = t4.get(e6);
798
- if (i4 && i4.length > 0 && "all_fields" === i4[0].name && false === i4[0].canEdit) o4.canUpdate = false, o4.canAdd = false;
799
- else {
800
- const s6 = o4.canUpdate, n3 = o4.updateRowIndexes;
801
- void 0 !== s6 && false === s6 && null != n3 && n3.length > 0 && t4.set(e6, [{ name: "all_fields", canEdit: false, rowIndexes: n3 }]);
2293
+ } else {
2294
+ if (fieldPermission.rowIndexes) {
2295
+ fieldPermissionMap.set(subModelName, [
2296
+ {
2297
+ name: "all_fields",
2298
+ canEdit: true,
2299
+ rowIndexes: fieldPermission.rowIndexes
802
2300
  }
803
- s5.set(e6, o4);
804
- });
2301
+ ]);
2302
+ } else {
2303
+ fieldPermissionMap.set(subModelName, [{ name: "all_fields", canEdit: true }]);
805
2304
  }
806
- e5.actionPermissionMap = s5;
807
- }(e4);
808
- }(e3), e3.canClick = true, T(null, e3, e3, "afterFormLoadData"), h2.setFormPageDataLoadState(true), o3(t3);
809
- }).catch((t3) => {
810
- e3.canClick = true, i3(t3);
811
- });
812
- });
813
- }(e2, s2, o2) : function(e3, t2, s3) {
814
- return new Promise((o3, i3) => {
815
- const a2 = e3.systemCode, u2 = e3.code, l2 = e3.version, p2 = te(e3);
816
- let d2 = t2 || null, f2 = t2 ? [t2] : null;
817
- void 0 === s3 || s3 ? (d2 || (d2 = p2 && p2.id ? p2.id : null), f2 || (f2 = p2 ? p2.ids : null)) : (d2 = null, f2 = null, p2._id = p2.id, p2.id = null);
818
- const g2 = p2 ? p2.taskId : null, b2 = u2, C2 = n(e3.backendUrl, e3.isTest), y2 = { pageCode: u2, pageVersion: l2, tableName: e3.tableName, formNoRuleCode: e3.formNoRuleCode, id: d2, systemCode: a2, functionCode: b2 + ".gets", listCodesMap: e3.listCodesMap };
819
- if (!y2.id && p2 && p2._t_ && m(p2._t_ + "_id") && (y2.id = m(p2._t_ + "_id")), f2 && (y2.ids = de(f2)), e3.notIdInitializationList && (y2.noIdAndTaskIdInitSetting = JSON.stringify(e3.notIdInitializationList)), p2 && (y2.additionalParamMap = p2), e3.beanName && (y2.beanName = e3.beanName), g2 && (y2.taskId = g2), (!e3.listCodesMap || 0 === Object.keys(e3.listCodesMap).length) && e3.tableUuids) {
820
- const t3 = {};
821
- e3.tableUuids.forEach((e4) => {
822
- const s4 = r(u2, l2, e4);
823
- t3[s4] = s4;
824
- }), 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]);
825
2318
  }
826
- e3.refercePropMap && (y2.refercePropMap = e3.refercePropMap);
827
- const h2 = C2 + "/dsc/commons/gets", P2 = E();
828
- P2.restorePageLoadState(), T(null, e3, e3, "beforeFormLoadData"), c.post(h2, y2).then((t3) => {
829
- t3 && (e3.entity.data = t3.entity, e3.initFormNo = t3.formNo);
830
- const s4 = e3.customRules, n2 = e3.rules, i4 = U(s4, n2);
831
- e3.rules = i4, e3.canClick = true, T(null, e3, e3, "afterFormLoadData"), P2.setFormPageDataLoadState(true), o3(t3);
832
- }).catch((t3) => {
833
- e3.canClick = true, i3(t3);
834
- });
835
- });
836
- }(e2, s2, o2);
2319
+ }
2320
+ }
837
2321
  }
838
- return new Promise((e3, t2) => {
839
- e3(true);
840
- });
2322
+ pageContext.fieldPermissionMap = fieldPermissionMap;
841
2323
  }
842
- function de(e2) {
843
- 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;
844
2353
  }
845
- function me(e2) {
846
- const t2 = e2.props.setValueList;
847
- if (t2) {
848
- if (s(t2) && t2.length > 0) return JSON.stringify(t2);
849
- 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
+ }
850
2362
  }
851
2363
  return null;
852
2364
  }
853
2365
  export {
854
- F as dealAfterOperate,
855
- Q as dealCompleteTaskParam,
856
- se as doAddSigner,
857
- Z as doAssign,
858
- ne as doCreateCopyTask,
859
- z as doImportFinally,
860
- ce as doRemoveSigners,
861
- ae as doReturnTaskTo,
862
- D as exportFormReport,
863
- te as getAdditionalParamMap,
864
- pe as getFormData,
865
- re as getRemoveSigner,
866
- V as getSaveFormRequest,
867
- W as getSaveFormRequestWithRow,
868
- ie as getTaskInformitions,
869
- ue as isVisibleWorkflowButton,
870
- Y as judgeDataNumber,
871
- $ as refreshFormOrListPage,
872
- le as refreshPage,
873
- _ as standardEvents,
874
- 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
875
2387
  };