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

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 = ".goodsBox.single-row {\n max-height: 800px;\n overflow-y: auto;\n padding-top: 4px;\n flex-basis: 100%;\n}\n.goodsBox.single-row .good-item.rich-item.with-pic,\n.goodsBox.single-row .good-item.rich-item.with-attr,\n.goodsBox.single-row .good-item.rich-item.with-attr.with-pic {\n flex-basis: 100%;\n}\n.goodsBox.single-row .good-item.rich-item .good-attrs {\n flex-grow: 1;\n flex-shrink: 1;\n}\n.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.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.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.good-item.rich-item.with-pic {\n flex-basis: 90px;\n}\n.good-item.rich-item.with-attr {\n flex-basis: 150px;\n}\n.good-item.rich-item.with-attr.with-pic {\n flex-basis: 238px;\n}\n.good-item.rich-item.with-attr.with-pic .goods-imgBox {\n margin-right: 8px;\n}\n.good-item.rich-item .good-item-attr {\n margin-right: 6px;\n width: 52px;\n flex-basis: 52px;\n}\n.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.good-item.rich-item .good-attrs {\n display: flex;\n flex-direction: column;\n font-size: 12px;\n}\n.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.good-item.rich-item .good-attrs .ant-input.id-textarea {\n width: 80px;\n resize: none;\n height: 45px;\n}\n.good-item.rich-item .good-attrs div {\n display: flex;\n}\n.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,19 @@ 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,
9181
9197
  className: "goodsBox goodsBox-item-horizontal--box".concat(isSingleRow ? ' single-row' : '')
