ls-pro-common 1.1.0 → 1.1.2
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 +138 -1
- package/dist/common.js +1 -1
- package/dist/common.js.LICENSE.txt +5 -3
- package/dist/common.min.css +138 -1
- package/dist/common.min.js +1 -1
- package/dist/common.min.js.LICENSE.txt +5 -3
- package/es/components/AreaCascader.js +35 -48
- package/es/components/AreaCascaderPanel.d.ts +5 -0
- package/es/components/AreaCascaderPanel.js +230 -0
- package/es/components/DescritionCard.js +14 -19
- package/es/components/DtlLayout.js +25 -38
- package/es/components/IconSelector.js +27 -50
- package/es/components/ImageSelector.js +89 -139
- package/es/components/InputMultiLine.js +33 -45
- package/es/components/InputTable.d.ts +2 -0
- package/es/components/InputTable.js +118 -160
- package/es/components/Loading.js +3 -6
- package/es/components/common.less +158 -1
- package/es/hooks/useDtl/index.d.ts +2 -0
- package/es/hooks/useDtl/index.js +676 -941
- package/es/hooks/usePermission/index.js +0 -9
- package/es/hooks/useSingle/index.d.ts +2 -0
- package/es/hooks/useSingle/index.js +440 -599
- package/es/http/index.js +113 -149
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -2
- package/es/service/BaseService.js +121 -195
- package/es/utils/index.js +12 -111
- package/lib/components/404.js +1 -6
- package/lib/components/AreaCascader.js +37 -63
- package/lib/components/AreaCascaderPanel.d.ts +5 -0
- package/lib/components/AreaCascaderPanel.js +239 -0
- package/lib/components/DescritionCard.js +16 -33
- package/lib/components/DtlLayout.js +27 -49
- package/lib/components/IconSelector.js +29 -64
- package/lib/components/ImageSelector.js +91 -162
- package/lib/components/InputMultiLine.js +35 -61
- package/lib/components/InputTable.d.ts +2 -0
- package/lib/components/InputTable.js +120 -185
- package/lib/components/Loading.js +4 -16
- package/lib/components/common.less +158 -1
- package/lib/hooks/useDtl/index.d.ts +2 -0
- package/lib/hooks/useDtl/index.js +677 -957
- package/lib/hooks/usePermission/index.js +0 -12
- package/lib/hooks/useSingle/index.d.ts +2 -0
- package/lib/hooks/useSingle/index.js +441 -614
- package/lib/http/index.js +111 -158
- package/lib/index.d.ts +2 -1
- package/lib/index.js +9 -20
- package/lib/service/BaseService.js +121 -201
- package/lib/utils/index.js +13 -209
- package/package.json +2 -2
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { useMemo, useCallback } from 'react';
|
|
2
2
|
import { useLocation } from 'react-router-dom';
|
|
3
3
|
import { getUrlQuery, getResourceProps, getCache, getLoginName } from '../../utils';
|
|
4
|
-
|
|
5
4
|
function usePermission() {
|
|
6
5
|
var routeLocation = useLocation();
|
|
7
6
|
/** @name 资源ID */
|
|
8
|
-
|
|
9
7
|
var resourceId = useMemo(function () {
|
|
10
8
|
var _routeLocation$query;
|
|
11
|
-
|
|
12
9
|
//@ts-ignore
|
|
13
10
|
var resId = routeLocation === null || routeLocation === void 0 ? void 0 : (_routeLocation$query = routeLocation.query) === null || _routeLocation$query === void 0 ? void 0 : _routeLocation$query.resCode;
|
|
14
11
|
if (resId) return resId;
|
|
@@ -18,20 +15,16 @@ function usePermission() {
|
|
|
18
15
|
return getLoginName();
|
|
19
16
|
}, []);
|
|
20
17
|
/** @name 用户权限 */
|
|
21
|
-
|
|
22
18
|
var permissionVal = useMemo(function () {
|
|
23
19
|
var _routeLocation$query2;
|
|
24
|
-
|
|
25
20
|
//@ts-ignore
|
|
26
21
|
var right = routeLocation === null || routeLocation === void 0 ? void 0 : (_routeLocation$query2 = routeLocation.query) === null || _routeLocation$query2 === void 0 ? void 0 : _routeLocation$query2.right;
|
|
27
22
|
if (right) return Number(right);
|
|
28
23
|
return Number(getUrlQuery('right') || getResourceProps('userPermissionVal') || getCache('right') || 0);
|
|
29
24
|
}, []);
|
|
30
25
|
/** @name 资源权限 */
|
|
31
|
-
|
|
32
26
|
var resRightVal = useMemo(function () {
|
|
33
27
|
var _routeLocation$query3;
|
|
34
|
-
|
|
35
28
|
//@ts-ignore
|
|
36
29
|
var right = routeLocation === null || routeLocation === void 0 ? void 0 : (_routeLocation$query3 = routeLocation.query) === null || _routeLocation$query3 === void 0 ? void 0 : _routeLocation$query3.resRight;
|
|
37
30
|
if (right) return Number(right);
|
|
@@ -41,7 +34,6 @@ function usePermission() {
|
|
|
41
34
|
* 检查是否有权限
|
|
42
35
|
* @param val 权限值
|
|
43
36
|
*/
|
|
44
|
-
|
|
45
37
|
var checkRight = useCallback(function (val) {
|
|
46
38
|
if (!val) return true;
|
|
47
39
|
if (location.href.includes("//localhost")) return true;
|
|
@@ -62,6 +54,5 @@ function usePermission() {
|
|
|
62
54
|
canPrint: checkRight(512)
|
|
63
55
|
};
|
|
64
56
|
}
|
|
65
|
-
|
|
66
57
|
;
|
|
67
58
|
export default usePermission;
|
|
@@ -49,5 +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
|
+
ifHistoryData: 0 | 1;
|
|
53
|
+
setIfHistoryData: import("react").Dispatch<import("react").SetStateAction<0 | 1>>;
|
|
52
54
|
};
|
|
53
55
|
export default useSingle;
|