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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/dist/es/_virtual/_plugin-vue_export-helper.js +7 -5
  2. package/dist/es/assets/chart-themes/theme1.js +6 -2
  3. package/dist/es/assets/chart-themes/theme2.js +6 -2
  4. package/dist/es/assets/chart-themes/theme3.js +6 -2
  5. package/dist/es/components/runtime/utils/api/api-util.js +7 -4
  6. package/dist/es/components/runtime/utils/api/page-expose-util.js +443 -135
  7. package/dist/es/components/runtime/utils/assemblys-config.js +369 -13
  8. package/dist/es/components/runtime/utils/barcode-util.js +33 -9
  9. package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +306 -122
  10. package/dist/es/components/runtime/utils/charts/chart-gauge-util.js +68 -29
  11. package/dist/es/components/runtime/utils/charts/chart-pie-util.js +152 -69
  12. package/dist/es/components/runtime/utils/charts/chart-radar-util.js +124 -46
  13. package/dist/es/components/runtime/utils/charts/chart-scatter-util.js +99 -38
  14. package/dist/es/components/runtime/utils/charts/chart-util.js +522 -226
  15. package/dist/es/components/runtime/utils/common-util.js +156 -76
  16. package/dist/es/components/runtime/utils/eventBus.js +8 -3
  17. package/dist/es/components/runtime/utils/events/event-util.js +775 -362
  18. package/dist/es/components/runtime/utils/events/print-label.js +140 -73
  19. package/dist/es/components/runtime/utils/events/standard-event.js +2320 -820
  20. package/dist/es/components/runtime/utils/events/validator-util.js +560 -224
  21. package/dist/es/components/runtime/utils/form/date-shortcuts.js +88 -28
  22. package/dist/es/components/runtime/utils/form/scan-util.js +162 -62
  23. package/dist/es/components/runtime/utils/global-refs.js +84 -53
  24. package/dist/es/components/runtime/utils/i18n-util.js +20 -11
  25. package/dist/es/components/runtime/utils/interfaces/page-design-types.js +7 -2
  26. package/dist/es/components/runtime/utils/page-helper-util.js +660 -280
  27. package/dist/es/components/runtime/utils/page-init-util.js +405 -144
  28. package/dist/es/components/runtime/utils/page-permission-util.js +531 -22
  29. package/dist/es/components/runtime/utils/page-store.js +68 -23
  30. package/dist/es/components/runtime/utils/store-util.js +13 -9
  31. package/dist/es/components/runtime/utils/store.js +2 -2
  32. package/dist/es/components/runtime/utils/table-utils.js +81 -40
  33. package/dist/es/components/runtime/utils/tree-utils.js +37 -17
  34. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue.js +2 -2
  35. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +83 -21
  36. package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue.js +2 -2
  37. package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue2.js +46 -14
  38. package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue.js +2 -2
  39. package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +132 -36
  40. package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue.js +2 -2
  41. package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue2.js +18 -4
  42. package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue.js +2 -2
  43. package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue2.js +107 -17
  44. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue.js +2 -2
  45. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +198 -54
  46. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue.js +42 -12
  47. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue2.js +2 -2
  48. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue.js +60 -11
  49. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue2.js +2 -2
  50. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue.js +203 -54
  51. package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue2.js +2 -2
  52. package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue.js +4 -4
  53. package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue2.js +162 -46
  54. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue.js +2 -2
  55. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +109 -33
  56. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue.js +2 -2
  57. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +166 -44
  58. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue.js +2 -2
  59. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +117 -33
  60. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue.js +2 -2
  61. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +118 -33
  62. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +599 -253
  63. package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue.js +42 -4
  64. package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue2.js +2 -2
  65. package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue.js +62 -8
  66. package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue2.js +2 -2
  67. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +160 -29
  68. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue2.js +2 -2
  69. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue.js +62 -13
  70. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue2.js +2 -2
  71. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue.js +2 -2
  72. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +594 -213
  73. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +139 -33
  74. package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue2.js +2 -2
  75. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue.js +125 -21
  76. package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue2.js +2 -2
  77. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue.js +102 -16
  78. package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue2.js +2 -2
  79. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue.js +2 -2
  80. package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue2.js +81 -18
  81. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue.js +2 -2
  82. package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue2.js +82 -17
  83. package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue.js +2 -2
  84. package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue2.js +86 -14
  85. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue.js +2 -2
  86. package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +79 -21
  87. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue.js +2 -2
  88. package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue2.js +61 -16
  89. package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue.js +2 -2
  90. package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue2.js +37 -10
  91. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue.js +2 -2
  92. package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +127 -38
  93. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue.js +2 -2
  94. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +76 -28
  95. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue.js +2 -2
  96. package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +178 -63
  97. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +810 -305
  98. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue2.js +2 -2
  99. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +635 -265
  100. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue2.js +2 -2
  101. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue.js +2 -2
  102. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +115 -40
  103. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue.js +2 -2
  104. package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +215 -56
  105. package/dist/es/components/runtime/views/assemblys/error-render.vue.js +21 -3
  106. package/dist/es/components/runtime/views/assemblys/error-render.vue2.js +2 -2
  107. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue.js +2 -2
  108. package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +154 -43
  109. package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue.js +98 -34
  110. package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue2.js +2 -2
  111. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue.js +2 -2
  112. package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +200 -52
  113. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue.js +2 -2
  114. package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +239 -70
  115. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue.js +2 -2
  116. package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +109 -31
  117. package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue.js +2 -2
  118. package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue2.js +59 -21
  119. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue.js +2 -2
  120. package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +188 -56
  121. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue.js +2 -2
  122. package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +103 -22
  123. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue.js +2 -2
  124. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +246 -59
  125. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue.js +2 -2
  126. package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +174 -34
  127. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue.js +2 -2
  128. package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +107 -29
  129. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +4 -4
  130. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue2.js +50 -13
  131. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue.js +2 -2
  132. package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +194 -65
  133. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue.js +2 -2
  134. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +249 -89
  135. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue.js +2 -2
  136. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +263 -80
  137. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue.js +2 -2
  138. package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue2.js +57 -13
  139. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue.js +2 -2
  140. package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +155 -30
  141. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue.js +2 -2
  142. package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +129 -40
  143. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue.js +2 -2
  144. package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +107 -22
  145. package/dist/es/components/runtime/views/assemblys/home-chart-render.vue.js +188 -89
  146. package/dist/es/components/runtime/views/assemblys/home-chart-render.vue2.js +2 -2
  147. package/dist/es/components/runtime/views/assemblys/object-render.vue.js +272 -133
  148. package/dist/es/components/runtime/views/assemblys/object-render.vue2.js +2 -2
  149. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue.js +2 -2
  150. package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue2.js +46 -18
  151. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue.js +2 -2
  152. package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue2.js +49 -21
  153. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue.js +2 -2
  154. package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +58 -20
  155. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue.js +2 -2
  156. package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue2.js +53 -16
  157. package/dist/es/components/runtime/views/home-chart.vue.js +160 -41
  158. package/dist/es/components/runtime/views/home-chart.vue2.js +2 -2
  159. package/dist/es/components/runtime/views/super-page-dialog.vue.js +139 -21
  160. package/dist/es/components/runtime/views/super-page-dialog.vue2.js +2 -2
  161. package/dist/es/components/runtime/views/super-page.vue.js +756 -230
  162. package/dist/es/components/runtime/views/super-page.vue2.js +2 -2
  163. package/dist/es/i18n/langs/cn.js +55 -2
  164. package/dist/es/i18n/langs/en.js +55 -2
  165. package/package.json +2 -2
