super-page-runtime 2.1.933 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/dist/es/_virtual/_plugin-vue_export-helper.js +5 -7
  2. package/dist/es/assets/chart-themes/theme1.js +2 -6
  3. package/dist/es/assets/chart-themes/theme2.js +2 -6
  4. package/dist/es/assets/chart-themes/theme3.js +2 -6
  5. package/dist/es/components/runtime/index.d.ts +2 -1
  6. package/dist/es/components/runtime/utils/api/api-util.js +4 -7
  7. package/dist/es/components/runtime/utils/api/page-expose-util.js +137 -435
  8. package/dist/es/components/runtime/utils/assemblys-config.js +11 -367
  9. package/dist/es/components/runtime/utils/barcode-util.js +9 -33
  10. package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +122 -306
  11. package/dist/es/components/runtime/utils/charts/chart-gauge-util.js +29 -68
  12. package/dist/es/components/runtime/utils/charts/chart-pie-util.js +68 -152
  13. package/dist/es/components/runtime/utils/charts/chart-radar-util.js +46 -124
  14. package/dist/es/components/runtime/utils/charts/chart-scatter-util.js +36 -99
  15. package/dist/es/components/runtime/utils/charts/chart-util.d.ts +1 -0
  16. package/dist/es/components/runtime/utils/charts/chart-util.js +226 -485
  17. package/dist/es/components/runtime/utils/common-util.js +76 -153
  18. package/dist/es/components/runtime/utils/eventBus.js +3 -9
  19. package/dist/es/components/runtime/utils/events/event-util.js +343 -727
  20. package/dist/es/components/runtime/utils/events/print-label.js +72 -140
  21. package/dist/es/components/runtime/utils/events/standard-event.d.ts +2 -2
  22. package/dist/es/components/runtime/utils/events/standard-event.js +810 -2299
  23. package/dist/es/components/runtime/utils/events/validator-util.js +222 -552
  24. package/dist/es/components/runtime/utils/form/date-shortcuts.js +28 -88
  25. package/dist/es/components/runtime/utils/form/scan-util.js +61 -162
  26. package/dist/es/components/runtime/utils/global-refs.js +53 -84
  27. package/dist/es/components/runtime/utils/i18n-util.js +11 -20
  28. package/dist/es/components/runtime/utils/interfaces/page-design-types.d.ts +2 -0
  29. package/dist/es/components/runtime/utils/interfaces/page-design-types.js +2 -7
  30. package/dist/es/components/runtime/utils/page-helper-util.js +278 -658
  31. package/dist/es/components/runtime/utils/page-init-util.d.ts +6 -1
  32. package/dist/es/components/runtime/utils/page-init-util.js +132 -370
  33. package/dist/es/components/runtime/utils/page-permission-util.js +22 -531
  34. package/dist/es/components/runtime/utils/page-store.d.ts +2 -2
  35. package/dist/es/components/runtime/utils/page-store.js +8 -12
  36. package/dist/es/components/runtime/utils/store-util.js +9 -13
  37. package/dist/es/components/runtime/utils/store.js +2 -2
  38. package/dist/es/components/runtime/utils/table-utils.js +45 -84
  39. package/dist/es/components/runtime/utils/tree-utils.js +17 -37
  40. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue.js +2 -2
  41. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +19 -75
  42. package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue.js +2 -2
  43. package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue2.js +14 -46
  44. package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue.js +2 -2
  45. package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +36 -132
  46. package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue.js +2 -2
  47. package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue2.js +4 -18
  48. package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue.js +2 -2
  49. package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue2.js +17 -107
  50. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue.js +2 -2
  51. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +50 -198
  52. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue.js +12 -42
  53. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue2.js +2 -2
  54. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue.js +7 -60
  55. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue2.js +2 -2
  56. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue.js +52 -169
  57. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue2.js +2 -2
  58. package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue.js +44 -0
  59. package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue2.js +4 -0
  60. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue.js +2 -2
  61. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +32 -107
  62. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue.js +2 -2
  63. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +43 -164
  64. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue.js +2 -2
  65. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +32 -115
  66. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue.js +2 -2
  67. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +32 -116
  68. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.d.ts +34 -1
  69. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +253 -449
  70. package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue.js +4 -42
  71. package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue2.js +2 -2
  72. package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue.js +8 -62
  73. package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue2.js +2 -2
  74. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +37 -231
  75. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue2.js +2 -2
  76. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue.js +13 -62
  77. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue2.js +2 -2
  78. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue.js +2 -2
  79. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +197 -510
  80. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.d.ts +4 -4
  81. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +29 -139
  82. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue2.js +2 -2
  83. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue.d.ts +6 -6
  84. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue.js +21 -125
  85. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue2.js +2 -2
  86. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue.d.ts +6 -6
  87. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue.js +16 -102
  88. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue2.js +2 -2
  89. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue.js +2 -2
  90. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue2.js +18 -81
  91. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue.js +2 -2
  92. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue2.js +17 -82
  93. package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue.js +2 -2
  94. package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue2.js +14 -86
  95. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue.js +2 -2
  96. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +21 -79
  97. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue.js +2 -2
  98. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue2.js +16 -61
  99. package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue.js +2 -2
  100. package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue2.js +10 -37
  101. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue.js +2 -2
  102. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +38 -127
  103. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue.js +2 -2
  104. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +28 -76
  105. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue.js +2 -2
  106. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +61 -178
  107. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +302 -803
  108. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue2.js +2 -2
  109. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +249 -594
  110. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue2.js +2 -2
  111. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue.js +2 -2
  112. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +40 -115
  113. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue.js +2 -2
  114. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +56 -215
  115. package/dist/es/components/runtime/views/assemblys/error-render.vue.d.ts +4 -4
  116. package/dist/es/components/runtime/views/assemblys/error-render.vue.js +3 -21
  117. package/dist/es/components/runtime/views/assemblys/error-render.vue2.js +2 -2
  118. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue.js +2 -2
  119. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +42 -154
  120. package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue.js +34 -98
  121. package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue2.js +2 -2
  122. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue.js +2 -2
  123. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +52 -200
  124. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue.js +2 -2
  125. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +66 -239
  126. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue.js +2 -2
  127. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +31 -104
  128. package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue.js +2 -2
  129. package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue2.js +21 -59
  130. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue.js +2 -2
  131. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +51 -173
  132. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue.js +2 -2
  133. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +22 -103
  134. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue.js +2 -2
  135. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +57 -249
  136. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue.js +2 -2
  137. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +32 -174
  138. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue.js +2 -2
  139. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +28 -107
  140. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +4 -4
  141. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue2.js +13 -50
  142. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue.js +2 -2
  143. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +61 -189
  144. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue.js +2 -2
  145. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +87 -244
  146. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue.js +2 -2
  147. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +77 -261
  148. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue.js +2 -2
  149. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue2.js +13 -57
  150. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue.js +2 -2
  151. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +30 -155
  152. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue.js +2 -2
  153. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +40 -129
  154. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue.js +2 -2
  155. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +22 -107
  156. package/dist/es/components/runtime/views/assemblys/home-chart-render.vue.d.ts +17 -0
  157. package/dist/es/components/runtime/views/assemblys/home-chart-render.vue.js +97 -0
  158. package/dist/es/components/runtime/views/assemblys/home-chart-render.vue2.js +4 -0
  159. package/dist/es/components/runtime/views/assemblys/object-render.vue.d.ts +1 -1
  160. package/dist/es/components/runtime/views/assemblys/object-render.vue.js +125 -254
  161. package/dist/es/components/runtime/views/assemblys/object-render.vue2.js +2 -2
  162. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue.js +2 -2
  163. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue2.js +18 -46
  164. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue.js +2 -2
  165. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue2.js +21 -49
  166. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue.js +2 -2
  167. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +20 -58
  168. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue.js +2 -2
  169. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue2.js +16 -53
  170. package/dist/es/components/runtime/views/home-chart.vue.d.ts +23 -0
  171. package/dist/es/components/runtime/views/home-chart.vue.js +36 -0
  172. package/dist/es/components/runtime/views/home-chart.vue2.js +4 -0
  173. package/dist/es/components/runtime/views/super-page-dialog.vue.d.ts +3 -3
  174. package/dist/es/components/runtime/views/super-page-dialog.vue.js +20 -134
  175. package/dist/es/components/runtime/views/super-page-dialog.vue2.js +2 -2
  176. package/dist/es/components/runtime/views/super-page.vue.d.ts +15 -6
  177. package/dist/es/components/runtime/views/super-page.vue.js +222 -708
  178. package/dist/es/components/runtime/views/super-page.vue2.js +2 -2
  179. package/dist/es/i18n/langs/cn.js +2 -55
  180. package/dist/es/i18n/langs/en.js +2 -55
  181. package/dist/es/index.d.ts +2 -2
  182. package/dist/es/index.js +6 -4
  183. package/package.json +3 -2
