ls-pro-common 1.1.1 → 1.1.3

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.
Files changed (54) hide show
  1. package/dist/common.css +66 -3
  2. package/dist/common.js +1 -1
  3. package/dist/common.js.LICENSE.txt +14 -3
  4. package/dist/common.min.css +66 -3
  5. package/dist/common.min.js +1 -1
  6. package/dist/common.min.js.LICENSE.txt +14 -3
  7. package/es/components/AreaCascader.js +35 -48
  8. package/es/components/AreaCascaderPanel.js +55 -85
  9. package/es/components/DescritionCard.js +14 -19
  10. package/es/components/DtlLayout.js +25 -38
  11. package/es/components/IconSelector.js +27 -50
  12. package/es/components/ImageSelector.js +89 -139
  13. package/es/components/InputMultiLine.js +33 -45
  14. package/es/components/InputTable.js +118 -160
  15. package/es/components/Loading.js +3 -6
  16. package/es/components/Permission.d.ts +6 -0
  17. package/es/components/Permission.js +10 -0
  18. package/es/components/common.less +63 -0
  19. package/es/hooks/useDtl/index.d.ts +2 -2
  20. package/es/hooks/useDtl/index.js +685 -950
  21. package/es/hooks/usePermission/index.js +0 -9
  22. package/es/hooks/useSingle/index.d.ts +3 -3
  23. package/es/hooks/useSingle/index.js +431 -603
  24. package/es/http/index.js +116 -154
  25. package/es/index.d.ts +4 -2
  26. package/es/index.js +2 -2
  27. package/es/service/BaseService.js +121 -195
  28. package/es/utils/index.d.ts +9 -22
  29. package/es/utils/index.js +63 -181
  30. package/lib/components/404.js +1 -6
  31. package/lib/components/AreaCascader.js +37 -63
  32. package/lib/components/AreaCascaderPanel.js +57 -105
  33. package/lib/components/DescritionCard.js +16 -33
  34. package/lib/components/DtlLayout.js +27 -49
  35. package/lib/components/IconSelector.js +29 -64
  36. package/lib/components/ImageSelector.js +91 -162
  37. package/lib/components/InputMultiLine.js +35 -61
  38. package/lib/components/InputTable.js +120 -185
  39. package/lib/components/Loading.js +4 -16
  40. package/lib/components/Permission.d.ts +6 -0
  41. package/lib/components/Permission.js +18 -0
  42. package/lib/components/common.less +63 -0
  43. package/lib/hooks/useDtl/index.d.ts +2 -2
  44. package/lib/hooks/useDtl/index.js +686 -966
  45. package/lib/hooks/usePermission/index.js +0 -12
  46. package/lib/hooks/useSingle/index.d.ts +3 -3
  47. package/lib/hooks/useSingle/index.js +432 -618
  48. package/lib/http/index.js +114 -163
  49. package/lib/index.d.ts +4 -2
  50. package/lib/index.js +9 -21
  51. package/lib/service/BaseService.js +121 -201
  52. package/lib/utils/index.d.ts +9 -22
  53. package/lib/utils/index.js +85 -290
  54. 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;
@@ -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>) => Promise<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
- ifHistoryData: 0 | 1;
53
- setIfHistoryData: import("react").Dispatch<import("react").SetStateAction<0 | 1>>;
52
+ ifHistory: 0 | 1;
53
+ setIfHistory: import("react").Dispatch<import("react").SetStateAction<0 | 1>>;
54
54
  };
55
55
  export default useSingle;