super-page-runtime 2.1.933 → 2.2.3

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 +6 -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/utils/api/api-util.js +4 -7
  6. package/dist/es/components/runtime/utils/api/page-expose-util.js +137 -433
  7. package/dist/es/components/runtime/utils/assemblys-config.js +12 -366
  8. package/dist/es/components/runtime/utils/barcode-util.js +10 -33
  9. package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +138 -300
  10. package/dist/es/components/runtime/utils/charts/chart-gauge-util.js +29 -66
  11. package/dist/es/components/runtime/utils/charts/chart-pie-util.js +71 -147
  12. package/dist/es/components/runtime/utils/charts/chart-radar-util.js +52 -122
  13. package/dist/es/components/runtime/utils/charts/chart-scatter-util.js +40 -98
  14. package/dist/es/components/runtime/utils/charts/chart-util.js +237 -478
  15. package/dist/es/components/runtime/utils/common-util.js +82 -152
  16. package/dist/es/components/runtime/utils/eventBus.js +3 -9
  17. package/dist/es/components/runtime/utils/events/event-util.js +361 -727
  18. package/dist/es/components/runtime/utils/events/print-label.js +73 -140
  19. package/dist/es/components/runtime/utils/events/standard-event.d.ts +2 -2
  20. package/dist/es/components/runtime/utils/events/standard-event.js +846 -2285
  21. package/dist/es/components/runtime/utils/events/validator-util.js +237 -536
  22. package/dist/es/components/runtime/utils/form/date-shortcuts.js +29 -88
  23. package/dist/es/components/runtime/utils/form/scan-util.js +60 -154
  24. package/dist/es/components/runtime/utils/global-refs.js +45 -69
  25. package/dist/es/components/runtime/utils/i18n-util.js +12 -20
  26. package/dist/es/components/runtime/utils/interfaces/page-design-types.d.ts +2 -0
  27. package/dist/es/components/runtime/utils/interfaces/page-design-types.js +2 -7
  28. package/dist/es/components/runtime/utils/page-helper-util.js +296 -630
  29. package/dist/es/components/runtime/utils/page-init-util.d.ts +6 -1
  30. package/dist/es/components/runtime/utils/page-init-util.js +137 -368
  31. package/dist/es/components/runtime/utils/page-permission-util.js +24 -531
  32. package/dist/es/components/runtime/utils/page-store.js +8 -12
  33. package/dist/es/components/runtime/utils/store-util.js +9 -13
  34. package/dist/es/components/runtime/utils/store.js +2 -2
  35. package/dist/es/components/runtime/utils/table-utils.js +49 -84
  36. package/dist/es/components/runtime/utils/tree-utils.js +18 -36
  37. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue.js +2 -2
  38. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +19 -75
  39. package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue.js +2 -2
  40. package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue2.js +14 -46
  41. package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue.js +2 -2
  42. package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +37 -132
  43. package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue.js +2 -2
  44. package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue2.js +4 -18
  45. package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue.js +2 -2
  46. package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue2.js +17 -107
  47. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue.js +2 -2
  48. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +54 -198
  49. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue.js +12 -42
  50. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue2.js +2 -2
  51. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue.js +7 -60
  52. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue2.js +2 -2
  53. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue.js +48 -169
  54. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue2.js +2 -2
  55. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue.js +2 -2
  56. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +32 -107
  57. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue.js +2 -2
  58. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +43 -164
  59. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue.js +2 -2
  60. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +32 -115
  61. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue.js +2 -2
  62. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +32 -116
  63. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.d.ts +1 -0
  64. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +242 -439
  65. package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue.js +4 -42
  66. package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue2.js +2 -2
  67. package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue.js +8 -62
  68. package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue2.js +2 -2
  69. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +37 -231
  70. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue2.js +2 -2
  71. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue.js +13 -62
  72. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue2.js +2 -2
  73. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue.js +2 -2
  74. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +191 -511
  75. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +29 -139
  76. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue2.js +2 -2
  77. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue.js +23 -125
  78. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue2.js +2 -2
  79. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue.js +16 -102
  80. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue2.js +2 -2
  81. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue.js +2 -2
  82. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue2.js +18 -81
  83. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue.js +2 -2
  84. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue2.js +17 -82
  85. package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue.js +2 -2
  86. package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue2.js +14 -86
  87. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue.js +2 -2
  88. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +21 -79
  89. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue.js +2 -2
  90. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue2.js +16 -61
  91. package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue.js +2 -2
  92. package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue2.js +10 -37
  93. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue.js +2 -2
  94. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +38 -127
  95. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue.js +2 -2
  96. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +28 -76
  97. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue.js +2 -2
  98. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +61 -178
  99. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +310 -800
  100. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue2.js +2 -2
  101. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +255 -592
  102. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue2.js +2 -2
  103. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue.js +2 -2
  104. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +43 -115
  105. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue.js +2 -2
  106. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +56 -215
  107. package/dist/es/components/runtime/views/assemblys/error-render.vue.js +3 -21
  108. package/dist/es/components/runtime/views/assemblys/error-render.vue2.js +2 -2
  109. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue.js +2 -2
  110. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +44 -154
  111. package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue.js +36 -98
  112. package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue2.js +2 -2
  113. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue.js +2 -2
  114. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +54 -200
  115. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue.js +2 -2
  116. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +69 -239
  117. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue.js +2 -2
  118. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +31 -104
  119. package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue.js +2 -2
  120. package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue2.js +22 -59
  121. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue.js +2 -2
  122. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +52 -173
  123. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue.js +2 -2
  124. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +22 -103
  125. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue.js +2 -2
  126. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +58 -249
  127. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue.js +2 -2
  128. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +34 -174
  129. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue.js +2 -2
  130. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +28 -107
  131. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +5 -5
  132. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue2.js +13 -50
  133. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue3.js +1 -0
  134. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue.js +2 -2
  135. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +66 -189
  136. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue.js +2 -2
  137. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +91 -243
  138. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue.js +2 -2
  139. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +82 -261
  140. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue.js +2 -2
  141. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue2.js +13 -57
  142. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue.js +2 -2
  143. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +30 -155
  144. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue.js +2 -2
  145. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +41 -129
  146. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue.js +2 -2
  147. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +22 -107
  148. package/dist/es/components/runtime/views/assemblys/object-render.vue.js +133 -252
  149. package/dist/es/components/runtime/views/assemblys/object-render.vue2.js +2 -2
  150. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue.js +2 -2
  151. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue2.js +19 -46
  152. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue.js +2 -2
  153. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue2.js +22 -49
  154. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue.js +2 -2
  155. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +21 -58
  156. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue.js +2 -2
  157. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue2.js +16 -53
  158. package/dist/es/components/runtime/views/super-page-dialog.vue.js +20 -134
  159. package/dist/es/components/runtime/views/super-page-dialog.vue2.js +2 -2
  160. package/dist/es/components/runtime/views/super-page.vue.d.ts +9 -0
  161. package/dist/es/components/runtime/views/super-page.vue.js +235 -708
  162. package/dist/es/components/runtime/views/super-page.vue2.js +2 -2
  163. package/dist/es/i18n/langs/cn.js +2 -55
  164. package/dist/es/i18n/langs/en.js +2 -55
  165. package/package.json +74 -73
