@kmkf-fe-packages/basic-components 0.7.15-alpha.26 → 0.7.15-alpha.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/index.esm.js CHANGED
@@ -9396,6 +9396,7 @@ var LogisticsTrajectory = function LogisticsTrajectory(props) {
9396
9396
  //sf手机号
9397
9397
  var LogisticsPhone = function LogisticsPhone() {
9398
9398
  return /*#__PURE__*/React.createElement(Input, {
9399
+ disabled: disabled,
9399
9400
  style: {
9400
9401
  marginTop: '8px'
9401
9402
  },
@@ -9699,21 +9700,15 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9699
9700
  _useState18 = _slicedToArray(_useState17, 2),
9700
9701
  shopInfo = _useState18[0],
9701
9702
  setShopInfo = _useState18[1]; //店铺信息
9702
- var _useState19 = useState([{
9703
- tab: '所选商品',
9704
- key: 'onSale'
9705
- }
9706
- // { tab: '已选商品', key: 'select' },
9707
- ]),
9708
- _useState20 = _slicedToArray(_useState19, 1),
9709
- tabs = _useState20[0];
9703
+ var _Form$useForm = Form.useForm(),
9704
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
9705
+ form = _Form$useForm2[0];
9710
9706
  //选择页码
9711
9707
  var pageChange = function pageChange(page, pageSize) {
9712
9708
  setSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, {
9713
9709
  pageNo: page,
9714
9710
  pageSize: pageSize
9715
9711
  }));
9716
- queryItems();
9717
9712
  };
9718
9713
  /**
9719
9714
  *
@@ -9737,53 +9732,48 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9737
9732
  /**
9738
9733
  * 查询商品
9739
9734
  */
9740
- var queryItems = /*#__PURE__*/function () {
9741
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
9742
- var params, res, _ref2, list, _total, nextKey, newList;
9743
- return _regeneratorRuntime().wrap(function _callee$(_context) {
9744
- while (1) switch (_context.prev = _context.next) {
9745
- case 0:
9746
- _context.prev = 0;
9747
- setLoading(true);
9748
- params = _objectSpread2({}, queryPd());
9749
- params.shopName = shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.shopName;
9750
- params.platform = platform;
9751
- params.status = params.type === 'onSale' ? 1 : 0;
9752
- delete params.type;
9753
- _context.next = 9;
9754
- return extendRequest('/qy/gdfw/product/listProduct', {
9755
- method: 'post',
9756
- data: params
9757
- });
9758
- case 9:
9759
- res = _context.sent;
9760
- _ref2 = res.data || {
9761
- result: [],
9762
- total: 0
9763
- }, list = _ref2.result, _total = _ref2.total, nextKey = _ref2.nextKey;
9764
- newList = list || [];
9765
- newList.forEach(function (item) {
9766
- item.numIid = item.productId;
9767
- item.outerId = item.outId;
9768
- item.title = item.productName;
9769
- item.platform = platform;
9770
- });
9771
- setGoodList(newList);
9772
- setTotal(_total);
9773
- case 15:
9774
- _context.prev = 15;
9775
- setLoading(false);
9776
- return _context.finish(15);
9777
- case 18:
9778
- case "end":
9779
- return _context.stop();
9780
- }
9781
- }, _callee, null, [[0,, 15, 18]]);
9782
- }));
9783
- return function queryItems() {
9784
- return _ref.apply(this, arguments);
9785
- };
9786
- }();
9735
+ var queryItems = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
9736
+ var params, res, _ref2, list, _total, nextKey, newList;
9737
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9738
+ while (1) switch (_context.prev = _context.next) {
9739
+ case 0:
9740
+ _context.prev = 0;
9741
+ setLoading(true);
9742
+ params = _objectSpread2({}, queryPd());
9743
+ params.shopName = shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.shopName;
9744
+ params.platform = platform;
9745
+ params.status = params.type === 'onSale' ? 1 : 0;
9746
+ delete params.type;
9747
+ _context.next = 9;
9748
+ return extendRequest('/qy/gdfw/product/listProduct', {
9749
+ method: 'post',
9750
+ data: params
9751
+ });
9752
+ case 9:
9753
+ res = _context.sent;
9754
+ _ref2 = res.data || {
9755
+ result: [],
9756
+ total: 0
9757
+ }, list = _ref2.result, _total = _ref2.total, nextKey = _ref2.nextKey;
9758
+ newList = list || [];
9759
+ newList.forEach(function (item) {
9760
+ item.numIid = item.productId;
9761
+ item.outerId = item.outId;
9762
+ item.title = item.productName;
9763
+ item.platform = platform;
9764
+ });
9765
+ setGoodList(newList);
9766
+ setTotal(_total);
9767
+ case 15:
9768
+ _context.prev = 15;
9769
+ setLoading(false);
9770
+ return _context.finish(15);
9771
+ case 18:
9772
+ case "end":
9773
+ return _context.stop();
9774
+ }
9775
+ }, _callee, null, [[0,, 15, 18]]);
9776
+ })), [searchParams]);
9787
9777
  useEffect(function () {
9788
9778
  var shopInfo = shopList.find(function (item) {
9789
9779
  return shopId === item.shopId || shopId === item.shopName;
@@ -9807,6 +9797,14 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9807
9797
  onSubmit(selectList);
9808
9798
  _onCancel();
9809
9799
  };
9800
+ var onFinish = function onFinish(value) {
9801
+ console.log(value);
9802
+ setSearch(_objectSpread2({}, searchParams));
9803
+ };
9804
+ var onReset = function onReset() {
9805
+ setSearch(_objectSpread2({}, searchParams));
9806
+ form.resetFields();
9807
+ };
9810
9808
  return /*#__PURE__*/React.createElement(Modal, {
9811
9809
  title: '选择商品',
9812
9810
  okText: '确认',
@@ -9819,17 +9817,27 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9819
9817
  onOk: onOk,
9820
9818
  wrapClassName: "goodModal"
9821
9819
  }, /*#__PURE__*/React.createElement(Form, {
9822
- layout: "inline"
9823
- }, /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement(Input, {
9820
+ layout: "inline",
9821
+ form: form,
9822
+ onFinish: onFinish
9823
+ }, /*#__PURE__*/React.createElement(Form.Item, {
9824
+ name: "code"
9825
+ }, /*#__PURE__*/React.createElement(Input, {
9824
9826
  placeholder: "\u6B3E\u5F0F\u7F16\u7801"
9825
- })), /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement(Input, {
9827
+ })), /*#__PURE__*/React.createElement(Form.Item, {
9828
+ name: "sku"
9829
+ }, /*#__PURE__*/React.createElement(Input, {
9826
9830
  placeholder: "\u5546\u54C1\u7F16\u7801"
9827
- })), /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement(Input, {
9831
+ })), /*#__PURE__*/React.createElement(Form.Item, {
9832
+ name: "name"
9833
+ }, /*#__PURE__*/React.createElement(Input, {
9828
9834
  placeholder: "\u5546\u54C1\u540D\u79F0"
9829
9835
  })), /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement(Button, {
9830
9836
  type: "primary",
9831
9837
  htmlType: "submit"
9832
- }, "\u67E5\u8BE2"), /*#__PURE__*/React.createElement(Button, null, "\u91CD\u7F6E"))), /*#__PURE__*/React.createElement(Spin, {
9838
+ }, "\u67E5\u8BE2"), /*#__PURE__*/React.createElement(Button, {
9839
+ onClick: onReset
9840
+ }, "\u91CD\u7F6E"))), /*#__PURE__*/React.createElement(Spin, {
9833
9841
  spinning: loading
9834
9842
  }, /*#__PURE__*/React.createElement(Table, {
9835
9843
  rowSelection: rowSelection,
@@ -9862,8 +9870,8 @@ var GoodItem = function GoodItem(props) {
9862
9870
  value = _props$value === void 0 ? [] : _props$value,
9863
9871
  onChange = props.onChange,
9864
9872
  disabled = props.disabled,
9865
- _props$showField = props.showField,
9866
- showField = _props$showField === void 0 ? [] : _props$showField,
9873
+ _props$showHeader = props.showHeader,
9874
+ showHeader = _props$showHeader === void 0 ? [] : _props$showHeader,
9867
9875
  width = props.width,
9868
9876
  _props$shopList = props.shopList,
9869
9877
  shopList = _props$shopList === void 0 ? [] : _props$shopList,
@@ -9982,7 +9990,7 @@ var GoodItem = function GoodItem(props) {
9982
9990
  return /*#__PURE__*/React.createElement("span", null, index + 1);
9983
9991
  }
9984
9992
  }].concat(_toConsumableArray(GOODS_INFO_COLUMNS().filter(function (t) {
9985
- return showField.includes(t === null || t === void 0 ? void 0 : t.dataIndex);
9993
+ return showHeader.includes(t === null || t === void 0 ? void 0 : t.dataIndex);
9986
9994
  })));
9987
9995
  if (!disabled) {
9988
9996
  columnList.push({
@@ -10002,7 +10010,7 @@ var GoodItem = function GoodItem(props) {
10002
10010
  });
10003
10011
  }
10004
10012
  return columnList;
10005
- }, [showField, value, disabled]);
10013
+ }, [showHeader, value, disabled]);
10006
10014
  var onSubmit = function onSubmit(list) {
10007
10015
  var newList = list.map(function (item) {
10008
10016
  var picUrl = item.picUrl,
package/dist/index.js CHANGED
@@ -9407,6 +9407,7 @@ var LogisticsTrajectory = function LogisticsTrajectory(props) {
9407
9407
  //sf手机号
9408
9408
  var LogisticsPhone = function LogisticsPhone() {
9409
9409
  return /*#__PURE__*/React__default['default'].createElement(antd.Input, {
9410
+ disabled: disabled,
9410
9411
  style: {
9411
9412
  marginTop: '8px'
9412
9413
  },
@@ -9710,21 +9711,15 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9710
9711
  _useState18 = _slicedToArray(_useState17, 2),
9711
9712
  shopInfo = _useState18[0],
9712
9713
  setShopInfo = _useState18[1]; //店铺信息
9713
- var _useState19 = React.useState([{
9714
- tab: '所选商品',
9715
- key: 'onSale'
9716
- }
9717
- // { tab: '已选商品', key: 'select' },
9718
- ]),
9719
- _useState20 = _slicedToArray(_useState19, 1),
9720
- tabs = _useState20[0];
9714
+ var _Form$useForm = antd.Form.useForm(),
9715
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
9716
+ form = _Form$useForm2[0];
9721
9717
  //选择页码
9722
9718
  var pageChange = function pageChange(page, pageSize) {
9723
9719
  setSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, {
9724
9720
  pageNo: page,
9725
9721
  pageSize: pageSize
9726
9722
  }));
9727
- queryItems();
9728
9723
  };
9729
9724
  /**
9730
9725
  *
@@ -9748,53 +9743,48 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9748
9743
  /**
9749
9744
  * 查询商品
9750
9745
  */
9751
- var queryItems = /*#__PURE__*/function () {
9752
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
9753
- var params, res, _ref2, list, _total, nextKey, newList;
9754
- return _regeneratorRuntime().wrap(function _callee$(_context) {
9755
- while (1) switch (_context.prev = _context.next) {
9756
- case 0:
9757
- _context.prev = 0;
9758
- setLoading(true);
9759
- params = _objectSpread2({}, queryPd());
9760
- params.shopName = shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.shopName;
9761
- params.platform = platform;
9762
- params.status = params.type === 'onSale' ? 1 : 0;
9763
- delete params.type;
9764
- _context.next = 9;
9765
- return extendRequest('/qy/gdfw/product/listProduct', {
9766
- method: 'post',
9767
- data: params
9768
- });
9769
- case 9:
9770
- res = _context.sent;
9771
- _ref2 = res.data || {
9772
- result: [],
9773
- total: 0
9774
- }, list = _ref2.result, _total = _ref2.total, nextKey = _ref2.nextKey;
9775
- newList = list || [];
9776
- newList.forEach(function (item) {
9777
- item.numIid = item.productId;
9778
- item.outerId = item.outId;
9779
- item.title = item.productName;
9780
- item.platform = platform;
9781
- });
9782
- setGoodList(newList);
9783
- setTotal(_total);
9784
- case 15:
9785
- _context.prev = 15;
9786
- setLoading(false);
9787
- return _context.finish(15);
9788
- case 18:
9789
- case "end":
9790
- return _context.stop();
9791
- }
9792
- }, _callee, null, [[0,, 15, 18]]);
9793
- }));
9794
- return function queryItems() {
9795
- return _ref.apply(this, arguments);
9796
- };
9797
- }();
9746
+ var queryItems = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
9747
+ var params, res, _ref2, list, _total, nextKey, newList;
9748
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9749
+ while (1) switch (_context.prev = _context.next) {
9750
+ case 0:
9751
+ _context.prev = 0;
9752
+ setLoading(true);
9753
+ params = _objectSpread2({}, queryPd());
9754
+ params.shopName = shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.shopName;
9755
+ params.platform = platform;
9756
+ params.status = params.type === 'onSale' ? 1 : 0;
9757
+ delete params.type;
9758
+ _context.next = 9;
9759
+ return extendRequest('/qy/gdfw/product/listProduct', {
9760
+ method: 'post',
9761
+ data: params
9762
+ });
9763
+ case 9:
9764
+ res = _context.sent;
9765
+ _ref2 = res.data || {
9766
+ result: [],
9767
+ total: 0
9768
+ }, list = _ref2.result, _total = _ref2.total, nextKey = _ref2.nextKey;
9769
+ newList = list || [];
9770
+ newList.forEach(function (item) {
9771
+ item.numIid = item.productId;
9772
+ item.outerId = item.outId;
9773
+ item.title = item.productName;
9774
+ item.platform = platform;
9775
+ });
9776
+ setGoodList(newList);
9777
+ setTotal(_total);
9778
+ case 15:
9779
+ _context.prev = 15;
9780
+ setLoading(false);
9781
+ return _context.finish(15);
9782
+ case 18:
9783
+ case "end":
9784
+ return _context.stop();
9785
+ }
9786
+ }, _callee, null, [[0,, 15, 18]]);
9787
+ })), [searchParams]);
9798
9788
  React.useEffect(function () {
9799
9789
  var shopInfo = shopList.find(function (item) {
9800
9790
  return shopId === item.shopId || shopId === item.shopName;
@@ -9818,6 +9808,14 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9818
9808
  onSubmit(selectList);
9819
9809
  _onCancel();
9820
9810
  };
9811
+ var onFinish = function onFinish(value) {
9812
+ console.log(value);
9813
+ setSearch(_objectSpread2({}, searchParams));
9814
+ };
9815
+ var onReset = function onReset() {
9816
+ setSearch(_objectSpread2({}, searchParams));
9817
+ form.resetFields();
9818
+ };
9821
9819
  return /*#__PURE__*/React__default['default'].createElement(antd.Modal, {
9822
9820
  title: '选择商品',
9823
9821
  okText: '确认',
@@ -9830,17 +9828,27 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9830
9828
  onOk: onOk,
9831
9829
  wrapClassName: "goodModal"
9832
9830
  }, /*#__PURE__*/React__default['default'].createElement(antd.Form, {
9833
- layout: "inline"
9834
- }, /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
9831
+ layout: "inline",
9832
+ form: form,
9833
+ onFinish: onFinish
9834
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
9835
+ name: "code"
9836
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
9835
9837
  placeholder: "\u6B3E\u5F0F\u7F16\u7801"
9836
- })), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
9838
+ })), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
9839
+ name: "sku"
9840
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
9837
9841
  placeholder: "\u5546\u54C1\u7F16\u7801"
