antd-management-fast-framework 1.12.11 → 1.12.12

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
4
4
 
5
+ ### [1.12.12](https://github.com/kityandhero/antd-management-fast-framework/compare/antd-management-fast-framework@1.12.11...antd-management-fast-framework@1.12.12) (2021-12-29)
6
+
7
+ **Note:** Version bump only for package antd-management-fast-framework
8
+
5
9
  ### [1.12.11](https://github.com/kityandhero/antd-management-fast-framework/compare/antd-management-fast-framework@1.12.10...antd-management-fast-framework@1.12.11) (2021-12-29)
6
10
 
7
11
  ### Performance Improvements
@@ -45,14 +45,14 @@ var _input = _interopRequireDefault(require("antd/es/input"));
45
45
 
46
46
  var _react = _interopRequireWildcard(require("react"));
47
47
 
48
- var _reactPlayer = _interopRequireDefault(require("react-player"));
49
-
50
48
  var _icons = require("@ant-design/icons");
51
49
 
52
50
  var _tools = require("../../utils/tools");
53
51
 
54
52
  var _defaultSettingsSpecial = require("../../utils/defaultSettingsSpecial");
55
53
 
54
+ var _FunctionComponent = require("../../customComponents/FunctionComponent");
55
+
56
56
  var _IconInfo = _interopRequireDefault(require("../IconInfo"));
57
57
 
58
58
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -425,11 +425,8 @@ var AudioUpload = /*#__PURE__*/function (_PureComponent) {
425
425
  height: '50px',
426
426
  width: '100%'
427
427
  }
