@bytenew/bn-applet-ui 1.1.41 → 1.1.42

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/common.scss CHANGED
@@ -1380,4 +1380,159 @@ $colors: (
1380
1380
  border-radius: 18px;
1381
1381
  overflow: hidden;
1382
1382
  margin-bottom: 0;
1383
+ }
1384
+
1385
+ // ========== Bn-table 公共表格样式(vxe-table / vxe-grid)==========
1386
+ // 表头背景色
1387
+ $bn-table-header-bg: #fbfbfb;
1388
+ // 表格内外边框、单元格分割线颜色
1389
+ $bn-table-border-color: #f0f2f5;
1390
+ // 表格外层圆角
1391
+ $bn-table-radius: 8px;
1392
+ // 表头行高 / 数据行行高(与 vxe cellConfig.height 一致)
1393
+ $bn-table-row-height: 48px;
1394
+ // 表头文字颜色
1395
+ $bn-table-text-header: rgba(0, 0, 0, 0.85);
1396
+ // 表体单元格文字颜色
1397
+ $bn-table-text-body: #606266;
1398
+ // 行 hover 背景色
1399
+ $bn-table-row-hover-bg: #f5f7fa;
1400
+ // 行选中(current)背景色
1401
+ $bn-table-row-current-bg: rgb(236, 245, 255);
1402
+
1403
+ .Bn-table {
1404
+ --vxe-ui-table-border-color: #{$bn-table-border-color};
1405
+ border-radius: $bn-table-radius;
1406
+ overflow: hidden;
1407
+ border-color: $bn-table-border-color;
1408
+
1409
+ .vxe-table--render-wrapper,
1410
+ .vxe-table--main-wrapper {
1411
+ border-radius: $bn-table-radius;
1412
+ }
1413
+
1414
+ .vxe-table--border-line {
1415
+ border-color: $bn-table-border-color;
1416
+ }
1417
+ }
1418
+
1419
+ .Bn-table-header-row {
1420
+ .vxe-header--column {
1421
+ padding: 0;
1422
+ background-color: $bn-table-header-bg;
1423
+ font-size: 14px;
1424
+ font-weight: 600;
1425
+ color: $bn-table-text-header;
1426
+ height: $bn-table-row-height;
1427
+ border-color: $bn-table-border-color;
1428
+
1429
+ .vxe-cell {
1430
+ padding: 0 12px;
1431
+ max-height: $bn-table-row-height;
1432
+ line-height: $bn-table-row-height;
1433
+ overflow: hidden;
1434
+
1435
+ .vxe-cell--title {
1436
+ width: 100%;
1437
+ overflow: hidden;
1438
+ text-overflow: ellipsis;
1439
+ white-space: nowrap;
1440
+ }
1441
+ }
1442
+ }
1443
+
1444
+ .vxe-checkbox--icon {
1445
+ font-weight: 100;
1446
+ }
1447
+
1448
+ .vxe-cell--checkbox {
1449
+ margin-right: 1px;
1450
+ }
1451
+ }
1452
+
1453
+ .Bn-table-body-row {
1454
+ background-color: #fff;
1455
+ color: $bn-table-text-body;
1456
+ font-size: 14px;
1457
+
1458
+ &.row--current {
1459
+ background-color: $bn-table-row-current-bg !important;
1460
+
1461
+ > .col--checkbox::before {
1462
+ content: "";
1463
+ position: absolute;
1464
+ left: 0;
1465
+ top: 0;
1466
+ display: block;
1467
+ width: 3px;
1468
+ height: 100%;
1469
+ background-color: #2783f2;
1470
+ }
1471
+ }
1472
+
1473
+ &.row--hover {
1474
+ background-color: $bn-table-row-hover-bg !important;
1475
+ }
1476
+
1477
+ &.row--current.row--hover {
1478
+ background-color: $bn-table-row-current-bg !important;
1479
+ }
1480
+
1481
+ .vxe-body--column {
1482
+ border-color: $bn-table-border-color;
1483
+ height: $bn-table-row-height;
1484
+ }
1485
+ }
1486
+
1487
+ // 表体允许多行展示(如规则列表「条件」「店铺」等),行高随内容增高,最小 48px
1488
+ .Bn-table--wrap-row {
1489
+ .Bn-table-body-row {
1490
+ .vxe-body--column {
1491
+ height: auto;
1492
+ min-height: $bn-table-row-height;
1493
+ }
1494
+ }
1495
+
1496
+ .Bn-table-cell:not(.workOrderTable-cell, .workOrder-vxe-number-cell).vxe-body--column {
1497
+ .vxe-cell {
1498
+ line-height: 22px;
1499
+ padding: 13px 12px;
1500
+ white-space: normal;
1501
+ word-break: break-all;
1502
+ }
1503
+ }
1504
+
1505
+ // show-overflow 列仍为单行省略
1506
+ .col--ellipsis .vxe-cell {
1507
+ line-height: $bn-table-row-height;
1508
+ padding: 0 12px;
1509
+ white-space: nowrap;
1510
+ word-break: normal;
1511
+ }
1512
+ }
1513
+
1514
+ .Bn-table-cell {
1515
+ .vxe-checkbox--icon {
1516
+ font-weight: 100;
1517
+ }
1518
+
1519
+ .vxe-checkbox--label {
1520
+ display: none;
1521
+ }
1522
+
1523
+ &:not(.workOrderTable-cell, .workOrder-vxe-number-cell).vxe-body--column {
1524
+ height: auto;
1525
+ padding: 0;
1526
+
1527
+ .vxe-cell {
1528
+ max-height: none;
1529
+ padding: 0 12px;
1530
+ color: $bn-table-text-body;
1531
+ font-size: 14px;
1532
+ }
1533
+
1534
+ .vxe-cell--checkbox {
1535
+ line-height: $bn-table-row-height;
1536
+ }
1537
+ }
1383
1538
  }
