@kmkf-fe-packages/basic-components 0.24.1-alpha.1 → 0.24.1-alpha.13

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
@@ -1,11 +1,11 @@
1
1
  import React, { useRef, useState, useEffect, forwardRef, useImperativeHandle, useMemo } from 'react';
2
2
  import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, message, Radio, Space, Spin, Modal, Button, Checkbox, Row, Col, Slider, Rate, Form, Tabs, ConfigProvider, Pagination, Popover, Table } from 'antd';
3
- import { EyeOutlined, DeleteOutlined } from '@ant-design/icons';
3
+ import { EyeOutlined, DeleteOutlined, CaretUpOutlined } from '@ant-design/icons';
4
4
  import request, { extend as extend$1 } from 'umi-request';
5
5
  import { CopyToClipboard } from 'react-copy-to-clipboard';
6
6
  import { AddressData, BsAddressData, toTree, request as request$1, ExpressData, uuid, LogisticsAddressData } from '@kmkf-fe-packages/kmkf-utils';
7
7
  import zhCN from 'antd/lib/locale/zh_CN';
8
- import { cloneDeep } from 'lodash';
8
+ import { cloneDeep, difference, differenceWith } from 'lodash';
9
9
  import { useDebounceEffect } from 'ahooks';
10
10
  import pubsub from 'pubsub-js';
11
11
 
