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
|
@@ -4,20 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var _reactRouterDom = require("react-router-dom");
|
|
11
|
-
|
|
12
9
|
var _utils = require("../../utils");
|
|
13
|
-
|
|
14
10
|
function usePermission() {
|
|
15
11
|
var routeLocation = (0, _reactRouterDom.useLocation)();
|
|
16
12
|
/** @name 资源ID */
|
|
17
|
-
|
|
18
13
|
var resourceId = (0, _react.useMemo)(function () {
|
|
19
14
|
var _routeLocation$query;
|
|
20
|
-
|
|
21
15
|
//@ts-ignore
|
|
22
16
|
var resId = routeLocation === null || routeLocation === void 0 ? void 0 : (_routeLocation$query = routeLocation.query) === null || _routeLocation$query === void 0 ? void 0 : _routeLocation$query.resCode;
|
|
23
17
|
if (resId) return resId;
|
|
@@ -27,20 +21,16 @@ function usePermission() {
|
|
|
27
21
|
return (0, _utils.getLoginName)();
|
|
28
22
|
}, []);
|
|
29
23
|
/** @name 用户权限 */
|
|
30
|
-
|
|
31
24
|
var permissionVal = (0, _react.useMemo)(function () {
|
|
32
25
|
var _routeLocation$query2;
|
|
33
|
-
|
|
34
26
|
//@ts-ignore
|
|
35
27
|
var right = routeLocation === null || routeLocation === void 0 ? void 0 : (_routeLocation$query2 = routeLocation.query) === null || _routeLocation$query2 === void 0 ? void 0 : _routeLocation$query2.right;
|
|
36
28
|
if (right) return Number(right);
|
|
37
29
|
return Number((0, _utils.getUrlQuery)('right') || (0, _utils.getResourceProps)('userPermissionVal') || (0, _utils.getCache)('right') || 0);
|
|
38
30
|
}, []);
|
|
39
31
|
/** @name 资源权限 */
|
|
40
|
-
|
|
41
32
|
var resRightVal = (0, _react.useMemo)(function () {
|
|
42
33
|
var _routeLocation$query3;
|
|
43
|
-
|
|
44
34
|
//@ts-ignore
|
|
45
35
|
var right = routeLocation === null || routeLocation === void 0 ? void 0 : (_routeLocation$query3 = routeLocation.query) === null || _routeLocation$query3 === void 0 ? void 0 : _routeLocation$query3.resRight;
|
|
46
36
|
if (right) return Number(right);
|
|
@@ -50,7 +40,6 @@ function usePermission() {
|
|
|
50
40
|
* 检查是否有权限
|
|
51
41
|
* @param val 权限值
|
|
52
42
|
*/
|
|
53
|
-
|
|
54
43
|
var checkRight = (0, _react.useCallback)(function (val) {
|
|
55
44
|
if (!val) return true;
|
|
56
45
|
if (location.href.includes("//localhost")) return true;
|
|
@@ -71,7 +60,6 @@ function usePermission() {
|
|
|
71
60
|
canPrint: checkRight(512)
|
|
72
61
|
};
|
|
73
62
|
}
|
|
74
|
-
|
|
75
63
|
;
|
|
76
64
|
var _default = usePermission;
|
|
77
65
|
exports.default = _default;
|
|
@@ -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;
|