super-page-runtime 2.2.26 → 2.2.29-tmp2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/dist/es/_virtual/_plugin-vue_export-helper.js +7 -5
  2. package/dist/es/assets/chart-themes/theme1.js +6 -2
  3. package/dist/es/assets/chart-themes/theme2.js +6 -2
  4. package/dist/es/assets/chart-themes/theme3.js +6 -2
  5. package/dist/es/components/runtime/utils/api/api-util.js +7 -4
  6. package/dist/es/components/runtime/utils/api/page-expose-util.js +443 -135
  7. package/dist/es/components/runtime/utils/assemblys-config.js +369 -13
  8. package/dist/es/components/runtime/utils/barcode-util.js +33 -9
  9. package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +306 -122
  10. package/dist/es/components/runtime/utils/charts/chart-gauge-util.js +68 -29
  11. package/dist/es/components/runtime/utils/charts/chart-pie-util.js +152 -68
  12. package/dist/es/components/runtime/utils/charts/chart-radar-util.js +124 -46
  13. package/dist/es/components/runtime/utils/charts/chart-scatter-util.js +99 -36
  14. package/dist/es/components/runtime/utils/charts/chart-util.js +522 -224
  15. package/dist/es/components/runtime/utils/common-util.js +156 -76
  16. package/dist/es/components/runtime/utils/eventBus.js +8 -3
  17. package/dist/es/components/runtime/utils/events/event-util.js +775 -362
  18. package/dist/es/components/runtime/utils/events/print-label.js +140 -72
  19. package/dist/es/components/runtime/utils/events/standard-event.js +2320 -808
  20. package/dist/es/components/runtime/utils/events/validator-util.js +560 -224
  21. package/dist/es/components/runtime/utils/form/date-shortcuts.js +88 -28
  22. package/dist/es/components/runtime/utils/form/scan-util.js +162 -61
  23. package/dist/es/components/runtime/utils/global-refs.js +84 -53
  24. package/dist/es/components/runtime/utils/i18n-util.js +20 -11
  25. package/dist/es/components/runtime/utils/interfaces/page-design-types.js +7 -2
  26. package/dist/es/components/runtime/utils/page-helper-util.js +660 -279
  27. package/dist/es/components/runtime/utils/page-init-util.js +406 -141
  28. package/dist/es/components/runtime/utils/page-permission-util.js +531 -22
  29. package/dist/es/components/runtime/utils/page-store.js +68 -23
  30. package/dist/es/components/runtime/utils/store-util.js +13 -9
  31. package/dist/es/components/runtime/utils/store.js +2 -2
  32. package/dist/es/components/runtime/utils/table-utils.js +81 -40
  33. package/dist/es/components/runtime/utils/tree-utils.js +37 -17
  34. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue.js +2 -2
  35. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +83 -21
  36. package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue.js +2 -2
  37. package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue2.js +46 -14
  38. package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue.js +2 -2
  39. package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +132 -36
  40. package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue.js +2 -2
  41. package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue2.js +18 -4
  42. package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue.js +2 -2
  43. package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue2.js +107 -17
  44. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue.js +2 -2
  45. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +198 -50
  46. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue.js +42 -12
  47. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue2.js +2 -2
  48. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue.js +60 -7
  49. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue2.js +2 -2
  50. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue.js +203 -52
  51. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue2.js +2 -2
  52. package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue.js +4 -4
  53. package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue2.js +162 -46
  54. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue.js +2 -2
  55. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +109 -32
  56. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue.js +2 -2
  57. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +166 -43
  58. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue.js +2 -2
  59. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +117 -32
  60. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue.js +2 -2
  61. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +118 -32
  62. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +597 -246
  63. package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue.js +42 -4
  64. package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue2.js +2 -2
  65. package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue.js +62 -8
  66. package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue2.js +2 -2
  67. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +160 -29
  68. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue2.js +2 -2
  69. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue.js +62 -13
  70. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue2.js +2 -2
  71. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue.js +2 -2
  72. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +594 -212
  73. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +139 -29
  74. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue2.js +2 -2
  75. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue.js +125 -21
  76. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue2.js +2 -2
  77. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue.js +102 -16
  78. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue2.js +2 -2
  79. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue.js +2 -2
  80. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue2.js +81 -18
  81. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue.js +2 -2
  82. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue2.js +82 -17
  83. package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue.js +2 -2
  84. package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue2.js +86 -14
  85. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue.js +2 -2
  86. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +79 -21
  87. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue.js +2 -2
  88. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue2.js +61 -16
  89. package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue.js +2 -2
  90. package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue2.js +37 -10
  91. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue.js +2 -2
  92. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +127 -38
  93. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue.js +2 -2
  94. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +76 -28
  95. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue.js +2 -2
  96. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +178 -61
  97. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +810 -302
  98. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue2.js +2 -2
  99. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +635 -262
  100. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue2.js +2 -2
  101. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue.js +2 -2
  102. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +115 -40
  103. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue.js +2 -2
  104. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +215 -56
  105. package/dist/es/components/runtime/views/assemblys/error-render.vue.js +21 -3
  106. package/dist/es/components/runtime/views/assemblys/error-render.vue2.js +2 -2
  107. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue.js +2 -2
  108. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +154 -42
  109. package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue.js +98 -34
  110. package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue2.js +2 -2
  111. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue.js +2 -2
  112. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +200 -52
  113. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue.js +2 -2
  114. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +239 -68
  115. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue.js +2 -2
  116. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +109 -31
  117. package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue.js +2 -2
  118. package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue2.js +59 -21
  119. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue.js +2 -2
  120. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +188 -56
  121. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue.js +2 -2
  122. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +103 -22
  123. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue.js +2 -2
  124. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +245 -57
  125. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue.js +2 -2
  126. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +174 -32
  127. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue.js +2 -2
  128. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +107 -28
  129. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +4 -4
  130. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue2.js +50 -13
  131. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue.js +2 -2
  132. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +194 -64
  133. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue.js +2 -2
  134. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +249 -88
  135. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue.js +2 -2
  136. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +263 -80
  137. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue.js +2 -2
  138. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue2.js +57 -13
  139. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue.js +2 -2
  140. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +155 -30
  141. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue.js +2 -2
  142. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +129 -40
  143. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue.js +2 -2
  144. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +107 -22
  145. package/dist/es/components/runtime/views/assemblys/home-chart-render.vue.js +188 -89
  146. package/dist/es/components/runtime/views/assemblys/home-chart-render.vue2.js +2 -2
  147. package/dist/es/components/runtime/views/assemblys/object-render.vue.js +272 -133
  148. package/dist/es/components/runtime/views/assemblys/object-render.vue2.js +2 -2
  149. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue.js +2 -2
  150. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue2.js +46 -18
  151. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue.js +2 -2
  152. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue2.js +49 -21
  153. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue.js +2 -2
  154. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +58 -20
  155. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue.js +2 -2
  156. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue2.js +53 -16
  157. package/dist/es/components/runtime/views/home-chart.vue.js +160 -40
  158. package/dist/es/components/runtime/views/home-chart.vue2.js +2 -2
  159. package/dist/es/components/runtime/views/super-page-dialog.vue.js +139 -20
  160. package/dist/es/components/runtime/views/super-page-dialog.vue2.js +2 -2
  161. package/dist/es/components/runtime/views/super-page.vue.js +754 -226
  162. package/dist/es/components/runtime/views/super-page.vue2.js +2 -2
  163. package/dist/es/i18n/langs/cn.js +55 -2
  164. package/dist/es/i18n/langs/en.js +55 -2
  165. package/package.json +2 -2
