super-page-runtime 2.1.932 → 2.2.0

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