@@ -7437,7 +7437,9 @@ var Province = function Province(props) {
7437
7437
 
7438
7438
  var TextArea = Input.TextArea;
7439
7439
  var ParseLogistics = function ParseLogistics(props) {
7440
- var onChange = props.onChange;
7440
+ var onChange = props.onChange,
7441
+ _props$selfCalibratio = props.selfCalibration,
7442
+ selfCalibration = _props$selfCalibratio === void 0 ? false : _props$selfCalibratio;
7441
7443
  var _useState = useState(''),
7442
7444
  _useState2 = _slicedToArray(_useState, 2),
7443
7445
  value = _useState2[0],
@@ -7450,15 +7452,22 @@ var ParseLogistics = function ParseLogistics(props) {
7450
7452
  if (!value && !val) {
7451
7453
  return;
7452
7454
  }
7455
+ var fullAddress = value || val;
7456
+ var needCalibration = selfCalibration && !/1\d{10}/.test(fullAddress);
7453
7457
  setIsCopy(false);
7454
7458
  request$1({
7455
7459
  url: '/qy/logistics/addressAnalysis',
7456
7460
  method: 'post',
7457
7461
  data: {
7458
- fullAddress: value || val
7462
+ fullAddress: needCalibration ? "".concat(fullAddress, " \u5F20\u4E09 18888888888") : fullAddress
7459
7463
  }
7460
7464
  }).then(function (res) {
7461
7465
  var data = res.data;
7466
+ // 如果是通过内部校准添加的姓名和手机号,则去除
7467
+ if (needCalibration) {
7468
+ data.name = '';
7469
+ data.phone = '';
7470
+ }
7462
7471
  onChange === null || onChange === void 0 ? void 0 : onChange(data);
7463
7472
  }).catch(function (e) {
7464
7473
  console.log(e);
@@ -7765,6 +7774,7 @@ function ApaasAddress(props) {
7765
7774
  onChange === null || onChange === void 0 ? void 0 : onChange(params);
7766
7775
  };
7767
7776
  return /*#__PURE__*/React.createElement(React.Fragment, null, !disabled && showIdentify && /*#__PURE__*/React.createElement(ParseLogistics, {
7777
+ selfCalibration: true,
7768
7778
  onChange: handleParseLogistics
7769
7779
  }), /*#__PURE__*/React.createElement(Province, {
7770
7780
  value: value === null || value === void 0 ? void 0 : value.address,
@@ -8941,7 +8951,7 @@ var ChooseBaby = function ChooseBaby(props) {
8941
8951
  }));
8942
8952
  };
8943
8953
 
8944
- var css_248z$6 = ".goodsBox.single-row {\n max-height: 800px;\n overflow-y: auto;\n padding-top: 4px;\n flex-basis: 100%;\n}\n.goodsBox.single-row .goodBox-Img.rich-item.with-pic,\n.goodsBox.single-row .goodBox-Img.rich-item.with-attr,\n.goodsBox.single-row .goodBox-Img.rich-item.with-attr.with-pic {\n flex-basis: 100%;\n}\n.goodsBox.single-row .goodBox-Img.rich-item .right-context {\n flex-grow: 1;\n flex-shrink: 1;\n}\n.goodsBox.single-row .goodBox-Img.rich-item .right-context .good-item-attr {\n flex-grow: 1;\n flex-shrink: 1;\n max-width: 80px;\n width: 20px;\n flex-basis: 20px;\n}\n.goodsBox.single-row .goodBox-Img.rich-item .right-context .ant-input {\n flex-shrink: 1;\n flex-grow: 1;\n width: 20px;\n flex-basis: 40px;\n}\n.goodBox-Img.rich-item {\n position: relative;\n border: 1px solid #ccc;\n display: flex;\n flex-basis: 80px;\n flex-wrap: wrap;\n margin: 0 10px 10px 0;\n padding: 4px;\n}\n.goodBox-Img.rich-item.with-pic {\n flex-basis: 90px;\n}\n.goodBox-Img.rich-item.with-attr {\n flex-basis: 150px;\n}\n.goodBox-Img.rich-item.with-attr.with-pic {\n flex-basis: 238px;\n}\n.goodBox-Img.rich-item.with-attr.with-pic .goods-imgBox {\n margin-right: 8px;\n}\n.goodBox-Img.rich-item .good-item-attr {\n margin-right: 6px;\n width: 52px;\n flex-basis: 52px;\n}\n.goodBox-Img.rich-item .goods-imgBox {\n margin-bottom: 0;\n}\n.goodBox-Img.rich-item .right-context div {\n display: flex;\n}\n.goodBox-Img.rich-item .right-context div:not(:first-child) {\n margin-top: 4px;\n}\n";
8954
+ var css_248z$6 = "#goods-wrap.goodsBox.single-row {\n max-height: 800px;\n overflow-y: auto;\n padding-top: 4px;\n flex-basis: 100%;\n}\n#goods-wrap.goodsBox.single-row .good-item.rich-item.with-pic,\n#goods-wrap.goodsBox.single-row .good-item.rich-item.with-attr,\n#goods-wrap.goodsBox.single-row .good-item.rich-item.with-attr.with-pic {\n flex-basis: 100%;\n}\n#goods-wrap.goodsBox.single-row .good-item.rich-item .good-attrs {\n flex-grow: 1;\n flex-shrink: 1;\n}\n#goods-wrap.goodsBox.single-row .good-item.rich-item .good-attrs .good-item-attr {\n flex-grow: 1;\n flex-shrink: 1;\n max-width: 80px;\n width: 20px;\n flex-basis: 20px;\n}\n#goods-wrap.goodsBox.single-row .good-item.rich-item .good-attrs .ant-input {\n flex-shrink: 1;\n flex-grow: 1;\n width: 20px;\n flex-basis: 40px;\n}\n#goods-wrap .good-item.rich-item {\n position: relative;\n border: 1px solid #ccc;\n display: flex;\n flex-basis: 80px;\n flex-wrap: nowrap;\n margin: 0 10px 10px 0;\n padding: 4px;\n}\n#goods-wrap .good-item.rich-item.with-pic {\n flex-basis: 90px;\n}\n#goods-wrap .good-item.rich-item.with-attr {\n flex-basis: 150px;\n}\n#goods-wrap .good-item.rich-item.with-attr.with-pic {\n flex-basis: 238px;\n}\n#goods-wrap .good-item.rich-item.with-attr.with-pic .goods-imgBox {\n margin-right: 8px;\n}\n#goods-wrap .good-item.rich-item .good-item-attr {\n margin-right: 6px;\n width: 52px;\n flex-basis: 52px;\n}\n#goods-wrap .good-item.rich-item .good-img {\n position: relative;\n width: 80px;\n height: 80px;\n border-radius: 4px;\n border: 1px solid #f2f3f5;\n margin: 0 10px 0 0;\n text-align: center;\n background-color: #f2f3f5;\n}\n#goods-wrap .good-item.rich-item .good-attrs {\n display: flex;\n flex-direction: column;\n font-size: 12px;\n}\n#goods-wrap .good-item.rich-item .good-attrs .ant-input {\n font-size: 12px;\n width: 80px;\n height: 20px;\n padding-left: 5px;\n padding-right: 5px;\n}\n#goods-wrap .good-item.rich-item .good-attrs .ant-input.id-textarea {\n width: 80px;\n resize: none;\n height: 45px;\n}\n#goods-wrap .good-item.rich-item .good-attrs div {\n display: flex;\n}\n#goods-wrap .good-item.rich-item .good-attrs div:not(:first-child) {\n margin-top: 4px;\n}\n";
8945
8955
  styleInject(css_248z$6);
8946
8956
 
8947
8957
  var GoodItem = function GoodItem(props) {
@@ -8953,7 +8963,7 @@ var GoodItem = function GoodItem(props) {
8953
8963
  imgList: []
8954
8964
  } : _props$value,
8955
8965
  _props$maxLength = props.maxLength,
8956
- maxLength = _props$maxLength === void 0 ? 999999999 : _props$maxLength,
8966
+ maxLength = _props$maxLength === void 0 ? 20 : _props$maxLength,
8957
8967
  onChange = props.onChange,
8958
8968
  _props$type = props.type,
8959
8969
  type = _props$type === void 0 ? 2 : _props$type,
@@ -9176,13 +9186,20 @@ var GoodItem = function GoodItem(props) {
9176
9186
  }];
9177
9187
  var hasPic = headerList.includes('picUrl');
9178
9188
  var hasAttr = hasPic ? headerList.length > 1 : headerList.length > 0;
9179
- return /*#__PURE__*/React.createElement("div", {
9189
+ return /*#__PURE__*/React.createElement("div", null, imgList.length === 0 ? /*#__PURE__*/React.createElement("p", {
9190
+ className: "goods-title"
9191
+ }, "\u6700\u591A\u6DFB\u52A0", maxLength, "\u4E2A\u5B9D\u8D1D") : /*#__PURE__*/React.createElement("p", {
9192
+ className: "goods-uploaded-state"
9193
+ }, "\u5DF2\u6DFB\u52A0", /*#__PURE__*/React.createElement("span", {
9194
+ className: "goods-uploaded-count"
9195
+ }, imgList.length), "/", maxLength, "\u4E2A\u5B9D\u8D1D"), /*#__PURE__*/React.createElement("div", {
9180
9196
  ref: boxRef,
9197
+ id: "goods-wrap",
9181
9198
  className: "goodsBox goodsBox-item-horizontal--box".concat(isSingleRow ? ' single-row' : '')
9182
9199
  }, imgList === null || imgList === void 0 ? void 0 : imgList.map(function (img, index) {
9183
9200
  return /*#__PURE__*/React.createElement("div", {
9184
9201
  key: index,
9185
- className: "goodBox-Img rich-item".concat(hasPic ? ' with-pic' : '').concat(hasAttr ? ' with-attr' : '')
9202
+ className: "good-item rich-item".concat(hasPic ? ' with-pic' : '').concat(hasAttr ? ' with-attr' : '')
9186
9203
  }, !disabled && /*#__PURE__*/React.createElement("img", {
9187
9204
  src: iconDelete,
9188
9205
  alt: "",
@@ -9191,7 +9208,7 @@ var GoodItem = function GoodItem(props) {
9191
9208
  handleDelete(index);
9192
9209
  }
9193
9210
  }), hasPic && /*#__PURE__*/React.createElement("div", {
9194
- className: "goods-imgBox",
9211
+ className: "good-img",
9195
9212
  key: "".concat(img.picUrl, "-").concat(index, "-goods")
9196
9213
  }, img.platform !== 'taobao' ? /*#__PURE__*/React.createElement("img", {
9197
9214
  src: img.picUrl || defaultImg,
@@ -9205,7 +9222,7 @@ var GoodItem = function GoodItem(props) {
9205
9222
  className: "img",
9206
9223
  alt: ""
9207
9224
  }))), /*#__PURE__*/React.createElement("div", {
9208
- className: "right-context",
9225
+ className: "good-attrs",
9209
9226
  key: "".concat(img.picUrl, "-").concat(index, "-context")
9210
9227
  }, goodItemAttrs.map(function (item) {
9211
9228
  return item.isShow && /*#__PURE__*/React.createElement("div", {
@@ -9254,7 +9271,7 @@ var GoodItem = function GoodItem(props) {
9254
9271
  ref: skuRef,
9255
9272
  userNick: userNick,
9256
9273
  type: type
9257
- }));
9274
+ })));
9258
9275
  };
9259
9276
 
9260
9277
  var TBGoodSerial = function TBGoodSerial(props) {
@@ -10600,7 +10617,6 @@ var columns = [{
10600
10617
  dataIndex: 'code',
10601
10618
  title: '商品编码',
10602
10619
  with: 200,
10603
- // ellipsis: true,
10604
10620
  render: function render(val) {
10605
10621
  return /*#__PURE__*/React.createElement("div", {
10606
10622
  style: {
@@ -10611,8 +10627,6 @@ var columns = [{
10611
10627
  }, {
10612
10628
  dataIndex: 'marketPrice',
10613
10629
  title: '市场价',
10614
- // with: 200,
10615
- // ellipsis: true,
10616
10630
  render: function render(val) {
10617
10631
  return /*#__PURE__*/React.createElement("div", {
10618
10632
  style: {
@@ -10747,9 +10761,42 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
10747
10761
  var rowSelection = {
10748
10762
  selectedRowKeys: selectIds,
10749
10763
  fixed: true,
10750
- onChange: function onChange(selectedRowKeys, selectedRows, info) {
10751
- setSelectIds(selectedRowKeys);
10752
- setSelect(_toConsumableArray(selectedRows));
10764
+ // onChange: (
10765
+ // selectedRowKeys: React.SetStateAction<string[]>,
10766
+ // selectedRows: any[],
10767
+ // info: any,
10768
+ // ) => {
10769
+ // setSelectIds(selectedRowKeys);
10770
+ // setSelect([...selectedRows]);
10771
+ // },
10772
+ onSelect: function onSelect(record, selected) {
10773
+ if (selected) {
10774
+ setSelectIds([].concat(_toConsumableArray(selectIds), [record.skuCode]));
10775
+ setSelect([].concat(_toConsumableArray(selectList), [record]));
10776
+ } else {
10777
+ setSelectIds(selectIds.filter(function (t) {
10778
+ return t !== record.skuCode;
10779
+ }));
10780
+ setSelect(selectList.filter(function (t) {
10781
+ return t.skuCode !== record.skuCode;
10782
+ }));
10783
+ }
10784
+ },
10785
+ onSelectAll: function onSelectAll(selected, selectedRows, changeRows) {
10786
+ if (selected) {
10787
+ setSelectIds([].concat(_toConsumableArray(selectIds), _toConsumableArray(changeRows.map(function (t) {
10788
+ return t.skuCode;
10789
+ }))));
10790
+ setSelect([].concat(_toConsumableArray(selectList), _toConsumableArray(changeRows)));
10791
+ } else {
10792
+ setSelectIds(difference(selectIds, changeRows.map(function (t) {
10793
+ return t.skuCode;
10794
+ })));
10795
+ var list = differenceWith(selectList, changeRows, function (arrVal, othVal) {
10796
+ return arrVal.skuCode !== othVal.skuCode;
10797
+ });
10798
+ setSelect(list);
10799
+ }
10753
10800
  }
10754
10801
  };
10755
10802
  var initData = function initData(list) {
@@ -10837,6 +10884,91 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
10837
10884
  });
10838
10885
  }
10839
10886
  };
10887
+ var showTable = function showTable() {
10888
+ var handleDelete = function handleDelete(record) {
10889
+ setSelectIds(selectIds.filter(function (t) {
10890
+ return t !== record.skuCode;
10891
+ }));
10892
+ setSelect(selectList.filter(function (t) {
10893
+ return t.skuCode !== record.skuCode;
10894
+ }));
10895
+ };
10896
+ var showColumns = [{
10897
+ dataIndex: '',
10898
+ title: "\u64CD\u4F5C",
10899
+ ellipsis: true,
10900
+ width: 100,
10901
+ render: function render(val, record) {
10902
+ return /*#__PURE__*/React.createElement(Button, {
10903
+ type: "link",
10904
+ onClick: function onClick() {
10905
+ return handleDelete(record);
10906
+ }
10907
+ }, "\u5220\u9664");
10908
+ }
10909
+ }, {
10910
+ dataIndex: 'skuName',
10911
+ title: '商品sku名称',
10912
+ with: 200,
10913
+ ellipsis: true
10914
+ }, {
10915
+ dataIndex: 'skuCode',
10916
+ title: '商品sku编码',
10917
+ with: 200,
10918
+ ellipsis: true
10919
+ }, {
10920
+ dataIndex: 'name',
10921
+ title: '商品名称',
10922
+ with: 200,
10923
+ ellipsis: true
10924
+ }, {
10925
+ dataIndex: 'goodsId',
10926
+ title: '商品id',
10927
+ with: 200,
10928
+ ellipsis: true
10929
+ }, {
10930
+ dataIndex: 'code',
10931
+ title: '商品编码',
10932
+ with: 200,
10933
+ render: function render(val) {
10934
+ return /*#__PURE__*/React.createElement("div", {
10935
+ style: {
10936
+ width: '100px'
10937
+ }
10938
+ }, val);
10939
+ }
10940
+ }, {
10941
+ dataIndex: 'marketPrice',
10942
+ title: '市场价',
10943
+ render: function render(val) {
10944
+ return /*#__PURE__*/React.createElement("div", {
10945
+ style: {
10946
+ width: '70px'
10947
+ }
10948
+ }, val);
10949
+ }
10950
+ }];
10951
+ return selectList.length ? /*#__PURE__*/React.createElement("div", {
10952
+ style: {
10953
+ width: '100%',
10954
+ maxWidth: '850px'
10955
+ }
10956
+ }, /*#__PURE__*/React.createElement(Table, {
10957
+ columns: showColumns,
10958
+ rowKey: 'skuCode',
10959
+ dataSource: selectList,
10960
+ scroll: {
10961
+ x: true,
10962
+ y: 250
10963
+ },
10964
+ pagination: {
10965
+ size: 'small',
10966
+ total: selectIds.length,
10967
+ pageSize: pageSize,
10968
+ showSizeChanger: false
10969
+ }
10970
+ })) : null;
10971
+ };
10840
10972
  return /*#__PURE__*/React.createElement(Modal, {
10841
10973
  title: '选择商品',
10842
10974
  okText: '确认',
@@ -10847,7 +10979,10 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
10847
10979
  _onCancel();
10848
10980
  },
10849
10981
  onOk: onOk,
10850
- wrapClassName: "goodModal"
10982
+ wrapClassName: "goodModal",
10983
+ style: {
10984
+ top: 20
10985
+ }
10851
10986
  }, /*#__PURE__*/React.createElement(Form, {
10852
10987
  layout: "inline",
10853
10988
  form: form,
@@ -10918,10 +11053,20 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
10918
11053
  total: total,
10919
11054
  current: pageNo,
10920
11055
  pageSize: pageSize,
10921
- pageSizeOptions: [],
11056
+ showSizeChanger: false,
11057
+ showQuickJumper: true,
10922
11058
  onChange: pageChange
10923
11059
  }
10924
- })));
11060
+ }), /*#__PURE__*/React.createElement(Popover, {
11061
+ getPopupContainer: function getPopupContainer(triggerNode) {
11062
+ return triggerNode.parentElement;
11063
+ },
11064
+ content: showTable(),
11065
+ title: "\u5DF2\u9009\u62E9".concat(selectIds.length, "\u4E2A\u5546\u54C1")
11066
+ }, /*#__PURE__*/React.createElement(Button, {
11067
+ danger: true,
11068
+ type: "text"
11069
+ }, "\u5DF2\u9009".concat(selectIds.length > 99 ? '99+' : selectIds.length, "\u4E2A\u5546\u54C1"), /*#__PURE__*/React.createElement(CaretUpOutlined, null)))));
10925
11070
  };
10926
11071
  var GoodsModal$2 = /*#__PURE__*/forwardRef(GoodsModal$1);
10927
11072
 
package/dist/index.js CHANGED
@@ -7448,7 +7448,9 @@ var Province = function Province(props) {
7448
7448
 
7449
7449
  var TextArea = antd.Input.TextArea;
7450
7450
  var ParseLogistics = function ParseLogistics(props) {
7451
- var onChange = props.onChange;
7451
+ var onChange = props.onChange,
7452
+ _props$selfCalibratio = props.selfCalibration,
7453
+ selfCalibration = _props$selfCalibratio === void 0 ? false : _props$selfCalibratio;
7452
7454
  var _useState = React.useState(''),
7453
7455
  _useState2 = _slicedToArray(_useState, 2),
7454
7456
  value = _useState2[0],
@@ -7461,15 +7463,22 @@ var ParseLogistics = function ParseLogistics(props) {
7461
7463
  if (!value && !val) {
7462
7464
  return;
7463
7465
  }
7466
+ var fullAddress = value || val;
7467
+ var needCalibration = selfCalibration && !/1\d{10}/.test(fullAddress);
7464
7468
  setIsCopy(false);
7465
7469
  kmkfUtils.request({
7466
7470
  url: '/qy/logistics/addressAnalysis',
7467
7471
  method: 'post',
7468
7472
  data: {
7469
- fullAddress: value || val
7473
+ fullAddress: needCalibration ? "".concat(fullAddress, " \u5F20\u4E09 18888888888") : fullAddress
7470
7474
  }
7471
7475
  }).then(function (res) {
7472
7476
  var data = res.data;
7477
+ // 如果是通过内部校准添加的姓名和手机号,则去除
7478
+ if (needCalibration) {
7479
+ data.name = '';
7480
+ data.phone = '';
7481
+ }
7473
7482
  onChange === null || onChange === void 0 ? void 0 : onChange(data);
7474
7483
  }).catch(function (e) {
7475
7484
  console.log(e);
@@ -7776,6 +7785,7 @@ function ApaasAddress(props) {
7776
7785
  onChange === null || onChange === void 0 ? void 0 : onChange(params);
7777
7786
  };
7778
7787
  return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, !disabled && showIdentify && /*#__PURE__*/React__default['default'].createElement(ParseLogistics, {
7788
+ selfCalibration: true,
7779
7789
  onChange: handleParseLogistics
7780
7790
  }), /*#__PURE__*/React__default['default'].createElement(Province, {
7781
7791
  value: value === null || value === void 0 ? void 0 : value.address,
@@ -8952,7 +8962,7 @@ var ChooseBaby = function ChooseBaby(props) {
8952
8962
  }));
8953
8963
  };
8954
8964
 
8955
- var css_248z$6 = ".goodsBox.single-row {\n max-height: 800px;\n overflow-y: auto;\n padding-top: 4px;\n flex-basis: 100%;\n}\n.goodsBox.single-row .goodBox-Img.rich-item.with-pic,\n.goodsBox.single-row .goodBox-Img.rich-item.with-attr,\n.goodsBox.single-row .goodBox-Img.rich-item.with-attr.with-pic {\n flex-basis: 100%;\n}\n.goodsBox.single-row .goodBox-Img.rich-item .right-context {\n flex-grow: 1;\n flex-shrink: 1;\n}\n.goodsBox.single-row .goodBox-Img.rich-item .right-context .good-item-attr {\n flex-grow: 1;\n flex-shrink: 1;\n max-width: 80px;\n width: 20px;\n flex-basis: 20px;\n}\n.goodsBox.single-row .goodBox-Img.rich-item .right-context .ant-input {\n flex-shrink: 1;\n flex-grow: 1;\n width: 20px;\n flex-basis: 40px;\n}\n.goodBox-Img.rich-item {\n position: relative;\n border: 1px solid #ccc;\n display: flex;\n flex-basis: 80px;\n flex-wrap: wrap;\n margin: 0 10px 10px 0;\n padding: 4px;\n}\n.goodBox-Img.rich-item.with-pic {\n flex-basis: 90px;\n}\n.goodBox-Img.rich-item.with-attr {\n flex-basis: 150px;\n}\n.goodBox-Img.rich-item.with-attr.with-pic {\n flex-basis: 238px;\n}\n.goodBox-Img.rich-item.with-attr.with-pic .goods-imgBox {\n margin-right: 8px;\n}\n.goodBox-Img.rich-item .good-item-attr {\n margin-right: 6px;\n width: 52px;\n flex-basis: 52px;\n}\n.goodBox-Img.rich-item .goods-imgBox {\n margin-bottom: 0;\n}\n.goodBox-Img.rich-item .right-context div {\n display: flex;\n}\n.goodBox-Img.rich-item .right-context div:not(:first-child) {\n margin-top: 4px;\n}\n";
8965
+ var css_248z$6 = "#goods-wrap.goodsBox.single-row {\n max-height: 800px;\n overflow-y: auto;\n padding-top: 4px;\n flex-basis: 100%;\n}\n#goods-wrap.goodsBox.single-row .good-item.rich-item.with-pic,\n#goods-wrap.goodsBox.single-row .good-item.rich-item.with-attr,\n#goods-wrap.goodsBox.single-row .good-item.rich-item.with-attr.with-pic {\n flex-basis: 100%;\n}\n#goods-wrap.goodsBox.single-row .good-item.rich-item .good-attrs {\n flex-grow: 1;\n flex-shrink: 1;\n}\n#goods-wrap.goodsBox.single-row .good-item.rich-item .good-attrs .good-item-attr {\n flex-grow: 1;\n flex-shrink: 1;\n max-width: 80px;\n width: 20px;\n flex-basis: 20px;\n}\n#goods-wrap.goodsBox.single-row .good-item.rich-item .good-attrs .ant-input {\n flex-shrink: 1;\n flex-grow: 1;\n width: 20px;\n flex-basis: 40px;\n}\n#goods-wrap .good-item.rich-item {\n position: relative;\n border: 1px solid #ccc;\n display: flex;\n flex-basis: 80px;\n flex-wrap: nowrap;\n margin: 0 10px 10px 0;\n padding: 4px;\n}\n#goods-wrap .good-item.rich-item.with-pic {\n flex-basis: 90px;\n}\n#goods-wrap .good-item.rich-item.with-attr {\n flex-basis: 150px;\n}\n#goods-wrap .good-item.rich-item.with-attr.with-pic {\n flex-basis: 238px;\n}\n#goods-wrap .good-item.rich-item.with-attr.with-pic .goods-imgBox {\n margin-right: 8px;\n}\n#goods-wrap .good-item.rich-item .good-item-attr {\n margin-right: 6px;\n width: 52px;\n flex-basis: 52px;\n}\n#goods-wrap .good-item.rich-item .good-img {\n position: relative;\n width: 80px;\n height: 80px;\n border-radius: 4px;\n border: 1px solid #f2f3f5;\n margin: 0 10px 0 0;\n text-align: center;\n background-color: #f2f3f5;\n}\n#goods-wrap .good-item.rich-item .good-attrs {\n display: flex;\n flex-direction: column;\n font-size: 12px;\n}\n#goods-wrap .good-item.rich-item .good-attrs .ant-input {\n font-size: 12px;\n width: 80px;\n height: 20px;\n padding-left: 5px;\n padding-right: 5px;\n}\n#goods-wrap .good-item.rich-item .good-attrs .ant-input.id-textarea {\n width: 80px;\n resize: none;\n height: 45px;\n}\n#goods-wrap .good-item.rich-item .good-attrs div {\n display: flex;\n}\n#goods-wrap .good-item.rich-item .good-attrs div:not(:first-child) {\n margin-top: 4px;\n}\n";
8956
8966
  styleInject(css_248z$6);
8957
8967
 
8958
8968
  var GoodItem = function GoodItem(props) {
@@ -8964,7 +8974,7 @@ var GoodItem = function GoodItem(props) {
8964
8974
  imgList: []
8965
8975
  } : _props$value,
8966
8976
  _props$maxLength = props.maxLength,
8967
- maxLength = _props$maxLength === void 0 ? 999999999 : _props$maxLength,
8977
+ maxLength = _props$maxLength === void 0 ? 20 : _props$maxLength,
8968
8978
  onChange = props.onChange,
8969
8979
  _props$type = props.type,
8970
8980
  type = _props$type === void 0 ? 2 : _props$type,
@@ -9187,13 +9197,20 @@ var GoodItem = function GoodItem(props) {
9187
9197
  }];
9188
9198
  var hasPic = headerList.includes('picUrl');
9189
9199
  var hasAttr = hasPic ? headerList.length > 1 : headerList.length > 0;
9190
- return /*#__PURE__*/React__default['default'].createElement("div", {
9200
+ return /*#__PURE__*/React__default['default'].createElement("div", null, imgList.length === 0 ? /*#__PURE__*/React__default['default'].createElement("p", {
9201
+ className: "goods-title"
9202
+ }, "\u6700\u591A\u6DFB\u52A0", maxLength, "\u4E2A\u5B9D\u8D1D") : /*#__PURE__*/React__default['default'].createElement("p", {
9203
+ className: "goods-uploaded-state"
9204
+ }, "\u5DF2\u6DFB\u52A0", /*#__PURE__*/React__default['default'].createElement("span", {
9205
+ className: "goods-uploaded-count"
9206
+ }, imgList.length), "/", maxLength, "\u4E2A\u5B9D\u8D1D"), /*#__PURE__*/React__default['default'].createElement("div", {
9191
9207
  ref: boxRef,
9208
+ id: "goods-wrap",
9192
9209
  className: "goodsBox goodsBox-item-horizontal--box".concat(isSingleRow ? ' single-row' : '')
9193
9210
  }, imgList === null || imgList === void 0 ? void 0 : imgList.map(function (img, index) {
9194
9211
  return /*#__PURE__*/React__default['default'].createElement("div", {
9195
9212
  key: index,
9196
- className: "goodBox-Img rich-item".concat(hasPic ? ' with-pic' : '').concat(hasAttr ? ' with-attr' : '')
9213
+ className: "good-item rich-item".concat(hasPic ? ' with-pic' : '').concat(hasAttr ? ' with-attr' : '')
9197
9214
  }, !disabled && /*#__PURE__*/React__default['default'].createElement("img", {
9198
9215
  src: iconDelete,
9199
9216
  alt: "",
@@ -9202,7 +9219,7 @@ var GoodItem = function GoodItem(props) {
9202
9219
  handleDelete(index);
9203
9220
  }
9204
9221
  }), hasPic && /*#__PURE__*/React__default['default'].createElement("div", {
9205
- className: "goods-imgBox",
9222
+ className: "good-img",
9206
9223
  key: "".concat(img.picUrl, "-").concat(index, "-goods")
9207
9224
  }, img.platform !== 'taobao' ? /*#__PURE__*/React__default['default'].createElement("img", {
9208
9225
  src: img.picUrl || defaultImg,
@@ -9216,7 +9233,7 @@ var GoodItem = function GoodItem(props) {
9216
9233
  className: "img",
9217
9234
  alt: ""
9218
9235
  }))), /*#__PURE__*/React__default['default'].createElement("div", {
9219
- className: "right-context",
9236
+ className: "good-attrs",
9220
9237
  key: "".concat(img.picUrl, "-").concat(index, "-context")
9221
9238
  }, goodItemAttrs.map(function (item) {
9222
9239
  return item.isShow && /*#__PURE__*/React__default['default'].createElement("div", {
@@ -9265,7 +9282,7 @@ var GoodItem = function GoodItem(props) {
9265
9282
  ref: skuRef,
9266
9283
  userNick: userNick,
9267
9284
  type: type
9268
- }));
9285
+ })));
9269
9286
  };
9270
9287
 
9271
9288
  var TBGoodSerial = function TBGoodSerial(props) {
@@ -10611,7 +10628,6 @@ var columns = [{
10611
10628
  dataIndex: 'code',
10612
10629
  title: '商品编码',
10613
10630
  with: 200,
10614
- // ellipsis: true,
10615
10631
  render: function render(val) {
10616
10632
  return /*#__PURE__*/React__default['default'].createElement("div", {
10617
10633
  style: {
@@ -10622,8 +10638,6 @@ var columns = [{
10622
10638
  }, {
10623
10639
  dataIndex: 'marketPrice',
10624
10640
  title: '市场价',
10625
- // with: 200,
10626
- // ellipsis: true,
10627
10641
  render: function render(val) {
10628
10642
  return /*#__PURE__*/React__default['default'].createElement("div", {
10629
10643
  style: {
@@ -10758,9 +10772,42 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
10758
10772
  var rowSelection = {
10759
10773
  selectedRowKeys: selectIds,
10760
10774
  fixed: true,
10761
- onChange: function onChange(selectedRowKeys, selectedRows, info) {
10762
- setSelectIds(selectedRowKeys);
10763
- setSelect(_toConsumableArray(selectedRows));
10775
+ // onChange: (
10776
+ // selectedRowKeys: React.SetStateAction<string[]>,
10777
+ // selectedRows: any[],
10778
+ // info: any,
10779
+ // ) => {
10780
+ // setSelectIds(selectedRowKeys);
10781
+ // setSelect([...selectedRows]);
10782
+ // },
10783
+ onSelect: function onSelect(record, selected) {
10784
+ if (selected) {
10785
+ setSelectIds([].concat(_toConsumableArray(selectIds), [record.skuCode]));
10786
+ setSelect([].concat(_toConsumableArray(selectList), [record]));
10787
+ } else {
10788
+ setSelectIds(selectIds.filter(function (t) {
10789
+ return t !== record.skuCode;
10790
+ }));
10791
+ setSelect(selectList.filter(function (t) {
10792
+ return t.skuCode !== record.skuCode;
10793
+ }));
10794
+ }
10795
+ },
10796
+ onSelectAll: function onSelectAll(selected, selectedRows, changeRows) {
10797
+ if (selected) {
10798
+ setSelectIds([].concat(_toConsumableArray(selectIds), _toConsumableArray(changeRows.map(function (t) {
10799
+ return t.skuCode;
10800
+ }))));
10801
+ setSelect([].concat(_toConsumableArray(selectList), _toConsumableArray(changeRows)));
10802
+ } else {
10803
+ setSelectIds(lodash.difference(selectIds, changeRows.map(function (t) {
10804
+ return t.skuCode;
10805
+ })));
10806
+ var list = lodash.differenceWith(selectList, changeRows, function (arrVal, othVal) {
10807
+ return arrVal.skuCode !== othVal.skuCode;
10808
+ });
10809
+ setSelect(list);
10810
+ }
10764
10811
  }
10765
10812
  };
10766
10813
  var initData = function initData(list) {
@@ -10848,6 +10895,91 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
10848
10895
  });
10849
10896
  }
10850
10897
  };
10898
+ var showTable = function showTable() {
10899
+ var handleDelete = function handleDelete(record) {
10900
+ setSelectIds(selectIds.filter(function (t) {
10901
+ return t !== record.skuCode;
10902
+ }));
10903
+ setSelect(selectList.filter(function (t) {
10904
+ return t.skuCode !== record.skuCode;
10905
+ }));
10906
+ };
10907
+ var showColumns = [{
10908
+ dataIndex: '',
10909
+ title: "\u64CD\u4F5C",
10910
+ ellipsis: true,
10911
+ width: 100,
10912
+ render: function render(val, record) {
10913
+ return /*#__PURE__*/React__default['default'].createElement(antd.Button, {
10914
+ type: "link",
10915
+ onClick: function onClick() {
10916
+ return handleDelete(record);
10917
+ }
10918
+ }, "\u5220\u9664");
10919
+ }
10920
+ }, {
10921
+ dataIndex: 'skuName',
10922
+ title: '商品sku名称',
10923
+ with: 200,
10924
+ ellipsis: true
10925
+ }, {
10926
+ dataIndex: 'skuCode',
10927
+ title: '商品sku编码',
10928
+ with: 200,
10929
+ ellipsis: true
10930
+ }, {
10931
+ dataIndex: 'name',
10932
+ title: '商品名称',
10933
+ with: 200,
10934
+ ellipsis: true
10935
+ }, {
10936
+ dataIndex: 'goodsId',
10937
+ title: '商品id',
10938
+ with: 200,
10939
+ ellipsis: true
10940
+ }, {
10941
+ dataIndex: 'code',
10942
+ title: '商品编码',
10943
+ with: 200,
10944
+ render: function render(val) {
10945
+ return /*#__PURE__*/React__default['default'].createElement("div", {
10946
+ style: {
10947
+ width: '100px'
10948
+ }
10949
+ }, val);
10950
+ }
10951
+ }, {
10952
+ dataIndex: 'marketPrice',
10953
+ title: '市场价',
10954
+ render: function render(val) {
10955
+ return /*#__PURE__*/React__default['default'].createElement("div", {
10956
+ style: {
10957
+ width: '70px'
10958
+ }
10959
+ }, val);
10960
+ }
10961
+ }];
10962
+ return selectList.length ? /*#__PURE__*/React__default['default'].createElement("div", {
10963
+ style: {
10964
+ width: '100%',
10965
+ maxWidth: '850px'
10966
+ }
10967
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Table, {
10968
+ columns: showColumns,
10969
+ rowKey: 'skuCode',
10970
+ dataSource: selectList,
10971
+ scroll: {
10972
+ x: true,
10973
+ y: 250
10974
+ },
10975
+ pagination: {
10976
+ size: 'small',
10977
+ total: selectIds.length,
10978
+ pageSize: pageSize,
10979
+ showSizeChanger: false
10980
+ }
10981
+ })) : null;
10982
+ };
10851
10983
  return /*#__PURE__*/React__default['default'].createElement(antd.Modal, {
10852
10984
  title: '选择商品',
10853
10985
  okText: '确认',
@@ -10858,7 +10990,10 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
10858
10990
  _onCancel();
10859
10991
  },
10860
10992
  onOk: onOk,
10861
- wrapClassName: "goodModal"
10993
+ wrapClassName: "goodModal",
10994
+ style: {
10995
+ top: 20
10996
+ }
10862
10997
  }, /*#__PURE__*/React__default['default'].createElement(antd.Form, {
10863
10998
  layout: "inline",
10864
10999
  form: form,
@@ -10929,10 +11064,20 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
10929
11064
  total: total,
10930
11065
  current: pageNo,
10931
11066
  pageSize: pageSize,
10932
- pageSizeOptions: [],
11067
+ showSizeChanger: false,
11068
+ showQuickJumper: true,
10933
11069
  onChange: pageChange
10934
11070
  }
10935
- })));
11071
+ }), /*#__PURE__*/React__default['default'].createElement(antd.Popover, {
11072
+ getPopupContainer: function getPopupContainer(triggerNode) {
11073
+ return triggerNode.parentElement;
11074
+ },
11075
+ content: showTable(),
11076
+ title: "\u5DF2\u9009\u62E9".concat(selectIds.length, "\u4E2A\u5546\u54C1")
11077
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
11078
+ danger: true,
11079
+ type: "text"
11080
+ }, "\u5DF2\u9009".concat(selectIds.length > 99 ? '99+' : selectIds.length, "\u4E2A\u5546\u54C1"), /*#__PURE__*/React__default['default'].createElement(icons.CaretUpOutlined, null)))));
10936
11081
  };
10937
11082
  var GoodsModal$2 = /*#__PURE__*/React.forwardRef(GoodsModal$1);
10938
11083
 
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  interface ParseLogisticsProps {
3
+ selfCalibration?: boolean;
3
4
  onChange: (value: any) => void;
4
5
  }
5
6
  declare const ParseLogistics: (props: ParseLogisticsProps) => React.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "0.24.1-alpha.1",
3
+ "version": "0.24.1-alpha.13",
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.24.1-alpha.0",
23
+ "@kmkf-fe-packages/kmkf-utils": "^0.24.1-alpha.4",
24
24
  "ahooks": "^3.7.4",
25
25
  "kmkf-monitor": "^0.8.8",
26
26
  "lodash": "^4.17.21",
@@ -64,5 +64,5 @@
64
64
  "publishConfig": {
65
65
  "access": "public"
66
66
  },
67
- "gitHead": "f2f307188e76984908f2f53a1a218d8be57794b5"
67
+ "gitHead": "1ec9ec0c8db18680426bb57e8ef75e392a6a9bd4"
68
68
  }