@@ -1,271 +1,644 @@
1
- import { defineComponent as e, ref as t, onMounted as n, onUnmounted as o, resolveComponent as i, createElementBlock as a, openBlock as l, createBlock as u, createCommentVNode as r, unref as s } from "vue";
2
- import { setTableEvents as c, gridSelectRecord as p, gridSelectAllRecords as f, gridSelectionChange as d, cellClick as b, cellDblClick as v, rowClick as g, rowDblClick as m, headerClick as h, getHandleEvent as S } from "../../../../utils/events/event-util.js";
3
- import { caculateShowCondition as w, setVariableValue as T, getVariableValue as x, getSizeConfig as D } from "../../../../utils/page-helper-util.js";
4
- import { getModelFields as C, getDefaultValue as y } from "../../../../utils/page-init-util.js";
5
- import P from "../../../../utils/eventBus.js";
6
- import { popupToPage as I, getOperationButtons as R } from "../../../../utils/table-utils.js";
7
- import { getListCode as O, getBaseUrl as _ } from "../../../../utils/common-util.js";
8
- import { getAdditionalParamMap as k } from "../../../../utils/events/standard-event.js";
9
- import { getRowStyleUtil as M, getCellStyleUtil as F, getHeaderCellStyleUtil as $ } from "../../chart/table/chart-table-util.js";
10
- const j = e({ __name: "sub-table-runtime", props: { pageContext: {}, configure: {} }, emits: ["setSafeDeleteTableCode"], setup(e2, { expose: j2, emit: N }) {
11
- const A = e2, H = A.pageContext;
12
- let L = A.configure;
13
- const B = A.configure.runtime ? A.configure.runtime : {};
14
- H.isTest ? B.value = A.configure.runtime ? A.configure.runtime : {} : H.tableRuntimes && H.tableRuntimes[L.uuid] && (L = JSON.parse(H.tableRuntimes[L.uuid].configure), B.value = L.runtime ? L.runtime : {});
15
- const E = O(H.code, H.version, L.uuid), U = H.entity.data, z = L.code ? L.code : E, V = k(H), G = B && B.events ? B.events : [], J = t([]), q = H.superGridItems, K = q ? q[L.uuid] : null, Q = B.style, W = B.class, X = A.pageContext.entity ? A.pageContext.entity : {};
16
- let Y = C(A.configure, z), Z = _(H.backendUrl, H.isTest);
17
- Z || (Z = window.$vueApp.config.globalProperties.baseURL);
18
- const ee = t(false);
19
- let te = t(0);
20
- const ne = L.props.dataOrigin.principalLinkage, oe = t({ isSql: true, subTableData: null, rowKeyProp: ne, extraParam: {}, operations: {}, hiddenColumns: [], pageCode: H.code, pageVersion: H.version, pageContext: H, configureObj: L, showPageArea: false, showRowForm: false, showOverflowTooltip: !(!L.props || !L.props.otherSettings || void 0 !== L.props.otherSettings.isBreakLine && false !== L.props.otherSettings.isBreakLine), backendUrl: Z, cellStyleRender: function(e3) {
21
- return F(e3, e3.cellStyle, A);
22
- }, rowStyleRender: function(e3) {
23
- return M(e3, null, A);
24
- }, titleStyleRender: function(e3) {
25
- const t2 = e3.titleStyle, n2 = A.configure.style.titleStyle;
26
- return $(e3, { cellTitleStyle: t2, titleStyle: n2 }, A);
27
- } }), ie = N;
28
- Q && (oe.value.tableStyle = Q), W && (oe.value.tableClass = W), L.props && L.props.base && true === L.props.base.subPaging ? oe.value.showPageArea = true : oe.value.showPageArea = false, L.props.base.showRowForm && (oe.value.showRowForm = L.props.base.showRowForm);
29
- const ae = t(null);
30
- function le() {
31
- ae.value && (oe.value.subTableData = null, ae.value.reloadSubTableData(E));
32
- }
33
- function ue(e3) {
34
- if (void 0 === e3 && (e3 = re()), oe.value.isPageInfo = false, oe.value.isFormSubTable = true, oe.value.canRrefreshSubtableData = e3, oe.value.getFormData = se, oe.value.getGridData = ce, oe.value.extraParam.subTableListViewCode = E, oe.value.extraParam.beanName = H.beanName, oe.value.extraParam.subtableSetting = L.props && L.props.otherSettings ? JSON.stringify(L.props.otherSettings) : null, oe.value.extraParam.additionalParamMap = V, oe.value.extraParam.entityMap = H.entity.data, oe.value.extraParam.contextMap = H.entity.context, oe.value.extraParam.taskMap = H.entity.task, !(L.props && L.props.base && L.props.base.showOperation)) {
35
- let e4 = oe.value.hiddenColumns;
36
- e4 ? e4.push("operation") : e4 = ["operation"], oe.value.hiddenColumns = e4;
37
- }
38
- oe.value.showOperationButton = !(!L.props || !L.props.base) && L.props.base.showOperation, oe.value.isPdfEditor = false, oe.value.tableRecordMaxNum = L.props && L.props.otherSettings ? L.props.otherSettings.tableRecordMaxNum : null;
39
- let t2 = D(H, L);
40
- t2 && t2.fixHeight && (oe.value.formSetHeight = t2.fixHeight), t2 && t2.maxHeight && (oe.value.formSetMaxHeight = t2.maxHeight);
41
- }
42
- function re() {
43
- if (L.props && L.props.otherSettings) {
44
- if (L.props.otherSettings.sourceQueryTableData && L.props.otherSettings.timeToInitializeSubTable && L.props.otherSettings.timeToInitializeSubTable.length > 0) {
45
- let e3 = false;
46
- if (-1 !== L.props.otherSettings.timeToInitializeSubTable.indexOf("create") && (e3 = !U.id && !U.ID), -1 !== L.props.otherSettings.timeToInitializeSubTable.indexOf("noData")) {
47
- const t2 = U[z];
48
- (!t2 || t2.length <= 0) && (e3 = true);
1
+ import { defineComponent, ref, onMounted, onUnmounted, resolveComponent, createElementBlock, openBlock, createBlock, createCommentVNode, unref } from "vue";
2
+ import { setTableEvents, gridSelectRecord, gridSelectAllRecords, gridSelectionChange, cellClick, cellDblClick, rowClick, rowDblClick, headerClick, getHandleEvent } from "../../../../utils/events/event-util.js";
3
+ import { caculateShowCondition, setVariableValue, getVariableValue, getSizeConfig } from "../../../../utils/page-helper-util.js";
4
+ import { getModelFields, getDefaultValue } from "../../../../utils/page-init-util.js";
5
+ import bus from "../../../../utils/eventBus.js";
6
+ import { popupToPage, getOperationButtons } from "../../../../utils/table-utils.js";
7
+ import { getListCode, getBaseUrl } from "../../../../utils/common-util.js";
8
+ import { getAdditionalParamMap } from "../../../../utils/events/standard-event.js";
9
+ import { getRowStyleUtil, getCellStyleUtil, getHeaderCellStyleUtil } from "../../chart/table/chart-table-util.js";
10
+ const _sfc_main = /* @__PURE__ */ defineComponent({
11
+ __name: "sub-table-runtime",
12
+ props: {
13
+ pageContext: {},
14
+ configure: {}
15
+ },
16
+ emits: ["setSafeDeleteTableCode"],
17
+ setup(__props, { expose: __expose, emit: __emit }) {
18
+ const props = __props;
19
+ const pageContext = props.pageContext;
20
+ let configure = props.configure;
21
+ const runtimeInfo = props.configure.runtime ? props.configure.runtime : {};
22
+ if (pageContext.isTest) {
23
+ runtimeInfo.value = props.configure.runtime ? props.configure.runtime : {};
24
+ } else {
25
+ if (pageContext.tableRuntimes && pageContext.tableRuntimes[configure.uuid]) {
26
+ configure = JSON.parse(pageContext.tableRuntimes[configure.uuid].configure);
27
+ runtimeInfo.value = configure.runtime ? configure.runtime : {};
28
+ }
29
+ }
30
+ const listCode = getListCode(pageContext.code, pageContext.version, configure.uuid);
31
+ const dataModel = pageContext.entity.data;
32
+ const prop = configure.code ? configure.code : listCode;
33
+ const additionalParamMap = getAdditionalParamMap(pageContext);
34
+ const tableEvents = runtimeInfo && runtimeInfo.events ? runtimeInfo.events : [];
35
+ const selections = ref([]);
36
+ const superGridItems = pageContext.superGridItems;
37
+ const superGridSetting = superGridItems ? superGridItems[configure.uuid] : null;
38
+ console.log("superGridSetting===", superGridItems, superGridSetting);
39
+ const runtimeStyle = runtimeInfo.style;
40
+ const runtimeClass = runtimeInfo.class;
41
+ const entity = props.pageContext.entity ? props.pageContext.entity : {};
42
+ let dynamicFields = getModelFields(props.configure, prop);
43
+ let baseURL = getBaseUrl(pageContext.backendUrl, pageContext.isTest);
44
+ if (!baseURL) {
45
+ baseURL = window["$vueApp"].config.globalProperties.baseURL;
46
+ }
47
+ const listViewShowFlag = ref(false);
48
+ let componentKey = ref(0);
49
+ const rowKeyProp = configure.props.dataOrigin.principalLinkage;
50
+ const listViewOptions = ref({
51
+ isSql: true,
52
+ subTableData: null,
53
+ rowKeyProp,
54
+ extraParam: {},
55
+ operations: {},
56
+ hiddenColumns: [],
57
+ pageCode: pageContext.code,
58
+ pageVersion: pageContext.version,
59
+ pageContext,
60
+ configureObj: configure,
61
+ showPageArea: false,
62
+ showRowForm: false,
63
+ showOverflowTooltip: !!(configure.props && configure.props.otherSettings && (configure.props.otherSettings.isBreakLine === void 0 || configure.props.otherSettings.isBreakLine === false)),
64
+ // 单元格内容是否换行显示
65
+ backendUrl: baseURL,
66
+ cellStyleRender: getCellStyle,
67
+ rowStyleRender: getRowStyle,
68
+ titleStyleRender: getTitleStyle
69
+ });
70
+ const $emit = __emit;
71
+ if (runtimeStyle) {
72
+ listViewOptions.value["tableStyle"] = runtimeStyle;
73
+ }
74
+ if (runtimeClass) {
75
+ listViewOptions.value["tableClass"] = runtimeClass;
76
+ }
77
+ if (configure.props && configure.props.base && configure.props.base.subPaging === true) {
78
+ listViewOptions.value.showPageArea = true;
79
+ } else {
80
+ listViewOptions.value.showPageArea = false;
81
+ }
82
+ if (configure.props.base.showRowForm) {
83
+ listViewOptions.value.showRowForm = configure.props.base.showRowForm;
84
+ }
85
+ const gridRef = ref(null);
86
+ onMounted(() => {
87
+ const tableUuid = configure.uuid;
88
+ const subTableWatchProps = pageContext.subTableWatchProps;
89
+ bus.$on("_refreshSubTable_" + tableUuid, (params) => {
90
+ console.log("-_refreshSubTable--tableUuid=", tableUuid, "params=", params);
91
+ const propName = params.propName;
92
+ if (subTableWatchProps && subTableWatchProps[tableUuid] && subTableWatchProps[tableUuid].length > 0) {
93
+ const mainFormProps = subTableWatchProps[tableUuid];
94
+ if (mainFormProps.indexOf(propName) >= 0) {
95
+ reloadSubTableData();
96
+ }
49
97
  }
50
- return e3;
98
+ });
99
+ bus.$on("_refreshSubTableHandle_" + tableUuid, (params) => {
100
+ console.log("-_refreshSubTableHandle_--tableUuid=", tableUuid, "params=", params);
101
+ reloadSubTableData();
102
+ });
103
+ bus.$on(
104
+ "_refreshChildData_" + tableUuid,
105
+ (gridData) => {
106
+ console.log("-_refreshChildData_--tableUuid=", tableUuid);
107
+ refreshChildTableData(gridData);
108
+ }
109
+ );
110
+ bus.$on(listCode + "-pickFileDone", (data) => {
111
+ console.log("superPage5555---listCode---pickFileDone--listCode=", listCode, "data=", data);
112
+ gridRef.value.pickFileDone(data);
113
+ });
114
+ bus.$on(listCode + "-scanDone", (data) => {
115
+ console.log("superPage5555---listCode---scanDone--listCode=", listCode, "data=", data);
116
+ gridRef.value.scanDone(data);
117
+ });
118
+ if (listViewOptions.value && listViewOptions.value.configureObj.props.base && listViewOptions.value.configureObj.props.base.isSafeDelete) {
119
+ $emit("setSafeDeleteTableCode", listViewOptions.value.extraParam.tableName);
120
+ }
121
+ });
122
+ function reloadSubTableData() {
123
+ if (gridRef.value) {
124
+ listViewOptions.value["subTableData"] = null;
125
+ gridRef.value.reloadSubTableData(listCode);
51
126
  }
52
- return false;
53
127
  }
54
- }
55
- function se() {
56
- return H.entity.data;
57
- }
58
- function ce() {
59
- return x(X, Y);
60
- }
61
- let pe, fe;
62
- function de(e3) {
63
- ue(e3), oe.value.subTableData = null, be(), ee.value = false, pe = setTimeout(() => {
64
- ee.value = true, te.value = te.value + 1, ve();
65
- }, 10);
66
- }
67
- function be() {
68
- !function() {
69
- const e4 = H.fieldPermissionMap, t2 = H.actionPermissionMap;
70
- if (e4 && null != e4) {
71
- let t3 = e4.get(z);
72
- if (!t3) {
73
- const n3 = e4.get("all_fields");
74
- n3 && (t3 = [n3]);
128
+ onUnmounted(() => {
129
+ if (timer) {
130
+ clearTimeout(timer);
131
+ }
132
+ if (timer2) {
133
+ clearTimeout(timer2);
134
+ }
135
+ const tableUuid = configure.uuid;
136
+ bus.$off("_refreshSubTable_" + tableUuid);
137
+ bus.$off("_refreshSubTableHandle_" + tableUuid);
138
+ bus.$off("_refreshChildData_" + tableUuid);
139
+ bus.$off(listCode + "-pickFileDone");
140
+ bus.$off(listCode + "-scanDone");
141
+ });
142
+ function currencyListViewSetting(canRrefreshSubtableData) {
143
+ if (canRrefreshSubtableData === void 0) {
144
+ canRrefreshSubtableData = judgeInitializationSubTable();
145
+ }
146
+ listViewOptions.value["isPageInfo"] = false;
147
+ listViewOptions.value["isFormSubTable"] = true;
148
+ listViewOptions.value["canRrefreshSubtableData"] = canRrefreshSubtableData;
149
+ listViewOptions.value["getFormData"] = getParentFormData;
150
+ listViewOptions.value["getGridData"] = getGridData;
151
+ listViewOptions.value.extraParam["subTableListViewCode"] = listCode;
152
+ listViewOptions.value.extraParam["beanName"] = pageContext.beanName;
153
+ listViewOptions.value.extraParam["subtableSetting"] = configure.props && configure.props.otherSettings ? JSON.stringify(configure.props.otherSettings) : null;
154
+ listViewOptions.value.extraParam["additionalParamMap"] = additionalParamMap;
155
+ listViewOptions.value.extraParam["entityMap"] = pageContext.entity.data;
156
+ listViewOptions.value.extraParam["contextMap"] = pageContext.entity.context;
157
+ listViewOptions.value.extraParam["taskMap"] = pageContext.entity.task;
158
+ if (!(configure.props && configure.props.base && configure.props.base.showOperation)) {
159
+ let hiddenColumns = listViewOptions.value.hiddenColumns;
160
+ if (!hiddenColumns) {
161
+ hiddenColumns = ["operation"];
162
+ } else {
163
+ hiddenColumns.push("operation");
75
164
  }
76
- oe.value.validateRules = t3 || null;
77
- }
78
- if (t2 && null != t2) {
79
- let e5 = t2.get(z);
80
- e5 || (e5 = t2.get("all_sub_tables")), oe.value.actionPermission = e5;
81
- }
82
- oe.value.operations || (oe.value.operations = {});
83
- const n2 = function() {
84
- let e5 = [], t3 = w(A.pageContext, L.props.base.showOperationCondition);
85
- if (t3 && Se()) {
86
- const t4 = { props: { elementType: "el-button", icon: "Plus", type: "primary", circle: true, size: "mini", permission: "true" }, onClick: De, isShow: we };
87
- e5.push(t4);
165
+ listViewOptions.value["hiddenColumns"] = hiddenColumns;
166
+ }
167
+ listViewOptions.value["showOperationButton"] = configure.props && configure.props.base ? configure.props.base.showOperation : false;
168
+ listViewOptions.value["isPdfEditor"] = false;
169
+ listViewOptions.value["tableRecordMaxNum"] = configure.props && configure.props.otherSettings ? configure.props.otherSettings.tableRecordMaxNum : null;
170
+ let sizeConfig = getSizeConfig(pageContext, configure);
171
+ if (sizeConfig && sizeConfig.fixHeight) {
172
+ listViewOptions.value["formSetHeight"] = sizeConfig.fixHeight;
173
+ }
174
+ if (sizeConfig && sizeConfig.maxHeight) {
175
+ listViewOptions.value["formSetMaxHeight"] = sizeConfig.maxHeight;
176
+ }
177
+ }
178
+ function judgeInitializationSubTable() {
179
+ if (!configure.props || !configure.props.otherSettings) {
180
+ return;
181
+ }
182
+ if (configure.props.otherSettings.sourceQueryTableData && configure.props.otherSettings.timeToInitializeSubTable && configure.props.otherSettings.timeToInitializeSubTable.length > 0) {
183
+ let flag = false;
184
+ if (configure.props.otherSettings.timeToInitializeSubTable.indexOf("create") !== -1) {
185
+ if (dataModel.id || dataModel.ID) {
186
+ flag = false;
187
+ } else {
188
+ flag = true;
189
+ }
88
190
  }
89
- if (t3 && Te(null, null, null, null, null, true)) {
90
- const t4 = { props: { elementType: "el-button", icon: "Minus", type: "danger", circle: true, size: "mini", permission: "true" }, onClick: Ce, isShow: xe };
91
- e5.push(t4);
191
+ if (configure.props.otherSettings.timeToInitializeSubTable.indexOf("noData") !== -1) {
192
+ const tableData = dataModel[prop];
193
+ if (!tableData || tableData.length <= 0) {
194
+ flag = true;
195
+ }
92
196
  }
93
- return R(H, L, e5, me), e5;
94
- }();
95
- oe.value.operations.operation = n2, oe.value.subTableCanAdd = Se();
96
- }(), c(oe.value, G, H, L);
97
- const e3 = H.customEvents;
98
- e3 && (oe.value.eventCallBack = e3), ee.value = true, ve();
99
- }
100
- function ve() {
101
- H.tableUuids || (H.tableUuids = []), H.tableUuids.indexOf(L.uuid) < 0 && H.tableUuids.push(L.uuid);
102
- }
103
- n(() => {
104
- const e3 = L.uuid, t2 = H.subTableWatchProps;
105
- P.$on("_refreshSubTable_" + e3, (n2) => {
106
- const o2 = n2.propName;
107
- if (t2 && t2[e3] && t2[e3].length > 0) {
108
- t2[e3].indexOf(o2) >= 0 && le();
109
- }
110
- }), P.$on("_refreshSubTableHandle_" + e3, (e4) => {
111
- le();
112
- }), P.$on("_refreshChildData_" + e3, (e4) => {
113
- !function(e5) {
114
- Be(e5), fe = setTimeout(() => {
115
- ae.value && (ae.value.refreshChildData(E, e5, L.props && L.props.base && true === L.props.base.subPaging), oe.value.extraParam.entityMap = H.entity.data);
116
- }, 10);
117
- }(e4);
118
- }), P.$on(E + "-pickFileDone", (e4) => {
119
- ae.value.pickFileDone(e4);
120
- }), P.$on(E + "-scanDone", (e4) => {
121
- ae.value.scanDone(e4);
122
- }), oe.value && oe.value.configureObj.props.base && oe.value.configureObj.props.base.isSafeDelete && ie("setSafeDeleteTableCode", oe.value.extraParam.tableName);
123
- }), o(() => {
124
- pe && clearTimeout(pe), fe && clearTimeout(fe);
125
- const e3 = L.uuid;
126
- P.$off("_refreshSubTable_" + e3), P.$off("_refreshSubTableHandle_" + e3), P.$off("_refreshChildData_" + e3), P.$off(E + "-pickFileDone"), P.$off(E + "-scanDone");
127
- });
128
- const ge = t({});
129
- function me(e3) {
130
- if (!e3) return;
131
- return ge.value[e3.uuid] = e3, he;
132
- }
133
- function he(e3, t2, n2, o2, i2, a2) {
134
- const l2 = { originalValue: e3, formatValue: t2, row: n2, column: o2, rowIndex: i2, button: a2, id: n2.ID ? n2.ID : n2.id }, u2 = ge.value[a2.sourceButton.uuid], r2 = L;
135
- u2.props.base.tableUuid = r2.uuid, S(null, H, u2, "click", l2);
136
- }
137
- function Se(e3, t2, n2, o2, i2, a2) {
138
- if (!w(A.pageContext, L.props.base.showOperationCondition)) return false;
139
- const l2 = H.fieldPermissionMap, u2 = H.actionPermissionMap;
140
- let r2 = true;
141
- if (l2 && null !== l2) {
142
- const e4 = l2.get("all_fields");
143
- void 0 === e4 || false !== e4.canEdit || void 0 !== e4.rowIndexes && null !== e4.rowIndexes && 0 !== e4.rowIndexes.length || (r2 = false);
144
- }
145
- if (true === r2 && z && u2 && null !== u2) {
146
- let e4 = u2.get(z);
147
- e4 || (e4 = u2.get("all_sub_tables")), e4 && void 0 !== e4.canAdd && false === e4.canAdd && (r2 = false);
148
- }
149
- return r2;
150
- }
151
- function we(e3, t2, n2, o2, i2, a2) {
152
- let l2 = Se();
153
- return true === l2 && (l2 = w(A.pageContext, L.props.base.showAddBtnCondition, n2)), l2;
154
- }
155
- function Te(e3, t2, n2, o2, i2, a2) {
156
- const l2 = H.fieldPermissionMap, u2 = H.actionPermissionMap;
157
- let r2 = true;
158
- if (l2 && null !== l2) {
159
- const e4 = l2.get("all_fields");
160
- void 0 === e4 || false !== e4.canEdit || void 0 !== e4.rowIndexes && null !== e4.rowIndexes && 0 !== e4.rowIndexes.length || (r2 = false);
161
- }
162
- if (true === r2 && z && u2 && null !== u2) {
163
- let e4 = u2.get(z);
164
- if (e4 || (e4 = u2.get("all_sub_tables")), e4 && void 0 !== e4.canDelete && false === e4.canDelete && (r2 = false), e4 && void 0 !== e4.canDelete && true === e4.canDelete && e4.deleteRowIndexes) if (e4.deleteRowIndexes.length > 0) if (a2) r2 = true;
165
- else {
166
- const t3 = function(e5) {
167
- return e5 && e5.id ? e5.id : e5 && e5.ID ? e5.ID : void 0;
168
- }(n2);
169
- r2 = void 0 !== t3 && e4.deleteRowIndexes.indexOf(t3) >= 0;
170
- }
171
- else r2 = false;
172
- }
173
- return r2;
174
- }
175
- function xe(e3, t2, n2, o2, i2, a2) {
176
- let l2 = Te(0, 0, n2, 0, 0, a2);
177
- return true === l2 && (l2 = w(A.pageContext, L.props.base.showDeleteBtnCondition, n2)), l2;
178
- }
179
- function De(e3, t2, n2, o2, i2) {
180
- ae.value.createRow(E, {}, { getDefaultValueFunc: y });
181
- }
182
- function Ce(e3, t2, n2, o2, i2) {
183
- ae.value.deleteRow(i2, E, false);
184
- }
185
- function ye(e3) {
186
- T(X, Y, e3);
187
- }
188
- function Pe(e3) {
189
- H.subTablePageInfo || (H.subTablePageInfo = {}), H.subTablePageInfo[z] = { pageSize: e3 };
190
- }
191
- function Ie(e3) {
192
- const t2 = e3.key, n2 = e3.value;
193
- H.selectOptions || (H.selectOptions = {}), H.selectOptions[t2] = n2;
194
- }
195
- function Re(e3) {
196
- const t2 = H.code + "_";
197
- P.$emit(t2 + "prohibit-edit", e3);
198
- }
199
- function Oe(e3) {
200
- const t2 = H.entity.data;
201
- if (e3) for (const n2 in e3) t2[n2] = e3[n2];
202
- }
203
- function _e(e3, t2) {
204
- if (void 0 !== t2) {
205
- J.value = e3;
206
- p(H, L, { selection: e3, row: t2 });
197
+ return flag;
198
+ } else {
199
+ return false;
200
+ }
207
201
  }
208
- }
209
- function ke(e3) {
210
- J.value = e3;
211
- f(H, L, { selection: e3 });
212
- }
213
- function Me(e3) {
214
- d(H, L, { newSelection: e3 });
215
- }
216
- function Fe(e3, t2, n2, o2) {
217
- b(H, L, { row: e3, column: t2, cell: n2, event: o2 });
218
- }
219
- function $e(e3, t2, n2, o2) {
220
- v(H, L, { row: e3, column: t2, cell: n2, event: o2 });
221
- }
222
- function je(e3, t2, n2) {
223
- g(H, L, { row: e3, column: t2, event: n2 });
224
- }
225
- function Ne(e3, t2, n2) {
226
- m(H, L, { row: e3, column: t2, event: n2 });
227
- }
228
- function Ae(e3, t2) {
229
- h(H, L, { column: e3, event: t2 });
230
- }
231
- function He(e3) {
232
- H.entity.data = e3;
233
- }
234
- function Le() {
235
- return x(X, Y);
236
- }
237
- function Be(e3) {
238
- return T(X, Y, e3);
239
- }
240
- return function() {
241
- const e3 = re();
242
- e3 ? de(e3) : (ue(e3), oe.value.isPageInfo = false, oe.value.subTableData = Le(), be());
243
- }(), j2({ createRow: function() {
244
- return ae.value.createRow(E);
245
- }, getSelections: function() {
246
- return J.value;
247
- }, getSelectionIds: function() {
248
- const e3 = [];
249
- return J.value && J.value.forEach((t2) => {
250
- e3.push(t2.id ? t2.id : t2.ID ? t2.ID : null);
251
- }), e3;
252
- }, clearSelections: function() {
253
- J.value = [];
254
- }, getTableConfigure: function() {
255
- return L;
256
- }, validatorSunTableListData: function() {
257
- return ae.value.validatorSunTableListData();
258
- }, getValue: Le, setValue: Be, getTableSelectOptions: function() {
259
- if (ae.value) return ae.value.getTableSelectOptions(E);
260
- }, dynamicControlTableEdit: function(e3, t2, n2) {
261
- ae.value && ae.value.dynamicControlTableEdit(e3, t2, n2);
262
- }, doLayout: function(e3) {
263
- ae.value && ae.value.doLayout(e3);
264
- } }), (e3, t2) => {
265
- const n2 = i("super-grid");
266
- return l(), a("div", null, [ee.value ? (l(), u(n2, { key: 0, ref_key: "gridRef", ref: ae, url: s(Z) + "/dsc/commons/sub-table", options: oe.value, code: s(E), settings: s(K), onSelect: _e, onSelectAll: ke, onSelectionChange: Me, onCellClick: Fe, onCellDblclick: $e, onRowClick: je, onRowDblclick: Ne, onHeaderClick: Ae, onFnProhibitToEdit: Re, onChangeGridData: ye, onReloadGrid: de, onRefresMainTableFields: Oe, onSetSelectOptions: Ie, onChangeRowsPerPage: Pe, onNewOpenGridDialog: s(I), onChangeFormData: He }, null, 8, ["url", "options", "code", "settings", "onNewOpenGridDialog"])) : r("", true)]);
267
- };
268
- } });
202
+ function getParentFormData() {
203
+ return pageContext.entity.data;
204
+ }
205
+ function getGridData() {
206
+ return getVariableValue(entity, dynamicFields);
207
+ }
208
+ function initializationSubTable() {
209
+ const canRrefreshSubtableData = judgeInitializationSubTable();
210
+ if (canRrefreshSubtableData) {
211
+ changeInitializationSubTable(canRrefreshSubtableData);
212
+ } else {
213
+ currencyListViewSetting(canRrefreshSubtableData);
214
+ listViewOptions.value["isPageInfo"] = false;
215
+ listViewOptions.value["subTableData"] = getValue();
216
+ setGridDataEventOptions();
217
+ }
218
+ }
219
+ let timer;
220
+ let timer2;
221
+ function changeInitializationSubTable(canRrefreshSubtableData) {
222
+ currencyListViewSetting(canRrefreshSubtableData);
223
+ listViewOptions.value["subTableData"] = null;
224
+ setGridDataEventOptions();
225
+ listViewShowFlag.value = false;
226
+ timer = setTimeout(() => {
227
+ listViewShowFlag.value = true;
228
+ componentKey.value = componentKey.value + 1;
229
+ setGridToStore();
230
+ }, 10);
231
+ }
232
+ function setGridDataEventOptions() {
233
+ setSubTableValidateInfo();
234
+ setTableEvents(listViewOptions.value, tableEvents, pageContext, configure);
235
+ const customEvents = pageContext.customEvents;
236
+ if (customEvents) {
237
+ listViewOptions.value["eventCallBack"] = customEvents;
238
+ }
239
+ listViewShowFlag.value = true;
240
+ setGridToStore();
241
+ }
242
+ function setSubTableValidateInfo() {
243
+ const fieldPermissionMap = pageContext.fieldPermissionMap;
244
+ const actionPermissionMap = pageContext.actionPermissionMap;
245
+ if (fieldPermissionMap && fieldPermissionMap != null) {
246
+ let validateRules = fieldPermissionMap.get(prop);
247
+ if (!validateRules) {
248
+ const allValidateRules = fieldPermissionMap.get("all_fields");
249
+ if (allValidateRules) {
250
+ validateRules = [allValidateRules];
251
+ }
252
+ }
253
+ if (validateRules) {
254
+ listViewOptions.value["validateRules"] = validateRules;
255
+ } else {
256
+ listViewOptions.value["validateRules"] = null;
257
+ }
258
+ }
259
+ if (actionPermissionMap && actionPermissionMap != null) {
260
+ let actionPermission = actionPermissionMap.get(prop);
261
+ if (!actionPermission) {
262
+ actionPermission = actionPermissionMap.get("all_sub_tables");
263
+ }
264
+ listViewOptions.value["actionPermission"] = actionPermission;
265
+ }
266
+ if (!listViewOptions.value["operations"]) {
267
+ listViewOptions.value["operations"] = {};
268
+ }
269
+ const subTableOperations = getOperations();
270
+ listViewOptions.value["operations"]["operation"] = subTableOperations;
271
+ listViewOptions.value["subTableCanAdd"] = isShowAddWf();
272
+ }
273
+ function setGridToStore() {
274
+ if (!pageContext.tableUuids) {
275
+ pageContext.tableUuids = [];
276
+ }
277
+ if (pageContext.tableUuids.indexOf(configure.uuid) < 0) {
278
+ pageContext.tableUuids.push(configure.uuid);
279
+ }
280
+ }
281
+ function getOperations() {
282
+ let operations = [];
283
+ let isShowOperation = caculateShowCondition(props.pageContext, configure.props.base.showOperationCondition);
284
+ if (isShowOperation && isShowAddWf()) {
285
+ const addButton = {
286
+ props: {
287
+ elementType: "el-button",
288
+ icon: "Plus",
289
+ type: "primary",
290
+ circle: true,
291
+ size: "mini",
292
+ permission: "true"
293
+ },
294
+ onClick: addSubTableData,
295
+ isShow: isShowAdd
296
+ };
297
+ operations.push(addButton);
298
+ }
299
+ if (isShowOperation && isShowDeleteWf(null, null, null, null, null, true)) {
300
+ const removeButton = {
301
+ props: {
302
+ elementType: "el-button",
303
+ icon: "Minus",
304
+ type: "danger",
305
+ circle: true,
306
+ size: "mini",
307
+ permission: "true"
308
+ },
309
+ onClick: removeSubTableData,
310
+ isShow: isShowDelete
311
+ };
312
+ operations.push(removeButton);
313
+ }
314
+ getOperationButtons(pageContext, configure, operations, getOperationButtonClickEvent);
315
+ return operations;
316
+ }
317
+ const operationButtonObj = ref({});
318
+ function getOperationButtonClickEvent(buttonConfigure) {
319
+ if (!buttonConfigure) {
320
+ return;
321
+ }
322
+ operationButtonObj.value[buttonConfigure.uuid] = buttonConfigure;
323
+ let onClick = customButtonClick;
324
+ return onClick;
325
+ }
326
+ function customButtonClick(originalValue, formatValue, row, column, rowIndex, button) {
327
+ const otherParams = {
328
+ originalValue,
329
+ formatValue,
330
+ row,
331
+ column,
332
+ rowIndex,
333
+ button,
334
+ id: row.ID ? row.ID : row.id
335
+ };
336
+ const buttonConfigure = operationButtonObj.value[button.sourceButton.uuid];
337
+ const tableConfigure = configure;
338
+ buttonConfigure.props.base.tableUuid = tableConfigure.uuid;
339
+ getHandleEvent(null, pageContext, buttonConfigure, "click", otherParams);
340
+ }
341
+ initializationSubTable();
342
+ function getEntityId(row) {
343
+ if (row && row.id) {
344
+ return row.id;
345
+ } else if (row && row.ID) {
346
+ return row.ID;
347
+ }
348
+ }
349
+ function isShowAddWf(originalValue, formatValue, row, column, rowIndex, isFormJudge) {
350
+ const isShowOperation = caculateShowCondition(props.pageContext, configure.props.base.showOperationCondition);
351
+ if (!isShowOperation) {
352
+ return false;
353
+ }
354
+ const fieldPermissionMap = pageContext.fieldPermissionMap;
355
+ const actionPermissionMap = pageContext.actionPermissionMap;
356
+ let canAdd = true;
357
+ if (fieldPermissionMap && fieldPermissionMap !== null) {
358
+ const allFieldPermission = fieldPermissionMap.get("all_fields");
359
+ if (typeof allFieldPermission !== "undefined" && allFieldPermission.canEdit === false && (allFieldPermission.rowIndexes === void 0 || allFieldPermission.rowIndexes === null || allFieldPermission.rowIndexes.length === 0)) {
360
+ canAdd = false;
361
+ }
362
+ }
363
+ if (canAdd === true && prop && actionPermissionMap && actionPermissionMap !== null) {
364
+ let oneTableActionPermission = actionPermissionMap.get(prop);
365
+ if (!oneTableActionPermission) {
366
+ oneTableActionPermission = actionPermissionMap.get("all_sub_tables");
367
+ }
368
+ if (oneTableActionPermission && oneTableActionPermission.canAdd !== void 0 && oneTableActionPermission.canAdd === false) {
369
+ canAdd = false;
370
+ }
371
+ }
372
+ return canAdd;
373
+ }
374
+ function isShowAdd(originalValue, formatValue, row, column, rowIndex, isFormJudge) {
375
+ let canAdd = isShowAddWf();
376
+ if (canAdd === true) {
377
+ canAdd = caculateShowCondition(props.pageContext, configure.props.base.showAddBtnCondition, row);
378
+ }
379
+ return canAdd;
380
+ }
381
+ function isShowDeleteWf(originalValue, formatValue, row, column, rowIndex, isFormJudge) {
382
+ const fieldPermissionMap = pageContext.fieldPermissionMap;
383
+ const actionPermissionMap = pageContext.actionPermissionMap;
384
+ let canDelete = true;
385
+ if (fieldPermissionMap && fieldPermissionMap !== null) {
386
+ const allFieldPermission = fieldPermissionMap.get("all_fields");
387
+ if (typeof allFieldPermission !== "undefined" && allFieldPermission.canEdit === false && (allFieldPermission.rowIndexes === void 0 || allFieldPermission.rowIndexes === null || allFieldPermission.rowIndexes.length === 0)) {
388
+ canDelete = false;
389
+ }
390
+ }
391
+ if (canDelete === true && prop && actionPermissionMap && actionPermissionMap !== null) {
392
+ let oneTableActionPermission = actionPermissionMap.get(prop);
393
+ if (!oneTableActionPermission) {
394
+ oneTableActionPermission = actionPermissionMap.get("all_sub_tables");
395
+ }
396
+ if (oneTableActionPermission && oneTableActionPermission.canDelete !== void 0 && oneTableActionPermission.canDelete === false) {
397
+ canDelete = false;
398
+ }
399
+ if (oneTableActionPermission && oneTableActionPermission.canDelete !== void 0 && oneTableActionPermission.canDelete === true) {
400
+ if (oneTableActionPermission.deleteRowIndexes) {
401
+ if (oneTableActionPermission.deleteRowIndexes.length > 0) {
402
+ if (isFormJudge) {
403
+ canDelete = true;
404
+ } else {
405
+ const rowId = getEntityId(row);
406
+ if (rowId !== void 0 && oneTableActionPermission.deleteRowIndexes.indexOf(rowId) >= 0) {
407
+ canDelete = true;
408
+ } else {
409
+ canDelete = false;
410
+ }
411
+ }
412
+ } else {
413
+ canDelete = false;
414
+ }
415
+ }
416
+ }
417
+ }
418
+ return canDelete;
419
+ }
420
+ function isShowDelete(originalValue, formatValue, row, column, rowIndex, isFormJudge) {
421
+ let canDelete = isShowDeleteWf(originalValue, formatValue, row, column, rowIndex, isFormJudge);
422
+ if (canDelete === true) {
423
+ canDelete = caculateShowCondition(props.pageContext, configure.props.base.showDeleteBtnCondition, row);
424
+ }
425
+ return canDelete;
426
+ }
427
+ function addSubTableData(originalValue, formatValue, row, column, rowIndex) {
428
+ gridRef.value.createRow(listCode, {}, { getDefaultValueFunc: getDefaultValue });
429
+ }
430
+ function removeSubTableData(originalValue, formatValue, row, column, rowIndex) {
431
+ gridRef.value.deleteRow(rowIndex, listCode, false);
432
+ }
433
+ function changeGridData(gridData) {
434
+ setVariableValue(entity, dynamicFields, gridData);
435
+ }
436
+ function changeRowsPerpage(pageSize) {
437
+ console.log("表单组件--Item--changeRowsPerpage==pageSize=", pageSize);
438
+ if (!pageContext.subTablePageInfo) {
439
+ pageContext.subTablePageInfo = {};
440
+ }
441
+ pageContext.subTablePageInfo[prop] = { pageSize };
442
+ }
443
+ function setSelectOptions(valueSetOptions) {
444
+ const propName = valueSetOptions.key;
445
+ const options = valueSetOptions.value;
446
+ if (!pageContext.selectOptions) {
447
+ pageContext.selectOptions = {};
448
+ }
449
+ pageContext.selectOptions[propName] = options;
450
+ }
451
+ function fnProhibitToEdit(data) {
452
+ const myPageCode = pageContext.code;
453
+ const eventPageInfo = myPageCode + "_";
454
+ bus.$emit(eventPageInfo + "prohibit-edit", data);
455
+ }
456
+ function refresMainTableFields(entity2) {
457
+ const dataModel2 = pageContext.entity.data;
458
+ if (entity2) {
459
+ for (const key in entity2) {
460
+ dataModel2[key] = entity2[key];
461
+ }
462
+ }
463
+ }
464
+ function select(selection, row) {
465
+ if (row !== void 0) {
466
+ selections.value = selection;
467
+ const params = {
468
+ selection,
469
+ row
470
+ };
471
+ gridSelectRecord(pageContext, configure, params);
472
+ }
473
+ }
474
+ function selectAll(selection) {
475
+ selections.value = selection;
476
+ const params = {
477
+ selection
478
+ };
479
+ gridSelectAllRecords(pageContext, configure, params);
480
+ }
481
+ function selectionChange(newSelection) {
482
+ const params = {
483
+ newSelection
484
+ };
485
+ gridSelectionChange(pageContext, configure, params);
486
+ }
487
+ function cellClickEvent(row, column, cell, event) {
488
+ const params = {
489
+ row,
490
+ column,
491
+ cell,
492
+ event
493
+ };
494
+ cellClick(pageContext, configure, params);
495
+ }
496
+ function cellDblClickEvent(row, column, cell, event) {
497
+ const params = {
498
+ row,
499
+ column,
500
+ cell,
501
+ event
502
+ };
503
+ cellDblClick(pageContext, configure, params);
504
+ }
505
+ function rowClickEvent(row, column, event) {
506
+ const params = {
507
+ row,
508
+ column,
509
+ event
510
+ };
511
+ rowClick(pageContext, configure, params);
512
+ }
513
+ function rowDblClickEvent(row, column, event) {
514
+ const params = {
515
+ row,
516
+ column,
517
+ event
518
+ };
519
+ rowDblClick(pageContext, configure, params);
520
+ }
521
+ function headerClickEvent(column, event) {
522
+ const params = {
523
+ column,
524
+ event
525
+ };
526
+ headerClick(pageContext, configure, params);
527
+ }
528
+ function changeFormData(formData) {
529
+ pageContext.entity.data = formData;
530
+ }
531
+ function validatorSunTableListData() {
532
+ return gridRef.value.validatorSunTableListData();
533
+ }
534
+ function createRow() {
535
+ return gridRef.value.createRow(listCode);
536
+ }
537
+ function getSelections() {
538
+ return selections.value;
539
+ }
540
+ function getSelectionIds() {
541
+ const dataIds = [];
542
+ if (selections.value) {
543
+ selections.value.forEach((item) => {
544
+ dataIds.push(item.id ? item.id : item.ID ? item.ID : null);
545
+ });
546
+ }
547
+ return dataIds;
548
+ }
549
+ function clearSelections() {
550
+ selections.value = [];
551
+ }
552
+ function getTableConfigure() {
553
+ return configure;
554
+ }
555
+ function getValue() {
556
+ return getVariableValue(entity, dynamicFields);
557
+ }
558
+ function setValue(value) {
559
+ return setVariableValue(entity, dynamicFields, value);
560
+ }
561
+ function refreshChildTableData(gridData) {
562
+ setValue(gridData);
563
+ timer2 = setTimeout(() => {
564
+ if (gridRef.value) {
565
+ gridRef.value.refreshChildData(listCode, gridData, configure.props && configure.props.base && configure.props.base.subPaging === true);
566
+ listViewOptions.value.extraParam["entityMap"] = pageContext.entity.data;
567
+ }
568
+ }, 10);
569
+ }
570
+ function getRowStyle(data) {
571
+ const style = getRowStyleUtil(data, null, props);
572
+ return style;
573
+ }
574
+ function getCellStyle(data) {
575
+ return getCellStyleUtil(data, data.cellStyle, props);
576
+ }
577
+ function getTitleStyle(data) {
578
+ const cellTitleStyle = data.titleStyle;
579
+ const rowTitleStyle = props.configure.style.titleStyle;
580
+ return getHeaderCellStyleUtil(data, { cellTitleStyle, titleStyle: rowTitleStyle }, props);
581
+ }
582
+ function getTableSelectOptions() {
583
+ if (gridRef.value) {
584
+ return gridRef.value.getTableSelectOptions(listCode);
585
+ }
586
+ }
587
+ function dynamicControlTableEdit(pageContext2, customRules, listCode2) {
588
+ if (gridRef.value) {
589
+ gridRef.value.dynamicControlTableEdit(pageContext2, customRules, listCode2);
590
+ }
591
+ }
592
+ function doLayout(hiddenColumns) {
593
+ if (gridRef.value) {
594
+ gridRef.value.doLayout(hiddenColumns);
595
+ }
596
+ }
597
+ __expose({
598
+ createRow,
599
+ getSelections,
600
+ getSelectionIds,
601
+ clearSelections,
602
+ getTableConfigure,
603
+ validatorSunTableListData,
604
+ getValue,
605
+ setValue,
606
+ getTableSelectOptions,
607
+ dynamicControlTableEdit,
608
+ doLayout
609
+ });
610
+ return (_ctx, _cache) => {
611
+ const _component_super_grid = resolveComponent("super-grid");
612
+ return openBlock(), createElementBlock("div", null, [
613
+ listViewShowFlag.value ? (openBlock(), createBlock(_component_super_grid, {
614
+ key: 0,
615
+ ref_key: "gridRef",
616
+ ref: gridRef,
617
+ url: unref(baseURL) + "/dsc/commons/sub-table",
618
+ options: listViewOptions.value,
619
+ code: unref(listCode),
620
+ settings: unref(superGridSetting),
621
+ onSelect: select,
622
+ onSelectAll: selectAll,
623
+ onSelectionChange: selectionChange,
624
+ onCellClick: cellClickEvent,
625
+ onCellDblclick: cellDblClickEvent,
626
+ onRowClick: rowClickEvent,
627
+ onRowDblclick: rowDblClickEvent,
628
+ onHeaderClick: headerClickEvent,
629
+ onFnProhibitToEdit: fnProhibitToEdit,
630
+ onChangeGridData: changeGridData,
631
+ onReloadGrid: changeInitializationSubTable,
632
+ onRefresMainTableFields: refresMainTableFields,
633
+ onSetSelectOptions: setSelectOptions,
634
+ onChangeRowsPerPage: changeRowsPerpage,
635
+ onNewOpenGridDialog: unref(popupToPage),
636
+ onChangeFormData: changeFormData
637
+ }, null, 8, ["url", "options", "code", "settings", "onNewOpenGridDialog"])) : createCommentVNode("", true)
638
+ ]);
639
+ };
640
+ }
641
+ });
269
642
  export {
270
- j as default
643
+ _sfc_main as default
271
644
  };