bl-common-vue3 3.8.115 → 3.8.116

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.116",
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,
@@ -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",