@kmkf-fe-packages/basic-components 0.27.1-test.4 → 0.27.1-test.7

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
@@ -3,7 +3,7 @@ import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, messag
3
3
  import { EyeOutlined, DeleteOutlined, CloseCircleOutlined, 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
- import { AddressData, BsAddressData, WdtAddressData, request as request$1, ExpressData, uuid, LogisticsAddressData, WDT, WDT_ORDER_TYPE_MAP } from '@kmkf-fe-packages/kmkf-utils';
6
+ import { AddressData, BsAddressData, WdtAddressData, request as request$1, useLogisticsData, ExpressData, uuid, LogisticsAddressData, useSendData, WDT_ORDER_TYPE_MAP } from '@kmkf-fe-packages/kmkf-utils';
7
7
  import zhCN from 'antd/lib/locale/zh_CN';
8
8
  import { cloneDeep, difference, differenceWith } from 'lodash';
9
9
  import { useDebounceEffect } from 'ahooks';
@@ -7563,15 +7563,18 @@ function ApaasPosting(props) {
7563
7563
  });
7564
7564
  }
7565
7565
 
7566
- var _excluded$a = ["value", "onChange"];
7566
+ var _excluded$a = ["value", "onChange", "type"];
7567
7567
  function ApaasLogistics(props) {
7568
7568
  var value = props.value,
7569
7569
  onChange = props.onChange,
7570
+ type = props.type,
7570
7571
  other = _objectWithoutProperties(props, _excluded$a);
7571
7572
  var _useState = useState([]),
7572
7573
  _useState2 = _slicedToArray(_useState, 2),
7573
7574
  option = _useState2[0],
7574
7575
  setOptions = _useState2[1];
7576
+ var _useLogisticsData = useLogisticsData(type),
7577
+ logisticsData = _useLogisticsData.logisticsData;
7575
7578
  var isFirst = useRef(false);
7576
7579
  var initPageSource = /*#__PURE__*/function () {
7577
7580
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
@@ -7597,6 +7600,11 @@ function ApaasLogistics(props) {
7597
7600
  isFirst.current = true;
7598
7601
  }
7599
7602
  }, []);
