@bit-sun/business-component 1.1.26 → 1.1.27
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/components/Business/SearchSelect/BusinessUtils.d.ts +3 -21
- package/dist/index.esm.js +122 -108
- package/dist/index.js +122 -108
- package/package.json +1 -1
- package/src/components/Business/SearchSelect/BusinessUtils.ts +31 -10
- package/src/components/Business/SearchSelect/index.md +4 -7
- package/src/components/Business/SearchSelect/index.tsx +13 -5
- package/src/components/Functional/SearchSelect/index.tsx +69 -66
|
@@ -1,23 +1,5 @@
|
|
|
1
|
-
export declare function commonFun(type?: string, prefixUrl: any): {
|
|
2
|
-
modalTableProps:
|
|
3
|
-
|
|
4
|
-
tableSearchForm: any[];
|
|
5
|
-
tableColumns: ({
|
|
6
|
-
title: string;
|
|
7
|
-
dataIndex: string;
|
|
8
|
-
render?: undefined;
|
|
9
|
-
} | {
|
|
10
|
-
title: string;
|
|
11
|
-
dataIndex: string;
|
|
12
|
-
render: (text: number) => any;
|
|
13
|
-
})[];
|
|
14
|
-
};
|
|
15
|
-
requestConfig: {
|
|
16
|
-
url: string;
|
|
17
|
-
filter: string;
|
|
18
|
-
otherParams: {
|
|
19
|
-
sorter: string;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
1
|
+
export declare function commonFun(type?: string, prefixUrl: any, requestConfigProp?: any, modalTableBusProps?: any): {
|
|
2
|
+
modalTableProps: any;
|
|
3
|
+
requestConfig: any;
|
|
22
4
|
needModalTable: boolean;
|
|
23
5
|
};
|
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 = "(?:"
|
|
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|\\(]+("
|
|
874
|
-
var PERMISSIVE_MATCH4 = "[\\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 =
|
|
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
|
|
1317
|
+
newNode.setAttribute(getMark(option), key);
|
|
1301
1318
|
return newNode;
|
|
1302
1319
|
}
|
|
1303
1320
|
|
|
@@ -2789,18 +2806,21 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
2789
2806
|
}
|
|
2790
2807
|
};
|
|
2791
2808
|
|
|
2792
|
-
var
|
|
2793
|
-
if (
|
|
2809
|
+
var handleSelectOver = function handleSelectOver(selectedValue) {
|
|
2810
|
+
if (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.length) {
|
|
2794
2811
|
var _ctx$form2;
|
|
2795
2812
|
|
|
2796
|
-
formaData(
|
|
2813
|
+
formaData(selectedValue); // 解决选择最后1页的sku,返回后,不显示名称问题
|
|
2797
2814
|
|
|
2798
|
-
var source = _.uniqBy(items.concat(
|
|
2815
|
+
var source = _.uniqBy(items.concat(selectedValue), 'value');
|
|
2799
2816
|
|
|
2800
2817
|
ctx === null || ctx === void 0 ? void 0 : (_ctx$form2 = ctx.form) === null || _ctx$form2 === void 0 ? void 0 : _ctx$form2.setFieldSource(resultSourceKey, source);
|
|
2801
2818
|
setItems(source);
|
|
2802
2819
|
}
|
|
2820
|
+
};
|
|
2803
2821
|
|
|
2822
|
+
var handleOk = function handleOk() {
|
|
2823
|
+
handleSelectOver(popvalue);
|
|
2804
2824
|
handleCancel();
|
|
2805
2825
|
};
|
|
2806
2826
|
|
|
@@ -2947,7 +2967,9 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
2947
2967
|
filterRows = selectRows;
|
|
2948
2968
|
sksResult = selectRows.map(function (i) {
|
|
2949
2969
|
return i.value;
|
|
2950
|
-
});
|
|
2970
|
+
}); // 单选直接选中 不需要确定
|
|
2971
|
+
|
|
2972
|
+
handleSelectOver(filterRows);
|
|
2951
2973
|
}
|
|
2952
2974
|
|
|
2953
2975
|
setSelectedRowKeys(sksResult);
|
|
@@ -3044,23 +3066,19 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3044
3066
|
}
|
|
3045
3067
|
};
|
|
3046
3068
|
|
|
3047
|
-
var
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
var newValue = JSON.parse(JSON.stringify(value)).filter(function (i) {
|
|
3058
|
-
return i !== item.value;
|
|
3059
|
-
});
|
|
3060
|
-
onChange(newValue);
|
|
3061
|
-
};
|
|
3069
|
+
var maxTagPlaceholder = function maxTagPlaceholder(selectedValues) {
|
|
3070
|
+
var _onClose = function onClose(e, item) {
|
|
3071
|
+
e.preventDefault();
|
|
3072
|
+
var newValue = labelInValue ? JSON.parse(JSON.stringify(value)).filter(function (i) {
|
|
3073
|
+
return i.value !== item.value;
|
|
3074
|
+
}) : JSON.parse(JSON.stringify(value)).filter(function (i) {
|
|
3075
|
+
return i !== item.value;
|
|
3076
|
+
});
|
|
3077
|
+
onChange(newValue);
|
|
3078
|
+
};
|
|
3062
3079
|
|
|
3063
|
-
|
|
3080
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
3081
|
+
title: selectedValues.map(function (i) {
|
|
3064
3082
|
return /*#__PURE__*/React.createElement(Tag, {
|
|
3065
3083
|
closable: true,
|
|
3066
3084
|
onClose: function onClose(e) {
|
|
@@ -3072,13 +3090,9 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3072
3090
|
height: '24px',
|
|
3073
3091
|
border: '1px solid #f0f0f0'
|
|
3074
3092
|
}
|
|
3075
|
-
}, i.
|
|
3076
|
-
})
|
|
3077
|
-
}
|
|
3078
|
-
setTooltipVisible(false);
|
|
3079
|
-
}
|
|
3080
|
-
|
|
3081
|
-
return '';
|
|
3093
|
+
}, i.label);
|
|
3094
|
+
})
|
|
3095
|
+
}, "+ ".concat(selectedValues === null || selectedValues === void 0 ? void 0 : selectedValues.length));
|
|
3082
3096
|
};
|
|
3083
3097
|
|
|
3084
3098
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -3086,15 +3100,6 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3086
3100
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3087
3101
|
className: "search_select_show",
|
|
3088
3102
|
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
3103
|
}, /*#__PURE__*/React.createElement(Select, _objectSpread2(_objectSpread2({
|
|
3099
3104
|
virtual: true,
|
|
3100
3105
|
labelInValue: labelInValue,
|
|
@@ -3141,7 +3146,8 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3141
3146
|
style: {
|
|
3142
3147
|
width: needModalTable ? 'calc(100% - 30px)' : 'calc(100%)'
|
|
3143
3148
|
},
|
|
3144
|
-
placeholder: "\u8BF7\u9009\u62E9"
|
|
3149
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
3150
|
+
maxTagPlaceholder: maxTagPlaceholder
|
|
3145
3151
|
}, currentSelectProps), {}, {
|
|
3146
3152
|
getPopupContainer: function getPopupContainer() {
|
|
3147
3153
|
return document.getElementById("search_select_div_".concat(uniqueValue));
|
|
@@ -3154,7 +3160,7 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3154
3160
|
text: "".concat(item.textShowKey, " ").concat(item.text),
|
|
3155
3161
|
filterTxt: searchValue
|
|
3156
3162
|
}));
|
|
3157
|
-
}))
|
|
3163
|
+
})), needModalTable && /*#__PURE__*/React.createElement(Button, {
|
|
3158
3164
|
style: {
|
|
3159
3165
|
width: '30px',
|
|
3160
3166
|
padding: '2px',
|
|
@@ -3168,7 +3174,7 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3168
3174
|
visible: isModalVisible,
|
|
3169
3175
|
onOk: handleOk,
|
|
3170
3176
|
onCancel: handleCancel,
|
|
3171
|
-
footer: [/*#__PURE__*/React.createElement(Button, {
|
|
3177
|
+
footer: selectMode ? [/*#__PURE__*/React.createElement(Button, {
|
|
3172
3178
|
key: "back",
|
|
3173
3179
|
onClick: handleCancel
|
|
3174
3180
|
}, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
|
|
@@ -3176,7 +3182,7 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3176
3182
|
type: "primary",
|
|
3177
3183
|
onClick: handleOk,
|
|
3178
3184
|
disabled: !tableData.length || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
|
|
3179
|
-
}, "\u786E\u5B9A")]
|
|
3185
|
+
}, "\u786E\u5B9A")] : null
|
|
3180
3186
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3181
3187
|
className: 'search_select_wrapper'
|
|
3182
3188
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -3342,16 +3348,15 @@ var loadSelectSource = function loadSelectSource(url, params) {
|
|
|
3342
3348
|
var _getDictionarySource;
|
|
3343
3349
|
var hasDictSharingType = (_getDictionarySource = getDictionarySource('UC000013')) === null || _getDictionarySource === void 0 ? void 0 : _getDictionarySource.length;
|
|
3344
3350
|
var sharingTypeDataList = hasDictSharingType && getDictionarySource('UC000013') || sharingType;
|
|
3345
|
-
function commonFun(type, prefixUrl) {
|
|
3351
|
+
function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
3346
3352
|
// 默认type === 'supplier' 供应商选择器
|
|
3347
|
-
var requestConfig = {
|
|
3353
|
+
var requestConfig = _objectSpread2({
|
|
3348
3354
|
url: "".concat(prefixUrl.selectPrefix, "/supplier"),
|
|
3349
3355
|
filter: 'qp-name,code-orGroup,like',
|
|
3350
3356
|
otherParams: {
|
|
3351
3357
|
sorter: 'desc-id'
|
|
3352
|
-
}
|
|
3353
|
-
|
|
3354
|
-
};
|
|
3358
|
+
}
|
|
3359
|
+
}, requestConfigProp);
|
|
3355
3360
|
/*
|
|
3356
3361
|
* 处理 格式化下拉框数据源
|
|
3357
3362
|
* reData 必传 promise返回响应的数据 格式为[{},{},{},...] Promise.all第一个参数数组有多少个数组长度就是多少,其中每个对象为每次请求的结果数据
|
|
@@ -3361,6 +3366,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3361
3366
|
* changeSearchForm 必传 为搜索表单Form数据
|
|
3362
3367
|
* */
|
|
3363
3368
|
|
|
3369
|
+
|
|
3364
3370
|
var formatSource = function formatSource(reData, position, changePosition, changeSearchForm) {
|
|
3365
3371
|
var _reData$position;
|
|
3366
3372
|
|
|
@@ -3495,7 +3501,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3495
3501
|
});
|
|
3496
3502
|
}
|
|
3497
3503
|
|
|
3498
|
-
var modalTableProps = {
|
|
3504
|
+
var modalTableProps = _objectSpread2({
|
|
3499
3505
|
modalTableTitle: '选择供应商',
|
|
3500
3506
|
tableSearchForm: tableSearchForm,
|
|
3501
3507
|
tableColumns: [{
|
|
@@ -3524,11 +3530,12 @@ function commonFun(type, prefixUrl) {
|
|
|
3524
3530
|
})) === null || _sharingType$find === void 0 ? void 0 : _sharingType$find.text;
|
|
3525
3531
|
}
|
|
3526
3532
|
}]
|
|
3527
|
-
};
|
|
3533
|
+
}, modalTableBusProps);
|
|
3534
|
+
|
|
3528
3535
|
var needModalTable = true; // 商品选择器
|
|
3529
3536
|
|
|
3530
3537
|
if (type === 'skuCommodity') {
|
|
3531
|
-
requestConfig = {
|
|
3538
|
+
requestConfig = _objectSpread2({
|
|
3532
3539
|
url: "".concat(prefixUrl.selectPrefix, "/sku"),
|
|
3533
3540
|
filter: 'qp-name,skuCode-orGroup,like',
|
|
3534
3541
|
mappingTextField: 'name',
|
|
@@ -3538,7 +3545,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3538
3545
|
sorter: 'desc-id'
|
|
3539
3546
|
},
|
|
3540
3547
|
sourceName: 'skuCode'
|
|
3541
|
-
};
|
|
3548
|
+
}, requestConfigProp);
|
|
3542
3549
|
tableSearchForm = [{
|
|
3543
3550
|
name: 'qp-name-like',
|
|
3544
3551
|
label: 'SKU名称'
|
|
@@ -3633,7 +3640,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3633
3640
|
formatTreeDataSource(x, 1, 6, tableSearchForm);
|
|
3634
3641
|
formatSource(x, 2, 7, tableSearchForm, ['id', 'name']);
|
|
3635
3642
|
});
|
|
3636
|
-
modalTableProps = {
|
|
3643
|
+
modalTableProps = _objectSpread2({
|
|
3637
3644
|
modalTableTitle: '选择SKU',
|
|
3638
3645
|
tableSearchForm: tableSearchForm,
|
|
3639
3646
|
tableColumns: [{
|
|
@@ -3661,12 +3668,12 @@ function commonFun(type, prefixUrl) {
|
|
|
3661
3668
|
title: '条形码',
|
|
3662
3669
|
dataIndex: 'barCode'
|
|
3663
3670
|
}]
|
|
3664
|
-
};
|
|
3671
|
+
}, modalTableBusProps);
|
|
3665
3672
|
} // 仓库选择器(物理、逻辑仓)
|
|
3666
3673
|
|
|
3667
3674
|
|
|
3668
3675
|
if (type === 'physicalWarehouse') {
|
|
3669
|
-
requestConfig = {
|
|
3676
|
+
requestConfig = _objectSpread2({
|
|
3670
3677
|
url: "".concat(prefixUrl.selectPrefix, "/physicalWarehouse"),
|
|
3671
3678
|
filter: 'qp-physicalWarehouseName,physicalWarehouseCode-orGroup,like',
|
|
3672
3679
|
mappingTextField: 'physicalWarehouseName',
|
|
@@ -3677,7 +3684,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3677
3684
|
sorter: 'desc-id'
|
|
3678
3685
|
},
|
|
3679
3686
|
sourceName: 'warehouseIds'
|
|
3680
|
-
};
|
|
3687
|
+
}, requestConfigProp);
|
|
3681
3688
|
tableSearchForm = [{
|
|
3682
3689
|
name: 'qp-physicalWarehouseName-like',
|
|
3683
3690
|
label: '物理仓名称'
|
|
@@ -3716,7 +3723,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3716
3723
|
})]).then(function (x) {
|
|
3717
3724
|
formatSource(x, 0, 3, tableSearchForm);
|
|
3718
3725
|
});
|
|
3719
|
-
modalTableProps = {
|
|
3726
|
+
modalTableProps = _objectSpread2({
|
|
3720
3727
|
modalTableTitle: '选择物理仓',
|
|
3721
3728
|
tableSearchForm: tableSearchForm,
|
|
3722
3729
|
tableColumns: [{
|
|
@@ -3735,11 +3742,11 @@ function commonFun(type, prefixUrl) {
|
|
|
3735
3742
|
title: '所属公司',
|
|
3736
3743
|
dataIndex: 'companyName'
|
|
3737
3744
|
}]
|
|
3738
|
-
};
|
|
3745
|
+
}, modalTableBusProps);
|
|
3739
3746
|
}
|
|
3740
3747
|
|
|
3741
3748
|
if (type === 'realWarehouse') {
|
|
3742
|
-
requestConfig = {
|
|
3749
|
+
requestConfig = _objectSpread2({
|
|
3743
3750
|
url: "".concat(prefixUrl.selectPrefix, "/realWarehouse"),
|
|
3744
3751
|
filter: 'qp-realWarehouseName,realWarehouseCode-orGroup,like',
|
|
3745
3752
|
mappingTextField: 'realWarehouseName',
|
|
@@ -3750,7 +3757,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3750
3757
|
sorter: 'desc-id'
|
|
3751
3758
|
},
|
|
3752
3759
|
sourceName: 'warehouseIds'
|
|
3753
|
-
};
|
|
3760
|
+
}, requestConfigProp);
|
|
3754
3761
|
tableSearchForm = [{
|
|
3755
3762
|
name: 'qp-realWarehouseName-like',
|
|
3756
3763
|
label: '逻辑仓名称'
|
|
@@ -3763,7 +3770,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3763
3770
|
label: '逻辑仓类型',
|
|
3764
3771
|
initialSource: getDictionarySource('SC00004')
|
|
3765
3772
|
}];
|
|
3766
|
-
modalTableProps = {
|
|
3773
|
+
modalTableProps = _objectSpread2({
|
|
3767
3774
|
modalTableTitle: '选择逻辑仓',
|
|
3768
3775
|
tableSearchForm: tableSearchForm,
|
|
3769
3776
|
tableColumns: [{
|
|
@@ -3779,12 +3786,12 @@ function commonFun(type, prefixUrl) {
|
|
|
3779
3786
|
return getDictionaryTextByValue('SC00004', text);
|
|
3780
3787
|
}
|
|
3781
3788
|
}]
|
|
3782
|
-
};
|
|
3789
|
+
}, modalTableBusProps);
|
|
3783
3790
|
} // 仓库选择器(虚拟、渠道仓)(无弹窗)
|
|
3784
3791
|
|
|
3785
3792
|
|
|
3786
3793
|
if (type === 'virtualWarehouse') {
|
|
3787
|
-
requestConfig = {
|
|
3794
|
+
requestConfig = _objectSpread2({
|
|
3788
3795
|
url: "".concat(prefixUrl.selectPrefix, "/virtualWarehouse"),
|
|
3789
3796
|
filter: 'qp-virtualWarehouseName,virtualWarehouseCode-orGroup,like',
|
|
3790
3797
|
mappingTextField: 'virtualWarehouseName',
|
|
@@ -3795,12 +3802,12 @@ function commonFun(type, prefixUrl) {
|
|
|
3795
3802
|
sorter: 'desc-id'
|
|
3796
3803
|
},
|
|
3797
3804
|
sourceName: 'warehouseIds'
|
|
3798
|
-
};
|
|
3805
|
+
}, requestConfigProp);
|
|
3799
3806
|
needModalTable = false;
|
|
3800
3807
|
}
|
|
3801
3808
|
|
|
3802
3809
|
if (type === 'channelWarehouse') {
|
|
3803
|
-
requestConfig = {
|
|
3810
|
+
requestConfig = _objectSpread2({
|
|
3804
3811
|
url: "".concat(prefixUrl.selectPrefix, "/channelWarehouse"),
|
|
3805
3812
|
filter: 'qp-channelWarehouseName,channelWarehouseCode-orGroup,like',
|
|
3806
3813
|
mappingTextField: 'channelWarehouseName',
|
|
@@ -3811,13 +3818,13 @@ function commonFun(type, prefixUrl) {
|
|
|
3811
3818
|
sorter: 'desc-id'
|
|
3812
3819
|
},
|
|
3813
3820
|
sourceName: 'warehouseIds'
|
|
3814
|
-
};
|
|
3821
|
+
}, requestConfigProp);
|
|
3815
3822
|
needModalTable = false;
|
|
3816
3823
|
} // 客户选择器
|
|
3817
3824
|
|
|
3818
3825
|
|
|
3819
3826
|
if (type === 'customer') {
|
|
3820
|
-
requestConfig = {
|
|
3827
|
+
requestConfig = _objectSpread2({
|
|
3821
3828
|
url: "".concat(prefixUrl.selectPrefix, "/uc/customer/v2"),
|
|
3822
3829
|
filter: 'qp-name,code-orGroup,like',
|
|
3823
3830
|
mappingTextField: 'name',
|
|
@@ -3826,7 +3833,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3826
3833
|
sorter: 'desc-id'
|
|
3827
3834
|
},
|
|
3828
3835
|
sourceName: 'customCode'
|
|
3829
|
-
};
|
|
3836
|
+
}, requestConfigProp);
|
|
3830
3837
|
tableSearchForm = [{
|
|
3831
3838
|
name: 'qp-name-like',
|
|
3832
3839
|
label: '客户名称'
|
|
@@ -3912,7 +3919,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3912
3919
|
formatSource(x, 1, 3, tableSearchForm);
|
|
3913
3920
|
formatSource(x, 2, 4, tableSearchForm);
|
|
3914
3921
|
});
|
|
3915
|
-
modalTableProps = {
|
|
3922
|
+
modalTableProps = _objectSpread2({
|
|
3916
3923
|
modalTableTitle: '选择客户',
|
|
3917
3924
|
tableSearchForm: tableSearchForm,
|
|
3918
3925
|
tableColumns: [{
|
|
@@ -3941,12 +3948,12 @@ function commonFun(type, prefixUrl) {
|
|
|
3941
3948
|
})) === null || _sharingType$find2 === void 0 ? void 0 : _sharingType$find2.text;
|
|
3942
3949
|
}
|
|
3943
3950
|
}]
|
|
3944
|
-
};
|
|
3951
|
+
}, modalTableBusProps);
|
|
3945
3952
|
} // 店铺选择器
|
|
3946
3953
|
|
|
3947
3954
|
|
|
3948
3955
|
if (type === 'shopFile') {
|
|
3949
|
-
requestConfig = {
|
|
3956
|
+
requestConfig = _objectSpread2({
|
|
3950
3957
|
url: "".concat(prefixUrl.selectPrefix, "/store"),
|
|
3951
3958
|
filter: 'qp-name,code-orGroup,like',
|
|
3952
3959
|
mappingTextField: 'name',
|
|
@@ -3955,7 +3962,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3955
3962
|
sorter: 'desc-id'
|
|
3956
3963
|
},
|
|
3957
3964
|
sourceName: 'code'
|
|
3958
|
-
};
|
|
3965
|
+
}, requestConfigProp);
|
|
3959
3966
|
tableSearchForm = [{
|
|
3960
3967
|
name: 'qp-name-like',
|
|
3961
3968
|
label: '店铺名称'
|
|
@@ -4065,7 +4072,7 @@ function commonFun(type, prefixUrl) {
|
|
|
4065
4072
|
formatSource(x, 2, 5, tableSearchForm);
|
|
4066
4073
|
formatSource(x, 3, 6, tableSearchForm);
|
|
4067
4074
|
});
|
|
4068
|
-
modalTableProps = {
|
|
4075
|
+
modalTableProps = _objectSpread2({
|
|
4069
4076
|
modalTableTitle: '选择店铺',
|
|
4070
4077
|
tableSearchForm: tableSearchForm,
|
|
4071
4078
|
tableColumns: [{
|
|
@@ -4097,12 +4104,12 @@ function commonFun(type, prefixUrl) {
|
|
|
4097
4104
|
title: '归属核算主体',
|
|
4098
4105
|
dataIndex: 'accountingName'
|
|
4099
4106
|
}]
|
|
4100
|
-
};
|
|
4107
|
+
}, modalTableBusProps);
|
|
4101
4108
|
} // 核算主体选择器(无弹窗)
|
|
4102
4109
|
|
|
4103
4110
|
|
|
4104
4111
|
if (type === 'accountingSubject') {
|
|
4105
|
-
requestConfig = {
|
|
4112
|
+
requestConfig = _objectSpread2({
|
|
4106
4113
|
url: "".concat(prefixUrl.selectPrefix, "/accountingSubject"),
|
|
4107
4114
|
filter: 'qp-name,code-orGroup,like',
|
|
4108
4115
|
mappingTextField: 'name',
|
|
@@ -4112,13 +4119,13 @@ function commonFun(type, prefixUrl) {
|
|
|
4112
4119
|
sorter: 'desc-id'
|
|
4113
4120
|
},
|
|
4114
4121
|
sourceName: 'accountingSubjectCode'
|
|
4115
|
-
};
|
|
4122
|
+
}, requestConfigProp);
|
|
4116
4123
|
needModalTable = false;
|
|
4117
4124
|
} // 库存组织选择器(无弹窗)
|
|
4118
4125
|
|
|
4119
4126
|
|
|
4120
4127
|
if (type === 'inventoryOrg') {
|
|
4121
|
-
requestConfig = {
|
|
4128
|
+
requestConfig = _objectSpread2({
|
|
4122
4129
|
url: "".concat(prefixUrl.selectPrefix, "/inventoryOrg"),
|
|
4123
4130
|
filter: 'qp-name,code-orGroup,like',
|
|
4124
4131
|
mappingTextField: 'name',
|
|
@@ -4128,13 +4135,13 @@ function commonFun(type, prefixUrl) {
|
|
|
4128
4135
|
sorter: 'desc-id'
|
|
4129
4136
|
},
|
|
4130
4137
|
sourceName: 'inventoryOrgCode'
|
|
4131
|
-
};
|
|
4138
|
+
}, requestConfigProp);
|
|
4132
4139
|
needModalTable = false;
|
|
4133
4140
|
} // 法人公司选择器(无弹窗)
|
|
4134
4141
|
|
|
4135
4142
|
|
|
4136
4143
|
if (type === 'corporationCompany') {
|
|
4137
|
-
requestConfig = {
|
|
4144
|
+
requestConfig = _objectSpread2({
|
|
4138
4145
|
url: "".concat(prefixUrl.selectPrefix, "/company"),
|
|
4139
4146
|
filter: 'qp-name,code-orGroup,like',
|
|
4140
4147
|
mappingTextField: 'name',
|
|
@@ -4144,15 +4151,15 @@ function commonFun(type, prefixUrl) {
|
|
|
4144
4151
|
sorter: 'desc-id'
|
|
4145
4152
|
},
|
|
4146
4153
|
sourceName: 'corporationCompany'
|
|
4147
|
-
};
|
|
4154
|
+
}, requestConfigProp);
|
|
4148
4155
|
needModalTable = false;
|
|
4149
4156
|
} // 员工选择器
|
|
4150
4157
|
|
|
4151
4158
|
|
|
4152
4159
|
if (type === 'employee') {
|
|
4153
|
-
requestConfig = {
|
|
4160
|
+
requestConfig = _objectSpread2({
|
|
4154
4161
|
url: "".concat(prefixUrl.selectPrefix, "/employee/v2"),
|
|
4155
|
-
filter: 'qp-name
|
|
4162
|
+
filter: 'qp-employeeNumber,name-orGroup,like',
|
|
4156
4163
|
mappingTextField: 'name',
|
|
4157
4164
|
mappingTextShowKeyField: 'employeeNumber',
|
|
4158
4165
|
mappingValueField: 'employeeNumber',
|
|
@@ -4161,7 +4168,7 @@ function commonFun(type, prefixUrl) {
|
|
|
4161
4168
|
sorter: 'desc-id'
|
|
4162
4169
|
},
|
|
4163
4170
|
sourceName: 'employeeNumber'
|
|
4164
|
-
};
|
|
4171
|
+
}, requestConfigProp);
|
|
4165
4172
|
tableSearchForm = [{
|
|
4166
4173
|
name: 'qp-name-like',
|
|
4167
4174
|
label: '员工名称'
|
|
@@ -4201,7 +4208,7 @@ function commonFun(type, prefixUrl) {
|
|
|
4201
4208
|
})]).then(function (x) {
|
|
4202
4209
|
formatSource(x, 0, 2, tableSearchForm);
|
|
4203
4210
|
});
|
|
4204
|
-
modalTableProps = {
|
|
4211
|
+
modalTableProps = _objectSpread2({
|
|
4205
4212
|
modalTableTitle: '选择员工',
|
|
4206
4213
|
tableSearchForm: tableSearchForm,
|
|
4207
4214
|
tableColumns: [{
|
|
@@ -4220,12 +4227,12 @@ function commonFun(type, prefixUrl) {
|
|
|
4220
4227
|
title: '手机号',
|
|
4221
4228
|
dataIndex: 'officeTelephone'
|
|
4222
4229
|
}]
|
|
4223
|
-
};
|
|
4230
|
+
}, modalTableBusProps);
|
|
4224
4231
|
} // 配送方式选择器
|
|
4225
4232
|
|
|
4226
4233
|
|
|
4227
4234
|
if (type === 'deliveryMode') {
|
|
4228
|
-
requestConfig = {
|
|
4235
|
+
requestConfig = _objectSpread2({
|
|
4229
4236
|
url: "".concat(prefixUrl.selectPrefix, "/deliveryMode"),
|
|
4230
4237
|
filter: 'qp-name,code-orGroup,like',
|
|
4231
4238
|
mappingTextField: 'name',
|
|
@@ -4235,7 +4242,7 @@ function commonFun(type, prefixUrl) {
|
|
|
4235
4242
|
sorter: 'desc-id'
|
|
4236
4243
|
},
|
|
4237
4244
|
sourceName: 'deliveryModeCode'
|
|
4238
|
-
};
|
|
4245
|
+
}, requestConfigProp);
|
|
4239
4246
|
tableSearchForm = [{
|
|
4240
4247
|
name: 'qp-name-like',
|
|
4241
4248
|
label: '配送方式名称'
|
|
@@ -4304,7 +4311,7 @@ function commonFun(type, prefixUrl) {
|
|
|
4304
4311
|
formatSource(x, 0, 2, tableSearchForm);
|
|
4305
4312
|
formatSource(x, 1, 5, tableSearchForm);
|
|
4306
4313
|
});
|
|
4307
|
-
modalTableProps = {
|
|
4314
|
+
modalTableProps = _objectSpread2({
|
|
4308
4315
|
modalTableTitle: '选择配送方式',
|
|
4309
4316
|
tableSearchForm: tableSearchForm,
|
|
4310
4317
|
tableColumns: [{
|
|
@@ -4339,7 +4346,7 @@ function commonFun(type, prefixUrl) {
|
|
|
4339
4346
|
dataIndex: 'remark',
|
|
4340
4347
|
title: '备注'
|
|
4341
4348
|
}]
|
|
4342
|
-
};
|
|
4349
|
+
}, modalTableBusProps);
|
|
4343
4350
|
}
|
|
4344
4351
|
|
|
4345
4352
|
return {
|
|
@@ -4358,23 +4365,30 @@ var BusinessSearchSelect = function BusinessSearchSelect(props) {
|
|
|
4358
4365
|
formSelectFix: '/bop/api'
|
|
4359
4366
|
};
|
|
4360
4367
|
|
|
4361
|
-
var _commonFun = commonFun(businessType, prefixUrl),
|
|
4368
|
+
var _commonFun = commonFun(businessType, prefixUrl, (props === null || props === void 0 ? void 0 : props.requestConfig) || {}, (props === null || props === void 0 ? void 0 : props.modalTableProps) || {}),
|
|
4362
4369
|
requestConfig = _commonFun.requestConfig,
|
|
4363
4370
|
modalTableProps = _commonFun.modalTableProps,
|
|
4364
4371
|
needModalTable = _commonFun.needModalTable;
|
|
4365
4372
|
|
|
4366
4373
|
var currentProps = useMemo(function () {
|
|
4367
|
-
return _objectSpread2(_objectSpread2({
|
|
4368
|
-
requestConfig: requestConfig
|
|
4369
|
-
}, props), {}, {
|
|
4374
|
+
return _objectSpread2(_objectSpread2({}, props), {}, {
|
|
4375
|
+
requestConfig: requestConfig,
|
|
4370
4376
|
needModalTable: needModalTable,
|
|
4371
4377
|
modalTableProps: modalTableProps
|
|
4372
4378
|
});
|
|
4373
|
-
}, []);
|
|
4379
|
+
}, [props === null || props === void 0 ? void 0 : props.value]);
|
|
4374
4380
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(MemoSearchSelect, _objectSpread2({}, currentProps)));
|
|
4375
4381
|
};
|
|
4376
4382
|
|
|
4377
|
-
var index = /*#__PURE__*/React.memo(BusinessSearchSelect, function () {
|
|
4383
|
+
var index = /*#__PURE__*/React.memo(BusinessSearchSelect, function (props, nextProps) {
|
|
4384
|
+
if (props && props.labelInValue && props.value && JSON.stringify(props.value) !== JSON.stringify(nextProps.value)) {
|
|
4385
|
+
return false;
|
|
4386
|
+
}
|
|
4387
|
+
|
|
4388
|
+
if (props && props.value !== nextProps.value) {
|
|
4389
|
+
return false;
|
|
4390
|
+
}
|
|
4391
|
+
|
|
4378
4392
|
return true;
|
|
4379
4393
|
});
|
|
4380
4394
|
|