@bit-sun/business-component 1.1.18 → 1.1.21
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
|
@@ -1647,7 +1647,7 @@ var itemsTemp = []; // const mapping = [
|
|
|
1647
1647
|
// { "key": "price", "name": "单价", "rule": "price" }
|
|
1648
1648
|
// ]
|
|
1649
1649
|
|
|
1650
|
-
var mapping = new Map([['skuCode', 'SKU编码'], ['quantity', '数量'], ['price', '单价'], ['regionCode', '库区'], ['checkQuantity', '实盘数量'], ['shareRatio', '共享比例'], ['
|
|
1650
|
+
var mapping = new Map([['skuCode', 'SKU编码'], ['quantity', '数量'], ['price', '单价'], ['regionCode', '库区'], ['checkQuantity', '实盘数量'], ['shareRatio', '共享比例'], ['lotNumberCode', '批号']]); // for dnd
|
|
1651
1651
|
|
|
1652
1652
|
|
|
1653
1653
|
var reorder = function reorder(list, startIndex, endIndex) {
|
|
@@ -1947,7 +1947,7 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
|
|
|
1947
1947
|
}).map(function (item) {
|
|
1948
1948
|
var obj = {};
|
|
1949
1949
|
item.slice(0, itemsTemp.length).map(function (innerItem, index) {
|
|
1950
|
-
obj[_this.state.items[index].code] = innerItem && innerItem.v;
|
|
1950
|
+
obj[_this.state.items[index].code] = innerItem && (innerItem.v === innerItem.m ? innerItem.v : innerItem.m);
|
|
1951
1951
|
});
|
|
1952
1952
|
return obj;
|
|
1953
1953
|
});
|
|
@@ -1982,6 +1982,17 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
|
|
|
1982
1982
|
sheetData.map(function (item, index) {
|
|
1983
1983
|
if (!res[index]) return item;
|
|
1984
1984
|
|
|
1985
|
+
var changeVMIndex = _this.props.columns.findIndex(function (i) {
|
|
1986
|
+
return i === 'skuCode';
|
|
1987
|
+
});
|
|
1988
|
+
|
|
1989
|
+
if (_this.props.columns.find(function (i) {
|
|
1990
|
+
return i === 'skuCode';
|
|
1991
|
+
}) && item[changeVMIndex].v !== res[index].skuCode) {
|
|
1992
|
+
item[changeVMIndex].v = res[index].skuCode;
|
|
1993
|
+
item[changeVMIndex].m = res[index].skuCode;
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1985
1996
|
if (res[index].flag) {
|
|
1986
1997
|
item[validIndex] = _objectSpread2(_objectSpread2({}, item[validIndex]), {}, {
|
|
1987
1998
|
v: '通过',
|
|
@@ -2438,7 +2449,8 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
2438
2449
|
_props$labelInValue = props.labelInValue,
|
|
2439
2450
|
labelInValue = _props$labelInValue === void 0 ? false : _props$labelInValue,
|
|
2440
2451
|
requestConfig = props.requestConfig,
|
|
2441
|
-
ctx = props.ctx
|
|
2452
|
+
ctx = props.ctx,
|
|
2453
|
+
sourceName = props.sourceName;
|
|
2442
2454
|
|
|
2443
2455
|
var _ref = requestConfig || {},
|
|
2444
2456
|
url = _ref.url,
|
|
@@ -2450,10 +2462,9 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
2450
2462
|
mappingTextField = _ref$mappingTextField === void 0 ? 'name' : _ref$mappingTextField,
|
|
2451
2463
|
mappingTextShowKeyField = _ref.mappingTextShowKeyField,
|
|
2452
2464
|
_ref$mappingValueFiel = _ref.mappingValueField,
|
|
2453
|
-
mappingValueField = _ref$mappingValueFiel === void 0 ? 'code' : _ref$mappingValueFiel
|
|
2454
|
-
_ref$sourceName = _ref.sourceName,
|
|
2455
|
-
sourceName = _ref$sourceName === void 0 ? 'supplierCode' : _ref$sourceName;
|
|
2465
|
+
mappingValueField = _ref$mappingValueFiel === void 0 ? 'code' : _ref$mappingValueFiel;
|
|
2456
2466
|
|
|
2467
|
+
var resultSourceKey = sourceName || (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.sourceName) || 'supplierCode';
|
|
2457
2468
|
var selectMode = selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode; // 设定当前选择器 为单选或者多选模式 无设定为单选模式(默认)
|
|
2458
2469
|
|
|
2459
2470
|
var initVal = value || (selectMode ? [] : null);
|
|
@@ -2509,6 +2520,11 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
2509
2520
|
popvalue = _useState14[0],
|
|
2510
2521
|
setPopValue = _useState14[1];
|
|
2511
2522
|
|
|
2523
|
+
var _useState15 = useState(sourceName),
|
|
2524
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
2525
|
+
uniqueValue = _useState16[0],
|
|
2526
|
+
setUniqueValue = _useState16[1];
|
|
2527
|
+
|
|
2512
2528
|
var _useDebounceFn = useDebounceFn(function (v) {
|
|
2513
2529
|
// 优化搜索参数 支持传多个
|
|
2514
2530
|
var searchParams = {};
|
|
@@ -2535,51 +2551,51 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
2535
2551
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
2536
2552
|
form = _Form$useForm2[0];
|
|
2537
2553
|
|
|
2538
|
-
var
|
|
2539
|
-
_useState16 = _slicedToArray(_useState15, 2),
|
|
2540
|
-
caretLeftFlag = _useState16[0],
|
|
2541
|
-
setCaretLeftFlag = _useState16[1];
|
|
2542
|
-
|
|
2543
|
-
var _useState17 = useState([]),
|
|
2554
|
+
var _useState17 = useState(true),
|
|
2544
2555
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
2545
|
-
|
|
2546
|
-
|
|
2556
|
+
caretLeftFlag = _useState18[0],
|
|
2557
|
+
setCaretLeftFlag = _useState18[1];
|
|
2558
|
+
|
|
2559
|
+
var _useState19 = useState([]),
|
|
2560
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
2561
|
+
tableData = _useState20[0],
|
|
2562
|
+
setTableData = _useState20[1];
|
|
2547
2563
|
|
|
2548
|
-
var
|
|
2564
|
+
var _useState21 = useState({
|
|
2549
2565
|
showQuickJumper: true,
|
|
2550
2566
|
total: 0,
|
|
2551
2567
|
current: 1,
|
|
2552
2568
|
pageSize: tableInitPageSize
|
|
2553
2569
|
}),
|
|
2554
|
-
_useState20 = _slicedToArray(_useState19, 2),
|
|
2555
|
-
tablePagination = _useState20[0],
|
|
2556
|
-
setTablePagination = _useState20[1];
|
|
2557
|
-
|
|
2558
|
-
var _useState21 = useState([]),
|
|
2559
2570
|
_useState22 = _slicedToArray(_useState21, 2),
|
|
2560
|
-
|
|
2561
|
-
|
|
2571
|
+
tablePagination = _useState22[0],
|
|
2572
|
+
setTablePagination = _useState22[1];
|
|
2562
2573
|
|
|
2563
2574
|
var _useState23 = useState([]),
|
|
2564
2575
|
_useState24 = _slicedToArray(_useState23, 2),
|
|
2565
|
-
|
|
2566
|
-
|
|
2576
|
+
selectedRowKeys = _useState24[0],
|
|
2577
|
+
setSelectedRowKeys = _useState24[1];
|
|
2567
2578
|
|
|
2568
|
-
|
|
2569
|
-
var _useState25 = useState(false),
|
|
2579
|
+
var _useState25 = useState([]),
|
|
2570
2580
|
_useState26 = _slicedToArray(_useState25, 2),
|
|
2571
|
-
|
|
2572
|
-
|
|
2581
|
+
doubleArr = _useState26[0],
|
|
2582
|
+
setDoubleArr = _useState26[1]; // 存放双数组的数组
|
|
2583
|
+
|
|
2573
2584
|
|
|
2574
2585
|
var _useState27 = useState(false),
|
|
2575
2586
|
_useState28 = _slicedToArray(_useState27, 2),
|
|
2576
|
-
|
|
2577
|
-
|
|
2587
|
+
checkedAll = _useState28[0],
|
|
2588
|
+
setCheckedAll = _useState28[1];
|
|
2578
2589
|
|
|
2579
|
-
var _useState29 = useState(
|
|
2590
|
+
var _useState29 = useState(false),
|
|
2580
2591
|
_useState30 = _slicedToArray(_useState29, 2),
|
|
2581
|
-
|
|
2582
|
-
|
|
2592
|
+
indeterminate = _useState30[0],
|
|
2593
|
+
setIndeterminate = _useState30[1];
|
|
2594
|
+
|
|
2595
|
+
var _useState31 = useState({}),
|
|
2596
|
+
_useState32 = _slicedToArray(_useState31, 2),
|
|
2597
|
+
tableFormParams = _useState32[0],
|
|
2598
|
+
setTableFormParams = _useState32[1]; // 获取数据源 (type: 1下拉框 2弹框 不传值默认为下拉框)
|
|
2583
2599
|
|
|
2584
2600
|
|
|
2585
2601
|
var getData = function getData() {
|
|
@@ -2646,7 +2662,7 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
2646
2662
|
if (type === 1) {
|
|
2647
2663
|
var _ctx$form;
|
|
2648
2664
|
|
|
2649
|
-
ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource(
|
|
2665
|
+
ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource(resultSourceKey, source);
|
|
2650
2666
|
setItems(source);
|
|
2651
2667
|
setItemsTotal(Number(res === null || res === void 0 ? void 0 : res.total));
|
|
2652
2668
|
} else {
|
|
@@ -2689,6 +2705,9 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
2689
2705
|
onChange(value);
|
|
2690
2706
|
}
|
|
2691
2707
|
}, [value]);
|
|
2708
|
+
useEffect(function () {
|
|
2709
|
+
makeUniqueValue();
|
|
2710
|
+
}, [sourceName]);
|
|
2692
2711
|
|
|
2693
2712
|
var showModal = function showModal() {
|
|
2694
2713
|
getData({
|
|
@@ -2738,7 +2757,7 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
2738
2757
|
|
|
2739
2758
|
var source = _.uniqBy(items.concat(popvalue), 'value');
|
|
2740
2759
|
|
|
2741
|
-
ctx === null || ctx === void 0 ? void 0 : (_ctx$form2 = ctx.form) === null || _ctx$form2 === void 0 ? void 0 : _ctx$form2.setFieldSource(
|
|
2760
|
+
ctx === null || ctx === void 0 ? void 0 : (_ctx$form2 = ctx.form) === null || _ctx$form2 === void 0 ? void 0 : _ctx$form2.setFieldSource(resultSourceKey, source);
|
|
2742
2761
|
setItems(source);
|
|
2743
2762
|
}
|
|
2744
2763
|
|
|
@@ -2895,6 +2914,13 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
2895
2914
|
setPopValue(filterRows);
|
|
2896
2915
|
setIndeterminate(!!filterRows.length && filterRows.length < (tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.total));
|
|
2897
2916
|
setCheckedAll(filterRows.length === (tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.total));
|
|
2917
|
+
}; // 生成唯一值
|
|
2918
|
+
|
|
2919
|
+
|
|
2920
|
+
var makeUniqueValue = function makeUniqueValue() {
|
|
2921
|
+
var generateUnitKey = ((1 + Math.random()) * 0x10000 | 0).toString(16);
|
|
2922
|
+
setUniqueValue(generateUnitKey);
|
|
2923
|
+
return generateUnitKey;
|
|
2898
2924
|
};
|
|
2899
2925
|
|
|
2900
2926
|
var rowSelection = {
|
|
@@ -2982,7 +3008,7 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
2982
3008
|
className: 'search_select'
|
|
2983
3009
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2984
3010
|
className: "search_select_show",
|
|
2985
|
-
id:
|
|
3011
|
+
id: "search_select_div_".concat(uniqueValue)
|
|
2986
3012
|
}, /*#__PURE__*/React.createElement(Select, _objectSpread2(_objectSpread2({
|
|
2987
3013
|
virtual: true,
|
|
2988
3014
|
labelInValue: labelInValue,
|
|
@@ -3028,7 +3054,7 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3028
3054
|
onPopupScroll: SelectScroll
|
|
3029
3055
|
}, currentSelectProps), {}, {
|
|
3030
3056
|
getPopupContainer: function getPopupContainer() {
|
|
3031
|
-
return document.getElementById(
|
|
3057
|
+
return document.getElementById("search_select_div_".concat(uniqueValue));
|
|
3032
3058
|
},
|
|
3033
3059
|
style: {
|
|
3034
3060
|
width: 'calc(100% - 30px)'
|
package/dist/index.js
CHANGED
|
@@ -1658,7 +1658,7 @@ var itemsTemp = []; // const mapping = [
|
|
|
1658
1658
|
// { "key": "price", "name": "单价", "rule": "price" }
|
|
1659
1659
|
// ]
|
|
1660
1660
|
|
|
1661
|
-
var mapping = new Map([['skuCode', 'SKU编码'], ['quantity', '数量'], ['price', '单价'], ['regionCode', '库区'], ['checkQuantity', '实盘数量'], ['shareRatio', '共享比例'], ['
|
|
1661
|
+
var mapping = new Map([['skuCode', 'SKU编码'], ['quantity', '数量'], ['price', '单价'], ['regionCode', '库区'], ['checkQuantity', '实盘数量'], ['shareRatio', '共享比例'], ['lotNumberCode', '批号']]); // for dnd
|
|
1662
1662
|
|
|
1663
1663
|
|
|
1664
1664
|
var reorder = function reorder(list, startIndex, endIndex) {
|
|
@@ -1958,7 +1958,7 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
|
|
|
1958
1958
|
}).map(function (item) {
|
|
1959
1959
|
var obj = {};
|
|
1960
1960
|
item.slice(0, itemsTemp.length).map(function (innerItem, index) {
|
|
1961
|
-
obj[_this.state.items[index].code] = innerItem && innerItem.v;
|
|
1961
|
+
obj[_this.state.items[index].code] = innerItem && (innerItem.v === innerItem.m ? innerItem.v : innerItem.m);
|
|
1962
1962
|
});
|
|
1963
1963
|
return obj;
|
|
1964
1964
|
});
|
|
@@ -1993,6 +1993,17 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
|
|
|
1993
1993
|
sheetData.map(function (item, index) {
|
|
1994
1994
|
if (!res[index]) return item;
|
|
1995
1995
|
|
|
1996
|
+
var changeVMIndex = _this.props.columns.findIndex(function (i) {
|
|
1997
|
+
return i === 'skuCode';
|
|
1998
|
+
});
|
|
1999
|
+
|
|
2000
|
+
if (_this.props.columns.find(function (i) {
|
|
2001
|
+
return i === 'skuCode';
|
|
2002
|
+
}) && item[changeVMIndex].v !== res[index].skuCode) {
|
|
2003
|
+
item[changeVMIndex].v = res[index].skuCode;
|
|
2004
|
+
item[changeVMIndex].m = res[index].skuCode;
|
|
2005
|
+
}
|
|
2006
|
+
|
|
1996
2007
|
if (res[index].flag) {
|
|
1997
2008
|
item[validIndex] = _objectSpread2(_objectSpread2({}, item[validIndex]), {}, {
|
|
1998
2009
|
v: '通过',
|
|
@@ -2449,7 +2460,8 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
2449
2460
|
_props$labelInValue = props.labelInValue,
|
|
2450
2461
|
labelInValue = _props$labelInValue === void 0 ? false : _props$labelInValue,
|
|
2451
2462
|
requestConfig = props.requestConfig,
|
|
2452
|
-
ctx = props.ctx
|
|
2463
|
+
ctx = props.ctx,
|
|
2464
|
+
sourceName = props.sourceName;
|
|
2453
2465
|
|
|
2454
2466
|
var _ref = requestConfig || {},
|
|
2455
2467
|
url = _ref.url,
|
|
@@ -2461,10 +2473,9 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
2461
2473
|
mappingTextField = _ref$mappingTextField === void 0 ? 'name' : _ref$mappingTextField,
|
|
2462
2474
|
mappingTextShowKeyField = _ref.mappingTextShowKeyField,
|
|
2463
2475
|
_ref$mappingValueFiel = _ref.mappingValueField,
|
|
2464
|
-
mappingValueField = _ref$mappingValueFiel === void 0 ? 'code' : _ref$mappingValueFiel
|
|
2465
|
-
_ref$sourceName = _ref.sourceName,
|
|
2466
|
-
sourceName = _ref$sourceName === void 0 ? 'supplierCode' : _ref$sourceName;
|
|
2476
|
+
mappingValueField = _ref$mappingValueFiel === void 0 ? 'code' : _ref$mappingValueFiel;
|
|
2467
2477
|
|
|
2478
|
+
var resultSourceKey = sourceName || (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.sourceName) || 'supplierCode';
|
|
2468
2479
|
var selectMode = selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode; // 设定当前选择器 为单选或者多选模式 无设定为单选模式(默认)
|
|
2469
2480
|
|
|
2470
2481
|
var initVal = value || (selectMode ? [] : null);
|
|
@@ -2520,6 +2531,11 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
2520
2531
|
popvalue = _useState14[0],
|
|
2521
2532
|
setPopValue = _useState14[1];
|
|
2522
2533
|
|
|
2534
|
+
var _useState15 = React.useState(sourceName),
|
|
2535
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
2536
|
+
uniqueValue = _useState16[0],
|
|
2537
|
+
setUniqueValue = _useState16[1];
|
|
2538
|
+
|
|
2523
2539
|
var _useDebounceFn = ahooks.useDebounceFn(function (v) {
|
|
2524
2540
|
// 优化搜索参数 支持传多个
|
|
2525
2541
|
var searchParams = {};
|
|
@@ -2546,51 +2562,51 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
2546
2562
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
2547
2563
|
form = _Form$useForm2[0];
|
|
2548
2564
|
|
|
2549
|
-
var
|
|
2550
|
-
_useState16 = _slicedToArray(_useState15, 2),
|
|
2551
|
-
caretLeftFlag = _useState16[0],
|
|
2552
|
-
setCaretLeftFlag = _useState16[1];
|
|
2553
|
-
|
|
2554
|
-
var _useState17 = React.useState([]),
|
|
2565
|
+
var _useState17 = React.useState(true),
|
|
2555
2566
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
2556
|
-
|
|
2557
|
-
|
|
2567
|
+
caretLeftFlag = _useState18[0],
|
|
2568
|
+
setCaretLeftFlag = _useState18[1];
|
|
2569
|
+
|
|
2570
|
+
var _useState19 = React.useState([]),
|
|
2571
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
2572
|
+
tableData = _useState20[0],
|
|
2573
|
+
setTableData = _useState20[1];
|
|
2558
2574
|
|
|
2559
|
-
var
|
|
2575
|
+
var _useState21 = React.useState({
|
|
2560
2576
|
showQuickJumper: true,
|
|
2561
2577
|
total: 0,
|
|
2562
2578
|
current: 1,
|
|
2563
2579
|
pageSize: tableInitPageSize
|
|
2564
2580
|
}),
|
|
2565
|
-
_useState20 = _slicedToArray(_useState19, 2),
|
|
2566
|
-
tablePagination = _useState20[0],
|
|
2567
|
-
setTablePagination = _useState20[1];
|
|
2568
|
-
|
|
2569
|
-
var _useState21 = React.useState([]),
|
|
2570
2581
|
_useState22 = _slicedToArray(_useState21, 2),
|
|
2571
|
-
|
|
2572
|
-
|
|
2582
|
+
tablePagination = _useState22[0],
|
|
2583
|
+
setTablePagination = _useState22[1];
|
|
2573
2584
|
|
|
2574
2585
|
var _useState23 = React.useState([]),
|
|
2575
2586
|
_useState24 = _slicedToArray(_useState23, 2),
|
|
2576
|
-
|
|
2577
|
-
|
|
2587
|
+
selectedRowKeys = _useState24[0],
|
|
2588
|
+
setSelectedRowKeys = _useState24[1];
|
|
2578
2589
|
|
|
2579
|
-
|
|
2580
|
-
var _useState25 = React.useState(false),
|
|
2590
|
+
var _useState25 = React.useState([]),
|
|
2581
2591
|
_useState26 = _slicedToArray(_useState25, 2),
|
|
2582
|
-
|
|
2583
|
-
|
|
2592
|
+
doubleArr = _useState26[0],
|
|
2593
|
+
setDoubleArr = _useState26[1]; // 存放双数组的数组
|
|
2594
|
+
|
|
2584
2595
|
|
|
2585
2596
|
var _useState27 = React.useState(false),
|
|
2586
2597
|
_useState28 = _slicedToArray(_useState27, 2),
|
|
2587
|
-
|
|
2588
|
-
|
|
2598
|
+
checkedAll = _useState28[0],
|
|
2599
|
+
setCheckedAll = _useState28[1];
|
|
2589
2600
|
|
|
2590
|
-
var _useState29 = React.useState(
|
|
2601
|
+
var _useState29 = React.useState(false),
|
|
2591
2602
|
_useState30 = _slicedToArray(_useState29, 2),
|
|
2592
|
-
|
|
2593
|
-
|
|
2603
|
+
indeterminate = _useState30[0],
|
|
2604
|
+
setIndeterminate = _useState30[1];
|
|
2605
|
+
|
|
2606
|
+
var _useState31 = React.useState({}),
|
|
2607
|
+
_useState32 = _slicedToArray(_useState31, 2),
|
|
2608
|
+
tableFormParams = _useState32[0],
|
|
2609
|
+
setTableFormParams = _useState32[1]; // 获取数据源 (type: 1下拉框 2弹框 不传值默认为下拉框)
|
|
2594
2610
|
|
|
2595
2611
|
|
|
2596
2612
|
var getData = function getData() {
|
|
@@ -2657,7 +2673,7 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
2657
2673
|
if (type === 1) {
|
|
2658
2674
|
var _ctx$form;
|
|
2659
2675
|
|
|
2660
|
-
ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource(
|
|
2676
|
+
ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource(resultSourceKey, source);
|
|
2661
2677
|
setItems(source);
|
|
2662
2678
|
setItemsTotal(Number(res === null || res === void 0 ? void 0 : res.total));
|
|
2663
2679
|
} else {
|
|
@@ -2700,6 +2716,9 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
2700
2716
|
onChange(value);
|
|
2701
2717
|
}
|
|
2702
2718
|
}, [value]);
|
|
2719
|
+
React.useEffect(function () {
|
|
2720
|
+
makeUniqueValue();
|
|
2721
|
+
}, [sourceName]);
|
|
2703
2722
|
|
|
2704
2723
|
var showModal = function showModal() {
|
|
2705
2724
|
getData({
|
|
@@ -2749,7 +2768,7 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
2749
2768
|
|
|
2750
2769
|
var source = ___default['default'].uniqBy(items.concat(popvalue), 'value');
|
|
2751
2770
|
|
|
2752
|
-
ctx === null || ctx === void 0 ? void 0 : (_ctx$form2 = ctx.form) === null || _ctx$form2 === void 0 ? void 0 : _ctx$form2.setFieldSource(
|
|
2771
|
+
ctx === null || ctx === void 0 ? void 0 : (_ctx$form2 = ctx.form) === null || _ctx$form2 === void 0 ? void 0 : _ctx$form2.setFieldSource(resultSourceKey, source);
|
|
2753
2772
|
setItems(source);
|
|
2754
2773
|
}
|
|
2755
2774
|
|
|
@@ -2906,6 +2925,13 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
2906
2925
|
setPopValue(filterRows);
|
|
2907
2926
|
setIndeterminate(!!filterRows.length && filterRows.length < (tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.total));
|
|
2908
2927
|
setCheckedAll(filterRows.length === (tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.total));
|
|
2928
|
+
}; // 生成唯一值
|
|
2929
|
+
|
|
2930
|
+
|
|
2931
|
+
var makeUniqueValue = function makeUniqueValue() {
|
|
2932
|
+
var generateUnitKey = ((1 + Math.random()) * 0x10000 | 0).toString(16);
|
|
2933
|
+
setUniqueValue(generateUnitKey);
|
|
2934
|
+
return generateUnitKey;
|
|
2909
2935
|
};
|
|
2910
2936
|
|
|
2911
2937
|
var rowSelection = {
|
|
@@ -2993,7 +3019,7 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
2993
3019
|
className: 'search_select'
|
|
2994
3020
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2995
3021
|
className: "search_select_show",
|
|
2996
|
-
id:
|
|
3022
|
+
id: "search_select_div_".concat(uniqueValue)
|
|
2997
3023
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Select, _objectSpread2(_objectSpread2({
|
|
2998
3024
|
virtual: true,
|
|
2999
3025
|
labelInValue: labelInValue,
|
|
@@ -3039,7 +3065,7 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3039
3065
|
onPopupScroll: SelectScroll
|
|
3040
3066
|
}, currentSelectProps), {}, {
|
|
3041
3067
|
getPopupContainer: function getPopupContainer() {
|
|
3042
|
-
return document.getElementById(
|
|
3068
|
+
return document.getElementById("search_select_div_".concat(uniqueValue));
|
|
3043
3069
|
},
|
|
3044
3070
|
style: {
|
|
3045
3071
|
width: 'calc(100% - 30px)'
|
package/package.json
CHANGED
|
@@ -46,7 +46,7 @@ const mapping = new Map([
|
|
|
46
46
|
['regionCode', '库区'],
|
|
47
47
|
['checkQuantity', '实盘数量'],
|
|
48
48
|
['shareRatio', '共享比例'],
|
|
49
|
-
['
|
|
49
|
+
['lotNumberCode', '批号'],
|
|
50
50
|
]);
|
|
51
51
|
|
|
52
52
|
// for dnd
|
|
@@ -379,7 +379,7 @@ class DataValidation extends React.Component {
|
|
|
379
379
|
let obj = {};
|
|
380
380
|
|
|
381
381
|
item.slice(0, itemsTemp.length).map((innerItem, index) => {
|
|
382
|
-
obj[this.state.items[index].code] = innerItem && innerItem.v;
|
|
382
|
+
obj[this.state.items[index].code] = innerItem && (innerItem.v === innerItem.m ? innerItem.v : innerItem.m);
|
|
383
383
|
});
|
|
384
384
|
|
|
385
385
|
return obj;
|
|
@@ -414,6 +414,12 @@ class DataValidation extends React.Component {
|
|
|
414
414
|
sheetData.map((item, index) => {
|
|
415
415
|
if (!res[index]) return item;
|
|
416
416
|
|
|
417
|
+
const changeVMIndex = this.props.columns.findIndex(i => i === 'skuCode');
|
|
418
|
+
if(this.props.columns.find(i => i === 'skuCode') && item[changeVMIndex].v !== res[index].skuCode) {
|
|
419
|
+
item[changeVMIndex].v = res[index].skuCode;
|
|
420
|
+
item[changeVMIndex].m = res[index].skuCode;
|
|
421
|
+
}
|
|
422
|
+
|
|
417
423
|
if (res[index].flag) {
|
|
418
424
|
item[validIndex] = {
|
|
419
425
|
...item[validIndex],
|
|
@@ -19,8 +19,10 @@ const SearchSelect = (props: any) => {
|
|
|
19
19
|
labelInValue=false,
|
|
20
20
|
requestConfig,
|
|
21
21
|
ctx,
|
|
22
|
+
sourceName,
|
|
22
23
|
} = props;
|
|
23
|
-
const { url, otherParams, isMap, fixedparameter, fieldValToParam, mappingTextField='name', mappingTextShowKeyField,mappingValueField='code'
|
|
24
|
+
const { url, otherParams, isMap, fixedparameter, fieldValToParam, mappingTextField='name', mappingTextShowKeyField,mappingValueField='code' } = requestConfig || {};
|
|
25
|
+
const resultSourceKey = sourceName || requestConfig?.sourceName || 'supplierCode'
|
|
24
26
|
|
|
25
27
|
const selectMode = selectProps?.mode // 设定当前选择器 为单选或者多选模式 无设定为单选模式(默认)
|
|
26
28
|
const initVal = value || (selectMode ? [] : null);
|
|
@@ -46,6 +48,7 @@ const SearchSelect = (props: any) => {
|
|
|
46
48
|
const [searchValue, setSearchValue] = useState('');
|
|
47
49
|
const [isModalVisible, setIsModalVisible] = useState(false);
|
|
48
50
|
const [popvalue, setPopValue] = useState(initVal);
|
|
51
|
+
const [uniqueValue, setUniqueValue] = useState(sourceName)
|
|
49
52
|
const { run } = useDebounceFn(
|
|
50
53
|
(v?: any) => {
|
|
51
54
|
// 优化搜索参数 支持传多个
|
|
@@ -144,7 +147,7 @@ const SearchSelect = (props: any) => {
|
|
|
144
147
|
}
|
|
145
148
|
source = Array.isArray(source) ? source : []
|
|
146
149
|
if(type === 1) {
|
|
147
|
-
ctx?.form?.setFieldSource(
|
|
150
|
+
ctx?.form?.setFieldSource(resultSourceKey, source)
|
|
148
151
|
setItems(source)
|
|
149
152
|
setItemsTotal(Number(res?.total))
|
|
150
153
|
} else {
|
|
@@ -181,6 +184,10 @@ const SearchSelect = (props: any) => {
|
|
|
181
184
|
}
|
|
182
185
|
}, [value]);
|
|
183
186
|
|
|
187
|
+
useEffect(() => {
|
|
188
|
+
makeUniqueValue();
|
|
189
|
+
}, [sourceName])
|
|
190
|
+
|
|
184
191
|
const showModal = () => {
|
|
185
192
|
getData({ pageSize: tableInitPageSize, currentPage: 1 }, 2)
|
|
186
193
|
setIsModalVisible(true);
|
|
@@ -207,7 +214,7 @@ const SearchSelect = (props: any) => {
|
|
|
207
214
|
formaData(popvalue);
|
|
208
215
|
// 解决选择最后1页的sku,返回后,不显示名称问题
|
|
209
216
|
const source = _.uniqBy(items.concat(popvalue), 'value')
|
|
210
|
-
ctx?.form?.setFieldSource(
|
|
217
|
+
ctx?.form?.setFieldSource(resultSourceKey, source)
|
|
211
218
|
setItems(source)
|
|
212
219
|
}
|
|
213
220
|
handleCancel();
|
|
@@ -341,6 +348,13 @@ const SearchSelect = (props: any) => {
|
|
|
341
348
|
setCheckedAll(filterRows.length === tablePagination?.total);
|
|
342
349
|
}
|
|
343
350
|
|
|
351
|
+
// 生成唯一值
|
|
352
|
+
const makeUniqueValue = () => {
|
|
353
|
+
const generateUnitKey = (((1+Math.random())*0x10000)|0).toString(16);
|
|
354
|
+
setUniqueValue(generateUnitKey);
|
|
355
|
+
return generateUnitKey;
|
|
356
|
+
}
|
|
357
|
+
|
|
344
358
|
const rowSelection = {
|
|
345
359
|
type: selectMode ? 'checkbox' : 'radio',
|
|
346
360
|
selectedRowKeys,
|
|
@@ -396,7 +410,7 @@ const SearchSelect = (props: any) => {
|
|
|
396
410
|
|
|
397
411
|
return (
|
|
398
412
|
<div className={'search_select'}>
|
|
399
|
-
<div className="search_select_show" id=
|
|
413
|
+
<div className="search_select_show" id={`search_select_div_${uniqueValue}`}>
|
|
400
414
|
<Select
|
|
401
415
|
virtual
|
|
402
416
|
labelInValue={labelInValue}
|
|
@@ -430,7 +444,7 @@ const SearchSelect = (props: any) => {
|
|
|
430
444
|
}
|
|
431
445
|
onPopupScroll={SelectScroll}
|
|
432
446
|
{...currentSelectProps}
|
|
433
|
-
getPopupContainer={() => document.getElementById(
|
|
447
|
+
getPopupContainer={() => document.getElementById(`search_select_div_${uniqueValue}`)}
|
|
434
448
|
style={{ width: 'calc(100% - 30px)' }}
|
|
435
449
|
placeholder="请选择"
|
|
436
450
|
>
|