@kmkf-fe-packages/basic-components 0.8.9-alpha.1 → 0.8.9-alpha.14
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 +81 -62
- package/dist/index.js +80 -61
- package/dist/src/apaas/ApaasRadio/index.d.ts +1 -0
- package/dist/src/apaas/ApaasSelect/index.d.ts +1 -0
- package/dist/src/bs/component/GoodItem/index.d.ts +1 -0
- package/dist/src/bs/component/GoodsModal.d.ts +1 -0
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useRef, useState, useEffect, useMemo, forwardRef, useImperativeHandle
|
|
1
|
+
import React, { useRef, useState, useEffect, useMemo, forwardRef, useImperativeHandle } from 'react';
|
|
2
2
|
import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, message, Radio, Space, Spin, Checkbox, Row, Col, Slider, Rate, Button, Form, Tabs, Modal, ConfigProvider, Pagination, Popover, Table } from 'antd';
|
|
3
3
|
import { EyeOutlined, DeleteOutlined, InboxOutlined } from '@ant-design/icons';
|
|
4
4
|
import request, { extend as extend$1 } from 'umi-request';
|
|
@@ -513,19 +513,22 @@ function ApaasInputNumber(props) {
|
|
|
513
513
|
return /*#__PURE__*/React.createElement(InputNumber, _objectSpread2({}, props));
|
|
514
514
|
}
|
|
515
515
|
|
|
516
|
-
var _excluded$2 = ["options", "basicMultSelect"];
|
|
516
|
+
var _excluded$2 = ["options", "basicMultSelect", "readonly"];
|
|
517
517
|
function ApaasSelect(props) {
|
|
518
518
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
519
519
|
var _props$options = props.options,
|
|
520
520
|
options = _props$options === void 0 ? [] : _props$options,
|
|
521
521
|
basicMultSelect = props.basicMultSelect,
|
|
522
|
+
readonly = props.readonly,
|
|
522
523
|
otherProps = _objectWithoutProperties(props, _excluded$2);
|
|
523
524
|
return /*#__PURE__*/React.createElement(Select, _objectSpread2(_objectSpread2({}, otherProps), {}, {
|
|
525
|
+
showSearch: !readonly,
|
|
524
526
|
style: {
|
|
525
527
|
width: '100%'
|
|
526
528
|
}
|
|
527
529
|
}), options.map(function (item) {
|
|
528
530
|
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
531
|
+
disabled: readonly,
|
|
529
532
|
value: item.value,
|
|
530
533
|
key: item.value
|
|
531
534
|
}, item.label);
|
|
@@ -803,7 +806,7 @@ var ApaasUpload = function ApaasUpload(_ref) {
|
|
|
803
806
|
})));
|
|
804
807
|
};
|
|
805
808
|
|
|
806
|
-
var _excluded$5 = ["showOther", "horizontal", "options", "value", "onChange", "disabled"];
|
|
809
|
+
var _excluded$5 = ["showOther", "horizontal", "options", "value", "onChange", "disabled", "hideUnselectedItem"];
|
|
807
810
|
function ApaasRadio(props) {
|
|
808
811
|
var showOther = props.showOther,
|
|
809
812
|
_props$horizontal = props.horizontal,
|
|
@@ -814,6 +817,7 @@ function ApaasRadio(props) {
|
|
|
814
817
|
value = _props$value === void 0 ? {} : _props$value,
|
|
815
818
|
onChange = props.onChange,
|
|
816
819
|
disabled = props.disabled,
|
|
820
|
+
hideUnselectedItem = props.hideUnselectedItem,
|
|
817
821
|
otherProps = _objectWithoutProperties(props, _excluded$5);
|
|
818
822
|
var radioValue = value.value,
|
|
819
823
|
other = value.other;
|
|
@@ -841,13 +845,14 @@ function ApaasRadio(props) {
|
|
|
841
845
|
direction: horizontal ? 'horizontal' : 'vertical',
|
|
842
846
|
wrap: true
|
|
843
847
|
}, options.map(function (item) {
|
|
848
|
+
if (hideUnselectedItem && item.value !== radioValue) return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
844
849
|
return /*#__PURE__*/React.createElement(Radio, {
|
|
845
850
|
value: item.value,
|
|
846
851
|
key: item.label,
|
|
847
852
|
disabled: disabled,
|
|
848
853
|
onClick: onRadioClick
|
|
849
854
|
}, item.label);
|
|
850
|
-
}), showOther && /*#__PURE__*/React.createElement(Radio, {
|
|
855
|
+
}), showOther && (!hideUnselectedItem || radioValue === '其他') && /*#__PURE__*/React.createElement(Radio, {
|
|
851
856
|
value: "\u5176\u4ED6",
|
|
852
857
|
disabled: disabled,
|
|
853
858
|
onClick: onRadioClick
|
|
@@ -9699,13 +9704,14 @@ var ItemList = function ItemList(props) {
|
|
|
9699
9704
|
}, "\u6682\u4E0D\u652F\u6301\u6DFB\u52A0")) : null);
|
|
9700
9705
|
};
|
|
9701
9706
|
|
|
9707
|
+
var _excluded$c = ["shopId"];
|
|
9702
9708
|
var columns = [{
|
|
9703
9709
|
dataIndex: 'index',
|
|
9704
|
-
title: '
|
|
9710
|
+
title: 'NO',
|
|
9705
9711
|
render: function render(val, record, index) {
|
|
9706
9712
|
return /*#__PURE__*/React.createElement("div", {
|
|
9707
9713
|
style: {
|
|
9708
|
-
width:
|
|
9714
|
+
width: 25
|
|
9709
9715
|
}
|
|
9710
9716
|
}, index + 1);
|
|
9711
9717
|
}
|
|
@@ -9757,12 +9763,12 @@ var columns = [{
|
|
|
9757
9763
|
var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
9758
9764
|
useImperativeHandle(ref, function () {
|
|
9759
9765
|
return {
|
|
9760
|
-
open: function open() {
|
|
9766
|
+
open: function open(shopCode) {
|
|
9761
9767
|
setVisible(true);
|
|
9762
9768
|
setPageNo(1);
|
|
9763
9769
|
setSelect([]);
|
|
9764
9770
|
setSelectIds([]);
|
|
9765
|
-
queryItems();
|
|
9771
|
+
queryItems(shopCode);
|
|
9766
9772
|
getShopList();
|
|
9767
9773
|
}
|
|
9768
9774
|
};
|
|
@@ -9771,7 +9777,7 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9771
9777
|
shopId = props.shopId,
|
|
9772
9778
|
shopList = props.shopList,
|
|
9773
9779
|
width = props.width,
|
|
9774
|
-
|
|
9780
|
+
companyKey = props.companyKey;
|
|
9775
9781
|
var _useState = useState(false),
|
|
9776
9782
|
_useState2 = _slicedToArray(_useState, 2),
|
|
9777
9783
|
visible = _useState2[0],
|
|
@@ -9826,44 +9832,49 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9826
9832
|
/**
|
|
9827
9833
|
* 查询商品
|
|
9828
9834
|
*/
|
|
9829
|
-
var queryItems =
|
|
9830
|
-
var
|
|
9831
|
-
|
|
9832
|
-
|
|
9833
|
-
|
|
9834
|
-
|
|
9835
|
-
|
|
9836
|
-
|
|
9837
|
-
_context.prev = 1;
|
|
9838
|
-
setLoading(true);
|
|
9839
|
-
params = {
|
|
9840
|
-
shopCode: shopCode
|
|
9841
|
-
};
|
|
9842
|
-
_context.next = 6;
|
|
9843
|
-
return extendRequest('/qy/gdfw/product/bsListProduct', {
|
|
9844
|
-
method: 'post',
|
|
9845
|
-
data: params
|
|
9846
|
-
});
|
|
9847
|
-
case 6:
|
|
9848
|
-
res = _context.sent;
|
|
9849
|
-
products = res.data.products;
|
|
9850
|
-
newProducts = (products || []).map(function (item, index) {
|
|
9851
|
-
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
9852
|
-
index: index + 1
|
|
9835
|
+
var queryItems = /*#__PURE__*/function () {
|
|
9836
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(shopCode) {
|
|
9837
|
+
var params, res, products, newProducts;
|
|
9838
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9839
|
+
while (1) switch (_context.prev = _context.next) {
|
|
9840
|
+
case 0:
|
|
9841
|
+
form.setFieldsValue({
|
|
9842
|
+
shopId: shopCode
|
|
9853
9843
|
});
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
|
|
9857
|
-
|
|
9858
|
-
|
|
9859
|
-
|
|
9860
|
-
|
|
9861
|
-
|
|
9862
|
-
|
|
9863
|
-
|
|
9864
|
-
|
|
9865
|
-
|
|
9866
|
-
|
|
9844
|
+
_context.prev = 1;
|
|
9845
|
+
setLoading(true);
|
|
9846
|
+
params = {
|
|
9847
|
+
shopCode: shopCode
|
|
9848
|
+
};
|
|
9849
|
+
_context.next = 6;
|
|
9850
|
+
return extendRequest('/qy/gdfw/product/bsListProduct', {
|
|
9851
|
+
method: 'post',
|
|
9852
|
+
data: params
|
|
9853
|
+
});
|
|
9854
|
+
case 6:
|
|
9855
|
+
res = _context.sent;
|
|
9856
|
+
products = res.data.products;
|
|
9857
|
+
newProducts = (products || []).map(function (item, index) {
|
|
9858
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
9859
|
+
index: index + 1
|
|
9860
|
+
});
|
|
9861
|
+
});
|
|
9862
|
+
setAllList(_toConsumableArray(newProducts));
|
|
9863
|
+
initData(_toConsumableArray(newProducts));
|
|
9864
|
+
case 11:
|
|
9865
|
+
_context.prev = 11;
|
|
9866
|
+
setLoading(false);
|
|
9867
|
+
return _context.finish(11);
|
|
9868
|
+
case 14:
|
|
9869
|
+
case "end":
|
|
9870
|
+
return _context.stop();
|
|
9871
|
+
}
|
|
9872
|
+
}, _callee, null, [[1,, 11, 14]]);
|
|
9873
|
+
}));
|
|
9874
|
+
return function queryItems(_x) {
|
|
9875
|
+
return _ref.apply(this, arguments);
|
|
9876
|
+
};
|
|
9877
|
+
}();
|
|
9867
9878
|
var rowSelection = {
|
|
9868
9879
|
selectedRowKeys: selectIds,
|
|
9869
9880
|
fixed: true,
|
|
@@ -9886,7 +9897,10 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9886
9897
|
onSubmit(selectList);
|
|
9887
9898
|
_onCancel();
|
|
9888
9899
|
};
|
|
9889
|
-
var onFinish = function onFinish(
|
|
9900
|
+
var onFinish = function onFinish(val) {
|
|
9901
|
+
var shopId = val.shopId,
|
|
9902
|
+
other = _objectWithoutProperties(val, _excluded$c);
|
|
9903
|
+
var value = other;
|
|
9890
9904
|
var newFilterList = [];
|
|
9891
9905
|
var hasValue = Object.values(value).some(function (t) {
|
|
9892
9906
|
return !!t;
|
|
@@ -9911,31 +9925,32 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9911
9925
|
};
|
|
9912
9926
|
var getShopList = /*#__PURE__*/function () {
|
|
9913
9927
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
9914
|
-
var _yield$request, success, data,
|
|
9928
|
+
var _yield$request, success, data, obj, list;
|
|
9915
9929
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
9916
9930
|
while (1) switch (_context2.prev = _context2.next) {
|
|
9917
9931
|
case 0:
|
|
9918
9932
|
_context2.next = 2;
|
|
9919
|
-
return extendRequest('/qy/
|
|
9920
|
-
method: '
|
|
9921
|
-
|
|
9922
|
-
|
|
9933
|
+
return extendRequest('/qy/diamond/getConfigInfo', {
|
|
9934
|
+
method: 'get',
|
|
9935
|
+
params: {
|
|
9936
|
+
key: 'company-third-shop-info'
|
|
9923
9937
|
}
|
|
9924
9938
|
});
|
|
9925
9939
|
case 2:
|
|
9926
9940
|
_yield$request = _context2.sent;
|
|
9927
9941
|
success = _yield$request.success;
|
|
9928
9942
|
data = _yield$request.data;
|
|
9943
|
+
obj = JSON.parse(data || '{}');
|
|
9929
9944
|
if (success) {
|
|
9930
|
-
list = (
|
|
9945
|
+
list = ((obj === null || obj === void 0 ? void 0 : obj[companyKey]) || []).map(function (item) {
|
|
9931
9946
|
return {
|
|
9932
|
-
label:
|
|
9933
|
-
value:
|
|
9947
|
+
label: item.shopName,
|
|
9948
|
+
value: item.shopCode
|
|
9934
9949
|
};
|
|
9935
9950
|
});
|
|
9936
9951
|
setShopList(list);
|
|
9937
9952
|
}
|
|
9938
|
-
case
|
|
9953
|
+
case 7:
|
|
9939
9954
|
case "end":
|
|
9940
9955
|
return _context2.stop();
|
|
9941
9956
|
}
|
|
@@ -9947,6 +9962,7 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9947
9962
|
}();
|
|
9948
9963
|
var onValuesChange = function onValuesChange(changedValues) {
|
|
9949
9964
|
if (changedValues === null || changedValues === void 0 ? void 0 : changedValues['shopId']) {
|
|
9965
|
+
queryItems(changedValues === null || changedValues === void 0 ? void 0 : changedValues.shopId);
|
|
9950
9966
|
pubsub.publish('changeShopCode', {
|
|
9951
9967
|
shopCode: changedValues.shopId
|
|
9952
9968
|
});
|
|
@@ -10072,6 +10088,8 @@ var GoodItem = function GoodItem(props) {
|
|
|
10072
10088
|
_props$canUpdateNumbe = props.canUpdateNumber,
|
|
10073
10089
|
canUpdateNumber = _props$canUpdateNumbe === void 0 ? false : _props$canUpdateNumbe,
|
|
10074
10090
|
shopCode = props.shopCode,
|
|
10091
|
+
_props$companyKey = props.companyKey,
|
|
10092
|
+
companyKey = _props$companyKey === void 0 ? '' : _props$companyKey,
|
|
10075
10093
|
onSelect = props.onSelect,
|
|
10076
10094
|
onDelete = props.onDelete;
|
|
10077
10095
|
var refModal = useRef();
|
|
@@ -10253,7 +10271,7 @@ var GoodItem = function GoodItem(props) {
|
|
|
10253
10271
|
}));
|
|
10254
10272
|
};
|
|
10255
10273
|
var handleChangeGoods = function handleChangeGoods() {
|
|
10256
|
-
refModal.current.open();
|
|
10274
|
+
refModal.current.open(shopCode);
|
|
10257
10275
|
};
|
|
10258
10276
|
var rowSelection = {
|
|
10259
10277
|
selectedRowKeys: selectedRowKeys,
|
|
@@ -10293,7 +10311,7 @@ var GoodItem = function GoodItem(props) {
|
|
|
10293
10311
|
shopList: shopList,
|
|
10294
10312
|
shopId: shopId,
|
|
10295
10313
|
maxLength: maxLength,
|
|
10296
|
-
|
|
10314
|
+
companyKey: companyKey
|
|
10297
10315
|
}));
|
|
10298
10316
|
};
|
|
10299
10317
|
|
|
@@ -10347,6 +10365,7 @@ var BsGoods = function BsGoods(props) {
|
|
|
10347
10365
|
}
|
|
10348
10366
|
});
|
|
10349
10367
|
pubsub.subscribeOnce('changeShopCode', function (type, data) {
|
|
10368
|
+
console.log(data);
|
|
10350
10369
|
onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
|
|
10351
10370
|
shopCode: data.shopCode
|
|
10352
10371
|
}));
|
|
@@ -10397,7 +10416,7 @@ var BsGoods = function BsGoods(props) {
|
|
|
10397
10416
|
}));
|
|
10398
10417
|
};
|
|
10399
10418
|
|
|
10400
|
-
var _excluded$
|
|
10419
|
+
var _excluded$d = ["value", "onChange", "reasonList", "disabled"];
|
|
10401
10420
|
var BsExchange = function BsExchange(props) {
|
|
10402
10421
|
var _value$bsExchangeType4, _value$bsExchangeType5, _value$bsExchangeType6;
|
|
10403
10422
|
var value = props.value,
|
|
@@ -10405,7 +10424,7 @@ var BsExchange = function BsExchange(props) {
|
|
|
10405
10424
|
_props$reasonList = props.reasonList,
|
|
10406
10425
|
reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
|
|
10407
10426
|
disabled = props.disabled,
|
|
10408
|
-
other = _objectWithoutProperties(props, _excluded$
|
|
10427
|
+
other = _objectWithoutProperties(props, _excluded$d);
|
|
10409
10428
|
var valueRef = useRef({});
|
|
10410
10429
|
useEffect(function () {
|
|
10411
10430
|
valueRef.current = value;
|
|
@@ -10627,14 +10646,14 @@ var BsExchange = function BsExchange(props) {
|
|
|
10627
10646
|
}))) : null);
|
|
10628
10647
|
};
|
|
10629
10648
|
|
|
10630
|
-
var _excluded$
|
|
10649
|
+
var _excluded$e = ["value", "onChange", "reasonList", "disabled"];
|
|
10631
10650
|
var BsReissue = function BsReissue(props) {
|
|
10632
10651
|
var value = props.value,
|
|
10633
10652
|
onChange = props.onChange,
|
|
10634
10653
|
_props$reasonList = props.reasonList,
|
|
10635
10654
|
reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
|
|
10636
10655
|
disabled = props.disabled,
|
|
10637
|
-
other = _objectWithoutProperties(props, _excluded$
|
|
10656
|
+
other = _objectWithoutProperties(props, _excluded$e);
|
|
10638
10657
|
var valueRef = useRef({});
|
|
10639
10658
|
useEffect(function () {
|
|
10640
10659
|
pubsub.subscribe('reissueSelectList', function (_, data) {
|
package/dist/index.js
CHANGED
|
@@ -524,19 +524,22 @@ function ApaasInputNumber(props) {
|
|
|
524
524
|
return /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, _objectSpread2({}, props));
|
|
525
525
|
}
|
|
526
526
|
|
|
527
|
-
var _excluded$2 = ["options", "basicMultSelect"];
|
|
527
|
+
var _excluded$2 = ["options", "basicMultSelect", "readonly"];
|
|
528
528
|
function ApaasSelect(props) {
|
|
529
529
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
530
530
|
var _props$options = props.options,
|
|
531
531
|
options = _props$options === void 0 ? [] : _props$options,
|
|
532
532
|
basicMultSelect = props.basicMultSelect,
|
|
533
|
+
readonly = props.readonly,
|
|
533
534
|
otherProps = _objectWithoutProperties(props, _excluded$2);
|
|
534
535
|
return /*#__PURE__*/React__default['default'].createElement(antd.Select, _objectSpread2(_objectSpread2({}, otherProps), {}, {
|
|
536
|
+
showSearch: !readonly,
|
|
535
537
|
style: {
|
|
536
538
|
width: '100%'
|
|
537
539
|
}
|
|
538
540
|
}), options.map(function (item) {
|
|
539
541
|
return /*#__PURE__*/React__default['default'].createElement(antd.Select.Option, {
|
|
542
|
+
disabled: readonly,
|
|
540
543
|
value: item.value,
|
|
541
544
|
key: item.value
|
|
542
545
|
}, item.label);
|
|
@@ -814,7 +817,7 @@ var ApaasUpload = function ApaasUpload(_ref) {
|
|
|
814
817
|
})));
|
|
815
818
|
};
|
|
816
819
|
|
|
817
|
-
var _excluded$5 = ["showOther", "horizontal", "options", "value", "onChange", "disabled"];
|
|
820
|
+
var _excluded$5 = ["showOther", "horizontal", "options", "value", "onChange", "disabled", "hideUnselectedItem"];
|
|
818
821
|
function ApaasRadio(props) {
|
|
819
822
|
var showOther = props.showOther,
|
|
820
823
|
_props$horizontal = props.horizontal,
|
|
@@ -825,6 +828,7 @@ function ApaasRadio(props) {
|
|
|
825
828
|
value = _props$value === void 0 ? {} : _props$value,
|
|
826
829
|
onChange = props.onChange,
|
|
827
830
|
disabled = props.disabled,
|
|
831
|
+
hideUnselectedItem = props.hideUnselectedItem,
|
|
828
832
|
otherProps = _objectWithoutProperties(props, _excluded$5);
|
|
829
833
|
var radioValue = value.value,
|
|
830
834
|
other = value.other;
|
|
@@ -852,13 +856,14 @@ function ApaasRadio(props) {
|
|
|
852
856
|
direction: horizontal ? 'horizontal' : 'vertical',
|
|
853
857
|
wrap: true
|
|
854
858
|
}, options.map(function (item) {
|
|
859
|
+
if (hideUnselectedItem && item.value !== radioValue) return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
855
860
|
return /*#__PURE__*/React__default['default'].createElement(antd.Radio, {
|
|
856
861
|
value: item.value,
|
|
857
862
|
key: item.label,
|
|
858
863
|
disabled: disabled,
|
|
859
864
|
onClick: onRadioClick
|
|
860
865
|
}, item.label);
|
|
861
|
-
}), showOther && /*#__PURE__*/React__default['default'].createElement(antd.Radio, {
|
|
866
|
+
}), showOther && (!hideUnselectedItem || radioValue === '其他') && /*#__PURE__*/React__default['default'].createElement(antd.Radio, {
|
|
862
867
|
value: "\u5176\u4ED6",
|
|
863
868
|
disabled: disabled,
|
|
864
869
|
onClick: onRadioClick
|
|
@@ -9710,13 +9715,14 @@ var ItemList = function ItemList(props) {
|
|
|
9710
9715
|
}, "\u6682\u4E0D\u652F\u6301\u6DFB\u52A0")) : null);
|
|
9711
9716
|
};
|
|
9712
9717
|
|
|
9718
|
+
var _excluded$c = ["shopId"];
|
|
9713
9719
|
var columns = [{
|
|
9714
9720
|
dataIndex: 'index',
|
|
9715
|
-
title: '
|
|
9721
|
+
title: 'NO',
|
|
9716
9722
|
render: function render(val, record, index) {
|
|
9717
9723
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
9718
9724
|
style: {
|
|
9719
|
-
width:
|
|
9725
|
+
width: 25
|
|
9720
9726
|
}
|
|
9721
9727
|
}, index + 1);
|
|
9722
9728
|
}
|
|
@@ -9768,12 +9774,12 @@ var columns = [{
|
|
|
9768
9774
|
var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
9769
9775
|
React.useImperativeHandle(ref, function () {
|
|
9770
9776
|
return {
|
|
9771
|
-
open: function open() {
|
|
9777
|
+
open: function open(shopCode) {
|
|
9772
9778
|
setVisible(true);
|
|
9773
9779
|
setPageNo(1);
|
|
9774
9780
|
setSelect([]);
|
|
9775
9781
|
setSelectIds([]);
|
|
9776
|
-
queryItems();
|
|
9782
|
+
queryItems(shopCode);
|
|
9777
9783
|
getShopList();
|
|
9778
9784
|
}
|
|
9779
9785
|
};
|
|
@@ -9782,7 +9788,7 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9782
9788
|
shopId = props.shopId,
|
|
9783
9789
|
shopList = props.shopList,
|
|
9784
9790
|
width = props.width,
|
|
9785
|
-
|
|
9791
|
+
companyKey = props.companyKey;
|
|
9786
9792
|
var _useState = React.useState(false),
|
|
9787
9793
|
_useState2 = _slicedToArray(_useState, 2),
|
|
9788
9794
|
visible = _useState2[0],
|
|
@@ -9837,44 +9843,49 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9837
9843
|
/**
|
|
9838
9844
|
* 查询商品
|
|
9839
9845
|
*/
|
|
9840
|
-
var queryItems =
|
|
9841
|
-
var
|
|
9842
|
-
|
|
9843
|
-
|
|
9844
|
-
|
|
9845
|
-
|
|
9846
|
-
|
|
9847
|
-
|
|
9848
|
-
_context.prev = 1;
|
|
9849
|
-
setLoading(true);
|
|
9850
|
-
params = {
|
|
9851
|
-
shopCode: shopCode
|
|
9852
|
-
};
|
|
9853
|
-
_context.next = 6;
|
|
9854
|
-
return extendRequest('/qy/gdfw/product/bsListProduct', {
|
|
9855
|
-
method: 'post',
|
|
9856
|
-
data: params
|
|
9857
|
-
});
|
|
9858
|
-
case 6:
|
|
9859
|
-
res = _context.sent;
|
|
9860
|
-
products = res.data.products;
|
|
9861
|
-
newProducts = (products || []).map(function (item, index) {
|
|
9862
|
-
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
9863
|
-
index: index + 1
|
|
9846
|
+
var queryItems = /*#__PURE__*/function () {
|
|
9847
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(shopCode) {
|
|
9848
|
+
var params, res, products, newProducts;
|
|
9849
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9850
|
+
while (1) switch (_context.prev = _context.next) {
|
|
9851
|
+
case 0:
|
|
9852
|
+
form.setFieldsValue({
|
|
9853
|
+
shopId: shopCode
|
|
9864
9854
|
});
|
|
9865
|
-
|
|
9866
|
-
|
|
9867
|
-
|
|
9868
|
-
|
|
9869
|
-
|
|
9870
|
-
|
|
9871
|
-
|
|
9872
|
-
|
|
9873
|
-
|
|
9874
|
-
|
|
9875
|
-
|
|
9876
|
-
|
|
9877
|
-
|
|
9855
|
+
_context.prev = 1;
|
|
9856
|
+
setLoading(true);
|
|
9857
|
+
params = {
|
|
9858
|
+
shopCode: shopCode
|
|
9859
|
+
};
|
|
9860
|
+
_context.next = 6;
|
|
9861
|
+
return extendRequest('/qy/gdfw/product/bsListProduct', {
|
|
9862
|
+
method: 'post',
|
|
9863
|
+
data: params
|
|
9864
|
+
});
|
|
9865
|
+
case 6:
|
|
9866
|
+
res = _context.sent;
|
|
9867
|
+
products = res.data.products;
|
|
9868
|
+
newProducts = (products || []).map(function (item, index) {
|
|
9869
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
9870
|
+
index: index + 1
|
|
9871
|
+
});
|
|
9872
|
+
});
|
|
9873
|
+
setAllList(_toConsumableArray(newProducts));
|
|
9874
|
+
initData(_toConsumableArray(newProducts));
|
|
9875
|
+
case 11:
|
|
9876
|
+
_context.prev = 11;
|
|
9877
|
+
setLoading(false);
|
|
9878
|
+
return _context.finish(11);
|
|
9879
|
+
case 14:
|
|
9880
|
+
case "end":
|
|
9881
|
+
return _context.stop();
|
|
9882
|
+
}
|
|
9883
|
+
}, _callee, null, [[1,, 11, 14]]);
|
|
9884
|
+
}));
|
|
9885
|
+
return function queryItems(_x) {
|
|
9886
|
+
return _ref.apply(this, arguments);
|
|
9887
|
+
};
|
|
9888
|
+
}();
|
|
9878
9889
|
var rowSelection = {
|
|
9879
9890
|
selectedRowKeys: selectIds,
|
|
9880
9891
|
fixed: true,
|
|
@@ -9897,7 +9908,10 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9897
9908
|
onSubmit(selectList);
|
|
9898
9909
|
_onCancel();
|
|
9899
9910
|
};
|
|
9900
|
-
var onFinish = function onFinish(
|
|
9911
|
+
var onFinish = function onFinish(val) {
|
|
9912
|
+
var shopId = val.shopId,
|
|
9913
|
+
other = _objectWithoutProperties(val, _excluded$c);
|
|
9914
|
+
var value = other;
|
|
9901
9915
|
var newFilterList = [];
|
|
9902
9916
|
var hasValue = Object.values(value).some(function (t) {
|
|
9903
9917
|
return !!t;
|
|
@@ -9922,31 +9936,32 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9922
9936
|
};
|
|
9923
9937
|
var getShopList = /*#__PURE__*/function () {
|
|
9924
9938
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
9925
|
-
var _yield$request, success, data,
|
|
9939
|
+
var _yield$request, success, data, obj, list;
|
|
9926
9940
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
9927
9941
|
while (1) switch (_context2.prev = _context2.next) {
|
|
9928
9942
|
case 0:
|
|
9929
9943
|
_context2.next = 2;
|
|
9930
|
-
return extendRequest('/qy/
|
|
9931
|
-
method: '
|
|
9932
|
-
|
|
9933
|
-
|
|
9944
|
+
return extendRequest('/qy/diamond/getConfigInfo', {
|
|
9945
|
+
method: 'get',
|
|
9946
|
+
params: {
|
|
9947
|
+
key: 'company-third-shop-info'
|
|
9934
9948
|
}
|
|
9935
9949
|
});
|
|
9936
9950
|
case 2:
|
|
9937
9951
|
_yield$request = _context2.sent;
|
|
9938
9952
|
success = _yield$request.success;
|
|
9939
9953
|
data = _yield$request.data;
|
|
9954
|
+
obj = JSON.parse(data || '{}');
|
|
9940
9955
|
if (success) {
|
|
9941
|
-
list = (
|
|
9956
|
+
list = ((obj === null || obj === void 0 ? void 0 : obj[companyKey]) || []).map(function (item) {
|
|
9942
9957
|
return {
|
|
9943
|
-
label:
|
|
9944
|
-
value:
|
|
9958
|
+
label: item.shopName,
|
|
9959
|
+
value: item.shopCode
|
|
9945
9960
|
};
|
|
9946
9961
|
});
|
|
9947
9962
|
setShopList(list);
|
|
9948
9963
|
}
|
|
9949
|
-
case
|
|
9964
|
+
case 7:
|
|
9950
9965
|
case "end":
|
|
9951
9966
|
return _context2.stop();
|
|
9952
9967
|
}
|
|
@@ -9958,6 +9973,7 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9958
9973
|
}();
|
|
9959
9974
|
var onValuesChange = function onValuesChange(changedValues) {
|
|
9960
9975
|
if (changedValues === null || changedValues === void 0 ? void 0 : changedValues['shopId']) {
|
|
9976
|
+
queryItems(changedValues === null || changedValues === void 0 ? void 0 : changedValues.shopId);
|
|
9961
9977
|
pubsub__default['default'].publish('changeShopCode', {
|
|
9962
9978
|
shopCode: changedValues.shopId
|
|
9963
9979
|
});
|
|
@@ -10083,6 +10099,8 @@ var GoodItem = function GoodItem(props) {
|
|
|
10083
10099
|
_props$canUpdateNumbe = props.canUpdateNumber,
|
|
10084
10100
|
canUpdateNumber = _props$canUpdateNumbe === void 0 ? false : _props$canUpdateNumbe,
|
|
10085
10101
|
shopCode = props.shopCode,
|
|
10102
|
+
_props$companyKey = props.companyKey,
|
|
10103
|
+
companyKey = _props$companyKey === void 0 ? '' : _props$companyKey,
|
|
10086
10104
|
onSelect = props.onSelect,
|
|
10087
10105
|
onDelete = props.onDelete;
|
|
10088
10106
|
var refModal = React.useRef();
|
|
@@ -10264,7 +10282,7 @@ var GoodItem = function GoodItem(props) {
|
|
|
10264
10282
|
}));
|
|
10265
10283
|
};
|
|
10266
10284
|
var handleChangeGoods = function handleChangeGoods() {
|
|
10267
|
-
refModal.current.open();
|
|
10285
|
+
refModal.current.open(shopCode);
|
|
10268
10286
|
};
|
|
10269
10287
|
var rowSelection = {
|
|
10270
10288
|
selectedRowKeys: selectedRowKeys,
|
|
@@ -10304,7 +10322,7 @@ var GoodItem = function GoodItem(props) {
|
|
|
10304
10322
|
shopList: shopList,
|
|
10305
10323
|
shopId: shopId,
|
|
10306
10324
|
maxLength: maxLength,
|
|
10307
|
-
|
|
10325
|
+
companyKey: companyKey
|
|
10308
10326
|
}));
|
|
10309
10327
|
};
|
|
10310
10328
|
|
|
@@ -10358,6 +10376,7 @@ var BsGoods = function BsGoods(props) {
|
|
|
10358
10376
|
}
|
|
10359
10377
|
});
|
|
10360
10378
|
pubsub__default['default'].subscribeOnce('changeShopCode', function (type, data) {
|
|
10379
|
+
console.log(data);
|
|
10361
10380
|
onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
|
|
10362
10381
|
shopCode: data.shopCode
|
|
10363
10382
|
}));
|
|
@@ -10408,7 +10427,7 @@ var BsGoods = function BsGoods(props) {
|
|
|
10408
10427
|
}));
|
|
10409
10428
|
};
|
|
10410
10429
|
|
|
10411
|
-
var _excluded$
|
|
10430
|
+
var _excluded$d = ["value", "onChange", "reasonList", "disabled"];
|
|
10412
10431
|
var BsExchange = function BsExchange(props) {
|
|
10413
10432
|
var _value$bsExchangeType4, _value$bsExchangeType5, _value$bsExchangeType6;
|
|
10414
10433
|
var value = props.value,
|
|
@@ -10416,7 +10435,7 @@ var BsExchange = function BsExchange(props) {
|
|
|
10416
10435
|
_props$reasonList = props.reasonList,
|
|
10417
10436
|
reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
|
|
10418
10437
|
disabled = props.disabled,
|
|
10419
|
-
other = _objectWithoutProperties(props, _excluded$
|
|
10438
|
+
other = _objectWithoutProperties(props, _excluded$d);
|
|
10420
10439
|
var valueRef = React.useRef({});
|
|
10421
10440
|
React.useEffect(function () {
|
|
10422
10441
|
valueRef.current = value;
|
|
@@ -10638,14 +10657,14 @@ var BsExchange = function BsExchange(props) {
|
|
|
10638
10657
|
}))) : null);
|
|
10639
10658
|
};
|
|
10640
10659
|
|
|
10641
|
-
var _excluded$
|
|
10660
|
+
var _excluded$e = ["value", "onChange", "reasonList", "disabled"];
|
|
10642
10661
|
var BsReissue = function BsReissue(props) {
|
|
10643
10662
|
var value = props.value,
|
|
10644
10663
|
onChange = props.onChange,
|
|
10645
10664
|
_props$reasonList = props.reasonList,
|
|
10646
10665
|
reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
|
|
10647
10666
|
disabled = props.disabled,
|
|
10648
|
-
other = _objectWithoutProperties(props, _excluded$
|
|
10667
|
+
other = _objectWithoutProperties(props, _excluded$e);
|
|
10649
10668
|
var valueRef = React.useRef({});
|
|
10650
10669
|
React.useEffect(function () {
|
|
10651
10670
|
pubsub__default['default'].subscribe('reissueSelectList', function (_, data) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/basic-components",
|
|
3
|
-
"version": "0.8.9-alpha.
|
|
3
|
+
"version": "0.8.9-alpha.14",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"watch": "nodemon --ignore dist/ --ignore node_modules/ --watch src/ -C -e ts,tsx,less --debug -x 'yarn async'"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@kmkf-fe-packages/kmkf-utils": "^0.8.
|
|
23
|
+
"@kmkf-fe-packages/kmkf-utils": "^0.8.9-alpha.9",
|
|
24
24
|
"lodash": "^4.17.21",
|
|
25
25
|
"pubsub-js": "^1.9.4",
|
|
26
26
|
"umi-request": "^1.4.0"
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "3a28d034441471c57ea0b8a5d123fdbae7722b2e"
|
|
62
62
|
}
|