antd-management-fast-framework 1.11.4 → 1.11.9

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.
@@ -3,6 +3,7 @@ declare class AuthorizationWrapper extends SupplementWrapper {
3
3
  componentAuthority: any;
4
4
  doDidMountTask: () => void;
5
5
  checkAuthority: (auth: any) => boolean;
6
+ checkAuthorities: (auth: any) => boolean;
6
7
  getCurrentOperator: () => any;
7
8
  reloadCurrentOperator: (callback?: any) => void;
8
9
  }
@@ -83,6 +83,10 @@ var AuthorizationWrapper = /*#__PURE__*/function (_SupplementWrapper) {
83
83
  return (0, _authority.checkHasAuthority)(auth);
84
84
  };
85
85
 
86
+ _this.checkAuthorities = function (auth) {
87
+ return (0, _authority.checkHasAuthorities)(auth);
88
+ };
89
+
86
90
  _this.getCurrentOperator = function () {
87
91
  var currentOperator = _this.props.global.currentOperator;
88
92
  return currentOperator;
@@ -1661,7 +1661,10 @@ var Common = /*#__PURE__*/function (_Core) {
1661
1661
  }), contentItem.imageBoxProps || {});
1662
1662
 
1663
1663
  var imageBoxContainorStyle = _objectSpread(_objectSpread({}, {
1664
- width: '120px'
1664
+ width: '100px',
1665
+ border: '1px solid #d9d9d9',
1666
+ borderRadius: '4px',
1667
+ padding: '8px'
1665
1668
  }), contentItem.imageBoxContainorStyle || {});
1666
1669
 
