@fecp/designer 5.5.50 → 5.5.51

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