@@ -1,451 +1,153 @@
1
- import { setValueForVariableName, getOptionDatasSourceMap, getComponentOptionDatasFromPage, getVariableValue, setVariableValue } from "../page-helper-util.js";
2
- import { getComponentRefByCode, getComponentRef } from "../global-refs.js";
3
- import eventBus from "../eventBus.js";
4
- import http from "agilebuilder-ui/src/utils/request";
5
- import { getAdditionalParamMap, refreshPage, getFormData } from "../events/standard-event.js";
6
- import { updateFormItemEditState, disabledAllFields, dynamicControlTableEdit } from "../events/validator-util.js";
7
- import { getBaseUrl, deepCopy } from "../common-util.js";
8
- import { isMobileBrowser } from "agilebuilder-ui/src/utils/common-util";
9
- import { getFormModelFields, getModelFields } from "../page-init-util.js";
10
- const functions = {
11
- /**
12
- * 展示页面中的某个组件元素
13
- * @param pageDesign 页面设计对象
14
- * @param codes 展示组件所绑定的变量或者是绑定的code值, 绑定变量时传递变量名, 如果绑定的变量为${data.xxx}则传递xxx
15
- */
16
- showElement: function(pageContext, codes, isInit) {
17
- if (isInit) {
18
- packageInitInfo(pageContext, "showElement", codes);
19
- } else {
20
- codes.forEach((code) => {
21
- const ref = getComponentRefByCode(pageContext, code);
22
- if (ref) {
23
- ref.show();
24
- } else {
25
- console.error(`未找到code为${code}的组件`);
26
- }
27
- });
28
- }
29
- },
30
- /**
31
- * 隐藏页面中的某个组件元素
32
- * @param pageDesign 页面设计对象
33
- * @param codes 展示组件所绑定的变量或者是绑定的code值, 绑定变量时传递变量名, 如果绑定的变量为${data.xxx}则传递xxx
34
- */
35
- hideElement: function(pageContext, codes, isInit) {
36
- if (isInit) {
37
- packageInitInfo(pageContext, "hideElement", codes);
38
- } else {
39
- codes.forEach((code) => {
40
- const ref = getComponentRefByCode(pageContext, code);
41
- if (ref) {
42
- ref.hide();
43
- } else {
44
- console.error(`未找到code为${code}的组件`);
45
- }
46
- });
47
- }
48
- },
49
- /**
50
- * 设置组件元素可用状态
51
- * @param pageContext
52
- * @param codes ['name', 'age']
53
- */
54
- enableElement: function(pageContext, codes, isInit) {
55
- if (isInit) {
56
- packageInitInfo(pageContext, "enableElement", codes);
57
- } else {
58
- codes.forEach((code) => {
59
- const ref = getComponentRefByCode(pageContext, code);
60
- if (ref) {
61
- const configure = ref.getConfigure();
62
- if (configure && configure.runtime.props) {
63
- configure.runtime.props.state = "enabled";
64
- }
65
- } else {
66
- console.error(`未找到code为${code}的组件`);
67
- }
68
- });
69
- }
70
- },
71
- /**
72
- * 禁用页面中的某个组件元素
73
- * @param pageContext
74
- * @param codes ['name', 'age']
75
- */
76
- disableElement: function(pageContext, codes, isInit) {
77
- if (isInit) {
78
- packageInitInfo(pageContext, "disableElement", codes);
79
- } else {
80
- codes.forEach((code) => {
81
- const ref = getComponentRefByCode(pageContext, code);
82
- if (ref) {
83
- const configure = ref.getConfigure();
84
- if (configure && configure.runtime.props) {
85
- configure.runtime.props.state = "disabled";
86
- }
87
- } else {
88
- console.error(`未找到code为${code}的组件`);
89
- }
90
- });
91
- }
92
- },
93
- /**
94
- * 设置值
95
- * @param pageDesign 页面设计对象
96
- * @param keyValue {"name":"xxx",age:1,addr:"bj"} 展示组件所绑定的变量或者是绑定的code值, 绑定变量时传递变量名, 如果绑定的变量为${data.xxx}则传递xxx
97
- */
98
- setEntityDataValue: function(pageContext, keyValue) {
99
- Object.keys(keyValue).forEach((key) => {
100
- setValueForVariableName(
101
- pageContext.entity,
102
- key.startsWith("${") ? key : "${data." + key + "}",
103
- keyValue[key]
104
- );
105
- });
106
- },
107
- /**
108
- * 设置值
109
- * @param pageDesign 页面设计对象
110
- * @param keyValue {"name":"xxx",age:1,addr:"bj"} 展示组件所绑定的变量或者是绑定的code值, 绑定变量时传递变量名, 如果绑定的变量为${data.xxx}则传递xxx
111
- */
112
- setEntityPageValue: function(pageContext, keyValue) {
113
- Object.keys(keyValue).forEach((key) => {
114
- setValueForVariableName(
115
- pageContext.entity,
116
- key.startsWith("${") ? key : "${page." + key + "}",
117
- keyValue[key]
118
- );
119
- });
120
- },
121
- setEntityValueByType: function(pageContext, type, keyValue) {
122
- Object.keys(keyValue).forEach((key) => {
123
- setValueForVariableName(
124
- pageContext.entity,
125
- key.startsWith("${") ? key : "${" + type + "." + key + "}",
126
- keyValue[key]
127
- );
128
- });
129
- },
130
- /**
131
- * 表单编辑权限动态控制
132
- * @param pageContext
133
- * @param keyValue [
134
- {
135
- name: '_all_fields', // _all_fields 表示所有字段
136
- show: true,
137
- readonly: true,
138
- disabled: true,
139
- required: true,
140
- rules: [
141
- {
142
- required: true,
143
- trigger: 'blur'
144
- },
145
- {
146
- type: 'email',
147
- trigger: ['blur', 'change']
148
- }
149
- ]
150
- },
151
- {
152
- name: 'xxxx',
153
- show: true,
154
- readonly: true,
155
- disabled: true,
156
- required: true,
157
- rules: [
158
- {
159
- required: true,
160
- message: 'Please input email address',
161
- trigger: 'blur'
162
- },
163
- {
164
- type: 'email',
165
- message: 'Please input correct email address',
166
- trigger: ['blur', 'change']
167
- }
168
- ]
169
- }
170
- ]
171
- */
172
- dynamicControlFormEdit: function(pageContext, rules, isInit) {
173
- if (isInit) {
174
- packageInitInfo(pageContext, "dynamicControlFormEdit", rules);
175
- } else {
176
- updateFormItemEditState(pageContext, rules);
177
- }
178
- },
179
- /**
180
- * 禁用所有字段
181
- * @param pageContext 页面上下文
182
- */
183
- disabledAllFields(pageContext) {
184
- disabledAllFields(pageContext);
185
- },
186
- /**
187
- * 控制表格编辑权限
188
- * @param pageContext 页面上下文
189
- * @param rules
190
- * @param tableCode 列表的“自定义编码”配置
191
- */
192
- dynamicControlTableEdit(pageContext, rules, tableCode) {
193
- dynamicControlTableEdit(pageContext, rules, tableCode);
194
- },
195
- /**
196
- * 调用服务流,
197
- * @param pageContext
198
- * @param flowCode
199
- * @returns
200
- */
201
- executeServiceFlow: function(pageContext, flowCode, params) {
202
- const pageCode = pageContext.code;
203
- if (!params) {
204
- params = {
205
- entity: pageContext.entity.data,
206
- serviceVariables: {},
207
- requestParams: getAdditionalParamMap(pageContext),
208
- taskParamMap: pageContext.entity.task,
209
- dynamicDimensionValue: [],
210
- dynamicSortValue: ""
211
- };
212
- }
213
- if (!params.entity) {
214
- params.entity = pageContext.entity.data;
215
- }
216
- if (!params.requestParams) {
217
- params.requestParams = getAdditionalParamMap(pageContext);
218
- }
219
- if (!params.taskParamMap) {
220
- params.taskParamMap = pageContext.entity.task;
221
- }
222
- const backendUrl = pageContext.backendUrl;
223
- const baseUrl = getBaseUrl(backendUrl, pageContext.isTest);
224
- return http.post(`${baseUrl}/dsc/service-flow/execute/${pageCode}/${flowCode}`, params);
225
- },
226
- openPage: function(pageContext, openParam) {
227
- eventBus.$emit(pageContext.code + "_open-dialog", {
228
- pageContext,
229
- eventParams: openParam.eventParams,
230
- configureObj: { props: { linkPage: openParam } }
231
- });
232
- },
233
- /**
234
- * 刷新页面
235
- * @param pageContext
236
- */
237
- refreshPage: function(pageContext, id) {
238
- refreshPage(pageContext, id);
239
- },
240
- /**
241
- * 刷新表单中子表内容
242
- * @param {*} pageContext 页面配置信息
243
- * @param {*} tableCode 表格组件中“自定义编码”的值
244
- */
245
- refreshSubTableHandle: function(pageContext, tableCode) {
246
- let tableUuid;
247
- const ref = getComponentRefByCode(pageContext, tableCode);
248
- if (ref) {
249
- const configure = ref.getConfigure();
250
- if (configure && configure.uuid && configure.name && configure.name === "table") {
251
- tableUuid = configure.uuid;
252
- }
253
- }
254
- if (tableUuid) {
255
- eventBus.$emit("_refreshSubTableHandle_" + tableUuid);
256
- } else {
257
- console.error("tableUUid is undefined");
258
- }
259
- },
260
- // 对外开放的api方法更新子表集合
261
- refreshChildData(pageContext, tableCode, data) {
262
- let tableUuid;
263
- const ref = getComponentRefByCode(pageContext, tableCode);
264
- if (ref) {
265
- const configure = ref.getConfigure();
266
- if (configure && configure.uuid && configure.name && configure.name === "table") {
267
- tableUuid = configure.uuid;
268
- }
269
- }
270
- if (tableUuid) {
271
- setTimeout(() => {
272
- eventBus.$emit("_refreshChildData_" + tableUuid, data);
273
- }, 10);
274
- } else {
275
- console.error("tableUUid is undefined");
276
- }
277
- },
278
- // 根据key获得serverConfig中配置的信息
279
- getServerConfigValue(key) {
280
- return window["$vueApp"].config.globalProperties[key];
281
- },
282
- // 获得当前系统的后端访问路径
283
- getBackendUrl(pageContext) {
284
- return getBaseUrl(pageContext.backendUrl, false);
285
- },
286
- // 获得平台后端访问路径
287
- getPlateBackendUrl() {
288
- return window["$vueApp"].config.globalProperties.baseAPI;
289
- },
290
- // 获得实体
291
- getEntity(pageContext) {
292
- return pageContext.entity.data;
293
- },
294
- // 获得实体属性值
295
- getEntityValue(pageContext, key) {
296
- return pageContext.entity.data ? pageContext.entity.data[key] : null;
297
- },
298
- // 获得页面变量
299
- getPageData(pageContext) {
300
- return pageContext.entity.page;
301
- },
302
- // 获得页面变量属性值
303
- getPageDataValue(pageContext, key) {
304
- return pageContext.entity.page ? pageContext.entity.page[key] : null;
305
- },
306
- // 获得附加参数对象
307
- getAdditionalParams(pageContext) {
308
- return getAdditionalParamMap(pageContext);
309
- },
310
- // 获得某附加参数值
311
- getAdditionalParamValue(pageContext, key) {
312
- const param = getAdditionalParamMap(pageContext);
313
- return param ? param[key] : null;
314
- },
315
- // 是否是移动端
316
- isMobile() {
317
- return isMobileBrowser();
318
- },
319
- // 根据获取组件引用对象
320
- getComponentRefByProp(pageContext, prop) {
321
- return getComponentRefByCode(pageContext, prop);
322
- },
323
- // 根据组件唯一编码获取组件引用对象
324
- getComponentRefByCode(pageContext, code) {
325
- return getComponentRef(pageContext, code);
326
- },
327
- // 获得表单数据查看信息,例如:下拉框选项名等
328
- getFormViewData(pageContext) {
329
- var _a, _b, _c, _d, _e, _f, _g, _h;
330
- const entity = pageContext.entity ? pageContext.entity : {};
331
- const viewEntity = deepCopy(entity);
332
- const optionSourceMap = getOptionDatasSourceMap(pageContext);
333
- for (const uuid in optionSourceMap) {
334
- const cacheOptions = getComponentOptionDatasFromPage(pageContext, uuid);
335
- const componentRef = getComponentRef(pageContext, uuid);
336
- if (componentRef) {
337
- const componentConfigure = componentRef.getConfigure();
338
- if (componentConfigure) {
339
- if (((_b = (_a = componentConfigure.props) == null ? void 0 : _a.dataOrigin) == null ? void 0 : _b.optionValueSetType) && (((_d = (_c = componentConfigure.props) == null ? void 0 : _c.dataOrigin) == null ? void 0 : _d.optionValueSetType) === "static" || ((_f = (_e = componentConfigure.props) == null ? void 0 : _e.dataOrigin) == null ? void 0 : _f.optionValueSetType) === "optionGroup")) {
340
- if (componentConfigure.name && (componentConfigure.name === "select" && ((_h = (_g = componentConfigure.props) == null ? void 0 : _g.base) == null ? void 0 : _h.multiple) || componentConfigure.name === "checkbox")) {
341
- const dynamicFields = getFormModelFields(pageContext, componentConfigure);
342
- const propValue = getVariableValue(viewEntity, dynamicFields);
343
- if (propValue) {
344
- const propValues = propValue.split(",");
345
- const label = getSelectShowLable(propValues, cacheOptions);
346
- setVariableValue(viewEntity, dynamicFields, label);
347
- }
348
- } else {
349
- const dynamicFields = getFormModelFields(pageContext, componentConfigure);
350
- const propValue = getVariableValue(viewEntity, dynamicFields);
351
- const label = getSelectShowLable(propValue, cacheOptions);
352
- setVariableValue(viewEntity, dynamicFields, label);
353
- }
354
- }
1
+ import { getOptionDatasSourceMap as e, getComponentOptionDatasFromPage as t, getVariableValue as n, setVariableValue as i, setValueForVariableName as o } from "../page-helper-util.js";
2
+ import { getComponentRef as a, getComponentRefByCode as r } from "../global-refs.js";
3
+ import s from "../eventBus.js";
4
+ import l from "agilebuilder-ui/src/utils/request";
5
+ import { getFormData as c, getAdditionalParamMap as u, refreshPage as f } from "../events/standard-event.js";
6
+ import { dynamicControlTableEdit as m, disabledAllFields as p, updateFormItemEditState as d } from "../events/validator-util.js";
7
+ import { deepCopy as g, getBaseUrl as y } from "../common-util.js";
8
+ import { isMobileBrowser as b } from "agilebuilder-ui/src/utils/common-util";
9
+ import { getFormModelFields as h, getModelFields as E } from "../page-init-util.js";
10
+ import { getCustomFunc as P } from "../events/event-util.js";
11
+ const C = { showElement: function(e2, t2, n2) {
12
+ n2 ? $(e2, "showElement", t2) : t2.forEach((t3) => {
13
+ const n3 = r(e2, t3);
14
+ n3 && n3.show();
15
+ });
16
+ }, hideElement: function(e2, t2, n2) {
17
+ n2 ? $(e2, "hideElement", t2) : t2.forEach((t3) => {
18
+ const n3 = r(e2, t3);
19
+ n3 && n3.hide();
20
+ });
21
+ }, enableElement: function(e2, t2, n2) {
22
+ n2 ? $(e2, "enableElement", t2) : t2.forEach((t3) => {
23
+ const n3 = r(e2, t3);
24
+ if (n3) {
25
+ const e3 = n3.getConfigure();
26
+ e3 && e3.runtime.props && (e3.runtime.props.state = "enabled");
27
+ }
28
+ });
29
+ }, disableElement: function(e2, t2, n2) {
30
+ n2 ? $(e2, "disableElement", t2) : t2.forEach((t3) => {
31
+ const n3 = r(e2, t3);
32
+ if (n3) {
33
+ const e3 = n3.getConfigure();
34
+ e3 && e3.runtime.props && (e3.runtime.props.state = "disabled");
35
+ }
36
+ });
37
+ }, setEntityDataValue: function(e2, t2) {
38
+ Object.keys(t2).forEach((n2) => {
39
+ o(e2.entity, n2.startsWith("${") ? n2 : "${data." + n2 + "}", t2[n2]);
40
+ });
41
+ }, setEntityPageValue: function(e2, t2) {
42
+ Object.keys(t2).forEach((n2) => {
43
+ o(e2.entity, n2.startsWith("${") ? n2 : "${page." + n2 + "}", t2[n2]);
44
+ });
45
+ }, setEntityValueByType: function(e2, t2, n2) {
46
+ Object.keys(n2).forEach((i2) => {
47
+ o(e2.entity, i2.startsWith("${") ? i2 : "${" + t2 + "." + i2 + "}", n2[i2]);
48
+ });
49
+ }, dynamicControlFormEdit: function(e2, t2, n2) {
50
+ n2 ? $(e2, "dynamicControlFormEdit", t2) : d(e2, t2);
51
+ }, disabledAllFields(e2) {
52
+ p(e2);
53
+ }, dynamicControlTableEdit(e2, t2, n2) {
54
+ m(e2, t2, n2);
55
+ }, executeServiceFlow: function(e2, t2, n2) {
56
+ const i2 = e2.code;
57
+ n2 || (n2 = { entity: e2.entity.data, serviceVariables: {}, requestParams: u(e2), taskParamMap: e2.entity.task, dynamicDimensionValue: [], dynamicSortValue: "" }), n2.entity || (n2.entity = e2.entity.data), n2.requestParams || (n2.requestParams = u(e2)), n2.taskParamMap || (n2.taskParamMap = e2.entity.task);
58
+ const o2 = e2.backendUrl, a2 = y(o2, e2.isTest);
59
+ return l.post(`${a2}/dsc/service-flow/execute/${i2}/${t2}`, n2);
60
+ }, openPage: function(e2, t2) {
61
+ s.$emit(e2.code + "_open-dialog", { pageContext: e2, eventParams: t2.eventParams, configureObj: { props: { linkPage: t2 } } });
62
+ }, refreshPage: function(e2, t2) {
63
+ f(e2, t2);
64
+ }, refreshSubTableHandle: function(e2, t2) {
65
+ let n2;
66
+ const i2 = r(e2, t2);
67
+ if (i2) {
68
+ const e3 = i2.getConfigure();
69
+ e3 && e3.uuid && e3.name && "table" === e3.name && (n2 = e3.uuid);
70
+ }
71
+ n2 && s.$emit("_refreshSubTableHandle_" + n2);
72
+ }, refreshChildData(e2, t2, n2) {
73
+ let i2;
74
+ const o2 = r(e2, t2);
75
+ if (o2) {
76
+ const e3 = o2.getConfigure();
77
+ e3 && e3.uuid && e3.name && "table" === e3.name && (i2 = e3.uuid);
78
+ }
79
+ i2 && setTimeout(() => {
80
+ s.$emit("_refreshChildData_" + i2, n2);
81
+ }, 10);
82
+ }, getServerConfigValue: (e2) => window.$vueApp.config.globalProperties[e2], getBackendUrl: (e2) => y(e2.backendUrl, false), getPlateBackendUrl: () => window.$vueApp.config.globalProperties.baseAPI, getEntity: (e2) => e2.entity.data, getEntityValue: (e2, t2) => e2.entity.data ? e2.entity.data[t2] : null, getPageData: (e2) => e2.entity.page, getPageDataValue: (e2, t2) => e2.entity.page ? e2.entity.page[t2] : null, getAdditionalParams: (e2) => u(e2), getAdditionalParamValue(e2, t2) {
83
+ const n2 = u(e2);
84
+ return n2 ? n2[t2] : null;
85
+ }, isMobile: () => b(), getComponentRefByProp: (e2, t2) => r(e2, t2), getComponentRefByCode: (e2, t2) => a(e2, t2), getFormViewData(o2) {
86
+ var _a, _b, _c, _d, _e, _f, _g, _h;
87
+ const r2 = o2.entity ? o2.entity : {}, s2 = g(r2), l2 = e(o2);
88
+ for (const e2 in l2) {
89
+ const r3 = t(o2, e2), l3 = a(o2, e2);
90
+ if (l3) {
91
+ const e3 = l3.getConfigure();
92
+ if (e3 && ((_b = (_a = e3.props) == null ? void 0 : _a.dataOrigin) == null ? void 0 : _b.optionValueSetType) && ("static" === ((_d = (_c = e3.props) == null ? void 0 : _c.dataOrigin) == null ? void 0 : _d.optionValueSetType) || "optionGroup" === ((_f = (_e = e3.props) == null ? void 0 : _e.dataOrigin) == null ? void 0 : _f.optionValueSetType))) if (e3.name && ("select" === e3.name && ((_h = (_g = e3.props) == null ? void 0 : _g.base) == null ? void 0 : _h.multiple) || "checkbox" === e3.name)) {
93
+ const t2 = h(o2, e3), a2 = n(s2, t2);
94
+ if (a2) {
95
+ const e4 = v(a2.split(","), r3);
96
+ i(s2, t2, e4);
355
97
  }
98
+ } else {
99
+ const t2 = h(o2, e3), a2 = v(n(s2, t2), r3);
100
+ i(s2, t2, a2);
356
101
  }
357
102
  }
358
- const listCodesMap = pageContext.listCodesMap;
359
- for (const listCode in listCodesMap) {
360
- let tableUuid;
361
- if (listCode.indexOf("__") > 0) {
362
- tableUuid = listCode.substring(listCode.lastIndexOf("__") + "__".length);
363
- }
364
- if (tableUuid) {
365
- const componentRef = getComponentRef(pageContext, tableUuid);
366
- if (componentRef) {
367
- const componentConfigure = componentRef.getConfigure();
368
- const prop = componentConfigure.code ? componentConfigure.code : listCode;
369
- const dynamicFields = getModelFields(componentConfigure, prop);
370
- const gridData = getVariableValue(viewEntity, dynamicFields);
371
- const subTableOptions = componentRef.getTableSelectOptions(listCode);
372
- packageSubTableShowLable(subTableOptions, gridData);
373
- }
103
+ }
104
+ const c2 = o2.listCodesMap;
105
+ for (const e2 in c2) {
106
+ let t2;
107
+ if (e2.indexOf("__") > 0 && (t2 = e2.substring(e2.lastIndexOf("__") + 2)), t2) {
108
+ const i2 = a(o2, t2);
109
+ if (i2) {
110
+ const t3 = i2.getConfigure(), o3 = t3.code ? t3.code : e2, a2 = E(t3, o3), r3 = n(s2, a2);
111
+ k(i2.getTableSelectOptions(e2), r3);
374
112
  }
375
113
  }
376
- return viewEntity.data;
377
- },
378
- /**
379
- * 重新走gets请求获得表单数据
380
- * @param pageContext
381
- * @param id
382
- * @returns commonEntity数据
383
- */
384
- getFormData(pageContext, id) {
385
- return getFormData(pageContext, id);
386
114
  }
387
- };
388
- function packageSubTableShowLable(subTableOptions, subData) {
389
- if (subTableOptions && subData) {
390
- subData.forEach((rowData) => {
391
- const props = Object.keys(subTableOptions);
392
- props.forEach((prop) => {
393
- const propValue = rowData[prop];
394
- const values = subTableOptions[prop];
395
- const propSelectOptions = values.options;
396
- const column = values.column;
397
- let propLabel;
398
- if (column && column.componentType && (column.componentType === "multiselect" || column.componentType === "checkbox")) {
399
- if (propValue) {
400
- const propValues = propValue.split(",");
401
- propLabel = getSelectShowLable(propValues, propSelectOptions);
402
- }
403
- } else {
404
- propLabel = getSelectShowLable(propValue, propSelectOptions);
115
+ return s2.data;
116
+ }, getFormData: (e2, t2) => c(e2, t2), getCustomFunc: (e2, t2) => P(e2, t2) };
117
+ function k(e2, t2) {
118
+ e2 && t2 && t2.forEach((t3) => {
119
+ Object.keys(e2).forEach((n2) => {
120
+ const i2 = t3[n2], o2 = e2[n2], a2 = o2.options, r2 = o2.column;
121
+ let s2;
122
+ if (r2 && r2.componentType && ("multiselect" === r2.componentType || "checkbox" === r2.componentType)) {
123
+ if (i2) {
124
+ s2 = v(i2.split(","), a2);
405
125
  }
406
- rowData[prop] = propLabel;
407
- });
126
+ } else s2 = v(i2, a2);
127
+ t3[n2] = s2;
408
128
  });
409
- }
129
+ });
410
130
  }
411
- function getSelectShowLable(propValue, propSelectOptions) {
412
- let showLabel;
413
- if (propValue !== void 0 && propValue !== null && propSelectOptions) {
414
- if (Array.isArray(propValue)) {
415
- showLabel = "";
416
- propValue.forEach((val) => {
417
- showLabel = showLabel + getSingleSelectShowLable(propValue, propSelectOptions) + ",";
418
- });
419
- if (showLabel.indexOf(",") > 0) {
420
- showLabel = showLabel.substring(0, showLabel.lastIndexOf(","));
421
- }
422
- } else {
423
- showLabel = propValue;
424
- showLabel = getSingleSelectShowLable(propValue, propSelectOptions);
425
- }
426
- }
427
- return showLabel;
131
+ function v(e2, t2) {
132
+ let n2;
133
+ return null != e2 && t2 && (Array.isArray(e2) ? (n2 = "", e2.forEach((i2) => {
134
+ n2 = n2 + V(e2, t2) + ",";
135
+ }), n2.indexOf(",") > 0 && (n2 = n2.substring(0, n2.lastIndexOf(",")))) : (n2 = e2, n2 = V(e2, t2))), n2;
428
136
  }
429
- function getSingleSelectShowLable(propValue, propSelectOptions) {
430
- let showLabel = propValue;
431
- if (propValue !== void 0 && propValue !== null && propSelectOptions) {
432
- for (let i = 0; i < propSelectOptions.length; i++) {
433
- const optValue = propSelectOptions[i].value;
434
- const optLabel = propSelectOptions[i].label ? propSelectOptions[i].label : propSelectOptions[i].name;
435
- if (propValue + "" === optValue + "" && optLabel !== void 0 && optLabel !== null) {
436
- showLabel = optLabel;
437
- break;
438
- }
137
+ function V(e2, t2) {
138
+ let n2 = e2;
139
+ if (null != e2 && t2) for (let i2 = 0; i2 < t2.length; i2++) {
140
+ const o2 = t2[i2].value, a2 = t2[i2].label ? t2[i2].label : t2[i2].name;
141
+ if (e2 + "" == o2 + "" && null != a2) {
142
+ n2 = a2;
143
+ break;
439
144
  }
440
145
  }
441
- return showLabel;
146
+ return n2;
442
147
  }
443
- function packageInitInfo(pageContext, type, settings) {
444
- if (!pageContext.initInfo) {
445
- pageContext.initInfo = {};
446
- }
447
- pageContext.initInfo[type] = settings;
148
+ function $(e2, t2, n2) {
149
+ e2.initInfo || (e2.initInfo = {}), e2.initInfo[t2] = n2;
448
150
  }
449
151
  export {
450
- functions
152
+ C as functions
451
153
  };