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.
Files changed (52) hide show
  1. package/dist/common.css +138 -1
  2. package/dist/common.js +1 -1
  3. package/dist/common.js.LICENSE.txt +5 -3
  4. package/dist/common.min.css +138 -1
  5. package/dist/common.min.js +1 -1
  6. package/dist/common.min.js.LICENSE.txt +5 -3
  7. package/es/components/AreaCascader.js +35 -48
  8. package/es/components/AreaCascaderPanel.d.ts +5 -0
  9. package/es/components/AreaCascaderPanel.js +230 -0
  10. package/es/components/DescritionCard.js +14 -19
  11. package/es/components/DtlLayout.js +25 -38
  12. package/es/components/IconSelector.js +27 -50
  13. package/es/components/ImageSelector.js +89 -139
  14. package/es/components/InputMultiLine.js +33 -45
  15. package/es/components/InputTable.d.ts +2 -0
  16. package/es/components/InputTable.js +118 -160
  17. package/es/components/Loading.js +3 -6
  18. package/es/components/common.less +158 -1
  19. package/es/hooks/useDtl/index.d.ts +2 -0
  20. package/es/hooks/useDtl/index.js +676 -941
  21. package/es/hooks/usePermission/index.js +0 -9
  22. package/es/hooks/useSingle/index.d.ts +2 -0
  23. package/es/hooks/useSingle/index.js +440 -599
  24. package/es/http/index.js +113 -149
  25. package/es/index.d.ts +2 -1
  26. package/es/index.js +2 -2
  27. package/es/service/BaseService.js +121 -195
  28. package/es/utils/index.js +12 -111
  29. package/lib/components/404.js +1 -6
  30. package/lib/components/AreaCascader.js +37 -63
  31. package/lib/components/AreaCascaderPanel.d.ts +5 -0
  32. package/lib/components/AreaCascaderPanel.js +239 -0
  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.d.ts +2 -0
  39. package/lib/components/InputTable.js +120 -185
  40. package/lib/components/Loading.js +4 -16
  41. package/lib/components/common.less +158 -1
  42. package/lib/hooks/useDtl/index.d.ts +2 -0
  43. package/lib/hooks/useDtl/index.js +677 -957
  44. package/lib/hooks/usePermission/index.js +0 -12
  45. package/lib/hooks/useSingle/index.d.ts +2 -0
  46. package/lib/hooks/useSingle/index.js +441 -614
  47. package/lib/http/index.js +111 -158
  48. package/lib/index.d.ts +2 -1
  49. package/lib/index.js +9 -20
  50. package/lib/service/BaseService.js +121 -201
  51. package/lib/utils/index.js +13 -209
  52. 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;