9182
9198
  }, imgList === null || imgList === void 0 ? void 0 : imgList.map(function (img, index) {
9183
9199
  return /*#__PURE__*/React.createElement("div", {
9184
9200
  key: index,
9185
- className: "goodBox-Img rich-item".concat(hasPic ? ' with-pic' : '').concat(hasAttr ? ' with-attr' : '')
9201
+ className: "good-item rich-item".concat(hasPic ? ' with-pic' : '').concat(hasAttr ? ' with-attr' : '')
9186
9202
  }, !disabled && /*#__PURE__*/React.createElement("img", {
9187
9203
  src: iconDelete,
9188
9204
  alt: "",
@@ -9191,7 +9207,7 @@ var GoodItem = function GoodItem(props) {
9191
9207
  handleDelete(index);
9192
9208
  }
9193
9209
  }), hasPic && /*#__PURE__*/React.createElement("div", {
9194
- className: "goods-imgBox",
9210
+ className: "good-img",
9195
9211
  key: "".concat(img.picUrl, "-").concat(index, "-goods")
9196
9212
  }, img.platform !== 'taobao' ? /*#__PURE__*/React.createElement("img", {
9197
9213
  src: img.picUrl || defaultImg,
@@ -9205,7 +9221,7 @@ var GoodItem = function GoodItem(props) {
9205
9221
  className: "img",
9206
9222
  alt: ""
9207
9223
  }))), /*#__PURE__*/React.createElement("div", {
9208
- className: "right-context",
9224
+ className: "good-attrs",
9209
9225
  key: "".concat(img.picUrl, "-").concat(index, "-context")
9210
9226
  }, goodItemAttrs.map(function (item) {
9211
9227
  return item.isShow && /*#__PURE__*/React.createElement("div", {
@@ -9254,7 +9270,7 @@ var GoodItem = function GoodItem(props) {
9254
9270
  ref: skuRef,
9255
9271
  userNick: userNick,
9256
9272
  type: type
9257
- }));
9273
+ })));
9258
9274
  };
9259
9275
 
9260
9276
  var TBGoodSerial = function TBGoodSerial(props) {
@@ -10600,7 +10616,6 @@ var columns = [{
10600
10616
  dataIndex: 'code',
10601
10617
  title: '商品编码',
10602
10618
  with: 200,
10603
- // ellipsis: true,
10604
10619
  render: function render(val) {
10605
10620
  return /*#__PURE__*/React.createElement("div", {
10606
10621
  style: {
@@ -10611,8 +10626,6 @@ var columns = [{
10611
10626
  }, {
10612
10627
  dataIndex: 'marketPrice',
10613
10628
  title: '市场价',
10614
- // with: 200,
10615
- // ellipsis: true,
10616
10629
  render: function render(val) {
10617
10630
  return /*#__PURE__*/React.createElement("div", {
10618
10631
  style: {
@@ -10747,9 +10760,42 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
10747
10760
  var rowSelection = {
10748
10761
  selectedRowKeys: selectIds,
10749
10762
  fixed: true,
10750
- onChange: function onChange(selectedRowKeys, selectedRows, info) {
10751
- setSelectIds(selectedRowKeys);
10752
- setSelect(_toConsumableArray(selectedRows));
10763
+ // onChange: (
10764
+ // selectedRowKeys: React.SetStateAction<string[]>,
10765
+ // selectedRows: any[],
10766
+ // info: any,
10767
+ // ) => {
10768
+ // setSelectIds(selectedRowKeys);
10769
+ // setSelect([...selectedRows]);
10770
+ // },
10771
+ onSelect: function onSelect(record, selected) {
10772
+ if (selected) {
10773
+ setSelectIds([].concat(_toConsumableArray(selectIds), [record.skuCode]));
10774
+ setSelect([].concat(_toConsumableArray(selectList), [record]));
10775
+ } else {
10776
+ setSelectIds(selectIds.filter(function (t) {
10777
+ return t !== record.skuCode;
10778
+ }));
10779
+ setSelect(selectList.filter(function (t) {
10780
+ return t.skuCode !== record.skuCode;
10781
+ }));
10782
+ }
10783
+ },
10784
+ onSelectAll: function onSelectAll(selected, selectedRows, changeRows) {
10785
+ if (selected) {
10786
+ setSelectIds([].concat(_toConsumableArray(selectIds), _toConsumableArray(changeRows.map(function (t) {
10787
+ return t.skuCode;
10788
+ }))));
10789
+ setSelect([].concat(_toConsumableArray(selectList), _toConsumableArray(changeRows)));
10790
+ } else {
10791
+ setSelectIds(difference(selectIds, changeRows.map(function (t) {
10792
+ return t.skuCode;
10793
+ })));
10794
+ var list = differenceWith(selectList, changeRows, function (arrVal, othVal) {
10795
+ return arrVal.skuCode !== othVal.skuCode;
10796
+ });
10797
+ setSelect(list);
10798
+ }
10753
10799
  }
10754
10800
  };
10755
10801
  var initData = function initData(list) {
@@ -10837,6 +10883,91 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
10837
10883
  });
10838
10884
  }
10839
10885
  };
10886
+ var showTable = function showTable() {
10887
+ var handleDelete = function handleDelete(record) {
10888
+ setSelectIds(selectIds.filter(function (t) {
10889
+ return t !== record.skuCode;
10890
+ }));
10891
+ setSelect(selectList.filter(function (t) {
10892
+ return t.skuCode !== record.skuCode;
10893
+ }));
10894
+ };
10895
+ var showColumns = [{
10896
+ dataIndex: '',
10897
+ title: "\u64CD\u4F5C",
10898
+ ellipsis: true,
10899
+ width: 100,
10900
+ render: function render(val, record) {
10901
+ return /*#__PURE__*/React.createElement(Button, {
10902
+ type: "link",
10903
+ onClick: function onClick() {
10904
+ return handleDelete(record);
10905
+ }
10906
+ }, "\u5220\u9664");
10907
+ }
10908
+ }, {
10909
+ dataIndex: 'skuName',
10910
+ title: '商品sku名称',
10911
+ with: 200,
10912
+ ellipsis: true
10913
+ }, {
10914
+ dataIndex: 'skuCode',
10915
+ title: '商品sku编码',
10916
+ with: 200,
10917
+ ellipsis: true
10918
+ }, {
10919
+ dataIndex: 'name',
10920
+ title: '商品名称',
10921
+ with: 200,
10922
+ ellipsis: true
10923
+ }, {
10924
+ dataIndex: 'goodsId',
10925
+ title: '商品id',
10926
+ with: 200,
10927
+ ellipsis: true
10928
+ }, {
10929
+ dataIndex: 'code',
10930
+ title: '商品编码',
10931
+ with: 200,
10932
+ render: function render(val) {
10933
+ return /*#__PURE__*/React.createElement("div", {
10934
+ style: {
10935
+ width: '100px'
10936
+ }
10937
+ }, val);
10938
+ }
10939
+ }, {
10940
+ dataIndex: 'marketPrice',
10941
+ title: '市场价',
10942
+ render: function render(val) {
10943
+ return /*#__PURE__*/React.createElement("div", {
10944
+ style: {
10945
+ width: '70px'
10946
+ }
10947
+ }, val);
10948
+ }
10949
+ }];
10950
+ return selectList.length ? /*#__PURE__*/React.createElement("div", {
10951
+ style: {
10952
+ width: '100%',
10953
+ maxWidth: '850px'
10954
+ }
10955
+ }, /*#__PURE__*/React.createElement(Table, {
10956
+ columns: showColumns,
10957
+ rowKey: 'skuCode',
10958
+ dataSource: selectList,
10959
+ scroll: {
10960
+ x: true,
10961
+ y: 250
10962
+ },
10963
+ pagination: {
10964
+ size: 'small',
10965
+ total: selectIds.length,
10966
+ pageSize: pageSize,
10967
+ showSizeChanger: false
10968
+ }
10969
+ })) : null;
10970
+ };
10840
10971
  return /*#__PURE__*/React.createElement(Modal, {
10841
10972
  title: '选择商品',
10842
10973
  okText: '确认',
@@ -10847,7 +10978,10 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
10847
10978
  _onCancel();
10848
10979
  },
10849
10980
  onOk: onOk,
10850
- wrapClassName: "goodModal"
10981
+ wrapClassName: "goodModal",
10982
+ style: {
10983
+ top: 20
10984
+ }
10851
10985
  }, /*#__PURE__*/React.createElement(Form, {
10852
10986
  layout: "inline",
10853
10987
  form: form,
@@ -10918,10 +11052,17 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
10918
11052
  total: total,
10919
11053
  current: pageNo,
10920
11054
  pageSize: pageSize,
10921
- pageSizeOptions: [],
11055
+ showSizeChanger: false,
11056
+ showQuickJumper: true,
10922
11057
  onChange: pageChange
10923
11058
  }
10924
- })));
11059
+ }), /*#__PURE__*/React.createElement(Popover, {
11060
+ content: showTable(),
11061
+ title: "\u5DF2\u9009\u62E9".concat(selectIds.length, "\u4E2A\u5546\u54C1")
11062
+ }, /*#__PURE__*/React.createElement(Button, {
11063
+ danger: true,
11064
+ type: "text"
11065
+ }, "\u5DF2\u9009".concat(selectIds.length > 99 ? '99+' : selectIds.length, "\u4E2A\u5546\u54C1"), /*#__PURE__*/React.createElement(CaretUpOutlined, null)))));
10925
11066
  };
10926
11067
  var GoodsModal$2 = /*#__PURE__*/forwardRef(GoodsModal$1);
10927
11068
 
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 = ".goodsBox.single-row {\n max-height: 800px;\n overflow-y: auto;\n padding-top: 4px;\n flex-basis: 100%;\n}\n.goodsBox.single-row .good-item.rich-item.with-pic,\n.goodsBox.single-row .good-item.rich-item.with-attr,\n.goodsBox.single-row .good-item.rich-item.with-attr.with-pic {\n flex-basis: 100%;\n}\n.goodsBox.single-row .good-item.rich-item .good-attrs {\n flex-grow: 1;\n flex-shrink: 1;\n}\n.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.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.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.good-item.rich-item.with-pic {\n flex-basis: 90px;\n}\n.good-item.rich-item.with-attr {\n flex-basis: 150px;\n}\n.good-item.rich-item.with-attr.with-pic {\n flex-basis: 238px;\n}\n.good-item.rich-item.with-attr.with-pic .goods-imgBox {\n margin-right: 8px;\n}\n.good-item.rich-item .good-item-attr {\n margin-right: 6px;\n width: 52px;\n flex-basis: 52px;\n}\n.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.good-item.rich-item .good-attrs {\n display: flex;\n flex-direction: column;\n font-size: 12px;\n}\n.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.good-item.rich-item .good-attrs .ant-input.id-textarea {\n width: 80px;\n resize: none;\n height: 45px;\n}\n.good-item.rich-item .good-attrs div {\n display: flex;\n}\n.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,19 @@ 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,
9192
9208
  className: "goodsBox goodsBox-item-horizontal--box".concat(isSingleRow ? ' single-row' : '')
9193
9209
  }, imgList === null || imgList === void 0 ? void 0 : imgList.map(function (img, index) {
9194
9210
  return /*#__PURE__*/React__default['default'].createElement("div", {
9195
9211
  key: index,
9196
- className: "goodBox-Img rich-item".concat(hasPic ? ' with-pic' : '').concat(hasAttr ? ' with-attr' : '')
9212
+ className: "good-item rich-item".concat(hasPic ? ' with-pic' : '').concat(hasAttr ? ' with-attr' : '')
9197
9213
  }, !disabled && /*#__PURE__*/React__default['default'].createElement("img", {
9198
9214
  src: iconDelete,
9199
9215
  alt: "",
@@ -9202,7 +9218,7 @@ var GoodItem = function GoodItem(props) {
9202
9218
  handleDelete(index);
9203
9219
  }
9204
9220
  }), hasPic && /*#__PURE__*/React__default['default'].createElement("div", {
9205
- className: "goods-imgBox",
9221
+ className: "good-img",
9206
9222
  key: "".concat(img.picUrl, "-").concat(index, "-goods")
9207
9223
  }, img.platform !== 'taobao' ? /*#__PURE__*/React__default['default'].createElement("img", {
9208
9224
  src: img.picUrl || defaultImg,
@@ -9216,7 +9232,7 @@ var GoodItem = function GoodItem(props) {
9216
9232
  className: "img",
9217
9233
  alt: ""
9218
9234
  }))), /*#__PURE__*/React__default['default'].createElement("div", {
9219
- className: "right-context",
9235
+ className: "good-attrs",
9220
9236
  key: "".concat(img.picUrl, "-").concat(index, "-context")
9221
9237
  }, goodItemAttrs.map(function (item) {
9222
9238
  return item.isShow && /*#__PURE__*/React__default['default'].createElement("div", {
@@ -9265,7 +9281,7 @@ var GoodItem = function GoodItem(props) {
9265
9281
  ref: skuRef,
9266
9282
  userNick: userNick,
9267
9283
  type: type
9268
- }));
9284
+ })));
9269
9285
  };
9270
9286
 
9271
9287
  var TBGoodSerial = function TBGoodSerial(props) {
@@ -10611,7 +10627,6 @@ var columns = [{
10611
10627
  dataIndex: 'code',
10612
10628
  title: '商品编码',
10613
10629
  with: 200,
10614
- // ellipsis: true,
10615
10630
  render: function render(val) {
10616
10631
  return /*#__PURE__*/React__default['default'].createElement("div", {
10617
10632
  style: {
@@ -10622,8 +10637,6 @@ var columns = [{
10622
10637
  }, {
10623
10638
  dataIndex: 'marketPrice',
10624
10639
  title: '市场价',
10625
- // with: 200,
10626
- // ellipsis: true,
10627
10640
  render: function render(val) {
10628
10641
  return /*#__PURE__*/React__default['default'].createElement("div", {
10629
10642
  style: {
@@ -10758,9 +10771,42 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
10758
10771
  var rowSelection = {
10759
10772
  selectedRowKeys: selectIds,
10760
10773
  fixed: true,
10761
- onChange: function onChange(selectedRowKeys, selectedRows, info) {
10762
- setSelectIds(selectedRowKeys);
10763
- setSelect(_toConsumableArray(selectedRows));
10774
+ // onChange: (
10775
+ // selectedRowKeys: React.SetStateAction<string[]>,
10776
+ // selectedRows: any[],
10777
+ // info: any,
10778
+ // ) => {
10779
+ // setSelectIds(selectedRowKeys);
10780
+ // setSelect([...selectedRows]);
10781
+ // },
10782
+ onSelect: function onSelect(record, selected) {
10783
+ if (selected) {
10784
+ setSelectIds([].concat(_toConsumableArray(selectIds), [record.skuCode]));
10785
+ setSelect([].concat(_toConsumableArray(selectList), [record]));
10786
+ } else {
10787
+ setSelectIds(selectIds.filter(function (t) {
10788
+ return t !== record.skuCode;
10789
+ }));
10790
+ setSelect(selectList.filter(function (t) {
10791
+ return t.skuCode !== record.skuCode;
10792
+ }));
10793
+ }
10794
+ },
10795
+ onSelectAll: function onSelectAll(selected, selectedRows, changeRows) {
10796
+ if (selected) {
10797
+ setSelectIds([].concat(_toConsumableArray(selectIds), _toConsumableArray(changeRows.map(function (t) {
10798
+ return t.skuCode;
10799
+ }))));
10800
+ setSelect([].concat(_toConsumableArray(selectList), _toConsumableArray(changeRows)));
10801
+ } else {
10802
+ setSelectIds(lodash.difference(selectIds, changeRows.map(function (t) {
10803
+ return t.skuCode;
10804
+ })));
10805
+ var list = lodash.differenceWith(selectList, changeRows, function (arrVal, othVal) {
10806
+ return arrVal.skuCode !== othVal.skuCode;
10807
+ });
10808
+ setSelect(list);
10809
+ }
10764
10810
  }
10765
10811
  };
10766
10812
  var initData = function initData(list) {
@@ -10848,6 +10894,91 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
10848
10894
  });
10849
10895
  }
10850
10896
  };
10897
+ var showTable = function showTable() {
10898
+ var handleDelete = function handleDelete(record) {
10899
+ setSelectIds(selectIds.filter(function (t) {
10900
+ return t !== record.skuCode;
10901
+ }));
10902
+ setSelect(selectList.filter(function (t) {
10903
+ return t.skuCode !== record.skuCode;
10904
+ }));
10905
+ };
10906
+ var showColumns = [{
10907
+ dataIndex: '',
10908
+ title: "\u64CD\u4F5C",
10909
+ ellipsis: true,
10910
+ width: 100,
10911
+ render: function render(val, record) {
10912
+ return /*#__PURE__*/React__default['default'].createElement(antd.Button, {
10913
+ type: "link",
10914
+ onClick: function onClick() {
10915
+ return handleDelete(record);
10916
+ }
10917
+ }, "\u5220\u9664");
10918
+ }
10919
+ }, {
10920
+ dataIndex: 'skuName',
10921
+ title: '商品sku名称',
10922
+ with: 200,
10923
+ ellipsis: true
10924
+ }, {
10925
+ dataIndex: 'skuCode',
10926
+ title: '商品sku编码',
10927
+ with: 200,
10928
+ ellipsis: true
10929
+ }, {
10930
+ dataIndex: 'name',
10931
+ title: '商品名称',
10932
+ with: 200,
10933
+ ellipsis: true
10934
+ }, {
10935
+ dataIndex: 'goodsId',
10936
+ title: '商品id',
10937
+ with: 200,
10938
+ ellipsis: true
10939
+ }, {
10940
+ dataIndex: 'code',
10941
+ title: '商品编码',
10942
+ with: 200,
10943
+ render: function render(val) {
10944
+ return /*#__PURE__*/React__default['default'].createElement("div", {
10945
+ style: {
10946
+ width: '100px'
10947
+ }
10948
+ }, val);
10949
+ }
10950
+ }, {
10951
+ dataIndex: 'marketPrice',
10952
+ title: '市场价',
10953
+ render: function render(val) {
10954
+ return /*#__PURE__*/React__default['default'].createElement("div", {
10955
+ style: {
10956
+ width: '70px'
10957
+ }
10958
+ }, val);
10959
+ }
10960
+ }];
10961
+ return selectList.length ? /*#__PURE__*/React__default['default'].createElement("div", {
10962
+ style: {
10963
+ width: '100%',
10964
+ maxWidth: '850px'
10965
+ }
10966
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Table, {
10967
+ columns: showColumns,
10968
+ rowKey: 'skuCode',
10969
+ dataSource: selectList,
10970
+ scroll: {
10971
+ x: true,
10972
+ y: 250
10973
+ },
10974
+ pagination: {
10975
+ size: 'small',
10976
+ total: selectIds.length,
10977
+ pageSize: pageSize,
10978
+ showSizeChanger: false
10979
+ }
10980
+ })) : null;
10981
+ };
10851
10982
  return /*#__PURE__*/React__default['default'].createElement(antd.Modal, {
10852
10983
  title: '选择商品',
10853
10984
  okText: '确认',
@@ -10858,7 +10989,10 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
10858
10989
  _onCancel();
10859
10990
  },
10860
10991
  onOk: onOk,
10861
- wrapClassName: "goodModal"
10992
+ wrapClassName: "goodModal",
10993
+ style: {
10994
+ top: 20
10995
+ }
10862
10996
  }, /*#__PURE__*/React__default['default'].createElement(antd.Form, {
10863
10997
  layout: "inline",
10864
10998
  form: form,
@@ -10929,10 +11063,17 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
10929
11063
  total: total,
10930
11064
  current: pageNo,
10931
11065
  pageSize: pageSize,
10932
- pageSizeOptions: [],
11066
+ showSizeChanger: false,
11067
+ showQuickJumper: true,
10933
11068
  onChange: pageChange
10934
11069
  }
10935
- })));
11070
+ }), /*#__PURE__*/React__default['default'].createElement(antd.Popover, {
11071
+ content: showTable(),
11072
+ title: "\u5DF2\u9009\u62E9".concat(selectIds.length, "\u4E2A\u5546\u54C1")
11073
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
11074
+ danger: true,
11075
+ type: "text"
11076
+ }, "\u5DF2\u9009".concat(selectIds.length > 99 ? '99+' : selectIds.length, "\u4E2A\u5546\u54C1"), /*#__PURE__*/React__default['default'].createElement(icons.CaretUpOutlined, null)))));
10936
11077
  };
10937
11078
  var GoodsModal$2 = /*#__PURE__*/React.forwardRef(GoodsModal$1);
10938
11079
 
@@ -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.12",
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": "8ac47d707d920019d40c55235cf245a40f349b86"
68
68
  }