ls-pro-common 1.1.2 → 1.1.4
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.css +1 -2
- package/dist/common.js +1 -1
- package/dist/common.js.LICENSE.txt +9 -0
- package/dist/common.min.css +1 -2
- package/dist/common.min.js +1 -1
- package/dist/common.min.js.LICENSE.txt +9 -0
- package/es/components/Permission.d.ts +6 -0
- package/es/components/Permission.js +10 -0
- package/es/hooks/useDtl/index.d.ts +2 -2
- package/es/hooks/useDtl/index.js +26 -20
- package/es/hooks/useSingle/index.d.ts +3 -3
- package/es/hooks/useSingle/index.js +31 -25
- package/es/http/index.js +18 -12
- package/es/index.d.ts +4 -2
- package/es/index.js +2 -1
- package/es/utils/index.d.ts +9 -22
- package/es/utils/index.js +52 -71
- package/lib/components/Permission.d.ts +6 -0
- package/lib/components/Permission.js +18 -0
- package/lib/hooks/useDtl/index.d.ts +2 -2
- package/lib/hooks/useDtl/index.js +26 -20
- package/lib/hooks/useSingle/index.d.ts +3 -3
- package/lib/hooks/useSingle/index.js +31 -25
- package/lib/http/index.js +18 -12
- package/lib/index.d.ts +4 -2
- package/lib/index.js +7 -0
- package/lib/utils/index.d.ts +9 -22
- package/lib/utils/index.js +73 -82
- package/package.json +2 -2
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _usePermission2 = _interopRequireDefault(require("../hooks/usePermission"));
|
|
10
|
+
var Permission = function Permission(_ref) {
|
|
11
|
+
var children = _ref.children,
|
|
12
|
+
rightValue = _ref.rightValue;
|
|
13
|
+
var _usePermission = (0, _usePermission2.default)(),
|
|
14
|
+
checkRight = _usePermission.checkRight;
|
|
15
|
+
return checkRight(rightValue) ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children) : null;
|
|
16
|
+
};
|
|
17
|
+
var _default = Permission;
|
|
18
|
+
exports.default = _default;
|
|
@@ -19,8 +19,8 @@ export declare type DtlParamType = SingleParamType & {
|
|
|
19
19
|
billType?: string;
|
|
20
20
|
/**@name 动态编码规则字段,主从表一起保存传参 */
|
|
21
21
|
codeRuleDynamicField?: string;
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
/** 是否查询历史数据,通过主表查询面板用户受控组件传入 */
|
|
23
|
+
ifHistory?: 0 | 1;
|
|
24
24
|
};
|
|
25
25
|
declare function useDtl(dtlParam: DtlParamType): {
|
|
26
26
|
formRef: import("react").MutableRefObject<ProFormInstance<any> | undefined>;
|
|
@@ -40,8 +40,8 @@ function useDtl(dtlParam) {
|
|
|
40
40
|
btnStatus = dtlParam.btnStatus,
|
|
41
41
|
beforeAudit = dtlParam.beforeAudit,
|
|
42
42
|
afterAudit = dtlParam.afterAudit,
|
|
43
|
-
_dtlParam$
|
|
44
|
-
|
|
43
|
+
_dtlParam$ifHistory = dtlParam.ifHistory,
|
|
44
|
+
ifHistory = _dtlParam$ifHistory === void 0 ? 0 : _dtlParam$ifHistory;
|
|
45
45
|
var _usePermission = (0, _usePermission2.default)(),
|
|
46
46
|
canAdd = _usePermission.canAdd,
|
|
47
47
|
canEdit = _usePermission.canEdit,
|
|
@@ -655,8 +655,8 @@ function useDtl(dtlParam) {
|
|
|
655
655
|
}
|
|
656
656
|
setSelectedRows([]);
|
|
657
657
|
(_tableRef$current3 = tableRef.current) === null || _tableRef$current3 === void 0 ? void 0 : (_tableRef$current3$cl = _tableRef$current3.clearSelected) === null || _tableRef$current3$cl === void 0 ? void 0 : _tableRef$current3$cl.call(_tableRef$current3);
|
|
658
|
-
if (
|
|
659
|
-
param.
|
|
658
|
+
if (ifHistory === 1) {
|
|
659
|
+
param.ifHistory = 1;
|
|
660
660
|
}
|
|
661
661
|
_context8.t0 = beforeLoad;
|
|
662
662
|
if (!_context8.t0) {
|
|
@@ -703,8 +703,8 @@ function useDtl(dtlParam) {
|
|
|
703
703
|
}();
|
|
704
704
|
var onExportDtl = /*#__PURE__*/function () {
|
|
705
705
|
var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(url, param) {
|
|
706
|
-
var _param$exportColumns;
|
|
707
|
-
var _result$flag6, result, _result$flag7, _result$flag8;
|
|
706
|
+
var _param$exportColumns, _param$searchData;
|
|
707
|
+
var searchArr, _result$flag6, result, _result$flag7, _result$flag8;
|
|
708
708
|
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
709
709
|
while (1) switch (_context9.prev = _context9.next) {
|
|
710
710
|
case 0:
|
|
@@ -722,40 +722,46 @@ function useDtl(dtlParam) {
|
|
|
722
722
|
(0, _utils.showWarn)('请配置业务接口 bizApi 属性');
|
|
723
723
|
return _context9.abrupt("return", false);
|
|
724
724
|
case 6:
|
|
725
|
-
|
|
726
|
-
|
|
725
|
+
// 处理导出历史数据传参
|
|
726
|
+
if (ifHistory && !param.searchData || !((_param$searchData = param.searchData) === null || _param$searchData === void 0 ? void 0 : _param$searchData.includes('ifHistory=1'))) {
|
|
727
|
+
searchArr = (param.searchData || '').split('&');
|
|
728
|
+
searchArr.push('ifHistory=1');
|
|
729
|
+
param.searchData = searchArr.join('&');
|
|
730
|
+
}
|
|
731
|
+
_context9.prev = 7;
|
|
732
|
+
_context9.next = 10;
|
|
727
733
|
return (0, _http.httpPost)(url, param);
|
|
728
|
-
case
|
|
734
|
+
case 10:
|
|
729
735
|
result = _context9.sent;
|
|
730
736
|
if (!(result.data && typeof result.data === 'string')) {
|
|
731
|
-
_context9.next =
|
|
737
|
+
_context9.next = 14;
|
|
732
738
|
break;
|
|
733
739
|
}
|
|
734
740
|
window.open(result.data);
|
|
735
741
|
return _context9.abrupt("return", true);
|
|
736
|
-
case
|
|
742
|
+
case 14:
|
|
737
743
|
if (!(((_result$flag6 = result.flag) === null || _result$flag6 === void 0 ? void 0 : _result$flag6.retCode) === '0')) {
|
|
738
|
-
_context9.next =
|
|
744
|
+
_context9.next = 19;
|
|
739
745
|
break;
|
|
740
746
|
}
|
|
741
747
|
(0, _utils.showSuccess)(((_result$flag7 = result.flag) === null || _result$flag7 === void 0 ? void 0 : _result$flag7.retMsg) || '导出成功');
|
|
742
748
|
return _context9.abrupt("return", true);
|
|
743
|
-
case
|
|
749
|
+
case 19:
|
|
744
750
|
(0, _utils.showError)(((_result$flag8 = result.flag) === null || _result$flag8 === void 0 ? void 0 : _result$flag8.retMsg) || '导出失败,请联系系统管理员');
|
|
745
751
|
return _context9.abrupt("return", false);
|
|
746
|
-
case
|
|
747
|
-
_context9.next =
|
|
752
|
+
case 21:
|
|
753
|
+
_context9.next = 27;
|
|
748
754
|
break;
|
|
749
|
-
case
|
|
750
|
-
_context9.prev =
|
|
751
|
-
_context9.t0 = _context9["catch"](
|
|
755
|
+
case 23:
|
|
756
|
+
_context9.prev = 23;
|
|
757
|
+
_context9.t0 = _context9["catch"](7);
|
|
752
758
|
(0, _utils.showError)(_context9.t0.message);
|
|
753
759
|
return _context9.abrupt("return", false);
|
|
754
|
-
case
|
|
760
|
+
case 27:
|
|
755
761
|
case "end":
|
|
756
762
|
return _context9.stop();
|
|
757
763
|
}
|
|
758
|
-
}, _callee9, null, [[
|
|
764
|
+
}, _callee9, null, [[7, 23]]);
|
|
759
765
|
}));
|
|
760
766
|
return function onExportDtl(_x6, _x7) {
|
|
761
767
|
return _ref9.apply(this, arguments);
|
|
@@ -40,7 +40,7 @@ declare function useSingle(inParam: SingleParamType): {
|
|
|
40
40
|
setEditItem: import("react").Dispatch<any>;
|
|
41
41
|
onRemove: (row: any) => void;
|
|
42
42
|
onSave: (formData: any) => Promise<boolean>;
|
|
43
|
-
onLoad: (params: Record<string, any>, sort: Record<string, any>, filter: Record<string, any
|
|
43
|
+
onLoad: (params: Record<string, any>, sort: Record<string, any>, filter: Record<string, any>, isHistory: any) => Promise<any>;
|
|
44
44
|
onAdd: (item: any) => Promise<void>;
|
|
45
45
|
onEdit: (item: any) => Promise<void>;
|
|
46
46
|
onExport: (url: string, param: exportParam) => Promise<boolean>;
|
|
@@ -49,7 +49,7 @@ declare function useSingle(inParam: SingleParamType): {
|
|
|
49
49
|
checkRight: (val: number) => boolean;
|
|
50
50
|
loginName: string | undefined;
|
|
51
51
|
isAudit: (row?: any) => boolean;
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
ifHistory: 0 | 1;
|
|
53
|
+
setIfHistory: import("react").Dispatch<import("react").SetStateAction<0 | 1>>;
|
|
54
54
|
};
|
|
55
55
|
export default useSingle;
|
|
@@ -77,8 +77,8 @@ function useSingle(inParam) {
|
|
|
77
77
|
/**@name 查看历史数据 */
|
|
78
78
|
var _useState7 = (0, _react.useState)(0),
|
|
79
79
|
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
ifHistory = _useState8[0],
|
|
81
|
+
setIfHistory = _useState8[1];
|
|
82
82
|
/** 判断是否已审核,只有传入审核状态和状态字段才进行判断 */
|
|
83
83
|
var isAudit = (0, _react.useCallback)(function () {
|
|
84
84
|
var row = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
@@ -409,7 +409,7 @@ function useSingle(inParam) {
|
|
|
409
409
|
}();
|
|
410
410
|
/** 加载数据方法 */
|
|
411
411
|
var onLoad = /*#__PURE__*/function () {
|
|
412
|
-
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(params, sort, filter) {
|
|
412
|
+
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(params, sort, filter, isHistory) {
|
|
413
413
|
var _tableRef$current, _tableRef$current$cle;
|
|
414
414
|
var current, pageSize, sumProperties, rest, param, key, k, sortArr, _key, result;
|
|
415
415
|
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
@@ -455,8 +455,8 @@ function useSingle(inParam) {
|
|
|
455
455
|
}
|
|
456
456
|
param.sort = sortArr.join(',');
|
|
457
457
|
}
|
|
458
|
-
if (
|
|
459
|
-
param.
|
|
458
|
+
if (ifHistory || isHistory) {
|
|
459
|
+
param.ifHistory = 1;
|
|
460
460
|
}
|
|
461
461
|
setSelectedRows([]);
|
|
462
462
|
(_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : (_tableRef$current$cle = _tableRef$current.clearSelected) === null || _tableRef$current$cle === void 0 ? void 0 : _tableRef$current$cle.call(_tableRef$current);
|
|
@@ -500,14 +500,14 @@ function useSingle(inParam) {
|
|
|
500
500
|
}
|
|
501
501
|
}, _callee6);
|
|
502
502
|
}));
|
|
503
|
-
return function onLoad(_x5, _x6, _x7) {
|
|
503
|
+
return function onLoad(_x5, _x6, _x7, _x8) {
|
|
504
504
|
return _ref6.apply(this, arguments);
|
|
505
505
|
};
|
|
506
506
|
}();
|
|
507
507
|
var onExport = /*#__PURE__*/function () {
|
|
508
508
|
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(url, param) {
|
|
509
|
-
var _param$exportColumns;
|
|
510
|
-
var _result$flag4, result, _result$flag5, _result$flag6;
|
|
509
|
+
var _param$exportColumns, _param$searchData;
|
|
510
|
+
var searchArr, _result$flag4, result, _result$flag5, _result$flag6;
|
|
511
511
|
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
512
512
|
while (1) switch (_context7.prev = _context7.next) {
|
|
513
513
|
case 0:
|
|
@@ -525,43 +525,49 @@ function useSingle(inParam) {
|
|
|
525
525
|
(0, _utils.showWarn)('请配置业务接口 bizApi 属性');
|
|
526
526
|
return _context7.abrupt("return", false);
|
|
527
527
|
case 6:
|
|
528
|
-
|
|
529
|
-
|
|
528
|
+
// 处理导出历史数据传参,如果组件里没有传入参数,hooks再处理一次
|
|
529
|
+
if (ifHistory && !param.searchData || !((_param$searchData = param.searchData) === null || _param$searchData === void 0 ? void 0 : _param$searchData.includes('ifHistory=1'))) {
|
|
530
|
+
searchArr = (param.searchData || '').split('&');
|
|
531
|
+
searchArr.push('ifHistory=1');
|
|
532
|
+
param.searchData = searchArr.join('&');
|
|
533
|
+
}
|
|
534
|
+
_context7.prev = 7;
|
|
535
|
+
_context7.next = 10;
|
|
530
536
|
return (0, _http.httpPost)(url, param, true, false);
|
|
531
|
-
case
|
|
537
|
+
case 10:
|
|
532
538
|
result = _context7.sent;
|
|
533
539
|
if (!(result.data && typeof result.data === 'string')) {
|
|
534
|
-
_context7.next =
|
|
540
|
+
_context7.next = 14;
|
|
535
541
|
break;
|
|
536
542
|
}
|
|
537
543
|
window.open(result.data);
|
|
538
544
|
return _context7.abrupt("return", true);
|
|
539
|
-
case
|
|
545
|
+
case 14:
|
|
540
546
|
if (!(((_result$flag4 = result.flag) === null || _result$flag4 === void 0 ? void 0 : _result$flag4.retCode) === '0')) {
|
|
541
|
-
_context7.next =
|
|
547
|
+
_context7.next = 19;
|
|
542
548
|
break;
|
|
543
549
|
}
|
|
544
550
|
(0, _utils.showSuccess)(((_result$flag5 = result.flag) === null || _result$flag5 === void 0 ? void 0 : _result$flag5.retMsg) || '导出成功');
|
|
545
551
|
return _context7.abrupt("return", true);
|
|
546
|
-
case
|
|
552
|
+
case 19:
|
|
547
553
|
(0, _utils.showError)(((_result$flag6 = result.flag) === null || _result$flag6 === void 0 ? void 0 : _result$flag6.retMsg) || '导出失败,请联系系统管理员');
|
|
548
554
|
return _context7.abrupt("return", false);
|
|
549
|
-
case
|
|
550
|
-
_context7.next =
|
|
555
|
+
case 21:
|
|
556
|
+
_context7.next = 28;
|
|
551
557
|
break;
|
|
552
|
-
case
|
|
553
|
-
_context7.prev =
|
|
554
|
-
_context7.t0 = _context7["catch"](
|
|
558
|
+
case 23:
|
|
559
|
+
_context7.prev = 23;
|
|
560
|
+
_context7.t0 = _context7["catch"](7);
|
|
555
561
|
console.log(_context7.t0);
|
|
556
562
|
(0, _utils.showError)(_context7.t0.message);
|
|
557
563
|
return _context7.abrupt("return", false);
|
|
558
|
-
case
|
|
564
|
+
case 28:
|
|
559
565
|
case "end":
|
|
560
566
|
return _context7.stop();
|
|
561
567
|
}
|
|
562
|
-
}, _callee7, null, [[
|
|
568
|
+
}, _callee7, null, [[7, 23]]);
|
|
563
569
|
}));
|
|
564
|
-
return function onExport(
|
|
570
|
+
return function onExport(_x9, _x10) {
|
|
565
571
|
return _ref7.apply(this, arguments);
|
|
566
572
|
};
|
|
567
573
|
}();
|
|
@@ -655,8 +661,8 @@ function useSingle(inParam) {
|
|
|
655
661
|
checkRight: checkRight,
|
|
656
662
|
loginName: loginName,
|
|
657
663
|
isAudit: isAudit,
|
|
658
|
-
|
|
659
|
-
|
|
664
|
+
ifHistory: ifHistory,
|
|
665
|
+
setIfHistory: setIfHistory
|
|
660
666
|
};
|
|
661
667
|
}
|
|
662
668
|
;
|
package/lib/http/index.js
CHANGED
|
@@ -20,11 +20,11 @@ var request = (0, _umiRequest.extend)({
|
|
|
20
20
|
timeout: 60000
|
|
21
21
|
});
|
|
22
22
|
var httpStatus = {
|
|
23
|
-
404: '
|
|
24
|
-
429: '
|
|
25
|
-
502: '
|
|
26
|
-
503: '
|
|
27
|
-
504: '
|
|
23
|
+
404: '请求的服务不存在',
|
|
24
|
+
429: '请求的服务繁忙',
|
|
25
|
+
502: '请求的服务网关出错',
|
|
26
|
+
503: '请求的服务器异常',
|
|
27
|
+
504: '请求服务超时'
|
|
28
28
|
};
|
|
29
29
|
/** 请求拦截器,统一添加token */
|
|
30
30
|
request.interceptors.request.use(function (url, options) {
|
|
@@ -70,7 +70,7 @@ request.interceptors.request.use(function (url, options) {
|
|
|
70
70
|
/** 请求返回拦截器,统一处理业务异常 */
|
|
71
71
|
request.interceptors.response.use( /*#__PURE__*/function () {
|
|
72
72
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(response, options) {
|
|
73
|
-
var noMsg, _data$flag, _data$flag2, _data$flag3, _data$flag4, data, retCode, retMsg, requestId, faultCode, text, _data$flag5, _data$flag6, _data$flag7, _data$flag8, _data, _retCode, _retMsg, status, _requestId, _faultCode;
|
|
73
|
+
var noMsg, _data$flag, _data$flag2, _data$flag3, _data$flag4, data, retCode, retMsg, requestId, faultCode, text, _text, _data$flag5, _data$flag6, _data$flag7, _data$flag8, _data, _retCode, _retMsg, status, _requestId, _faultCode;
|
|
74
74
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
75
75
|
while (1) switch (_context.prev = _context.next) {
|
|
76
76
|
case 0:
|
|
@@ -94,7 +94,13 @@ request.interceptors.response.use( /*#__PURE__*/function () {
|
|
|
94
94
|
if (faultCode) {
|
|
95
95
|
(0, _utils.httpError)(retMsg, retCode, faultCode, options.url);
|
|
96
96
|
} else {
|
|
97
|
-
|
|
97
|
+
text = httpStatus[response.status];
|
|
98
|
+
if (response.status === 503 && response.statusText === 'no healthy upstream') {
|
|
99
|
+
text = '请求的服务未启动';
|
|
100
|
+
} else if (response.status === 503 && response.statusText === 'reached concurrency limit') {
|
|
101
|
+
text = '请求的服务被限流';
|
|
102
|
+
}
|
|
103
|
+
(0, _utils.showError)(text || retMsg);
|
|
98
104
|
}
|
|
99
105
|
}
|
|
100
106
|
_context.next = 18;
|
|
@@ -102,13 +108,13 @@ request.interceptors.response.use( /*#__PURE__*/function () {
|
|
|
102
108
|
case 13:
|
|
103
109
|
_context.prev = 13;
|
|
104
110
|
_context.t0 = _context["catch"](2);
|
|
105
|
-
|
|
111
|
+
_text = httpStatus[response.status];
|
|
106
112
|
if (response.status === 503 && response.statusText === 'no healthy upstream') {
|
|
107
|
-
|
|
113
|
+
_text = '请求的服务未启动';
|
|
108
114
|
} else if (response.status === 503 && response.statusText === 'reached concurrency limit') {
|
|
109
|
-
|
|
115
|
+
_text = '请求的服务被限流';
|
|
110
116
|
}
|
|
111
|
-
(0, _utils.showError)(
|
|
117
|
+
(0, _utils.showError)(_text || _context.t0.message || response.statusText);
|
|
112
118
|
case 18:
|
|
113
119
|
_context.next = 30;
|
|
114
120
|
break;
|
|
@@ -122,7 +128,7 @@ request.interceptors.response.use( /*#__PURE__*/function () {
|
|
|
122
128
|
case 23:
|
|
123
129
|
_data = _context.sent;
|
|
124
130
|
_retCode = (_data === null || _data === void 0 ? void 0 : (_data$flag5 = _data.flag) === null || _data$flag5 === void 0 ? void 0 : _data$flag5.retCode) || '0';
|
|
125
|
-
_retMsg = ((_data$flag6 = _data.flag) === null || _data$flag6 === void 0 ? void 0 : _data$flag6.retMsg) || '
|
|
131
|
+
_retMsg = ((_data$flag6 = _data.flag) === null || _data$flag6 === void 0 ? void 0 : _data$flag6.retMsg) || '请求的服务出错';
|
|
126
132
|
status = ((0, _utils.getUrlQuery)('apiStatus') || '0').split(',');
|
|
127
133
|
_requestId = (_data$flag7 = _data.flag) === null || _data$flag7 === void 0 ? void 0 : _data$flag7.requestId;
|
|
128
134
|
_faultCode = (_data$flag8 = _data.flag) === null || _data$flag8 === void 0 ? void 0 : _data$flag8.faultCode;
|
package/lib/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import InputMultiLine from './components/InputMultiLine';
|
|
|
8
8
|
import AreaCascader from './components/AreaCascader';
|
|
9
9
|
import AreaCascaderPanel from './components/AreaCascaderPanel';
|
|
10
10
|
import DescritionCard from './components/DescritionCard';
|
|
11
|
+
import Permission from './components/Permission';
|
|
11
12
|
import BaseService from './service/BaseService';
|
|
12
13
|
import request, { httpGet, httpPut, httpPost, httpDelete, getDict, fetchOptions } from './http';
|
|
13
14
|
import * as utils from './utils';
|
|
@@ -19,5 +20,6 @@ import usePermission from './hooks/usePermission';
|
|
|
19
20
|
import type { ApiResponse, TableToolbar, BaseApiType, MethodType } from './typing';
|
|
20
21
|
import type { DtlLyaoutProps } from './components/DtlLayout';
|
|
21
22
|
import type { DescritionCardProps } from './components/DescritionCard';
|
|
22
|
-
|
|
23
|
-
export {
|
|
23
|
+
import type { PermissionProps } from './components/Permission';
|
|
24
|
+
export type { ApiResponse, TableToolbar, BaseApiType, MethodType, DtlLyaoutProps, DescritionCardProps, PermissionProps };
|
|
25
|
+
export { DtlLayout, InputTable, Page404, Loading, IconSelector, ImageSelector, InputMultiLine, AreaCascader, AreaCascaderPanel, DescritionCard, Permission, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl, usePermission };
|
package/lib/index.js
CHANGED
|
@@ -71,6 +71,12 @@ Object.defineProperty(exports, "Page404", {
|
|
|
71
71
|
return _.default;
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
|
+
Object.defineProperty(exports, "Permission", {
|
|
75
|
+
enumerable: true,
|
|
76
|
+
get: function get() {
|
|
77
|
+
return _Permission.default;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
74
80
|
Object.defineProperty(exports, "fetchOptions", {
|
|
75
81
|
enumerable: true,
|
|
76
82
|
get: function get() {
|
|
@@ -142,6 +148,7 @@ var _InputMultiLine = _interopRequireDefault(require("./components/InputMultiLin
|
|
|
142
148
|
var _AreaCascader = _interopRequireDefault(require("./components/AreaCascader"));
|
|
143
149
|
var _AreaCascaderPanel = _interopRequireDefault(require("./components/AreaCascaderPanel"));
|
|
144
150
|
var _DescritionCard = _interopRequireDefault(require("./components/DescritionCard"));
|
|
151
|
+
var _Permission = _interopRequireDefault(require("./components/Permission"));
|
|
145
152
|
var _BaseService = _interopRequireDefault(require("./service/BaseService"));
|
|
146
153
|
var _http = _interopRequireWildcard(require("./http"));
|
|
147
154
|
var utils = _interopRequireWildcard(require("./utils"));
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ModalFuncProps } from 'antd';
|
|
2
2
|
import ReactDOM from 'react-dom';
|
|
3
3
|
import React from 'react';
|
|
4
|
+
export { throttle, debounce } from 'lodash';
|
|
4
5
|
export { getUrlQuery, setUrlQuery, toGatewayUrl, dateFormat, getResourceProps } from 'ls-pro-table';
|
|
5
6
|
/**
|
|
6
7
|
* 设置文档title
|
|
@@ -26,13 +27,14 @@ export declare const today: () => string;
|
|
|
26
27
|
*/
|
|
27
28
|
export declare const now: () => string;
|
|
28
29
|
/**
|
|
29
|
-
*
|
|
30
|
+
* 时间加减
|
|
31
|
+
* @param dt 原始时间,传 null 为当前时间
|
|
30
32
|
* @param addDay 添加添数,可为负数
|
|
31
33
|
* @param addMonth 添加月数,可为负数
|
|
32
34
|
* @param addYear 添加年数,可以负责
|
|
33
|
-
* @returns YYYY-MM-DD
|
|
35
|
+
* @returns YYYY-MM-DD hh:mm:ss
|
|
34
36
|
*/
|
|
35
|
-
export declare const
|
|
37
|
+
export declare const dateAdd: (dt: Date | null, addDay: number, addMonth?: number, addYear?: number) => string;
|
|
36
38
|
/**
|
|
37
39
|
* 当前时间加减
|
|
38
40
|
* @param addDay 添加添数,可为负数
|
|
@@ -42,14 +44,13 @@ export declare const todayAdd: (addDay: number, addMonth?: number, addYear?: num
|
|
|
42
44
|
*/
|
|
43
45
|
export declare const nowAdd: (addDay: number, addMonth?: number, addYear?: number) => string;
|
|
44
46
|
/**
|
|
45
|
-
*
|
|
46
|
-
* @param dt 原始时间,传 null 为当前时间
|
|
47
|
+
* 当前日期加减
|
|
47
48
|
* @param addDay 添加添数,可为负数
|
|
48
49
|
* @param addMonth 添加月数,可为负数
|
|
49
50
|
* @param addYear 添加年数,可以负责
|
|
50
|
-
* @returns YYYY-MM-DD
|
|
51
|
+
* @returns YYYY-MM-DD
|
|
51
52
|
*/
|
|
52
|
-
export declare const
|
|
53
|
+
export declare const todayAdd: (addDay: number, addMonth?: number, addYear?: number) => string;
|
|
53
54
|
/**
|
|
54
55
|
* 千位符格式化数值
|
|
55
56
|
* @param num 数值
|
|
@@ -75,6 +76,7 @@ export declare const setCookie: (key: string, value: string | number, day?: numb
|
|
|
75
76
|
* @returns
|
|
76
77
|
*/
|
|
77
78
|
export declare const isLogin: () => boolean;
|
|
79
|
+
export declare const getFullScreenElement: () => any;
|
|
78
80
|
/**
|
|
79
81
|
* 设置本地缓存
|
|
80
82
|
* @param { String } key 关键字
|
|
@@ -101,7 +103,6 @@ export declare const showError: (text: string) => void;
|
|
|
101
103
|
export declare const showWarn: (text: string) => void;
|
|
102
104
|
/** @name 显示成功 */
|
|
103
105
|
export declare const showSuccess: (text: string) => void;
|
|
104
|
-
export declare const getFullScreenElement: () => any;
|
|
105
106
|
/**
|
|
106
107
|
* 弹框提示
|
|
107
108
|
* @param text 提示信息
|
|
@@ -165,20 +166,6 @@ export declare const treeFind: (list: any[], key: string, val: any, children?: s
|
|
|
165
166
|
* @returns 返回已处理好的表头[{dataIndex:sizeTypeNo,title:'国标码',width:120,children[...]},{dataIndex:'f1',...}...]
|
|
166
167
|
*/
|
|
167
168
|
export declare const handleSizeCols: (orgSizeHeader: any[], typeWidth?: number, sizeWidth?: number) => any[];
|
|
168
|
-
/**
|
|
169
|
-
* 函数防抖, 限定的时间内多次操作只执行最后一次
|
|
170
|
-
* @param fn 函数
|
|
171
|
-
* @param delay 限时
|
|
172
|
-
* @returns function
|
|
173
|
-
*/
|
|
174
|
-
export declare const debounce: (fn: Function, delay?: number) => () => void;
|
|
175
|
-
/**
|
|
176
|
-
* 函数节流,限时内只触发一次函数
|
|
177
|
-
* @param fn 函数
|
|
178
|
-
* @param delay 限时
|
|
179
|
-
* @returns function
|
|
180
|
-
*/
|
|
181
|
-
export declare const throttle: (fn: Function, delay?: number) => (...args: any[]) => void;
|
|
182
169
|
/**
|
|
183
170
|
* 绑定事件
|
|
184
171
|
* @param eventName 事件名
|