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

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