@@ -4,715 +4,381 @@ 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) {
7
+ function getComponentOptionConfigs(t, e) {
8
+ if (!t.props || !t.props.dataOrigin)
9
9
  return;
10
- }
11
- if (component.name && component.name === "table") {
10
+ if (t.name && "table" === t.name)
12
11
  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
- }
12
+ const o = t.props.dataOrigin, n = { uuid: t.uuid };
13
+ if ("optionGroup" == o.optionValueSetType)
14
+ n.type = "optionGroup", n.props = { code: o.optionGroup };
15
+ else if ("dynamicData" == o.optionValueSetType)
16
+ n.type = "dynamicData", n.filterType = o.filterType, n.props = { code: o.dynamicDataSourceCode };
17
+ else if ("dataTable" == o.optionValueSetType) {
18
+ n.filterType = o.filterType;
19
+ const t2 = getTableQueryInfo(o, e);
20
+ Object.assign(n, t2);
21
+ } else if ("service" == o.optionValueSetType) {
22
+ n.filterType = o.filterType;
23
+ const t2 = getServiceQueryInfo(o, e);
24
+ Object.assign(n, t2);
25
+ }
26
+ return n.type ? n : void 0;
43
27
  }
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) {
28
+ function getTableQueryInfo(t, e) {
29
+ const o = { type: "dataTable" };
30
+ if (o.props = { tableName: t.tableName, systemCode: t.tableSysCode ? t.tableSysCode : e.systemCode, systemVersion: t.tableSysCode ? t.tableSysVersion : e.systemVersion }, t.sortFields) {
31
+ const e2 = [];
32
+ for (const o2 of t.sortFields)
33
+ o2.name && e2.push({ prop: o2.name, order: o2.type ? o2.type : "asc" });
34
+ o.props.sorts = e2;
35
+ }
36
+ const n = [];
37
+ if (t.filterList) {
38
+ const e2 = [];
39
+ for (const o2 of t.filterList) {
40
+ if (!o2.propName)
69
41
  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;
42
+ o2.propDbName || (o2.propDbName = o2.propName);
43
+ const t2 = {};
44
+ Object.assign(t2, o2);
45
+ const a2 = getParamNames(o2.propValue);
46
+ for (const t3 of a2)
47
+ t3 && (t3.startsWith("${data.") || t3.startsWith("${task.") || t3.startsWith("${page.")) && (n.includes(t3) || n.push(t3));
48
+ o2.propValue, e2.push(t2);
49
+ }
50
+ o.props.searchForm = e2;
51
+ }
52
+ o.props.monitorFields = n;
53
+ const a = [];
54
+ if (t.tableValueField && (o.props.valueField = t.tableValueField), t.tableLableField && -1 == a.indexOf(t.tableLableField) && (o.props.lableField = t.tableLableField), t.autoSets)
55
+ for (const e2 of t.autoSets)
56
+ e2.source && -1 == a.indexOf(e2.source) && a.push(e2.source);
57
+ return o.props.queryFields = a, o.props.pageSize = t.displayQuantity, o;
107
58
  }
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) {
59
+ function getServiceQueryInfo(t, e) {
60
+ const o = { type: "service" };
61
+ if (o.props = { serivceCode: t.serviceCode, systemCode: t.tableSysCode ? t.tableSysCode : e.systemCode, systemVersion: t.tableSysCode ? t.tableSysCode : e.systemCode }, t.serviceInputs) {
62
+ const e2 = [];
63
+ for (const o2 of t.serviceInputs) {
64
+ if (!o2.name || o2.value)
120
65
  continue;
121
- }
122
- const tempObj = {};
123
- Object.assign(tempObj, f);
124
- searchForm.push(tempObj);
66
+ const t2 = {};
67
+ Object.assign(t2, o2), e2.push(t2);
125
68
  }
126
- infoObj.props.inputs = searchForm;
69
+ o.props.inputs = e2;
127
70
  }
128
- infoObj.props.dataSetField = dataOriginInfo.serviceDataSetField;
129
- infoObj.props.valueField = dataOriginInfo.serviceValueField;
130
- infoObj.props.labelField = dataOriginInfo.serviceLabelField;
131
- return infoObj;
71
+ return o.props.dataSetField = t.serviceDataSetField, o.props.valueField = t.serviceValueField, o.props.labelField = t.serviceLabelField, o;
132
72
  }
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
- }
73
+ function updateChartDatasources(t, e, o, n) {
74
+ return new Promise((a, r) => {
75
+ if (!e || 0 == e.length)
76
+ return void r(new Error("无需查询的统计图配置!"));
77
+ const s = deepCopy(e);
78
+ s.forEach((e2) => {
79
+ const o2 = e2.services;
80
+ if (o2 && o2.length > 0) {
81
+ let e3 = o2[0].serviceInputs;
82
+ e3 && (o2[0].serviceInParams = {}, e3.forEach((e4) => {
83
+ const n2 = e4.name, a2 = e4.value;
84
+ o2[0].serviceInParams[n2] = getValueFromVariable(t.entity, a2);
85
+ }), delete o2[0].serviceInputs);
161
86
  }
162
87
  });
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) => {
88
+ const i = t.entity ? t.entity : {}, u = {};
89
+ i.request && Object.assign(u, i.request), i.page && Object.assign(u, i.page), o && Object.assign(u, o);
90
+ const l = {};
91
+ i.task && Object.assign(l, i.task);
92
+ 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";
93
+ http.post(f, c).then((e2) => {
190
94
  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
- }
95
+ t.chartDataSourceMap || (t.chartDataSourceMap = {});
96
+ for (const o2 in e2) {
97
+ t.chartDataSourceMap[o2] = e2[o2];
98
+ const a2 = getComponentRef(t, o2);
99
+ if (a2) {
100
+ const r2 = a2.getConfigure();
101
+ 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)) {
102
+ const n2 = e2[o2] && e2[o2].length > 0 ? e2[o2][0] : {}, a3 = n2 && n2.result ? n2.result : {};
103
+ let s2 = null;
104
+ r2.serviceDataField ? s2 = a3[r2.serviceDataField] : a3 && (s2 = Array.isArray(a3) ? a3 : [a3]), s2 || (s2 = []), setValueForVariableName(t.entity, r2.runtime.dataConfig.resultSet, s2);
227
105
  }
228
106
  }
229
107
  }
230
- console.log("查询统计图数据完成", result);
231
- resolve(result);
232
- }).catch((error) => {
233
- console.log("查询统计图数据失败", error);
234
- reject(error);
108
+ a(e2);
109
+ }).catch((t2) => {
110
+ r(t2);
235
111
  });