@@ -10558,6 +10558,8 @@ __webpack_require__.d(__webpack_exports__, {
10558
10558
  BnSelect: () => (/* reexport */ BnSelect_select),
10559
10559
  BnVirtPopover: () => (/* reexport */ BnVirtPopover),
10560
10560
  addressParse: () => (/* reexport */ addressParse),
10561
+ bnTableBind: () => (/* reexport */ bnTableBind),
10562
+ bnTableWrapBind: () => (/* reexport */ bnTableWrapBind),
10561
10563
  "default": () => (/* binding */ entry_lib),
10562
10564
  idsToTexts: () => (/* reexport */ idsToTexts)
10563
10565
  });
@@ -11027,9 +11029,9 @@ var BnAddressParsevue_type_template_id_3a0d7cb0_staticRenderFns = [];
11027
11029
  var es_array_for_each = __webpack_require__(1629);
11028
11030
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
11029
11031
  var es_array_push = __webpack_require__(4114);
11030
- ;// external "lodash"
11031
- const external_lodash_namespaceObject = require("lodash");
11032
- var external_lodash_default = /*#__PURE__*/__webpack_require__.n(external_lodash_namespaceObject);
11032
+ ;// external "_"
11033
+ const external_namespaceObject = require("_");
11034
+ var external_default = /*#__PURE__*/__webpack_require__.n(external_namespaceObject);
11033
11035
  ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/babel-loader/lib/index.js!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/BnAddressParse/index.vue?vue&type=script&lang=js
11034
11036
 
11035
11037
 
