ls-pro-common 3.1.24 → 3.1.26
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/common.js +1 -1
- package/dist/common.min.js +1 -1
- package/es/http/index.d.ts +13 -1
- package/es/http/index.js +166 -90
- package/es/http/mdmRequest.d.ts +21 -21
- package/es/http/mdmRequest.js +64 -43
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/utils/index.d.ts +8 -1
- package/es/utils/index.js +28 -9
- package/lib/http/index.d.ts +13 -1
- package/lib/http/index.js +166 -90
- package/lib/http/mdmRequest.d.ts +21 -21
- package/lib/http/mdmRequest.js +64 -43
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -2
- package/lib/utils/index.d.ts +8 -1
- package/lib/utils/index.js +28 -9
- package/package.json +1 -1
package/es/http/index.d.ts
CHANGED
|
@@ -70,7 +70,7 @@ export declare function getDict(dictCodes: string, showValue?: boolean, needGate
|
|
|
70
70
|
* @returns
|
|
71
71
|
*/
|
|
72
72
|
export declare function fetchOptions(url: string, param: any, valueField: string, labelField: string, showValue?: boolean, needGateWay?: boolean, timeout?: number, isGet?: boolean, valueIsNumber?: boolean): Promise<any>;
|
|
73
|
-
export declare const
|
|
73
|
+
export declare const getResourceRight: (ids: string[]) => Promise<any>;
|
|
74
74
|
/**
|
|
75
75
|
* 分批获取数据,当一次性取大于2000条,且是第一页时,分多次去取,避免一次性取太多数据导致后端工程压力过大
|
|
76
76
|
*
|
|
@@ -83,4 +83,16 @@ export declare const checkResourceRight: (ids: string[]) => Promise<any>;
|
|
|
83
83
|
* @returns
|
|
84
84
|
*/
|
|
85
85
|
export declare const httpBatchGet: (url: string, params?: Record<string, any>, needGateWay?: boolean, timeout?: number) => Promise<any>;
|
|
86
|
+
/**
|
|
87
|
+
* 分批获取数据,当一次性取大于2000条,且是第一页时,分多次去取,避免一次性取太多数据导致后端工程压力过大
|
|
88
|
+
*
|
|
89
|
+
* 注意:如果pageSize小于等于2000,或不是取第一页数据时,直接使用普通请求
|
|
90
|
+
*
|
|
91
|
+
* @param url
|
|
92
|
+
* @param params
|
|
93
|
+
* @param needGateWay
|
|
94
|
+
* @param timeout
|
|
95
|
+
* @returns
|
|
96
|
+
*/
|
|
97
|
+
export declare const httpBatchPost: (url: string, params?: Record<string, any>, needGateWay?: boolean, timeout?: number) => Promise<any>;
|
|
86
98
|
export default request;
|
package/es/http/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
4
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
4
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
@@ -409,7 +410,7 @@ export function fetchOptions(_x3, _x4, _x5, _x6) {
|
|
|
409
410
|
return _fetchOptions.apply(this, arguments);
|
|
410
411
|
}
|
|
411
412
|
function _fetchOptions() {
|
|
412
|
-
_fetchOptions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
413
|
+
_fetchOptions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(url, param, valueField, labelField) {
|
|
413
414
|
var showValue,
|
|
414
415
|
needGateWay,
|
|
415
416
|
timeout,
|
|
@@ -417,44 +418,44 @@ function _fetchOptions() {
|
|
|
417
418
|
valueIsNumber,
|
|
418
419
|
rows,
|
|
419
420
|
data,
|
|
420
|
-
|
|
421
|
-
return _regeneratorRuntime.wrap(function
|
|
422
|
-
while (1) switch (
|
|
421
|
+
_args4 = arguments;
|
|
422
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
423
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
423
424
|
case 0:
|
|
424
|
-
showValue =
|
|
425
|
-
needGateWay =
|
|
426
|
-
timeout =
|
|
427
|
-
isGet =
|
|
428
|
-
valueIsNumber =
|
|
425
|
+
showValue = _args4.length > 4 && _args4[4] !== undefined ? _args4[4] : true;
|
|
426
|
+
needGateWay = _args4.length > 5 && _args4[5] !== undefined ? _args4[5] : true;
|
|
427
|
+
timeout = _args4.length > 6 && _args4[6] !== undefined ? _args4[6] : 60000;
|
|
428
|
+
isGet = _args4.length > 7 && _args4[7] !== undefined ? _args4[7] : true;
|
|
429
|
+
valueIsNumber = _args4.length > 8 && _args4[8] !== undefined ? _args4[8] : false;
|
|
429
430
|
if (!isGet) {
|
|
430
|
-
|
|
431
|
+
_context4.next = 14;
|
|
431
432
|
break;
|
|
432
433
|
}
|
|
433
|
-
|
|
434
|
-
return
|
|
434
|
+
_context4.next = 8;
|
|
435
|
+
return httpBatchGet(url, param, needGateWay, timeout);
|
|
435
436
|
case 8:
|
|
436
|
-
|
|
437
|
-
if (
|
|
438
|
-
|
|
437
|
+
_context4.t0 = _context4.sent.rows;
|
|
438
|
+
if (_context4.t0) {
|
|
439
|
+
_context4.next = 11;
|
|
439
440
|
break;
|
|
440
441
|
}
|
|
441
|
-
|
|
442
|
+
_context4.t0 = [];
|
|
442
443
|
case 11:
|
|
443
|
-
rows =
|
|
444
|
-
|
|
444
|
+
rows = _context4.t0;
|
|
445
|
+
_context4.next = 20;
|
|
445
446
|
break;
|
|
446
447
|
case 14:
|
|
447
|
-
|
|
448
|
-
return
|
|
448
|
+
_context4.next = 16;
|
|
449
|
+
return httpBatchPost(url, param, needGateWay, timeout);
|
|
449
450
|
case 16:
|
|
450
|
-
|
|
451
|
-
if (
|
|
452
|
-
|
|
451
|
+
_context4.t1 = _context4.sent.rows;
|
|
452
|
+
if (_context4.t1) {
|
|
453
|
+
_context4.next = 19;
|
|
453
454
|
break;
|
|
454
455
|
}
|
|
455
|
-
|
|
456
|
+
_context4.t1 = [];
|
|
456
457
|
case 19:
|
|
457
|
-
rows =
|
|
458
|
+
rows = _context4.t1;
|
|
458
459
|
case 20:
|
|
459
460
|
data = (rows || []).map(function (o) {
|
|
460
461
|
return _objectSpread(_objectSpread({}, o), {}, {
|
|
@@ -463,21 +464,36 @@ function _fetchOptions() {
|
|
|
463
464
|
label: (showValue ? o[valueField] + '→' : '') + o[labelField]
|
|
464
465
|
});
|
|
465
466
|
});
|
|
466
|
-
return
|
|
467
|
+
return _context4.abrupt("return", data);
|
|
467
468
|
case 22:
|
|
468
469
|
case "end":
|
|
469
|
-
return
|
|
470
|
+
return _context4.stop();
|
|
470
471
|
}
|
|
471
|
-
},
|
|
472
|
+
}, _callee4);
|
|
472
473
|
}));
|
|
473
474
|
return _fetchOptions.apply(this, arguments);
|
|
474
475
|
}
|
|
475
|
-
export var
|
|
476
|
+
export var getResourceRight = function getResourceRight(ids) {
|
|
476
477
|
var url = '/lesoon/lesoon-petrel-permission-api/sysUserRole/selectResourceIds';
|
|
477
478
|
return httpPost(url, {
|
|
478
479
|
resourceIds: ids
|
|
479
480
|
}, true, false);
|
|
480
481
|
};
|
|
482
|
+
// 默认分批获取数据的大小
|
|
483
|
+
var defaultPageSize = 2000;
|
|
484
|
+
/**
|
|
485
|
+
* 分批获取数据
|
|
486
|
+
*
|
|
487
|
+
* @param url
|
|
488
|
+
* @param params
|
|
489
|
+
* @param method
|
|
490
|
+
* @param needGateWay
|
|
491
|
+
* @param timeout
|
|
492
|
+
* @returns
|
|
493
|
+
*/
|
|
494
|
+
function httpBatchRequest(_x7) {
|
|
495
|
+
return _httpBatchRequest.apply(this, arguments);
|
|
496
|
+
}
|
|
481
497
|
/**
|
|
482
498
|
* 分批获取数据,当一次性取大于2000条,且是第一页时,分多次去取,避免一次性取太多数据导致后端工程压力过大
|
|
483
499
|
*
|
|
@@ -489,20 +505,25 @@ export var checkResourceRight = function checkResourceRight(ids) {
|
|
|
489
505
|
* @param timeout
|
|
490
506
|
* @returns
|
|
491
507
|
*/
|
|
492
|
-
|
|
493
|
-
|
|
508
|
+
function _httpBatchRequest() {
|
|
509
|
+
_httpBatchRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(url) {
|
|
494
510
|
var params,
|
|
511
|
+
method,
|
|
495
512
|
needGateWay,
|
|
496
513
|
timeout,
|
|
497
514
|
urlPageSize,
|
|
498
515
|
urlPageNum,
|
|
499
516
|
pageSize,
|
|
500
517
|
pageNum,
|
|
518
|
+
isV2,
|
|
519
|
+
PAGE_SIZE,
|
|
520
|
+
PAGE_NUM,
|
|
501
521
|
cleanUrl,
|
|
502
522
|
batchSize,
|
|
503
523
|
allRows,
|
|
504
524
|
total,
|
|
505
525
|
currentPage,
|
|
526
|
+
_objectSpread2,
|
|
506
527
|
firstParams,
|
|
507
528
|
firstResponse,
|
|
508
529
|
firstData,
|
|
@@ -515,68 +536,70 @@ export var httpBatchGet = /*#__PURE__*/function () {
|
|
|
515
536
|
batchPages,
|
|
516
537
|
batchRequests,
|
|
517
538
|
batchResponses,
|
|
518
|
-
|
|
519
|
-
return _regeneratorRuntime.wrap(function
|
|
520
|
-
while (1) switch (
|
|
539
|
+
_args5 = arguments;
|
|
540
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
541
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
521
542
|
case 0:
|
|
522
|
-
params =
|
|
523
|
-
|
|
524
|
-
|
|
543
|
+
params = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
|
|
544
|
+
method = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : 'get';
|
|
545
|
+
needGateWay = _args5.length > 3 && _args5[3] !== undefined ? _args5[3] : true;
|
|
546
|
+
timeout = _args5.length > 4 && _args5[4] !== undefined ? _args5[4] : 60000;
|
|
525
547
|
// 从URL中获取pageSize和page参数
|
|
526
|
-
urlPageSize = getUrlQuery('pageSize', url);
|
|
527
|
-
urlPageNum = getUrlQuery('page', url) || '1'; //
|
|
528
|
-
pageSize = params.pageSize || (urlPageSize ? parseInt(urlPageSize) :
|
|
529
|
-
pageNum = params.page || (
|
|
530
|
-
if (!(pageSize <=
|
|
531
|
-
|
|
548
|
+
urlPageSize = getUrlQuery('pageSize', url) || getUrlQuery('page.size', url);
|
|
549
|
+
urlPageNum = getUrlQuery('page', url) || getUrlQuery('page.pn', url) || '1'; // 优先使用params中的分页参数,其次使用URL中的分页参数
|
|
550
|
+
pageSize = (params === null || params === void 0 ? void 0 : params.pageSize) || (params === null || params === void 0 ? void 0 : params['page.size']) || (urlPageSize ? parseInt(urlPageSize) : defaultPageSize);
|
|
551
|
+
pageNum = (params === null || params === void 0 ? void 0 : params.page) || (params === null || params === void 0 ? void 0 : params['page.pn']) || parseInt(urlPageNum); // 如果pageSize小于等于defaultPageSize,或不是取第一页数据时,直接使用普通请求
|
|
552
|
+
if (!(pageSize <= defaultPageSize || pageNum !== 1)) {
|
|
553
|
+
_context5.next = 10;
|
|
532
554
|
break;
|
|
533
555
|
}
|
|
534
|
-
return
|
|
535
|
-
case
|
|
536
|
-
|
|
556
|
+
return _context5.abrupt("return", ajax(url, params, method, needGateWay, true, timeout));
|
|
557
|
+
case 10:
|
|
558
|
+
isV2 = url.includes('page.size') || (params === null || params === void 0 ? void 0 : params['page.size']) ? true : false;
|
|
559
|
+
PAGE_SIZE = isV2 ? 'page.size' : 'pageSize';
|
|
560
|
+
PAGE_NUM = isV2 ? 'page.pn' : 'page'; // 分批获取数据时,需要从URL中移除原有的pageSize和page参数
|
|
537
561
|
cleanUrl = url;
|
|
538
562
|
if (urlPageSize) {
|
|
539
|
-
cleanUrl = setUrlQuery(cleanUrl, {
|
|
540
|
-
pageSize: ''
|
|
541
|
-
}).replace('&pageSize=', '').replace('pageSize=', '');
|
|
563
|
+
cleanUrl = setUrlQuery(cleanUrl, _defineProperty({}, PAGE_SIZE, '')).replace("&".concat(PAGE_SIZE, "="), '').replace("".concat(PAGE_SIZE, "="), '');
|
|
542
564
|
}
|
|
543
565
|
if (urlPageNum) {
|
|
544
|
-
cleanUrl = setUrlQuery(cleanUrl, {
|
|
545
|
-
page: ''
|
|
546
|
-
}).replace('&page=', '').replace('page=', '');
|
|
566
|
+
cleanUrl = setUrlQuery(cleanUrl, _defineProperty({}, PAGE_NUM, '')).replace("&".concat(PAGE_NUM, "="), '').replace("".concat(PAGE_NUM, "="), '');
|
|
547
567
|
}
|
|
548
568
|
// 分批获取数据
|
|
549
|
-
batchSize =
|
|
569
|
+
batchSize = defaultPageSize;
|
|
550
570
|
allRows = [];
|
|
551
571
|
total = 0;
|
|
552
572
|
currentPage = pageNum;
|
|
553
|
-
|
|
573
|
+
_context5.prev = 20;
|
|
554
574
|
// 第一次请求,获取总数
|
|
555
|
-
firstParams = _objectSpread(_objectSpread({}, params), {}, {
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
575
|
+
firstParams = _objectSpread(_objectSpread({}, params), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, PAGE_SIZE, batchSize), _defineProperty(_objectSpread2, PAGE_NUM, currentPage), _objectSpread2));
|
|
576
|
+
_context5.next = 24;
|
|
577
|
+
return ajax(cleanUrl, firstParams, method, needGateWay, true, timeout);
|
|
578
|
+
case 24:
|
|
579
|
+
firstResponse = _context5.sent;
|
|
580
|
+
firstData = firstResponse; // 如果返回值没有 rows 或 total,直接返回普通请求
|
|
581
|
+
if (!(!('rows' in firstData) || !('total' in firstData))) {
|
|
582
|
+
_context5.next = 28;
|
|
583
|
+
break;
|
|
584
|
+
}
|
|
585
|
+
return _context5.abrupt("return", ajax(url, params, method, needGateWay, true, timeout));
|
|
586
|
+
case 28:
|
|
564
587
|
if (firstData.rows) {
|
|
565
588
|
allRows.push.apply(allRows, _toConsumableArray(firstData.rows));
|
|
566
589
|
total = firstData.total || 0;
|
|
567
590
|
}
|
|
568
|
-
// 如果total小于等于
|
|
569
|
-
if (!(total <=
|
|
570
|
-
|
|
591
|
+
// 如果total小于等于defaultPageSize,不需要分批获取,直接返回
|
|
592
|
+
if (!(total <= defaultPageSize)) {
|
|
593
|
+
_context5.next = 31;
|
|
571
594
|
break;
|
|
572
595
|
}
|
|
573
|
-
return
|
|
574
|
-
case
|
|
596
|
+
return _context5.abrupt("return", firstResponse);
|
|
597
|
+
case 31:
|
|
575
598
|
// 计算实际需要获取的数据量(不超过用户传入的pageSize)
|
|
576
599
|
actualPageSize = Math.min(pageSize, total); // 计算需要请求的总页数(基于实际需要的数据量)
|
|
577
600
|
totalPages = Math.ceil(actualPageSize / batchSize); // 如果还有更多数据需要获取
|
|
578
601
|
if (!(totalPages > 1)) {
|
|
579
|
-
|
|
602
|
+
_context5.next = 48;
|
|
580
603
|
break;
|
|
581
604
|
}
|
|
582
605
|
// 分批并发请求,每次最多6个并发
|
|
@@ -587,13 +610,14 @@ export var httpBatchGet = /*#__PURE__*/function () {
|
|
|
587
610
|
}
|
|
588
611
|
// 分批处理请求
|
|
589
612
|
_i = 0;
|
|
590
|
-
case
|
|
613
|
+
case 38:
|
|
591
614
|
if (!(_i < remainingPages.length)) {
|
|
592
|
-
|
|
615
|
+
_context5.next = 48;
|
|
593
616
|
break;
|
|
594
617
|
}
|
|
595
618
|
batchPages = remainingPages.slice(_i, _i + maxConcurrent);
|
|
596
619
|
batchRequests = batchPages.map(function (pageNum) {
|
|
620
|
+
var _objectSpread3;
|
|
597
621
|
// 计算当前页应该获取的数据量
|
|
598
622
|
var currentPageSize = batchSize;
|
|
599
623
|
// 如果是最后一页,计算实际需要的数据量
|
|
@@ -601,16 +625,13 @@ export var httpBatchGet = /*#__PURE__*/function () {
|
|
|
601
625
|
var remainingData = actualPageSize - (pageNum - 1) * batchSize;
|
|
602
626
|
currentPageSize = Math.max(0, remainingData);
|
|
603
627
|
}
|
|
604
|
-
var requestParams = _objectSpread(_objectSpread({}, params), {}, {
|
|
605
|
-
|
|
606
|
-
page: pageNum
|
|
607
|
-
});
|
|
608
|
-
return ajax(cleanUrl, requestParams, 'get', needGateWay, true, timeout);
|
|
628
|
+
var requestParams = _objectSpread(_objectSpread({}, params), {}, (_objectSpread3 = {}, _defineProperty(_objectSpread3, PAGE_SIZE, currentPageSize), _defineProperty(_objectSpread3, PAGE_NUM, pageNum), _objectSpread3));
|
|
629
|
+
return ajax(cleanUrl, requestParams, method, needGateWay, true, timeout);
|
|
609
630
|
}); // 并发执行当前批次的请求
|
|
610
|
-
|
|
631
|
+
_context5.next = 43;
|
|
611
632
|
return Promise.all(batchRequests);
|
|
612
|
-
case
|
|
613
|
-
batchResponses =
|
|
633
|
+
case 43:
|
|
634
|
+
batchResponses = _context5.sent;
|
|
614
635
|
// 合并当前批次的响应数据
|
|
615
636
|
batchResponses.forEach(function (response) {
|
|
616
637
|
var data = response;
|
|
@@ -618,32 +639,87 @@ export var httpBatchGet = /*#__PURE__*/function () {
|
|
|
618
639
|
allRows.push.apply(allRows, _toConsumableArray(data.rows));
|
|
619
640
|
}
|
|
620
641
|
});
|
|
621
|
-
case
|
|
642
|
+
case 45:
|
|
622
643
|
_i += maxConcurrent;
|
|
623
|
-
|
|
644
|
+
_context5.next = 38;
|
|
624
645
|
break;
|
|
625
|
-
case
|
|
646
|
+
case 48:
|
|
626
647
|
// 如果获取的数据超过了用户要求的pageSize,进行截取
|
|
627
648
|
if (allRows.length > actualPageSize) {
|
|
628
649
|
allRows.splice(actualPageSize);
|
|
629
650
|
}
|
|
630
651
|
// 返回合并后的数据,保持与原始响应格式一致
|
|
631
|
-
return
|
|
652
|
+
return _context5.abrupt("return", _objectSpread(_objectSpread({}, firstResponse), {}, {
|
|
632
653
|
rows: allRows,
|
|
633
654
|
total: total // 保持原始的total值
|
|
634
655
|
}));
|
|
635
|
-
case
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
throw
|
|
639
|
-
case
|
|
656
|
+
case 52:
|
|
657
|
+
_context5.prev = 52;
|
|
658
|
+
_context5.t0 = _context5["catch"](20);
|
|
659
|
+
throw _context5.t0;
|
|
660
|
+
case 55:
|
|
661
|
+
case "end":
|
|
662
|
+
return _context5.stop();
|
|
663
|
+
}
|
|
664
|
+
}, _callee5, null, [[20, 52]]);
|
|
665
|
+
}));
|
|
666
|
+
return _httpBatchRequest.apply(this, arguments);
|
|
667
|
+
}
|
|
668
|
+
export var httpBatchGet = /*#__PURE__*/function () {
|
|
669
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(url) {
|
|
670
|
+
var params,
|
|
671
|
+
needGateWay,
|
|
672
|
+
timeout,
|
|
673
|
+
_args2 = arguments;
|
|
674
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
675
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
676
|
+
case 0:
|
|
677
|
+
params = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
|
|
678
|
+
needGateWay = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : true;
|
|
679
|
+
timeout = _args2.length > 3 && _args2[3] !== undefined ? _args2[3] : 60000;
|
|
680
|
+
return _context2.abrupt("return", httpBatchRequest(url, params, 'get', needGateWay, timeout));
|
|
681
|
+
case 4:
|
|
640
682
|
case "end":
|
|
641
683
|
return _context2.stop();
|
|
642
684
|
}
|
|
643
|
-
}, _callee2
|
|
685
|
+
}, _callee2);
|
|
644
686
|
}));
|
|
645
|
-
return function httpBatchGet(
|
|
687
|
+
return function httpBatchGet(_x8) {
|
|
646
688
|
return _ref2.apply(this, arguments);
|
|
647
689
|
};
|
|
648
690
|
}();
|
|
691
|
+
/**
|
|
692
|
+
* 分批获取数据,当一次性取大于2000条,且是第一页时,分多次去取,避免一次性取太多数据导致后端工程压力过大
|
|
693
|
+
*
|
|
694
|
+
* 注意:如果pageSize小于等于2000,或不是取第一页数据时,直接使用普通请求
|
|
695
|
+
*
|
|
696
|
+
* @param url
|
|
697
|
+
* @param params
|
|
698
|
+
* @param needGateWay
|
|
699
|
+
* @param timeout
|
|
700
|
+
* @returns
|
|
701
|
+
*/
|
|
702
|
+
export var httpBatchPost = /*#__PURE__*/function () {
|
|
703
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(url) {
|
|
704
|
+
var params,
|
|
705
|
+
needGateWay,
|
|
706
|
+
timeout,
|
|
707
|
+
_args3 = arguments;
|
|
708
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
709
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
710
|
+
case 0:
|
|
711
|
+
params = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
|
|
712
|
+
needGateWay = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : true;
|
|
713
|
+
timeout = _args3.length > 3 && _args3[3] !== undefined ? _args3[3] : 60000;
|
|
714
|
+
return _context3.abrupt("return", httpBatchRequest(url, params, 'post', needGateWay, timeout));
|
|
715
|
+
case 4:
|
|
716
|
+
case "end":
|
|
717
|
+
return _context3.stop();
|
|
718
|
+
}
|
|
719
|
+
}, _callee3);
|
|
720
|
+
}));
|
|
721
|
+
return function httpBatchPost(_x9) {
|
|
722
|
+
return _ref3.apply(this, arguments);
|
|
723
|
+
};
|
|
724
|
+
}();
|
|
649
725
|
export default request;
|
package/es/http/mdmRequest.d.ts
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @param params 请求参数
|
|
3
|
-
* @name 获取主数据货主数据,调用接口/lesoon-mdm-center-api/bmOwner/
|
|
3
|
+
* @name 获取主数据货主数据,调用接口/lesoon-mdm-center-api/bmOwner/page
|
|
4
4
|
* @returns
|
|
5
5
|
*/
|
|
6
6
|
export declare const getOwner: (params?: any) => Promise<any>;
|
|
7
7
|
/**
|
|
8
8
|
* @param params 请求参数
|
|
9
|
-
* @name 获取主数据仓库数据,调用接口/lesoon-mdm-center-api/bmStore/
|
|
9
|
+
* @name 获取主数据仓库数据,调用接口/lesoon-mdm-center-api/bmStore/page
|
|
10
10
|
* @returns
|
|
11
11
|
*/
|
|
12
12
|
export declare const getStore: (params?: any) => Promise<any>;
|
|
13
13
|
/**
|
|
14
14
|
* @param params 请求参数
|
|
15
|
-
* @name 获取主数据品牌部数据,调用接口/lesoon-mdm-center-api/bmBrandDept/
|
|
15
|
+
* @name 获取主数据品牌部数据,调用接口/lesoon-mdm-center-api/bmBrandDept/page
|
|
16
16
|
* @returns
|
|
17
17
|
*/
|
|
18
18
|
export declare const getBrandDept: (params?: any) => Promise<any>;
|
|
19
19
|
/**
|
|
20
20
|
* @param params 请求参数
|
|
21
|
-
* @name 获取主数据物流大区数据,调用接口/lesoon-mdm-center-api/bmLogisticRegion/
|
|
21
|
+
* @name 获取主数据物流大区数据,调用接口/lesoon-mdm-center-api/bmLogisticRegion/page
|
|
22
22
|
* @returns
|
|
23
23
|
*/
|
|
24
24
|
export declare const getLogisticRegion: (params?: any) => Promise<any>;
|
|
25
25
|
/**
|
|
26
26
|
* @param where: {forwarderLevel: 1 // 承运商级别 1:一级 2:二级 , forwarderType: 1 // 承运商类型 0:货运公司 1:快递公司 }
|
|
27
|
-
* @name 获取快递/快运承运商,调用接口/lesoon-mdm-center-api/bmForwarder/
|
|
27
|
+
* @name 获取快递/快运承运商,调用接口/lesoon-mdm-center-api/bmForwarder/page
|
|
28
28
|
* @returns
|
|
29
29
|
*/
|
|
30
30
|
export declare const getExpressCompany: (params?: any) => Promise<any>;
|
|
@@ -34,48 +34,48 @@ export declare const getExpressCompany: (params?: any) => Promise<any>;
|
|
|
34
34
|
*/
|
|
35
35
|
export declare const getExpressCompanyPage: (params?: any) => Promise<any>;
|
|
36
36
|
/**
|
|
37
|
-
* @name 实体仓,调用接口/lesoon-mdm-center-api/bmPhysicalStore/
|
|
37
|
+
* @name 实体仓,调用接口/lesoon-mdm-center-api/bmPhysicalStore/page
|
|
38
38
|
* @returns
|
|
39
39
|
*/
|
|
40
40
|
export declare const getPhysicalStore: (params?: any) => Promise<any>;
|
|
41
41
|
/**
|
|
42
42
|
* @param params
|
|
43
|
-
* @name 结算大类,调用接口/lesoon-mdm-center-api/bmSettlementCate/
|
|
43
|
+
* @name 结算大类,调用接口/lesoon-mdm-center-api/bmSettlementCate/page
|
|
44
44
|
* @returns
|
|
45
45
|
*/
|
|
46
46
|
export declare const getSettleCategory: (params?: any) => Promise<any>;
|
|
47
47
|
/**
|
|
48
48
|
* @param param
|
|
49
|
-
* @name 获取损益主体,调用接口/lesoon-mdm-center-api/bmProfitLossMain/
|
|
49
|
+
* @name 获取损益主体,调用接口/lesoon-mdm-center-api/bmProfitLossMain/page
|
|
50
50
|
* @returns
|
|
51
51
|
*/
|
|
52
52
|
export declare const getProfitLossMain: (param?: any) => Promise<any>;
|
|
53
53
|
/**
|
|
54
54
|
* @param params
|
|
55
|
-
* @name 结算公司,调用接口/lesoon-mdm-center-api/bmSettleCompany/
|
|
55
|
+
* @name 结算公司,调用接口/lesoon-mdm-center-api/bmSettleCompany/page
|
|
56
56
|
* @returns
|
|
57
57
|
*/
|
|
58
58
|
export declare const getSettleCompany: (params?: any) => Promise<any>;
|
|
59
59
|
/**
|
|
60
60
|
* @param params
|
|
61
|
-
* @name 货权,调用接口/lesoon-mdm-center-api/bmPowerUnit/
|
|
61
|
+
* @name 货权,调用接口/lesoon-mdm-center-api/bmPowerUnit/page
|
|
62
62
|
* @returns
|
|
63
63
|
*/
|
|
64
64
|
export declare const getPowerUnit: (params?: any) => Promise<any>;
|
|
65
65
|
/**
|
|
66
66
|
* @param params
|
|
67
|
-
* @name 结算账号,调用接口/lesoon-mdm-center-api/bmSettleAccount/
|
|
67
|
+
* @name 结算账号,调用接口/lesoon-mdm-center-api/bmSettleAccount/page
|
|
68
68
|
* @returns
|
|
69
69
|
*/
|
|
70
70
|
export declare const getSettleAccount: (params?: any) => Promise<any>;
|
|
71
71
|
/**
|
|
72
|
-
* @name 获取物流大类,调用接口/lesoon-mdm-center-api/bmLogisticCategory/
|
|
72
|
+
* @name 获取物流大类,调用接口/lesoon-mdm-center-api/bmLogisticCategory/page
|
|
73
73
|
* @returns
|
|
74
74
|
*/
|
|
75
75
|
export declare const getLogisticCategory: (params?: any) => Promise<any>;
|
|
76
76
|
/**
|
|
77
77
|
* @param param
|
|
78
|
-
* @name 管理城市,调用接口/lesoon-mdm-center-api/bmManagingCity/
|
|
78
|
+
* @name 管理城市,调用接口/lesoon-mdm-center-api/bmManagingCity/page
|
|
79
79
|
* @returns
|
|
80
80
|
*/
|
|
81
81
|
export declare const getManagingCity: (params?: any) => Promise<any>;
|
|
@@ -88,13 +88,13 @@ interface AreaParams {
|
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
90
|
* @param {where: {level:'province'}} level Province=省,city=市,district=区
|
|
91
|
-
* @name 获取省市区,调用接口/lesoon-mdm-center-api/sysAdministrativeDivision/
|
|
91
|
+
* @name 获取省市区,调用接口/lesoon-mdm-center-api/sysAdministrativeDivision/page
|
|
92
92
|
* @returns
|
|
93
93
|
*/
|
|
94
94
|
export declare const getArea: (params?: AreaParams) => Promise<any>;
|
|
95
95
|
/**
|
|
96
96
|
* @param param
|
|
97
|
-
* @name 获取集散中心,调用接口/lesoon-mdm-center-api/tmsTransportLocno/
|
|
97
|
+
* @name 获取集散中心,调用接口/lesoon-mdm-center-api/tmsTransportLocno/page
|
|
98
98
|
* @returns
|
|
99
99
|
*/
|
|
100
100
|
export declare const getTransportLocno: (params?: any) => Promise<any>;
|
|
@@ -118,37 +118,37 @@ export declare const getUploadPointPage: (params?: any) => Promise<any>;
|
|
|
118
118
|
export declare const getShopPage: (params?: any) => Promise<any>;
|
|
119
119
|
/**
|
|
120
120
|
* @param param
|
|
121
|
-
* @name 获取颜色,调用接口/lesoon-mdm-center-api/bmColor/
|
|
121
|
+
* @name 获取颜色,调用接口/lesoon-mdm-center-api/bmColor/page
|
|
122
122
|
* @returns
|
|
123
123
|
*/
|
|
124
124
|
export declare const getColor: (params?: any) => Promise<any>;
|
|
125
125
|
/**
|
|
126
126
|
* @param param
|
|
127
|
-
* @name 获取尺码类型,调用接口/lesoon-mdm-center-api/bmSizeType/
|
|
127
|
+
* @name 获取尺码类型,调用接口/lesoon-mdm-center-api/bmSizeType/page
|
|
128
128
|
* @returns
|
|
129
129
|
*/
|
|
130
130
|
export declare const getSizeType: (params?: any) => Promise<any>;
|
|
131
131
|
/**
|
|
132
132
|
* @param param
|
|
133
|
-
* @name 获取性别,调用接口/lesoon-mdm-center-api/bmGender/
|
|
133
|
+
* @name 获取性别,调用接口/lesoon-mdm-center-api/bmGender/page
|
|
134
134
|
* @returns
|
|
135
135
|
*/
|
|
136
136
|
export declare const getGender: (params?: any) => Promise<any>;
|
|
137
137
|
/**
|
|
138
138
|
* @param param
|
|
139
|
-
* @name 获取年份,调用接口/lesoon-mdm-center-api/bmYear/
|
|
139
|
+
* @name 获取年份,调用接口/lesoon-mdm-center-api/bmYear/page
|
|
140
140
|
* @returns
|
|
141
141
|
*/
|
|
142
142
|
export declare const getYear: (params?: any) => Promise<any>;
|
|
143
143
|
/**
|
|
144
144
|
* @param param
|
|
145
|
-
* @name 获取季节,调用接口/lesoon-mdm-center-api/bmSeason/
|
|
145
|
+
* @name 获取季节,调用接口/lesoon-mdm-center-api/bmSeason/page
|
|
146
146
|
* @returns
|
|
147
147
|
*/
|
|
148
148
|
export declare const getSeason: (params?: any) => Promise<any>;
|
|
149
149
|
/**
|
|
150
150
|
* @param param
|
|
151
|
-
* @name 获取品类,调用接口/lesoon-mdm-center-api/bmCategory/
|
|
151
|
+
* @name 获取品类,调用接口/lesoon-mdm-center-api/bmCategory/page
|
|
152
152
|
* @returns
|
|
153
153
|
*/
|
|
154
154
|
export declare const getCategory: (params?: any) => Promise<any>;
|