dlt-for-react 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.
package/README.md CHANGED
@@ -8,7 +8,7 @@ npm publish
8
8
 
9
9
  ## 前端 dlt-for-react 依赖包版本更新记录
10
10
 
11
- ##### 当前最新版本:1.1.0
11
+ ##### 当前最新版本:1.1.2
12
12
 
13
13
  ##### 安装依赖
14
14
 
@@ -16,6 +16,10 @@ npm publish
16
16
 
17
17
  ##### 版本修改记录
18
18
 
19
+ #### V1.1.1~2—2023 年 11 月 20 日
20
+
21
+ 1. change
22
+
19
23
  #### V1.1.0—2023 年 11 月 20 日
20
24
 
21
25
  1. 优化工具类导出方式
package/lib/index.js CHANGED
@@ -355,12 +355,231 @@ Object.defineProperty(exports, 'toProcessViewPage', {
355
355
  }
356
356
  });
357
357
 
358
+ var _index4 = require('./utils/index.js');
359
+
360
+ Object.defineProperty(exports, 'decode', {
361
+ enumerable: true,
362
+ get: function get() {
363
+ return _index4.decode;
364
+ }
365
+ });
366
+ Object.defineProperty(exports, 'encode', {
367
+ enumerable: true,
368
+ get: function get() {
369
+ return _index4.encode;
370
+ }
371
+ });
372
+ Object.defineProperty(exports, 'DateUtil', {
373
+ enumerable: true,
374
+ get: function get() {
375
+ return _index4.DateUtil;
376
+ }
377
+ });
378
+ Object.defineProperty(exports, 'getStrLength', {
379
+ enumerable: true,
380
+ get: function get() {
381
+ return _index4.getStrLength;
382
+ }
383
+ });
384
+ Object.defineProperty(exports, 'transformDate', {
385
+ enumerable: true,
386
+ get: function get() {
387
+ return _index4.transformDate;
388
+ }
389
+ });
390
+ Object.defineProperty(exports, 'getRouterAuthority', {
391
+ enumerable: true,
392
+ get: function get() {
393
+ return _index4.getRouterAuthority;
394
+ }
395
+ });
396
+ Object.defineProperty(exports, 'isUrl', {
397
+ enumerable: true,
398
+ get: function get() {
399
+ return _index4.isUrl;
400
+ }
401
+ });
402
+ Object.defineProperty(exports, 'getHashParam', {
403
+ enumerable: true,
404
+ get: function get() {
405
+ return _index4.getHashParam;
406
+ }
407
+ });
408
+ Object.defineProperty(exports, 'urlToList', {
409
+ enumerable: true,
410
+ get: function get() {
411
+ return _index4.urlToList;
412
+ }
413
+ });
414
+ Object.defineProperty(exports, 'matchParamsPath', {
415
+ enumerable: true,
416
+ get: function get() {
417
+ return _index4.matchParamsPath;
418
+ }
419
+ });
420
+ Object.defineProperty(exports, 'checkPassword', {
421
+ enumerable: true,
422
+ get: function get() {
423
+ return _index4.checkPassword;
424
+ }
425
+ });
426
+ Object.defineProperty(exports, 'arrayMove', {
427
+ enumerable: true,
428
+ get: function get() {
429
+ return _index4.arrayMove;
430
+ }
431
+ });
432
+ Object.defineProperty(exports, 'cutArray', {
433
+ enumerable: true,
434
+ get: function get() {
435
+ return _index4.cutArray;
436
+ }
437
+ });
438
+ Object.defineProperty(exports, 'splitString', {
439
+ enumerable: true,
440
+ get: function get() {
441
+ return _index4.splitString;
442
+ }
443
+ });
444
+ Object.defineProperty(exports, 'queryArray', {
445
+ enumerable: true,
446
+ get: function get() {
447
+ return _index4.queryArray;
448
+ }
449
+ });
450
+ Object.defineProperty(exports, 'arrayToTree', {
451
+ enumerable: true,
452
+ get: function get() {
453
+ return _index4.arrayToTree;
454
+ }
455
+ });
456
+ Object.defineProperty(exports, 'getLabelValueTree', {
457
+ enumerable: true,
458
+ get: function get() {
459
+ return _index4.getLabelValueTree;
460
+ }
461
+ });
462
+ Object.defineProperty(exports, 'getValueFromArray', {
463
+ enumerable: true,
464
+ get: function get() {
465
+ return _index4.getValueFromArray;
466
+ }
467
+ });
468
+ Object.defineProperty(exports, 'delay', {
469
+ enumerable: true,
470
+ get: function get() {
471
+ return _index4.delay;
472
+ }
473
+ });
474
+ Object.defineProperty(exports, 'transformFileToText', {
475
+ enumerable: true,
476
+ get: function get() {
477
+ return _index4.transformFileToText;
478
+ }
479
+ });
480
+ Object.defineProperty(exports, 'isAccordReg', {
481
+ enumerable: true,
482
+ get: function get() {
483
+ return _index4.isAccordReg;
484
+ }
485
+ });
486
+ Object.defineProperty(exports, 'isSearchKeyReg', {
487
+ enumerable: true,
488
+ get: function get() {
489
+ return _index4.isSearchKeyReg;
490
+ }
491
+ });
492
+ Object.defineProperty(exports, 'toThousands', {
493
+ enumerable: true,
494
+ get: function get() {
495
+ return _index4.toThousands;
496
+ }
497
+ });
498
+ Object.defineProperty(exports, 'findValueFormObject', {
499
+ enumerable: true,
500
+ get: function get() {
501
+ return _index4.findValueFormObject;
502
+ }
503
+ });
504
+ Object.defineProperty(exports, 'randomNumEnum', {
505
+ enumerable: true,
506
+ get: function get() {
507
+ return _index4.randomNumEnum;
508
+ }
509
+ });
510
+
358
511
  var _common = require('./utils/common.js');