9838
- })), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
9842
+ })), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
9843
+ name: "name"
9844
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
9839
9845
  placeholder: "\u5546\u54C1\u540D\u79F0"
9840
9846
  })), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, null, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
9841
9847
  type: "primary",
9842
9848
  htmlType: "submit"
9843
- }, "\u67E5\u8BE2"), /*#__PURE__*/React__default['default'].createElement(antd.Button, null, "\u91CD\u7F6E"))), /*#__PURE__*/React__default['default'].createElement(antd.Spin, {
9849
+ }, "\u67E5\u8BE2"), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
9850
+ onClick: onReset
9851
+ }, "\u91CD\u7F6E"))), /*#__PURE__*/React__default['default'].createElement(antd.Spin, {
9844
9852
  spinning: loading
9845
9853
  }, /*#__PURE__*/React__default['default'].createElement(antd.Table, {
9846
9854
  rowSelection: rowSelection,
@@ -9873,8 +9881,8 @@ var GoodItem = function GoodItem(props) {
9873
9881
  value = _props$value === void 0 ? [] : _props$value,
9874
9882
  onChange = props.onChange,
9875
9883
  disabled = props.disabled,
9876
- _props$showField = props.showField,
9877
- showField = _props$showField === void 0 ? [] : _props$showField,
9884
+ _props$showHeader = props.showHeader,
9885
+ showHeader = _props$showHeader === void 0 ? [] : _props$showHeader,
9878
9886
  width = props.width,
9879
9887
  _props$shopList = props.shopList,
9880
9888
  shopList = _props$shopList === void 0 ? [] : _props$shopList,
@@ -9993,7 +10001,7 @@ var GoodItem = function GoodItem(props) {
9993
10001
  return /*#__PURE__*/React__default['default'].createElement("span", null, index + 1);
9994
10002
  }
9995
10003
  }].concat(_toConsumableArray(GOODS_INFO_COLUMNS().filter(function (t) {
9996
- return showField.includes(t === null || t === void 0 ? void 0 : t.dataIndex);
10004
+ return showHeader.includes(t === null || t === void 0 ? void 0 : t.dataIndex);
9997
10005
  })));
9998
10006
  if (!disabled) {
9999
10007
  columnList.push({
@@ -10013,7 +10021,7 @@ var GoodItem = function GoodItem(props) {
10013
10021
  });
10014
10022
  }
10015
10023
  return columnList;
10016
- }, [showField, value, disabled]);
10024
+ }, [showHeader, value, disabled]);
10017
10025
  var onSubmit = function onSubmit(list) {
10018
10026
  var newList = list.map(function (item) {
10019
10027
  var picUrl = item.picUrl,
@@ -4,7 +4,7 @@ interface BsGoodsProps {
4
4
  type: number;
5
5
  options: any[];
6
6
  disabled: boolean;
7
- showField: string[];
7
+ showHeader: string[];
8
8
  width: number;
9
9
  shopList: any[];
10
10
  shopId: string | number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "0.7.15-alpha.26",
3
+ "version": "0.7.15-alpha.27",
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.7.15-alpha.26",
23
+ "@kmkf-fe-packages/kmkf-utils": "^0.7.15-alpha.27",
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": "1864859c358cb78f091b1fdca91c1d3171bd5584"
61
+ "gitHead": "60218b9dc2250d8cbe366629af669ba395ca2551"
62
62
  }