antd-management-fast-framework 1.9.17 → 1.9.39

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 (55) hide show
  1. package/es/configGroup/configGeneral.d.ts +47 -0
  2. package/es/configGroup/configGeneral.js +61 -0
  3. package/es/configGroup/themeCollection.d.ts +29 -0
  4. package/es/configGroup/themeCollection.js +117 -0
  5. package/es/configGroup/webpackPlugin.d.ts +11 -0
  6. package/es/configGroup/webpackPlugin.js +166 -0
  7. package/es/customComponents/PageLoading/index.d.ts +2 -0
  8. package/es/customComponents/PageLoading/index.js +13 -0
  9. package/es/framework/Base/index.d.ts +25 -2
  10. package/es/framework/Base/index.js +178 -11
  11. package/es/framework/ButtonExtension/SelectButton/Base/index.d.ts +1 -1
  12. package/es/framework/ButtonExtension/SelectButton/Base/index.js +2 -2
  13. package/es/framework/Common/index.d.ts +18 -6
  14. package/es/framework/Common/index.js +263 -153
  15. package/es/framework/DataDrawer/Base/index.d.ts +1 -1
  16. package/es/framework/DataDrawer/Base/index.js +2 -2
  17. package/es/framework/DataDrawer/BaseLoadDrawer/index.js +2 -6
  18. package/es/framework/DataForm/BaseAddForm/index.js +42 -27
  19. package/es/framework/DataForm/BaseUpdateForm/index.js +42 -31
  20. package/es/framework/DataForm/BaseUpdateFormContent/index.js +2 -2
  21. package/es/framework/DataListView/Base/index.d.ts +2 -1
  22. package/es/framework/DataListView/Base/index.js +9 -15
  23. package/es/framework/DataMenuContainer/index.d.ts +1 -1
  24. package/es/framework/DataMenuContainer/index.js +2 -2
  25. package/es/framework/DataModal/Base/index.d.ts +1 -1
  26. package/es/framework/DataModal/Base/index.js +13 -17
  27. package/es/framework/DataModal/BaseLoadModal/index.js +3 -11
  28. package/es/framework/DataModal/BaseUpdateTransferModal/index.js +1 -1
  29. package/es/framework/DataMultiPageView/MultiPage/index.js +3 -4
  30. package/es/framework/DataMultiPageView/MultiPageDrawer/index.js +6 -10
  31. package/es/framework/DataOperation/BaseWindow/index.js +41 -30
  32. package/es/framework/DataSinglePageView/SinglePage/index.js +1 -3
  33. package/es/framework/DataSinglePageView/SinglePageDrawer/index.js +2 -2
  34. package/es/framework/DataSingleView/DataCore/index.d.ts +1 -1
  35. package/es/framework/DataSingleView/DataCore/index.js +2 -2
  36. package/es/framework/DataTabContainer/index.js +2 -2
  37. package/es/framework/FieldExtension/SelectFieldDrawer/SelectFieldBase/index.d.ts +2 -1
  38. package/es/framework/FieldExtension/SelectFieldDrawer/SelectFieldBase/index.js +3 -2
  39. package/es/utils/actionAssist.js +67 -54
  40. package/es/utils/authority.d.ts +4 -0
  41. package/es/utils/authority.js +42 -3
  42. package/es/utils/cacheAssist.d.ts +85 -0
  43. package/es/utils/cacheAssist.js +313 -0
  44. package/es/utils/constants.d.ts +1 -0
  45. package/es/utils/constants.js +2 -1
  46. package/es/utils/defaultSettingsSpecial.d.ts +1 -0
  47. package/es/utils/defaultSettingsSpecial.js +10 -0
  48. package/es/utils/globalStorageAssist.d.ts +2 -2
  49. package/es/utils/globalStorageAssist.js +2 -2
  50. package/es/utils/proLayoutCollection.js +14 -10
  51. package/es/utils/requestAssistor.d.ts +14 -14
  52. package/es/utils/requestAssistor.js +29 -6
  53. package/es/utils/tools.d.ts +1 -0
  54. package/es/utils/tools.js +6 -2
  55. package/package.json +13 -11
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
@@ -15,6 +13,8 @@ var _nprogress = _interopRequireDefault(require("nprogress"));
15
13
 