@@ -1,274 +1,644 @@
1
- import { defineComponent as e, ref as t, onMounted as n, onUnmounted as o, resolveComponent as a, createElementBlock as i, openBlock as l, createBlock as u, createCommentVNode as s, unref as r } from "vue";
2
- import { setTableEvents as c, gridSelectRecord as p, gridSelectAllRecords as d, gridSelectionChange as f, cellClick as b, cellDblClick as g, rowClick as v, 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 D, getSizeConfig as x } from "../../../../utils/page-helper-util.js";
4
- import { getModelFields as C, getDefaultValue as P } from "../../../../utils/page-init-util.js";
5
- import y from "../../../../utils/eventBus.js";
6
- import { popupToPage as _, getOperationButtons as I } from "../../../../utils/table-utils.js";
7
- import { getListCode as R, getBaseUrl as O } 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: U }) {
11
- const H = e2, N = H.pageContext;
12
- let A = H.configure;
13
- const L = H.configure.runtime ? H.configure.runtime : {};
14
- N.isTest ? L.value = H.configure.runtime ? H.configure.runtime : {} : N.tableRuntimes && N.tableRuntimes[A.uuid] && (A = JSON.parse(N.tableRuntimes[A.uuid].configure), L.value = A.runtime ? A.runtime : {});
15
- const z = R(N.code, N.version, A.uuid), B = N.entity.data, E = A.code ? A.code : z, G = k(N), V = L && L.events ? L.events : [], J = t([]), q = N.superGridItems, K = q ? q[A.uuid] : null;
16
- console.log("superGridSetting===", q, K);
17
- const Q = L.style, W = L.class, X = H.pageContext.entity ? H.pageContext.entity : {};
18
- let Y = C(H.configure, E), Z = O(N.backendUrl, N.isTest);
19
- Z || (Z = window.$vueApp.config.globalProperties.baseURL);
20
- const ee = t(false);
21
- let te = t(0);
22
- const ne = A.props.dataOrigin.principalLinkage, oe = t({ isSql: true, subTableData: null, rowKeyProp: ne, extraParam: {}, operations: {}, hiddenColumns: [], pageCode: N.code, pageVersion: N.version, pageContext: N, configureObj: A, showPageArea: false, showRowForm: false, showOverflowTooltip: !(!A.props || !A.props.otherSettings || void 0 !== A.props.otherSettings.isBreakLine && false !== A.props.otherSettings.isBreakLine), backendUrl: Z, cellStyleRender: function(e3) {
23
- return F(e3, e3.cellStyle, H);
24
- }, rowStyleRender: function(e3) {
25
- return M(e3, null, H);
26
- }, titleStyleRender: function(e3) {
27
- const t2 = e3.titleStyle, n2 = H.configure.style.titleStyle;
28
- return $(e3, { cellTitleStyle: t2, titleStyle: n2 }, H);
29
- } }), ae = U;
30
- Q && (oe.value.tableStyle = Q), W && (oe.value.tableClass = W), A.props && A.props.base && true === A.props.base.subPaging ? oe.value.showPageArea = true : oe.value.showPageArea = false, A.props.base.showRowForm && (oe.value.showRowForm = A.props.base.showRowForm);
31
- const ie = t(null);
32
- function le() {
33
- ie.value && (oe.value.subTableData = null, ie.value.reloadSubTableData(z));
34
- }
35
- function ue(e3) {
36
- if (void 0 === e3 && (e3 = se()), oe.value.isPageInfo = false, oe.value.isFormSubTable = true, oe.value.canRrefreshSubtableData = e3, oe.value.getFormData = re, oe.value.getGridData = ce, oe.value.extraParam.subTableListViewCode = z, oe.value.extraParam.beanName = N.beanName, oe.value.extraParam.subtableSetting = A.props && A.props.otherSettings ? JSON.stringify(A.props.otherSettings) : null, oe.value.extraParam.additionalParamMap = G, oe.value.extraParam.entityMap = N.entity.data, oe.value.extraParam.contextMap = N.entity.context, oe.value.extraParam.taskMap = N.entity.task, !(A.props && A.props.base && A.props.base.showOperation)) {
37
- let e4 = oe.value.hiddenColumns;
38
- e4 ? e4.push("operation") : e4 = ["operation"], oe.value.hiddenColumns = e4;
39
- }
40
- oe.value.showOperationButton = !(!A.props || !A.props.base) && A.props.base.showOperation, oe.value.isPdfEditor = false, oe.value.tableRecordMaxNum = A.props && A.props.otherSettings ? A.props.otherSettings.tableRecordMaxNum : null;
41
- let t2 = x(N, A);
42
- t2 && t2.fixHeight && (oe.value.formSetHeight = t2.fixHeight), t2 && t2.maxHeight && (oe.value.formSetMaxHeight = t2.maxHeight);
43
- }
44
- function se() {
45
- if (A.props && A.props.otherSettings) {
46
- if (A.props.otherSettings.sourceQueryTableData && A.props.otherSettings.timeToInitializeSubTable && A.props.otherSettings.timeToInitializeSubTable.length > 0) {
47
- let e3 = false;
48
- if (-1 !== A.props.otherSettings.timeToInitializeSubTable.indexOf("create") && (e3 = !B.id && !B.ID), -1 !== A.props.otherSettings.timeToInitializeSubTable.indexOf("noData")) {
49
- const t2 = B[E];
50
- (!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
+ }
51
97
  }
52
- 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);
53
126
  }
54
- return false;
55
127
  }
56
- }
57
- function re() {
58
- return N.entity.data;
59
- }
60
- function ce() {
61
- return D(X, Y);
62
- }
63
- let pe, de;
64
- function fe(e3) {
65
- ue(e3), oe.value.subTableData = null, be(), ee.value = false, pe = setTimeout(() => {
66
- ee.value = true, te.value = te.value + 1, ge();
67
- }, 10);
68
- }
69
- function be() {
70
- !function() {
71
- const e4 = N.fieldPermissionMap, t2 = N.actionPermissionMap;
72
- if (e4 && null != e4) {
73
- let t3 = e4.get(E);
74
- if (!t3) {
75
- const n3 = e4.get("all_fields");
76
- 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");
77
164
  }
78
- oe.value.validateRules = t3 || null;
79
- }
80
- if (t2 && null != t2) {
81
- let e5 = t2.get(E);
82
- e5 || (e5 = t2.get("all_sub_tables")), oe.value.actionPermission = e5;
83
- }
84
- oe.value.operations || (oe.value.operations = {});
85
- const n2 = function() {
86
- let e5 = [], t3 = w(H.pageContext, A.props.base.showOperationCondition);
87
- if (t3 && Se()) {
88
- const t4 = { props: { elementType: "el-button", icon: "Plus", type: "primary", circle: true, size: "mini", permission: "true" }, onClick: xe, isShow: we };
89
- 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
+ }
90
190
  }
91
- if (t3 && Te(null, null, null, null, null, true)) {
92
- const t4 = { props: { elementType: "el-button", icon: "Minus", type: "danger", circle: true, size: "mini", permission: "true" }, onClick: Ce, isShow: De };
93
- 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
+ }
94
196
  }
95
- return I(N, A, e5, me), e5;
96
- }();
97
- oe.value.operations.operation = n2, oe.value.subTableCanAdd = Se();
98
- }(), c(oe.value, V, N, A);
99
- const e3 = N.customEvents;
100
- e3 && (oe.value.eventCallBack = e3), ee.value = true, ge();
101
- }
102
- function ge() {
103
- N.tableUuids || (N.tableUuids = []), N.tableUuids.indexOf(A.uuid) < 0 && N.tableUuids.push(A.uuid);
104
- }
105
- n(() => {
106
- const e3 = A.uuid, t2 = N.subTableWatchProps;
107
- y.$on("_refreshSubTable_" + e3, (n2) => {
108
- console.log("-_refreshSubTable--tableUuid=", e3, "params=", n2);
109
- const o2 = n2.propName;
110
- if (t2 && t2[e3] && t2[e3].length > 0) {
111
- t2[e3].indexOf(o2) >= 0 && le();
112
- }
113
- }), y.$on("_refreshSubTableHandle_" + e3, (t3) => {
114
- console.log("-_refreshSubTableHandle_--tableUuid=", e3, "params=", t3), le();
115
- }), y.$on("_refreshChildData_" + e3, (t3) => {
116
- console.log("-_refreshChildData_--tableUuid=", e3), function(e4) {
117
- Le(e4), de = setTimeout(() => {
118
- ie.value && (ie.value.refreshChildData(z, e4, A.props && A.props.base && true === A.props.base.subPaging), oe.value.extraParam.entityMap = N.entity.data);
119
- }, 10);
120
- }(t3);
121
- }), y.$on(z + "-pickFileDone", (e4) => {
122
- console.log("superPage5555---listCode---pickFileDone--listCode=", z, "data=", e4), ie.value.pickFileDone(e4);
123
- }), y.$on(z + "-scanDone", (e4) => {
124
- console.log("superPage5555---listCode---scanDone--listCode=", z, "data=", e4), ie.value.scanDone(e4);
125
- }), oe.value && oe.value.configureObj.props.base && oe.value.configureObj.props.base.isSafeDelete && ae("setSafeDeleteTableCode", oe.value.extraParam.tableName);
126
- }), o(() => {
127
- pe && clearTimeout(pe), de && clearTimeout(de);
128
- const e3 = A.uuid;
129
- y.$off("_refreshSubTable_" + e3), y.$off("_refreshSubTableHandle_" + e3), y.$off("_refreshChildData_" + e3), y.$off(z + "-pickFileDone"), y.$off(z + "-scanDone");
130
- });
131
- const ve = t({});
132
- function me(e3) {
133
- if (!e3) return;
134
- return ve.value[e3.uuid] = e3, he;
135
- }
136
- function he(e3, t2, n2, o2, a2, i2) {
137
- const l2 = { originalValue: e3, formatValue: t2, row: n2, column: o2, rowIndex: a2, button: i2, id: n2.ID ? n2.ID : n2.id }, u2 = ve.value[i2.sourceButton.uuid], s2 = A;
138
- u2.props.base.tableUuid = s2.uuid, S(null, N, u2, "click", l2);
139
- }
140
- function Se(e3, t2, n2, o2, a2, i2) {
141
- if (!w(H.pageContext, A.props.base.showOperationCondition)) return false;
142
- const l2 = N.fieldPermissionMap, u2 = N.actionPermissionMap;
143
- let s2 = true;
144
- if (l2 && null !== l2) {
145
- const e4 = l2.get("all_fields");
146
- void 0 === e4 || false !== e4.canEdit || void 0 !== e4.rowIndexes && null !== e4.rowIndexes && 0 !== e4.rowIndexes.length || (s2 = false);
147
- }
148
- if (true === s2 && E && u2 && null !== u2) {
149
- let e4 = u2.get(E);
150
- e4 || (e4 = u2.get("all_sub_tables")), e4 && void 0 !== e4.canAdd && false === e4.canAdd && (s2 = false);
151
- }
152
- return s2;
153
- }
154
- function we(e3, t2, n2, o2, a2, i2) {
155
- let l2 = Se();
156
- return true === l2 && (l2 = w(H.pageContext, A.props.base.showAddBtnCondition, n2)), l2;
157
- }
158
- function Te(e3, t2, n2, o2, a2, i2) {
159
- const l2 = N.fieldPermissionMap, u2 = N.actionPermissionMap;
160
- let s2 = true;
161
- if (l2 && null !== l2) {
162
- const e4 = l2.get("all_fields");
163
- void 0 === e4 || false !== e4.canEdit || void 0 !== e4.rowIndexes && null !== e4.rowIndexes && 0 !== e4.rowIndexes.length || (s2 = false);
164
- }
165
- if (true === s2 && E && u2 && null !== u2) {
166
- let e4 = u2.get(E);
167
- if (e4 || (e4 = u2.get("all_sub_tables")), e4 && void 0 !== e4.canDelete && false === e4.canDelete && (s2 = false), e4 && void 0 !== e4.canDelete && true === e4.canDelete && e4.deleteRowIndexes) if (e4.deleteRowIndexes.length > 0) if (i2) s2 = true;
168
- else {
169
- const t3 = function(e5) {
170
- return e5 && e5.id ? e5.id : e5 && e5.ID ? e5.ID : void 0;
171
- }(n2);
172
- s2 = void 0 !== t3 && e4.deleteRowIndexes.indexOf(t3) >= 0;
173
- }
174
- else s2 = false;
175
- }
176
- return s2;
177
- }
178
- function De(e3, t2, n2, o2, a2, i2) {
179
- let l2 = Te(0, 0, n2, 0, 0, i2);
180
- return true === l2 && (l2 = w(H.pageContext, A.props.base.showDeleteBtnCondition, n2)), l2;
181
- }
182
- function xe(e3, t2, n2, o2, a2) {
183
- ie.value.createRow(z, {}, { getDefaultValueFunc: P });
184
- }
185
- function Ce(e3, t2, n2, o2, a2) {
186
- ie.value.deleteRow(a2, z, false);
187
- }
188
- function Pe(e3) {
189
- T(X, Y, e3);
190
- }
191
- function ye(e3) {
192
- console.log("表单组件--Item--changeRowsPerpage==pageSize=", e3), N.subTablePageInfo || (N.subTablePageInfo = {}), N.subTablePageInfo[E] = { pageSize: e3 };
193
- }
194
- function _e(e3) {
195
- const t2 = e3.key, n2 = e3.value;
196
- N.selectOptions || (N.selectOptions = {}), N.selectOptions[t2] = n2;
197
- }
198
- function Ie(e3) {
199
- const t2 = N.code + "_";
200
- y.$emit(t2 + "prohibit-edit", e3);
201
- }
202
- function Re(e3) {
203
- const t2 = N.entity.data;
204
- if (e3) for (const n2 in e3) t2[n2] = e3[n2];
205
- }
206
- function Oe(e3, t2) {
207
- if (void 0 !== t2) {
208
- J.value = e3;
209
- p(N, A, { selection: e3, row: t2 });
197
+ return flag;
198
+ } else {
199
+ return false;
200
+ }
210
201
  }