7603
+ useEffect(function () {
7604
+ if (type === 'wdt') {
7605
+ setOptions(_toConsumableArray(logisticsData || []));
7606
+ }
7607
+ }, [logisticsData]);
7600
7608
  return /*#__PURE__*/React.createElement(Select, _objectSpread2(_objectSpread2({}, other), {}, {
7601
7609
  value: value,
7602
7610
  onChange: onChange,
@@ -10417,23 +10425,14 @@ var jstGoods = function jstGoods(props) {
10417
10425
  _useState2 = _slicedToArray(_useState, 2),
10418
10426
  changeIndex = _useState2[0],
10419
10427
  setChangeIndex = _useState2[1]; //选中的包裹
10420
- var _useState3 = useState([]),
10421
- _useState4 = _slicedToArray(_useState3, 2),
10422
- wdtSendOptions = _useState4[0],
10423
- setSendOptions = _useState4[1];
10428
+ var _useSendData = useSendData(componentType === 'WDT_SEND_GOOD' ? 'wdt' : ''),
10429
+ wdtSendOptions = _useSendData.sendData;
10424
10430
  useEffect(function () {
10425
10431
  //没有值塞个默认值
10426
10432
  if (!(value === null || value === void 0 ? void 0 : value.length)) {
10427
10433
  onChange === null || onChange === void 0 ? void 0 : onChange(typeInitValueMap[type]);
10428
10434
  }
10429
10435
  }, [value, type]);
10430
- useEffect(function () {
10431
- if (type === 3 && componentType === 'WDT_SEND_GOOD' && ['sendName', 'all'].includes(showField)) {
10432
- WDT.getWarehouseDataAsync().then(setSendOptions).catch(function (e) {
10433
- message.error((e === null || e === void 0 ? void 0 : e.message) || '获取发货仓数据失败,请刷新重试');
10434
- });
10435
- }
10436
- }, []);
10437
10436
  var content = function content(item, index) {
10438
10437
  return /*#__PURE__*/React.createElement("div", {
10439
10438
  style: {
@@ -10507,7 +10506,8 @@ var jstGoods = function jstGoods(props) {
10507
10506
  style: {
10508
10507
  minWidth: '100px',
10509
10508
  maxWidth: '180px'
10510
- }
10509
+ },
10510
+ type: componentType === 'WDT_LOGISTICS' ? 'wdt' : 'default'
10511
10511
  }) : null, !showField || showField === 'logisticsCode' ? /*#__PURE__*/React.createElement(Input, {
10512
10512
  disabled: disabled,
10513
10513
  placeholder: "\u7269\u6D41\u5355\u53F7",
package/dist/index.js CHANGED
@@ -7574,15 +7574,18 @@ function ApaasPosting(props) {
7574
7574
  });
7575
7575
  }
7576
7576
 
7577
- var _excluded$a = ["value", "onChange"];
7577
+ var _excluded$a = ["value", "onChange", "type"];
7578
7578
  function ApaasLogistics(props) {
7579
7579
  var value = props.value,
7580
7580
  onChange = props.onChange,
7581
+ type = props.type,
7581
7582
  other = _objectWithoutProperties(props, _excluded$a);
7582
7583
  var _useState = React.useState([]),
7583
7584
  _useState2 = _slicedToArray(_useState, 2),
7584
7585
  option = _useState2[0],
7585
7586
  setOptions = _useState2[1];
7587
+ var _useLogisticsData = kmkfUtils.useLogisticsData(type),
7588
+ logisticsData = _useLogisticsData.logisticsData;
7586
7589
  var isFirst = React.useRef(false);
7587
7590
  var initPageSource = /*#__PURE__*/function () {
7588
7591
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
@@ -7608,6 +7611,11 @@ function ApaasLogistics(props) {
7608
7611
  isFirst.current = true;
7609
7612
  }
7610
7613
  }, []);
7614
+ React.useEffect(function () {
7615
+ if (type === 'wdt') {
7616
+ setOptions(_toConsumableArray(logisticsData || []));
7617
+ }
7618
+ }, [logisticsData]);
7611
7619
  return /*#__PURE__*/React__default['default'].createElement(antd.Select, _objectSpread2(_objectSpread2({}, other), {}, {
7612
7620
  value: value,
7613
7621
  onChange: onChange,
@@ -10428,23 +10436,14 @@ var jstGoods = function jstGoods(props) {
10428
10436
  _useState2 = _slicedToArray(_useState, 2),
10429
10437
  changeIndex = _useState2[0],
10430
10438
  setChangeIndex = _useState2[1]; //选中的包裹
10431
- var _useState3 = React.useState([]),
10432
- _useState4 = _slicedToArray(_useState3, 2),
10433
- wdtSendOptions = _useState4[0],
10434
- setSendOptions = _useState4[1];
10439
+ var _useSendData = kmkfUtils.useSendData(componentType === 'WDT_SEND_GOOD' ? 'wdt' : ''),
10440
+ wdtSendOptions = _useSendData.sendData;
10435
10441
  React.useEffect(function () {
10436
10442
  //没有值塞个默认值
10437
10443
  if (!(value === null || value === void 0 ? void 0 : value.length)) {
10438
10444
  onChange === null || onChange === void 0 ? void 0 : onChange(typeInitValueMap[type]);
10439
10445
  }
10440
10446
  }, [value, type]);
10441
- React.useEffect(function () {
10442
- if (type === 3 && componentType === 'WDT_SEND_GOOD' && ['sendName', 'all'].includes(showField)) {
10443
- kmkfUtils.WDT.getWarehouseDataAsync().then(setSendOptions).catch(function (e) {
10444
- antd.message.error((e === null || e === void 0 ? void 0 : e.message) || '获取发货仓数据失败,请刷新重试');
10445
- });
10446
- }
10447
- }, []);
10448
10447
  var content = function content(item, index) {
10449
10448
  return /*#__PURE__*/React__default['default'].createElement("div", {
10450
10449
  style: {
@@ -10518,7 +10517,8 @@ var jstGoods = function jstGoods(props) {
10518
10517
  style: {
10519
10518
  minWidth: '100px',
10520
10519
  maxWidth: '180px'
10521
- }
10520
+ },
10521
+ type: componentType === 'WDT_LOGISTICS' ? 'wdt' : 'default'
10522
10522
  }) : null, !showField || showField === 'logisticsCode' ? /*#__PURE__*/React__default['default'].createElement(antd.Input, {
10523
10523
  disabled: disabled,
10524
10524
  placeholder: "\u7269\u6D41\u5355\u53F7",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "0.27.1-test.4",
3
+ "version": "0.27.1-test.7",
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.27.1-test.4",
23
+ "@kmkf-fe-packages/kmkf-utils": "^0.27.1-test.7",
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": "156d314130701c3e3fd39a375bea1456b569591e"
67
+ "gitHead": "8d75e5eeca6c2b783dd065d893e62731da836488"
68
68
  }