16
14
  var _tools = require("../../utils/tools");
17
15
 
16
+ var _defaultSettingsSpecial = require("../../utils/defaultSettingsSpecial");
17
+
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
19
 
20
20
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -37,11 +37,89 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
37
37
 
38
38
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
39
39
 
40
- var Base = /*#__PURE__*/function (_PureComponent) {
41
- _inherits(Base, _PureComponent);
40
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
41
+
42
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
43
+
44
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
45
+
46
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
47
+
48
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
49
+
50
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
51
+
52
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
53
+
54
+ 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; }
55
+
56
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
57
+
58
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
59
+
60
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
61
+
62
+ function filterModel(props) {
63
+ var result = _objectSpread({}, props);
64
+
65
+ delete result.loading;
66
+ Object.entries(result).forEach(function (o) {
67
+ var _o = _slicedToArray(o, 2),
68
+ k = _o[0],
69
+ v = _o[1];
70
+
71
+ if ((0, _tools.isObject)(v)) {
72
+ if (!!v.fromRemote) {
73
+ delete result[k];
74
+ }
75
+ }
76
+ });
77
+ return result;
78
+ }
79
+ /**
80
+ * Performs equality by iterating through keys on an object and returning false
81
+ * when any key has values which are not strictly equal between the arguments.
82
+ * Returns true when the values of all keys are strictly equal.
83
+ */
84
+
85
+
86
+ function shallowEqual(a, b) {
87
+ // 调用Object.is判断是否相等,相同返回true,不同返回false
88
+ if (Object.is(a, b)) {
89
+ return true;
90
+ } // object.is比较发现不等,但并不代表真的不等,object对象还需要比较
91
+ // 这里判断是否是object,如果不是,那直接返回false
92
+
93
+
94
+ if (_typeof(a) !== 'object' || a === null || _typeof(b) !== 'object' || b === null) {
95
+ return false;
96
+ }
97
+
98
+ var keysA = Object.keys(a);
99
+ var keysB = Object.keys(b); // 比较对象中的keys长度,不等返回false
100
+
101
+ if (keysA.length !== keysB.length) {
102
+ return false;
103
+ } // 比较对象中相同的key的val是否相等
104
+
105
+
106
+ for (var i = 0; i < keysA.length; i++) {
107
+ if (!hasOwnProperty.call(b, keysA[i]) || !Object.is(a[keysA[i]], b[keysA[i]])) {
108
+ return false;
109
+ }
110
+ }
111
+
112
+ return true;
113
+ }
114
+
115
+ var Base = /*#__PURE__*/function (_Component) {
116
+ _inherits(Base, _Component);
42
117
 
43
118
  var _super = _createSuper(Base);
44
119
 
120
+ /**
121
+ *显示render次数开关,用于开发时候调试页面渲染性能
122
+ */
45
123
  function Base(props) {
46
124
  var _this;
47
125
 
@@ -49,9 +127,15 @@ var Base = /*#__PURE__*/function (_PureComponent) {
49
127
 
50
128
  _this = _super.call(this, props);
51
129
  _this.mounted = false;
130
+ _this.showRenderCountInConsole = false;
131
+ _this.renderCount = 0;
52
132
 
53
133
  _this.doDidMountTask = function () {};
54
134
 
135
+ _this.doOtherCheckComponentUpdate = function (nextProps, nextState) {
136
+ return null;
137
+ };
138
+
55
139
  _this.doWhenGetSnapshotBeforeUpdate = function (preProps, preState) {
56
140
  return null;
57
141
  };
@@ -71,7 +155,9 @@ var Base = /*#__PURE__*/function (_PureComponent) {
71
155
  pathname: path
72
156
  };
73
157
 
74
- _nprogress["default"].inc();
158
+ if (_defaultSettingsSpecial.defaultSettingsLayoutCustom.getUseNprogress()) {
159
+ _nprogress["default"].inc();
160
+ }
75
161
 
76
162
  _umi.history.push(location);
77
163
  };
@@ -81,7 +167,9 @@ var Base = /*#__PURE__*/function (_PureComponent) {
81
167
  pathname: path
82
168
  };
83
169
 
84
- _nprogress["default"].inc();
170
+ if (_defaultSettingsSpecial.defaultSettingsLayoutCustom.getUseNprogress()) {
171
+ _nprogress["default"].inc();
172
+ }
85
173
 
86
174
  _umi.history.replace(location);
87
175
  };
@@ -104,9 +192,12 @@ var Base = /*#__PURE__*/function (_PureComponent) {
104
192
  _createClass(Base, [{
105
193
  key: "componentDidMount",
106
194
  value: function componentDidMount() {
107
- setTimeout(function () {
108
- _nprogress["default"].done();
109
- }, 400);
195
+ if (_defaultSettingsSpecial.defaultSettingsLayoutCustom.getUseNprogress()) {
196
+ setTimeout(function () {
197
+ _nprogress["default"].done();
198
+ }, 400);
199
+ }
200
+
110
201
  this.beforeDidMount();
111
202
  this.mounted = true;
112
203
  this.doDidMountTask();
@@ -123,6 +214,28 @@ var Base = /*#__PURE__*/function (_PureComponent) {
123
214
  value: function componentDidUpdate(preProps, preState, snapshot) {
124
215
  this.doWorkWhenDidUpdate(preProps, preState, snapshot);
125
216
  }
217
+ }, {
218
+ key: "shouldComponentUpdate",
219
+ value: function shouldComponentUpdate(nextProps, nextState) {
220
+ var _dispatchComplete$nex = _objectSpread(_objectSpread({}, {
221
+ dispatchComplete: true
222
+ }), nextState),
223
+ dispatchComplete = _dispatchComplete$nex.dispatchComplete;
224
+
225
+ if (!!!dispatchComplete) {
226
+ return false;
227
+ }
228
+
229
+ var checkComponentUpdate = this.doOtherCheckComponentUpdate(nextProps, nextState);
230
+
231
+ if ((checkComponentUpdate || null) != null) {
232
+ return !!checkComponentUpdate;
233
+ }
234
+
235
+ var nextPropsIgnoreModel = filterModel(nextProps);
236
+ var currentPropsIgnoreModel = filterModel(this.props);
237
+ return !shallowEqual(nextPropsIgnoreModel, currentPropsIgnoreModel) || !shallowEqual(nextState, this.state);
238
+ }
126
239
  }, {
127
240
  key: "componentWillUnmount",
128
241
  value: function componentWillUnmount() {
@@ -133,10 +246,64 @@ var Base = /*#__PURE__*/function (_PureComponent) {
133
246
 
134
247
  this.afterUnmount();
135
248
  }
249
+ }, {
250
+ key: "showRenderCount",
251
+ value: function showRenderCount() {
252
+ if (this.showRenderCountInConsole) {
253
+ this.renderCount += 1;
254
+ console.log("render frequency: ".concat(this.renderCount));
255
+ }
256
+ }
257
+ /**
258
+ * check loading progress,if loading or load fail,return false,else return true
259
+ * @returns bool
260
+ */
261
+
262
+ }, {
263
+ key: "checkLoadingProgress",
264
+ value: function checkLoadingProgress() {
265
+ var _this$state = this.state,
266
+ dataLoading = _this$state.dataLoading,
267
+ loadSuccess = _this$state.loadSuccess;
268
+ return dataLoading || !loadSuccess;
269
+ }
270
+ /**
271
+ * check operability,if loading or or processing or load fail,return false,else return true
272
+ * @returns bool
273
+ */
274
+
275
+ }, {
276
+ key: "checkOperability",
277
+ value: function checkOperability() {
278
+ var _this$state2 = this.state,
279
+ dataLoading = _this$state2.dataLoading,
280
+ processing = _this$state2.processing,
281
+ loadSuccess = _this$state2.loadSuccess;
282
+ return dataLoading || processing || !loadSuccess;
283
+ }
284
+ /**
285
+ * check in progress,if loading or or processing,return false,else return true
286
+ * @returns bool
287
+ */
288
+
289
+ }, {
290
+ key: "checkInProgress",
291
+ value: function checkInProgress() {
292
+ var _this$state3 = this.state,
293
+ dataLoading = _this$state3.dataLoading,
294
+ processing = _this$state3.processing;
295
+ return dataLoading || processing;
296
+ }
297
+ }, {
298
+ key: "renderFurther",
299
+ value: function renderFurther() {
300
+ return null;
301
+ }
136
302
  }, {
137
303
  key: "render",
138
304
  value: function render() {
139
- return null;
305
+ this.showRenderCount();
306
+ return this.renderFurther();
140
307
  }
141
308
  }], [{
142
309
  key: "getDerivedStateFromProps",
@@ -146,7 +313,7 @@ var Base = /*#__PURE__*/function (_PureComponent) {
146
313
  }]);
147
314
 
148
315
  return Base;
149
- }(_react.PureComponent);
316
+ }(_react.Component);
150
317
 
151
318
  var _default = Base;
152
319
  exports["default"] = _default;
@@ -10,6 +10,6 @@ declare class Base extends SupplementWrapper {
10
10
  placeholder: string;
11
11
  };
12
12
  renderButton: () => JSX.Element;
13
- render(): JSX.Element;
13
+ renderFurther(): JSX.Element;
14
14
  }
15
15
  import SupplementWrapper from "../../../CustomWrapper/SupplementWrapper";
@@ -98,8 +98,8 @@ var Base = /*#__PURE__*/function (_SupplementWrapper) {
98
98
  }
99
99
 
100
100
  _createClass(Base, [{
101
- key: "render",
102
- value: function render() {
101
+ key: "renderFurther",
102
+ value: function renderFurther() {
103
103
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, this.renderButton(), this.renderOther());
104
104
  }
105
105
  }], [{
@@ -35,13 +35,25 @@ declare class Common extends Core {
35
35
  initLoadRequestParams: (o: any) => any;
36
36
  supplementLoadRequestParams: (o: any) => any;
37
37
  checkLoadRequestParams: (o: any) => boolean;
38
- initLoad: (callback?: any) => void;
38
+ initLoad: ({ otherState, delay, callback }: {
39
+ otherState?: {} | undefined;
40
+ delay?: number | undefined;
41
+ callback?: any;
42
+ }) => void;
39
43
  adjustLoadApiPath: () => string;
40
- initLoadCore: (requestData: any, callback: any) => void;
41
- pageListData: (otherState: any, callback?: any) => void;
42
- reloadData: (otherState: any, callback?: any) => void;
43
- searchData: (otherState: any, callback?: any) => void;
44
- refreshData: (callback?: any) => void;
44
+ initLoadCore: ({ requestData, delay, callback }: {
45
+ requestData: any;
46
+ delay?: number | undefined;
47
+ callback: any;
48
+ }) => void;
49
+ loadFromApi: ({ requestData, callback }: {
50
+ requestData: any;
51
+ callback: any;
52
+ }) => void;
53
+ pageListData: (otherState: any, callback?: any, delay?: number) => void;
54
+ reloadData: (otherState: any, callback?: any, delay?: number) => void;
55
+ searchData: (otherState: any, callback?: any, delay?: number) => void;
56
+ refreshData: (otherState: any, callback?: any, delay?: number) => void;
45
57
  reloadGlobalData: (callback?: any) => void;
46
58
  afterFirstLoadSuccess: () => void;
47
59
  afterLoadSuccess: ({ metaData, metaListData, metaExtra, metaOriginalData, }: {