@bit-sun/business-component 1.1.26 → 1.1.29

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/dist/index.esm.js CHANGED
@@ -78,14 +78,14 @@ function _inherits(subClass, superClass) {
78
78
  throw new TypeError("Super expression must either be null or a function");
79
79
  }
80
80
 
81
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
82
+ constructor: {
83
+ value: subClass,
84
+ writable: true,
85
+ configurable: true
86
+ }
87
+ });
81
88
  Object.defineProperty(subClass, "prototype", {
82
- value: Object.create(superClass && superClass.prototype, {
83
- constructor: {
84
- value: subClass,
85
- writable: true,
86
- configurable: true
87
- }
88
- }),
89
89
  writable: false
90
90
  });
91
91
  if (superClass) _setPrototypeOf(subClass, superClass);
@@ -484,7 +484,7 @@ function boundAlpha(a) {
484
484
  */
485
485
  function convertToPercentage(n) {
486
486
  if (n <= 1) {
487
- return Number(n) * 100 + "%";
487
+ return "".concat(Number(n) * 100, "%");
488
488
  }
489
489
  return n;
490
490
  }
@@ -866,12 +866,12 @@ var CSS_INTEGER = '[-\\+]?\\d+%?';
866
866
  // <http://www.w3.org/TR/css3-values/#number-value>
867
867
  var CSS_NUMBER = '[-\\+]?\\d*\\.\\d+%?';
868
868
  // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
869
- var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
869
+ var CSS_UNIT = "(?:".concat(CSS_NUMBER, ")|(?:").concat(CSS_INTEGER, ")");
870
870
  // Actual matching.
871
871
  // Parentheses and commas are optional, but not required.
872
872
  // Whitespace can take the place of commas or opening paren
873
- var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
874
- var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
873
+ var PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
874
+ var PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
875
875
  var matchers = {
876
876
  CSS_UNIT: new RegExp(CSS_UNIT),
877
877
  rgb: new RegExp('rgb' + PERMISSIVE_MATCH3),
@@ -1222,6 +1222,17 @@ function canUseDom() {
1222
1222
 
1223
1223
  var MARK_KEY = "rc-util-key";
1224
1224
 
1225
+ function getMark() {
1226
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1227
+ mark = _ref.mark;
1228
+
1229
+ if (mark) {
1230
+ return mark.startsWith('data-') ? mark : "data-".concat(mark);
1231
+ }
1232
+
1233
+ return MARK_KEY;
1234
+ }
1235
+
1225
1236
  function getContainer(option) {
1226
1237
  if (option.attachTo) {
1227
1238
  return option.attachTo;
@@ -1265,6 +1276,14 @@ function injectCSS(css) {
1265
1276
  return styleNode;
1266
1277
  }
1267
1278
  var containerCache = new Map();
1279
+
1280
+ function findExistNode(key) {
1281
+ var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1282
+ var container = getContainer(option);
1283
+ return Array.from(containerCache.get(container).children).find(function (node) {
1284
+ return node.tagName === 'STYLE' && node.getAttribute(getMark(option)) === key;
1285
+ });
1286
+ }
1268
1287
  function updateCSS(css, key) {
1269
1288
  var option = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1270
1289
  var container = getContainer(option); // Get real parent
@@ -1276,9 +1295,7 @@ function updateCSS(css, key) {
1276
1295
  parentNode.removeChild(placeholderStyle);
1277
1296
  }
1278
1297
 
1279
- var existNode = Array.from(containerCache.get(container).children).find(function (node) {
1280
- return node.tagName === 'STYLE' && node[MARK_KEY] === key;
1281
- });
1298
+ var existNode = findExistNode(key, option);
1282
1299
 
1283
1300
  if (existNode) {
1284
1301
  var _option$csp3, _option$csp4;
@@ -1297,7 +1314,7 @@ function updateCSS(css, key) {
1297
1314
  }
1298
1315
 
1299
1316
  var newNode = injectCSS(css, option);
1300
- newNode[MARK_KEY] = key;
1317
+ newNode.setAttribute(getMark(option), key);
1301
1318
  return newNode;
1302
1319
  }
1303
1320
 
@@ -2390,7 +2407,9 @@ var SearchSelect = function SearchSelect(props) {
2390
2407
  ctx = props.ctx,
2391
2408
  sourceName = props.sourceName,
2392
2409
  _props$needModalTable = props.needModalTable,
2393
- needModalTable = _props$needModalTable === void 0 ? true : _props$needModalTable;
2410
+ needModalTable = _props$needModalTable === void 0 ? true : _props$needModalTable,
2411
+ _props$getPopupContai = props.getPopupContainer,
2412
+ _getPopupContainer = _props$getPopupContai === void 0 ? undefined : _props$getPopupContai;
2394
2413
 
2395
2414
  var _ref = requestConfig || {},
2396
2415
  url = _ref.url,
@@ -2402,7 +2421,8 @@ var SearchSelect = function SearchSelect(props) {
2402
2421
  mappingTextField = _ref$mappingTextField === void 0 ? 'name' : _ref$mappingTextField,
2403
2422
  mappingTextShowKeyField = _ref.mappingTextShowKeyField,
2404
2423
  _ref$mappingValueFiel = _ref.mappingValueField,
2405
- mappingValueField = _ref$mappingValueFiel === void 0 ? 'code' : _ref$mappingValueFiel;
2424
+ mappingValueField = _ref$mappingValueFiel === void 0 ? 'code' : _ref$mappingValueFiel,
2425
+ mappingTextShowTextField = _ref.mappingTextShowTextField;
2406
2426
 
2407
2427
  var resultSourceKey = sourceName || (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.sourceName) || 'supplierCode';
2408
2428
  var selectMode = selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode; // 设定当前选择器 为单选或者多选模式 无设定为单选模式(默认)
@@ -2651,6 +2671,8 @@ var SearchSelect = function SearchSelect(props) {
2651
2671
  delete params[key];
2652
2672
  } else if (Array.isArray(element)) {
2653
2673
  params[key] = element.join(',');
2674
+ } else if (element == null || element === undefined || String(element).trim() === '') {
2675
+ delete params[key];
2654
2676
  }
2655
2677
  })();
2656
2678
  }
@@ -2683,14 +2705,44 @@ var SearchSelect = function SearchSelect(props) {
2683
2705
  } else {
2684
2706
  var keys = res.list ? 'list' : 'items';
2685
2707
  source = res ? res[keys] ? res[keys].map(function (item) {
2708
+ var textShowText = item[mappingTextField];
2709
+
2710
+ if (mappingTextShowTextField) {
2711
+ textShowText = [];
2712
+
2713
+ if (Array.isArray(mappingTextShowTextField)) {
2714
+ mappingTextShowTextField.forEach(function (r) {
2715
+ textShowText.push(item[r]);
2716
+ });
2717
+ } else {
2718
+ textShowText = item[mappingTextShowTextField];
2719
+ }
2720
+ }
2721
+
2686
2722
  return _objectSpread2(_objectSpread2({}, item), {}, {
2687
2723
  text: item[mappingTextField],
2724
+ textShowText: textShowText,
2688
2725
  textShowKey: item[mappingTextShowKeyField || mappingValueField],
2689
2726
  value: item[mappingValueField]
2690
2727
  });
2691
2728
  }) : Array.isArray(res) && (res === null || res === void 0 ? void 0 : res.map(function (item) {
2729
+ var textShowText = item[mappingTextField];
2730
+
2731
+ if (mappingTextShowTextField) {
2732
+ textShowText = [];
2733
+
2734
+ if (Array.isArray(mappingTextShowTextField)) {
2735
+ mappingTextShowTextField.forEach(function (r) {
2736
+ textShowText.push(item[r]);
2737
+ });
2738
+ } else {
2739
+ textShowText = item[mappingTextShowTextField];
2740
+ }
2741
+ }
2742
+
2692
2743
  return _objectSpread2(_objectSpread2({}, item), {}, {
2693
2744
  text: item[mappingTextField],
2745
+ textShowText: textShowText,
2694
2746
  textShowKey: item[mappingTextShowKeyField || mappingValueField],
2695
2747
  value: item[mappingValueField]
2696
2748
  });
@@ -2723,7 +2775,8 @@ var SearchSelect = function SearchSelect(props) {
2723
2775
  var target = e.target;
2724
2776
  var totalPage = Math.ceil(itemsTotal / pageSize); // 判断是否滑动到底部
2725
2777
 
2726
- var isTouchGround = target.scrollTop + target.offsetHeight === target.scrollHeight; // 判断数据是否还没有加载到了最后一页
2778
+ var isTouchGround = target.scrollTop + target.offsetHeight === target.scrollHeight; // >=scrollHeight
2779
+ // 判断数据是否还没有加载到了最后一页
2727
2780
 
2728
2781
  var canPageAdd = scrollPage < totalPage;
2729
2782
 
@@ -2733,6 +2786,20 @@ var SearchSelect = function SearchSelect(props) {
2733
2786
  getData({
2734
2787
  currentPage: nextScrollPage
2735
2788
  }); // 调用api方法
2789
+ } //判断是否滑动到顶部
2790
+
2791
+
2792
+ var isTouchTop = target.scrollTop === 0; // <=0
2793
+ // 判断数据是否到第一页
2794
+
2795
+ var canPageJian = scrollPage > 1;
2796
+
2797
+ if (isTouchTop && canPageJian) {
2798
+ var preScrollPage = scrollPage - 1;
2799
+ setScrollPage(preScrollPage);
2800
+ getData({
2801
+ currentPage: preScrollPage
2802
+ }); // 调用api方法
2736
2803
  }
2737
2804
  };
2738
2805
 
@@ -2772,7 +2839,7 @@ var SearchSelect = function SearchSelect(props) {
2772
2839
  };
2773
2840
  }));
2774
2841
  setIndeterminate(!!value.length && value.length < itemsTotal);
2775
- setCheckedAll(value.length === itemsTotal); // 需清空数据
2842
+ setCheckedAll(itemsTotal && value.length === itemsTotal); // 需清空数据
2776
2843
 
2777
2844
  if (!value.length) {
2778
2845
  setDoubleArr([]);
@@ -2789,18 +2856,21 @@ var SearchSelect = function SearchSelect(props) {
2789
2856
  }
2790
2857
  };
2791
2858
 
2792
- var handleOk = function handleOk() {
2793
- if (popvalue === null || popvalue === void 0 ? void 0 : popvalue.length) {
2859
+ var handleSelectOver = function handleSelectOver(selectedValue) {
2860
+ if (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.length) {
2794
2861
  var _ctx$form2;
2795
2862
 
2796
- formaData(popvalue); // 解决选择最后1页的sku,返回后,不显示名称问题
2863
+ formaData(selectedValue); // 解决选择最后1页的sku,返回后,不显示名称问题
2797
2864
 
2798
- var source = _.uniqBy(items.concat(popvalue), 'value');
2865
+ var source = _.uniqBy(items.concat(selectedValue), 'value');
2799
2866
 
2800
2867
  ctx === null || ctx === void 0 ? void 0 : (_ctx$form2 = ctx.form) === null || _ctx$form2 === void 0 ? void 0 : _ctx$form2.setFieldSource(resultSourceKey, source);
2801
2868
  setItems(source);
2802
2869
  }
2870
+ };
2803
2871
 
2872
+ var handleOk = function handleOk() {
2873
+ handleSelectOver(popvalue);
2804
2874
  handleCancel();
2805
2875
  };
2806
2876
 
@@ -2827,6 +2897,10 @@ var SearchSelect = function SearchSelect(props) {
2827
2897
  form.resetFields();
2828
2898
  setTableFormParams({});
2829
2899
  setIsModalVisible(false);
2900
+
2901
+ if (selectMode) {
2902
+ run();
2903
+ }
2830
2904
  };
2831
2905
 
2832
2906
  var onSearchChange = function onSearchChange(e) {
@@ -2845,6 +2919,10 @@ var SearchSelect = function SearchSelect(props) {
2845
2919
  getData(_objectSpread2(_objectSpread2({}, params), {}, {
2846
2920
  pageSize: tableInitPageSize
2847
2921
  }), 2);
2922
+
2923
+ if (selectMode) {
2924
+ getData(params);
2925
+ }
2848
2926
  };
2849
2927
 
2850
2928
  var onResetTable = function onResetTable() {
@@ -2865,14 +2943,22 @@ var SearchSelect = function SearchSelect(props) {
2865
2943
 
2866
2944
  var onChangeCheckAll = function onChangeCheckAll(e) {
2867
2945
  if (e.target.checked) {
2868
- // 如果下拉框有所有数据就处理选中所有,如果没有 就默认查出所有数据
2869
- if (items.length === itemsTotal) {
2870
- var currentItemsData = JSON.parse(JSON.stringify(items));
2871
- setSelectedRowKeys(currentItemsData.map(function (i) {
2872
- return i.value;
2873
- }));
2874
- setPopValue(currentItemsData);
2946
+ // 如果下拉框有所有数据就处理选中所有【items.length === itemsTotal】(最多可选100条)
2947
+ // 如果超过100条 就默认查出所有数据
2948
+ var currentItemsData = JSON.parse(JSON.stringify(items));
2949
+ var totalPage = Math.ceil(itemsTotal / (tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.pageSize));
2950
+
2951
+ for (var i = 0; i <= totalPage - 1; i++) {
2952
+ doubleArr[i] = currentItemsData.slice((tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.pageSize) * i, (tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.pageSize) * (i + 1));
2875
2953
  }
2954
+
2955
+ setDoubleArr(doubleArr);
2956
+ setSelectedRowKeys(currentItemsData.map(function (i) {
2957
+ return i.value;
2958
+ }));
2959
+ setPopValue(currentItemsData);
2960
+
2961
+ if (items.length < itemsTotal) ;
2876
2962
  } else {
2877
2963
  setSelectedRowKeys([]);
2878
2964
  setPopValue([]);
@@ -2897,13 +2983,15 @@ var SearchSelect = function SearchSelect(props) {
2897
2983
  return txt.replace(regexp, "<span style=\"color:red\">".concat(heightTxt, "</span>"));
2898
2984
  };
2899
2985
 
2900
- return /*#__PURE__*/React.createElement("div", {
2986
+ return /*#__PURE__*/React.createElement(Tooltip, {
2987
+ title: text
2988
+ }, /*#__PURE__*/React.createElement("div", {
2901
2989
  ref: function ref(nodeElement) {
2902
2990
  if (nodeElement) {
2903
2991
  nodeElement.innerHTML = heightLightTxt(text, filterTxt);
2904
2992
  }
2905
2993
  }
2906
- });
2994
+ }));
2907
2995
  }; // 扁平化二维数组的方法
2908
2996
 
2909
2997
 
@@ -2947,7 +3035,10 @@ var SearchSelect = function SearchSelect(props) {
2947
3035
  filterRows = selectRows;
2948
3036
  sksResult = selectRows.map(function (i) {
2949
3037
  return i.value;
2950
- });
3038
+ }); // 单选直接选中 不需要确定
3039
+
3040
+ handleSelectOver(filterRows);
3041
+ handleCancel();
2951
3042
  }
2952
3043
 
2953
3044
  setSelectedRowKeys(sksResult);
@@ -3023,6 +3114,14 @@ var SearchSelect = function SearchSelect(props) {
3023
3114
  },
3024
3115
  placeholder: "\u8BF7\u9009\u62E9"
3025
3116
  }, i === null || i === void 0 ? void 0 : (_i$field4 = i.field) === null || _i$field4 === void 0 ? void 0 : _i$field4.props)));
3117
+ }
3118
+
3119
+ if ((i === null || i === void 0 ? void 0 : i.type) === 'businessSearchSelect') {
3120
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form.Item, {
3121
+ name: i.name,
3122
+ label: i.label,
3123
+ key: i.name
3124
+ }, /*#__PURE__*/React.createElement(BusinessSearchSelect$1, _objectSpread2({}, i.field.props))));
3026
3125
  } // 默认type是input
3027
3126
 
3028
3127
 
@@ -3044,23 +3143,19 @@ var SearchSelect = function SearchSelect(props) {
3044
3143
  }
3045
3144
  };
3046
3145
 
3047
- var TooltipContent = function TooltipContent() {
3048
- if (selectMode && value && (value === null || value === void 0 ? void 0 : value.length)) {
3049
- var listSelected = JSON.parse(JSON.stringify(items)).filter(function (i) {
3050
- return value.find(function (item) {
3051
- return item === i.value;
3052
- });
3053
- }) || [];
3054
-
3055
- var _onClose = function onClose(e, item) {
3056
- e.preventDefault();
3057
- var newValue = JSON.parse(JSON.stringify(value)).filter(function (i) {
3058
- return i !== item.value;
3059
- });
3060
- onChange(newValue);
3061
- };
3146
+ var maxTagPlaceholder = function maxTagPlaceholder(selectedValues) {
3147
+ var _onClose = function onClose(e, item) {
3148
+ e.preventDefault();
3149
+ var newValue = labelInValue ? JSON.parse(JSON.stringify(value)).filter(function (i) {
3150
+ return i.value !== item.value;
3151
+ }) : JSON.parse(JSON.stringify(value)).filter(function (i) {
3152
+ return i !== item.value;
3153
+ });
3154
+ onChange(newValue);
3155
+ };
3062
3156
 
3063
- return (listSelected === null || listSelected === void 0 ? void 0 : listSelected.length) && listSelected.map(function (i) {
3157
+ return /*#__PURE__*/React.createElement(Tooltip, {
3158
+ title: selectedValues.map(function (i) {
3064
3159
  return /*#__PURE__*/React.createElement(Tag, {
3065
3160
  closable: true,
3066
3161
  onClose: function onClose(e) {
@@ -3072,13 +3167,9 @@ var SearchSelect = function SearchSelect(props) {
3072
3167
  height: '24px',
3073
3168
  border: '1px solid #f0f0f0'
3074
3169
  }
3075
- }, i.text);
3076
- }) || '';
3077
- } else {
3078
- setTooltipVisible(false);
3079
- }
3080
-
3081
- return '';
3170
+ }, i.label);
3171
+ })
3172
+ }, "+ ".concat(selectedValues === null || selectedValues === void 0 ? void 0 : selectedValues.length));
3082
3173
  };
3083
3174
 
3084
3175
  return /*#__PURE__*/React.createElement("div", {
@@ -3086,15 +3177,6 @@ var SearchSelect = function SearchSelect(props) {
3086
3177
  }, /*#__PURE__*/React.createElement("div", {
3087
3178
  className: "search_select_show",
3088
3179
  id: "search_select_div_".concat(uniqueValue)
3089
- }, /*#__PURE__*/React.createElement(Tooltip, {
3090
- title: TooltipContent,
3091
- visible: tooltipVisible,
3092
- trigger: 'hover',
3093
- onVisibleChange: function onVisibleChange(visible) {
3094
- if (selectMode && value && (value === null || value === void 0 ? void 0 : value.length)) {
3095
- setTooltipVisible(visible);
3096
- }
3097
- }
3098
3180
  }, /*#__PURE__*/React.createElement(Select, _objectSpread2(_objectSpread2({
3099
3181
  virtual: true,
3100
3182
  labelInValue: labelInValue,
@@ -3141,20 +3223,21 @@ var SearchSelect = function SearchSelect(props) {
3141
3223
  style: {
3142
3224
  width: needModalTable ? 'calc(100% - 30px)' : 'calc(100%)'
3143
3225
  },
3144
- placeholder: "\u8BF7\u9009\u62E9"
3226
+ placeholder: "\u8BF7\u9009\u62E9",
3227
+ maxTagPlaceholder: maxTagPlaceholder
3145
3228
  }, currentSelectProps), {}, {
3146
3229
  getPopupContainer: function getPopupContainer() {
3147
- return document.getElementById("search_select_div_".concat(uniqueValue));
3230
+ return _getPopupContainer && _getPopupContainer() || document.getElementById("search_select_div_".concat(uniqueValue));
3148
3231
  }
3149
3232
  }), items.map(function (item) {
3150
3233
  return /*#__PURE__*/React.createElement(Option, {
3151
3234
  key: item.value,
3152
3235
  label: item.text
3153
3236
  }, LightHeightOption({
3154
- text: "".concat(item.textShowKey, " ").concat(item.text),
3237
+ text: "".concat(item.textShowKey, " ").concat(Array.isArray(item.textShowText) && item.textShowText.join(' ') || item.textShowText),
3155
3238
  filterTxt: searchValue
3156
3239
  }));
3157
- }))), needModalTable && /*#__PURE__*/React.createElement(Button, {
3240
+ })), needModalTable && /*#__PURE__*/React.createElement(Button, {
3158
3241
  style: {
3159
3242
  width: '30px',
3160
3243
  padding: '2px',
@@ -3168,7 +3251,7 @@ var SearchSelect = function SearchSelect(props) {
3168
3251
  visible: isModalVisible,
3169
3252
  onOk: handleOk,
3170
3253
  onCancel: handleCancel,
3171
- footer: [/*#__PURE__*/React.createElement(Button, {
3254
+ footer: selectMode ? [/*#__PURE__*/React.createElement(Button, {
3172
3255
  key: "back",
3173
3256
  onClick: handleCancel
3174
3257
  }, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
@@ -3176,7 +3259,7 @@ var SearchSelect = function SearchSelect(props) {
3176
3259
  type: "primary",
3177
3260
  onClick: handleOk,
3178
3261
  disabled: !tableData.length || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
3179
- }, "\u786E\u5B9A")]
3262
+ }, "\u786E\u5B9A")] : null
3180
3263
  }, /*#__PURE__*/React.createElement("div", {
3181
3264
  className: 'search_select_wrapper'
3182
3265
  }, /*#__PURE__*/React.createElement("div", {
@@ -3342,16 +3425,15 @@ var loadSelectSource = function loadSelectSource(url, params) {
3342
3425
  var _getDictionarySource;
3343
3426
  var hasDictSharingType = (_getDictionarySource = getDictionarySource('UC000013')) === null || _getDictionarySource === void 0 ? void 0 : _getDictionarySource.length;
3344
3427
  var sharingTypeDataList = hasDictSharingType && getDictionarySource('UC000013') || sharingType;
3345
- function commonFun(type, prefixUrl) {
3428
+ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
3346
3429
  // 默认type === 'supplier' 供应商选择器
3347
- var requestConfig = {
3430
+ var requestConfig = _objectSpread2({
3348
3431
  url: "".concat(prefixUrl.selectPrefix, "/supplier"),
3349
3432
  filter: 'qp-name,code-orGroup,like',
3350
3433
  otherParams: {
3351
3434
  sorter: 'desc-id'
3352
- } // 默认参数
3353
-
3354
- };
3435
+ }
3436
+ }, requestConfigProp);
3355
3437
  /*
3356
3438
  * 处理 格式化下拉框数据源
3357
3439
  * reData 必传 promise返回响应的数据 格式为[{},{},{},...] Promise.all第一个参数数组有多少个数组长度就是多少,其中每个对象为每次请求的结果数据
@@ -3361,6 +3443,7 @@ function commonFun(type, prefixUrl) {
3361
3443
  * changeSearchForm 必传 为搜索表单Form数据
3362
3444
  * */
3363
3445
 
3446
+
3364
3447
  var formatSource = function formatSource(reData, position, changePosition, changeSearchForm) {
3365
3448
  var _reData$position;
3366
3449
 
@@ -3495,7 +3578,7 @@ function commonFun(type, prefixUrl) {
3495
3578
  });
3496
3579
  }
3497
3580
 
3498
- var modalTableProps = {
3581
+ var modalTableProps = _objectSpread2({
3499
3582
  modalTableTitle: '选择供应商',
3500
3583
  tableSearchForm: tableSearchForm,
3501
3584
  tableColumns: [{
@@ -3524,36 +3607,56 @@ function commonFun(type, prefixUrl) {
3524
3607
  })) === null || _sharingType$find === void 0 ? void 0 : _sharingType$find.text;
3525
3608
  }
3526
3609
  }]
3527
- };
3610
+ }, modalTableBusProps);
3611
+
3528
3612
  var needModalTable = true; // 商品选择器
3529
3613
 
3530
3614
  if (type === 'skuCommodity') {
3531
- requestConfig = {
3532
- url: "".concat(prefixUrl.selectPrefix, "/sku"),
3533
- filter: 'qp-name,skuCode-orGroup,like',
3615
+ requestConfig = _objectSpread2({
3616
+ url: "".concat(prefixUrl.selectPrefix, "/sku/pager/v2"),
3617
+ filter: 'skuCodeAndSkuName',
3534
3618
  mappingTextField: 'name',
3535
3619
  mappingValueField: 'skuCode',
3620
+ mappingTextShowTextField: ['name', 'propertyNameAndValue'],
3536
3621
  otherParams: {
3537
- 'qp-approveStatus-eq': 2,
3622
+ 'qp-approveStatus-eq': 1,
3623
+ 'qp-type-eq': 10,
3538
3624
  sorter: 'desc-id'
3539
3625
  },
3540
3626
  sourceName: 'skuCode'
3541
- };
3627
+ }, requestConfigProp);
3542
3628
  tableSearchForm = [{
3543
- name: 'qp-name-like',
3629
+ name: 'qp-skuName-like',
3544
3630
  label: 'SKU名称'
3545
3631
  }, {
3546
3632
  name: 'qp-skuCode-like',
3547
3633
  label: 'SKU编码'
3548
3634
  }, {
3549
- name: 'qp-barCode-like',
3550
- label: '条形码'
3635
+ name: 'qp-code-like',
3636
+ label: '国际条码'
3551
3637
  }, {
3552
3638
  name: 'qp-itemName-like',
3553
3639
  label: '所属SPU名称'
3554
3640
  }, {
3555
3641
  name: 'qp-itemCode-like',
3556
3642
  label: '所属SPU编码'
3643
+ }, {
3644
+ name: 'qp-externalCode-like',
3645
+ label: '外部编码'
3646
+ }, {
3647
+ name: 'qp-propertyValueCode-in',
3648
+ type: 'businessSearchSelect',
3649
+ label: '规格',
3650
+ field: {
3651
+ type: 'businessSearchSelect',
3652
+ props: {
3653
+ selectBusinessType: 'skuPropertyValue',
3654
+ selectProps: {
3655
+ mode: 'multiple',
3656
+ maxTagCount: 1
3657
+ }
3658
+ }
3659
+ }
3557
3660
  }, {
3558
3661
  name: 'qp-brandId-in',
3559
3662
  type: 'select',
@@ -3629,11 +3732,11 @@ function commonFun(type, prefixUrl) {
3629
3732
  pageSize: 5000,
3630
3733
  currentPage: 1
3631
3734
  })]).then(function (x) {
3632
- formatSource(x, 0, 5, tableSearchForm, ['id', 'name']);
3633
- formatTreeDataSource(x, 1, 6, tableSearchForm);
3634
- formatSource(x, 2, 7, tableSearchForm, ['id', 'name']);
3735
+ formatSource(x, 0, 7, tableSearchForm, ['id', 'name']);
3736
+ formatTreeDataSource(x, 1, 8, tableSearchForm);
3737
+ formatSource(x, 2, 9, tableSearchForm, ['id', 'name']);
3635
3738
  });
3636
- modalTableProps = {
3739
+ modalTableProps = _objectSpread2({
3637
3740
  modalTableTitle: '选择SKU',
3638
3741
  tableSearchForm: tableSearchForm,
3639
3742
  tableColumns: [{
@@ -3643,11 +3746,20 @@ function commonFun(type, prefixUrl) {
3643
3746
  title: 'SKU名称',
3644
3747
  dataIndex: 'name'
3645
3748
  }, {
3646
- title: '所属SPU',
3749
+ title: '国际条码',
3750
+ dataIndex: 'barCode'
3751
+ }, {
3752
+ title: '所属SPU名称',
3647
3753
  dataIndex: 'itemName'
3754
+ }, {
3755
+ title: '所属SPU编码',
3756
+ dataIndex: 'itemCode'
3757
+ }, {
3758
+ title: '外部编码',
3759
+ dataIndex: 'externalCode'
3648
3760
  }, {
3649
3761
  title: '规格',
3650
- dataIndex: 'skuSpec'
3762
+ dataIndex: 'propertyNameAndValue'
3651
3763
  }, {
3652
3764
  title: '类目',
3653
3765
  dataIndex: 'categoryName'
@@ -3657,16 +3769,29 @@ function commonFun(type, prefixUrl) {
3657
3769
  }, {
3658
3770
  title: '品牌',
3659
3771
  dataIndex: 'brandName'
3660
- }, {
3661
- title: '条形码',
3662
- dataIndex: 'barCode'
3663
3772
  }]
3664
- };
3773
+ }, modalTableBusProps);
3774
+ } // 商品规格选择器(无弹窗)
3775
+
3776
+
3777
+ if (type === 'skuPropertyValue') {
3778
+ requestConfig = _objectSpread2({
3779
+ url: "".concat(prefixUrl.selectPrefix, "/skuPropertyValue/list"),
3780
+ filter: 'qp-value-like',
3781
+ mappingTextField: 'value',
3782
+ mappingTextShowKeyField: 'propertyValueCode',
3783
+ mappingValueField: 'propertyValueCode',
3784
+ otherParams: {
3785
+ sorter: 'desc-id'
3786
+ },
3787
+ sourceName: 'qp-propertyValueCode-in'
3788
+ }, requestConfigProp);
3789
+ needModalTable = false;
3665
3790
  } // 仓库选择器(物理、逻辑仓)
3666
3791
 
3667
3792
 
3668
3793
  if (type === 'physicalWarehouse') {
3669
- requestConfig = {
3794
+ requestConfig = _objectSpread2({
3670
3795
  url: "".concat(prefixUrl.selectPrefix, "/physicalWarehouse"),
3671
3796
  filter: 'qp-physicalWarehouseName,physicalWarehouseCode-orGroup,like',
3672
3797
  mappingTextField: 'physicalWarehouseName',
@@ -3677,7 +3802,7 @@ function commonFun(type, prefixUrl) {
3677
3802
  sorter: 'desc-id'
3678
3803
  },
3679
3804
  sourceName: 'warehouseIds'
3680
- };
3805
+ }, requestConfigProp);
3681
3806
  tableSearchForm = [{
3682
3807
  name: 'qp-physicalWarehouseName-like',
3683
3808
  label: '物理仓名称'
@@ -3716,7 +3841,7 @@ function commonFun(type, prefixUrl) {
3716
3841
  })]).then(function (x) {
3717
3842
  formatSource(x, 0, 3, tableSearchForm);
3718
3843
  });
3719
- modalTableProps = {
3844
+ modalTableProps = _objectSpread2({
3720
3845
  modalTableTitle: '选择物理仓',
3721
3846
  tableSearchForm: tableSearchForm,
3722
3847
  tableColumns: [{
@@ -3735,11 +3860,11 @@ function commonFun(type, prefixUrl) {
3735
3860
  title: '所属公司',
3736
3861
  dataIndex: 'companyName'
3737
3862
  }]
3738
- };
3863
+ }, modalTableBusProps);
3739
3864
  }
3740
3865
 
3741
3866
  if (type === 'realWarehouse') {
3742
- requestConfig = {
3867
+ requestConfig = _objectSpread2({
3743
3868
  url: "".concat(prefixUrl.selectPrefix, "/realWarehouse"),
3744
3869
  filter: 'qp-realWarehouseName,realWarehouseCode-orGroup,like',
3745
3870
  mappingTextField: 'realWarehouseName',
@@ -3750,7 +3875,7 @@ function commonFun(type, prefixUrl) {
3750
3875
  sorter: 'desc-id'
3751
3876
  },
3752
3877
  sourceName: 'warehouseIds'
3753
- };
3878
+ }, requestConfigProp);
3754
3879
  tableSearchForm = [{
3755
3880
  name: 'qp-realWarehouseName-like',
3756
3881
  label: '逻辑仓名称'
@@ -3763,7 +3888,7 @@ function commonFun(type, prefixUrl) {
3763
3888
  label: '逻辑仓类型',
3764
3889
  initialSource: getDictionarySource('SC00004')
3765
3890
  }];
3766
- modalTableProps = {
3891
+ modalTableProps = _objectSpread2({
3767
3892
  modalTableTitle: '选择逻辑仓',
3768
3893
  tableSearchForm: tableSearchForm,
3769
3894
  tableColumns: [{
@@ -3779,12 +3904,12 @@ function commonFun(type, prefixUrl) {
3779
3904
  return getDictionaryTextByValue('SC00004', text);
3780
3905
  }
3781
3906
  }]
3782
- };
3907
+ }, modalTableBusProps);
3783
3908
  } // 仓库选择器(虚拟、渠道仓)(无弹窗)
3784
3909
 
3785
3910
 
3786
3911
  if (type === 'virtualWarehouse') {
3787
- requestConfig = {
3912
+ requestConfig = _objectSpread2({
3788
3913
  url: "".concat(prefixUrl.selectPrefix, "/virtualWarehouse"),
3789
3914
  filter: 'qp-virtualWarehouseName,virtualWarehouseCode-orGroup,like',
3790
3915
  mappingTextField: 'virtualWarehouseName',
@@ -3795,12 +3920,12 @@ function commonFun(type, prefixUrl) {
3795
3920
  sorter: 'desc-id'
3796
3921
  },
3797
3922
  sourceName: 'warehouseIds'
3798
- };
3923
+ }, requestConfigProp);
3799
3924
  needModalTable = false;
3800
3925
  }
3801
3926
 
3802
3927
  if (type === 'channelWarehouse') {
3803
- requestConfig = {
3928
+ requestConfig = _objectSpread2({
3804
3929
  url: "".concat(prefixUrl.selectPrefix, "/channelWarehouse"),
3805
3930
  filter: 'qp-channelWarehouseName,channelWarehouseCode-orGroup,like',
3806
3931
  mappingTextField: 'channelWarehouseName',
@@ -3811,13 +3936,13 @@ function commonFun(type, prefixUrl) {
3811
3936
  sorter: 'desc-id'
3812
3937
  },
3813
3938
  sourceName: 'warehouseIds'
3814
- };
3939
+ }, requestConfigProp);
3815
3940
  needModalTable = false;
3816
3941
  } // 客户选择器
3817
3942
 
3818
3943
 
3819
3944
  if (type === 'customer') {
3820
- requestConfig = {
3945
+ requestConfig = _objectSpread2({
3821
3946
  url: "".concat(prefixUrl.selectPrefix, "/uc/customer/v2"),
3822
3947
  filter: 'qp-name,code-orGroup,like',
3823
3948
  mappingTextField: 'name',
@@ -3826,7 +3951,7 @@ function commonFun(type, prefixUrl) {
3826
3951
  sorter: 'desc-id'
3827
3952
  },
3828
3953
  sourceName: 'customCode'
3829
- };
3954
+ }, requestConfigProp);
3830
3955
  tableSearchForm = [{
3831
3956
  name: 'qp-name-like',
3832
3957
  label: '客户名称'
@@ -3912,7 +4037,7 @@ function commonFun(type, prefixUrl) {
3912
4037
  formatSource(x, 1, 3, tableSearchForm);
3913
4038
  formatSource(x, 2, 4, tableSearchForm);
3914
4039
  });
3915
- modalTableProps = {
4040
+ modalTableProps = _objectSpread2({
3916
4041
  modalTableTitle: '选择客户',
3917
4042
  tableSearchForm: tableSearchForm,
3918
4043
  tableColumns: [{
@@ -3941,12 +4066,12 @@ function commonFun(type, prefixUrl) {
3941
4066
  })) === null || _sharingType$find2 === void 0 ? void 0 : _sharingType$find2.text;
3942
4067
  }
3943
4068
  }]
3944
- };
4069
+ }, modalTableBusProps);
3945
4070
  } // 店铺选择器
3946
4071
 
3947
4072
 
3948
4073
  if (type === 'shopFile') {
3949
- requestConfig = {
4074
+ requestConfig = _objectSpread2({
3950
4075
  url: "".concat(prefixUrl.selectPrefix, "/store"),
3951
4076
  filter: 'qp-name,code-orGroup,like',
3952
4077
  mappingTextField: 'name',
@@ -3955,7 +4080,7 @@ function commonFun(type, prefixUrl) {
3955
4080
  sorter: 'desc-id'
3956
4081
  },
3957
4082
  sourceName: 'code'
3958
- };
4083
+ }, requestConfigProp);
3959
4084
  tableSearchForm = [{
3960
4085
  name: 'qp-name-like',
3961
4086
  label: '店铺名称'
@@ -4065,7 +4190,7 @@ function commonFun(type, prefixUrl) {
4065
4190
  formatSource(x, 2, 5, tableSearchForm);
4066
4191
  formatSource(x, 3, 6, tableSearchForm);
4067
4192
  });
4068
- modalTableProps = {
4193
+ modalTableProps = _objectSpread2({
4069
4194
  modalTableTitle: '选择店铺',
4070
4195
  tableSearchForm: tableSearchForm,
4071
4196
  tableColumns: [{
@@ -4097,12 +4222,12 @@ function commonFun(type, prefixUrl) {
4097
4222
  title: '归属核算主体',
4098
4223
  dataIndex: 'accountingName'
4099
4224
  }]
4100
- };
4225
+ }, modalTableBusProps);
4101
4226
  } // 核算主体选择器(无弹窗)
4102
4227
 
4103
4228
 
4104
4229
  if (type === 'accountingSubject') {
4105
- requestConfig = {
4230
+ requestConfig = _objectSpread2({
4106
4231
  url: "".concat(prefixUrl.selectPrefix, "/accountingSubject"),
4107
4232
  filter: 'qp-name,code-orGroup,like',
4108
4233
  mappingTextField: 'name',
@@ -4112,13 +4237,13 @@ function commonFun(type, prefixUrl) {
4112
4237
  sorter: 'desc-id'
4113
4238
  },
4114
4239
  sourceName: 'accountingSubjectCode'
4115
- };
4240
+ }, requestConfigProp);
4116
4241
  needModalTable = false;
4117
4242
  } // 库存组织选择器(无弹窗)
4118
4243
 
4119
4244
 
4120
4245
  if (type === 'inventoryOrg') {
4121
- requestConfig = {
4246
+ requestConfig = _objectSpread2({
4122
4247
  url: "".concat(prefixUrl.selectPrefix, "/inventoryOrg"),
4123
4248
  filter: 'qp-name,code-orGroup,like',
4124
4249
  mappingTextField: 'name',
@@ -4128,13 +4253,13 @@ function commonFun(type, prefixUrl) {
4128
4253
  sorter: 'desc-id'
4129
4254
  },
4130
4255
  sourceName: 'inventoryOrgCode'
4131
- };
4256
+ }, requestConfigProp);
4132
4257
  needModalTable = false;
4133
4258
  } // 法人公司选择器(无弹窗)
4134
4259
 
4135
4260
 
4136
4261
  if (type === 'corporationCompany') {
4137
- requestConfig = {
4262
+ requestConfig = _objectSpread2({
4138
4263
  url: "".concat(prefixUrl.selectPrefix, "/company"),
4139
4264
  filter: 'qp-name,code-orGroup,like',
4140
4265
  mappingTextField: 'name',
@@ -4144,15 +4269,15 @@ function commonFun(type, prefixUrl) {
4144
4269
  sorter: 'desc-id'
4145
4270
  },
4146
4271
  sourceName: 'corporationCompany'
4147
- };
4272
+ }, requestConfigProp);
4148
4273
  needModalTable = false;
4149
4274
  } // 员工选择器
4150
4275
 
4151
4276
 
4152
4277
  if (type === 'employee') {
4153
- requestConfig = {
4278
+ requestConfig = _objectSpread2({
4154
4279
  url: "".concat(prefixUrl.selectPrefix, "/employee/v2"),
4155
- filter: 'qp-name,employeeNumber-orGroup,like',
4280
+ filter: 'qp-employeeNumber,name-orGroup,like',
4156
4281
  mappingTextField: 'name',
4157
4282
  mappingTextShowKeyField: 'employeeNumber',
4158
4283
  mappingValueField: 'employeeNumber',
@@ -4161,7 +4286,7 @@ function commonFun(type, prefixUrl) {
4161
4286
  sorter: 'desc-id'
4162
4287
  },
4163
4288
  sourceName: 'employeeNumber'
4164
- };
4289
+ }, requestConfigProp);
4165
4290
  tableSearchForm = [{
4166
4291
  name: 'qp-name-like',
4167
4292
  label: '员工名称'
@@ -4201,7 +4326,7 @@ function commonFun(type, prefixUrl) {
4201
4326
  })]).then(function (x) {
4202
4327
  formatSource(x, 0, 2, tableSearchForm);
4203
4328
  });
4204
- modalTableProps = {
4329
+ modalTableProps = _objectSpread2({
4205
4330
  modalTableTitle: '选择员工',
4206
4331
  tableSearchForm: tableSearchForm,
4207
4332
  tableColumns: [{
@@ -4220,12 +4345,12 @@ function commonFun(type, prefixUrl) {
4220
4345
  title: '手机号',
4221
4346
  dataIndex: 'officeTelephone'
4222
4347
  }]
4223
- };
4348
+ }, modalTableBusProps);
4224
4349
  } // 配送方式选择器
4225
4350
 
4226
4351
 
4227
4352
  if (type === 'deliveryMode') {
4228
- requestConfig = {
4353
+ requestConfig = _objectSpread2({
4229
4354
  url: "".concat(prefixUrl.selectPrefix, "/deliveryMode"),
4230
4355
  filter: 'qp-name,code-orGroup,like',
4231
4356
  mappingTextField: 'name',
@@ -4235,7 +4360,7 @@ function commonFun(type, prefixUrl) {
4235
4360
  sorter: 'desc-id'
4236
4361
  },
4237
4362
  sourceName: 'deliveryModeCode'
4238
- };
4363
+ }, requestConfigProp);
4239
4364
  tableSearchForm = [{
4240
4365
  name: 'qp-name-like',
4241
4366
  label: '配送方式名称'
@@ -4304,7 +4429,7 @@ function commonFun(type, prefixUrl) {
4304
4429
  formatSource(x, 0, 2, tableSearchForm);
4305
4430
  formatSource(x, 1, 5, tableSearchForm);
4306
4431
  });
4307
- modalTableProps = {
4432
+ modalTableProps = _objectSpread2({
4308
4433
  modalTableTitle: '选择配送方式',
4309
4434
  tableSearchForm: tableSearchForm,
4310
4435
  tableColumns: [{
@@ -4339,7 +4464,7 @@ function commonFun(type, prefixUrl) {
4339
4464
  dataIndex: 'remark',
4340
4465
  title: '备注'
4341
4466
  }]
4342
- };
4467
+ }, modalTableBusProps);
4343
4468
  }
4344
4469
 
4345
4470
  return {
@@ -4358,23 +4483,30 @@ var BusinessSearchSelect = function BusinessSearchSelect(props) {
4358
4483
  formSelectFix: '/bop/api'
4359
4484
  };
4360
4485
 
4361
- var _commonFun = commonFun(businessType, prefixUrl),
4486
+ var _commonFun = commonFun(businessType, prefixUrl, (props === null || props === void 0 ? void 0 : props.requestConfig) || {}, (props === null || props === void 0 ? void 0 : props.modalTableProps) || {}),
4362
4487
  requestConfig = _commonFun.requestConfig,
4363
4488
  modalTableProps = _commonFun.modalTableProps,
4364
4489
  needModalTable = _commonFun.needModalTable;
4365
4490
 
4366
4491
  var currentProps = useMemo(function () {
4367
- return _objectSpread2(_objectSpread2({
4368
- requestConfig: requestConfig
4369
- }, props), {}, {
4492
+ return _objectSpread2(_objectSpread2({}, props), {}, {
4493
+ requestConfig: requestConfig,
4370
4494
  needModalTable: needModalTable,
4371
4495
  modalTableProps: modalTableProps
4372
4496
  });
4373
- }, []);
4497
+ }, [props === null || props === void 0 ? void 0 : props.value]);
4374
4498
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(MemoSearchSelect, _objectSpread2({}, currentProps)));
4375
4499
  };
4376
4500
 
4377
- var index = /*#__PURE__*/React.memo(BusinessSearchSelect, function () {
4501
+ var BusinessSearchSelect$1 = /*#__PURE__*/React.memo(BusinessSearchSelect, function (props, nextProps) {
4502
+ if (props && props.labelInValue && props.value && JSON.stringify(props.value) !== JSON.stringify(nextProps.value)) {
4503
+ return false;
4504
+ }
4505
+
4506
+ if (props && props.value !== nextProps.value) {
4507
+ return false;
4508
+ }
4509
+
4378
4510
  return true;
4379
4511
  });
4380
4512
 
@@ -4463,7 +4595,7 @@ var CommodityEntry = function CommodityEntry(props) {
4463
4595
  * @LastEditTime: 2022-01-14 17:17:26
4464
4596
  * @LastEditors: rodchen
4465
4597
  */
4466
- var index$1 = (function (storageKeyString) {
4598
+ var index = (function (storageKeyString) {
4467
4599
  var seconds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
4468
4600
  var tipsCallFunction = arguments.length > 2 ? arguments[2] : undefined;
4469
4601
  if (typeof seconds !== 'number') throw new Error('seconds should be number');
@@ -4523,4 +4655,4 @@ function getStorageVale(storageKeyString) {
4523
4655
  var resposne = JSON.parse(localStorage.getItem('userInfo') || '{}');
4524
4656
  axios.defaults.headers.common['sso-sessionid'] = (resposne === null || resposne === void 0 ? void 0 : resposne.sessionId) || '';
4525
4657
 
4526
- export { index as BusinessSearchSelect, index$1 as CheckOneUser, CommodityEntry, DataValidation, QueryMutipleInput, SearchSelect };
4658
+ export { BusinessSearchSelect$1 as BusinessSearchSelect, index as CheckOneUser, CommodityEntry, DataValidation, QueryMutipleInput, SearchSelect };