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,402 +1,815 @@
1
- import { isMobileBrowser as e, isPromise as n } from "agilebuilder-ui/src/utils/common-util";
2
- import { getAdditionalParamMap as t, standardEvents as i, judgeDataNumber as o, dealAfterOperate as r } from "./standard-event.js";
3
- import { validateDataModelFunc as u } from "./validator-util.js";
4
- import { getComponentRef as c, getComponentRefByCode as l } from "../global-refs.js";
5
- import { ElMessage as a } from "element-plus";
6
- import { analysisCondition as s } from "agilebuilder-ui/src/utils/util";
7
- import { getListCode as f, deepCopy as g } from "../common-util.js";
8
- import m from "../eventBus.js";
9
- import { getValueFromSource as p } from "../page-helper-util.js";
10
- import { expressJump as d } from "../table-utils.js";
11
- const v = ["downloadTemplate", "back", "exportForm", "exportPDF", "lineEditCreate", "workflowSave"], b = ["downloadTemplate", "exportForm", "exportPDF", "export", "exportCharts"], C = ["import"];
12
- function x(e2, n2) {
13
- if (e2 && e2.customEvents) {
14
- const t2 = function(e3) {
15
- const n3 = {};
16
- return e3.forEach((e4) => {
17
- if (!e4.isStandard && e4.jsContent) if ("customFunc" === e4.name) {
18
- let t3 = null;
19
- if (e4.funcParam) {
20
- const n4 = e4.funcParam.split(",");
21
- t3 = new Function(n4, e4.jsContent);
22
- } else t3 = new Function(e4.jsContent);
23
- n3[e4.eventName] = t3;
24
- } else {
25
- let t3 = e4.componentUuid + "_";
26
- t3 += e4.name, n3[t3] = new Function("params", e4.jsContent);
27
- }
28
- }), n3;
29
- }(e2.customEvents);
30
- !function(e3, n3) {
31
- if (!n3) return;
32
- for (const t3 in n3) {
33
- j(n3[t3], e3);
34
- }
35
- }(n2, t2), n2.customEvents = t2;
36
- }
37
- }
38
- function k(e2, n2) {
39
- if (e2.customEvents) return e2.customEvents[n2];
40
- }
41
- function j(e2, n2) {
42
- e2.get = function(e3) {
43
- return e3 ? l(n2, e3) : void 0;
44
- }, e2.getByUuid = function(e3) {
45
- return e3 ? c(n2, e3) : void 0;
46
- }, e2.getPageContext = function() {
47
- return n2;
48
- }, e2.getContextValue = function(e3) {
49
- let t2 = n2 && n2.entity ? n2.entity.context : null;
50
- return t2 = t2 || {}, p(t2, e3, "context");
51
- }, e2.getContext = function() {
52
- return n2 && n2.entity ? n2.entity.context : {};
53
- }, e2.getSystem = function() {
54
- return n2 && n2.entity ? n2.entity.system : {};
55
- }, e2.getTask = function() {
56
- return n2 && n2.entity ? n2.entity.task : {};
57
- }, e2.getRequest = function() {
58
- return n2 && n2.entity ? n2.entity.request : {};
59
- }, e2.getPage = function() {
60
- return n2 && n2.entity ? n2.entity.page : {};
61
- }, e2.getCustomFunc = function(e3) {
62
- return k(n2, e3);
1
+ import { isMobileBrowser, isPromise } from "agilebuilder-ui/src/utils/common-util";
2
+ import { getAdditionalParamMap, standardEvents, judgeDataNumber, dealAfterOperate } from "./standard-event.js";
3
+ import { validateDataModelFunc } from "./validator-util.js";
4
+ import { getComponentRef, getComponentRefByCode } from "../global-refs.js";
5
+ import { ElMessage } from "element-plus";
6
+ import { analysisCondition } from "agilebuilder-ui/src/utils/util";
7
+ import { getListCode, deepCopy } from "../common-util.js";
8
+ import bus from "../eventBus.js";
9
+ import { getValueFromSource } from "../page-helper-util.js";
10
+ import { expressJump } from "../table-utils.js";
11
+ const skipValidateEvents = [
12
+ "downloadTemplate",
13
+ "back",
14
+ "exportForm",
15
+ "exportPDF",
16
+ "lineEditCreate",
17
+ "workflowSave"
18
+ ];
19
+ const exportEvents = [
20
+ "downloadTemplate",
21
+ "exportForm",
22
+ "exportPDF",
23
+ "export",
24
+ "exportCharts"
25
+ ];
26
+ const importEvents = [
27
+ "import"
28
+ ];
29
+ function initPageEvents(pageDesign, pageContext) {
30
+ if (pageDesign && pageDesign.customEvents) {
31
+ const customEvents = transferToFunction(pageDesign.customEvents);
32
+ appendDefaultMethod(pageContext, customEvents);
33
+ console.log("initPage customEvents", customEvents);
34
+ pageContext.customEvents = customEvents;
35
+ }
36
+ }
37
+ function getCustomFunc(pageContext, funcName) {
38
+ if (pageContext.customEvents) {
39
+ return pageContext.customEvents[funcName];
40
+ }
41
+ }
42
+ function appendDefaultMethod(pageContext, customEvents) {
43
+ if (!customEvents) {
44
+ return;
45
+ }
46
+ for (const pro in customEvents) {
47
+ const func = customEvents[pro];
48
+ appendDefaultMethods(func, pageContext);
49
+ }
50
+ }
51
+ function appendDefaultMethods(func, pageContext) {
52
+ func.get = function(code) {
53
+ if (code) {
54
+ return getComponentRefByCode(pageContext, code);
55
+ } else {
56
+ return void 0;
57
+ }
58
+ };
59
+ func.getByUuid = function(uuid) {
60
+ if (uuid) {
61
+ return getComponentRef(pageContext, uuid);
62
+ } else {
63
+ return void 0;
64
+ }
65
+ };
66
+ func.getPageContext = function() {
67
+ return pageContext;
68
+ };
69
+ func.getContextValue = function(fieldName) {
70
+ let contextData = pageContext && pageContext.entity ? pageContext.entity.context : null;
71
+ contextData = contextData ? contextData : {};
72
+ return getValueFromSource(contextData, fieldName, "context");
73
+ };
74
+ func.getContext = function() {
75
+ return pageContext && pageContext.entity ? pageContext.entity.context : {};
76
+ };
77
+ func.getSystem = function() {
78
+ return pageContext && pageContext.entity ? pageContext.entity.system : {};
79
+ };
80
+ func.getTask = function() {
81
+ return pageContext && pageContext.entity ? pageContext.entity.task : {};
82
+ };
83
+ func.getRequest = function() {
84
+ return pageContext && pageContext.entity ? pageContext.entity.request : {};
85
+ };
86
+ func.getPage = function() {
87
+ return pageContext && pageContext.entity ? pageContext.entity.page : {};
88
+ };
89
+ func.getCustomFunc = function(funcName) {
90
+ return getCustomFunc(pageContext, funcName);
63
91
  };
64
92
  }
65
- function O(e2) {
66
- if (e2 && e2.customEvents) {
67
- const n2 = e2.customEvents.filter((e3) => "customFunc" === e3.name && e3.jsContent);
68
- n2 && n2.length > 0 && n2.forEach((e3) => {
69
- delete window["$page_" + e3.eventName];
70
- });
93
+ function removeCustomFuncFromWindow(pageDesign) {
94
+ if (pageDesign && pageDesign.customEvents) {
95
+ const customEvents = pageDesign.customEvents;
96
+ const customFuncs = customEvents.filter((item) => item.name === "customFunc" && item.jsContent);
97
+ if (customFuncs && customFuncs.length > 0) {
98
+ customFuncs.forEach((event) => {
99
+ delete window["$page_" + event.eventName];
100
+ });
101
+ }
71
102
  }
72
103
  }
73
- function h(e2, n2, t2, i2, o2) {
74
- return N(e2, n2, t2, i2, true, o2, false);
104
+ function handleEvent($event, pageContext, configure, eventType, otherParams) {
105
+ return handleEventUtil($event, pageContext, configure, eventType, true, otherParams, false);
75
106
  }
76
- function E(e2, n2, t2, i2, o2) {
107
+ function handleFormEvent($event, pageContext, configure, eventType, otherParams) {
77
108
  var _a, _b;
78
- if (i2 && "change" === i2) {
79
- const e3 = n2.subTableWatchProps;
80
- if (e3) for (const n3 in e3) {
81
- const i3 = e3[n3], o3 = (_b = (_a = t2.props) == null ? void 0 : _a.base) == null ? void 0 : _b.prop;
82
- i3 && i3.indexOf(o3) >= 0 && m.$emit("_refreshSubTable_" + n3, { propName: o3 });
109
+ if (eventType && eventType === "change") {
110
+ const subTableWatchProps = pageContext.subTableWatchProps;
111
+ if (subTableWatchProps) {
112
+ for (const tableUuid in subTableWatchProps) {
113
+ const mainFormProps = subTableWatchProps[tableUuid];
114
+ const propName = (_b = (_a = configure.props) == null ? void 0 : _a.base) == null ? void 0 : _b.prop;
115
+ if (mainFormProps && mainFormProps.indexOf(propName) >= 0) {
116
+ bus.$emit("_refreshSubTable_" + tableUuid, { propName });
117
+ }
118
+ }
119
+ }
120
+ }
121
+ return handleEventUtil($event, pageContext, configure, eventType, true, otherParams, true);
122
+ }
123
+ function handleAfterInitEvent($event, pageContext, configure, otherParams) {
124
+ return handleFormEvent($event, pageContext, configure, "afterInit", otherParams);
125
+ }
126
+ function getHandleEvent($event, pageContext, configure, eventType, otherParams) {
127
+ return handleEventUtil($event, pageContext, configure, eventType, false, otherParams, false);
128
+ }
129
+ function handleEventUtil($event, pageContext, configure, eventType, isExecute, otherParams, skipValidate) {
130
+ const events = configure && configure.runtime && configure.runtime.events ? configure.runtime.events : [];
131
+ let eventFun;
132
+ if (!skipValidate && isClickEvent(eventType)) {
133
+ const eventParams = getDefaultEventParams($event, pageContext, configure, otherParams);
134
+ buttonClickEvent(pageContext, configure, eventParams);
135
+ } else {
136
+ eventFun = getEventFuncByType(pageContext, events, eventType);
137
+ if (isExecute) {
138
+ const eventParams = packageEventParams(pageContext, configure, $event, otherParams);
139
+ return callItemEvent(pageContext, configure, eventFun, eventParams);
140
+ } else {
141
+ return eventFun;
83
142
  }
84
143
  }
85
- return N(e2, n2, t2, i2, true, o2, true);
86
144
  }
87
- function y(e2, n2, t2, i2) {
88
- return E(e2, n2, t2, "afterInit", i2);
145
+ function isClickEvent(eventType) {
146
+ return eventType && (eventType === "click" || eventType === "suffixClick" || eventType === "prefixClick");
89
147
  }
90
- function w(e2, n2, t2, i2, o2) {
91
- return N(e2, n2, t2, i2, false, o2, false);
148
+ function getTableUuid(pageContext, configure) {
149
+ return configure.props.base.tableUuid ? configure.props.base.tableUuid : pageContext.tableUuids && pageContext.tableUuids.length > 0 ? pageContext.tableUuids[0] : null;
92
150
  }
93
- function N(e2, t2, i2, r2, u2, c2, l2) {
94
- const a2 = i2 && i2.runtime && i2.runtime.events ? i2.runtime.events : [];
95
- let s2;
96
- if (l2 || !/* @__PURE__ */ function(e3) {
97
- return e3 && ("click" === e3 || "suffixClick" === e3 || "prefixClick" === e3);
98
- }(r2)) {
99
- if (s2 = I(t2, a2, r2), u2) {
100
- return z(t2, i2, s2, P(t2, i2, e2, c2));
151
+ function packageEventParams(pageContext, configureObj, $event, otherParams) {
152
+ const params = {};
153
+ if (otherParams) {
154
+ for (const key in otherParams) {
155
+ params[key] = otherParams[key];
101
156
  }
102
- return s2;
103
- }
104
- !function(e3, t3, i3) {
105
- const r3 = o(t3, i3.ids);
106
- if (!r3) return;
107
- if (void 0 !== e3.canClick && false === e3.canClick) return;
108
- H(i3).then((o2) => {
109
- if (true === o2.canExecute) {
110
- e3.clickUuid = t3.uuid, e3.canClick = false;
111
- const o3 = t3.runtime && t3.runtime.events ? t3.runtime.events : [], r4 = I(e3, o3, "beforeValidateForm");
112
- let u3;
113
- if (r4 && (u3 = z(e3, t3, r4, i3)), void 0 === u3 && (u3 = true), !u3) return void (e3.canClick = true);
114
- n(u3) ? u3.then((n2) => {
115
- n2 && true === n2 ? R(e3, t3, i3) : e3.canClick = true;
116
- }).catch((n2) => {
117
- e3.canClick = true;
118
- }) : R(e3, t3, i3);
157
+ }
158
+ if ($event !== void 0 && $event !== null) {
159
+ params["_value"] = $event;
160
+ }
161
+ if (pageContext) {
162
+ params["pageContext"] = pageContext;
163
+ }
164
+ if (configureObj) {
165
+ params["configureObj"] = configureObj;
166
+ }
167
+ return params;
168
+ }
169
+ function buttonClickEvent(pageContext, configure, eventParams) {
170
+ const judgeFlag = judgeDataNumber(configure, eventParams["ids"]);
171
+ if (!judgeFlag) {
172
+ return;
173
+ }
174
+ if (pageContext.canClick !== void 0 && pageContext.canClick === false) {
175
+ console.log("不能重复点击");
176
+ return;
177
+ }
178
+ canExecuteButton(eventParams).then((result) => {
179
+ if (result["canExecute"] === true) {
180
+ pageContext.clickUuid = configure.uuid;
181
+ pageContext.canClick = false;
182
+ const events = configure.runtime && configure.runtime.events ? configure.runtime.events : [];
183
+ const beforeValidateFormFunc = getEventFuncByType(pageContext, events, "beforeValidateForm");
184
+ let beforeValidateFormResult;
185
+ if (beforeValidateFormFunc) {
186
+ beforeValidateFormResult = callItemEvent(
187
+ pageContext,
188
+ configure,
189
+ beforeValidateFormFunc,
190
+ eventParams
191
+ );
192
+ }
193
+ if (beforeValidateFormResult === void 0) {
194
+ beforeValidateFormResult = true;
195
+ }
196
+ if (!beforeValidateFormResult) {
197
+ pageContext.canClick = true;
198
+ return;
199
+ }
200
+ if (isPromise(beforeValidateFormResult)) {
201
+ beforeValidateFormResult.then((result2) => {
202
+ if (result2 && result2 === true) {
203
+ doValidateForm(pageContext, configure, eventParams);
204
+ } else {
205
+ pageContext.canClick = true;
206
+ }
207
+ }).catch((error) => {
208
+ console.log(error);
209
+ pageContext.canClick = true;
210
+ });
211
+ } else {
212
+ doValidateForm(pageContext, configure, eventParams);
119
213
  }
120
- });
121
- }(t2, i2, T(e2, t2, i2, c2));
122
- }
123
- function S(e2, n2) {
124
- return n2.props.base.tableUuid ? n2.props.base.tableUuid : e2.tableUuids && e2.tableUuids.length > 0 ? e2.tableUuids[0] : null;
125
- }
126
- function P(e2, n2, t2, i2) {
127
- const o2 = {};
128
- if (i2) for (const e3 in i2) o2[e3] = i2[e3];
129
- return null != t2 && (o2._value = t2), e2 && (o2.pageContext = e2), n2 && (o2.configureObj = n2), o2;
130
- }
131
- function R(e2, t2, i2) {
132
- const o2 = t2.runtime && t2.runtime.events ? t2.runtime.events : [];
133
- let r2 = true;
134
- (i2 == null ? void 0 : i2.skipValidate) && (r2 = false);
135
- const c2 = $(e2, o2, "click");
136
- if (c2) {
137
- const e3 = function(e4, n2) {
138
- return e4 && v.includes(n2.eventName);
139
- }(c2.isStandard, c2.event);
140
- e3 && (r2 = false);
141
- }
142
- u(e2, t2, r2).then((o3) => {
143
- if (!o3) return void (e2.canClick = true);
144
- const r3 = U(e2, t2, i2);
145
- r3 ? n(r3) ? r3.then((n2) => {
146
- n2 ? q(e2, t2, c2, i2) : e2.canClick = true;
147
- }).catch((n2) => {
148
- e2.canClick = true;
149
- }) : q(e2, t2, c2, i2) : e2.canClick = true;
150
- }).catch((n2) => {
151
- e2.canClick = true;
214
+ }
152
215
  });
153
216
  }
154
- function F(e2, n2, t2, i2, o2) {
155
- const r2 = T(e2, n2, t2, o2);
156
- q(n2, t2, $(n2, t2.runtime && t2.runtime.events ? t2.runtime.events : [], i2), r2);
157
- }
158
- function T(e2, n2, t2, i2) {
159
- const o2 = n2.code, r2 = n2.version, u2 = S(n2, t2);
160
- if (u2) {
161
- const e3 = c(n2, u2), t3 = e3 ? e3.getSelections() : null, l2 = e3 ? e3.getSelectionIds() : null;
162
- i2 || (i2 = {}), i2.tableUuid = u2, i2.listCode = f(o2, r2, u2);
163
- L(n2) && (i2.selections = t3, i2.id = l2 && l2.length > 0 ? l2[0] : null, i2.ids = l2);
164
- const a2 = e3 ? e3.getTableConfigure() : null;
165
- i2.tableConfigure = a2;
166
- }
167
- return P(n2, t2, e2, i2);
168
- }
169
- function U(e2, n2, t2) {
170
- const i2 = I(e2, n2.runtime && n2.runtime.events ? n2.runtime.events : [], "beforeClick");
171
- let o2;
172
- return i2 && (o2 = z(e2, n2, i2, null, t2)), void 0 === o2 || o2;
173
- }
174
- function D(e2, n2, t2) {
175
- const i2 = e2.code + "_";
176
- m.$emit(i2 + "open-dialog", { pageContext: e2, configureObj: n2, eventParams: t2 });
177
- }
178
- function L(e2, n2) {
179
- return !(!e2.pageType || "list" !== e2.pageType);
180
- }
181
- function _(e2, t2, i2) {
182
- const o2 = t2.runtime && t2.runtime.events ? t2.runtime.events : [], r2 = I(e2, o2, "afterClick");
183
- if (r2) {
184
- const o3 = z(e2, t2, r2, null, i2);
185
- n(o3) ? o3.finally(() => {
186
- e2.canClick = true;
187
- }) : e2.canClick = true;
188
- } else e2.canClick = true;
189
- }
190
- function V(e2, n2, t2, i2, o2, u2) {
191
- i2 ? (e2.result = o2, e2.canClick = true) : r(e2, n2, o2, "", u2);
192
- const c2 = I(e2, n2.runtime && n2.runtime.events ? n2.runtime.events : [], "afterClick");
193
- c2 && z(e2, n2, c2, t2);
194
- }
195
- function q(e2, t2, i2, o2) {
196
- let r2 = t2, u2 = t2.props.linkPage;
197
- if (u2 && u2 instanceof Array) {
198
- const n2 = function(e3) {
199
- let n3 = e3 ? e3.row : null;
200
- n3 || (n3 = e3 && e3.selections && e3.selections.length > 0 ? e3.selections[0] : null);
201
- return n3;
202
- }(o2), i3 = d(e2, t2, u2, n2);
203
- let c2, l2 = false;
204
- i3 && (l2 = i3.show, c2 = l2 ? i3.toPage : null), u2 = c2 ? c2.linkPage : null, u2 && (r2 = g(t2), r2.props.linkPage = u2);
205
- }
206
- u2 && u2.jumpPageUrl ? (e2.canClick = true, D(e2, r2, o2)) : function(e3, t3, i3, o3) {
207
- const r3 = i3;
208
- if (r3) {
209
- const i4 = r3.func, u3 = r3.isStandard, c2 = r3.event, l2 = z(e3, t3, i4, o3), a2 = L(e3);
210
- if (function(e4, n2) {
211
- return e4 && ("exportForm" === n2.eventName || "exportPDF" === n2.eventName || "import" === n2.eventName || "assign" === n2.eventName || "copyTask" === n2.eventName || "addSigner" === n2.eventName || "returnTaskTo" === n2.eventName || "removeSigner" === n2.eventName);
212
- }(u3, c2)) return void (e3.canClick = true);
213
- n(l2) ? l2.then((n2) => {
214
- n2 ? V(e3, t3, o3, u3, n2, a2) : e3.canClick = true;
215
- }).catch((n2) => {
216
- e3.canClick = true;
217
- }) : V(e3, t3, o3, u3, l2, a2);
218
- } else e3.canClick = true;
219
- }(e2, t2, i2, o2);
220
- }
221
- function A(e2, n2) {
222
- const t2 = e2.customEvents;
223
- if (t2 && n2) {
224
- let e3 = "";
225
- return e3 = "object" == typeof n2 ? n2.componentUuid + "_" + n2.name : n2, t2[e3];
226
- }
227
- }
228
- function I(e2, n2, t2) {
229
- if (n2 && t2) {
230
- const o2 = n2.filter((e3) => e3.name === t2);
231
- if (o2 && o2.length > 0) {
232
- const n3 = o2[0];
233
- return n3.isStandard ? i[n3.eventName] : A(e2, n3);
217
+ function doValidateForm(pageContext, configure, eventParams) {
218
+ const events = configure.runtime && configure.runtime.events ? configure.runtime.events : [];
219
+ let isEnableRequired = true;
220
+ console.log("doValidateForm---eventParams=", eventParams);
221
+ if (eventParams == null ? void 0 : eventParams.skipValidate) {
222
+ isEnableRequired = false;
223
+ }
224
+ const clickEventFunObj = getClickEventFuncByType(pageContext, events, "click");
225
+ if (clickEventFunObj) {
226
+ const isStandardEvent = clickEventFunObj.isStandard;
227
+ const event = clickEventFunObj.event;
228
+ const isNotNeedValidate = isNotNeedValidateRequired(isStandardEvent, event);
229
+ if (isNotNeedValidate) {
230
+ isEnableRequired = false;
234
231
  }
235
232
  }
233
+ validateDataModelFunc(pageContext, configure, isEnableRequired).then((validateReslut) => {
234
+ if (!validateReslut) {
235
+ pageContext.canClick = true;
236
+ return;
237
+ }
238
+ const beforeClickResult = doBeforeClickEvent(pageContext, configure, eventParams);
239
+ if (!beforeClickResult) {
240
+ pageContext.canClick = true;
241
+ return;
242
+ }
243
+ if (isPromise(beforeClickResult)) {
244
+ beforeClickResult.then((result) => {
245
+ if (result) {
246
+ doClickEvent(pageContext, configure, clickEventFunObj, eventParams);
247
+ } else {
248
+ pageContext.canClick = true;
249
+ }
250
+ }).catch((error) => {
251
+ console.error(error);
252
+ pageContext.canClick = true;
253
+ });
254
+ } else {
255
+ doClickEvent(pageContext, configure, clickEventFunObj, eventParams);
256
+ }
257
+ }).catch((error) => {
258
+ console.error(error);
259
+ pageContext.canClick = true;
260
+ });
236
261
  }
237
- function B(e2, n2) {
238
- if (e2 && n2) {
239
- const t2 = e2.filter((e3) => e3.name === n2);
240
- if (t2 && t2.length > 0) {
241
- return t2[0].eventName;
262
+ function doSuffixOrPrefixClickEvent($event, pageContext, configure, eventType, otherParams) {
263
+ const eventParams = getDefaultEventParams($event, pageContext, configure, otherParams);
264
+ const events = configure.runtime && configure.runtime.events ? configure.runtime.events : [];
265
+ const clickEventFunObj = getClickEventFuncByType(pageContext, events, eventType);
266
+ doClickEvent(pageContext, configure, clickEventFunObj, eventParams);
267
+ }
268
+ function getDefaultEventParams($event, pageContext, configure, otherParams) {
269
+ const pageCode = pageContext.code;
270
+ const pageVersion = pageContext.version;
271
+ const tableUuid = getTableUuid(pageContext, configure);
272
+ if (tableUuid) {
273
+ const gridRef = getComponentRef(pageContext, tableUuid);
274
+ const selections = gridRef ? gridRef.getSelections() : null;
275
+ const selectionIds = gridRef ? gridRef.getSelectionIds() : null;
276
+ if (!otherParams) {
277
+ otherParams = {};
278
+ }
279
+ otherParams["tableUuid"] = tableUuid;
280
+ otherParams["listCode"] = getListCode(pageCode, pageVersion, tableUuid);
281
+ const isListButton = isListPage(pageContext);
282
+ if (isListButton) {
283
+ otherParams["selections"] = selections;
284
+ otherParams["id"] = selectionIds && selectionIds.length > 0 ? selectionIds[0] : null;
285
+ otherParams["ids"] = selectionIds;
242
286
  }
287
+ const tableConfigure = gridRef ? gridRef.getTableConfigure() : null;
288
+ otherParams["tableConfigure"] = tableConfigure;
289
+ }
290
+ return packageEventParams(pageContext, configure, $event, otherParams);
291
+ }
292
+ function doBeforeClickEvent(pageContext, configure, otherParams) {
293
+ const events = configure.runtime && configure.runtime.events ? configure.runtime.events : [];
294
+ const beforeClickFunc = getEventFuncByType(pageContext, events, "beforeClick");
295
+ let beforeClickResult;
296
+ if (beforeClickFunc) {
297
+ beforeClickResult = callItemEvent(pageContext, configure, beforeClickFunc, null, otherParams);
298
+ }
299
+ if (beforeClickResult === void 0) {
300
+ return true;
301
+ }
302
+ return beforeClickResult;
303
+ }
304
+ function doClickJumpPageEvent(pageContext, configure, eventParams) {
305
+ const myPageCode = pageContext.code;
306
+ const eventPageInfo = myPageCode + "_";
307
+ bus.$emit(eventPageInfo + "open-dialog", {
308
+ pageContext,
309
+ configureObj: configure,
310
+ eventParams
311
+ });
312
+ }
313
+ function isListPage(pageContext, configure) {
314
+ return pageContext.pageType && pageContext.pageType === "list" ? true : false;
315
+ }
316
+ function doClickCustomEvent(pageContext, configure, clickEventFuncObj, eventParams) {
317
+ const eventFunObj = clickEventFuncObj;
318
+ if (eventFunObj) {
319
+ const eventFun = eventFunObj["func"];
320
+ const isStandardEvent = eventFunObj["isStandard"];
321
+ const event = eventFunObj["event"];
322
+ const clickResult = callItemEvent(pageContext, configure, eventFun, eventParams);
323
+ const isListButton = isListPage(pageContext);
324
+ if (isNotDoAfterClick(isStandardEvent, event)) {
325
+ pageContext.canClick = true;
326
+ return;
327
+ }
328
+ if (isPromise(clickResult)) {
329
+ clickResult.then((result) => {
330
+ if (result) {
331
+ doAfterClickFunc(
332
+ pageContext,
333
+ configure,
334
+ eventParams,
335
+ isStandardEvent,
336
+ result,
337
+ isListButton
338
+ );
339
+ } else {
340
+ pageContext.canClick = true;
341
+ }
342
+ }).catch((error) => {
343
+ console.error(error);
344
+ pageContext.canClick = true;
345
+ });
346
+ } else {
347
+ doAfterClickFunc(
348
+ pageContext,
349
+ configure,
350
+ eventParams,
351
+ isStandardEvent,
352
+ clickResult,
353
+ isListButton
354
+ );
355
+ }
356
+ } else {
357
+ pageContext.canClick = true;
243
358
  }
244
359
  }
245
- function $(e2, n2, t2) {
246
- if (n2 && t2) {
247
- const o2 = n2.filter((e3) => e3.name === t2);
248
- if (o2 && o2.length > 0) {
249
- const n3 = o2[0];
250
- return n3.isStandard ? { func: i[n3.eventName], isStandard: true, event: n3 } : { func: A(e2, n3), isStandard: false, event: n3 };
360
+ function isNotDoAfterClick(isStandardEvent, clickEvent) {
361
+ return isStandardEvent && (clickEvent.eventName === "exportForm" || clickEvent.eventName === "exportPDF" || clickEvent.eventName === "import" || clickEvent.eventName === "assign" || clickEvent.eventName === "copyTask" || clickEvent.eventName === "addSigner" || clickEvent.eventName === "returnTaskTo" || clickEvent.eventName === "removeSigner");
362
+ }
363
+ function isNotNeedValidateRequired(isStandardEvent, clickEvent) {
364
+ return isStandardEvent && skipValidateEvents.includes(clickEvent.eventName);
365
+ }
366
+ function doAfterClickEvent(pageContext, configure, otherParams) {
367
+ const events = configure.runtime && configure.runtime.events ? configure.runtime.events : [];
368
+ const afterClickFunc = getEventFuncByType(pageContext, events, "afterClick");
369
+ if (afterClickFunc) {
370
+ const afterFunc = callItemEvent(pageContext, configure, afterClickFunc, null, otherParams);
371
+ if (isPromise(afterFunc)) {
372
+ afterFunc.finally(() => {
373
+ pageContext.canClick = true;
374
+ });
375
+ } else {
376
+ pageContext.canClick = true;
251
377
  }
378
+ } else {
379
+ pageContext.canClick = true;
380
+ }
381
+ }
382
+ function doAfterClickFunc(pageContext, configure, eventParams, isStandardEvent, result, isListButton) {
383
+ if (!isStandardEvent) {
384
+ dealAfterOperate(
385
+ pageContext,
386
+ configure,
387
+ result,
388
+ "",
389
+ // superPageRuntimeMessage.successfulOperation 开发人员自己加事件
390
+ isListButton
391
+ );
392
+ } else {
393
+ pageContext.result = result;
394
+ pageContext.canClick = true;
395
+ }
396
+ const events = configure.runtime && configure.runtime.events ? configure.runtime.events : [];
397
+ const afterClickFunc = getEventFuncByType(pageContext, events, "afterClick");
398
+ if (afterClickFunc) {
399
+ callItemEvent(pageContext, configure, afterClickFunc, eventParams);
400
+ }
401
+ }
402
+ function doClickEvent(pageContext, configure, clickEventFunObj, eventParams) {
403
+ let configureObj = configure;
404
+ let linkPage = configure.props.linkPage;
405
+ if (linkPage && linkPage instanceof Array) {
406
+ const row = getRowData(eventParams);
407
+ const result = expressJump(pageContext, configure, linkPage, row);
408
+ let show = false;
409
+ let toLinkPage;
410
+ if (result) {
411
+ show = result.show;
412
+ toLinkPage = show ? result.toPage : null;
413
+ }
414
+ linkPage = toLinkPage ? toLinkPage.linkPage : null;
415
+ if (linkPage) {
416
+ configureObj = deepCopy(configure);
417
+ configureObj.props.linkPage = linkPage;
418
+ }
419
+ }
420
+ if (linkPage && linkPage.jumpPageUrl) {
421
+ pageContext.canClick = true;
422
+ doClickJumpPageEvent(pageContext, configureObj, eventParams);
423
+ } else {
424
+ doClickCustomEvent(pageContext, configure, clickEventFunObj, eventParams);
252
425
  }
253
426
  }
254
- function z(e2, n2, t2, i2, o2) {
255
- if (t2) {
256
- if (i2 || (i2 = { pageContext: e2, configureObj: n2 }), o2 && i2) for (const e3 in o2) i2[e3] = o2[e3];
257
- return t2.apply(t2, [i2]);
258
- }
259
- }
260
- function H(e2) {
261
- const n2 = e2.pageContext, i2 = e2.configureObj, o2 = L(n2);
262
- let r2 = [];
263
- if (o2) n2.editData ? r2.push(n2.editData) : r2 = e2.selections;
264
- else {
265
- const e3 = n2.entity.data;
266
- r2.push(e3);
267
- }
268
- const u2 = i2.props.base.condition;
269
- return new Promise((e3, i3) => {
270
- if (void 0 === u2 || "" === u2 || void 0 === r2 || 0 === r2.length) e3({ canExecute: true });
271
- else {
272
- const i4 = n2.entity.context, o3 = t(n2), c2 = true, l2 = n2.tableName;
273
- let f2, g2, m2 = true;
274
- for (let e4 = 0; e4 < r2.length; e4++) {
275
- const t2 = r2[e4];
276
- for (let e5 = 0; e5 < u2.length; e5++) {
277
- const r3 = u2[e5], a2 = r3.toolTips, p2 = r3.conditionList;
278
- if (!s(p2, t2, o3, i4, c2, l2, null, n2)) {
279
- m2 = false, f2 = a2, g2 = t2;
427
+ function getRowData(eventParams) {
428
+ let row = eventParams ? eventParams.row : null;
429
+ if (!row) {
430
+ row = eventParams && eventParams.selections && eventParams.selections.length > 0 ? eventParams.selections[0] : null;
431
+ }
432
+ return row;
433
+ }
434
+ function getEventByEventName(pageContext, eventObj) {
435
+ const eventsObj = pageContext.customEvents;
436
+ if (eventsObj && eventObj) {
437
+ let key = "";
438
+ if (typeof eventObj === "object") {
439
+ key = eventObj.componentUuid + "_" + eventObj.name;
440
+ } else {
441
+ key = eventObj;
442
+ }
443
+ return eventsObj[key];
444
+ }
445
+ }
446
+ function getEventFuncByType(pageContext, events, eventType) {
447
+ if (events && eventType) {
448
+ const eventArr = events.filter((item) => item.name === eventType);
449
+ if (eventArr && eventArr.length > 0) {
450
+ const event = eventArr[0];
451
+ if (event.isStandard) {
452
+ return standardEvents[event.eventName];
453
+ } else {
454
+ return getEventByEventName(pageContext, event);
455
+ }
456
+ }
457
+ }
458
+ }
459
+ function getEventNameByType(events, eventType) {
460
+ if (events && eventType) {
461
+ const eventArr = events.filter((item) => item.name === eventType);
462
+ if (eventArr && eventArr.length > 0) {
463
+ const event = eventArr[0];
464
+ return event.eventName;
465
+ }
466
+ }
467
+ }
468
+ function getClickEventFuncByType(pageContext, events, eventType) {
469
+ if (events && eventType) {
470
+ const eventArr = events.filter((item) => item.name === eventType);
471
+ if (eventArr && eventArr.length > 0) {
472
+ const event = eventArr[0];
473
+ if (event.isStandard) {
474
+ return { func: standardEvents[event.eventName], isStandard: true, event };
475
+ } else {
476
+ return {
477
+ func: getEventByEventName(pageContext, event),
478
+ isStandard: false,
479
+ event
480
+ };
481
+ }
482
+ }
483
+ }
484
+ }
485
+ function callItemEvent(pageContext, configureObj, eventFun, eventParams, otherParams) {
486
+ if (!eventFun) {
487
+ return;
488
+ }
489
+ if (!eventParams) {
490
+ eventParams = {
491
+ pageContext,
492
+ configureObj
493
+ // 组件配置信息,包含如:跳转页面配置、判重配置等
494
+ };
495
+ }
496
+ if (otherParams && eventParams) {
497
+ for (const key in otherParams) {
498
+ eventParams[key] = otherParams[key];
499
+ }
500
+ }
501
+ return eventFun.apply(eventFun, [eventParams]);
502
+ }
503
+ function transferToFunction(customEvents) {
504
+ const eventsObj = {};
505
+ customEvents.forEach((event) => {
506
+ if (!event.isStandard && event.jsContent) {
507
+ if (event.name === "customFunc") {
508
+ let newFunc = null;
509
+ if (event.funcParam) {
510
+ const args = event.funcParam.split(",");
511
+ newFunc = new Function(args, event.jsContent);
512
+ } else {
513
+ newFunc = new Function(event.jsContent);
514
+ }
515
+ eventsObj[event.eventName] = newFunc;
516
+ } else {
517
+ let key = event.componentUuid + "_";
518
+ key += event.name;
519
+ eventsObj[key] = new Function("params", event.jsContent);
520
+ }
521
+ }
522
+ });
523
+ return eventsObj;
524
+ }
525
+ function canExecuteButton(params) {
526
+ const pageContext = params.pageContext;
527
+ const configureObj = params.configureObj;
528
+ const isListButton = isListPage(pageContext);
529
+ let entities = [];
530
+ if (isListButton) {
531
+ if (pageContext.editData) {
532
+ entities.push(pageContext.editData);
533
+ } else {
534
+ entities = params.selections;
535
+ }
536
+ } else {
537
+ const dataModel = pageContext.entity.data;
538
+ entities.push(dataModel);
539
+ }
540
+ const executableDataSetting = configureObj.props.base.condition;
541
+ return new Promise((resolve, reject) => {
542
+ if (executableDataSetting === void 0 || executableDataSetting === "" || entities === void 0 || entities.length === 0) {
543
+ resolve({
544
+ canExecute: true
545
+ });
546
+ } else {
547
+ const contextParameter = pageContext.entity.context;
548
+ const additionalParamMap = getAdditionalParamMap(pageContext);
549
+ const isSql = true;
550
+ const tableName = pageContext.tableName;
551
+ let isCanExecute = true;
552
+ let failMessage;
553
+ let failEntity;
554
+ for (let i = 0; i < entities.length; i++) {
555
+ const entity = entities[i];
556
+ for (let n = 0; n < executableDataSetting.length; n++) {
557
+ const conditionSetting = executableDataSetting[n];
558
+ const message = conditionSetting.toolTips;
559
+ const conditionList = conditionSetting.conditionList;
560
+ const canExecute = analysisCondition(
561
+ conditionList,
562
+ entity,
563
+ additionalParamMap,
564
+ contextParameter,
565
+ isSql,
566
+ tableName,
567
+ null,
568
+ pageContext
569
+ );
570
+ if (!canExecute) {
571
+ isCanExecute = false;
572
+ failMessage = message;
573
+ failEntity = entity;
280
574
  break;
281
575
  }
282
576
  }
283
577
  }
284
- m2 ? e3({ canExecute: true }) : (f2 && a({ showClose: true, type: "warning", message: f2 }), e3({ canExecute: false, message: f2, failEntity: g2 }));
578
+ if (!isCanExecute) {
579
+ if (failMessage) {
580
+ ElMessage({
581
+ showClose: true,
582
+ type: "warning",
583
+ message: failMessage
584
+ });
585
+ }
586
+ resolve({
587
+ canExecute: false,
588
+ message: failMessage,
589
+ failEntity
590
+ });
591
+ } else {
592
+ resolve({
593
+ canExecute: true
594
+ });
595
+ }
285
596
  }
286
597
  });
287
598
  }
288
- function W(e2, n2, t2, i2) {
289
- var o2;
290
- n2 && (G("loadBeforeSend", w(null, (o2 = { pageContext: t2, configureObj: i2 }).pageContext, o2.configureObj, "beforeListLoad", o2), e2), G("beforeRequest", function(e3) {
291
- return w(null, e3.pageContext, e3.configureObj, "beforeRequest", e3);
292
- }({ pageContext: t2, configureObj: i2 }), e2), G("gridDataLoaded", function(e3) {
293
- return w(null, e3.pageContext, e3.configureObj, "onListLoad", e3);
294
- }({ pageContext: t2, configureObj: i2 }), e2), G("gridComplete", function(e3) {
295
- return w(null, e3.pageContext, e3.configureObj, "afterListLoad", e3);
296
- }({ pageContext: t2, configureObj: i2 }), e2), G("resizeHeight", function(e3) {
297
- return w(null, e3.pageContext, e3.configureObj, "resizeTableHeight", e3);
298
- }({ pageContext: t2, configureObj: i2 }), e2), e2.lineEditOptions || (e2.lineEditOptions = {}), G("beforeInsertRow", function(e3) {
299
- return w(null, e3.pageContext, e3.configureObj, "beforeAddRow", e3);
300
- }({ pageContext: t2, configureObj: i2 }), e2.lineEditOptions), G("afterInsertRow", function(e3) {
301
- return w(null, e3.pageContext, e3.configureObj, "afterAddRow", e3);
302
- }({ pageContext: t2, configureObj: i2 }), e2.lineEditOptions), G("beforeDelete", function(e3) {
303
- return w(null, e3.pageContext, e3.configureObj, "beforeRemoveRow", e3);
304
- }({ pageContext: t2, configureObj: i2 }), e2.lineEditOptions), G("afterDelete", function(e3) {
305
- return w(null, e3.pageContext, e3.configureObj, "afterRemoveRow", e3);
306
- }({ pageContext: t2, configureObj: i2 }), e2.lineEditOptions), G("beforeEdit", function(e3) {
307
- return w(null, e3.pageContext, e3.configureObj, "beforeEdit", e3);
308
- }({ pageContext: t2, configureObj: i2 }), e2.lineEditOptions), G("beforeRestore", function(e3) {
309
- return w(null, e3.pageContext, e3.configureObj, "beforeRestore", e3);
310
- }({ pageContext: t2, configureObj: i2 }), e2.lineEditOptions), G("beforeRestoreValidate", function(e3) {
311
- return w(null, e3.pageContext, e3.configureObj, "beforeRestoreValidate", e3);
312
- }({ pageContext: t2, configureObj: i2 }), e2.lineEditOptions), function(e3, n3, t3) {
313
- n3 && (t3[e3] = n3);
314
- }("filterDataEvent", w(null, t2, i2, "filter-data", { pageContext: t2, configureObj: i2 }), e2));
315
- }
316
- function G(e2, n2, t2) {
317
- n2 && (t2[e2] = n2);
318
- }
319
- function J(e2, n2, t2) {
320
- return h(null, e2, n2, "select", t2);
321
- }
322
- function K(e2, n2, t2) {
323
- return h(null, e2, n2, "select-all", t2);
324
- }
325
- function M(e2, n2, t2) {
326
- return h(null, e2, n2, "selection-change", t2);
327
- }
328
- function Q(e2, n2, t2) {
329
- return h(null, e2, n2, "cell-click", t2);
330
- }
331
- function X(e2, n2, t2) {
332
- return h(null, e2, n2, "cell-dblclick", t2);
333
- }
334
- function Y(e2, n2, t2) {
335
- return h(null, e2, n2, "row-click", t2);
336
- }
337
- function Z(e2, n2, t2) {
338
- return h(null, e2, n2, "row-dblclick", t2);
339
- }
340
- function ee(e2, n2, t2) {
341
- return h(null, e2, n2, "header-click", t2);
342
- }
343
- function ne(e2) {
344
- return w(null, e2.pageContext, e2.configureObj, "before-upload", e2);
345
- }
346
- function te(n2) {
347
- let t2 = true;
348
- if (!e()) {
349
- const e2 = n2 && n2.events ? n2.events : [];
350
- if (e2) {
351
- const n3 = e2.filter((e3) => "click" === e3.name && e3.isStandard && e3.eventName && "showSearch" === e3.eventName);
352
- n3 && n3.length > 0 && (t2 = false);
599
+ function setTableEvents(options, tableEvents, pageContext, configureObj) {
600
+ if (tableEvents) {
601
+ addTableEvent("loadBeforeSend", loadBeforeSend({ pageContext, configureObj }), options);
602
+ addTableEvent("beforeRequest", beforeRequest({ pageContext, configureObj }), options);
603
+ addTableEvent("gridDataLoaded", gridDataLoaded({ pageContext, configureObj }), options);
604
+ addTableEvent("gridComplete", gridComplete({ pageContext, configureObj }), options);
605
+ addTableEvent("resizeHeight", resizeTableHeight({ pageContext, configureObj }), options);
606
+ if (!options["lineEditOptions"]) {
607
+ options["lineEditOptions"] = {};
353
608
  }
609
+ addTableEvent(
610
+ "beforeInsertRow",
611
+ gridBeforeInsertRow({ pageContext, configureObj }),
612
+ options["lineEditOptions"]
613
+ );
614
+ addTableEvent(
615
+ "afterInsertRow",
616
+ gridAfterInsertRow({ pageContext, configureObj }),
617
+ options["lineEditOptions"]
618
+ );
619
+ addTableEvent(
620
+ "beforeDelete",
621
+ gridBeforeRemoveRow({ pageContext, configureObj }),
622
+ options["lineEditOptions"]
623
+ );
624
+ addTableEvent(
625
+ "afterDelete",
626
+ gridAfterRemoveRow({ pageContext, configureObj }),
627
+ options["lineEditOptions"]
628
+ );
629
+ addTableEvent(
630
+ "beforeEdit",
631
+ gridBeforeEdit({ pageContext, configureObj }),
632
+ options["lineEditOptions"]
633
+ );
634
+ addTableEvent(
635
+ "beforeRestore",
636
+ beforeRestore({ pageContext, configureObj }),
637
+ options["lineEditOptions"]
638
+ );
639
+ addTableEvent(
640
+ "beforeRestoreValidate",
641
+ beforeRestoreValidate({ pageContext, configureObj }),
642
+ options["lineEditOptions"]
643
+ );
644
+ filterDataEvent(
645
+ "filterDataEvent",
646
+ getHandleEvent(null, pageContext, configureObj, "filter-data", {
647
+ pageContext,
648
+ configureObj
649
+ }),
650
+ options
651
+ );
652
+ }
653
+ }
654
+ function filterDataEvent(gridEventType, eventFunc, options) {
655
+ if (eventFunc) {
656
+ options[gridEventType] = eventFunc;
657
+ }
658
+ }
659
+ function addTableEvent(gridEventType, eventFunc, options) {
660
+ if (eventFunc) {
661
+ options[gridEventType] = eventFunc;
354
662
  }
355
- return t2;
356
663
  }
357
- function ie(e2, n2, t2, i2, o2) {
358
- return z(e2, n2, I(e2, n2 && n2.runtime && n2.runtime.events ? n2.runtime.events : [], t2), { configure: n2, pageContext: e2, chartOption: i2, ...o2 });
664
+ function loadBeforeSend(params) {
665
+ return getHandleEvent(null, params.pageContext, params.configureObj, "beforeListLoad", params);
666
+ }
667
+ function beforeRequest(params) {
668
+ return getHandleEvent(null, params.pageContext, params.configureObj, "beforeRequest", params);
669
+ }
670
+ function gridDataLoaded(params) {
671
+ return getHandleEvent(null, params.pageContext, params.configureObj, "onListLoad", params);
672
+ }
673
+ function gridComplete(params) {
674
+ return getHandleEvent(null, params.pageContext, params.configureObj, "afterListLoad", params);
675
+ }
676
+ function resizeTableHeight(params) {
677
+ return getHandleEvent(null, params.pageContext, params.configureObj, "resizeTableHeight", params);
678
+ }
679
+ function beforeRestoreValidate(params) {
680
+ return getHandleEvent(
681
+ null,
682
+ params.pageContext,
683
+ params.configureObj,
684
+ "beforeRestoreValidate",
685
+ params
686
+ );
687
+ }
688
+ function beforeRestore(params) {
689
+ return getHandleEvent(null, params.pageContext, params.configureObj, "beforeRestore", params);
690
+ }
691
+ function gridBeforeEdit(params) {
692
+ return getHandleEvent(null, params.pageContext, params.configureObj, "beforeEdit", params);
693
+ }
694
+ function gridBeforeInsertRow(params) {
695
+ return getHandleEvent(null, params.pageContext, params.configureObj, "beforeAddRow", params);
696
+ }
697
+ function gridAfterInsertRow(params) {
698
+ return getHandleEvent(null, params.pageContext, params.configureObj, "afterAddRow", params);
699
+ }
700
+ function gridBeforeRemoveRow(params) {
701
+ return getHandleEvent(null, params.pageContext, params.configureObj, "beforeRemoveRow", params);
702
+ }
703
+ function gridAfterRemoveRow(params) {
704
+ return getHandleEvent(null, params.pageContext, params.configureObj, "afterRemoveRow", params);
705
+ }
706
+ function gridSelectRecord(pageContext, configureObj, params) {
707
+ return handleEvent(null, pageContext, configureObj, "select", params);
708
+ }
709
+ function gridSelectAllRecords(pageContext, configureObj, params) {
710
+ return handleEvent(null, pageContext, configureObj, "select-all", params);
711
+ }
712
+ function gridSelectionChange(pageContext, configureObj, params) {
713
+ return handleEvent(null, pageContext, configureObj, "selection-change", params);
714
+ }
715
+ function cellClick(pageContext, configureObj, params) {
716
+ return handleEvent(null, pageContext, configureObj, "cell-click", params);
359
717
  }
360
- function oe(n2, t2) {
361
- let i2 = true;
362
- if (e()) {
363
- const e2 = $(n2, t2 && t2.runtime && t2.runtime.events ? t2.runtime.events : [], "click");
364
- if (e2) {
365
- const n3 = e2.isStandard, t3 = e2.event, o2 = navigator ? navigator.userAgent : null;
366
- n3 && o2 && (o2.indexOf(" uni-app ") > 0 ? (b.includes(t3.eventName) || C.includes(t3.eventName)) && (i2 = false) : C.includes(t3.eventName) && (i2 = false));
718
+ function cellDblClick(pageContext, configureObj, params) {
719
+ return handleEvent(null, pageContext, configureObj, "cell-dblclick", params);
720
+ }
721
+ function rowClick(pageContext, configureObj, params) {
722
+ return handleEvent(null, pageContext, configureObj, "row-click", params);
723
+ }
724
+ function rowDblClick(pageContext, configureObj, params) {
725
+ return handleEvent(null, pageContext, configureObj, "row-dblclick", params);
726
+ }
727
+ function headerClick(pageContext, configureObj, params) {
728
+ return handleEvent(null, pageContext, configureObj, "header-click", params);
729
+ }
730
+ function fileUploadBeforeUpload(params) {
731
+ return getHandleEvent(null, params.pageContext, params.configureObj, "before-upload", params);
732
+ }
733
+ function isShowComponent(configure) {
734
+ let isShow = true;
735
+ const isMobile = isMobileBrowser();
736
+ if (!isMobile) {
737
+ const events = configure && configure.events ? configure.events : [];
738
+ if (events) {
739
+ const eventArr = events.filter(
740
+ (item) => item.name === "click" && item.isStandard && item.eventName && item.eventName === "showSearch"
741
+ );
742
+ if (eventArr && eventArr.length > 0) {
743
+ isShow = false;
744
+ }
745
+ }
746
+ }
747
+ return isShow;
748
+ }
749
+ function handleChartEvent(pageContext, configure, eventType, chartOption, otherParams) {
750
+ const events = configure && configure.runtime && configure.runtime.events ? configure.runtime.events : [];
751
+ const eventFun = getEventFuncByType(pageContext, events, eventType);
752
+ return callItemEvent(pageContext, configure, eventFun, {
753
+ configure,
754
+ pageContext,
755
+ chartOption,
756
+ ...otherParams
757
+ });
758
+ }
759
+ function isShowMobileEvent(pageContext, configure) {
760
+ let isShow = true;
761
+ const isMobile = isMobileBrowser();
762
+ if (isMobile) {
763
+ const events = configure && configure.runtime && configure.runtime.events ? configure.runtime.events : [];
764
+ const clickEventFunObj = getClickEventFuncByType(pageContext, events, "click");
765
+ if (clickEventFunObj) {
766
+ const isStandardEvent = clickEventFunObj.isStandard;
767
+ const event = clickEventFunObj.event;
768
+ const userAgentOrg = navigator ? navigator.userAgent : null;
769
+ if (isStandardEvent && userAgentOrg) {
770
+ if (userAgentOrg.indexOf(" uni-app ") > 0) {
771
+ if (exportEvents.includes(event.eventName) || importEvents.includes(event.eventName)) {
772
+ isShow = false;
773
+ }
774
+ } else {
775
+ if (importEvents.includes(event.eventName)) {
776
+ isShow = false;
777
+ }
778
+ }
779
+ }
367
780
  }
368
781
  }
369
- return i2;
782
+ return isShow;
370
783
  }
371
784
  export {
372
- j as appendDefaultMethods,
373
- H as canExecuteButton,
374
- Q as cellClick,
375
- X as cellDblClick,
376
- _ as doAfterClickEvent,
377
- U as doBeforeClickEvent,
378
- D as doClickJumpPageEvent,
379
- F as doSuffixOrPrefixClickEvent,
380
- ne as fileUploadBeforeUpload,
381
- $ as getClickEventFuncByType,
382
- k as getCustomFunc,
383
- I as getEventFuncByType,
384
- B as getEventNameByType,
385
- w as getHandleEvent,
386
- S as getTableUuid,
387
- K as gridSelectAllRecords,
388
- J as gridSelectRecord,
389
- M as gridSelectionChange,
390
- y as handleAfterInitEvent,
391
- ie as handleChartEvent,
392
- h as handleEvent,
393
- E as handleFormEvent,
394
- ee as headerClick,
395
- x as initPageEvents,
396
- te as isShowComponent,
397
- oe as isShowMobileEvent,
398
- O as removeCustomFuncFromWindow,
399
- Y as rowClick,
400
- Z as rowDblClick,
401
- W as setTableEvents
785
+ appendDefaultMethods,
786
+ canExecuteButton,
787
+ cellClick,
788
+ cellDblClick,
789
+ doAfterClickEvent,
790
+ doBeforeClickEvent,
791
+ doClickJumpPageEvent,
792
+ doSuffixOrPrefixClickEvent,
793
+ fileUploadBeforeUpload,
794
+ getClickEventFuncByType,
795
+ getCustomFunc,
796
+ getEventFuncByType,
797
+ getEventNameByType,
798
+ getHandleEvent,
799
+ getTableUuid,
800
+ gridSelectAllRecords,
801
+ gridSelectRecord,
802
+ gridSelectionChange,
803
+ handleAfterInitEvent,
804
+ handleChartEvent,
805
+ handleEvent,
806
+ handleFormEvent,
807
+ headerClick,
808
+ initPageEvents,
809
+ isShowComponent,
810
+ isShowMobileEvent,
811
+ removeCustomFuncFromWindow,
812
+ rowClick,
813
+ rowDblClick,
814
+ setTableEvents
402
815
  };