super-page-runtime 2.1.933 → 2.2.1

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 (183) hide show
  1. package/dist/es/_virtual/_plugin-vue_export-helper.js +5 -7
  2. package/dist/es/assets/chart-themes/theme1.js +2 -6
  3. package/dist/es/assets/chart-themes/theme2.js +2 -6
  4. package/dist/es/assets/chart-themes/theme3.js +2 -6
  5. package/dist/es/components/runtime/index.d.ts +2 -1
  6. package/dist/es/components/runtime/utils/api/api-util.js +4 -7
  7. package/dist/es/components/runtime/utils/api/page-expose-util.js +137 -435
  8. package/dist/es/components/runtime/utils/assemblys-config.js +11 -367
  9. package/dist/es/components/runtime/utils/barcode-util.js +9 -33
  10. package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +122 -306
  11. package/dist/es/components/runtime/utils/charts/chart-gauge-util.js +29 -68
  12. package/dist/es/components/runtime/utils/charts/chart-pie-util.js +68 -152
  13. package/dist/es/components/runtime/utils/charts/chart-radar-util.js +46 -124
  14. package/dist/es/components/runtime/utils/charts/chart-scatter-util.js +36 -99
  15. package/dist/es/components/runtime/utils/charts/chart-util.d.ts +1 -0
  16. package/dist/es/components/runtime/utils/charts/chart-util.js +226 -485
  17. package/dist/es/components/runtime/utils/common-util.js +76 -153
  18. package/dist/es/components/runtime/utils/eventBus.js +3 -9
  19. package/dist/es/components/runtime/utils/events/event-util.js +343 -727
  20. package/dist/es/components/runtime/utils/events/print-label.js +72 -140
  21. package/dist/es/components/runtime/utils/events/standard-event.d.ts +2 -2
  22. package/dist/es/components/runtime/utils/events/standard-event.js +810 -2299
  23. package/dist/es/components/runtime/utils/events/validator-util.js +222 -552
  24. package/dist/es/components/runtime/utils/form/date-shortcuts.js +28 -88
  25. package/dist/es/components/runtime/utils/form/scan-util.js +61 -162
  26. package/dist/es/components/runtime/utils/global-refs.js +53 -84
  27. package/dist/es/components/runtime/utils/i18n-util.js +11 -20
  28. package/dist/es/components/runtime/utils/interfaces/page-design-types.d.ts +2 -0
  29. package/dist/es/components/runtime/utils/interfaces/page-design-types.js +2 -7
  30. package/dist/es/components/runtime/utils/page-helper-util.js +278 -658
  31. package/dist/es/components/runtime/utils/page-init-util.d.ts +6 -1
  32. package/dist/es/components/runtime/utils/page-init-util.js +132 -370
  33. package/dist/es/components/runtime/utils/page-permission-util.js +22 -531
  34. package/dist/es/components/runtime/utils/page-store.d.ts +2 -2
  35. package/dist/es/components/runtime/utils/page-store.js +8 -12
  36. package/dist/es/components/runtime/utils/store-util.js +9 -13
  37. package/dist/es/components/runtime/utils/store.js +2 -2
  38. package/dist/es/components/runtime/utils/table-utils.js +45 -84
  39. package/dist/es/components/runtime/utils/tree-utils.js +17 -37
  40. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue.js +2 -2
  41. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +19 -75
  42. package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue.js +2 -2
  43. package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue2.js +14 -46
  44. package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue.js +2 -2
  45. package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +36 -132
  46. package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue.js +2 -2
  47. package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue2.js +4 -18
  48. package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue.js +2 -2
  49. package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue2.js +17 -107
  50. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue.js +2 -2
  51. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +50 -198
  52. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue.js +12 -42
  53. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue2.js +2 -2
  54. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue.js +7 -60
  55. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue2.js +2 -2
  56. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue.js +52 -169
  57. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue2.js +2 -2
  58. package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue.js +44 -0
  59. package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue2.js +4 -0
  60. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue.js +2 -2
  61. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +32 -107
  62. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue.js +2 -2
  63. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +43 -164
  64. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue.js +2 -2
  65. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +32 -115
  66. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue.js +2 -2
  67. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +32 -116
  68. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.d.ts +34 -1
  69. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +253 -449
  70. package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue.js +4 -42
  71. package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue2.js +2 -2
  72. package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue.js +8 -62
  73. package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue2.js +2 -2
  74. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +37 -231
  75. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue2.js +2 -2
  76. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue.js +13 -62
  77. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue2.js +2 -2
  78. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue.js +2 -2
  79. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +197 -510
  80. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.d.ts +4 -4
  81. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +29 -139
  82. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue2.js +2 -2
  83. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue.d.ts +6 -6
  84. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue.js +21 -125
  85. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue2.js +2 -2
  86. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue.d.ts +6 -6
  87. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue.js +16 -102
  88. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue2.js +2 -2
  89. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue.js +2 -2
  90. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue2.js +18 -81
  91. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue.js +2 -2
  92. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue2.js +17 -82
  93. package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue.js +2 -2
  94. package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue2.js +14 -86
  95. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue.js +2 -2
  96. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +21 -79
  97. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue.js +2 -2
  98. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue2.js +16 -61
  99. package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue.js +2 -2
  100. package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue2.js +10 -37
  101. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue.js +2 -2
  102. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +38 -127
  103. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue.js +2 -2
  104. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +28 -76
  105. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue.js +2 -2
  106. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +61 -178
  107. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +302 -803
  108. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue2.js +2 -2
  109. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +249 -594
  110. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue2.js +2 -2
  111. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue.js +2 -2
  112. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +40 -115
  113. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue.js +2 -2
  114. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +56 -215
  115. package/dist/es/components/runtime/views/assemblys/error-render.vue.d.ts +4 -4
  116. package/dist/es/components/runtime/views/assemblys/error-render.vue.js +3 -21
  117. package/dist/es/components/runtime/views/assemblys/error-render.vue2.js +2 -2
  118. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue.js +2 -2
  119. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +42 -154
  120. package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue.js +34 -98
  121. package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue2.js +2 -2
  122. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue.js +2 -2
  123. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +52 -200
  124. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue.js +2 -2
  125. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +66 -239
  126. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue.js +2 -2
  127. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +31 -104
  128. package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue.js +2 -2
  129. package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue2.js +21 -59
  130. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue.js +2 -2
  131. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +51 -173
  132. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue.js +2 -2
  133. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +22 -103
  134. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue.js +2 -2
  135. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +57 -249
  136. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue.js +2 -2
  137. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +32 -174
  138. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue.js +2 -2
  139. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +28 -107
  140. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +4 -4
  141. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue2.js +13 -50
  142. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue.js +2 -2
  143. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +61 -189
  144. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue.js +2 -2
  145. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +87 -244
  146. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue.js +2 -2
  147. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +77 -261
  148. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue.js +2 -2
  149. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue2.js +13 -57
  150. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue.js +2 -2
  151. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +30 -155
  152. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue.js +2 -2
  153. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +40 -129
  154. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue.js +2 -2
  155. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +22 -107
  156. package/dist/es/components/runtime/views/assemblys/home-chart-render.vue.d.ts +17 -0
  157. package/dist/es/components/runtime/views/assemblys/home-chart-render.vue.js +97 -0
  158. package/dist/es/components/runtime/views/assemblys/home-chart-render.vue2.js +4 -0
  159. package/dist/es/components/runtime/views/assemblys/object-render.vue.d.ts +1 -1
  160. package/dist/es/components/runtime/views/assemblys/object-render.vue.js +125 -254
  161. package/dist/es/components/runtime/views/assemblys/object-render.vue2.js +2 -2
  162. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue.js +2 -2
  163. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue2.js +18 -46
  164. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue.js +2 -2
  165. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue2.js +21 -49
  166. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue.js +2 -2
  167. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +20 -58
  168. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue.js +2 -2
  169. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue2.js +16 -53
  170. package/dist/es/components/runtime/views/home-chart.vue.d.ts +23 -0
  171. package/dist/es/components/runtime/views/home-chart.vue.js +36 -0
  172. package/dist/es/components/runtime/views/home-chart.vue2.js +4 -0
  173. package/dist/es/components/runtime/views/super-page-dialog.vue.d.ts +3 -3
  174. package/dist/es/components/runtime/views/super-page-dialog.vue.js +20 -134
  175. package/dist/es/components/runtime/views/super-page-dialog.vue2.js +2 -2
  176. package/dist/es/components/runtime/views/super-page.vue.d.ts +15 -6
  177. package/dist/es/components/runtime/views/super-page.vue.js +222 -708
  178. package/dist/es/components/runtime/views/super-page.vue2.js +2 -2
  179. package/dist/es/i18n/langs/cn.js +2 -55
  180. package/dist/es/i18n/langs/en.js +2 -55
  181. package/dist/es/index.d.ts +2 -2
  182. package/dist/es/index.js +6 -4
  183. package/package.json +3 -2
