@fecp/designer 5.5.50 → 5.5.53

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.
@@ -38,6 +38,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
38
38
  Vue.inject("gridLayout");
39
39
  const setFormItemHeight = Vue.inject("setFormItemHeight");
40
40
  const handleEvent = Vue.inject("handleEvent");
41
+ const heightMode = Vue.computed(() => {
42
+ return props.config.subTableHeightType || "auto";
43
+ });
41
44
  const btnRollbackEvent = Vue.computed(() => {
42
45
  const btnRollback = props.config.btnRollback || [];
43
46
  const data = {};
@@ -106,7 +109,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
106
109
  );
107
110
  });
108
111
  });
109
- function subTableLoaded(subOption) {
112
+ function subTableLoaded(subOption, tableHeight) {
110
113
  subTableOption.value = subOption;
111
114
  const foundItem = props.localConfig.fieldsData.find(
112
115
  (item) => item.id == props.config.id
@@ -114,12 +117,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
114
117
  const titleHeight = props.config.titleMode != "none" ? 60 : 0;
115
118
  if (foundItem) {
116
119
  foundItem.fixedH = true;
117
- foundItem.h = props.config.subTableHeight + titleHeight;
118
- setFormItemHeight(
119
- props.config.id,
120
- true,
121
- props.config.subTableHeight + titleHeight
122
- );
120
+ foundItem.h = tableHeight + titleHeight;
121
+ setFormItemHeight(props.config.id, true, foundItem.h);
123
122
  }
124
123
  }
125
124
  const tableRef = Vue.ref();
@@ -193,17 +192,19 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
193
192
  ref: tableRef,
194
193
  templateKey: __props.config.subTableKey,
195
194
  isSubTable: "",
196
- onLoaded: subTableLoaded,
195
+ onHeightLoaded: subTableLoaded,
197
196
  mode: __props.config.subTableMode,
198
197
  titleMode: __props.config.titleMode,
199
198
  hasPagination: __props.config.isSubTablePagination,
199
+ heightMode: Vue.unref(heightMode),
200
200
  height: __props.config.subTableHeight,
201
+ maxHeight: __props.config.subTableMaxHeight,
201
202
  tableData: Vue.unref(subTableData),
202
203
  initSearchData: Vue.unref(initSearchData),
203
204
  canLoadBySearchData: __props.config.reloadOnParamsChange,
204
205
  readonly: __props.config.isSubTableReadOnly || __props.formMode == "query",
205
206
  btnRollbackEvent: Vue.unref(btnRollbackEvent)
206
- }, null, 8, ["templateKey", "mode", "titleMode", "hasPagination", "height", "tableData", "initSearchData", "canLoadBySearchData", "readonly", "btnRollbackEvent"])
207
+ }, null, 8, ["templateKey", "mode", "titleMode", "hasPagination", "heightMode", "height", "maxHeight", "tableData", "initSearchData", "canLoadBySearchData", "readonly", "btnRollbackEvent"])
207
208
  ], 64);
208
209
  };
209
210
  }
@@ -94,10 +94,18 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
94
94
  type: Boolean,
95
95
  default: false
96
96
  },
97
+ heightMode: {
98
+ type: String,
99
+ default: ""
100
+ },
97
101
  height: {
98
102
  type: Number,
99
103
  default: null
100
104
  },
105
+ maxHeight: {
106
+ type: Number,
107
+ default: null
108
+ },
101
109
  readonly: {
102
110
  type: Boolean,
103
111
  default: false
@@ -123,11 +131,13 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
123
131
  "selection-change",
124
132
  "sort-change",
125
133
  "page-change",
126
- "loaded"
134
+ "loaded",
135
+ "height-loaded"
127
136
  ],
128
137
  setup(__props, { expose: __expose, emit: __emit }) {
129
138
  const props = __props;
130
139
  const emit = __emit;
140
+ const fecTableContainerRef = Vue.ref(null);
131
141
  const tableRef = Vue.ref(null);
132
142
  const tableContainer = Vue.ref(null);
133
143
  const currentMode = Vue.ref("");
@@ -189,13 +199,43 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
189
199
  };
190
200
  });
191
201
  const autoResize = Vue.computed(() => {
192
- return localConfig.value.heightMode === "auto";
202
+ if (props.isSubTable) {
203
+ if (props.heightMode) {
204
+ return props.heightMode == "auto";
205
+ } else {
206
+ return false;
207
+ }
208
+ } else {
209
+ return localConfig.value.heightMode == "auto";
210
+ }
193
211
  });
