@bit-sun/business-component 1.1.25 → 1.1.28
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/components/Business/SearchSelect/index.d.ts +3 -2
- package/dist/index.esm.js +137 -120
- package/dist/index.js +137 -120
- 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 +28 -11
- package/src/components/Functional/SearchSelect/index.tsx +70 -66
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import React, { createContext, useContext, useEffect, forwardRef, createElement, useState, useRef } from 'react';
|
|
2
|
+
import React, { createContext, useContext, useEffect, forwardRef, createElement, useState, useMemo, useRef } from 'react';
|
|
3
3
|
import { message, Menu, Space, Dropdown, Tooltip, Button, Checkbox, Input, Modal, Select, Form, Divider, Spin, Table, TreeSelect, Tag } from 'antd';
|
|
4
4
|
import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
|
|
5
5
|
import classNames from 'classnames';
|
|
@@ -294,9 +294,10 @@ function ownKeys$1(object, enumerableOnly) {
|
|
|
294
294
|
|
|
295
295
|
if (Object.getOwnPropertySymbols) {
|
|
296
296
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
297
|
-
enumerableOnly
|
|
297
|
+
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
|
298
298
|
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
299
|
-
})
|
|
299
|
+
});
|
|
300
|
+
keys.push.apply(keys, symbols);
|
|
300
301
|
}
|
|
301
302
|
|
|
302
303
|
return keys;
|
|
@@ -304,12 +305,19 @@ function ownKeys$1(object, enumerableOnly) {
|
|
|
304
305
|
|
|
305
306
|
function _objectSpread2$1(target) {
|
|
306
307
|
for (var i = 1; i < arguments.length; i++) {
|
|
307
|
-
var source =
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
308
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
309
|
+
|
|
310
|
+
if (i % 2) {
|
|
311
|
+
ownKeys$1(Object(source), true).forEach(function (key) {
|
|
312
|
+
_defineProperty$1(target, key, source[key]);
|
|
313
|
+
});
|
|
314
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
315
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
316
|
+
} else {
|
|
317
|
+
ownKeys$1(Object(source)).forEach(function (key) {
|
|
318
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
319
|
+
});
|
|
320
|
+
}
|
|
313
321
|
}
|
|
314
322
|
|
|
315
323
|
return target;
|
|
@@ -320,17 +328,14 @@ function _arrayWithHoles$1(arr) {
|
|
|
320
328
|
}
|
|
321
329
|
|
|
322
330
|
function _iterableToArrayLimit$1(arr, i) {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
if (_i == null) return;
|
|
331
|
+
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
|
|
326
332
|
var _arr = [];
|
|
327
333
|
var _n = true;
|
|
328
334
|
var _d = false;
|
|
329
|
-
|
|
330
|
-
var _s, _e;
|
|
335
|
+
var _e = undefined;
|
|
331
336
|
|
|
332
337
|
try {
|
|
333
|
-
for (_i =
|
|
338
|
+
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
|
334
339
|
_arr.push(_s.value);
|
|
335
340
|
|
|
336
341
|
if (i && _arr.length === i) break;
|
|
@@ -413,11 +418,17 @@ function _objectWithoutProperties$1(source, excluded) {
|
|
|
413
418
|
function _typeof(obj) {
|
|
414
419
|
"@babel/helpers - typeof";
|
|
415
420
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
}
|
|
421
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
422
|
+
_typeof = function _typeof(obj) {
|
|
423
|
+
return typeof obj;
|
|
424
|
+
};
|
|
425
|
+
} else {
|
|
426
|
+
_typeof = function _typeof(obj) {
|
|
427
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
return _typeof(obj);
|
|
421
432
|
}
|
|
422
433
|
|
|
423
434
|
/**
|
|
@@ -2407,7 +2418,9 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
2407
2418
|
ctx = props.ctx,
|
|
2408
2419
|
sourceName = props.sourceName,
|
|
2409
2420
|
_props$needModalTable = props.needModalTable,
|
|
2410
|
-
needModalTable = _props$needModalTable === void 0 ? true : _props$needModalTable
|
|
2421
|
+
needModalTable = _props$needModalTable === void 0 ? true : _props$needModalTable,
|
|
2422
|
+
_props$getPopupContai = props.getPopupContainer,
|
|
2423
|
+
_getPopupContainer = _props$getPopupContai === void 0 ? undefined : _props$getPopupContai;
|
|
2411
2424
|
|
|
2412
2425
|
var _ref = requestConfig || {},
|
|
2413
2426
|
url = _ref.url,
|
|
@@ -2806,18 +2819,21 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
2806
2819
|
}
|
|
2807
2820
|
};
|
|
2808
2821
|
|
|
2809
|
-
var
|
|
2810
|
-
if (
|
|
2822
|
+
var handleSelectOver = function handleSelectOver(selectedValue) {
|
|
2823
|
+
if (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.length) {
|
|
2811
2824
|
var _ctx$form2;
|
|
2812
2825
|
|
|
2813
|
-
formaData(
|
|
2826
|
+
formaData(selectedValue); // 解决选择最后1页的sku,返回后,不显示名称问题
|
|
2814
2827
|
|
|
2815
|
-
var source = _.uniqBy(items.concat(
|
|
2828
|
+
var source = _.uniqBy(items.concat(selectedValue), 'value');
|
|
2816
2829
|
|
|
2817
2830
|
ctx === null || ctx === void 0 ? void 0 : (_ctx$form2 = ctx.form) === null || _ctx$form2 === void 0 ? void 0 : _ctx$form2.setFieldSource(resultSourceKey, source);
|
|
2818
2831
|
setItems(source);
|
|
2819
2832
|
}
|
|
2833
|
+
};
|
|
2820
2834
|
|
|
2835
|
+
var handleOk = function handleOk() {
|
|
2836
|
+
handleSelectOver(popvalue);
|
|
2821
2837
|
handleCancel();
|
|
2822
2838
|
};
|
|
2823
2839
|
|
|
@@ -2964,7 +2980,9 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
2964
2980
|
filterRows = selectRows;
|
|
2965
2981
|
sksResult = selectRows.map(function (i) {
|
|
2966
2982
|
return i.value;
|
|
2967
|
-
});
|
|
2983
|
+
}); // 单选直接选中 不需要确定
|
|
2984
|
+
|
|
2985
|
+
handleSelectOver(filterRows);
|
|
2968
2986
|
}
|
|
2969
2987
|
|
|
2970
2988
|
setSelectedRowKeys(sksResult);
|
|
@@ -3061,23 +3079,19 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3061
3079
|
}
|
|
3062
3080
|
};
|
|
3063
3081
|
|
|
3064
|
-
var
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
var newValue = JSON.parse(JSON.stringify(value)).filter(function (i) {
|
|
3075
|
-
return i !== item.value;
|
|
3076
|
-
});
|
|
3077
|
-
onChange(newValue);
|
|
3078
|
-
};
|
|
3082
|
+
var maxTagPlaceholder = function maxTagPlaceholder(selectedValues) {
|
|
3083
|
+
var _onClose = function onClose(e, item) {
|
|
3084
|
+
e.preventDefault();
|
|
3085
|
+
var newValue = labelInValue ? JSON.parse(JSON.stringify(value)).filter(function (i) {
|
|
3086
|
+
return i.value !== item.value;
|
|
3087
|
+
}) : JSON.parse(JSON.stringify(value)).filter(function (i) {
|
|
3088
|
+
return i !== item.value;
|
|
3089
|
+
});
|
|
3090
|
+
onChange(newValue);
|
|
3091
|
+
};
|
|
3079
3092
|
|
|
3080
|
-
|
|
3093
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
3094
|
+
title: selectedValues.map(function (i) {
|
|
3081
3095
|
return /*#__PURE__*/React.createElement(Tag, {
|
|
3082
3096
|
closable: true,
|
|
3083
3097
|
onClose: function onClose(e) {
|
|
@@ -3089,13 +3103,9 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3089
3103
|
height: '24px',
|
|
3090
3104
|
border: '1px solid #f0f0f0'
|
|
3091
3105
|
}
|
|
3092
|
-
}, i.
|
|
3093
|
-
})
|
|
3094
|
-
}
|
|
3095
|
-
setTooltipVisible(false);
|
|
3096
|
-
}
|
|
3097
|
-
|
|
3098
|
-
return '';
|
|
3106
|
+
}, i.label);
|
|
3107
|
+
})
|
|
3108
|
+
}, "+ ".concat(selectedValues === null || selectedValues === void 0 ? void 0 : selectedValues.length));
|
|
3099
3109
|
};
|
|
3100
3110
|
|
|
3101
3111
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -3103,15 +3113,6 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3103
3113
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3104
3114
|
className: "search_select_show",
|
|
3105
3115
|
id: "search_select_div_".concat(uniqueValue)
|
|
3106
|
-
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
3107
|
-
title: TooltipContent,
|
|
3108
|
-
visible: tooltipVisible,
|
|
3109
|
-
trigger: 'hover',
|
|
3110
|
-
onVisibleChange: function onVisibleChange(visible) {
|
|
3111
|
-
if (selectMode && value && (value === null || value === void 0 ? void 0 : value.length)) {
|
|
3112
|
-
setTooltipVisible(visible);
|
|
3113
|
-
}
|
|
3114
|
-
}
|
|
3115
3116
|
}, /*#__PURE__*/React.createElement(Select, _objectSpread2(_objectSpread2({
|
|
3116
3117
|
virtual: true,
|
|
3117
3118
|
labelInValue: labelInValue,
|
|
@@ -3158,10 +3159,11 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3158
3159
|
style: {
|
|
3159
3160
|
width: needModalTable ? 'calc(100% - 30px)' : 'calc(100%)'
|
|
3160
3161
|
},
|
|
3161
|
-
placeholder: "\u8BF7\u9009\u62E9"
|
|
3162
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
3163
|
+
maxTagPlaceholder: maxTagPlaceholder
|
|
3162
3164
|
}, currentSelectProps), {}, {
|
|
3163
3165
|
getPopupContainer: function getPopupContainer() {
|
|
3164
|
-
return document.getElementById("search_select_div_".concat(uniqueValue));
|
|
3166
|
+
return _getPopupContainer && _getPopupContainer() || document.getElementById("search_select_div_".concat(uniqueValue));
|
|
3165
3167
|
}
|
|
3166
3168
|
}), items.map(function (item) {
|
|
3167
3169
|
return /*#__PURE__*/React.createElement(Option, {
|
|
@@ -3171,7 +3173,7 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3171
3173
|
text: "".concat(item.textShowKey, " ").concat(item.text),
|
|
3172
3174
|
filterTxt: searchValue
|
|
3173
3175
|
}));
|
|
3174
|
-
}))
|
|
3176
|
+
})), needModalTable && /*#__PURE__*/React.createElement(Button, {
|
|
3175
3177
|
style: {
|
|
3176
3178
|
width: '30px',
|
|
3177
3179
|
padding: '2px',
|
|
@@ -3185,7 +3187,7 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3185
3187
|
visible: isModalVisible,
|
|
3186
3188
|
onOk: handleOk,
|
|
3187
3189
|
onCancel: handleCancel,
|
|
3188
|
-
footer: [/*#__PURE__*/React.createElement(Button, {
|
|
3190
|
+
footer: selectMode ? [/*#__PURE__*/React.createElement(Button, {
|
|
3189
3191
|
key: "back",
|
|
3190
3192
|
onClick: handleCancel
|
|
3191
3193
|
}, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
|
|
@@ -3193,7 +3195,7 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3193
3195
|
type: "primary",
|
|
3194
3196
|
onClick: handleOk,
|
|
3195
3197
|
disabled: !tableData.length || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
|
|
3196
|
-
}, "\u786E\u5B9A")]
|
|
3198
|
+
}, "\u786E\u5B9A")] : null
|
|
3197
3199
|
}, /*#__PURE__*/React.createElement("div", {
|
|
3198
3200
|
className: 'search_select_wrapper'
|
|
3199
3201
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -3359,16 +3361,15 @@ var loadSelectSource = function loadSelectSource(url, params) {
|
|
|
3359
3361
|
var _getDictionarySource;
|
|
3360
3362
|
var hasDictSharingType = (_getDictionarySource = getDictionarySource('UC000013')) === null || _getDictionarySource === void 0 ? void 0 : _getDictionarySource.length;
|
|
3361
3363
|
var sharingTypeDataList = hasDictSharingType && getDictionarySource('UC000013') || sharingType;
|
|
3362
|
-
function commonFun(type, prefixUrl) {
|
|
3364
|
+
function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
3363
3365
|
// 默认type === 'supplier' 供应商选择器
|
|
3364
|
-
var requestConfig = {
|
|
3366
|
+
var requestConfig = _objectSpread2({
|
|
3365
3367
|
url: "".concat(prefixUrl.selectPrefix, "/supplier"),
|
|
3366
3368
|
filter: 'qp-name,code-orGroup,like',
|
|
3367
3369
|
otherParams: {
|
|
3368
3370
|
sorter: 'desc-id'
|
|
3369
|
-
}
|
|
3370
|
-
|
|
3371
|
-
};
|
|
3371
|
+
}
|
|
3372
|
+
}, requestConfigProp);
|
|
3372
3373
|
/*
|
|
3373
3374
|
* 处理 格式化下拉框数据源
|
|
3374
3375
|
* reData 必传 promise返回响应的数据 格式为[{},{},{},...] Promise.all第一个参数数组有多少个数组长度就是多少,其中每个对象为每次请求的结果数据
|
|
@@ -3378,6 +3379,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3378
3379
|
* changeSearchForm 必传 为搜索表单Form数据
|
|
3379
3380
|
* */
|
|
3380
3381
|
|
|
3382
|
+
|
|
3381
3383
|
var formatSource = function formatSource(reData, position, changePosition, changeSearchForm) {
|
|
3382
3384
|
var _reData$position;
|
|
3383
3385
|
|
|
@@ -3512,7 +3514,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3512
3514
|
});
|
|
3513
3515
|
}
|
|
3514
3516
|
|
|
3515
|
-
var modalTableProps = {
|
|
3517
|
+
var modalTableProps = _objectSpread2({
|
|
3516
3518
|
modalTableTitle: '选择供应商',
|
|
3517
3519
|
tableSearchForm: tableSearchForm,
|
|
3518
3520
|
tableColumns: [{
|
|
@@ -3541,11 +3543,12 @@ function commonFun(type, prefixUrl) {
|
|
|
3541
3543
|
})) === null || _sharingType$find === void 0 ? void 0 : _sharingType$find.text;
|
|
3542
3544
|
}
|
|
3543
3545
|
}]
|
|
3544
|
-
};
|
|
3546
|
+
}, modalTableBusProps);
|
|
3547
|
+
|
|
3545
3548
|
var needModalTable = true; // 商品选择器
|
|
3546
3549
|
|
|
3547
3550
|
if (type === 'skuCommodity') {
|
|
3548
|
-
requestConfig = {
|
|
3551
|
+
requestConfig = _objectSpread2({
|
|
3549
3552
|
url: "".concat(prefixUrl.selectPrefix, "/sku"),
|
|
3550
3553
|
filter: 'qp-name,skuCode-orGroup,like',
|
|
3551
3554
|
mappingTextField: 'name',
|
|
@@ -3555,7 +3558,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3555
3558
|
sorter: 'desc-id'
|
|
3556
3559
|
},
|
|
3557
3560
|
sourceName: 'skuCode'
|
|
3558
|
-
};
|
|
3561
|
+
}, requestConfigProp);
|
|
3559
3562
|
tableSearchForm = [{
|
|
3560
3563
|
name: 'qp-name-like',
|
|
3561
3564
|
label: 'SKU名称'
|
|
@@ -3650,7 +3653,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3650
3653
|
formatTreeDataSource(x, 1, 6, tableSearchForm);
|
|
3651
3654
|
formatSource(x, 2, 7, tableSearchForm, ['id', 'name']);
|
|
3652
3655
|
});
|
|
3653
|
-
modalTableProps = {
|
|
3656
|
+
modalTableProps = _objectSpread2({
|
|
3654
3657
|
modalTableTitle: '选择SKU',
|
|
3655
3658
|
tableSearchForm: tableSearchForm,
|
|
3656
3659
|
tableColumns: [{
|
|
@@ -3678,12 +3681,12 @@ function commonFun(type, prefixUrl) {
|
|
|
3678
3681
|
title: '条形码',
|
|
3679
3682
|
dataIndex: 'barCode'
|
|
3680
3683
|
}]
|
|
3681
|
-
};
|
|
3684
|
+
}, modalTableBusProps);
|
|
3682
3685
|
} // 仓库选择器(物理、逻辑仓)
|
|
3683
3686
|
|
|
3684
3687
|
|
|
3685
3688
|
if (type === 'physicalWarehouse') {
|
|
3686
|
-
requestConfig = {
|
|
3689
|
+
requestConfig = _objectSpread2({
|
|
3687
3690
|
url: "".concat(prefixUrl.selectPrefix, "/physicalWarehouse"),
|
|
3688
3691
|
filter: 'qp-physicalWarehouseName,physicalWarehouseCode-orGroup,like',
|
|
3689
3692
|
mappingTextField: 'physicalWarehouseName',
|
|
@@ -3694,7 +3697,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3694
3697
|
sorter: 'desc-id'
|
|
3695
3698
|
},
|
|
3696
3699
|
sourceName: 'warehouseIds'
|
|
3697
|
-
};
|
|
3700
|
+
}, requestConfigProp);
|
|
3698
3701
|
tableSearchForm = [{
|
|
3699
3702
|
name: 'qp-physicalWarehouseName-like',
|
|
3700
3703
|
label: '物理仓名称'
|
|
@@ -3733,7 +3736,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3733
3736
|
})]).then(function (x) {
|
|
3734
3737
|
formatSource(x, 0, 3, tableSearchForm);
|
|
3735
3738
|
});
|
|
3736
|
-
modalTableProps = {
|
|
3739
|
+
modalTableProps = _objectSpread2({
|
|
3737
3740
|
modalTableTitle: '选择物理仓',
|
|
3738
3741
|
tableSearchForm: tableSearchForm,
|
|
3739
3742
|
tableColumns: [{
|
|
@@ -3752,11 +3755,11 @@ function commonFun(type, prefixUrl) {
|
|
|
3752
3755
|
title: '所属公司',
|
|
3753
3756
|
dataIndex: 'companyName'
|
|
3754
3757
|
}]
|
|
3755
|
-
};
|
|
3758
|
+
}, modalTableBusProps);
|
|
3756
3759
|
}
|
|
3757
3760
|
|
|
3758
3761
|
if (type === 'realWarehouse') {
|
|
3759
|
-
requestConfig = {
|
|
3762
|
+
requestConfig = _objectSpread2({
|
|
3760
3763
|
url: "".concat(prefixUrl.selectPrefix, "/realWarehouse"),
|
|
3761
3764
|
filter: 'qp-realWarehouseName,realWarehouseCode-orGroup,like',
|
|
3762
3765
|
mappingTextField: 'realWarehouseName',
|
|
@@ -3767,7 +3770,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3767
3770
|
sorter: 'desc-id'
|
|
3768
3771
|
},
|
|
3769
3772
|
sourceName: 'warehouseIds'
|
|
3770
|
-
};
|
|
3773
|
+
}, requestConfigProp);
|
|
3771
3774
|
tableSearchForm = [{
|
|
3772
3775
|
name: 'qp-realWarehouseName-like',
|
|
3773
3776
|
label: '逻辑仓名称'
|
|
@@ -3780,7 +3783,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3780
3783
|
label: '逻辑仓类型',
|
|
3781
3784
|
initialSource: getDictionarySource('SC00004')
|
|
3782
3785
|
}];
|
|
3783
|
-
modalTableProps = {
|
|
3786
|
+
modalTableProps = _objectSpread2({
|
|
3784
3787
|
modalTableTitle: '选择逻辑仓',
|
|
3785
3788
|
tableSearchForm: tableSearchForm,
|
|
3786
3789
|
tableColumns: [{
|
|
@@ -3796,12 +3799,12 @@ function commonFun(type, prefixUrl) {
|
|
|
3796
3799
|
return getDictionaryTextByValue('SC00004', text);
|
|
3797
3800
|
}
|
|
3798
3801
|
}]
|
|
3799
|
-
};
|
|
3802
|
+
}, modalTableBusProps);
|
|
3800
3803
|
} // 仓库选择器(虚拟、渠道仓)(无弹窗)
|
|
3801
3804
|
|
|
3802
3805
|
|
|
3803
3806
|
if (type === 'virtualWarehouse') {
|
|
3804
|
-
requestConfig = {
|
|
3807
|
+
requestConfig = _objectSpread2({
|
|
3805
3808
|
url: "".concat(prefixUrl.selectPrefix, "/virtualWarehouse"),
|
|
3806
3809
|
filter: 'qp-virtualWarehouseName,virtualWarehouseCode-orGroup,like',
|
|
3807
3810
|
mappingTextField: 'virtualWarehouseName',
|
|
@@ -3812,12 +3815,12 @@ function commonFun(type, prefixUrl) {
|
|
|
3812
3815
|
sorter: 'desc-id'
|
|
3813
3816
|
},
|
|
3814
3817
|
sourceName: 'warehouseIds'
|
|
3815
|
-
};
|
|
3818
|
+
}, requestConfigProp);
|
|
3816
3819
|
needModalTable = false;
|
|
3817
3820
|
}
|
|
3818
3821
|
|
|
3819
3822
|
if (type === 'channelWarehouse') {
|
|
3820
|
-
requestConfig = {
|
|
3823
|
+
requestConfig = _objectSpread2({
|
|
3821
3824
|
url: "".concat(prefixUrl.selectPrefix, "/channelWarehouse"),
|
|
3822
3825
|
filter: 'qp-channelWarehouseName,channelWarehouseCode-orGroup,like',
|
|
3823
3826
|
mappingTextField: 'channelWarehouseName',
|
|
@@ -3828,13 +3831,13 @@ function commonFun(type, prefixUrl) {
|
|
|
3828
3831
|
sorter: 'desc-id'
|
|
3829
3832
|
},
|
|
3830
3833
|
sourceName: 'warehouseIds'
|
|
3831
|
-
};
|
|
3834
|
+
}, requestConfigProp);
|
|
3832
3835
|
needModalTable = false;
|
|
3833
3836
|
} // 客户选择器
|
|
3834
3837
|
|
|
3835
3838
|
|
|
3836
3839
|
if (type === 'customer') {
|
|
3837
|
-
requestConfig = {
|
|
3840
|
+
requestConfig = _objectSpread2({
|
|
3838
3841
|
url: "".concat(prefixUrl.selectPrefix, "/uc/customer/v2"),
|
|
3839
3842
|
filter: 'qp-name,code-orGroup,like',
|
|
3840
3843
|
mappingTextField: 'name',
|
|
@@ -3843,7 +3846,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3843
3846
|
sorter: 'desc-id'
|
|
3844
3847
|
},
|
|
3845
3848
|
sourceName: 'customCode'
|
|
3846
|
-
};
|
|
3849
|
+
}, requestConfigProp);
|
|
3847
3850
|
tableSearchForm = [{
|
|
3848
3851
|
name: 'qp-name-like',
|
|
3849
3852
|
label: '客户名称'
|
|
@@ -3929,7 +3932,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3929
3932
|
formatSource(x, 1, 3, tableSearchForm);
|
|
3930
3933
|
formatSource(x, 2, 4, tableSearchForm);
|
|
3931
3934
|
});
|
|
3932
|
-
modalTableProps = {
|
|
3935
|
+
modalTableProps = _objectSpread2({
|
|
3933
3936
|
modalTableTitle: '选择客户',
|
|
3934
3937
|
tableSearchForm: tableSearchForm,
|
|
3935
3938
|
tableColumns: [{
|
|
@@ -3958,12 +3961,12 @@ function commonFun(type, prefixUrl) {
|
|
|
3958
3961
|
})) === null || _sharingType$find2 === void 0 ? void 0 : _sharingType$find2.text;
|
|
3959
3962
|
}
|
|
3960
3963
|
}]
|
|
3961
|
-
};
|
|
3964
|
+
}, modalTableBusProps);
|
|
3962
3965
|
} // 店铺选择器
|
|
3963
3966
|
|
|
3964
3967
|
|
|
3965
3968
|
if (type === 'shopFile') {
|
|
3966
|
-
requestConfig = {
|
|
3969
|
+
requestConfig = _objectSpread2({
|
|
3967
3970
|
url: "".concat(prefixUrl.selectPrefix, "/store"),
|
|
3968
3971
|
filter: 'qp-name,code-orGroup,like',
|
|
3969
3972
|
mappingTextField: 'name',
|
|
@@ -3972,7 +3975,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3972
3975
|
sorter: 'desc-id'
|
|
3973
3976
|
},
|
|
3974
3977
|
sourceName: 'code'
|
|
3975
|
-
};
|
|
3978
|
+
}, requestConfigProp);
|
|
3976
3979
|
tableSearchForm = [{
|
|
3977
3980
|
name: 'qp-name-like',
|
|
3978
3981
|
label: '店铺名称'
|
|
@@ -4082,7 +4085,7 @@ function commonFun(type, prefixUrl) {
|
|
|
4082
4085
|
formatSource(x, 2, 5, tableSearchForm);
|
|
4083
4086
|
formatSource(x, 3, 6, tableSearchForm);
|
|
4084
4087
|
});
|
|
4085
|
-
modalTableProps = {
|
|
4088
|
+
modalTableProps = _objectSpread2({
|
|
4086
4089
|
modalTableTitle: '选择店铺',
|
|
4087
4090
|
tableSearchForm: tableSearchForm,
|
|
4088
4091
|
tableColumns: [{
|
|
@@ -4114,12 +4117,12 @@ function commonFun(type, prefixUrl) {
|
|
|
4114
4117
|
title: '归属核算主体',
|
|
4115
4118
|
dataIndex: 'accountingName'
|
|
4116
4119
|
}]
|
|
4117
|
-
};
|
|
4120
|
+
}, modalTableBusProps);
|
|
4118
4121
|
} // 核算主体选择器(无弹窗)
|
|
4119
4122
|
|
|
4120
4123
|
|
|
4121
4124
|
if (type === 'accountingSubject') {
|
|
4122
|
-
requestConfig = {
|
|
4125
|
+
requestConfig = _objectSpread2({
|
|
4123
4126
|
url: "".concat(prefixUrl.selectPrefix, "/accountingSubject"),
|
|
4124
4127
|
filter: 'qp-name,code-orGroup,like',
|
|
4125
4128
|
mappingTextField: 'name',
|
|
@@ -4129,13 +4132,13 @@ function commonFun(type, prefixUrl) {
|
|
|
4129
4132
|
sorter: 'desc-id'
|
|
4130
4133
|
},
|
|
4131
4134
|
sourceName: 'accountingSubjectCode'
|
|
4132
|
-
};
|
|
4135
|
+
}, requestConfigProp);
|
|
4133
4136
|
needModalTable = false;
|
|
4134
4137
|
} // 库存组织选择器(无弹窗)
|
|
4135
4138
|
|
|
4136
4139
|
|
|
4137
4140
|
if (type === 'inventoryOrg') {
|
|
4138
|
-
requestConfig = {
|
|
4141
|
+
requestConfig = _objectSpread2({
|
|
4139
4142
|
url: "".concat(prefixUrl.selectPrefix, "/inventoryOrg"),
|
|
4140
4143
|
filter: 'qp-name,code-orGroup,like',
|
|
4141
4144
|
mappingTextField: 'name',
|
|
@@ -4145,13 +4148,13 @@ function commonFun(type, prefixUrl) {
|
|
|
4145
4148
|
sorter: 'desc-id'
|
|
4146
4149
|
},
|
|
4147
4150
|
sourceName: 'inventoryOrgCode'
|
|
4148
|
-
};
|
|
4151
|
+
}, requestConfigProp);
|
|
4149
4152
|
needModalTable = false;
|
|
4150
4153
|
} // 法人公司选择器(无弹窗)
|
|
4151
4154
|
|
|
4152
4155
|
|
|
4153
4156
|
if (type === 'corporationCompany') {
|
|
4154
|
-
requestConfig = {
|
|
4157
|
+
requestConfig = _objectSpread2({
|
|
4155
4158
|
url: "".concat(prefixUrl.selectPrefix, "/company"),
|
|
4156
4159
|
filter: 'qp-name,code-orGroup,like',
|
|
4157
4160
|
mappingTextField: 'name',
|
|
@@ -4161,15 +4164,15 @@ function commonFun(type, prefixUrl) {
|
|
|
4161
4164
|
sorter: 'desc-id'
|
|
4162
4165
|
},
|
|
4163
4166
|
sourceName: 'corporationCompany'
|
|
4164
|
-
};
|
|
4167
|
+
}, requestConfigProp);
|
|
4165
4168
|
needModalTable = false;
|
|
4166
4169
|
} // 员工选择器
|
|
4167
4170
|
|
|
4168
4171
|
|
|
4169
4172
|
if (type === 'employee') {
|
|
4170
|
-
requestConfig = {
|
|
4173
|
+
requestConfig = _objectSpread2({
|
|
4171
4174
|
url: "".concat(prefixUrl.selectPrefix, "/employee/v2"),
|
|
4172
|
-
filter: 'qp-name
|
|
4175
|
+
filter: 'qp-employeeNumber,name-orGroup,like',
|
|
4173
4176
|
mappingTextField: 'name',
|
|
4174
4177
|
mappingTextShowKeyField: 'employeeNumber',
|
|
4175
4178
|
mappingValueField: 'employeeNumber',
|
|
@@ -4178,7 +4181,7 @@ function commonFun(type, prefixUrl) {
|
|
|
4178
4181
|
sorter: 'desc-id'
|
|
4179
4182
|
},
|
|
4180
4183
|
sourceName: 'employeeNumber'
|
|
4181
|
-
};
|
|
4184
|
+
}, requestConfigProp);
|
|
4182
4185
|
tableSearchForm = [{
|
|
4183
4186
|
name: 'qp-name-like',
|
|
4184
4187
|
label: '员工名称'
|
|
@@ -4218,7 +4221,7 @@ function commonFun(type, prefixUrl) {
|
|
|
4218
4221
|
})]).then(function (x) {
|
|
4219
4222
|
formatSource(x, 0, 2, tableSearchForm);
|
|
4220
4223
|
});
|
|
4221
|
-
modalTableProps = {
|
|
4224
|
+
modalTableProps = _objectSpread2({
|
|
4222
4225
|
modalTableTitle: '选择员工',
|
|
4223
4226
|
tableSearchForm: tableSearchForm,
|
|
4224
4227
|
tableColumns: [{
|
|
@@ -4237,12 +4240,12 @@ function commonFun(type, prefixUrl) {
|
|
|
4237
4240
|
title: '手机号',
|
|
4238
4241
|
dataIndex: 'officeTelephone'
|
|
4239
4242
|
}]
|
|
4240
|
-
};
|
|
4243
|
+
}, modalTableBusProps);
|
|
4241
4244
|
} // 配送方式选择器
|
|
4242
4245
|
|
|
4243
4246
|
|
|
4244
4247
|
if (type === 'deliveryMode') {
|
|
4245
|
-
requestConfig = {
|
|
4248
|
+
requestConfig = _objectSpread2({
|
|
4246
4249
|
url: "".concat(prefixUrl.selectPrefix, "/deliveryMode"),
|
|
4247
4250
|
filter: 'qp-name,code-orGroup,like',
|
|
4248
4251
|
mappingTextField: 'name',
|
|
@@ -4252,7 +4255,7 @@ function commonFun(type, prefixUrl) {
|
|
|
4252
4255
|
sorter: 'desc-id'
|
|
4253
4256
|
},
|
|
4254
4257
|
sourceName: 'deliveryModeCode'
|
|
4255
|
-
};
|
|
4258
|
+
}, requestConfigProp);
|
|
4256
4259
|
tableSearchForm = [{
|
|
4257
4260
|
name: 'qp-name-like',
|
|
4258
4261
|
label: '配送方式名称'
|
|
@@ -4321,7 +4324,7 @@ function commonFun(type, prefixUrl) {
|
|
|
4321
4324
|
formatSource(x, 0, 2, tableSearchForm);
|
|
4322
4325
|
formatSource(x, 1, 5, tableSearchForm);
|
|
4323
4326
|
});
|
|
4324
|
-
modalTableProps = {
|
|
4327
|
+
modalTableProps = _objectSpread2({
|
|
4325
4328
|
modalTableTitle: '选择配送方式',
|
|
4326
4329
|
tableSearchForm: tableSearchForm,
|
|
4327
4330
|
tableColumns: [{
|
|
@@ -4356,7 +4359,7 @@ function commonFun(type, prefixUrl) {
|
|
|
4356
4359
|
dataIndex: 'remark',
|
|
4357
4360
|
title: '备注'
|
|
4358
4361
|
}]
|
|
4359
|
-
};
|
|
4362
|
+
}, modalTableBusProps);
|
|
4360
4363
|
}
|
|
4361
4364
|
|
|
4362
4365
|
return {
|
|
@@ -4366,6 +4369,8 @@ function commonFun(type, prefixUrl) {
|
|
|
4366
4369
|
};
|
|
4367
4370
|
}
|
|
4368
4371
|
|
|
4372
|
+
var MemoSearchSelect = /*#__PURE__*/React.memo(SearchSelect);
|
|
4373
|
+
|
|
4369
4374
|
var BusinessSearchSelect = function BusinessSearchSelect(props) {
|
|
4370
4375
|
var businessType = (props === null || props === void 0 ? void 0 : props.selectBusinessType) || 'supplier';
|
|
4371
4376
|
var prefixUrl = (props === null || props === void 0 ? void 0 : props.prefixUrl) || {
|
|
@@ -4373,21 +4378,33 @@ var BusinessSearchSelect = function BusinessSearchSelect(props) {
|
|
|
4373
4378
|
formSelectFix: '/bop/api'
|
|
4374
4379
|
};
|
|
4375
4380
|
|
|
4376
|
-
var _commonFun = commonFun(businessType, prefixUrl),
|
|
4381
|
+
var _commonFun = commonFun(businessType, prefixUrl, (props === null || props === void 0 ? void 0 : props.requestConfig) || {}, (props === null || props === void 0 ? void 0 : props.modalTableProps) || {}),
|
|
4377
4382
|
requestConfig = _commonFun.requestConfig,
|
|
4378
4383
|
modalTableProps = _commonFun.modalTableProps,
|
|
4379
4384
|
needModalTable = _commonFun.needModalTable;
|
|
4380
4385
|
|
|
4381
|
-
var currentProps =
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(
|
|
4386
|
+
var currentProps = useMemo(function () {
|
|
4387
|
+
return _objectSpread2(_objectSpread2({}, props), {}, {
|
|
4388
|
+
requestConfig: requestConfig,
|
|
4389
|
+
needModalTable: needModalTable,
|
|
4390
|
+
modalTableProps: modalTableProps
|
|
4391
|
+
});
|
|
4392
|
+
}, [props === null || props === void 0 ? void 0 : props.value]);
|
|
4393
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(MemoSearchSelect, _objectSpread2({}, currentProps)));
|
|
4389
4394
|
};
|
|
4390
4395
|
|
|
4396
|
+
var index = /*#__PURE__*/React.memo(BusinessSearchSelect, function (props, nextProps) {
|
|
4397
|
+
if (props && props.labelInValue && props.value && JSON.stringify(props.value) !== JSON.stringify(nextProps.value)) {
|
|
4398
|
+
return false;
|
|
4399
|
+
}
|
|
4400
|
+
|
|
4401
|
+
if (props && props.value !== nextProps.value) {
|
|
4402
|
+
return false;
|
|
4403
|
+
}
|
|
4404
|
+
|
|
4405
|
+
return true;
|
|
4406
|
+
});
|
|
4407
|
+
|
|
4391
4408
|
var CommodityEntry = function CommodityEntry(props) {
|
|
4392
4409
|
var dataValidationRef = useRef();
|
|
4393
4410
|
var _props$buttonName = props.buttonName,
|
|
@@ -4473,7 +4490,7 @@ var CommodityEntry = function CommodityEntry(props) {
|
|
|
4473
4490
|
* @LastEditTime: 2022-01-14 17:17:26
|
|
4474
4491
|
* @LastEditors: rodchen
|
|
4475
4492
|
*/
|
|
4476
|
-
var index = (function (storageKeyString) {
|
|
4493
|
+
var index$1 = (function (storageKeyString) {
|
|
4477
4494
|
var seconds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
4478
4495
|
var tipsCallFunction = arguments.length > 2 ? arguments[2] : undefined;
|
|
4479
4496
|
if (typeof seconds !== 'number') throw new Error('seconds should be number');
|
|
@@ -4533,4 +4550,4 @@ function getStorageVale(storageKeyString) {
|
|
|
4533
4550
|
var resposne = JSON.parse(localStorage.getItem('userInfo') || '{}');
|
|
4534
4551
|
axios.defaults.headers.common['sso-sessionid'] = (resposne === null || resposne === void 0 ? void 0 : resposne.sessionId) || '';
|
|
4535
4552
|
|
|
4536
|
-
export { BusinessSearchSelect, index as CheckOneUser, CommodityEntry, DataValidation, QueryMutipleInput, SearchSelect };
|
|
4553
|
+
export { index as BusinessSearchSelect, index$1 as CheckOneUser, CommodityEntry, DataValidation, QueryMutipleInput, SearchSelect };
|