@@ -4,715 +4,335 @@ import { executeExpression } from "agilebuilder-ui/src/utils/calculator/calculat
4
4
  import { getComponentRef } from "./global-refs.js";
5
5
  import { watch } from "vue";
6
6
  import { deepCopy, getBaseUrl } from "./common-util.js";
7
- function getComponentOptionConfigs(component, pageContext2) {
8
- if (!component.props || !component.props.dataOrigin) {
9
- return;
10
- }
11
- if (component.name && component.name === "table") {
12
- return;
13
- }
14
- const dataOriginInfo = component.props.dataOrigin;
15
- const infoObj = {
16
- uuid: component.uuid
17
- };
18
- if (dataOriginInfo.optionValueSetType == "optionGroup") {
19
- infoObj.type = "optionGroup";
20
- infoObj.props = {
21
- code: dataOriginInfo.optionGroup
22
- };
23
- } else if (dataOriginInfo.optionValueSetType == "dynamicData") {
24
- infoObj.type = "dynamicData";
25
- infoObj.filterType = dataOriginInfo.filterType;
26
- infoObj.props = {
27
- code: dataOriginInfo.dynamicDataSourceCode
28
- };
29
- } else if (dataOriginInfo.optionValueSetType == "dataTable") {
30
- infoObj.filterType = dataOriginInfo.filterType;
31
- const tempObj = getTableQueryInfo(dataOriginInfo, pageContext2);
32
- Object.assign(infoObj, tempObj);
33
- } else if (dataOriginInfo.optionValueSetType == "service") {
34
- infoObj.filterType = dataOriginInfo.filterType;
35
- const tempObj = getServiceQueryInfo(dataOriginInfo, pageContext2);
36
- Object.assign(infoObj, tempObj);
37
- }
38
- if (infoObj.type) {
39
- return infoObj;
40
- } else {
41
- return void 0;
42
- }
7
+ function getComponentOptionConfigs(t, e) {
8
+ if (!t.props || !t.props.dataOrigin) return;
9
+ if (t.name && "table" === t.name) return;
10
+ const o = t.props.dataOrigin, n = { uuid: t.uuid };
11
+ if ("optionGroup" == o.optionValueSetType) n.type = "optionGroup", n.props = { code: o.optionGroup };
12
+ else if ("dynamicData" == o.optionValueSetType) n.type = "dynamicData", n.filterType = o.filterType, n.props = { code: o.dynamicDataSourceCode };
13
+ else if ("dataTable" == o.optionValueSetType) {
14
+ n.filterType = o.filterType;
15
+ const t2 = getTableQueryInfo(o, e);
16
+ Object.assign(n, t2);
17
+ } else if ("service" == o.optionValueSetType) {
18
+ n.filterType = o.filterType;
19
+ const t2 = getServiceQueryInfo(o, e);
20
+ Object.assign(n, t2);
21
+ }
22
+ return n.type ? n : void 0;
43
23
  }
44
- function getTableQueryInfo(dataOriginInfo, pageContext2) {
45
- const infoObj = {};
46
- infoObj.type = "dataTable";
47
- infoObj.props = {
48
- tableName: dataOriginInfo.tableName,
49
- systemCode: dataOriginInfo.tableSysCode ? dataOriginInfo.tableSysCode : pageContext2.systemCode,
50
- systemVersion: dataOriginInfo.tableSysCode ? dataOriginInfo.tableSysVersion : pageContext2.systemVersion
51
- };
52
- if (dataOriginInfo.sortFields) {
53
- const sortFields = [];
54
- for (const field of dataOriginInfo.sortFields) {
55
- if (field.name) {
56
- sortFields.push({
57
- prop: field.name,
58
- order: field.type ? field.type : "asc"
59
- });
60
- }
61
- }
62
- infoObj.props.sorts = sortFields;
63
- }
64
- const autoMonitorFields = [];
65
- if (dataOriginInfo.filterList) {
66
- const searchForm = [];
67
- for (const f of dataOriginInfo.filterList) {
68
- if (!f.propName) {
69
- continue;
70
- }
71
- if (!f.propDbName) {
72
- f.propDbName = f.propName;
73
- }
74
- const tempObj = {};
75
- Object.assign(tempObj, f);
76
- const paramsNames = getParamNames(f.propValue);
77
- for (const p of paramsNames) {
78
- if (p && (p.startsWith("${data.") || p.startsWith("${task.") || p.startsWith("${page."))) {
79
- if (!autoMonitorFields.includes(p)) {
80
- autoMonitorFields.push(p);
81
- }
82
- }
83
- }
84
- if (f.propValue) ;
85
- searchForm.push(tempObj);
86
- }
87
- infoObj.props.searchForm = searchForm;
88
- }
89
- infoObj.props.monitorFields = autoMonitorFields;
90
- const queryFields = [];
91
- if (dataOriginInfo.tableValueField) {
92
- infoObj.props.valueField = dataOriginInfo.tableValueField;
93
- }
94
- if (dataOriginInfo.tableLableField && queryFields.indexOf(dataOriginInfo.tableLableField) == -1) {
95
- infoObj.props.lableField = dataOriginInfo.tableLableField;
96
- }
97
- if (dataOriginInfo.autoSets) {
98
- for (const field of dataOriginInfo.autoSets) {
99
- if (field.source && queryFields.indexOf(field.source) == -1) {
100
- queryFields.push(field.source);
101
- }
102
- }
103
- }
104
- infoObj.props.queryFields = queryFields;
105
- infoObj.props.pageSize = dataOriginInfo.displayQuantity;
106
- return infoObj;
24
+ function getTableQueryInfo(t, e) {
25
+ const o = { type: "dataTable" };
26
+ if (o.props = { tableName: t.tableName, systemCode: t.tableSysCode ? t.tableSysCode : e.systemCode, systemVersion: t.tableSysCode ? t.tableSysVersion : e.systemVersion }, t.sortFields) {
27
+ const e2 = [];
28
+ for (const o2 of t.sortFields) o2.name && e2.push({ prop: o2.name, order: o2.type ? o2.type : "asc" });
29
+ o.props.sorts = e2;
30
+ }
31
+ const n = [];
32
+ if (t.filterList) {
33
+ const e2 = [];
34
+ for (const o2 of t.filterList) {
35
+ if (!o2.propName) continue;
36
+ o2.propDbName || (o2.propDbName = o2.propName);
37
+ const t2 = {};
38
+ Object.assign(t2, o2);
39
+ const a2 = getParamNames(o2.propValue);
40
+ for (const t3 of a2) t3 && (t3.startsWith("${data.") || t3.startsWith("${task.") || t3.startsWith("${page.")) && (n.includes(t3) || n.push(t3));
41
+ o2.propValue, e2.push(t2);
42
+ }
43
+ o.props.searchForm = e2;
44
+ }
45
+ o.props.monitorFields = n;
46
+ const a = [];
47
+ if (t.tableValueField && (o.props.valueField = t.tableValueField), t.tableLableField && -1 == a.indexOf(t.tableLableField) && (o.props.lableField = t.tableLableField), t.autoSets) for (const e2 of t.autoSets) e2.source && -1 == a.indexOf(e2.source) && a.push(e2.source);
48
+ return o.props.queryFields = a, o.props.pageSize = t.displayQuantity, o;
107
49
  }
108
- function getServiceQueryInfo(dataOriginInfo, pageContext2) {
109
- const infoObj = {};
110
- infoObj.type = "service";
111
- infoObj.props = {
112
- serivceCode: dataOriginInfo.serviceCode,
113
- systemCode: dataOriginInfo.tableSysCode ? dataOriginInfo.tableSysCode : pageContext2.systemCode,
114
- systemVersion: dataOriginInfo.tableSysCode ? dataOriginInfo.tableSysCode : pageContext2.systemCode
115
- };
116
- if (dataOriginInfo.serviceInputs) {
117
- const searchForm = [];
118
- for (const f of dataOriginInfo.serviceInputs) {
119
- if (!f.name || f.value) {
120
- continue;
121
- }
122
- const tempObj = {};
123
- Object.assign(tempObj, f);
124
- searchForm.push(tempObj);
125
- }
126
- infoObj.props.inputs = searchForm;
127
- }
128
- infoObj.props.dataSetField = dataOriginInfo.serviceDataSetField;
129
- infoObj.props.valueField = dataOriginInfo.serviceValueField;
130
- infoObj.props.labelField = dataOriginInfo.serviceLabelField;
131
- return infoObj;
50
+ function getServiceQueryInfo(t, e) {
51
+ const o = { type: "service" };
52
+ if (o.props = { serivceCode: t.serviceCode, systemCode: t.tableSysCode ? t.tableSysCode : e.systemCode, systemVersion: t.tableSysCode ? t.tableSysCode : e.systemCode }, t.serviceInputs) {
53
+ const e2 = [];
54
+ for (const o2 of t.serviceInputs) {
55
+ if (!o2.name || o2.value) continue;
56
+ const t2 = {};
57
+ Object.assign(t2, o2), e2.push(t2);
58
+ }
59
+ o.props.inputs = e2;
60
+ }
61
+ return o.props.dataSetField = t.serviceDataSetField, o.props.valueField = t.serviceValueField, o.props.labelField = t.serviceLabelField, o;
132
62
  }
133
- function updateChartDatasources(pageContext2, dataSourceConfs, appendParams, isInit) {
134
- return new Promise((resolve, reject) => {
135
- if (!dataSourceConfs || dataSourceConfs.length == 0) {
136
- reject(new Error("无需查询的统计图配置!"));
137
- return;
138
- }
139
- const dataSourceConfsCopy = deepCopy(dataSourceConfs);
140
- dataSourceConfsCopy.forEach((item) => {
141
- var _a;
142
- const configureUuid = item.uuid;
143
- const componentRef = getComponentRef(pageContext2, configureUuid);
144
- if (componentRef) {
145
- const configure = componentRef.getConfigure();
146
- const serviceInputs = (_a = configure == null ? void 0 : configure.props.dataOrigin) == null ? void 0 : _a.serviceInputs;
147
- if (serviceInputs) {
148
- const services = item.services;
149
- if (services && services.length > 0) {
150
- services[0].serviceInParams = {};
151
- serviceInputs.forEach((inParam) => {
152
- const paramName = inParam.name;
153
- const paramValue = inParam.value;
154
- services[0].serviceInParams[paramName] = getValueFromVariable(
155
- pageContext2.entity,
156
- paramValue
157
- );
158
- });
159
- }
160
- }
63
+ function updateChartDatasources(t, e, o, n) {
64
+ return new Promise((a, r) => {
65
+ if (!e || 0 == e.length) return void r(new Error("无需查询的统计图配置!"));
66
+ const s = deepCopy(e);
67
+ s.forEach((e2) => {
68
+ const o2 = e2.services;
69
+ if (o2 && o2.length > 0) {
70
+ let e3 = o2[0].serviceInputs;
71
+ e3 && (o2[0].serviceInParams = {}, e3.forEach((e4) => {
72
+ const n2 = e4.name, a2 = e4.value;
73
+ o2[0].serviceInParams[n2] = getValueFromVariable(t.entity, a2);
74
+ }), delete o2[0].serviceInputs);
161
75
  }
162
76
  });
163
- const entityData2 = pageContext2.entity ? pageContext2.entity : {};
164
- const additionalParamMap = {};
165
- if (entityData2.request) {
166
- Object.assign(additionalParamMap, entityData2.request);
167
- }
168
- if (entityData2.page) {
169
- Object.assign(additionalParamMap, entityData2.page);
170
- }
171
- if (appendParams) {
172
- Object.assign(additionalParamMap, appendParams);
173
- }
174
- const taskMap = {};
175
- if (entityData2.task) {
176
- Object.assign(taskMap, entityData2.task);
177
- }
178
- const param = {
179
- entityMap: entityData2.data,
180
- additionalParamMap,
181
- taskMap,
182
- dataSourceList: dataSourceConfsCopy,
183
- systemCode: pageContext2.systemCode,
184
- pageCode: pageContext2.code
185
- };
186
- const backendUrl = pageContext2.backendUrl;
187
- const baseUrl = getBaseUrl(backendUrl, pageContext2.isTest);
188
- const url = baseUrl + "/common/common-data/find-chart-datas";
189
- http.post(url, param).then((result) => {
77
+ const i = t.entity ? t.entity : {}, u = {};
78
+ i.request && Object.assign(u, i.request), i.page && Object.assign(u, i.page), o && Object.assign(u, o);
79
+ const l = {};
80
+ i.task && Object.assign(l, i.task);
81
+ const c = { entityMap: i.data, additionalParamMap: u, taskMap: l, dataSourceList: s, systemCode: t.systemCode, pageCode: t.code }, p = t.backendUrl, f = getBaseUrl(p, t.isTest) + "/common/common-data/find-chart-datas";
82
+ http.post(f, c).then((e2) => {
190
83
  var _a, _b;
191
- if (!pageContext2.chartDataSourceMap) {
192
- pageContext2.chartDataSourceMap = {};
193
- }
194
- for (const uuid in result) {
195
- pageContext2.chartDataSourceMap[uuid] = result[uuid];
196
- const componentObj = getComponentRef(pageContext2, uuid);
197
- if (componentObj) {
198
- const chartConfig = componentObj.getConfigure();
199
- if (!isInit || chartConfig && chartConfig.initializationQuery) {
200
- if (componentObj.updateChartDatas) {
201
- componentObj.updateChartDatas(result[uuid]);
202
- if ((_b = (_a = chartConfig.runtime) == null ? void 0 : _a.dataConfig) == null ? void 0 : _b.resultSet) {
203
- const serviceData = result[uuid] && result[uuid].length > 0 ? result[uuid][0] : {};
204
- const chartData = serviceData && serviceData.result ? serviceData.result : {};
205
- let datas = null;
206
- if (chartConfig.serviceDataField) {
207
- datas = chartData[chartConfig.serviceDataField];
208
- } else {
209
- if (chartData) {
210
- if (Array.isArray(chartData)) {
211
- datas = chartData;
212
- } else {
213
- datas = [chartData];
214
- }
215
- }
216
- }
217
- if (!datas) {
218
- datas = [];
219
- }
220
- setValueForVariableName(
221
- pageContext2.entity,
222
- chartConfig.runtime.dataConfig.resultSet,
223
- datas
224
- );
225
- }
226
- }
84
+ t.chartDataSourceMap || (t.chartDataSourceMap = {});
85
+ for (const o2 in e2) {
86
+ t.chartDataSourceMap[o2] = e2[o2];
87
+ const a2 = getComponentRef(t, o2);
88
+ if (a2) {
89
+ const r2 = a2.getConfigure();
90
+ if ((!n || r2 && (void 0 === r2.initializationQuery || r2.initializationQuery)) && a2.updateChartDatas && (a2.updateChartDatas(e2[o2]), (_b = (_a = r2.runtime) == null ? void 0 : _a.dataConfig) == null ? void 0 : _b.resultSet)) {
91
+ const n2 = e2[o2] && e2[o2].length > 0 ? e2[o2][0] : {}, a3 = n2 && n2.result ? n2.result : {};
92
+ let s2 = null;
93
+ r2.serviceDataField ? s2 = a3[r2.serviceDataField] : a3 && (s2 = Array.isArray(a3) ? a3 : [a3]), s2 || (s2 = []), setValueForVariableName(t.entity, r2.runtime.dataConfig.resultSet, s2);
227
94
  }
228
95
  }
229
96
  }
230
- console.log("查询统计图数据完成", result);
231
- resolve(result);
232
- }).catch((error) => {
233
- console.log("查询统计图数据失败", error);
234
- reject(error);
97
+ a(e2);
98
+ }).catch((t2) => {
99
+ r(t2);
235
100
  });
236
101
  });
237
102
  }
238
- function updateChartDatasourcesByComponent(pageContext2, componentUuid) {
239
- const chartDataSource = pageContext2.initChartServiceConfigs.find(
240
- (item) => item.uuid === componentUuid
241
- );
242
- if (chartDataSource) {
243
- updateChartDatasources(pageContext2, [chartDataSource], null, false);
244
- }
103
+ function updateChartDatasourcesByComponent(t, e) {
104
+ const o = t.initChartServiceConfigs.find((t2) => t2.uuid === e);
105
+ o && updateChartDatasources(t, [o], null, false);
245
106
  }
246
- function updateOptionDatasources(pageContext2, dataSourceConfs, query) {
247
- return new Promise((resolve, reject) => {
248
- if (!dataSourceConfs || dataSourceConfs.length == 0) {
249
- reject(new Error("无需查询的配置!"));
250
- return;
251
- }
252
- const entityData2 = pageContext2.entity ? pageContext2.entity : {};
253
- const additionalParamMap = {};
254
- if (entityData2.request) {
255
- Object.assign(additionalParamMap, entityData2.request);
256
- }
257
- if (entityData2.page) {
258
- Object.assign(additionalParamMap, entityData2.page);
259
- }
260
- additionalParamMap.query = query;
261
- const param = {
262
- entityMap: entityData2.data,
263
- additionalParamMap,
264
- dataSourceList: dataSourceConfs,
265
- systemCode: pageContext2.systemCode,
266
- query
267
- };
268
- const backendUrl = pageContext2.backendUrl;
269
- const baseUrl = getBaseUrl(backendUrl, pageContext2.isTest);
270
- const url = baseUrl + "/common/common-data/find-datas";
271
- http.post(url, param).then((result) => {
272
- if (!pageContext2.optionSourceMap) {
273
- pageContext2.optionSourceMap = {};
107
+ function updateOptionDatasources(t, e, o) {
108
+ return new Promise((n, a) => {
109
+ if (!e || 0 == e.length) return void a(new Error("无需查询的配置!"));
110
+ const r = t.entity ? t.entity : {}, s = {};
111
+ r.request && Object.assign(s, r.request), r.page && Object.assign(s, r.page), s.query = o;
112
+ const i = { entityMap: r.data, additionalParamMap: s, dataSourceList: e, systemCode: t.systemCode, query: o }, u = t.backendUrl, l = getBaseUrl(u, t.isTest) + "/common/common-data/find-datas";
113
+ http.post(l, i).then((e2) => {
114
+ t.optionSourceMap || (t.optionSourceMap = {});
115
+ for (const o2 in e2) {
116
+ t.optionSourceMap[o2] = e2[o2];
117
+ const n2 = getComponentRef(t, o2);
118
+ n2 && n2.updateOptions && n2.updateOptions(e2[o2]);
274
119
  }
275
- for (const uuid in result) {
276
- pageContext2.optionSourceMap[uuid] = result[uuid];
277
- const componentObj = getComponentRef(pageContext2, uuid);
278
- if (componentObj && componentObj.updateOptions) {
279
- componentObj.updateOptions(result[uuid]);
280
- }
281
- }
282
- console.log("查询选项数据完成", result);
283
- resolve(result);
284
- }).catch((error) => {
285
- console.log("查询选项数据失败", error);
286
- reject(error);
120
+ n(e2);
121
+ }).catch((t2) => {
122
+ a(t2);
287
123
  });
288
124
  });
289
125
  }
290
- function getOptionDatasFromPage(pageContext2, configure) {
291
- return getComponentOptionDatasFromPage(pageContext2, configure.uuid);
126
+ function getOptionDatasFromPage(t, e) {
127
+ return getComponentOptionDatasFromPage(t, e.uuid);
292
128
  }
293
- function getComponentOptionDatasFromPage(pageContext2, configureUuid) {
294
- const optionSourceMap = getOptionDatasSourceMap(pageContext2);
295
- const cacheOptions = optionSourceMap[configureUuid];
296
- return cacheOptions ? cacheOptions : [];
129
+ function getComponentOptionDatasFromPage(t, e) {
130
+ const o = getOptionDatasSourceMap(t)[e];
131
+ return o || [];
297
132
  }
298
- function getOptionDatasSourceMap(pageContext2) {
299
- if (!pageContext2 || !pageContext2.optionSourceMap) {
300
- return {};
301
- }
302
- const cacheOptions = pageContext2.optionSourceMap;
303
- return cacheOptions ? cacheOptions : {};
133
+ function getOptionDatasSourceMap(t) {
134
+ if (!t || !t.optionSourceMap) return {};
135
+ const e = t.optionSourceMap;
136
+ return e || {};
304
137
  }
305
- function getChartDatasFromPage(pageContext2, configure) {
306
- if (!pageContext2 || !pageContext2.chartDataSourceMap || !configure) {
307
- return null;
308
- }
309
- const cacheDatas = pageContext2.chartDataSourceMap[configure.uuid];
310
- return cacheDatas;
138
+ function getChartDatasFromPage(t, e) {
139
+ if (!t || !t.chartDataSourceMap || !e) return null;
140
+ return t.chartDataSourceMap[e.uuid];
311
141
  }
312
- function queryOptionDatasources(pageContext2, dataSourceConf, query) {
313
- return updateOptionDatasources(pageContext2, dataSourceConf ? [dataSourceConf] : [], query);
142
+ function queryOptionDatasources(t, e, o) {
143
+ return updateOptionDatasources(t, e ? [e] : [], o);
314
144
  }
315
- function autoSetAfterSelect(component, pageContext2, autoSets, selItems) {
316
- if (!autoSets || autoSets.length == 0) {
317
- return;
318
- }
319
- const entity = pageContext2.entity ? pageContext2.entity : {};
320
- for (const as of autoSets) {
321
- if (!as.source || !as.target) {
322
- continue;
323
- }
324
- const values = getValuesByField(selItems, as.source);
325
- let targetField = as.target;
326
- if (!targetField || !targetField.startsWith("${")) {
327
- continue;
328
- }
329
- targetField = targetField.substring(2, targetField.length - 1);
330
- const fields = targetField.split(".");
331
- setVariableValue(entity, fields, values.join(","));
145
+ function autoSetAfterSelect(t, e, o, n) {
146
+ if (!o || 0 == o.length) return;
147
+ const a = e.entity ? e.entity : {};
148
+ for (const t2 of o) {
149
+ if (!t2.source || !t2.target) continue;
150
+ const e2 = getValuesByField(n, t2.source);
151
+ let o2 = t2.target;
152
+ if (!o2 || !o2.startsWith("${")) continue;
153
+ o2 = o2.substring(2, o2.length - 1);
154
+ setVariableValue(a, o2.split("."), e2.join(","));
332
155
  }
333
156
  }
334
- function getValuesByField(items, fieldName) {
335
- if (!items) {
336
- return [""];
337
- } else {
338
- const values = [];
339
- for (const i of items) {
340
- let val = i[fieldName];
341
- if (val == void 0 || val == null) {
342
- val = "";
343
- }
344
- values.push(val);
157
+ function getValuesByField(t, e) {
158
+ if (t) {
159
+ const o = [];
160
+ for (const n of t) {
161
+ let t2 = n[e];
162
+ null != t2 && null != t2 || (t2 = ""), o.push(t2);
345
163
  }
346
- return values;
164
+ return o;
347
165
  }
166
+ return [""];
348
167
  }
349
- function getVariableValue(entity, fields) {
350
- if (!entity || !fields || fields.length == 0) {
351
- return;
352
- }
353
- let tempObj = entity;
354
- for (let i = 0; i < fields.length; i++) {
355
- if (tempObj == void 0) {
356
- return tempObj;
357
- }
358
- const fieldName = fields[i];
359
- tempObj = tempObj[fieldName];
360
- }
361
- return tempObj;
168
+ function getVariableValue(t, e) {
169
+ if (!t || !e || 0 == e.length) return;
170
+ let o = t;
171
+ for (let t2 = 0; t2 < e.length; t2++) {
172
+ if (null == o) return o;
173
+ o = o[e[t2]];
174
+ }
175
+ return o;
362
176
  }
363
- function setValueForVariableName(entity, variableName, newValue) {
364
- if (!variableName || !variableName.startsWith("${")) {
365
- return;
366
- }
367
- variableName = variableName.substring(2, variableName.length - 1);
368
- const fields = variableName.split(".");
369
- setVariableValue(entity, fields, newValue);
177
+ function setValueForVariableName(t, e, o) {
178
+ if (!e || !e.startsWith("${")) return;
179
+ setVariableValue(t, (e = e.substring(2, e.length - 1)).split("."), o);
370
180
  }
371
- function setVariableValue(entity, fields, newValue) {
372
- if (!entity || !fields || fields.length == 0) {
373
- return;
374
- }
375
- let tempObj = entity;
376
- for (let i = 0; i < fields.length; i++) {
377
- const fieldName = fields[i];
378
- if (i + 1 === fields.length) {
379
- tempObj[fieldName] = newValue;
380
- } else {
381
- if (tempObj[fieldName] === void 0) {
382
- tempObj[fieldName] = {};
383
- }
384
- tempObj = tempObj[fieldName];
385
- }
181
+ function setVariableValue(t, e, o) {
182
+ if (!t || !e || 0 == e.length) return;
183
+ let n = t;
184
+ for (let t2 = 0; t2 < e.length; t2++) {
185
+ const a = e[t2];
186
+ t2 + 1 === e.length ? n[a] = o : (void 0 === n[a] && (n[a] = {}), n = n[a]);
386
187
  }
387
188
  }
388
- function setVariableValueWithProp(entity, prop, newValue) {
389
- if (!entity || !prop) {
390
- return;
391
- }
392
- const fields = prop.split(".");
393
- setVariableValue(entity, fields, newValue);
189
+ function setVariableValueWithProp(t, e, o) {
190
+ if (!t || !e) return;
191
+ setVariableValue(t, e.split("."), o);
394
192
  }
395
- function formatVariableValue(pageContext2, variable) {
396
- if (!pageContext2 || variable == "" || variable == null || variable == void 0) {
397
- return variable;
398
- }
399
- const entity = pageContext2.entity ? pageContext2.entity : {};
400
- const t = getParamNames(variable);
401
- for (const c in t) {
402
- const param = t[c];
403
- const paramValue = getValueFromVariable(entity, param);
404
- variable = variable.replace(
405
- param,
406
- paramValue === void 0 || paramValue === null ? "" : paramValue
407
- );
408
- }
409
- return variable;
193
+ function formatVariableValue(t, e) {
194
+ if (!t || "" == e || null == e || null == e) return e;
195
+ const o = t.entity ? t.entity : {}, n = getParamNames(e);
196
+ for (const t2 in n) {
197
+ const a = n[t2], r = getValueFromVariable(o, a);
198
+ e = e.replace(a, null == r ? "" : r);
199
+ }
200
+ return e;
410
201
  }
411
- function getParamNames(variable) {
412
- if (!variable) {
413
- return [];
414
- }
415
- const reg = /\$\{[^\{|\}]+\}/g;
416
- const paramNames = variable.match(reg);
417
- return paramNames ? paramNames : [];
202
+ function getParamNames(t) {
203
+ if (!t) return [];
204
+ const e = t.match(/\$\{[^\{|\}]+\}/g);
205
+ return e || [];
418
206
  }
419
- function formatValueByType(value, formatType, formatInfo) {
420
- if (!formatType || value == "" || value == null || value == void 0) {
421
- return value;
422
- }
423
- console.log("aaa", value, formatType, formatInfo);
424
- formatInfo = formatInfo ? formatInfo : {};
425
- if (formatType == "number" || formatType == "percent") {
426
- if (isNaN(value)) {
427
- return value;
428
- }
429
- let precision = parseInt(formatInfo.decimalDigit);
430
- if (precision == null || isNaN(precision)) {
431
- precision = -1;
432
- }
433
- value = parseFloat(value);
434
- if (formatType == "percent") {
435
- value = value * 100;
436
- }
437
- if (precision > -1) {
438
- value = parseFloat(value.toFixed(precision));
439
- }
440
- if (formatType == "percent") {
441
- value = value + "%";
442
- } else {
443
- if (formatInfo.thousandsSeparator) {
444
- const parts = value.toString().split(".");
445
- parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
446
- value = parts.length > 1 ? parts.join(".") : parts[0];
447
- }
448
- if (formatInfo.symbol) {
449
- value = formatInfo.symbol + "" + value;
450
- }
451
- }
452
- return value;
453
- } else if (formatType == "date" || formatType == "time") {
454
- let formatStr = "";
455
- if (formatType == "date") {
456
- formatStr = formatInfo.dateFormat;
457
- if (!formatStr) {
458
- formatStr = "YYYY-MM-DD";
459
- }
460
- } else {
461
- formatStr = formatInfo.timeFormat;
462
- if (!formatStr) {
463
- formatStr = "HH:mm:ss";
207
+ function formatValueByType(t, e, o) {
208
+ if (!e || "" == t || null == t || null == t) return t;
209
+ if (o = o || {}, "number" == e || "percent" == e) {
210
+ if (isNaN(t)) return t;
211
+ let n = parseInt(o.decimalDigit);
212
+ if ((null == n || isNaN(n)) && (n = -1), t = parseFloat(t), "percent" == e && (t *= 100), n > -1 && (t = parseFloat(t.toFixed(n))), "percent" == e) t += "%";
213
+ else {
214
+ if (o.thousandsSeparator) {
215
+ const e2 = t.toString().split(".");
216
+ e2[0] = e2[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), t = e2.length > 1 ? e2.join(".") : e2[0];
464
217
  }
218
+ o.symbol && (t = o.symbol + "" + t);
465
219
  }
466
- return dayjs(value).format(formatStr);
467
- } else if (formatType == "custom" && formatInfo.formatEventUuid) {
468
- console.log("自定义方法", formatInfo);
220
+ return t;
469
221
  }
470
- return value;
471
- }
472
- function getValueFromVariable(entity, variable, row2) {
473
- if (variable == null || variable == void 0) {
474
- return variable;
475
- }
476
- if (variable.startsWith("${") && variable.endsWith("}")) {
477
- let paramName = variable.substring(2, variable.length - 1);
478
- let paramType = null;
479
- let valueSource = null;
480
- if (paramName.startsWith("data.")) {
481
- paramName = paramName.substring(5);
482
- valueSource = entity.data;
483
- paramType = "data";
484
- } else if (paramName.startsWith("page.")) {
485
- paramName = paramName.substring(5);
486
- paramType = "page";
487
- valueSource = entity.page;
488
- } else if (paramName.startsWith("task.")) {
489
- paramName = paramName.substring(5);
490
- paramType = "task";
491
- valueSource = entity.task;
492
- } else if (paramName.startsWith("request.")) {
493
- paramName = paramName.substring(8);
494
- paramType = "request";
495
- valueSource = entity.request;
496
- } else if (paramName.startsWith("context.")) {
497
- paramName = paramName.substring(8);
498
- paramType = "context";
499
- valueSource = entity.context;
500
- } else if (paramName.startsWith("system.")) {
501
- paramName = paramName.substring(7);
502
- paramType = "system";
503
- valueSource = entity.system;
504
- } else if (paramName.startsWith("fixed.")) {
505
- return paramName.substring(6);
506
- } else if (paramName.startsWith("row.")) {
507
- paramName = paramName.substring(4);
508
- valueSource = row2;
509
- paramType = "row";
510
- }
511
- if (!paramName) {
512
- console.log("获取变量失败", variable, entity);
513
- return "";
514
- }
515
- return getValueFromSource(valueSource, paramName, paramType);
516
- } else {
517
- return variable;
222
+ if ("date" == e || "time" == e) {
223
+ let n = "";
224
+ return "date" == e ? (n = o.dateFormat, n || (n = "YYYY-MM-DD")) : (n = o.timeFormat, n || (n = "HH:mm:ss")), dayjs(t).format(n);
518
225
  }
226
+ return "custom" == e && o.formatEventUuid, t;
519
227
  }
520
- function getValueFromSource(valueSource, paramName, paramType) {
521
- if (paramType != "context" && !valueSource || !paramName) {
522
- return void 0;
523
- }
524
- const firstIndex = paramName.indexOf(".");
525
- if (firstIndex > -1) {
526
- const tempParamName = paramName.substring(0, firstIndex);
527
- const newParamName = paramName.substring(firstIndex + 1);
528
- let childValue = valueSource[tempParamName];
529
- if (childValue && Array.isArray(childValue) && childValue.length > 0) {
530
- childValue = childValue[0];
531
- }
532
- return getValueFromSource(childValue, newParamName, paramType);
533
- } else {
534
- if (paramType == "context") {
535
- if (paramName == "currentDate" || paramName == "currentTime") {
536
- return /* @__PURE__ */ new Date();
537
- } else if (paramName.startsWith("currentDate") && paramName.length > 11) {
538
- const str = paramName.substring(11);
539
- const symbol = str.substring(0, 1);
540
- let num = parseInt(str.substring(1, str.length - 1), 10);
541
- const unit = str.substring(str.length - 1);
542
- const date = /* @__PURE__ */ new Date();
543
- num = "+" === symbol ? num : -num;
544
- if (unit === "d" || unit === "w") {
545
- num = unit === "w" ? num * 7 : num;
546
- date.setDate(date.getDate() + num);
547
- } else if (unit === "m") {
548
- date.setMonth(date.getMonth() + num);
549
- } else if (unit === "y") {
550
- date.setFullYear(date.getFullYear() + num);
551
- }
552
- return date;
553
- }
554
- if (!valueSource) {
555
- return void 0;
556
- }
557
- }
558
- return valueSource[paramName];
559
- }
228
+ function getValueFromVariable(t, e, o) {
229
+ if (null == e || null == e) return e;
230
+ if (e.startsWith("${") && e.endsWith("}")) {
231
+ let n = e.substring(2, e.length - 1), a = null, r = null;
232
+ if (n.startsWith("data.")) n = n.substring(5), r = t.data, a = "data";
233
+ else if (n.startsWith("page.")) n = n.substring(5), a = "page", r = t.page;
234
+ else if (n.startsWith("task.")) n = n.substring(5), a = "task", r = t.task;
235
+ else if (n.startsWith("request.")) n = n.substring(8), a = "request", r = t.request;
236
+ else if (n.startsWith("context.")) n = n.substring(8), a = "context", r = t.context;
237
+ else if (n.startsWith("system.")) n = n.substring(7), a = "system", r = t.system;
238
+ else {
239
+ if (n.startsWith("fixed.")) return n.substring(6);
240
+ n.startsWith("row.") && (n = n.substring(4), r = o, a = "row");
241
+ }
242
+ return n ? getValueFromSource(r, n, a) : "";
243
+ }
244
+ return e;
245
+ }
246
+ function getValueFromSource(t, e, o) {
247
+ if ("context" != o && !t || !e) return;
248
+ const n = e.indexOf(".");
249
+ if (n > -1) {
250
+ const a = e.substring(0, n), r = e.substring(n + 1);
251
+ let s = t[a];
252
+ return s && Array.isArray(s) && s.length > 0 && (s = s[0]), getValueFromSource(s, r, o);
253
+ }
254
+ if ("context" == o) {
255
+ if ("currentDate" == e || "currentTime" == e) return /* @__PURE__ */ new Date();
256
+ if (e.startsWith("currentDate") && e.length > 11) {
257
+ const t2 = e.substring(11), o2 = t2.substring(0, 1);
258
+ let n2 = parseInt(t2.substring(1, t2.length - 1), 10);
259
+ const a = t2.substring(t2.length - 1), r = /* @__PURE__ */ new Date();
260
+ return n2 = "+" === o2 ? n2 : -n2, "d" === a || "w" === a ? (n2 = "w" === a ? 7 * n2 : n2, r.setDate(r.getDate() + n2)) : "m" === a ? r.setMonth(r.getMonth() + n2) : "y" === a && r.setFullYear(r.getFullYear() + n2), r;
261
+ }
262
+ if (!t) return;
263
+ }
264
+ return t[e];
560
265
  }
561
266
  function caculateShowCondition(pageContext, showConditions, row) {
562
- if (!showConditions || showConditions.length == 0 || !pageContext || !pageContext.entity) {
563
- return true;
564
- }
267
+ if (!showConditions || 0 == showConditions.length || !pageContext || !pageContext.entity) return true;
565
268
  const entityData = pageContext.entity;
566
269
  let conditions = "";
567
270
  const maxLen = showConditions.length;
568
- for (let i = 0; i < maxLen; i++) {
569
- const condition = showConditions[i];
570
- const propName = condition.propName;
571
- let operator = condition.operator;
572
- if (!propName || propName === "") {
573
- continue;
574
- }
575
- if (!operator) {
576
- operator = "EQ";
577
- }
578
- const leftValue = getValueFromVariable(entityData, propName, row);
579
- let propValue = getValueFromVariable(entityData, condition.propValue, row);
580
- const dataType = condition.dataType;
581
- if (operator == "CONTAIN" || operator == "NOT_CONTAIN") {
582
- if (leftValue && !leftValue.includes) {
583
- operator = operator == "CONTAIN" ? "EQ" : "NET";
584
- }
585
- }
586
- let variableIsNullStr = condition.variableIsNull;
587
- if (!variableIsNullStr) {
588
- variableIsNullStr = "null";
589
- }
590
- let conditionResult = void 0;
591
- if (propValue === void 0 || propValue === "") {
592
- propValue = null;
593
- if (variableIsNullStr === "null") {
594
- operator = "IS_NULL";
595
- } else if (variableIsNullStr === "notequal") {
596
- operator = "IS_NOT_NULL";
597
- } else {
598
- conditionResult = true;
599
- }
600
- }
601
- if (conditionResult == void 0) {
602
- try {
603
- conditionResult = executeExpression(leftValue, operator, propValue, dataType);
604
- } catch (e) {
605
- console.log("executeExpression error", e);
606
- conditionResult = false;
607
- }
608
- }
609
- const leftBracket = condition.leftBracket;
610
- const rightBracket = condition.rightBracket;
611
- let joinSign = condition.joinSign;
612
- if (leftBracket && leftBracket !== null && leftBracket !== "") {
613
- conditions = conditions + leftBracket;
614
- conditions = conditions + " ";
615
- }
616
- conditions += conditionResult + " ";
617
- if (rightBracket && rightBracket !== null && rightBracket !== "") {
618
- conditions = conditions + rightBracket;
619
- conditions = conditions + " ";
620
- }
621
- if (i < maxLen - 1) {
622
- if (joinSign && joinSign !== null && joinSign !== "") {
623
- const joinSignIgnoreCase = joinSign.toLowerCase();
624
- if (joinSignIgnoreCase === "and") {
625
- joinSign = joinSignIgnoreCase.replace("and", "&&");
626
- } else if (joinSignIgnoreCase === "or") {
627
- joinSign = joinSignIgnoreCase.replace("or", "||");
628
- }
629
- conditions += joinSign + " ";
630
- }
631
- }
632
- }
633
- if (conditions) {
634
- return eval("(" + conditions + ")");
635
- } else {
636
- return true;
637
- }
271
+ for (let t = 0; t < maxLen; t++) {
272
+ const e = showConditions[t], o = e.propName;
273
+ let n = e.operator;
274
+ if (!o || "" === o) continue;
275
+ n || (n = "EQ");
276
+ const a = getValueFromVariable(entityData, o, row);
277
+ let r = getValueFromVariable(entityData, e.propValue, row);
278
+ const s = e.dataType;
279
+ "CONTAIN" != n && "NOT_CONTAIN" != n || a && !a.includes && (n = "CONTAIN" == n ? "EQ" : "NET");
280
+ let i = e.variableIsNull, u;
281
+ if (i || (i = "null"), void 0 !== r && "" !== r || (r = null, "null" === i ? n = "IS_NULL" : "notequal" === i ? n = "IS_NOT_NULL" : u = true), null == u) try {
282
+ u = executeExpression(a, n, r, s);
283
+ } catch (t2) {
284
+ u = false;
285
+ }
286
+ const l = e.leftBracket, c = e.rightBracket;
287
+ let p = e.joinSign;
288
+ if (l && null !== l && "" !== l && (conditions += l, conditions += " "), conditions += u + " ", c && null !== c && "" !== c && (conditions += c, conditions += " "), t < maxLen - 1 && p && null !== p && "" !== p) {
289
+ const t2 = p.toLowerCase();
290
+ "and" === t2 ? p = t2.replace("and", "&&") : "or" === t2 && (p = t2.replace("or", "||")), conditions += p + " ";
291
+ }
292
+ }
293
+ return !conditions || eval("(" + conditions + ")");
638
294
  }
639
- function monitorFieldChange(pageContext2, monitorFields, triggerFunc) {
640
- if (!triggerFunc || !pageContext2 || !monitorFields || monitorFields.length == 0) {
641
- return;
642
- }
643
- const monitorFieldInfos = [];
644
- const preFields = [];
645
- for (let propName of monitorFields) {
646
- if (propName.startsWith("${")) {
647
- propName = propName.substring(2, propName.length - 1);
648
- const fields = propName.split(".");
649
- if (fields[0] === "page" || fields[0] === "task" || fields[0] === "data") {
650
- monitorFieldInfos.push(fields);
651
- if (!preFields.includes(fields[0])) {
652
- preFields.push(fields[0]);
653
- }
654
- }
655
- }
656
- }
657
- const entity = pageContext2.entity;
658
- let firstValue = getMonitorFieldValues(monitorFieldInfos, entity);
659
- let monitorTimeout = false;
660
- for (const preField of preFields) {
661
- watch(entity[preField], () => {
662
- if (monitorTimeout) {
663
- clearTimeout(monitorTimeout);
664
- }
665
- monitorTimeout = setTimeout(function() {
666
- const newValue = getMonitorFieldValues(monitorFieldInfos, entity);
667
- if (firstValue != newValue) {
668
- firstValue = newValue;
669
- triggerFunc();
670
- }
671
- }, 200);
672
- });
673
- }
295
+ function monitorFieldChange(t, e, o) {
296
+ if (!o || !t || !e || 0 == e.length) return;
297
+ const n = [], a = [];
298
+ for (let t2 of e) if (t2.startsWith("${")) {
299
+ t2 = t2.substring(2, t2.length - 1);
300
+ const e2 = t2.split(".");
301
+ "page" !== e2[0] && "task" !== e2[0] && "data" !== e2[0] || (n.push(e2), a.includes(e2[0]) || a.push(e2[0]));
302
+ }
303
+ const r = t.entity;
304
+ let s = getMonitorFieldValues(n, r), i = false;
305
+ for (const t2 of a) watch(r[t2], () => {
306
+ i && clearTimeout(i), i = setTimeout(function() {
307
+ const t3 = getMonitorFieldValues(n, r);
308
+ s != t3 && (s = t3, o());
309
+ }, 200);
310
+ });
674
311
  }
675
- function getMonitorFieldValues(monitorFieldInfos, entity) {
676
- let values = "";
677
- for (const fieldInfo of monitorFieldInfos) {
678
- values += "_" + getVariableValue(entity, fieldInfo);
679
- }
680
- return values;
312
+ function getMonitorFieldValues(t, e) {
313
+ let o = "";
314
+ for (const n of t) o += "_" + getVariableValue(e, n);
315
+ return o;
681
316
  }
682
- function getFormPropName(prop) {
683
- if (prop && prop.indexOf("${") >= 0) {
684
- return prop.substring(prop.indexOf(".") + 1, prop.lastIndexOf("}"));
685
- } else {
686
- return prop;
687
- }
317
+ function getFormPropName(t) {
318
+ return t && t.indexOf("${") >= 0 ? t.substring(t.indexOf(".") + 1, t.lastIndexOf("}")) : t;
688
319
  }
689
- function getSizeConfig(pageContext2, configure) {
690
- const pageModeType = getPageModeType(pageContext2);
691
- let sizeConfig;
692
- if (configure.props && configure.props.size && configure.props.size[pageModeType]) {
693
- sizeConfig = configure.props.size[pageModeType];
694
- }
695
- if (!sizeConfig && configure.props && configure.props.size) {
696
- sizeConfig = configure.props.size["pc"];
697
- }
698
- return sizeConfig;
320
+ function getSizeConfig(t, e) {
321
+ const o = getPageModeType(t);
322
+ let n;
323
+ return e.props && e.props.size && e.props.size[o] && (n = e.props.size[o]), !n && e.props && e.props.size && (n = e.props.size.pc), n;
699
324
  }
700
- function getPageModeType(pageContext2) {
701
- let dimensions = pageContext2.dimensions;
702
- if (!dimensions) {
703
- dimensions = "pc";
704
- }
705
- return dimensions;
325
+ function getPageModeType(t) {
326
+ let e = t.dimensions;
327
+ return e || (e = "pc"), e;
706
328
  }
707
- function isPromise(p) {
708
- return p && Object.prototype.toString.call(p) === "[object Promise]";
329
+ function isPromise(t) {
330
+ return t && "[object Promise]" === Object.prototype.toString.call(t);
709
331
  }
710
- function decomposeVariable(variable) {
711
- if (!variable) {
712
- return [];
713
- }
714
- const paramNames = variable.match(/\${(.*?)}/);
715
- return paramNames ? paramNames[1].split(".") : [];
332
+ function decomposeVariable(t) {
333
+ if (!t) return [];
334
+ const e = t.match(/\${(.*?)}/);
335
+ return e ? e[1].split(".") : [];
716
336
  }
717
337
  export {
718
338
  autoSetAfterSelect,