@kmkf-fe-packages/basic-components 0.26.0 → 0.26.1-alpha.1
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, 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,
|
|
6
|
+
import { AddressData, BsAddressData, WdtAddressData, request as request$1, ExpressData, uuid, LogisticsAddressData, 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';
|
|
@@ -7377,72 +7377,17 @@ function ApaasRate(props) {
|
|
|
7377
7377
|
}));
|
|
7378
7378
|
}
|
|
7379
7379
|
|
|
7380
|
-
var addressData = AddressData.getInstance();
|
|
7381
|
-
var bsAddressData = BsAddressData.getInstance();
|
|
7382
|
-
var wdtAddressData = WdtAddressData.getInstance();
|
|
7383
7380
|
var Province = function Province(props) {
|
|
7381
|
+
var _mapping$type;
|
|
7384
7382
|
var _props$type = props.type,
|
|
7385
|
-
type = _props$type === void 0 ? 'workOrder' : _props$type
|
|
7386
|
-
|
|
7387
|
-
|
|
7388
|
-
|
|
7389
|
-
|
|
7390
|
-
setOptions = _useState2[1];
|
|
7391
|
-
var num = 0;
|
|
7392
|
-
var isFirst = useRef(false);
|
|
7393
|
-
var time = useRef();
|
|
7394
|
-
var initPageSource = /*#__PURE__*/function () {
|
|
7395
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
7396
|
-
var options;
|
|
7397
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
7398
|
-
while (1) switch (_context.prev = _context.next) {
|
|
7399
|
-
case 0:
|
|
7400
|
-
num++;
|
|
7401
|
-
options = ({
|
|
7402
|
-
bs: bsAddressData,
|
|
7403
|
-
wdt: wdtAddressData,
|
|
7404
|
-
workOrder: addressData
|
|
7405
|
-
}[type] || addressData).addressOptions || [];
|
|
7406
|
-
if (!(options === null || options === void 0 ? void 0 : options.length) && num < 6) {
|
|
7407
|
-
time.current = setTimeout(function () {
|
|
7408
|
-
initPageSource();
|
|
7409
|
-
}, 1000);
|
|
7410
|
-
}
|
|
7411
|
-
setOptions(options);
|
|
7412
|
-
case 4:
|
|
7413
|
-
case "end":
|
|
7414
|
-
return _context.stop();
|
|
7415
|
-
}
|
|
7416
|
-
}, _callee);
|
|
7417
|
-
}));
|
|
7418
|
-
return function initPageSource() {
|
|
7419
|
-
return _ref.apply(this, arguments);
|
|
7420
|
-
};
|
|
7421
|
-
}();
|
|
7422
|
-
var getBsAddress = function getBsAddress() {
|
|
7423
|
-
var data = JSON.parse(localStorage.getItem('bsAddressData') || '[]');
|
|
7424
|
-
if (data.length) {
|
|
7425
|
-
var options = toTree(data, 1);
|
|
7426
|
-
setOptions(options);
|
|
7427
|
-
}
|
|
7383
|
+
type = _props$type === void 0 ? 'workOrder' : _props$type;
|
|
7384
|
+
var mapping = {
|
|
7385
|
+
workOrder: AddressData.getInstance(),
|
|
7386
|
+
bs: BsAddressData.getInstance(),
|
|
7387
|
+
wdt: WdtAddressData.getInstance()
|
|
7428
7388
|
};
|
|
7429
|
-
//如果值改变地址不存在则再获取一遍
|
|
7430
|
-
useEffect(function () {
|
|
7431
|
-
if (value && type == 'bs' && !option.length) {
|
|
7432
|
-
getBsAddress();
|
|
7433
|
-
}
|
|
7434
|
-
}, [value, type, option]);
|
|
7435
|
-
useEffect(function () {
|
|
7436
|
-
if (!isFirst.current) {
|
|
7437
|
-
initPageSource();
|
|
7438
|
-
isFirst.current = true;
|
|
7439
|
-
}
|
|
7440
|
-
return function () {
|
|
7441
|
-
clearTimeout(time.current);
|
|
7442
|
-
};
|
|
7443
|
-
}, []);
|
|
7444
7389
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Cascader, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
7445
|
-
options:
|
|
7390
|
+
options: ((_mapping$type = mapping[type]) === null || _mapping$type === void 0 ? void 0 : _mapping$type.addressOptions) || [],
|
|
7446
7391
|
style: {
|
|
7447
7392
|
minWidth: '100px'
|
|
7448
7393
|
},
|
|
@@ -7619,7 +7564,6 @@ function ApaasPosting(props) {
|
|
|
7619
7564
|
}
|
|
7620
7565
|
|
|
7621
7566
|
var _excluded$a = ["value", "onChange"];
|
|
7622
|
-
var express = ExpressData.getInstance();
|
|
7623
7567
|
function ApaasLogistics(props) {
|
|
7624
7568
|
var value = props.value,
|
|
7625
7569
|
onChange = props.onChange,
|
|
@@ -7631,11 +7575,13 @@ function ApaasLogistics(props) {
|
|
|
7631
7575
|
var isFirst = useRef(false);
|
|
7632
7576
|
var initPageSource = /*#__PURE__*/function () {
|
|
7633
7577
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
7578
|
+
var express;
|
|
7634
7579
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
7635
7580
|
while (1) switch (_context.prev = _context.next) {
|
|
7636
7581
|
case 0:
|
|
7582
|
+
express = ExpressData.getInstance();
|
|
7637
7583
|
setOptions(express.expressData || []);
|
|
7638
|
-
case
|
|
7584
|
+
case 2:
|
|
7639
7585
|
case "end":
|
|
7640
7586
|
return _context.stop();
|
|
7641
7587
|
}
|
package/dist/index.js
CHANGED
|
@@ -7388,72 +7388,17 @@ function ApaasRate(props) {
|
|
|
7388
7388
|
}));
|
|
7389
7389
|
}
|
|
7390
7390
|
|
|
7391
|
-
var addressData = kmkfUtils.AddressData.getInstance();
|
|
7392
|
-
var bsAddressData = kmkfUtils.BsAddressData.getInstance();
|
|
7393
|
-
var wdtAddressData = kmkfUtils.WdtAddressData.getInstance();
|
|
7394
7391
|
var Province = function Province(props) {
|
|
7392
|
+
var _mapping$type;
|
|
7395
7393
|
var _props$type = props.type,
|
|
7396
|
-
type = _props$type === void 0 ? 'workOrder' : _props$type
|
|
7397
|
-
|
|
7398
|
-
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
setOptions = _useState2[1];
|
|
7402
|
-
var num = 0;
|
|
7403
|
-
var isFirst = React.useRef(false);
|
|
7404
|
-
var time = React.useRef();
|
|
7405
|
-
var initPageSource = /*#__PURE__*/function () {
|
|
7406
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
7407
|
-
var options;
|
|
7408
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
7409
|
-
while (1) switch (_context.prev = _context.next) {
|
|
7410
|
-
case 0:
|
|
7411
|
-
num++;
|
|
7412
|
-
options = ({
|
|
7413
|
-
bs: bsAddressData,
|
|
7414
|
-
wdt: wdtAddressData,
|
|
7415
|
-
workOrder: addressData
|
|
7416
|
-
}[type] || addressData).addressOptions || [];
|
|
7417
|
-
if (!(options === null || options === void 0 ? void 0 : options.length) && num < 6) {
|
|
7418
|
-
time.current = setTimeout(function () {
|
|
7419
|
-
initPageSource();
|
|
7420
|
-
}, 1000);
|
|
7421
|
-
}
|
|
7422
|
-
setOptions(options);
|
|
7423
|
-
case 4:
|
|
7424
|
-
case "end":
|
|
7425
|
-
return _context.stop();
|
|
7426
|
-
}
|
|
7427
|
-
}, _callee);
|
|
7428
|
-
}));
|
|
7429
|
-
return function initPageSource() {
|
|
7430
|
-
return _ref.apply(this, arguments);
|
|
7431
|
-
};
|
|
7432
|
-
}();
|
|
7433
|
-
var getBsAddress = function getBsAddress() {
|
|
7434
|
-
var data = JSON.parse(localStorage.getItem('bsAddressData') || '[]');
|
|
7435
|
-
if (data.length) {
|
|
7436
|
-
var options = kmkfUtils.toTree(data, 1);
|
|
7437
|
-
setOptions(options);
|
|
7438
|
-
}
|
|
7394
|
+
type = _props$type === void 0 ? 'workOrder' : _props$type;
|
|
7395
|
+
var mapping = {
|
|
7396
|
+
workOrder: kmkfUtils.AddressData.getInstance(),
|
|
7397
|
+
bs: kmkfUtils.BsAddressData.getInstance(),
|
|
7398
|
+
wdt: kmkfUtils.WdtAddressData.getInstance()
|
|
7439
7399
|
};
|
|
7440
|
-
//如果值改变地址不存在则再获取一遍
|
|
7441
|
-
React.useEffect(function () {
|
|
7442
|
-
if (value && type == 'bs' && !option.length) {
|
|
7443
|
-
getBsAddress();
|
|
7444
|
-
}
|
|
7445
|
-
}, [value, type, option]);
|
|
7446
|
-
React.useEffect(function () {
|
|
7447
|
-
if (!isFirst.current) {
|
|
7448
|
-
initPageSource();
|
|
7449
|
-
isFirst.current = true;
|
|
7450
|
-
}
|
|
7451
|
-
return function () {
|
|
7452
|
-
clearTimeout(time.current);
|
|
7453
|
-
};
|
|
7454
|
-
}, []);
|
|
7455
7400
|
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Cascader, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
7456
|
-
options:
|
|
7401
|
+
options: ((_mapping$type = mapping[type]) === null || _mapping$type === void 0 ? void 0 : _mapping$type.addressOptions) || [],
|
|
7457
7402
|
style: {
|
|
7458
7403
|
minWidth: '100px'
|
|
7459
7404
|
},
|
|
@@ -7630,7 +7575,6 @@ function ApaasPosting(props) {
|
|
|
7630
7575
|
}
|
|
7631
7576
|
|
|
7632
7577
|
var _excluded$a = ["value", "onChange"];
|
|
7633
|
-
var express = kmkfUtils.ExpressData.getInstance();
|
|
7634
7578
|
function ApaasLogistics(props) {
|
|
7635
7579
|
var value = props.value,
|
|
7636
7580
|
onChange = props.onChange,
|
|
@@ -7642,11 +7586,13 @@ function ApaasLogistics(props) {
|
|
|
7642
7586
|
var isFirst = React.useRef(false);
|
|
7643
7587
|
var initPageSource = /*#__PURE__*/function () {
|
|
7644
7588
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
7589
|
+
var express;
|
|
7645
7590
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
7646
7591
|
while (1) switch (_context.prev = _context.next) {
|
|
7647
7592
|
case 0:
|
|
7593
|
+
express = kmkfUtils.ExpressData.getInstance();
|
|
7648
7594
|
setOptions(express.expressData || []);
|
|
7649
|
-
case
|
|
7595
|
+
case 2:
|
|
7650
7596
|
case "end":
|
|
7651
7597
|
return _context.stop();
|
|
7652
7598
|
}
|
|
@@ -3,7 +3,7 @@ interface ProvinceType {
|
|
|
3
3
|
value: string[];
|
|
4
4
|
disabled: boolean;
|
|
5
5
|
onChange: (value: any, selectedOptions: any) => void;
|
|
6
|
-
type?:
|
|
6
|
+
type?: 'workOrder' | 'bs' | 'wdt';
|
|
7
7
|
}
|
|
8
8
|
declare const Province: (props: Partial<ProvinceType>) => React.JSX.Element;
|
|
9
9
|
export default Province;
|
|
@@ -9,7 +9,7 @@ interface ApaasPostingProps {
|
|
|
9
9
|
value: Partial<PostingValueType>;
|
|
10
10
|
disabled: boolean;
|
|
11
11
|
onChange: (val: any) => void;
|
|
12
|
-
type?:
|
|
12
|
+
type?: 'workOrder' | 'bs' | 'wdt';
|
|
13
13
|
}
|
|
14
14
|
declare function ApaasPosting(props: Partial<ApaasPostingProps>): React.JSX.Element;
|
|
15
15
|
export default ApaasPosting;
|
|
@@ -9,7 +9,7 @@ interface IdentifyAddressProps {
|
|
|
9
9
|
onChange: (value: any) => void;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
showIdentify?: boolean;
|
|
12
|
-
type?:
|
|
12
|
+
type?: 'workOrder' | 'bs' | 'wdt';
|
|
13
13
|
}
|
|
14
14
|
declare const IdentifyAddress: (props: IdentifyAddressProps) => React.JSX.Element;
|
|
15
15
|
export default IdentifyAddress;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/basic-components",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.1-alpha.1",
|
|
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.26.
|
|
23
|
+
"@kmkf-fe-packages/kmkf-utils": "^0.26.1-alpha.1",
|
|
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": "
|
|
67
|
+
"gitHead": "82b28b7d1fb02d0a197460143bc023a75c81ddfb"
|
|
68
68
|
}
|