ls-pro-common 1.1.1 → 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 (42) hide show
  1. package/dist/common.css +65 -1
  2. package/dist/common.js +1 -1
  3. package/dist/common.js.LICENSE.txt +5 -3
  4. package/dist/common.min.css +65 -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.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/common.less +63 -0
  17. package/es/hooks/useDtl/index.js +676 -947
  18. package/es/hooks/usePermission/index.js +0 -9
  19. package/es/hooks/useSingle/index.js +417 -595
  20. package/es/http/index.js +107 -151
  21. package/es/index.js +0 -1
  22. package/es/service/BaseService.js +121 -195
  23. package/es/utils/index.js +12 -111
  24. package/lib/components/404.js +1 -6
  25. package/lib/components/AreaCascader.js +37 -63
  26. package/lib/components/AreaCascaderPanel.js +57 -105
  27. package/lib/components/DescritionCard.js +16 -33
  28. package/lib/components/DtlLayout.js +27 -49
  29. package/lib/components/IconSelector.js +29 -64
  30. package/lib/components/ImageSelector.js +91 -162
  31. package/lib/components/InputMultiLine.js +35 -61
  32. package/lib/components/InputTable.js +120 -185
  33. package/lib/components/Loading.js +4 -16
  34. package/lib/components/common.less +63 -0
  35. package/lib/hooks/useDtl/index.js +677 -963
  36. package/lib/hooks/usePermission/index.js +0 -12
  37. package/lib/hooks/useSingle/index.js +418 -610
  38. package/lib/http/index.js +105 -160
  39. package/lib/index.js +2 -21
  40. package/lib/service/BaseService.js +121 -201
  41. package/lib/utils/index.js +13 -209
  42. 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;