236
112
  });
237
113
  }
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
- }
114
+ function updateChartDatasourcesByComponent(t, e) {
115
+ const o = t.initChartServiceConfigs.find((t2) => t2.uuid === e);
116
+ o && updateChartDatasources(t, [o], null, false);
245
117
  }
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 = {};
274
- }
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
- }
118
+ function updateOptionDatasources(t, e, o) {
119
+ return new Promise((n, a) => {
120
+ if (!e || 0 == e.length)
121
+ return void a(new Error("无需查询的配置!"));
122
+ const r = t.entity ? t.entity : {}, s = {};
123
+ r.request && Object.assign(s, r.request), r.page && Object.assign(s, r.page), s.query = o;
124
+ 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";
125
+ http.post(l, i).then((e2) => {
126
+ t.optionSourceMap || (t.optionSourceMap = {});
127
+ for (const o2 in e2) {
128
+ t.optionSourceMap[o2] = e2[o2];
129
+ const n2 = getComponentRef(t, o2);
130
+ n2 && n2.updateOptions && n2.updateOptions(e2[o2]);
281
131
  }
282
- console.log("查询选项数据完成", result);
283
- resolve(result);
284
- }).catch((error) => {
285
- console.log("查询选项数据失败", error);
286
- reject(error);
132
+ n(e2);
133
+ }).catch((t2) => {
134
+ a(t2);
287
135
  });
288
136
  });
289
137
  }