194
212
  const tableHeight = Vue.computed(() => {
195
- if (localConfig.value.heightMode === "auto") {
196
- return "100%";
213
+ if (props.isSubTable) {
214
+ if (props.heightMode == "fixed" && props.height) {
215
+ return props.height;
216
+ } else {
217
+ return "";
218
+ }
219
+ } else {
220
+ if (localConfig.value.heightMode === "auto") {
221
+ return "100%";
222
+ }
223
+ return localConfig.value.height || 500;
224
+ }
225
+ });
226
+ const tableMaxHeight = Vue.computed(() => {
227
+ if (props.isSubTable) {
228
+ if (props.heightMode == "max" && props.maxHeight) {
229
+ return props.maxHeight;
230
+ } else {
231
+ return "";
232
+ }
233
+ } else {
234
+ if (localConfig.value.heightMode === "max") {
235
+ return localConfig.value.maxHeight || 500;
236
+ }
237
+ return "";
197
238
  }
198
- return localConfig.value.height || 500;
199
239
  });
200
240
  const summaryConfig = Vue.computed(() => {
201
241
  return localConfig.value.summaryConfig || {
@@ -508,6 +548,19 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
508
548
  const handleRadioChange = (checked) => {
509
549
  emit("selection-change", [checked.row]);
510
550
  };
551
+ const handleInitRendered = ({ visibleColumn, visibleData, $event }) => {
552
+ const offsetHeight = fecTableContainerRef.value.$el.offsetHeight;
553
+ emit("height-loaded", localConfig.value, offsetHeight);
554
+ };
555
+ const handleDataRendered = ({
556
+ isReload,
557
+ visibleColumn,
558
+ visibleData,
559
+ $event
560
+ }) => {
561
+ const offsetHeight = fecTableContainerRef.value.$el.offsetHeight;
562
+ emit("height-loaded", localConfig.value, offsetHeight);
563
+ };
511
564
  const handleFilterSearch = (filters) => {
512
565
  var _a, _b;
513
566
  if (dataSourceManager.value) {
@@ -708,8 +761,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
708
761
  }
709
762
  });
710
763
  initHandleEvent();
711
- emit("loaded", localConfig.value);
712
764
  configLoading.value = false;
765
+ Vue.nextTick(() => {
766
+ var _a2;
767
+ const offsetHeight = ((_a2 = fecTableContainerRef.value) == null ? void 0 : _a2.$el.offsetHeight) || 300;
768
+ emit("height-loaded", localConfig.value, offsetHeight);
769
+ });
713
770
  return;
714
771
  }
715
772
  configLoading.value = true;
@@ -802,7 +859,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
802
859
  "data-id": localConfig.value.templateKey,
803
860
  "data-name": localConfig.value.templateName,
804
861
  "data-pkId": localConfig.value.pkId,
805
- "data-version": "v5"
862
+ "data-version": "v5",
863
+ ref_key: "fecTableContainerRef",
864
+ ref: fecTableContainerRef
806
865
  }, {
807
866
  default: Vue.withCtx(() => {
808
867
  var _a, _b, _c, _d;
@@ -811,10 +870,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
811
870
  key: 0,
812
871
  ref_key: "tableContainer",
813
872
  ref: tableContainer,
814
- class: "fec-table-container",
815
- style: Vue.normalizeStyle(
816
- props.height && props.height > 0 ? { height: `${props.height}px` } : {}
817
- )
873
+ class: "fec-table-container"
818
874
  }, [
819
875
  ((_b = (_a = localConfig.value) == null ? void 0 : _a.queryConfig) == null ? void 0 : _b.mode) == "fixed" ? (Vue.openBlock(), Vue.createElementBlock(Vue.Fragment, { key: 0 }, [
820
876
  Vue.createVNode(TableFilter.default, {
@@ -852,6 +908,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
852
908
  data: displayData.value,
853
909
  "auto-resize": autoResize.value,
854
910
  height: tableHeight.value,
911
+ maxHeight: tableMaxHeight.value,
855
912
  "empty-text": "暂无数据",
856
913
  "export-config": Vue.unref(exportConfig),
857
914
  "row-config": rowConfig.value,
@@ -863,7 +920,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
863
920
  onSortChange: handleSortChange,
864
921
  onCheckboxChange: handleCheckboxChange,
865
922
  onCheckboxAll: handleCheckboxAll,
866
- onRadioChange: handleRadioChange
923
+ onRadioChange: handleRadioChange,
924
+ onInitRendered: handleInitRendered,
925
+ onDataRendered: handleDataRendered
867
926
  }, {
868
927
  default: Vue.withCtx(() => {
869
928
  var _a2;
@@ -898,7 +957,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
898
957
  ];
899
958
  }),
900
959
  _: 3
901
- }, 8, ["data", "auto-resize", "height", "export-config", "row-config", "radio-config", "checkbox-config", "sort-config", "show-footer", "footer-data"])
960
+ }, 8, ["data", "auto-resize", "height", "maxHeight", "export-config", "row-config", "radio-config", "checkbox-config", "sort-config", "show-footer", "footer-data"])
902
961
  ]),
903
962
  isPagination.value && displayData.value.length > 0 ? (Vue.openBlock(), Vue.createBlock(Pagination.default, {
904
963
  key: 2,
@@ -906,7 +965,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
906
965
  pagination: displayPagination.value,
907
966
  onChange: handlePageChange
908
967
  }, null, 8, ["config", "pagination"])) : Vue.createCommentVNode("", true)
909
- ], 4)) : Vue.createCommentVNode("", true)
968
+ ], 512)) : Vue.createCommentVNode("", true)
910
969
  ];
911
970
  }),
912
971
  _: 3
@@ -914,5 +973,5 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
914
973
  };
915
974
  }
916
975
  });
917
- const _Table = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-1b05547f"]]);
976
+ const _Table = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-b224babf"]]);
918
977
  exports.default = _Table;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fecp/designer",
3
- "version": "5.5.50",
3
+ "version": "5.5.53",
4
4
  "main": "lib/designer/index.js",
5
5
  "module": "es/designer/index.mjs",
6
6
  "files": [