428
- }, /*#__PURE__*/_react.default.createElement(_reactPlayer.default, {
429
- width: "100%",
430
- height: "100%",
431
- url: audioUrl,
432
- controls: true
428
+ }, (0, _FunctionComponent.buildPlayer)({
429
+ url: audioUrl
433
430
  }))), /*#__PURE__*/_react.default.createElement(_modal.default, {
434
431
  title: /*#__PURE__*/_react.default.createElement(_IconInfo.default, {
435
432
  icon: /*#__PURE__*/_react.default.createElement(_icons.SwapOutlined, null),
@@ -379,6 +379,12 @@ export function buildColumnItem({ column: columnConfig, attachedTargetName, }: {
379
379
  column: any;
380
380
  attachedTargetName?: string | undefined;
381
381
  }): any;
382
+ export function buildPlayer({ url, width, height, controls, }: {
383
+ url: any;
384
+ width?: string | undefined;
385
+ height?: string | undefined;
386
+ controls?: boolean | undefined;
387
+ }): JSX.Element;
382
388
  /**
383
389
  * 构建彩色文本
384
390
  */
@@ -49,6 +49,7 @@ exports.buildOptionItem = buildOptionItem;
49
49
  exports.buildPageHeaderContent = buildPageHeaderContent;
50
50
  exports.buildPageHeaderTagWrapper = buildPageHeaderTagWrapper;
51
51
  exports.buildPageHeaderTitle = buildPageHeaderTitle;
52
+ exports.buildPlayer = buildPlayer;
52
53
  exports.buildRadioGroup = buildRadioGroup;
53
54
  exports.buildRadioItem = buildRadioItem;
54
55
  exports.buildSearchFormSelect = buildSearchFormSelect;
@@ -154,6 +155,8 @@ var _rcTexty = _interopRequireDefault(require("rc-texty"));
154
155
 
155
156
  var _icons = require("@ant-design/icons");
156
157
 
158
+ var _reactPlayer = _interopRequireDefault(require("react-player"));
159
+
157
160
  var _reactJsonView = _interopRequireDefault(require("react-json-view"));
158
161
 
159
162
  var _reactSyntaxHighlighter = _interopRequireDefault(require("react-syntax-highlighter"));
@@ -3005,34 +3008,50 @@ function buildColumnItem(_ref50) {
3005
3008
 
3006
3009
  return d;
3007
3010
  }
3011
+
3012
+ function buildPlayer(_ref51) {
3013
+ var url = _ref51.url,
3014
+ _ref51$width = _ref51.width,
3015
+ width = _ref51$width === void 0 ? '100%' : _ref51$width,
3016
+ _ref51$height = _ref51.height,
3017
+ height = _ref51$height === void 0 ? 'auto' : _ref51$height,
3018
+ _ref51$controls = _ref51.controls,
3019
+ controls = _ref51$controls === void 0 ? true : _ref51$controls;
3020
+ return /*#__PURE__*/_react.default.createElement(_reactPlayer.default, {
3021
+ width: width,
3022
+ height: height,
3023
+ url: url,
3024
+ controls: controls
3025
+ });
3026
+ }
3008
3027
  /**
3009
3028
  * 构建彩色文本
3010
3029
  */
3011
3030
 
3012
3031
 
3013
- function buildColorText(_ref51) {
3014
- var _ref51$canCopy = _ref51.canCopy,
3015
- canCopy = _ref51$canCopy === void 0 ? false : _ref51$canCopy,
3016
- _ref51$randomSeed = _ref51.randomSeed,
3017
- randomSeed = _ref51$randomSeed === void 0 ? 0 : _ref51$randomSeed,
3018
- _ref51$seedOffset = _ref51.seedOffset,
3019
- seedOffset = _ref51$seedOffset === void 0 ? 0 : _ref51$seedOffset,
3020
- _ref51$randomColor = _ref51.randomColor,
3021
- randomColor = _ref51$randomColor === void 0 ? false : _ref51$randomColor,
3022
- _ref51$color = _ref51.color,
3023
- color = _ref51$color === void 0 ? '' : _ref51$color,
3024
- _ref51$textPrefix = _ref51.textPrefix,
3025
- textPrefix = _ref51$textPrefix === void 0 ? null : _ref51$textPrefix,
3026
- _ref51$textPrefixStyl = _ref51.textPrefixStyle,
3027
- textPrefixStyle = _ref51$textPrefixStyl === void 0 ? null : _ref51$textPrefixStyl,
3028
- _ref51$text = _ref51.text,
3029
- text = _ref51$text === void 0 ? '' : _ref51$text,
3030
- _ref51$separator = _ref51.separator,
3031
- separator = _ref51$separator === void 0 ? ':' : _ref51$separator,
3032
- _ref51$separatorStyle = _ref51.separatorStyle,
3033
- separatorStyle = _ref51$separatorStyle === void 0 ? null : _ref51$separatorStyle,
3034
- _ref51$wrapperBuilder = _ref51.wrapperBuilder,
3035
- wrapperBuilder = _ref51$wrapperBuilder === void 0 ? null : _ref51$wrapperBuilder;
3032
+ function buildColorText(_ref52) {
3033
+ var _ref52$canCopy = _ref52.canCopy,
3034
+ canCopy = _ref52$canCopy === void 0 ? false : _ref52$canCopy,
3035
+ _ref52$randomSeed = _ref52.randomSeed,
3036
+ randomSeed = _ref52$randomSeed === void 0 ? 0 : _ref52$randomSeed,
3037
+ _ref52$seedOffset = _ref52.seedOffset,
3038
+ seedOffset = _ref52$seedOffset === void 0 ? 0 : _ref52$seedOffset,
3039
+ _ref52$randomColor = _ref52.randomColor,
3040
+ randomColor = _ref52$randomColor === void 0 ? false : _ref52$randomColor,
3041
+ _ref52$color = _ref52.color,
3042
+ color = _ref52$color === void 0 ? '' : _ref52$color,
3043
+ _ref52$textPrefix = _ref52.textPrefix,
3044
+ textPrefix = _ref52$textPrefix === void 0 ? null : _ref52$textPrefix,
3045
+ _ref52$textPrefixStyl = _ref52.textPrefixStyle,
3046
+ textPrefixStyle = _ref52$textPrefixStyl === void 0 ? null : _ref52$textPrefixStyl,
3047
+ _ref52$text = _ref52.text,
3048
+ text = _ref52$text === void 0 ? '' : _ref52$text,
3049
+ _ref52$separator = _ref52.separator,
3050
+ separator = _ref52$separator === void 0 ? ':' : _ref52$separator,
3051
+ _ref52$separatorStyle = _ref52.separatorStyle,
3052
+ separatorStyle = _ref52$separatorStyle === void 0 ? null : _ref52$separatorStyle,
3053
+ _ref52$wrapperBuilder = _ref52.wrapperBuilder,
3054
+ wrapperBuilder = _ref52$wrapperBuilder === void 0 ? null : _ref52$wrapperBuilder;
3036
3055
 
3037
3056
  var colorText = /*#__PURE__*/_react.default.createElement(_ColorText.default, {
3038
3057
  canCopy: canCopy || false,
@@ -3054,9 +3073,9 @@ function buildColorText(_ref51) {
3054
3073
  return wrapperBuilder(colorText);
3055
3074
  }
3056
3075
 
3057
- function adjustTableExpandConfig(_ref52) {
3058
- var list = _ref52.list,
3059
- config = _ref52.config;
3076
+ function adjustTableExpandConfig(_ref53) {
3077
+ var list = _ref53.list,
3078
+ config = _ref53.config;
3060
3079
 
3061
3080
  if ((config || null) != null) {
3062
3081
  var _checkNeedExpander$ro = _objectSpread(_objectSpread({}, {
@@ -3073,10 +3092,10 @@ function adjustTableExpandConfig(_ref52) {
3073
3092
  animalType: _constants.listViewConfig.expandAnimalType.none,
3074
3093
  expandIconRotate: true,
3075
3094
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
3076
- expandIcon: function expandIcon(_ref53) {
3077
- var expanded = _ref53.expanded,
3078
- onExpand = _ref53.onExpand,
3079
- record = _ref53.record;
3095
+ expandIcon: function expandIcon(_ref54) {
3096
+ var expanded = _ref54.expanded,
3097
+ onExpand = _ref54.onExpand,
3098
+ record = _ref54.record;
3080
3099
  return /*#__PURE__*/_react.default.createElement(_icons.RightCircleOutlined, null);
3081
3100
  },
3082
3101
  expandedRowRender: null
@@ -3106,11 +3125,11 @@ function adjustTableExpandConfig(_ref52) {
3106
3125
 
3107
3126
  var expandableConfig = checkNeedExpanderResult ? {
3108
3127
  rowExpandable: rowExpandable,
3109
- expandIcon: function expandIcon(_ref54) {
3110
- var canExpand = _ref54.expandable,
3111
- expanded = _ref54.expanded,
3112
- onExpand = _ref54.onExpand,
3113
- record = _ref54.record;
3128
+ expandIcon: function expandIcon(_ref55) {
3129
+ var canExpand = _ref55.expandable,
3130
+ expanded = _ref55.expanded,
3131
+ onExpand = _ref55.onExpand,
3132
+ record = _ref55.record;
3114
3133
 
3115
3134
  if (!canExpand && (expandPlaceholderIcon || null) != null) {
3116
3135
  return expandPlaceholderIcon || null;
@@ -45,14 +45,14 @@ var _input = _interopRequireDefault(require("antd/es/input"));
45
45
 
46
46
  var _react = _interopRequireWildcard(require("react"));
47
47
 
48
- var _reactPlayer = _interopRequireDefault(require("react-player"));
49
-
50
48
  var _icons = require("@ant-design/icons");
51
49
 
52
50
  var _tools = require("../../utils/tools");
53
51
 
54
52
  var _defaultSettingsSpecial = require("../../utils/defaultSettingsSpecial");
55
53
 
54
+ var _FunctionComponent = require("../../customComponents/FunctionComponent");
55
+
56
56
  var _IconInfo = _interopRequireDefault(require("../IconInfo"));
57
57
 
58
58
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -419,11 +419,8 @@ var VideoUpload = /*#__PURE__*/function (_PureComponent) {
419
419
  visible: previewVisible,
420
420
  footer: null,
421
421
  onCancel: this.handleUploadCancel
422
- }, /*#__PURE__*/_react.default.createElement(_reactPlayer.default, {
423
- width: "100%",
424
- height: "100%",
425
- url: videoUrl,
426
- controls: true
422
+ }, (0, _FunctionComponent.buildPlayer)({
423
+ url: videoUrl
427
424
  })), /*#__PURE__*/_react.default.createElement(_modal.default, {
428
425
  title: /*#__PURE__*/_react.default.createElement(_IconInfo.default, {
429
426
  icon: /*#__PURE__*/_react.default.createElement(_icons.SwapOutlined, null),
@@ -61,7 +61,7 @@ export function handlePageListDataAssist(state: any, action: any, pretreatment?:
61
61
  * @param {*} virtualNeedAuthorize [object]:set virtual request whether check token, only check mull or empty, generally used to debug
62
62
  * @returns
63
63
  */
64
- export function request({ api, params, method, useVirtualRequest, showUseVirtualRequestMessage, virtualSuccessResponse, virtualFailResponse, virtualRequestResult, virtualNeedAuthorize, }: any): Promise<any>;
64
+ export function request({ api, urlParams, params, method, useVirtualRequest, showUseVirtualRequestMessage, virtualSuccessResponse, virtualFailResponse, virtualRequestResult, virtualNeedAuthorize, }: any): Promise<any>;
65
65
  /**
66
66
  * 获取配置的 api 版本号
67
67
  */
@@ -31,6 +31,8 @@ var _defaultSettingsSpecial = require("./defaultSettingsSpecial");
31
31
 
32
32
  var _virtualRequest = require("./virtualRequest");
33
33
 
34
+ var _lodash = require("lodash");
35
+
34
36
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
35
37
 
36
38
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
@@ -407,13 +409,13 @@ function request(_x) {
407
409
 
408
410
  function _request() {
409
411
  _request = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(_ref4) {
410
- var api, _ref4$params, params, _ref4$method, method, _ref4$useVirtualReque, useVirtualRequest, _ref4$showUseVirtualR, showUseVirtualRequestMessage, _ref4$virtualSuccessR, virtualSuccessResponse, _ref4$virtualFailResp, virtualFailResponse, _ref4$virtualRequestR, virtualRequestResult, _ref4$virtualNeedAuth, virtualNeedAuthorize, apiVersion, url, showRequestInfo, result, verifyToken, token, loginPath;
412
+ var api, _ref4$urlParams, urlParams, _ref4$params, params, _ref4$method, method, _ref4$useVirtualReque, useVirtualRequest, _ref4$showUseVirtualR, showUseVirtualRequestMessage, _ref4$virtualSuccessR, virtualSuccessResponse, _ref4$virtualFailResp, virtualFailResponse, _ref4$virtualRequestR, virtualRequestResult, _ref4$virtualNeedAuth, virtualNeedAuthorize, apiVersion, url, showRequestInfo, result, verifyToken, token, loginPath;
411
413
 
412
414
  return regeneratorRuntime.wrap(function _callee$(_context) {
413
415
  while (1) {
414
416
  switch (_context.prev = _context.next) {
415
417
  case 0:
416
- api = _ref4.api, _ref4$params = _ref4.params, params = _ref4$params === void 0 ? {} : _ref4$params, _ref4$method = _ref4.method, method = _ref4$method === void 0 ? 'POST' : _ref4$method, _ref4$useVirtualReque = _ref4.useVirtualRequest, useVirtualRequest = _ref4$useVirtualReque === void 0 ? _defaultSettingsSpecial.defaultSettingsLayoutCustom.getUseVirtualRequest() : _ref4$useVirtualReque, _ref4$showUseVirtualR = _ref4.showUseVirtualRequestMessage, showUseVirtualRequestMessage = _ref4$showUseVirtualR === void 0 ? _defaultSettingsSpecial.defaultSettingsLayoutCustom.getShowUseVirtualRequestMessage() : _ref4$showUseVirtualR, _ref4$virtualSuccessR = _ref4.virtualSuccessResponse, virtualSuccessResponse = _ref4$virtualSuccessR === void 0 ? {} : _ref4$virtualSuccessR, _ref4$virtualFailResp = _ref4.virtualFailResponse, virtualFailResponse = _ref4$virtualFailResp === void 0 ? {
418
+ api = _ref4.api, _ref4$urlParams = _ref4.urlParams, urlParams = _ref4$urlParams === void 0 ? null : _ref4$urlParams, _ref4$params = _ref4.params, params = _ref4$params === void 0 ? {} : _ref4$params, _ref4$method = _ref4.method, method = _ref4$method === void 0 ? 'POST' : _ref4$method, _ref4$useVirtualReque = _ref4.useVirtualRequest, useVirtualRequest = _ref4$useVirtualReque === void 0 ? _defaultSettingsSpecial.defaultSettingsLayoutCustom.getUseVirtualRequest() : _ref4$useVirtualReque, _ref4$showUseVirtualR = _ref4.showUseVirtualRequestMessage, showUseVirtualRequestMessage = _ref4$showUseVirtualR === void 0 ? _defaultSettingsSpecial.defaultSettingsLayoutCustom.getShowUseVirtualRequestMessage() : _ref4$showUseVirtualR, _ref4$virtualSuccessR = _ref4.virtualSuccessResponse, virtualSuccessResponse = _ref4$virtualSuccessR === void 0 ? {} : _ref4$virtualSuccessR, _ref4$virtualFailResp = _ref4.virtualFailResponse, virtualFailResponse = _ref4$virtualFailResp === void 0 ? {
417
419
  code: 1001,
418
420
  message: '虚拟未知错误'
419
421
  } : _ref4$virtualFailResp, _ref4$virtualRequestR = _ref4.virtualRequestResult, virtualRequestResult = _ref4$virtualRequestR === void 0 ? true : _ref4$virtualRequestR, _ref4$virtualNeedAuth = _ref4.virtualNeedAuthorize, virtualNeedAuthorize = _ref4$virtualNeedAuth === void 0 ? true : _ref4$virtualNeedAuth;
@@ -442,10 +444,21 @@ function _request() {
442
444
  }
443
445
 
444
446
  url = "".concat(apiVersion).concat(api).replace('//', '/');
447
+
448
+ if ((urlParams || null) != null) {
449
+ if ((0, _tools.isString)(urlParams)) {
450
+ url = "url?".concat(urlParams);
451
+ }
452
+
453
+ if ((0, _lodash.isObject)(urlParams)) {
454
+ url = "url?".concat((0, _tools.queryStringify)(urlParams));
455
+ }
456
+ }
457
+
445
458
  showRequestInfo = _defaultSettingsSpecial.defaultSettingsLayoutCustom.getShowRequestInfo();
446
459
 
447
460
  if (!useVirtualRequest) {
448
- _context.next = 28;
461
+ _context.next = 29;
449
462
  break;
450
463
  }
451
464
 
@@ -470,20 +483,20 @@ function _request() {
470
483
  }
471
484
 
472
485
  if (!(virtualNeedAuthorize && !verifyToken)) {
473
- _context.next = 23;
486
+ _context.next = 24;
474
487
  break;
475
488
  }
476
489
 
477
490
  loginPath = _defaultSettingsSpecial.defaultSettingsLayoutCustom.getLoginPath();
478
491
 
479
492
  if (!(0, _tools.stringIsNullOrWhiteSpace)(loginPath)) {
480
- _context.next = 20;
493
+ _context.next = 21;
481
494
  break;
482
495
  }
483
496
 
484
497
  throw new Error('缺少登录页面路径配置');
485
498
 
486
- case 20:
499
+ case 21:
487
500
  setTimeout(function () {
488
501
  (0, _globalStorageAssist.clearCustomData)();
489
502
 
@@ -493,11 +506,11 @@ function _request() {
493
506
  pathname: loginPath
494
507
  });
495
508
  }, 400);
496
- _context.next = 26;
509
+ _context.next = 27;
497
510
  break;
498
511
 
499
- case 23:
500
- _context.next = 25;
512
+ case 24:
513
+ _context.next = 26;
501
514
  return (0, _virtualRequest.apiVirtualAccess)({
502
515
  dataBuild: function dataBuild(resolve) {
503
516
  if (virtualRequestResult) {
@@ -513,10 +526,10 @@ function _request() {
513
526
  }
514
527
  });
515
528
 
516
- case 25:
529
+ case 26:
517
530
  result = _context.sent;
518
531
 
519
- case 26:
532
+ case 27:
520
533
  if (showRequestInfo) {
521
534
  (0, _tools.recordObject)({
522
535
  url: url,
@@ -528,7 +541,7 @@ function _request() {
528
541
 
529
542
  return _context.abrupt("return", result);
530
543
 
531
- case 28:
544
+ case 29:
532
545
  if (showRequestInfo) {
533
546
  (0, _tools.recordObject)({
534
547
  api: api,
@@ -543,7 +556,7 @@ function _request() {
543
556
  data: params
544
557
  }));
545
558
 
546
- case 30:
559
+ case 31:
547
560
  case "end":
548
561
  return _context.stop();
549
562
  }
@@ -417,9 +417,10 @@ export function getValueByKey({ data, key, defaultValue, convert, convertBuilder
417
417
  * @returns
418
418
  */
419
419
  export function convertTarget({ target, convert }: any): any;
420
- export function formatTarget({ target, format }: {
420
+ export function formatTarget({ target, format, option }: {
421
421
  target: any;
422
422
  format: any;
423
+ option?: {} | undefined;
423
424
  }): any;
424
425
  /**
425
426
  * 通过 path 获取对应得值
@@ -458,10 +459,11 @@ export function removeLastMatch(source: any, target: any): any;
458
459
  * 转换金额为人民币大写
459
460
  *
460
461
  * @export
461
- * @param {*} v
462
+ * @param {*} target 转换的目标
463
+ * @param {*} option 转换配置, 参看Nzh包
462
464
  * @returns
463
465
  */
464
- export function formatMoneyToChinese(v: any): string;
466
+ export function formatMoneyToChinese({ target, option }: any): string;
465
467
  export function seededRandom({ seed, min, max }: {
466
468
  seed: any;
467
469
  min: any;
@@ -775,6 +777,8 @@ export function sortCollectionByKey({ operate, item, list, sortKey, sortMin, }:
775
777
  sortKey: any;
776
778
  sortMin?: number | undefined;
777
779
  }): any;
780
+ export function queryStringify(data: any): string;
781
+ export function queryStringParse(data: any): import("qs").ParsedQs;
778
782
  /**
779
783
  * 占位函数
780
784
  *
package/es/utils/tools.js CHANGED
@@ -75,6 +75,8 @@ exports.isUndefined = isUndefined;
75
75
  exports.notify = notify;
76
76
  exports.notifySuccess = notifySuccess;
77
77
  exports.numeralFormat = numeralFormat;
78
+ exports.queryStringParse = queryStringParse;
79
+ exports.queryStringify = queryStringify;
78
80
  exports.recordError = recordError;
79
81
  exports.recordLog = recordLog;
80
82
  exports.recordObject = recordObject;
@@ -145,6 +147,10 @@ var _numeral = _interopRequireDefault(require("numeral"));
145
147
 
146
148
  var _randomcolor = _interopRequireDefault(require("randomcolor"));
147
149
 
150
+ var _nzh = _interopRequireDefault(require("nzh"));
151
+
152
+ var _qs = require("qs");
153
+
148
154
  var _arrayMove = require("array-move");
149
155
 
150
156
  var _lodash = require("lodash");
@@ -157,22 +163,14 @@ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableTo
157
163
 
158
164
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
159
165
 
166
+ 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); }
167
+
160
168
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
161
169
 
162
170
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
163
171
 
164
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
165
-
166
- 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."); }
167
-
168
- 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); }
169
-
170
172
  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; }
171
173
 
172
- 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; }
173
-
174
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
175
-
176
174
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
177
175
 
178
176
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -1106,7 +1104,9 @@ function convertTarget(_ref15) {
1106
1104
 
1107
1105
  function formatTarget(_ref16) {
1108
1106
  var target = _ref16.target,
1109
- format = _ref16.format;
1107
+ format = _ref16.format,
1108
+ _ref16$option = _ref16.option,
1109
+ option = _ref16$option === void 0 ? {} : _ref16$option;
1110
1110
 
1111
1111
  if (isFunction(format)) {
1112
1112
  return format(target);
@@ -1123,7 +1123,10 @@ function formatTarget(_ref16) {
1123
1123
  });
1124
1124
 
1125
1125
  case _constants.formatCollection.chineseMoney:
1126
- return formatMoneyToChinese(target);
1126
+ return formatMoneyToChinese({
1127
+ target: target,
1128
+ option: option
1129
+ });
1127
1130
 
1128
1131
  case _constants.formatCollection.percentage:
1129
1132
  return "".concat(roundToTarget(target * 100, 1), "%");
@@ -1273,120 +1276,42 @@ function removeLastMatch(source, target) {
1273
1276
  * 转换金额为人民币大写
1274
1277
  *
1275
1278
  * @export
1276
- * @param {*} v
1279
+ * @param {*} target 转换的目标
1280
+ * @param {*} option 转换配置, 参看Nzh包
1277
1281
  * @returns
1278
1282
  */
1279
1283
 
1280
1284
 
1281
- function formatMoneyToChinese(v) {
1282
- var money = v;
1283
- var cnNumber = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']; // 汉字的数字
1284
-
1285
- var cnIntBasic = ['', '拾', '佰', '仟']; // 基本单位
1286
-
1287
- var cnIntUnits = ['', '万', '亿', '兆']; // 对应整数部分扩展单位
1288
-
1289
- var cnDecUnits = ['角', '分', '毫', '厘']; // 对应小数部分单位
1290
- // var cnInteger = "整"; // 整数金额时后面跟的字符
1291
-
1292
- var cnIntLast = '元'; // 整型完以后的单位
1293
-
1294
- var maxNum = 999999999999999.9999; // 最大处理的数字
1295
-
1296
- var IntegerNum; // 金额整数部分
1297
-
1298
- var DecimalNum; // 金额小数部分
1299
-
1300
- var ChineseString = ''; // 输出的中文金额字符串
1301
-
1302
- var parts; // 分离金额后用的数组,预定义
1303
-
1304
- if (money === '') {
1305
- return '';
1306
- }
1307
-
1308
- money = parseFloat(money);
1309
-
1310
- if (money >= maxNum) {
1311
- return '超出最大处理数字';
1312
- }
1313
-
1314
- if (money === 0) {
1315
- ChineseString = cnNumber[0] + cnIntLast;
1316
- return ChineseString;
1317
- }
1318
-
1319
- money = money.toString(); // 转换为字符串
1320
-
1321
- if (money.indexOf('.') === -1) {
1322
- IntegerNum = money;
1323
- DecimalNum = '';
1324
- } else {
1325
- parts = money.split('.');
1326
- var _parts = parts;
1327
-
1328
- var _parts2 = _slicedToArray(_parts, 2);
1329
-
1330
- IntegerNum = _parts2[0];
1331
- DecimalNum = _parts2[1];
1332
- DecimalNum = parts[1].substr(0, 4);
1333
- }
1334
-
1335
- if (parseInt(IntegerNum, 10) > 0) {
1336
- // 获取整型部分转换
1337
- var zeroCount = 0;
1338
- var IntLen = IntegerNum.length;
1285
+ function formatMoneyToChinese(_ref17) {
1286
+ var target = _ref17.target,
1287
+ _ref17$option = _ref17.option,
1288
+ option = _ref17$option === void 0 ? {} : _ref17$option;
1339
1289
 
1340
- for (var i = 0; i < IntLen; i += 1) {
1341
- var n = IntegerNum.substr(i, 1);
1342
- var p = IntLen - i - 1;
1343
- var q = p / 4;
1344
- var m = p % 4;
1345
-
1346
- if (n === '0') {
1347
- zeroCount += 1;
1348
- } else {
1349
- if (zeroCount > 0) {
1350
- ChineseString += cnNumber[0];
1351
- }
1290
+ var o = _objectSpread(_objectSpread({}, {
1291
+ mode: 'cn',
1292
+ complete: false,
1293
+ outSymbol: true
1294
+ }), option || {});
1352
1295
 
1353
- zeroCount = 0; // 归零
1354
-
1355
- ChineseString += cnNumber[parseInt(n, 10)] + cnIntBasic[m];
1356
- }
1357
-
1358
- if (m === 0 && zeroCount < 4) {
1359
- ChineseString += cnIntUnits[q];
1360
- }
1361
- }
1362
-
1363
- ChineseString += cnIntLast; // 整型部分处理完毕
1364
- }
1296
+ var mode = o.mode;
1297
+ var nzhLocal = _nzh.default.cn;
1365
1298
 
1366
- if (DecimalNum !== '') {
1367
- // 小数部分
1368
- var decLen = DecimalNum.length;
1369
-
1370
- for (var _i2 = 0; _i2 < decLen; _i2 += 1) {
1371
- var _n2 = DecimalNum.substr(_i2, 1);
1372
-
1373
- if (_n2 !== '0') {
1374
- ChineseString += cnNumber[Number(_n2)] + cnDecUnits[_i2];
1375
- }
1376
- }
1377
- }
1299
+ switch (mode) {
1300
+ case 'hk':
1301
+ nzhLocal = _nzh.default.hk;
1302
+ break;
1378
1303
 
1379
- if (ChineseString === '') {
1380
- ChineseString += cnNumber[0] + cnIntLast;
1304
+ default:
1305
+ break;
1381
1306
  }
1382
1307
 
1383
- return ChineseString;
1308
+ return nzhLocal.toMoney(target, o);
1384
1309
  }
1385
1310
 
1386
- function seededRandom(_ref17) {
1387
- var seed = _ref17.seed,
1388
- min = _ref17.min,
1389
- max = _ref17.max;
1311
+ function seededRandom(_ref18) {
1312
+ var seed = _ref18.seed,
1313
+ min = _ref18.min,
1314
+ max = _ref18.max;
1390
1315
  var maxValue = max || 1;
1391
1316
  var minValue = min || 0;
1392
1317
  var seedValue = (seed * 9301 + 49297) % 233280;
@@ -1402,18 +1327,18 @@ function seededRandom(_ref17) {
1402
1327
  */
1403
1328
 
1404
1329
 
1405
- function getRandomColor(_ref18) {
1406
- var seed = _ref18.seed,
1407
- _ref18$hue = _ref18.hue,
1408
- hue = _ref18$hue === void 0 ? null : _ref18$hue,
1409
- _ref18$luminosity = _ref18.luminosity,
1410
- luminosity = _ref18$luminosity === void 0 ? null : _ref18$luminosity,
1411
- _ref18$count = _ref18.count,
1412
- count = _ref18$count === void 0 ? null : _ref18$count,
1413
- _ref18$format = _ref18.format,
1414
- format = _ref18$format === void 0 ? null : _ref18$format,
1415
- _ref18$alpha = _ref18.alpha,
1416
- alpha = _ref18$alpha === void 0 ? null : _ref18$alpha;
1330
+ function getRandomColor(_ref19) {
1331
+ var seed = _ref19.seed,
1332
+ _ref19$hue = _ref19.hue,
1333
+ hue = _ref19$hue === void 0 ? null : _ref19$hue,
1334
+ _ref19$luminosity = _ref19.luminosity,
1335
+ luminosity = _ref19$luminosity === void 0 ? null : _ref19$luminosity,
1336
+ _ref19$count = _ref19.count,
1337
+ count = _ref19$count === void 0 ? null : _ref19$count,
1338
+ _ref19$format = _ref19.format,
1339
+ format = _ref19$format === void 0 ? null : _ref19$format,
1340
+ _ref19$alpha = _ref19.alpha,
1341
+ alpha = _ref19$alpha === void 0 ? null : _ref19$alpha;
1417
1342
  return (0, _randomcolor.default)({
1418
1343
  seed: seed,
1419
1344
  hue: hue,
@@ -2116,8 +2041,8 @@ function removeNearestLocalhostNotifyCache() {
2116
2041
  */
2117
2042
 
2118
2043
 
2119
- function trySendNearestLocalhostNotify(_ref19) {
2120
- var text = _ref19.text;
2044
+ function trySendNearestLocalhostNotify(_ref20) {
2045
+ var text = _ref20.text;
2121
2046
  var needSend = false;
2122
2047
  var nearestTime = 0;
2123
2048
 
@@ -2178,11 +2103,11 @@ function notifySuccess(text) {
2178
2103
  */
2179
2104
 
2180
2105
 
2181
- function notify(_ref20) {
2182
- var type = _ref20.type,
2183
- placementValue = _ref20.placement,
2184
- messageValue = _ref20.message,
2185
- descriptionValue = _ref20.description;
2106
+ function notify(_ref21) {
2107
+ var type = _ref21.type,
2108
+ placementValue = _ref21.placement,
2109
+ messageValue = _ref21.message,
2110
+ descriptionValue = _ref21.description;
2186
2111
 
2187
2112
  var _placement$message$de = _objectSpread(_objectSpread({}, {
2188
2113
  placement: 'bottomRight',
@@ -2256,10 +2181,10 @@ function notify(_ref20) {
2256
2181
  }, 600);
2257
2182
  }
2258
2183
 
2259
- function checkFromConfig(_ref21) {
2260
- var label = _ref21.label,
2261
- name = _ref21.name,
2262
- helper = _ref21.helper;
2184
+ function checkFromConfig(_ref22) {
2185
+ var label = _ref22.label,
2186
+ name = _ref22.name,
2187
+ helper = _ref22.helper;
2263
2188
  var labelText = 'object';
2264
2189
  var nameText = 'object';
2265
2190
  var helperText = 'object';
@@ -2318,13 +2243,13 @@ var requestAnimFrame = requestAnimFrameCustom;
2318
2243
 
2319
2244
  exports.requestAnimFrame = requestAnimFrame;
2320
2245
 
2321
- function sortCollectionByKey(_ref22) {
2322
- var operate = _ref22.operate,
2323
- item = _ref22.item,
2324
- list = _ref22.list,
2325
- sortKey = _ref22.sortKey,
2326
- _ref22$sortMin = _ref22.sortMin,
2327
- sortMin = _ref22$sortMin === void 0 ? 0 : _ref22$sortMin;
2246
+ function sortCollectionByKey(_ref23) {
2247
+ var operate = _ref23.operate,
2248
+ item = _ref23.item,
2249
+ list = _ref23.list,
2250
+ sortKey = _ref23.sortKey,
2251
+ _ref23$sortMin = _ref23.sortMin,
2252
+ sortMin = _ref23$sortMin === void 0 ? 0 : _ref23$sortMin;
2328
2253
 
2329
2254
  if ((item || null) == null) {
2330
2255
  return list;
@@ -2423,6 +2348,14 @@ function sortCollectionByKey(_ref22) {
2423
2348
 
2424
2349
  return result;
2425
2350
  }
2351
+
2352
+ function queryStringify(data) {
2353
+ return (0, _qs.stringify)(data);
2354
+ }
2355
+
2356
+ function queryStringParse(data) {
2357
+ return (0, _qs.parse)(data);
2358
+ }
2426
2359
  /**
2427
2360
  * 占位函数
2428
2361
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antd-management-fast-framework",
3
- "version": "1.12.11",
3
+ "version": "1.12.12",
4
4
  "description": "antd-management-fast-framework",
5
5
  "keywords": [
6
6
  "antd-management-fast-framework"
@@ -51,9 +51,11 @@
51
51
  "node-cache": "^5.1.2",
52
52
  "nprogress": "^0.2.0",
53
53
  "numeral": "^2.0.6",
54
+ "nzh": "^1.0.8",
54
55
  "omit.js": "^2.0.2",
55
56
  "path-to-regexp": "^6.2.0",
56
57
  "prop-types": "^15.8.0",
58
+ "qs": "^6.10.2",
57
59
  "queue": "^6.0.2",
58
60
  "randomcolor": "^0.6.2",
59
61
  "rc-animate": "^3.1.1",
@@ -68,14 +70,14 @@
68
70
  "react-copy-to-clipboard": "^5.0.4",
69
71
  "react-dnd": "^14.0.4",
70
72
  "react-dnd-html5-backend": "^14.0.2",
73
+ "react-document-title": "^2.0.3",
71
74
  "react-dom": "^17.0.2",
72
75
  "react-json-view": "^1.21.3",
73
76
  "react-player": "^2.9.0",
74
77
  "react-router": "^6.2.1",
75
78
  "react-router-dom": "^6.2.1",
76
79
  "react-syntax-highlighter": "^15.4.5",
77
- "stylelint-config-css-modules": "^2.3.0",
78
- "stylelint-declaration-block-no-ignored-properties": "^2.5.0",
80
+ "redux": "^4.1.2",
79
81
  "umi-request": "^1.4.0",
80
82
  "use-merge-value": "^1.0.2",
81
83
  "uuid": "^8.3.2"
@@ -93,6 +95,7 @@
93
95
  "@testing-library/react-hooks": "^7.0.2",
94
96
  "@types/jest": "^27.0.3",
95
97
  "@types/node": "^17.0.5",
98
+ "@types/react-document-title": "^2.0.5",
96
99
  "@typescript-eslint/eslint-plugin": "^5.8.1",
97
100
  "@umijs/fabric": "^2.8.1",
98
101
  "@umijs/test": "^3.5.20",
@@ -122,26 +125,22 @@
122
125
  "import-sort-parser-babylon": "^6.0.0",
123
126
  "import-sort-parser-typescript": "^6.0.0",
124
127
  "import-sort-style-module": "^6.0.0",
125
- "lerna": "^4.0.0",
126
128
  "lint-staged": "^12.1.4",
127
- "npm-run-all": "^4.1.5",
128
- "pify": "^5.0.0",
129
129
  "postcss": "^8.4.5",
130
130
  "postcss-less": "^5.0.0",
131
131
  "prettier": "^2.5.1",
132
132
  "puppeteer": "^13.0.1",
133
- "query-string": "^7.0.1",
134
133
  "react": "^17.0.2",
135
- "react-dom": "^17.0.2",
136
134
  "react-test-renderer": "^17.0.2",
137
135
  "rimraf": "^3.0.2",
138
136
  "stylelint": "^14.2.0",
137
+ "stylelint-config-css-modules": "^2.3.0",
139
138
  "stylelint-config-prettier": "^9.0.3",
140
139
  "stylelint-config-standard": "^24.0.0",
140
+ "stylelint-declaration-block-no-ignored-properties": "^2.5.0",
141
141
  "test-umi-plugin": "^0.1.0",
142
142
  "umi": "^3.5.20",
143
- "umi-plugin-custom-extra": "^1.0.12",
144
- "yorkie": "^2.0.0"
143
+ "umi-plugin-custom-extra": "^1.0.12"
145
144
  },
146
145
  "gitHooks": {
147
146
  "pre-commit": "lint-staged"