1667
1670
  var imageBox = /*#__PURE__*/_react.default.createElement(_ImageBox.default, _extends({
@@ -1695,7 +1698,10 @@ var Common = /*#__PURE__*/function (_Core) {
1695
1698
  }
1696
1699
 
1697
1700
  var _imageBoxContainorStyle = _objectSpread(_objectSpread({}, {
1698
- width: '120px'
1701
+ width: '100px',
1702
+ border: '1px solid #d9d9d9',
1703
+ borderRadius: '4px',
1704
+ padding: '8px'
1699
1705
  }), contentItem.imageBoxContainorStyle || {});
1700
1706
 
1701
1707
  var imageItemShowList = [];
@@ -1,5 +1,6 @@
1
1
  export function getAllAuthority(): any;
2
2
  export function checkIsSuper(): boolean;
3
+ export function checkHasAuthorities(authCollection: any): boolean;
3
4
  export function checkHasAuthority(auth: any): boolean;
4
5
  /**
5
6
  * 缓存用户权限数据体
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.checkHasAuthorities = checkHasAuthorities;
6
7
  exports.checkHasAuthority = checkHasAuthority;
7
8
  exports.checkIsSuper = checkIsSuper;
8
9
  exports.getAllAuthority = getAllAuthority;
@@ -16,7 +17,24 @@ var _globalStorageAssist = require("./globalStorageAssist");
16
17
 
17
18
  var _Authorized = require("./Authorized");
18
19
 
20
+ var authorityCollectionCache = 'authorityCollectionCache';
21
+
19
22
  function getAllAuthorityCore() {
23
+ var result = [];
24
+ var existCache = (0, _cacheAssist.hasCache)({
25
+ key: authorityCollectionCache
26
+ });
27
+
28
+ if (existCache) {
29
+ result = (0, _cacheAssist.getCache)({
30
+ key: authorityCollectionCache
31
+ });
32
+
33
+ if ((0, _tools.isArray)(result)) {
34
+ return result;
35
+ }
36
+ }
37
+
20
38
  var authorityString = (0, _tools.getStringFromLocalStorage)(_globalStorageAssist.storageKeyCollection.authorityCollection);
21
39
  var authority;
22
40
 
@@ -27,10 +45,16 @@ function getAllAuthorityCore() {
27
45
  }
28
46
 
29
47
  if (typeof authority === 'string') {
30
- return [authority];
48
+ result.push(authority);
49
+ } else {
50
+ result = (0, _tools.isArray)(authority) ? authority : [];
31
51
  }
32
52
 
33
- return (0, _tools.isArray)(authority) ? authority : [];
53
+ (0, _cacheAssist.setCache)({
54
+ key: authorityCollectionCache,
55
+ value: result
56
+ });
57
+ return result;
34
58
  }
35
59
 
36
60
  function getAllAuthority() {
@@ -53,6 +77,44 @@ function checkIsSuper() {
53
77
  return false;
54
78
  }
55
79
 
80
+ function checkHasAuthorities(authCollection) {
81
+ var result = false;
82
+
83
+ if ((0, _tools.isArray)(authCollection)) {
84
+ authCollection.forEach(function (auth) {
85
+ result = checkHasAuthority(auth);
86
+
87
+ if (result) {
88
+ return true;
89
+ }
90
+ });
91
+
92
+ for (var _auth in authCollection) {
93
+ result = checkHasAuthority(_auth);
94
+
95
+ if (result) {
96
+ break;
97
+ }
98
+ }
99
+
100
+ return result;
101
+ }
102
+
103
+ if ((0, _tools.isString)(authCollection)) {
104
+ result = checkHasAuthority(authCollection);
105
+ return result;
106
+ }
107
+
108
+ var text = '无效的待验证权限';
109
+ (0, _tools.showErrorMessage)({
110
+ message: text
111
+ });
112
+ (0, _tools.recordError)({
113
+ auth: auth
114
+ });
115
+ return result;
116
+ }
117
+
56
118
  function checkHasAuthority(auth) {
57
119
  var _accessWayCollection$;
58
120
 
@@ -81,6 +81,7 @@ export const convertCollection: {
81
81
  string: string;
82
82
  moment: string;
83
83
  money: string;
84
+ array: string;
84
85
  };
85
86
  export namespace formatCollection {
86
87
  export const money: string;
@@ -110,7 +110,8 @@ var convertCollection = {
110
110
  datetime: 'datetime',
111
111
  string: 'string',
112
112
  moment: 'moment',
113
- money: 'money'
113
+ money: 'money',
114
+ array: 'array'
114
115
  };
115
116
  exports.convertCollection = convertCollection;
116
117
  var formatCollection = {
@@ -1,7 +1,7 @@
1
1
  export function getNearestLocalhostNotifyCache(): any;
2
2
  export function setNearestLocalhostNotifyCache(): void;
3
3
  export function removeNearestLocalhostNotifyCache(): void;
4
- export function getAccessWayCollectionCache(): any;
4
+ export function getAccessWayCollectionCache(): {};
5
5
  export function setAccessWayCollectionCache(o: any): void;
6
6
  /**
7
7
  * 获取useParamsData缓存
@@ -21,6 +21,8 @@ exports.storageKeyCollection = void 0;
21
21
 
22
22
  var _tools = require("./tools");
23
23
 
24
+ var _cacheAssist = require("./cacheAssist");
25
+
24
26
  var _constants = require("./constants");
25
27
 
26
28
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
@@ -67,14 +69,34 @@ function removeNearestLocalhostNotifyCache() {
67
69
  }
68
70
 
69
71
  function getAccessWayCollectionCache() {
72
+ var result = {};
70
73
  var key = storageKeyCollection.accessWayCollection;
74
+ var existCache = (0, _cacheAssist.hasCache)({
75
+ key: key
76
+ });
77
+
78
+ if (existCache) {
79
+ result = (0, _cacheAssist.getCache)({
80
+ key: key
81
+ });
82
+
83
+ if ((0, _tools.isArray)(result)) {
84
+ return result;
85
+ }
86
+ }
87
+
71
88
  var d = (0, _tools.getJsonFromLocalStorage)(key);
72
89
 
73
90
  if ((d || null) == null) {
74
91
  return _objectSpread({}, _constants.accessWaySpecialCollection || {});
75
92
  }
76
93
 
77
- return _objectSpread(_objectSpread({}, d || null), _constants.accessWaySpecialCollection || {});
94
+ result = _objectSpread(_objectSpread({}, d || null), _constants.accessWaySpecialCollection || {});
95
+ (0, _cacheAssist.setCache)({
96
+ key: key,
97
+ value: result
98
+ });
99
+ return result;
78
100
  }
79
101
 
80
102
  function setAccessWayCollectionCache(o) {
package/es/utils/tools.js CHANGED
@@ -1049,6 +1049,10 @@ function getValueByKey(_ref14) {
1049
1049
  result = toMoney(v);
1050
1050
  break;
1051
1051
 
1052
+ case _constants.convertCollection.array:
1053
+ result = (v || null) == null ? [] : isArray(v) ? v : [v];
1054
+ break;
1055
+
1052
1056
  default:
1053
1057
  result = v;
1054
1058
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antd-management-fast-framework",
3
- "version": "1.11.4",
3
+ "version": "1.11.9",
4
4
  "description": "antd-management-fast-framework",
5
5
  "keywords": [
6
6
  "antd-management-fast-framework"
@@ -40,7 +40,7 @@
40
40
  "classnames": "^2.3.1",
41
41
  "copy-to-clipboard": "^3.3.1",
42
42
  "enquire-js": "^0.2.1",
43
- "html-react-parser": "^1.4.0",
43
+ "html-react-parser": "^1.4.1",
44
44
  "lodash": "^4.17.21",
45
45
  "lodash-decorators": "^6.0.1",
46
46
  "lodash.debounce": "^4.0.8",
@@ -124,10 +124,10 @@
124
124
  "lint-staged": "^12.1.2",
125
125
  "npm-run-all": "^4.1.5",
126
126
  "pify": "^5.0.0",
127
- "postcss": "^8.4.3",
127
+ "postcss": "^8.4.4",
128
128
  "postcss-less": "^5.0.0",
129
129
  "prettier": "^2.5.0",
130
- "puppeteer": "^11.0.0",
130
+ "puppeteer": "^12.0.0",
131
131
  "query-string": "^7.0.1",
132
132
  "react": "^17.0.2",
133
133
  "react-dom": "^17.0.2",
@@ -167,5 +167,5 @@
167
167
  "bugs": {
168
168
  "url": "https://github.com/kityandhero/antd-management-fast-framework/issues"
169
169
  },
170
- "gitHead": "23ac2b1ce1267df2c5c613529b0d354784b7d88e"
170
+ "gitHead": "48e23cd378dbe7cda1566614180397fdc06e066d"
171
171
  }
package/License.txt DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 luzhitao
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.