359
512
 
360
- Object.defineProperty(exports, 'exactAdd', {
513
+ Object.defineProperty(exports, 'getOptions', {
361
514
  enumerable: true,
362
515
  get: function get() {
363
- return _common.exactAdd;
516
+ return _common.getOptions;
517
+ }
518
+ });
519
+ Object.defineProperty(exports, 'ellipsis', {
520
+ enumerable: true,
521
+ get: function get() {
522
+ return _common.ellipsis;
523
+ }
524
+ });
525
+ Object.defineProperty(exports, 'convertSmallHump', {
526
+ enumerable: true,
527
+ get: function get() {
528
+ return _common.convertSmallHump;
529
+ }
530
+ });
531
+ Object.defineProperty(exports, 'keepDecimal', {
532
+ enumerable: true,
533
+ get: function get() {
534
+ return _common.keepDecimal;
535
+ }
536
+ });
537
+ Object.defineProperty(exports, 'formatFloat', {
538
+ enumerable: true,
539
+ get: function get() {
540
+ return _common.formatFloat;
541
+ }
542
+ });
543
+ Object.defineProperty(exports, 'removeTreeListItem', {
544
+ enumerable: true,
545
+ get: function get() {
546
+ return _common.removeTreeListItem;
547
+ }
548
+ });
549
+ Object.defineProperty(exports, 'deepTree', {
550
+ enumerable: true,
551
+ get: function get() {
552
+ return _common.deepTree;
553
+ }
554
+ });
555
+ Object.defineProperty(exports, 'deepTreeEditing', {
556
+ enumerable: true,
557
+ get: function get() {
558
+ return _common.deepTreeEditing;
559
+ }
560
+ });
561
+ Object.defineProperty(exports, 'setRowId', {
562
+ enumerable: true,
563
+ get: function get() {
564
+ return _common.setRowId;
565
+ }
566
+ });
567
+ Object.defineProperty(exports, 'setBudget', {
568
+ enumerable: true,
569
+ get: function get() {
570
+ return _common.setBudget;
571
+ }
572
+ });
573
+ Object.defineProperty(exports, 'calcAfterBudgetSum', {
574
+ enumerable: true,
575
+ get: function get() {
576
+ return _common.calcAfterBudgetSum;
577
+ }
578
+ });
579
+ Object.defineProperty(exports, 'deepTreeChildSum', {
580
+ enumerable: true,
581
+ get: function get() {
582
+ return _common.deepTreeChildSum;
364
583
  }
365
584
  });
366
585
  Object.defineProperty(exports, 'summation', {
@@ -369,25 +588,97 @@ Object.defineProperty(exports, 'summation', {
369
588
  return _common.summation;
370
589
  }
371
590
  });
591
+ Object.defineProperty(exports, 'exactAdd', {
592
+ enumerable: true,
593
+ get: function get() {
594
+ return _common.exactAdd;
595
+ }
596
+ });
597
+ Object.defineProperty(exports, 'updateDataSource', {
598
+ enumerable: true,
599
+ get: function get() {
600
+ return _common.updateDataSource;
601
+ }
602
+ });
372
603
  Object.defineProperty(exports, 'isEmpty', {
373
604
  enumerable: true,
374
605
  get: function get() {
375
606
  return _common.isEmpty;
376
607
  }
377
608
  });
609
+ Object.defineProperty(exports, 'deepCheckField', {
610
+ enumerable: true,
611
+ get: function get() {
612
+ return _common.deepCheckField;
613
+ }
614
+ });
615
+ Object.defineProperty(exports, 'handleMenus', {
616
+ enumerable: true,
617
+ get: function get() {
618
+ return _common.handleMenus;
619
+ }
620
+ });
621
+ Object.defineProperty(exports, 'findAuth', {
622
+ enumerable: true,
623
+ get: function get() {
624
+ return _common.findAuth;
625
+ }
626
+ });
627
+ Object.defineProperty(exports, 'filterChildrenMenus', {
628
+ enumerable: true,
629
+ get: function get() {
630
+ return _common.filterChildrenMenus;
631
+ }
632
+ });
633
+ Object.defineProperty(exports, 'filterAuthMenus', {
634
+ enumerable: true,
635
+ get: function get() {
636
+ return _common.filterAuthMenus;
637
+ }
638
+ });
378
639
  Object.defineProperty(exports, 'deepCopy', {
379
640
  enumerable: true,
380
641
  get: function get() {
381
642
  return _common.deepCopy;
382
643
  }
383
644
  });
645
+ Object.defineProperty(exports, 'isArrayFn', {
646
+ enumerable: true,
647
+ get: function get() {
648
+ return _common.isArrayFn;
649
+ }
650
+ });
651
+ Object.defineProperty(exports, 'specialParams', {
652
+ enumerable: true,
653
+ get: function get() {
654
+ return _common.specialParams;
655
+ }
656
+ });
384
657
 
385
658
  var _NHCore = require('./utils/NHCore.js');
386
659
 
387
- Object.defineProperty(exports, 'getLoginUser', {
660
+ Object.defineProperty(exports, 'getSize', {
388
661
  enumerable: true,
389
662
  get: function get() {
390
- return _NHCore.getLoginUser;
663
+ return _NHCore.getSize;
664
+ }
665
+ });
666
+ Object.defineProperty(exports, 'getSuitHeight', {
667
+ enumerable: true,
668
+ get: function get() {
669
+ return _NHCore.getSuitHeight;
670
+ }
671
+ });
672
+ Object.defineProperty(exports, 'createUuid', {
673
+ enumerable: true,
674
+ get: function get() {
675
+ return _NHCore.createUuid;
676
+ }
677
+ });
678
+ Object.defineProperty(exports, 'getStyle', {
679
+ enumerable: true,
680
+ get: function get() {
681
+ return _NHCore.getStyle;
391
682
  }
392
683
  });
393
684
  Object.defineProperty(exports, 'hasAuth', {
@@ -396,22 +687,88 @@ Object.defineProperty(exports, 'hasAuth', {
396
687
  return _NHCore.hasAuth;
397
688
  }
398
689
  });
690
+ Object.defineProperty(exports, 'hasAuthList', {
691
+ enumerable: true,
692
+ get: function get() {
693
+ return _NHCore.hasAuthList;
694
+ }
695
+ });
696
+ Object.defineProperty(exports, 'getLoginUser', {
697
+ enumerable: true,
698
+ get: function get() {
699
+ return _NHCore.getLoginUser;
700
+ }
701
+ });
399
702
  Object.defineProperty(exports, 'browserJudge', {
400
703
  enumerable: true,
401
704
  get: function get() {
402
705
  return _NHCore.browserJudge;
403
706
  }
404
707
  });
405
- Object.defineProperty(exports, 'createUuid', {
708
+ Object.defineProperty(exports, 'computeFontSize', {
406
709
  enumerable: true,
407
710
  get: function get() {
408
- return _NHCore.createUuid;
711
+ return _NHCore.computeFontSize;
409
712
  }
410
713
  });
411
- Object.defineProperty(exports, 'getSize', {
714
+ Object.defineProperty(exports, 'getOffset', {
412
715
  enumerable: true,
413
716
  get: function get() {
414
- return _NHCore.getSize;
717
+ return _NHCore.getOffset;
718
+ }
719
+ });
720
+ Object.defineProperty(exports, 'validateCode', {
721
+ enumerable: true,
722
+ get: function get() {
723
+ return _NHCore.validateCode;
724
+ }
725
+ });
726
+ Object.defineProperty(exports, 'getCookie', {
727
+ enumerable: true,
728
+ get: function get() {
729
+ return _NHCore.getCookie;
730
+ }
731
+ });
732
+ Object.defineProperty(exports, 'setCookie', {
733
+ enumerable: true,
734
+ get: function get() {
735
+ return _NHCore.setCookie;
736
+ }
737
+ });
738
+ Object.defineProperty(exports, 'loadScript', {
739
+ enumerable: true,
740
+ get: function get() {
741
+ return _NHCore.loadScript;
742
+ }
743
+ });
744
+ Object.defineProperty(exports, 'animationFramePolyfill', {
745
+ enumerable: true,
746
+ get: function get() {
747
+ return _NHCore.animationFramePolyfill;
748
+ }
749
+ });
750
+ Object.defineProperty(exports, 'compatibleAnimationFrame', {
751
+ enumerable: true,
752
+ get: function get() {
753
+ return _NHCore.compatibleAnimationFrame;
754
+ }
755
+ });
756
+ Object.defineProperty(exports, 'createScript', {
757
+ enumerable: true,
758
+ get: function get() {
759
+ return _NHCore.createScript;
760
+ }
761
+ });
762
+ Object.defineProperty(exports, 'getBase64', {
763
+ enumerable: true,
764
+ get: function get() {
765
+ return _NHCore.getBase64;
766
+ }
767
+ });
768
+ Object.defineProperty(exports, 'download', {
769
+ enumerable: true,
770
+ get: function get() {
771
+ return _NHCore.download;
415
772
  }
416
773
  });
417
774
 
@@ -3,7 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.setCookie = exports.getCookie = exports.validateCode = exports.getOffset = exports.computeFontSize = exports.browserJudge = exports.getLoginUser = exports.hasAuthList = exports.hasAuth = exports.getStyle = exports.createUuid = exports.getSuitHeight = exports.getSize = undefined;
6
+ exports.download = exports.getBase64 = exports.createScript = exports.compatibleAnimationFrame = exports.setCookie = exports.getCookie = exports.validateCode = exports.getOffset = exports.computeFontSize = exports.browserJudge = exports.getLoginUser = exports.hasAuthList = exports.hasAuth = exports.getStyle = exports.createUuid = exports.getSuitHeight = exports.getSize = undefined;
7
+
8
+ var _promise = require('babel-runtime/core-js/promise');
9
+
10
+ var _promise2 = _interopRequireDefault(_promise);
7
11
 
8
12
  var _regenerator = require('babel-runtime/regenerator');
9
13
 
@@ -17,8 +21,12 @@ var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator');
17
21
 
18
22
  var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);
19
23
 
24
+ exports.loadScript = loadScript;
25
+ exports.animationFramePolyfill = animationFramePolyfill;
26
+
20
27
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
28
 
29
+ // 获取窗口信息
22
30
  var getSize = exports.getSize = function getSize() {
23
31
  var setting = sessionStorage.getItem('setting');
24
32
  var breadcrumbHeight = 0; //面包屑高度
@@ -324,4 +332,169 @@ var setCookie = exports.setCookie = function setCookie(key, value) {
324
332
  d.setTime(d.getTime() + day * 24 * 60 * 60 * 1000);
325
333
  var expires = 'expires=' + d.toGMTString();
326
334
  document.cookie = key + '=' + value + '; ' + expires;
335
+ };
336
+
337
+ function loadScript(src) {
338
+ return new _promise2.default(function (resolve, reject) {
339
+ var script = document.createElement('script');
340
+ script.type = 'text/javascript';
341
+ script.src = src;
342
+ script.onload = resolve;
343
+ script.onerror = reject;
344
+ document.head.appendChild(script);
345
+ });
346
+ }
347
+
348
+ /**
349
+ * 兼容requestAnimationFrame
350
+ *
351
+ * @export
352
+ */
353
+ function animationFramePolyfill() {
354
+ var lastTime = 0;
355
+ var vendors = ['ms', 'moz', 'webkit', 'o'];
356
+ for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
357
+ window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
358
+ window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
359
+ }
360
+
361
+ if (!window.requestAnimationFrame) {
362
+ window.requestAnimationFrame = function (callback, element) {
363
+ var currTime = new Date().getTime();
364
+ var timeToCall = Math.max(0, 16 - (currTime - lastTime));
365
+ var id = window.setTimeout(function () {
366
+ callback(currTime + timeToCall);
367
+ }, timeToCall);
368
+ lastTime = currTime + timeToCall;
369
+ return id;
370
+ };
371
+ }
372
+
373
+ if (!window.cancelAnimationFrame) {
374
+ window.cancelAnimationFrame = function (id) {
375
+ clearTimeout(id);
376
+ };
377
+ }
378
+ }
379
+
380
+ // 兼容requestAnimationFrame
381
+ var compatibleAnimationFrame = exports.compatibleAnimationFrame = function compatibleAnimationFrame() {
382
+ var lastTime = 0;
383
+ var vendors = ['webkit', 'moz'];
384
+ for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
385
+ window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
386
+ window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
387
+ }
388
+
389
+ if (!window.requestAnimationFrame) window.requestAnimationFrame = function (callback, element) {
390
+ var currTime = new Date().getTime();
391
+ var timeToCall = Math.max(0, 16 - (currTime - lastTime));
392
+ var id = window.setTimeout(function () {
393
+ callback(currTime + timeToCall);
394
+ }, timeToCall);
395
+ lastTime = currTime + timeToCall;
396
+ return id;
397
+ };
398
+
399
+ if (!window.cancelAnimationFrame) window.cancelAnimationFrame = function (id) {
400
+ clearTimeout(id);
401
+ };
402
+ };
403
+
404
+ /**
405
+ * 创建script标签加载js
406
+ * @param {string} [url='']
407
+ * @returns
408
+ */
409
+ var createScript = exports.createScript = function createScript() {
410
+ var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
411
+
412
+ var scriptTags = window.document.querySelectorAll('script');
413
+ var len = scriptTags.length;
414
+ var i = 0;
415
+ // 截取字符串,去掉可能url是相对路径的
416
+ url = url.indexOf('.') === 0 ? url.substr(1) : url;
417
+ var _url = location.origin + url;
418
+ return new _promise2.default(function (resolve, reject) {
419
+ var isHas = false;
420
+ for (i = 0; i < len; i++) {
421
+ var src = scriptTags[i].src;
422
+ if (src && src === _url) {
423
+ isHas = true;
424
+ resolve();
425
+ // scriptTags[i].parentElement.removeChild(scriptTags[i]);
426
+ }
427
+ }
428
+ if (!isHas) {
429
+ var node = document.createElement('script');
430
+ node.type = 'text/javascript';
431
+ node.src = url;
432
+ node.onload = resolve;
433
+ document.body.appendChild(node);
434
+ }
435
+ });
436
+ };
437
+
438
+ /**
439
+ * 图片转化
440
+ * @param {*} file
441
+ * @returns
442
+ */
443
+ var getBase64 = exports.getBase64 = function getBase64(file) {
444
+ return new _promise2.default(function (resolve, reject) {
445
+ var reader = new FileReader();
446
+ reader.readAsDataURL(file);
447
+ reader.onload = function () {
448
+ return resolve(reader.result);
449
+ };
450
+ reader.onerror = function (error) {
451
+ return reject(error);
452
+ };
453
+ });
454
+ };
455
+
456
+ // 下载成绩单
457
+ var download = exports.download = function download(res) {
458
+ var blob = new Blob([res.data]);
459
+ // 提取文件名
460
+ var contentDisposition = '';
461
+ if (res.headers['content-disposition']) {
462
+ contentDisposition = res.headers['content-disposition'];
463
+ }
464
+ if (res.headers['Content-disposition']) {
465
+ contentDisposition = res.headers['Content-disposition'];
466
+ }
467
+ var err = contentDisposition.match(/err=(.*)/);
468
+ if (err && err[1]) {
469
+ message.error(decodeURI(err[1]));
470
+ return;
471
+ }
472
+ var fileNameArr = contentDisposition.match(/filename=(.*)/);
473
+ if (!fileNameArr || !fileNameArr.length) {
474
+ return false;
475
+ }
476
+ var fileName = fileNameArr[1];
477
+ if (typeof window.navigator.msSaveBlob !== 'undefined') {
478
+ // 兼容IE,window.navigator.msSaveBlob:以本地方式保存文件
479
+ window.navigator.msSaveBlob(blob, decodeURI(fileName));
480
+ } else {
481
+ // 创建新的URL并指向File对象或者Blob对象的地址
482
+ var blobURL = window.URL.createObjectURL(blob);
483
+ // 创建a标签,用于跳转至下载链接
484
+ var tempLink = document.createElement('a');
485
+ tempLink.style.display = 'none';
486
+ tempLink.href = blobURL;
487
+ tempLink.setAttribute('download', decodeURI(fileName));
488
+ // 兼容:某些浏览器不支持HTML5的download属性
489
+ if (typeof tempLink.download === 'undefined') {
490
+ tempLink.setAttribute('target', '_blank');
491
+ }
492
+ // 挂载a标签
493
+ document.body.appendChild(tempLink);
494
+ tempLink.click();
495
+ document.body.removeChild(tempLink);
496
+ // 释放blob URL地址
497
+ window.URL.revokeObjectURL(blobURL);
498
+ }
499
+ return true;
327
500
  };
@@ -3,11 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.download = exports.specialParams = exports.isArrayFn = exports.deepCopy = exports.filterAuthMenus = exports.filterChildrenMenus = exports.findAuth = exports.handleMenus = exports.deepCheckField = exports.isEmpty = exports.updateDataSource = exports.exactAdd = exports.exactAdd1 = exports.summation = exports.deepTreeChildSum = exports.calcAfterBudgetSum = exports.setBudget = exports.setRowId = exports.deepTreeEditing = exports.deepTree = exports.removeTreeListItem = exports.formatFloat = exports.keepDecimal = exports.convertSmallHump = exports.ellipsis = exports.getOptions = exports.commonDataSource = exports.zipCodeRegExp = exports.emailRegExp = exports.officePhoneRegExp = exports.phoneRegExp = undefined;
7
-
8
- var _message2 = require('antd/lib/message');
9
-
10
- var _message3 = _interopRequireDefault(_message2);
6
+ exports.specialParams = exports.isArrayFn = exports.deepCopy = exports.filterAuthMenus = exports.filterChildrenMenus = exports.findAuth = exports.handleMenus = exports.deepCheckField = exports.isEmpty = exports.updateDataSource = exports.exactAdd = exports.exactAdd1 = exports.summation = exports.deepTreeChildSum = exports.calcAfterBudgetSum = exports.setBudget = exports.setRowId = exports.deepTreeEditing = exports.deepTree = exports.removeTreeListItem = exports.formatFloat = exports.keepDecimal = exports.convertSmallHump = exports.ellipsis = exports.getOptions = exports.commonDataSource = exports.zipCodeRegExp = exports.emailRegExp = exports.officePhoneRegExp = exports.phoneRegExp = undefined;
11
7
 
12
8
  var _typeof2 = require('babel-runtime/helpers/typeof');
13
9
 
@@ -31,8 +27,6 @@ var _select2 = _interopRequireDefault(_select);
31
27
 
32
28
  var _arguments = arguments;
33
29
 
34
- require('antd/lib/message/style');
35
-
36
30
  require('antd/lib/select/style');
37
31
 
38
32
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -466,49 +460,4 @@ var specialParams = exports.specialParams = {
466
460
  specialFunc: function specialFunc(dataIndex, record) {
467
461
  return record.authorType === '1' && ['workCompany', 'title', 'degree'].includes(dataIndex);
468
462
  }
469
-
470
- // 下载成绩单
471
- };var download = exports.download = function download(res) {
472
- var blob = new Blob([res.data]);
473
- // 提取文件名
474
- var contentDisposition = '';
475
- if (res.headers['content-disposition']) {
476
- contentDisposition = res.headers['content-disposition'];
477
- }
478
- if (res.headers['Content-disposition']) {
479
- contentDisposition = res.headers['Content-disposition'];
480
- }
481
- var err = contentDisposition.match(/err=(.*)/);
482
- if (err && err[1]) {
483
- _message3.default.error(decodeURI(err[1]));
484
- return;
485
- }
486
- var fileNameArr = contentDisposition.match(/filename=(.*)/);
487
- if (!fileNameArr || !fileNameArr.length) {
488
- return false;
489
- }
490
- var fileName = fileNameArr[1];
491
- if (typeof window.navigator.msSaveBlob !== 'undefined') {
492
- // 兼容IE,window.navigator.msSaveBlob:以本地方式保存文件
493
- window.navigator.msSaveBlob(blob, decodeURI(fileName));
494
- } else {
495
- // 创建新的URL并指向File对象或者Blob对象的地址
496
- var blobURL = window.URL.createObjectURL(blob);
497
- // 创建a标签,用于跳转至下载链接
498
- var tempLink = document.createElement('a');
499
- tempLink.style.display = 'none';
500
- tempLink.href = blobURL;
501
- tempLink.setAttribute('download', decodeURI(fileName));
502
- // 兼容:某些浏览器不支持HTML5的download属性
503
- if (typeof tempLink.download === 'undefined') {
504
- tempLink.setAttribute('target', '_blank');
505
- }
506
- // 挂载a标签
507
- document.body.appendChild(tempLink);
508
- tempLink.click();
509
- document.body.removeChild(tempLink);
510
- // 释放blob URL地址
511
- window.URL.revokeObjectURL(blobURL);
512
- }
513
- return true;
514
463
  };
@@ -3,16 +3,16 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.randomNumEnum = exports.getStyle = exports.getValueFromArray = exports.getLabelValueTree = exports.createUuid = exports.createScript = exports.getBase64 = exports.compatibleAnimationFrame = exports.cutArray = exports.arrayMove = exports.arrayMoveMutate = exports.checkPassword = exports.matchParamsPath = exports.urlToList = exports.getHashParam = exports.isUrl = exports.getRouterAuthority = exports.transformDate = exports.getStrLength = exports.DateUtil = exports._utf8_encode = exports.encode = exports.decode = exports.getSize = exports.getOffset = undefined;
7
-
8
- var _stringify = require('babel-runtime/core-js/json/stringify');
9
-
10
- var _stringify2 = _interopRequireDefault(_stringify);
6
+ exports.randomNumEnum = exports.getValueFromArray = exports.getLabelValueTree = exports.cutArray = exports.arrayMove = exports.arrayMoveMutate = exports.checkPassword = exports.matchParamsPath = exports.urlToList = exports.getHashParam = exports.isUrl = exports.getRouterAuthority = exports.transformDate = exports.getStrLength = exports.DateUtil = exports._utf8_encode = exports.encode = exports.decode = undefined;
11
7
 
12
8
  var _promise = require('babel-runtime/core-js/promise');
13
9
 
14
10
  var _promise2 = _interopRequireDefault(_promise);
15
11
 
12
+ var _stringify = require('babel-runtime/core-js/json/stringify');
13
+
14
+ var _stringify2 = _interopRequireDefault(_stringify);
15
+
16
16
  var _keys = require('babel-runtime/core-js/object/keys');
17
17
 
18
18
  var _keys2 = _interopRequireDefault(_keys);
@@ -22,12 +22,10 @@ exports.queryArray = queryArray;
22
22
  exports.arrayToTree = arrayToTree;
23
23
  exports.delay = delay;
24
24
  exports.transformFileToText = transformFileToText;
25
- exports.animationFramePolyfill = animationFramePolyfill;
26
25
  exports.isAccordReg = isAccordReg;
27
26
  exports.isSearchKeyReg = isSearchKeyReg;
28
27
  exports.toThousands = toThousands;
29
28
  exports.findValueFormObject = findValueFormObject;
30
- exports.loadScript = loadScript;
31
29
 
32
30
  var _pathToRegexp = require('path-to-regexp');
33
31
 
@@ -35,55 +33,6 @@ var _pathToRegexp2 = _interopRequireDefault(_pathToRegexp);
35
33
 
36
34
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
37
35
 
38
- /**
39
- * 获取元素距离可视区域顶部、左部的距离
40
- * @param {*} ele
41
- * @returns
42
- */
43
- var getOffset = exports.getOffset = function getOffset(ele) {
44
- var top = ele.offsetTop;
45
- var left = ele.offsetLeft;
46
- while (ele.offsetParent) {
47
- ele = ele.offsetParent;
48
- if (window.navigator.userAgent.indexOf('MSTE 8') > -1) {
49
- top += ele.offsetTop;
50
- left += ele.offsetLeft;
51
- } else {
52
- top += ele.offsetTop + ele.clientTop;
53
- left += ele.offsetLeft + ele.clientLeft;
54
- }
55
- }
56
- return {
57
- left: left,
58
- top: top
59
- };
60
- };
61
-
62
- /**
63
- * 获取窗口信息
64
- * @returns
65
- */
66
- /*
67
- * @Description: 通用工具类
68
- * @Author: admin
69
- * @Date: 2020-03-06 09:45:52
70
- * @LastEditors: jiangzhongxin
71
- * @LastEditTime: 2023-10-17 09:46:26
72
- */
73
- var getSize = exports.getSize = function getSize() {
74
- var windowW = void 0,
75
- windowH = void 0,
76
- contentH = void 0,
77
- contentW = void 0,
78
- scrollT = void 0;
79
- windowH = window.innerHeight;
80
- windowW = window.innerWidth;
81
- scrollT = document.documentElement.scrollTop || document.body.scrollTop;
82
- contentH = document.documentElement.scrollHeight > document.body.scrollHeight ? document.documentElement.scrollHeight : document.body.scrollHeight;
83
- contentW = document.documentElement.scrollWidth > document.body.scrollWidth ? document.documentElement.scrollWidth : document.body.scrollWidth;
84
- return { windowW: windowW, windowH: windowH, contentH: contentH, contentW: contentW, scrollT: scrollT };
85
- };
86
-
87
36
  var decode = exports.decode = function decode(input) {
88
37
  var _keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
89
38
  var output = '';
@@ -114,8 +63,13 @@ var decode = exports.decode = function decode(input) {
114
63
  }
115
64
  output = _utf8_decode(output);
116
65
  return output;
117
- };
118
-
66
+ }; /*
67
+ * @Description: 通用工具类
68
+ * @Author: admin
69
+ * @Date: 2020-03-06 09:45:52
70
+ * @LastEditors: jiangzhongxin
71
+ * @LastEditTime: 2023-10-17 09:46:26
72
+ */
119
73
  var encode = exports.encode = function encode(input) {
120
74
  var _keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
121
75
  var output = '';
@@ -408,121 +362,6 @@ function splitString(str, num) {
408
362
  return array;
409
363
  }
410
364
 
411
- // 兼容requestAnimationFrame
412
- var compatibleAnimationFrame = exports.compatibleAnimationFrame = function compatibleAnimationFrame() {
413
- var lastTime = 0;
414
- var vendors = ['webkit', 'moz'];
415
- for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
416
- window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
417
- window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
418
- }
419
-
420
- if (!window.requestAnimationFrame) window.requestAnimationFrame = function (callback, element) {
421
- var currTime = new Date().getTime();
422
- var timeToCall = Math.max(0, 16 - (currTime - lastTime));
423
- var id = window.setTimeout(function () {
424
- callback(currTime + timeToCall);
425
- }, timeToCall);
426
- lastTime = currTime + timeToCall;
427
- return id;
428
- };
429
-
430
- if (!window.cancelAnimationFrame) window.cancelAnimationFrame = function (id) {
431
- clearTimeout(id);
432
- };
433
- };
434
-
435
- /**
436
- * 图片转化
437
- * @param {*} file
438
- * @returns
439
- */
440
- var getBase64 = exports.getBase64 = function getBase64(file) {
441
- return new _promise2.default(function (resolve, reject) {
442
- var reader = new FileReader();
443
- reader.readAsDataURL(file);
444
- reader.onload = function () {
445
- return resolve(reader.result);
446
- };
447
- reader.onerror = function (error) {
448
- return reject(error);
449
- };
450
- });
451
- };
452
-
453
- /**
454
- * 创建script标签加载js
455
- * @param {string} [url='']
456
- * @returns
457
- */
458
- var createScript = exports.createScript = function createScript() {
459
- var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
460
-
461
- var scriptTags = window.document.querySelectorAll('script');
462
- var len = scriptTags.length;
463
- var i = 0;
464
- // 截取字符串,去掉可能url是相对路径的
465
- url = url.indexOf('.') === 0 ? url.substr(1) : url;
466
- var _url = location.origin + url;
467
- return new _promise2.default(function (resolve, reject) {
468
- var isHas = false;
469
- for (i = 0; i < len; i++) {
470
- var src = scriptTags[i].src;
471
- if (src && src === _url) {
472
- isHas = true;
473
- resolve();
474
- // scriptTags[i].parentElement.removeChild(scriptTags[i]);
475
- }
476
- }
477
- if (!isHas) {
478
- var node = document.createElement('script');
479
- node.type = 'text/javascript';
480
- node.src = url;
481
- node.onload = resolve;
482
- document.body.appendChild(node);
483
- }
484
- });
485
- };
486
-
487
- /**
488
- * 获取UUID
489
- * @returns
490
- */
491
- var createUuid = exports.createUuid = function createUuid() {
492
- var len = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 32;
493
- var radix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 16;
494
-
495
- var chars = '0123456789abcdefghijklmnopqrstuvwxyz'.split('');
496
- var uuid = [],
497
- i;
498
- radix = radix || chars.length;
499
-
500
- if (len) {
501
- // Compact form
502
- for (i = 0; i < len; i++) {
503
- uuid[i] = chars[0 | Math.random() * radix];
504
- }
505
- } else {
506
- // rfc4122, version 4 form
507
- var r;
508
-
509
- // rfc4122 requires these characters
510
- uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
511
- uuid[14] = '4';
512
-
513
- // Fill in random data. At i==19 set the high bits of clock sequence as
514
- // per rfc4122, sec. 4.1.5
515
- for (i = 0; i < 36; i++) {
516
- if (!uuid[i]) {
517
- r = 0 | Math.random() * 16;
518
- uuid[i] = chars[i == 19 ? r & 0x3 | 0x8 : r];
519
- }
520
- }
521
- }
522
-
523
- return uuid.join('');
524
- };
525
-
526
365
  /**
527
366
  * 数组内查询
528
367
  * @param {array} array
@@ -632,20 +471,6 @@ var getValueFromArray = exports.getValueFromArray = function getValueFromArray()
632
471
  return res;
633
472
  };
634
473
 
635
- /**
636
- * 获取元素的属性
637
- * @version 171221 1.0
638
- * @param {node} obj 元素
639
- * @param {string} name 属性key
640
- */
641
- var getStyle = exports.getStyle = function getStyle(obj, name) {
642
- if (obj.currentStyle) {
643
- return obj.currentStyle[name];
644
- } else {
645
- return getComputedStyle(obj, false)[name];
646
- }
647
- };
648
-
649
474
  /**
650
475
  * 延时
651
476
  * @export
@@ -677,38 +502,6 @@ function transformFileToText(file) {
677
502
  });
678
503
  }
679
504
 
680
- /**
681
- * 兼容requestAnimationFrame
682
- *
683
- * @export
684
- */
685
- function animationFramePolyfill() {
686
- var lastTime = 0;
687
- var vendors = ['ms', 'moz', 'webkit', 'o'];
688
- for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
689
- window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
690
- window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
691
- }
692
-
693
- if (!window.requestAnimationFrame) {
694
- window.requestAnimationFrame = function (callback, element) {
695
- var currTime = new Date().getTime();
696
- var timeToCall = Math.max(0, 16 - (currTime - lastTime));
697
- var id = window.setTimeout(function () {
698
- callback(currTime + timeToCall);
699
- }, timeToCall);
700
- lastTime = currTime + timeToCall;
701
- return id;
702
- };
703
- }
704
-
705
- if (!window.cancelAnimationFrame) {
706
- window.cancelAnimationFrame = function (id) {
707
- clearTimeout(id);
708
- };
709
- }
710
- }
711
-
712
505
  /**
713
506
  * 是否符合(中文、英文、汉字、汉字符号和 - _ 字符)
714
507
  * @param {*} text
@@ -772,17 +565,6 @@ function findValueFormObject(source, findStr) {
772
565
  return data;
773
566
  }
774
567
 
775
- function loadScript(src) {
776
- return new _promise2.default(function (resolve, reject) {
777
- var script = document.createElement('script');
778
- script.type = 'text/javascript';
779
- script.src = src;
780
- script.onload = resolve;
781
- script.onerror = reject;
782
- document.head.appendChild(script);
783
- });
784
- }
785
-
786
568
  /*******
787
569
  * @description: 随机抽取数组中的n个值
788
570
  * @author: 琴时
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dlt-for-react",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "dlt for react",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {