bl-common-vue3 3.8.115 → 3.8.117

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bl-common-vue3",
3
- "version": "3.8.115",
3
+ "version": "3.8.117",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "description": "bailing vue3 common components lib",
@@ -460,6 +460,9 @@ const utils = {
460
460
  }
461
461
  return noI18nFields && noI18nFieldsUseT ? t(result) : result;
462
462
  },
463
+ getRoomMeasureUnit: (room = {}) => {
464
+ return utils.i18nMapShow(room, ['place_measure_unit_txt'], ['place_measure_unit_txt']) || utils.getAreaUnit();
465
+ },
463
466
  /*
464
467
  * item 内容。
465
468
  * type: 转换类型。
@@ -4,20 +4,17 @@
4
4
  <template v-if="checkable">
5
5
  <a-col :span="16"> {{ t("CheckedHousingResources.index.396661-0", [roomTitleProps]) }} </a-col>
6
6
  <a-col :span="8">
7
- {{ maxTotal ? `${t("CheckedHousingResources.index.396661-2")}(${commonAreaUnit})` :
8
- `${t("CheckedHousingResources.index.396661-3")}(${commonAreaUnit})` }}
7
+ {{ getAreaTitleText(maxTotal ? "CheckedHousingResources.index.396661-2" : "CheckedHousingResources.index.396661-3") }}
9
8
  </a-col>
10
9
  </template>
11
10
 
12
11
  <template v-else>
13
12
  <a-col :span="!areaInput?16:checkedColSpan"> {{ t("CheckedHousingResources.index.396661-0", [roomTitleProps]) }} </a-col>
14
13
  <a-col :span="checkedColSpan" v-if="inputShow">
15
- {{ realClauseType == "gov" ? t("CheckedPropertyResources.index.618076-3") :
16
- t("CheckedHousingResources.index.396661-1") }}({{ commonAreaUnit }})
14
+ {{ getAreaTitleText(realClauseType == "gov" ? "CheckedPropertyResources.index.618076-3" : "CheckedHousingResources.index.396661-1") }}
17
15
  </a-col>
18
16
  <a-col :span="!areaInput?8:checkedColSpan" v-if="!(leaseBindConfig.showUnitPrice && leaseBindConfig.showBindOwner)">
19
- {{ maxTotal ? `${t("CheckedHousingResources.index.396661-2")}(${commonAreaUnit})` :
20
- `${t("CheckedHousingResources.index.396661-3")}(${commonAreaUnit})` }}
17
+ {{ getAreaTitleText(maxTotal ? "CheckedHousingResources.index.396661-2" : "CheckedHousingResources.index.396661-3") }}
21
18
  </a-col>
22
19
  <template v-if="isViewBindAndNotCheck">
23
20
  <a-col :span="checkedColSpan">
@@ -210,6 +207,19 @@ import utils from "../../common/utils/util";
210
207
  import { t, loadLanguageAsync } from "../../locale";
211
208
  import {DiffFilled} from "@ant-design/icons-vue";
212
209
  import TenantComponent from '../TenantComponent/index.vue'
210
+ const PLACE_MEASURE_UNIT = {
211
+ KILOMETER: 'kilometer',
212
+ };
213
+
214
+ const AREA_MEASURE_TYPE = 'area';
215
+ const LENGTH_MEASURE_TYPE = 'length';
216
+ const LENGTH_TITLE_I18N_KEY = {
217
+ "CheckedHousingResources.index.396661-1": "CheckedHousingResources.index.396661-11",
218
+ "CheckedHousingResources.index.396661-2": "CheckedHousingResources.index.396661-12",
219
+ "CheckedHousingResources.index.396661-3": "CheckedHousingResources.index.396661-13",
220
+ "CheckedPropertyResources.index.618076-3": "CheckedHousingResources.index.396661-14",
221
+ };
222
+
213
223
  export default defineComponent({
214
224
  name: "CheckedHousingResources",
215
225
  components: {
@@ -324,8 +334,6 @@ export default defineComponent({
324
334
  roomInfo: {},
325
335
  });
326
336
 
327
- const commonAreaUnit = utils.getAreaUnit();
328
-
329
337
  const emptyDescProps = computed(() => {
330
338
  return props.emptyDesc || t("CheckedHousingResources.index.396661-7");
331
339
  });
@@ -336,6 +344,61 @@ export default defineComponent({
336
344
 
337
345
  const inputShow = computed(() => !props.checkable && props.areaInput);
338
346
 
347
+ const getRoomMeasureUnit = (room = {}) => {
348
+ return utils.getRoomMeasureUnit(room);
349
+ };
350
+
351
+ const getRoomMeasureType = (room = {}) => {
352
+ return room.place_measure_unit == PLACE_MEASURE_UNIT.KILOMETER ? LENGTH_MEASURE_TYPE : AREA_MEASURE_TYPE;
353
+ };
354
+
355
+ const currentRoomList = computed(() => {
356
+ return props.checkable ? props.allHouseList : state.houseShowList;
357
+ });
358
+
359
+ const measureUnitList = computed(() => {
360
+ return Array.from(new Set((currentRoomList.value || []).map((item) => getRoomMeasureUnit(item)).filter(Boolean)));
361
+ });
362
+
363
+ const currentMeasureUnitText = computed(() => {
364
+ return measureUnitList.value.length == 1 ? measureUnitList.value[0] : '';
365
+ });
366
+
367
+ const measureTypeList = computed(() => {
368
+ return Array.from(new Set((currentRoomList.value || []).map((item) => getRoomMeasureType(item))));
369
+ });
370
+
371
+ const measureUnitMap = computed(() => {
372
+ return (currentRoomList.value || []).reduce((result, item) => {
373
+ const measureType = getRoomMeasureType(item);
374
+ if (!result[measureType]) {
375
+ result[measureType] = getRoomMeasureUnit(item);
376
+ }
377
+ return result;
378
+ }, {});
379
+ });
380
+
381
+ const getLengthTitleText = (i18nKey) => {
382
+ return t(LENGTH_TITLE_I18N_KEY[i18nKey] || i18nKey);
383
+ };
384
+
385
+ const getAreaTitleText = (i18nKey) => {
386
+ if (!measureTypeList.value.length) {
387
+ return t(i18nKey);
388
+ }
389
+ if (measureTypeList.value.length > 1) {
390
+ return t("CheckedHousingResources.index.396661-15", [
391
+ t(i18nKey),
392
+ measureUnitMap.value[AREA_MEASURE_TYPE] || utils.getAreaUnit(),
393
+ t("CheckedHousingResources.index.396661-14"),
394
+ measureUnitMap.value[LENGTH_MEASURE_TYPE] || '',
395
+ ]);
396
+ }
397
+ const measureType = measureTypeList.value[0];
398
+ const title = measureType == LENGTH_MEASURE_TYPE ? getLengthTitleText(i18nKey) : t(i18nKey);
399
+ return currentMeasureUnitText.value ? `${title}(${currentMeasureUnitText.value})` : title;
400
+ };
401
+
339
402
  // 这里需要判断是租赁条款 且 选择的房源里面有 类型是商业的 房源
340
403
  const isViewBindAndNotCheck = computed(() => {
341
404
  let hasBusiness = state.houseShowList.some((v) => v.house_type == 'business');
@@ -677,7 +740,6 @@ export default defineComponent({
677
740
 
678
741
  return {
679
742
  t,
680
- commonAreaUnit,
681
743
  emptyDescProps,
682
744
  roomTitleProps,
683
745
  inputShow,
@@ -688,6 +750,8 @@ export default defineComponent({
688
750
  handleHouseChecked,
689
751
  getTotalArea,
690
752
  getMaxArea,
753
+ getRoomMeasureUnit,
754
+ getAreaTitleText,
691
755
  handleRequest,
692
756
  i18nMapShow,
693
757
  selectBrandClick,
@@ -719,6 +783,10 @@ export default defineComponent({
719
783
  font-size: 12px;
720
784
  }
721
785
 
786
+ .area-unit {
787
+ margin-left: 4px;
788
+ }
789
+
722
790
  .room-area {
723
791
  font-size: 15px;
724
792
  color: rgba(0, 0, 0, 1);
@@ -97,10 +97,10 @@
97
97
  >
98
98
  <a-tooltip>
99
99
  <template #title>
100
- <div v-if="!noDisabledLog">{{t('ChooseHousingResources.index.592551-0', [dataRef.showArea, commonAreaUnit])}}</div>
101
- <div v-if="utils.numberToPrecision(dataRef.build_area) || noDisabledLog">{{t('ChooseHousingResources.index.592551-1', [utils.numberToPrecision(dataRef.build_area), commonAreaUnit])}}</div>
102
- <div v-if="utils.numberToPrecision(dataRef.inside_area)">{{t('ChooseHousingResources.index.592551-2', [utils.numberToPrecision(dataRef.inside_area), commonAreaUnit])}}</div>
103
- <div v-if="utils.numberToPrecision(dataRef.share_area)">{{t('ChooseHousingResources.index.592551-3', [utils.numberToPrecision(dataRef.share_area), commonAreaUnit])}}</div>
100
+ <div v-if="!noDisabledLog">{{ getRoomAreaDetailText(dataRef, 'rentable', dataRef.showArea) }}</div>
101
+ <div v-if="utils.numberToPrecision(dataRef.build_area) || noDisabledLog">{{ getRoomAreaDetailText(dataRef, 'build', utils.numberToPrecision(dataRef.build_area)) }}</div>
102
+ <div v-if="utils.numberToPrecision(dataRef.inside_area)">{{ getRoomAreaDetailText(dataRef, 'inside', utils.numberToPrecision(dataRef.inside_area)) }}</div>
103
+ <div v-if="utils.numberToPrecision(dataRef.share_area)">{{ getRoomAreaDetailText(dataRef, 'share', utils.numberToPrecision(dataRef.share_area)) }}</div>
104
104
  </template>
105
105
  {{ getRoomAreaText(dataRef) }}
106
106
  </a-tooltip>
@@ -169,6 +169,27 @@ import utils from "../../common/utils/util";
169
169
  import {ROOM_TYPE_ICONS} from "../../common/utils/constant";
170
170
  import {t, loadLanguageAsync} from "../../locale";
171
171
 
172
+ const PLACE_MEASURE_UNIT = {
173
+ KILOMETER: 'kilometer',
174
+ };
175
+
176
+ const AREA_MEASURE_TYPE = 'area';
177
+ const LENGTH_MEASURE_TYPE = 'length';
178
+ const ROOM_AREA_DETAIL_I18N_KEY = {
179
+ [AREA_MEASURE_TYPE]: {
180
+ rentable: 'ChooseHousingResources.index.592551-0',
181
+ build: 'ChooseHousingResources.index.592551-1',
182
+ inside: 'ChooseHousingResources.index.592551-2',
183
+ share: 'ChooseHousingResources.index.592551-3',
184
+ },
185
+ [LENGTH_MEASURE_TYPE]: {
186
+ rentable: 'ChooseHousingResources.index.592551-4',
187
+ build: 'ChooseHousingResources.index.592551-5',
188
+ inside: 'ChooseHousingResources.index.592551-6',
189
+ share: 'ChooseHousingResources.index.592551-7',
190
+ },
191
+ };
192
+
172
193
  export default defineComponent({
173
194
  name: "ChooseHousingResources",
174
195
  components: {
@@ -406,7 +427,6 @@ export default defineComponent({
406
427
  }
407
428
  },
408
429
  setup(props, { emit }) {
409
- const commonAreaUnit = utils.getAreaUnit();
410
430
  // 大数据量时切换到性能优先模式,减少默认展开、动画和 Tooltip 的同步开销
411
431
  const LARGE_TREE_NODE_THRESHOLD = 2000;
412
432
  // 当前节点样式包含上下 padding,因此需要显式同步虚拟列表的单项高度
@@ -576,7 +596,21 @@ export default defineComponent({
576
596
  */
577
597
  const getRoomAreaText = (dataRef) => {
578
598
  const areaValue = props.noDisabledLog ? utils.numberToPrecision(dataRef.build_area) : dataRef.showArea;
579
- return `${areaValue || 0}${commonAreaUnit}`;
599
+ return `${areaValue || 0}${getRoomMeasureUnit(dataRef)}`;
600
+ };
601
+
602
+ const getRoomMeasureUnit = (room = {}) => {
603
+ return utils.getRoomMeasureUnit(room);
604
+ };
605
+
606
+ const getRoomMeasureType = (room = {}) => {
607
+ return room.place_measure_unit == PLACE_MEASURE_UNIT.KILOMETER ? LENGTH_MEASURE_TYPE : AREA_MEASURE_TYPE;
608
+ };
609
+
610
+ const getRoomAreaDetailText = (room = {}, areaType, value) => {
611
+ const measureType = getRoomMeasureType(room);
612
+ const i18nKey = ROOM_AREA_DETAIL_I18N_KEY[measureType]?.[areaType] || ROOM_AREA_DETAIL_I18N_KEY[AREA_MEASURE_TYPE][areaType];
613
+ return t(i18nKey, [value || 0, getRoomMeasureUnit(room)]);
580
614
  };
581
615
 
582
616
  /**
@@ -2642,9 +2676,10 @@ export default defineComponent({
2642
2676
  treeItemHeight,
2643
2677
  treeMotion,
2644
2678
  ...toRefs(state),
2645
- commonAreaUnit,
2646
2679
  getNodeTitle,
2647
2680
  getRoomAreaText,
2681
+ getRoomMeasureUnit,
2682
+ getRoomAreaDetailText,
2648
2683
  getRoomNodeTitle,
2649
2684
  onLoadTreeData,
2650
2685
  handleTreeCheck,
@@ -1,6 +1,7 @@
1
1
  <template>
2
- <div class="table-warp">
2
+ <div ref="tableWarpRef" class="table-warp">
3
3
  <div
4
+ ref="titleHeaderRef"
4
5
  class="visitoeTitleHeader"
5
6
  v-if="displayTitleCollapsed && filterList?.length"
6
7
  :style="{ marginBottom: isTitleCollapsed ? '10px' : '0' }">
@@ -1592,6 +1593,10 @@ export default defineComponent({
1592
1593
  type: Number,
1593
1594
  default: 0,
1594
1595
  },
1596
+ autoTableHeight: {
1597
+ type: Boolean,
1598
+ default: false,
1599
+ },
1595
1600
  titleRowAlign: {
1596
1601
  type: String,
1597
1602
  default: "middle",
@@ -1875,12 +1880,165 @@ export default defineComponent({
1875
1880
  const columnSlots = ref([]);
1876
1881
  const buttonIconSlots = ref([]);
1877
1882
  const isInDrawer = ref(false);
1883
+ const tableWarpRef = ref(null);
1884
+ const titleHeaderRef = ref(null);
1878
1885
  const tableRef = ref(null);
1879
1886
  const filterRef = ref(null);
1880
1887
  const isTitleCollapsed = ref(props.displayTitleCollapsed);
1888
+ const autoTableHeightRaf = ref(0);
1889
+ const tableHeightTimer = ref(0);
1890
+ const autoTableHeightObserver = ref(null);
1891
+ const autoTableHeightBottomOffset = 11;
1892
+ const autoTableHeightMinBody = 80;
1881
1893
  const toggleTitle = () => {
1882
1894
  isTitleCollapsed.value = !isTitleCollapsed.value;
1895
+ scheduleTableHeightRecalc();
1896
+ };
1897
+
1898
+ const isVisibleFlowElement = (el) => {
1899
+ if (!el || el.nodeType !== 1) {
1900
+ return false;
1901
+ }
1902
+ const style = window.getComputedStyle(el);
1903
+ if (style.display === "none" || style.visibility === "hidden") {
1904
+ return false;
1905
+ }
1906
+ if (style.position === "absolute" || style.position === "fixed") {
1907
+ return false;
1908
+ }
1909
+ const rect = el.getBoundingClientRect();
1910
+ return rect.width > 0 && rect.height > 0;
1911
+ };
1912
+
1913
+ const hasVisibleNextFlowSibling = (el) => {
1914
+ let nextSibling = el?.nextElementSibling;
1915
+ while (nextSibling) {
1916
+ if (isVisibleFlowElement(nextSibling)) {
1917
+ return true;
1918
+ }
1919
+ nextSibling = nextSibling.nextElementSibling;
1920
+ }
1921
+ return false;
1922
+ };
1923
+
1924
+ const hasUnsafeAutoTableHeightContainer = (el) => {
1925
+ return ["ant-drawer", "ant-modal", "ant-tabs-tabpane"].some((className) =>
1926
+ utils.hasParentWithClass(el, className)
1927
+ );
1928
+ };
1929
+
1930
+ const getAutoTableHeightBoundaryBottom = (el) => {
1931
+ const viewportHeight =
1932
+ window.innerHeight || document.documentElement?.clientHeight || 0;
1933
+ let parent = el?.parentElement;
1934
+ while (parent && parent !== document.body) {
1935
+ const style = window.getComputedStyle(parent);
1936
+ if (["auto", "scroll", "overlay"].includes(style.overflowY)) {
1937
+ const rect = parent.getBoundingClientRect();
1938
+ return Math.min(rect.bottom, viewportHeight);
1939
+ }
1940
+ parent = parent.parentElement;
1941
+ }
1942
+ return viewportHeight;
1943
+ };
1944
+
1945
+ const clearAutoTableHeightObserver = () => {
1946
+ if (autoTableHeightObserver.value) {
1947
+ autoTableHeightObserver.value.disconnect();
1948
+ autoTableHeightObserver.value = null;
1949
+ }
1950
+ };
1951
+
1952
+ const isAutoTableHeightSafe = () => {
1953
+ if (!props.autoTableHeight || props.tableHeight) {
1954
+ return false;
1955
+ }
1956
+ const rootEl = tableWarpRef.value;
1957
+ if (!rootEl || !rootEl.parentElement) {
1958
+ return false;
1959
+ }
1960
+ if (hasUnsafeAutoTableHeightContainer(rootEl)) {
1961
+ return false;
1962
+ }
1963
+ let currentEl = rootEl;
1964
+ while (currentEl && currentEl !== document.body) {
1965
+ if (hasVisibleNextFlowSibling(currentEl)) {
1966
+ return false;
1967
+ }
1968
+ currentEl = currentEl.parentElement;
1969
+ }
1970
+ return true;
1971
+ };
1972
+
1973
+ const scheduleTableHeightRecalc = () => {
1974
+ if (autoTableHeightRaf.value) {
1975
+ cancelAnimationFrame(autoTableHeightRaf.value);
1976
+ }
1977
+ autoTableHeightRaf.value = requestAnimationFrame(() => {
1978
+ autoTableHeightRaf.value = 0;
1979
+ getTableHeight();
1980
+ });
1981
+ };
1982
+
1983
+ const setupAutoTableHeightObserver = () => {
1984
+ clearAutoTableHeightObserver();
1985
+ if (!isAutoTableHeightSafe()) {
1986
+ return;
1987
+ }
1988
+ const rootEl = tableWarpRef.value;
1989
+ const parentEl = rootEl?.parentElement;
1990
+ if (!rootEl || !parentEl || typeof ResizeObserver === "undefined") {
1991
+ return;
1992
+ }
1993
+ autoTableHeightObserver.value = new ResizeObserver(() => {
1994
+ scheduleTableHeightRecalc();
1995
+ });
1996
+ autoTableHeightObserver.value.observe(rootEl);
1997
+ autoTableHeightObserver.value.observe(parentEl);
1998
+ autoTableHeightObserver.value.observe(document.body);
1999
+ if (titleHeaderRef.value) {
2000
+ autoTableHeightObserver.value.observe(titleHeaderRef.value);
2001
+ }
2002
+ if (filterRef.value) {
2003
+ autoTableHeightObserver.value.observe(filterRef.value);
2004
+ }
2005
+ let prevSibling = rootEl.previousElementSibling;
2006
+ while (prevSibling) {
2007
+ if (isVisibleFlowElement(prevSibling)) {
2008
+ autoTableHeightObserver.value.observe(prevSibling);
2009
+ }
2010
+ prevSibling = prevSibling.previousElementSibling;
2011
+ }
2012
+ };
2013
+
2014
+ const getTableTitleHeight = () => {
2015
+ return (
2016
+ tableRef.value?.$el.getElementsByClassName("ant-table-title")[0]
2017
+ ?.offsetHeight || 0
2018
+ );
2019
+ };
2020
+
2021
+ const getTableHeaderHeight = () => {
2022
+ return (
2023
+ tableRef.value?.$el.getElementsByClassName("ant-table-thead")[0]
2024
+ ?.offsetHeight || 0
2025
+ );
1883
2026
  };
2027
+
2028
+ const getTablePaginationHeight = () => {
2029
+ let pagHeight =
2030
+ tableRef.value?.$el.getElementsByClassName("ant-pagination")[0]
2031
+ ?.offsetHeight || 0;
2032
+ if (pagHeight) {
2033
+ pagHeight += 32;
2034
+ }
2035
+ return pagHeight;
2036
+ };
2037
+
2038
+ const getFilterHeight = () => {
2039
+ return filterRef.value?.offsetHeight || 0;
2040
+ };
2041
+
1884
2042
  const closeTages = (key) => {
1885
2043
  for (let i = 0; i < state.filterList?.length; i++) {
1886
2044
  if (state.filterList[i].field === key) {
@@ -2814,29 +2972,28 @@ export default defineComponent({
2814
2972
  };
2815
2973
 
2816
2974
  const getTableHeight = () => {
2817
- setTimeout(() => {
2975
+ if (tableHeightTimer.value) {
2976
+ clearTimeout(tableHeightTimer.value);
2977
+ }
2978
+ tableHeightTimer.value = setTimeout(() => {
2979
+ tableHeightTimer.value = 0;
2818
2980
  nextTick(() => {
2981
+ const tableEl = tableRef.value?.$el;
2982
+ if (!tableEl) {
2983
+ return;
2984
+ }
2819
2985
  if (props.tableHeight) {
2820
- let tTitleHeight =
2821
- tableRef.value.$el.getElementsByClassName("ant-table-title")[0]
2822
- ?.offsetHeight || 0;
2823
- let tHeaderHeight =
2824
- tableRef.value.$el.getElementsByClassName("ant-table-thead")[0]
2825
- ?.offsetHeight || 0;
2826
- let tPagHeight =
2827
- tableRef.value.$el.getElementsByClassName("ant-pagination")[0]
2828
- ?.offsetHeight || 0;
2829
- let filterHeight = filterRef.value?.offsetHeight || 0;
2830
- if (tPagHeight) {
2831
- tPagHeight = tPagHeight + 32; // 分页的margin距离
2832
- }
2986
+ let tTitleHeight = getTableTitleHeight();
2987
+ let tHeaderHeight = getTableHeaderHeight();
2988
+ let tPagHeight = getTablePaginationHeight();
2989
+ let filterHeight = getFilterHeight();
2833
2990
  if (utils.isEnv()) {
2834
2991
  console.log(
2835
2992
  props.tableHeight,
2836
2993
  tTitleHeight,
2837
2994
  tHeaderHeight,
2838
2995
  tPagHeight,
2839
- tableRef.value.$el.getElementsByClassName("ant-table-thead")[0],
2996
+ tableEl.getElementsByClassName("ant-table-thead")[0],
2840
2997
  "0000000000000000000"
2841
2998
  );
2842
2999
  }
@@ -2846,9 +3003,33 @@ export default defineComponent({
2846
3003
  tHeaderHeight -
2847
3004
  tPagHeight -
2848
3005
  filterHeight;
3006
+ tableScrollHeight = Math.max(0, Math.floor(tableScrollHeight));
2849
3007
  if (state.tableScrollHeight !== tableScrollHeight) {
2850
3008
  state.tableScrollHeight = tableScrollHeight;
2851
3009
  }
3010
+ return;
3011
+ }
3012
+ if (props.autoTableHeight && isAutoTableHeightSafe()) {
3013
+ const tableTop = tableEl.getBoundingClientRect()?.top || 0;
3014
+ const boundaryBottom = getAutoTableHeightBoundaryBottom(tableEl);
3015
+ let tableScrollHeight =
3016
+ boundaryBottom -
3017
+ tableTop -
3018
+ getTableTitleHeight() -
3019
+ getTableHeaderHeight() -
3020
+ getTablePaginationHeight() -
3021
+ autoTableHeightBottomOffset;
3022
+ tableScrollHeight = Math.max(
3023
+ autoTableHeightMinBody,
3024
+ Math.ceil(tableScrollHeight)
3025
+ );
3026
+ if (state.tableScrollHeight !== tableScrollHeight) {
3027
+ state.tableScrollHeight = tableScrollHeight;
3028
+ }
3029
+ return;
3030
+ }
3031
+ if (state.tableScrollHeight !== 0) {
3032
+ state.tableScrollHeight = 0;
2852
3033
  }
2853
3034
  });
2854
3035
  }, 0);
@@ -3580,6 +3761,7 @@ export default defineComponent({
3580
3761
 
3581
3762
  const handleResize = () => {
3582
3763
  state.isMobile = window.innerWidth < 768;
3764
+ scheduleTableHeightRecalc();
3583
3765
  };
3584
3766
 
3585
3767
  let num = 1;
@@ -3811,20 +3993,50 @@ export default defineComponent({
3811
3993
  watch(
3812
3994
  () => props.tableHeight,
3813
3995
  () => {
3996
+ setupAutoTableHeightObserver();
3814
3997
  getTableHeight();
3815
3998
  }
3816
3999
  );
3817
4000
 
4001
+ watch(
4002
+ () => props.autoTableHeight,
4003
+ () => {
4004
+ setupAutoTableHeightObserver();
4005
+ scheduleTableHeightRecalc();
4006
+ }
4007
+ );
4008
+
4009
+ watch(
4010
+ () => [state.filterList.length, isTitleCollapsed.value],
4011
+ () => {
4012
+ nextTick(() => {
4013
+ setupAutoTableHeightObserver();
4014
+ scheduleTableHeightRecalc();
4015
+ });
4016
+ }
4017
+ );
4018
+
3818
4019
  onMounted(() => {
3819
4020
  createColumnSlots();
3820
4021
  createButtonIconSlots();
3821
4022
  window.addEventListener("resize", handleResize);
3822
4023
  handleResize();
4024
+ setupAutoTableHeightObserver();
4025
+ scheduleTableHeightRecalc();
3823
4026
  init();
3824
4027
  });
3825
4028
 
3826
4029
  onBeforeUnmount(() => {
3827
4030
  window.removeEventListener("resize", handleResize);
4031
+ clearAutoTableHeightObserver();
4032
+ if (autoTableHeightRaf.value) {
4033
+ cancelAnimationFrame(autoTableHeightRaf.value);
4034
+ autoTableHeightRaf.value = 0;
4035
+ }
4036
+ if (tableHeightTimer.value) {
4037
+ clearTimeout(tableHeightTimer.value);
4038
+ tableHeightTimer.value = 0;
4039
+ }
3828
4040
  });
3829
4041
 
3830
4042
  const initColumns = () => {
@@ -4084,6 +4296,8 @@ export default defineComponent({
4084
4296
  columnSlots,
4085
4297
  actionBtnShow,
4086
4298
  actionBtnDisabled,
4299
+ tableWarpRef,
4300
+ titleHeaderRef,
4087
4301
  tableRef,
4088
4302
  isInDrawer,
4089
4303
  realColumns,
@@ -69,6 +69,11 @@
69
69
  "CheckedHousingResources.index.396661-7": "尚未選擇物件",
70
70
  "CheckedHousingResources.index.396661-9": "水電資料{0}",
71
71
  "CheckedHousingResources.index.396661-10": "資產資料{0}",
72
+ "CheckedHousingResources.index.396661-11": "租賃長度",
73
+ "CheckedHousingResources.index.396661-12": "總長度",
74
+ "CheckedHousingResources.index.396661-13": "可租/總長度",
75
+ "CheckedHousingResources.index.396661-14": "長度",
76
+ "CheckedHousingResources.index.396661-15": "{0}({1})或{2}({3})",
72
77
  "CheckedPropertyResources.index.618076-0": "{0}名稱",
73
78
  "CheckedPropertyResources.index.618076-1": "出售",
74
79
  "CheckedPropertyResources.index.618076-2": "租賃",
@@ -376,6 +381,10 @@
376
381
  "ChooseHousingResources.index.592551-1": "建築面積{0}{1}",
377
382
  "ChooseHousingResources.index.592551-2": "室內面積{0}{1}",
378
383
  "ChooseHousingResources.index.592551-3": "公設面積{0}{1}",
384
+ "ChooseHousingResources.index.592551-4": "可租長度{0}{1}",
385
+ "ChooseHousingResources.index.592551-5": "建築長度{0}{1}",
386
+ "ChooseHousingResources.index.592551-6": "室內長度{0}{1}",
387
+ "ChooseHousingResources.index.592551-7": "公設{0}{1}",
379
388
  "DictionarySetting.index.734314-0": "請輸入字典名稱",
380
389
  "VisitorPage.index.924333-0": "接受上傳的檔案類型",
381
390
  "VisitorPage.index.924333-1": "留空則支援所有檔案格式;多個格式請用半形逗號分隔,例如:.doc,.docx,.pdf,.jpg,.jpeg,.png,.xls,.xlsx,.rar,.zip,.gif",
@@ -69,6 +69,11 @@
69
69
  "CheckedHousingResources.index.396661-7": "No property selected",
70
70
  "CheckedHousingResources.index.396661-9": "Utility data {0}",
71
71
  "CheckedHousingResources.index.396661-10": "Asset data{0}",
72
+ "CheckedHousingResources.index.396661-11": "Rental length",
73
+ "CheckedHousingResources.index.396661-12": "Total length",
74
+ "CheckedHousingResources.index.396661-13": "Rentable/Total Length",
75
+ "CheckedHousingResources.index.396661-14": "Length",
76
+ "CheckedHousingResources.index.396661-15": "{0} ({1}) or {2} ({3})",
72
77
  "CheckedPropertyResources.index.618076-0": "{0} name",
73
78
  "CheckedPropertyResources.index.618076-1": "Sale",
74
79
  "CheckedPropertyResources.index.618076-2": "Lease",
@@ -376,6 +381,10 @@
376
381
  "ChooseHousingResources.index.592551-1": "Floor area {0}{1}",
377
382
  "ChooseHousingResources.index.592551-2": "Internal area {0}{1}",
378
383
  "ChooseHousingResources.index.592551-3": "Shared area {0}{1}",
384
+ "ChooseHousingResources.index.592551-4": "Rentable length {0}{1}",
385
+ "ChooseHousingResources.index.592551-5": "Floor length {0}{1}",
386
+ "ChooseHousingResources.index.592551-6": "Internal length {0}{1}",
387
+ "ChooseHousingResources.index.592551-7": "Shared {0}{1}",
379
388
  "DictionarySetting.index.734314-0": "Please enter the dictionary name",
380
389
  "VisitorPage.index.924333-0": "Allowed file types",
381
390
  "VisitorPage.index.924333-1": "Leave blank to allow all formats. Separate multiple formats with commas, for example: .doc,.docx,.pdf,.jpg,.jpeg,.png,.xls,.xlsx,.rar,.zip,.gif",
@@ -69,6 +69,11 @@
69
69
  "CheckedHousingResources.index.396661-7": "物件が選択されていません",
70
70
  "CheckedHousingResources.index.396661-9": "電気・水道データ{0}",
71
71
  "CheckedHousingResources.index.396661-10": "資産データ{0}",
72
+ "CheckedHousingResources.index.396661-11": "賃貸長さ",
73
+ "CheckedHousingResources.index.396661-12": "総長さ",
74
+ "CheckedHousingResources.index.396661-13": "賃貸可能/総長さ",
75
+ "CheckedHousingResources.index.396661-14": "長さ",
76
+ "CheckedHousingResources.index.396661-15": "{0}({1})または{2}({3})",
72
77
  "CheckedPropertyResources.index.618076-0": "{0}名",
73
78
  "CheckedPropertyResources.index.618076-1": "売却",
74
79
  "CheckedPropertyResources.index.618076-2": "賃貸",
@@ -376,6 +381,10 @@
376
381
  "ChooseHousingResources.index.592551-1": "延床面積{0}{1}",
377
382
  "ChooseHousingResources.index.592551-2": "専有面積{0}{1}",
378
383
  "ChooseHousingResources.index.592551-3": "共用面積{0}{1}",
384
+ "ChooseHousingResources.index.592551-4": "賃貸可能長さ{0}{1}",
385
+ "ChooseHousingResources.index.592551-5": "延床長さ{0}{1}",
386
+ "ChooseHousingResources.index.592551-6": "専有長さ{0}{1}",
387
+ "ChooseHousingResources.index.592551-7": "共用{0}{1}",
379
388
  "DictionarySetting.index.734314-0": "辞書名を入力してください",
380
389
  "VisitorPage.index.924333-0": "アップロード可能なファイル形式",
381
390
  "VisitorPage.index.924333-1": "空欄の場合はすべての形式に対応します。複数指定する場合は半角カンマで区切ってください。例:.doc,.docx,.pdf,.jpg,.jpeg,.png,.xls,.xlsx,.rar,.zip,.gif",
@@ -69,6 +69,11 @@
69
69
  "CheckedHousingResources.index.396661-7": "尚未選擇物業",
70
70
  "CheckedHousingResources.index.396661-9": "水電資料{0}",
71
71
  "CheckedHousingResources.index.396661-10": "資產資料{0}",
72
+ "CheckedHousingResources.index.396661-11": "租賃長度",
73
+ "CheckedHousingResources.index.396661-12": "總長度",
74
+ "CheckedHousingResources.index.396661-13": "可租/總長度",
75
+ "CheckedHousingResources.index.396661-14": "長度",
76
+ "CheckedHousingResources.index.396661-15": "{0}({1})或{2}({3})",
72
77
  "CheckedPropertyResources.index.618076-0": "{0}名稱",
73
78
  "CheckedPropertyResources.index.618076-1": "出售",
74
79
  "CheckedPropertyResources.index.618076-2": "租賃",
@@ -376,6 +381,10 @@
376
381
  "ChooseHousingResources.index.592551-1": "建築面積{0}{1}",
377
382
  "ChooseHousingResources.index.592551-2": "室內面積{0}{1}",
378
383
  "ChooseHousingResources.index.592551-3": "公用面積{0}{1}",
384
+ "ChooseHousingResources.index.592551-4": "可租長度{0}{1}",
385
+ "ChooseHousingResources.index.592551-5": "建築長度{0}{1}",
386
+ "ChooseHousingResources.index.592551-6": "室內長度{0}{1}",
387
+ "ChooseHousingResources.index.592551-7": "公用{0}{1}",
379
388
  "DictionarySetting.index.734314-0": "請輸入字典名稱",
380
389
  "VisitorPage.index.924333-0": "可上載的檔案類型",
381
390
  "VisitorPage.index.924333-1": "留空則支援所有檔案格式;多個格式請用半形逗號分隔,例如:.doc,.docx,.pdf,.jpg,.jpeg,.png,.xls,.xlsx,.rar,.zip,.gif",
@@ -69,6 +69,11 @@
69
69
  "CheckedHousingResources.index.396661-7": "未选择房源",
70
70
  "CheckedHousingResources.index.396661-9": "水电数据{0}",
71
71
  "CheckedHousingResources.index.396661-10": "资产数据{0}",
72
+ "CheckedHousingResources.index.396661-11": "租赁长度",
73
+ "CheckedHousingResources.index.396661-12": "总长度",
74
+ "CheckedHousingResources.index.396661-13": "可租/总长度",
75
+ "CheckedHousingResources.index.396661-14": "长度",
76
+ "CheckedHousingResources.index.396661-15": "{0}({1})或{2}({3})",
72
77
  "CheckedPropertyResources.index.618076-0": "{0}名称",
73
78
  "CheckedPropertyResources.index.618076-1": "出售",
74
79
  "CheckedPropertyResources.index.618076-2": "租赁",
@@ -376,6 +381,10 @@
376
381
  "ChooseHousingResources.index.592551-1": "建筑面积{0}{1}",
377
382
  "ChooseHousingResources.index.592551-2": "套内面积{0}{1}",
378
383
  "ChooseHousingResources.index.592551-3": "公摊面积{0}{1}",
384
+ "ChooseHousingResources.index.592551-4": "可租长度{0}{1}",
385
+ "ChooseHousingResources.index.592551-5": "建筑长度{0}{1}",
386
+ "ChooseHousingResources.index.592551-6": "套内长度{0}{1}",
387
+ "ChooseHousingResources.index.592551-7": "公摊{0}{1}",
379
388
  "DictionarySetting.index.734314-0": "请输入字典名称",
380
389
  "VisitorPage.index.924333-0": "接受上传的文件类型",
381
390
  "VisitorPage.index.924333-1": "不填写则支持所有文件格式,多个用英文逗号隔开。示例:.doc,.docx,.pdf,.jpg,.jpeg,.png,.xls,.xlsx,.rar,.zip,.gif",