290
- function getOptionDatasFromPage(pageContext2, configure) {
291
- return getComponentOptionDatasFromPage(pageContext2, configure.uuid);
138
+ function getOptionDatasFromPage(t, e) {
139
+ return getComponentOptionDatasFromPage(t, e.uuid);
292
140
  }
293
- function getComponentOptionDatasFromPage(pageContext2, configureUuid) {
294
- const optionSourceMap = getOptionDatasSourceMap(pageContext2);
295
- const cacheOptions = optionSourceMap[configureUuid];
296
- return cacheOptions ? cacheOptions : [];
141
+ function getComponentOptionDatasFromPage(t, e) {
142
+ const o = getOptionDatasSourceMap(t)[e];
143
+ return o || [];
297
144
  }
298
- function getOptionDatasSourceMap(pageContext2) {
299
- if (!pageContext2 || !pageContext2.optionSourceMap) {
145
+ function getOptionDatasSourceMap(t) {
146
+ if (!t || !t.optionSourceMap)
300
147
  return {};
301
- }
302
- const cacheOptions = pageContext2.optionSourceMap;
303
- return cacheOptions ? cacheOptions : {};
148
+ const e = t.optionSourceMap;
149
+ return e || {};
304
150
  }
305
- function getChartDatasFromPage(pageContext2, configure) {
306
- if (!pageContext2 || !pageContext2.chartDataSourceMap || !configure) {
151
+ function getChartDatasFromPage(t, e) {
152
+ if (!t || !t.chartDataSourceMap || !e)
307
153
  return null;
308
- }
309
- const cacheDatas = pageContext2.chartDataSourceMap[configure.uuid];
310
- return cacheDatas;
154
+ return t.chartDataSourceMap[e.uuid];
311
155
  }
312
- function queryOptionDatasources(pageContext2, dataSourceConf, query) {
313
- return updateOptionDatasources(pageContext2, dataSourceConf ? [dataSourceConf] : [], query);
156
+ function queryOptionDatasources(t, e, o) {
157
+ return updateOptionDatasources(t, e ? [e] : [], o);
314
158
  }
315
- function autoSetAfterSelect(component, pageContext2, autoSets, selItems) {
316
- if (!autoSets || autoSets.length == 0) {
159
+ function autoSetAfterSelect(t, e, o, n) {
160
+ if (!o || 0 == o.length)
317
161
  return;
318
- }
319
- const entity = pageContext2.entity ? pageContext2.entity : {};
320
- for (const as of autoSets) {
321
- if (!as.source || !as.target) {
162
+ const a = e.entity ? e.entity : {};
163
+ for (const t2 of o) {
164
+ if (!t2.source || !t2.target)
322
165
  continue;
323
- }
324
- const values = getValuesByField(selItems, as.source);
325
- let targetField = as.target;
326
- if (!targetField || !targetField.startsWith("${")) {
166
+ const e2 = getValuesByField(n, t2.source);
167
+ let o2 = t2.target;
168
+ if (!o2 || !o2.startsWith("${"))
327
169
  continue;
328
- }
329
- targetField = targetField.substring(2, targetField.length - 1);
330
- const fields = targetField.split(".");
331
- setVariableValue(entity, fields, values.join(","));
170
+ o2 = o2.substring(2, o2.length - 1);
171
+ setVariableValue(a, o2.split("."), e2.join(","));
332
172
  }
333
173
  }
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);
174
+ function getValuesByField(t, e) {
175
+ if (t) {
176
+ const o = [];
177
+ for (const n of t) {
178
+ let t2 = n[e];
179
+ null != t2 && null != t2 || (t2 = ""), o.push(t2);
345
180
  }
346
- return values;
181
+ return o;
347
182
  }
183
+ return [""];
348
184
  }
349
- function getVariableValue(entity, fields) {
350
- if (!entity || !fields || fields.length == 0) {
185
+ function getVariableValue(t, e) {
186
+ if (!t || !e || 0 == e.length)
351
187
  return;
188
+ let o = t;
189
+ for (let t2 = 0; t2 < e.length; t2++) {
190
+ if (null == o)
191
+ return o;
192
+ o = o[e[t2]];
352
193
  }
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;
194
+ return o;
362
195
  }
363
- function setValueForVariableName(entity, variableName, newValue) {
364
- if (!variableName || !variableName.startsWith("${")) {
196
+ function setValueForVariableName(t, e, o) {
197
+ if (!e || !e.startsWith("${"))
365
198
  return;
366
- }
367
- variableName = variableName.substring(2, variableName.length - 1);
368
- const fields = variableName.split(".");
369
- setVariableValue(entity, fields, newValue);
199
+ setVariableValue(t, (e = e.substring(2, e.length - 1)).split("."), o);
370
200
  }
371
- function setVariableValue(entity, fields, newValue) {
372
- if (!entity || !fields || fields.length == 0) {
201
+ function setVariableValue(t, e, o) {
202
+ if (!t || !e || 0 == e.length)
373
203
  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
- }
204
+ let n = t;
205
+ for (let t2 = 0; t2 < e.length; t2++) {
206
+ const a = e[t2];
207
+ t2 + 1 === e.length ? n[a] = o : (void 0 === n[a] && (n[a] = {}), n = n[a]);
386
208
  }
387
209
  }
388
- function setVariableValueWithProp(entity, prop, newValue) {
389
- if (!entity || !prop) {
210
+ function setVariableValueWithProp(t, e, o) {
211
+ if (!t || !e)
390
212
  return;
391
- }
392
- const fields = prop.split(".");
393
- setVariableValue(entity, fields, newValue);
213
+ setVariableValue(t, e.split("."), o);
394
214
  }
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;
215
+ function formatVariableValue(t, e) {
216
+ if (!t || "" == e || null == e || null == e)
217
+ return e;
218
+ const o = t.entity ? t.entity : {}, n = getParamNames(e);
219
+ for (const t2 in n) {
220
+ const a = n[t2], r = getValueFromVariable(o, a);
221
+ e = e.replace(a, null == r ? "" : r);
222
+ }
223
+ return e;
410
224
  }
411
- function getParamNames(variable) {
412
- if (!variable) {
225
+ function getParamNames(t) {
226
+ if (!t)
413
227
  return [];
414
- }
415
- const reg = /\$\{[^\{|\}]+\}/g;
416
- const paramNames = variable.match(reg);
417
- return paramNames ? paramNames : [];
228
+ const e = t.match(/\$\{[^\{|\}]+\}/g);
229
+ return e || [];
418
230
  }
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;
231
+ function formatValueByType(t, e, o) {
232
+ if (!e || "" == t || null == t || null == t)
233
+ return t;
234
+ if (o = o || {}, "number" == e || "percent" == e) {
235
+ if (isNaN(t))
236
+ return t;
237
+ let n = parseInt(o.decimalDigit);
238
+ if ((null == n || isNaN(n)) && (n = -1), t = parseFloat(t), "percent" == e && (t *= 100), n > -1 && (t = parseFloat(t.toFixed(n))), "percent" == e)
239
+ t += "%";
240
+ else {
241
+ if (o.thousandsSeparator) {
242
+ const e2 = t.toString().split(".");
243
+ e2[0] = e2[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), t = e2.length > 1 ? e2.join(".") : e2[0];
450
244
  }
245
+ o.symbol && (t = o.symbol + "" + t);
451
246
  }
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";
464
- }
465
- }
466
- return dayjs(value).format(formatStr);
467
- } else if (formatType == "custom" && formatInfo.formatEventUuid) {
468
- console.log("自定义方法", formatInfo);
469
- }
470
- return value;
471
- }
472
- function getValueFromVariable(entity, variable, row2) {
473
- if (variable == null || variable == void 0) {
474
- return variable;
247
+ return t;
475
248
  }
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;
249
+ if ("date" == e || "time" == e) {
250
+ let n = "";
251
+ return "date" == e ? (n = o.dateFormat, n || (n = "YYYY-MM-DD")) : (n = o.timeFormat, n || (n = "HH:mm:ss")), dayjs(t).format(n);
518
252
  }
253
+ return "custom" == e && o.formatEventUuid, t;
519
254
  }
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];
255
+ function getValueFromVariable(t, e, o) {
256
+ if (null == e || null == e)
257
+ return e;
258
+ if (e.startsWith("${") && e.endsWith("}")) {
259
+ let n = e.substring(2, e.length - 1), a = null, r = null;
260
+ if (n.startsWith("data."))
261
+ n = n.substring(5), r = t.data, a = "data";
262
+ else if (n.startsWith("page."))
263
+ n = n.substring(5), a = "page", r = t.page;
264
+ else if (n.startsWith("task."))
265
+ n = n.substring(5), a = "task", r = t.task;
266
+ else if (n.startsWith("request."))
267
+ n = n.substring(8), a = "request", r = t.request;
268
+ else if (n.startsWith("context."))
269
+ n = n.substring(8), a = "context", r = t.context;
270
+ else if (n.startsWith("system."))
271
+ n = n.substring(7), a = "system", r = t.system;
272
+ else {
273
+ if (n.startsWith("fixed."))
274
+ return n.substring(6);
275
+ n.startsWith("row.") && (n = n.substring(4), r = o, a = "row");
276
+ }
277
+ return n ? getValueFromSource(r, n, a) : "";
278
+ }
279
+ return e;
280
+ }
281
+ function getValueFromSource(t, e, o) {
282
+ if ("context" != o && !t || !e)
283
+ return;
284
+ const n = e.indexOf(".");
285
+ if (n > -1) {
286
+ const a = e.substring(0, n), r = e.substring(n + 1);
287
+ let s = t[a];
288
+ return s && Array.isArray(s) && s.length > 0 && (s = s[0]), getValueFromSource(s, r, o);
289
+ }
290
+ if ("context" == o) {
291
+ if ("currentDate" == e || "currentTime" == e)
292
+ return /* @__PURE__ */ new Date();
293
+ if (e.startsWith("currentDate") && e.length > 11) {
294
+ const t2 = e.substring(11), o2 = t2.substring(0, 1);
295
+ let n2 = parseInt(t2.substring(1, t2.length - 1), 10);
296
+ const a = t2.substring(t2.length - 1), r = /* @__PURE__ */ new Date();
297
+ 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;
298
+ }
299
+ if (!t)
300
+ return;
559
301
  }
302
+ return t[e];
560
303
  }
561
304
  function caculateShowCondition(pageContext, showConditions, row) {
562
- if (!showConditions || showConditions.length == 0 || !pageContext || !pageContext.entity) {
305
+ if (!showConditions || 0 == showConditions.length || !pageContext || !pageContext.entity)
563
306
  return true;
564
- }
565
307
  const entityData = pageContext.entity;
566
308
  let conditions = "";
567
309
  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 === "") {
310
+ for (let t = 0; t < maxLen; t++) {
311
+ const e = showConditions[t], o = e.propName;
312
+ let n = e.operator;
313
+ if (!o || "" === o)
573
314
  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) {
315
+ n || (n = "EQ");
316
+ const a = getValueFromVariable(entityData, o, row);
317
+ let r = getValueFromVariable(entityData, e.propValue, row);
318
+ const s = e.dataType;
319
+ "CONTAIN" != n && "NOT_CONTAIN" != n || a && !a.includes && (n = "CONTAIN" == n ? "EQ" : "NET");
320
+ let i = e.variableIsNull, u;
321
+ 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)
602
322
  try {
603
- conditionResult = executeExpression(leftValue, operator, propValue, dataType);
604
- } catch (e) {
605
- console.log("executeExpression error", e);
606
- conditionResult = false;
323
+ u = executeExpression(a, n, r, s);
324
+ } catch (t2) {
325
+ u = false;
607
326
  }
327
+ const l = e.leftBracket, c = e.rightBracket;
328
+ let p = e.joinSign;
329
+ if (l && null !== l && "" !== l && (conditions += l, conditions += " "), conditions += u + " ", c && null !== c && "" !== c && (conditions += c, conditions += " "), t < maxLen - 1 && p && null !== p && "" !== p) {
330
+ const t2 = p.toLowerCase();
331
+ "and" === t2 ? p = t2.replace("and", "&&") : "or" === t2 && (p = t2.replace("or", "||")), conditions += p + " ";
608
332
  }
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
333
  }
334
+ return !conditions || eval("(" + conditions + ")");
638
335
  }
639
- function monitorFieldChange(pageContext2, monitorFields, triggerFunc) {
640
- if (!triggerFunc || !pageContext2 || !monitorFields || monitorFields.length == 0) {
336
+ function monitorFieldChange(t, e, o) {
337
+ if (!o || !t || !e || 0 == e.length)
641
338
  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
- }
339
+ const n = [], a = [];
340
+ for (let t2 of e)
341
+ if (t2.startsWith("${")) {
342
+ t2 = t2.substring(2, t2.length - 1);
343
+ const e2 = t2.split(".");
344
+ "page" !== e2[0] && "task" !== e2[0] && "data" !== e2[0] || (n.push(e2), a.includes(e2[0]) || a.push(e2[0]));
345
+ }
346
+ const r = t.entity;
347
+ let s = getMonitorFieldValues(n, r), i = false;
348
+ for (const t2 of a)
349
+ watch(r[t2], () => {
350
+ i && clearTimeout(i), i = setTimeout(function() {
351
+ const t3 = getMonitorFieldValues(n, r);
352
+ s != t3 && (s = t3, o());
671
353
  }, 200);
672
354
  });
673
- }
674
355
  }
675
- function getMonitorFieldValues(monitorFieldInfos, entity) {
676
- let values = "";
677
- for (const fieldInfo of monitorFieldInfos) {
678
- values += "_" + getVariableValue(entity, fieldInfo);
679
- }
680
- return values;
356
+ function getMonitorFieldValues(t, e) {
357
+ let o = "";
358
+ for (const n of t)
359
+ o += "_" + getVariableValue(e, n);
360
+ return o;
681
361
  }
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
- }
362
+ function getFormPropName(t) {
363
+ return t && t.indexOf("${") >= 0 ? t.substring(t.indexOf(".") + 1, t.lastIndexOf("}")) : t;
688
364
  }
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;
365
+ function getSizeConfig(t, e) {
366
+ const o = getPageModeType(t);
367
+ let n;
368
+ 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
369
  }
700
- function getPageModeType(pageContext2) {
701
- let dimensions = pageContext2.dimensions;
702
- if (!dimensions) {
703
- dimensions = "pc";
704
- }
705
- return dimensions;
370
+ function getPageModeType(t) {
371
+ let e = t.dimensions;
372
+ return e || (e = "pc"), e;
706
373
  }
707
- function isPromise(p) {
708
- return p && Object.prototype.toString.call(p) === "[object Promise]";
374
+ function isPromise(t) {
375
+ return t && "[object Promise]" === Object.prototype.toString.call(t);
709
376
  }
710
- function decomposeVariable(variable) {
711
- if (!variable) {
377
+ function decomposeVariable(t) {
378
+ if (!t)
712
379
  return [];
713
- }
714
- const paramNames = variable.match(/\${(.*?)}/);
715
- return paramNames ? paramNames[1].split(".") : [];
380
+ const e = t.match(/\${(.*?)}/);
381
+ return e ? e[1].split(".") : [];
716
382
  }
717
383
  export {
718
384
  autoSetAfterSelect,