@@ -11055,7 +11057,7 @@ var external_lodash_default = /*#__PURE__*/__webpack_require__.n(external_lodash
11055
11057
  /**
11056
11058
  * 自动识别方法(使用防抖)
11057
11059
  */
11058
- autoAds: (0,external_lodash_namespaceObject.debounce)(function () {
11060
+ autoAds: (0,external_namespaceObject.debounce)(function () {
11059
11061
  var _this = this;
11060
11062
  if (!this.address || this.address == this.record) {
11061
11063
  return;
@@ -12493,7 +12495,7 @@ function _toConsumableArray(r) {
12493
12495
  /**
12494
12496
  * 滚动加载
12495
12497
  * */
12496
- scrollMore: (0,external_lodash_namespaceObject.debounce)(function () {
12498
+ scrollMore: (0,external_namespaceObject.debounce)(function () {
12497
12499
  if (this.optionList.length < this.total && !this.loading) {
12498
12500
  // 远程获取
12499
12501
  if (this.pathUrl) {
@@ -12512,7 +12514,7 @@ function _toConsumableArray(r) {
12512
12514
  * 快速搜索选项
12513
12515
  * @param {String} val 搜索的值
12514
12516
  */
12515
- filterMethod: (0,external_lodash_namespaceObject.debounce)(function (val) {
12517
+ filterMethod: (0,external_namespaceObject.debounce)(function (val) {
12516
12518
  this.queryValue = val;
12517
12519
  // 选项列表被初始化过
12518
12520
  if (this.pathUrl && this.isPage) {
@@ -12561,7 +12563,7 @@ function _toConsumableArray(r) {
12561
12563
  var _this2 = this;
12562
12564
  // 判断当前是否全选
12563
12565
  var isAllChecked = this.isCheckedAll();
12564
- var value = (0,external_lodash_namespaceObject.cloneDeep)(this.val);
12566
+ var value = (0,external_namespaceObject.cloneDeep)(this.val);
12565
12567
  if (isAllChecked) {
12566
12568
  // 如果已经全选,则取消全选
12567
12569
  value = _toConsumableArray(this.fixedFrontOptions);
@@ -14579,8 +14581,8 @@ var es_parse_float = __webpack_require__(8459);
14579
14581
  computed: {
14580
14582
  canPreview: function canPreview() {
14581
14583
  if (!this.file.type) return false;
14582
- var lowerType = (0,external_lodash_namespaceObject.toLower)(this.file.type);
14583
- return (0,external_lodash_namespaceObject.includes)((0,external_lodash_namespaceObject.map)(this.pictureType, external_lodash_namespaceObject.toLower), lowerType) || (0,external_lodash_namespaceObject.includes)((0,external_lodash_namespaceObject.map)(this.videoType, external_lodash_namespaceObject.toLower), lowerType);
14584
+ var lowerType = (0,external_namespaceObject.toLower)(this.file.type);
14585
+ return (0,external_namespaceObject.includes)((0,external_namespaceObject.map)(this.pictureType, external_namespaceObject.toLower), lowerType) || (0,external_namespaceObject.includes)((0,external_namespaceObject.map)(this.videoType, external_namespaceObject.toLower), lowerType);
14584
14586
  }
14585
14587
  },
14586
14588
  methods: {
@@ -14768,7 +14770,7 @@ var FileDetail_component = normalizeComponent(
14768
14770
  * */
14769
14771
  includesType: function includesType(typeList, fileType) {
14770
14772
  if (!fileType) return false;
14771
- return (0,external_lodash_namespaceObject.includes)((0,external_lodash_namespaceObject.map)(typeList, external_lodash_namespaceObject.toLower), (0,external_lodash_namespaceObject.toLower)(fileType));
14773
+ return (0,external_namespaceObject.includes)((0,external_namespaceObject.map)(typeList, external_namespaceObject.toLower), (0,external_namespaceObject.toLower)(fileType));
14772
14774
  },
14773
14775
  /**
14774
14776
  * 打开文件预览,一般是除了图片、视频、音频这些无法预览的附件类型
@@ -14832,7 +14834,7 @@ var FileDetail_component = normalizeComponent(
14832
14834
  }
14833
14835
  // office类型文件展示对应类型图片
14834
14836
  if (this.includesType(this.officeFileTypes, file.type)) {
14835
- var lowerType = (0,external_lodash_namespaceObject.toLower)(file.type);
14837
+ var lowerType = (0,external_namespaceObject.toLower)(file.type);
14836
14838
  if (lowerType.includes('xls')) {
14837
14839
  url = "https://banniu-work.oss-cn-zhangjiakou.aliyuncs.com/125_10030158_d46630a679d1f3830947095edfd12f41.png";
14838
14840
  }
@@ -15823,7 +15825,7 @@ var es_string_starts_with = __webpack_require__(1392);
15823
15825
  /**
15824
15826
  * input事件 实时变化
15825
15827
  * */
15826
- valInput: (0,external_lodash_namespaceObject.debounce)(function (val) {
15828
+ valInput: (0,external_namespaceObject.debounce)(function (val) {
15827
15829
  // 快速处理空值
15828
15830
  if (!val) {
15829
15831
  this.val = "";
@@ -19737,10 +19739,10 @@ function util_searchToBoolean(chart, data) {
19737
19739
  // 是否处理过初始化数据
19738
19740
  pageOptionList: [],
19739
19741
  total: 0,
19740
- loadingOptionListDebounced: (0,external_lodash_namespaceObject.debounce)(this.loadingOptionList, 200),
19741
- filterMethodDebounced: (0,external_lodash_namespaceObject.debounce)(this.filterMethod, 200),
19742
- initRemoteMethodDebounced: (0,external_lodash_namespaceObject.debounce)(this.initRemoteMethod, 10),
19743
- initSelectDataDebounced: (0,external_lodash_namespaceObject.debounce)(this.initSelectData, 10)
19742
+ loadingOptionListDebounced: (0,external_namespaceObject.debounce)(this.loadingOptionList, 200),
19743
+ filterMethodDebounced: (0,external_namespaceObject.debounce)(this.filterMethod, 200),
19744
+ initRemoteMethodDebounced: (0,external_namespaceObject.debounce)(this.initRemoteMethod, 10),
19745
+ initSelectDataDebounced: (0,external_namespaceObject.debounce)(this.initSelectData, 10)
19744
19746
  };
19745
19747
  },
19746
19748
  mounted: function mounted() {
@@ -20813,7 +20815,7 @@ function _asyncToGenerator(n) {
20813
20815
  },
20814
20816
  methods: {
20815
20817
  // 防抖函数
20816
- handleInput: external_lodash_default().debounce(function () {
20818
+ handleInput: external_default().debounce(function () {
20817
20819
  this.debouncedValue = this.sourceData.value;
20818
20820
  this.getOptions(this.debouncedValue);
20819
20821
  }, 200),
@@ -21552,6 +21554,12 @@ var es_array_sort = __webpack_require__(6910);
21552
21554
 
21553
21555
 
21554
21556
 
21557
+
21558
+
21559
+
21560
+
21561
+
21562
+
21555
21563
 
21556
21564
 
21557
21565
 
@@ -21631,6 +21639,165 @@ function isFourAddressLevel(sourceData) {
21631
21639
  }
21632
21640
  var CITY_SUFFIX_KEYS = ['布依族苗族自治州', '苗族侗族自治州', '自治州', '州', '市', '县', '地区'];
21633
21641
  var INVALID_AREA_NAMES = ['其他', '其它区', '其他区'];
21642
+ var PROVINCE_STRIP_SUFFIXES = ['维吾尔自治区', '回族自治区', '壮族自治区', '特别行政区', '自治区', '省', '市'];
21643
+ var AREA_STRIP_SUFFIXES = ['自治县', '自治旗', '林区', '特区', '区', '县', '市', '旗'];
21644
+ var STREET_STRIP_SUFFIXES = ['街道办事处', '街道', '镇', '乡', '路', '巷', '弄', '号'];
21645
+
21646
+ /**
21647
+ * 生成省市区街道在原文中可能出现的匹配片段(含简称)
21648
+ */
21649
+ function getRegionMatchTokens(name, type) {
21650
+ var tokens = [];
21651
+ if (!name) {
21652
+ return tokens;
21653
+ }
21654
+ var addToken = function addToken(token) {
21655
+ if (token && token.length >= 2 && tokens.indexOf(token) === -1) {
21656
+ tokens.push(token);
21657
+ }
21658
+ };
21659
+ addToken(name);
21660
+ if (type === 'province') {
21661
+ PROVINCE_STRIP_SUFFIXES.forEach(function (suffix) {
21662
+ if (name.endsWith(suffix)) {
21663
+ addToken(name.slice(0, -suffix.length));
21664
+ }
21665
+ });
21666
+ if (name.indexOf('内蒙古') === 0) {
21667
+ addToken('内蒙');
21668
+ }
21669
+ } else if (type === 'city') {
21670
+ CITY_SUFFIX_KEYS.forEach(function (suffix) {
21671
+ if (name.endsWith(suffix)) {
21672
+ addToken(name.slice(0, -suffix.length));
21673
+ }
21674
+ });
21675
+ } else if (type === 'area') {
21676
+ AREA_STRIP_SUFFIXES.forEach(function (suffix) {
21677
+ if (name.endsWith(suffix) && name.length > suffix.length + 1) {
21678
+ addToken(name.slice(0, -suffix.length));
21679
+ }
21680
+ });
21681
+ } else if (type === 'street') {
21682
+ STREET_STRIP_SUFFIXES.forEach(function (suffix) {
21683
+ if (name.endsWith(suffix) && name.length > suffix.length + 1) {
21684
+ addToken(name.slice(0, -suffix.length));
21685
+ }
21686
+ });
21687
+ }
21688
+ return tokens;
21689
+ }
21690
+
21691
+ /**
21692
+ * 校验文本匹配时忽略空白符,避免空格/换行影响判断
21693
+ */
21694
+ function normalizeTextForRegionCheck(text) {
21695
+ if (!text) {
21696
+ return '';
21697
+ }
21698
+ return String(text).replace(/\s+/g, '');
21699
+ }
21700
+
21701
+ /**
21702
+ * 判断识别出的地址片段是否能在客户原始输入中找到
21703
+ */
21704
+ function isAddressPartInText(text, name, type) {
21705
+ if (!name) {
21706
+ return true;
21707
+ }
21708
+ var normalizedText = normalizeTextForRegionCheck(text);
21709
+ var tokens = getRegionMatchTokens(name, type);
21710
+ return tokens.some(function (token) {
21711
+ return normalizedText.indexOf(token) > -1;
21712
+ });
21713
+ }
21714
+
21715
+ /**
21716
+ * 强制校验:识别出的省市区街道必须出现在原始输入中
21717
+ */
21718
+ function validateRecognizedRegion(originalText, parse) {
21719
+ var checks = [{
21720
+ key: 'province',
21721
+ label: '省',
21722
+ value: parse.province
21723
+ }, {
21724
+ key: 'city',
21725
+ label: '市',
21726
+ value: parse.city
21727
+ }, {
21728
+ key: 'area',
21729
+ label: '区',
21730
+ value: parse.area
21731
+ }, {
21732
+ key: 'street',
21733
+ label: '街道',
21734
+ value: parse.street
21735
+ }];
21736
+ var recognized = checks.filter(function (item) {
21737
+ return item.value;
21738
+ });
21739
+ if (recognized.length === 0) {
21740
+ return {
21741
+ valid: true,
21742
+ missing: [],
21743
+ recognized: []
21744
+ };
21745
+ }
21746
+ var missing = recognized.filter(function (item) {
21747
+ return !isAddressPartInText(originalText, item.value, item.key);
21748
+ });
21749
+ return {
21750
+ valid: missing.length === 0,
21751
+ missing: missing,
21752
+ recognized: recognized
21753
+ };
21754
+ }
21755
+
21756
+ /**
21757
+ * 强制校验失败:清空省市区街道收件人,保留联系方式,原文写入详细地址
21758
+ */
21759
+ function applyRegionValidationFailure(originalText, parse, validation) {
21760
+ var fallbackAddress = String(originalText || '').trim();
21761
+ console.warn('[addressParse] 强制校验失败:识别出的省市区/街道在客户原始输入中未找到,已按识别失败处理', {
21762
+ originalText: fallbackAddress,
21763
+ recognized: {
21764
+ province: parse.province,
21765
+ city: parse.city,
21766
+ area: parse.area,
21767
+ street: parse.street,
21768
+ name: parse.name,
21769
+ addr: parse.addr
21770
+ },
21771
+ missingInOriginalText: validation.missing.map(function (item) {
21772
+ return {
21773
+ field: item.key,
21774
+ label: item.label,
21775
+ value: item.value,
21776
+ triedTokens: getRegionMatchTokens(item.value, item.key)
21777
+ };
21778
+ }),
21779
+ keptFields: {
21780
+ mobile: parse.mobile,
21781
+ phone: parse.phone,
21782
+ zip_code: parse.zip_code,
21783
+ extensionNumber: parse.extensionNumber
21784
+ },
21785
+ fallbackAddress: fallbackAddress
21786
+ });
21787
+ return {
21788
+ name: '',
21789
+ mobile: parse.mobile || '',
21790
+ phone: parse.phone || '',
21791
+ zip_code: parse.zip_code || '',
21792
+ extensionNumber: parse.extensionNumber || '',
21793
+ detail: fallbackAddress,
21794
+ province: '',
21795
+ city: '',
21796
+ area: '',
21797
+ street: '',
21798
+ addr: fallbackAddress
21799
+ };
21800
+ }
21634
21801
 
21635
21802
  /**
21636
21803
  * 去掉地址片段开头的市/州等后缀(仅用于城市简称匹配后的剩余文本)
@@ -21820,9 +21987,10 @@ function matchAreaInCity(afterCity, city, sourceData, parse) {
21820
21987
  * 解析地址详情(内部方法,需先调用 parseArea 初始化地址库)
21821
21988
  * @param address 任意地址字符串
21822
21989
  * @param sourceData 组件配置,如 extraInfo.isFourAddress
21990
+ * @param originalAddress 客户原始输入,用于识别结果强制校验
21823
21991
  * @returns {{name: string, mobile: string, detail: string, zip_code: string, phone: string}}
21824
21992
  */
21825
- function parseAddressDetail(address, sourceData) {
21993
+ function parseAddressDetail(address, sourceData, originalAddress) {
21826
21994
  var parse = {
21827
21995
  name: '',
21828
21996
  mobile: '',
@@ -21959,6 +22127,10 @@ function parseAddressDetail(address, sourceData) {
21959
22127
  } else if (parse.province === "内蒙古") {
21960
22128
  parse.province = "内蒙古自治区";
21961
22129
  }
22130
+ var regionValidation = validateRecognizedRegion(originalAddress || address, parse);
22131
+ if (!regionValidation.valid) {
22132
+ return applyRegionValidationFailure(originalAddress || address, parse, regionValidation);
22133
+ }
21962
22134
  console.log('最终解析结果:', JSON.stringify(parse));
21963
22135
  return parse;
21964
22136
  }
@@ -22494,7 +22666,7 @@ function addressParse(address, sourceData) {
22494
22666
  parseArea(list);
22495
22667
  }
22496
22668
  var cleanAddress = preprocessAddress(address);
22497
- return parseAddressDetail(cleanAddress, sourceData || {});
22669
+ return parseAddressDetail(cleanAddress, sourceData || {}, address);
22498
22670
  }
22499
22671
  ;// ../../packages/utils/index.js
22500
22672
  /* unused harmony import specifier */ var utils_toConsumableArray;
@@ -24236,6 +24408,38 @@ function mainAppRouterPush(route) {
24236
24408
  (_window$$wujie = window.$wujie) === null || _window$$wujie === void 0 || _window$$wujie.bus.$emit('router-jump', route);
24237
24409
  } else {}
24238
24410
  }
24411
+
24412
+ /** vxe-table 公共样式绑定:固定行高 48px(common.scss `.Bn-table`) */
24413
+ var bnTableBind = {
24414
+ "class": 'Bn-table',
24415
+ border: 'full',
24416
+ highlightHoverRow: true,
24417
+ showHeaderOverflow: 'ellipsis',
24418
+ cellConfig: {
24419
+ height: 48
24420
+ },
24421
+ headerCellConfig: {
24422
+ height: 48
24423
+ },
24424
+ headerRowClassName: 'Bn-table-header-row',
24425
+ rowClassName: 'Bn-table-body-row',
24426
+ cellClassName: 'Bn-table-cell'
24427
+ };
24428
+
24429
+ /** vxe-table 公共样式绑定:表体多行(`.Bn-table--wrap-row`) */
24430
+ var bnTableWrapBind = {
24431
+ "class": 'Bn-table Bn-table--wrap-row',
24432
+ border: 'full',
24433
+ highlightHoverRow: true,
24434
+ showHeaderOverflow: 'ellipsis',
24435
+ headerCellConfig: {
24436
+ height: 48
24437
+ },
24438
+ headerRowClassName: 'Bn-table-header-row',
24439
+ rowClassName: 'Bn-table-body-row',
24440
+ cellClassName: 'Bn-table-cell'
24441
+ };
24442
+
24239
24443
  /**
24240
24444
  * 地址自动识别
24241
24445
  * */