211
- }
212
- function ke(e3) {
213
- J.value = e3;
214
- d(N, A, { selection: e3 });
215
- }
216
- function Me(e3) {
217
- f(N, A, { newSelection: e3 });
218
- }
219
- function Fe(e3, t2, n2, o2) {
220
- b(N, A, { row: e3, column: t2, cell: n2, event: o2 });
221
- }
222
- function $e(e3, t2, n2, o2) {
223
- g(N, A, { row: e3, column: t2, cell: n2, event: o2 });
224
- }
225
- function je(e3, t2, n2) {
226
- v(N, A, { row: e3, column: t2, event: n2 });
227
- }
228
- function Ue(e3, t2, n2) {
229
- m(N, A, { row: e3, column: t2, event: n2 });
230
- }
231
- function He(e3, t2) {
232
- h(N, A, { column: e3, event: t2 });
233
- }
234
- function Ne(e3) {
235
- N.entity.data = e3;
236
- }
237
- function Ae() {
238
- return D(X, Y);
239
- }
240
- function Le(e3) {
241
- return T(X, Y, e3);
242
- }
243
- return function() {
244
- const e3 = se();
245
- e3 ? fe(e3) : (ue(e3), oe.value.isPageInfo = false, oe.value.subTableData = Ae(), be());
246
- }(), j2({ createRow: function() {
247
- return ie.value.createRow(z);
248
- }, getSelections: function() {
249
- return J.value;
250
- }, getSelectionIds: function() {
251
- const e3 = [];
252
- return J.value && J.value.forEach((t2) => {
253
- e3.push(t2.id ? t2.id : t2.ID ? t2.ID : null);
254
- }), e3;
255
- }, clearSelections: function() {
256
- J.value = [];
257
- }, getTableConfigure: function() {
258
- return A;
259
- }, validatorSunTableListData: function() {
260
- return ie.value.validatorSunTableListData();
261
- }, getValue: Ae, setValue: Le, getTableSelectOptions: function() {
262
- if (ie.value) return ie.value.getTableSelectOptions(z);
263
- }, dynamicControlTableEdit: function(e3, t2, n2) {
264
- ie.value && ie.value.dynamicControlTableEdit(e3, t2, n2);
265
- }, doLayout: function(e3) {
266
- ie.value && ie.value.doLayout(e3);
267
- } }), (e3, t2) => {
268
- const n2 = a("super-grid");
269
- return l(), i("div", null, [ee.value ? (l(), u(n2, { key: 0, ref_key: "gridRef", ref: ie, url: r(Z) + "/dsc/commons/sub-table", options: oe.value, code: r(z), settings: r(K), onSelect: Oe, onSelectAll: ke, onSelectionChange: Me, onCellClick: Fe, onCellDblclick: $e, onRowClick: je, onRowDblclick: Ue, onHeaderClick: He, onFnProhibitToEdit: Ie, onChangeGridData: Pe, onReloadGrid: fe, onRefresMainTableFields: Re, onSetSelectOptions: _e, onChangeRowsPerPage: ye, onNewOpenGridDialog: r(_), onChangeFormData: Ne }, null, 8, ["url", "options", "code", "settings", "onNewOpenGridDialog"])) : s("", true)]);
270
- };
271
- } });
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
+ });
272
642
  export {
273
- j as default
643
+ _sfc_main as default
274
644
  };