ztxkutils 2.10.47 → 2.10.49
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +1 -1
- package/dist/print.js +115 -46
- package/dist/{request-ef290b9a.js → request-2c8dff05.js} +82 -17
- package/dist/request.js +1 -1
- package/dist/statistic.d.ts +36 -1
- package/package.json +4 -4
- package/dist/validate-6e735536.js +0 -79
package/dist/index.js
CHANGED
@@ -2,7 +2,7 @@ export { c as authority } from './authority-e6bde99f.js';
|
|
2
2
|
export { d as dataModel } from './dataModel-1fbaff40.js';
|
3
3
|
export { t as tools } from './tools-09a4d620.js';
|
4
4
|
export { v as validate } from './validate-18e52490.js';
|
5
|
-
export { r as request } from './request-
|
5
|
+
export { r as request } from './request-2c8dff05.js';
|
6
6
|
export { r as reqUrl } from './reqUrl-787dd9e5.js';
|
7
7
|
import './tslib.es6-35653116.js';
|
8
8
|
import 'dayjs';
|
package/dist/print.js
CHANGED
@@ -387,7 +387,8 @@ function htmlToPdfNoCanvas(_a) {
|
|
387
387
|
setPdfVersion(pdf);
|
388
388
|
supportJsPdfChinese(pdf, fileBinary);
|
389
389
|
return [4 /*yield*/, new Promise(function (resolve) {
|
390
|
-
|
390
|
+
// 正确呈现文档
|
391
|
+
pdf.html(item, {
|
391
392
|
autoPaging: 'text',
|
392
393
|
margin: [pageMarginY, pageMarginX, pageMarginY, pageMarginX],
|
393
394
|
width: pageWidth,
|
@@ -397,30 +398,63 @@ function htmlToPdfNoCanvas(_a) {
|
|
397
398
|
for (var i_1 = 2, j = res.internal.getNumberOfPages(); i_1 <= j; i_1++) {
|
398
399
|
pdf.addPage(pageFormat, pageOrient);
|
399
400
|
}
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
}
|
414
|
-
if (isDownload) {
|
415
|
-
pdf.save(pdfName + "_" + i + ".pdf");
|
416
|
-
}
|
417
|
-
pdfBase64_2.push(pdf.output('dataurlstring'));
|
418
|
-
pdfs_2.push(pdf);
|
419
|
-
resolve({});
|
420
|
-
},
|
421
|
-
});
|
401
|
+
for (var i_2 = 1, j = res.internal.getNumberOfPages(); i_2 <= j; i_2++) {
|
402
|
+
pdf.setPage(i_2);
|
403
|
+
// 添加水印
|
404
|
+
if (isAddWater) {
|
405
|
+
setPdfWater(pdf, waterBase64, imgWidth, imgHeight);
|
406
|
+
}
|
407
|
+
}
|
408
|
+
if (isDownload) {
|
409
|
+
pdf.save(pdfName + "_" + i + ".pdf");
|
410
|
+
}
|
411
|
+
pdfBase64_2.push(pdf.output('dataurlstring'));
|
412
|
+
pdfs_2.push(pdf);
|
413
|
+
resolve({});
|
422
414
|
},
|
423
415
|
});
|
416
|
+
// new jsPDF(pdfOptions).html(item, {
|
417
|
+
// autoPaging: 'text',
|
418
|
+
// margin: [pageMarginY, pageMarginX, pageMarginY, pageMarginX],
|
419
|
+
// width: pageWidth,
|
420
|
+
// windowWidth: pageWidth,
|
421
|
+
// callback: function (res) {
|
422
|
+
// // 添加呈现的HTML所需的页面(从第2页开始)
|
423
|
+
// for (
|
424
|
+
// let i = 2, j = (res as any).internal.getNumberOfPages();
|
425
|
+
// i <= j;
|
426
|
+
// i++
|
427
|
+
// ) {
|
428
|
+
// pdf.addPage(pageFormat, pageOrient);
|
429
|
+
// }
|
430
|
+
// // 正确呈现文档
|
431
|
+
// pdf.html(item, {
|
432
|
+
// autoPaging: 'text',
|
433
|
+
// margin: [pageMarginY, pageMarginX, pageMarginY, pageMarginX],
|
434
|
+
// width: pageWidth,
|
435
|
+
// windowWidth: pageWidth,
|
436
|
+
// callback: function () {
|
437
|
+
// for (
|
438
|
+
// let i = 1, j = (res as any).internal.getNumberOfPages();
|
439
|
+
// i <= j;
|
440
|
+
// i++
|
441
|
+
// ) {
|
442
|
+
// pdf.setPage(i);
|
443
|
+
// // 添加水印
|
444
|
+
// if (isAddWater) {
|
445
|
+
// setPdfWater(pdf, waterBase64, imgWidth, imgHeight);
|
446
|
+
// }
|
447
|
+
// }
|
448
|
+
// if (isDownload) {
|
449
|
+
// pdf.save(`${pdfName}_${i}.pdf`);
|
450
|
+
// }
|
451
|
+
// pdfBase64.push(pdf.output('dataurlstring'));
|
452
|
+
// pdfs.push(pdf);
|
453
|
+
// resolve({});
|
454
|
+
// },
|
455
|
+
// });
|
456
|
+
// },
|
457
|
+
// });
|
424
458
|
})];
|
425
459
|
case 1:
|
426
460
|
_b.sent();
|
@@ -455,7 +489,8 @@ function htmlToPdfNoCanvas(_a) {
|
|
455
489
|
setPdfVersion(pdf_3);
|
456
490
|
supportJsPdfChinese(pdf_3, fileBinary);
|
457
491
|
return [2 /*return*/, new Promise(function (resolve) {
|
458
|
-
|
492
|
+
// 正确呈现文档
|
493
|
+
pdf_3.html(dom, {
|
459
494
|
autoPaging: 'text',
|
460
495
|
margin: [pageMarginY, pageMarginX, pageMarginY, pageMarginX],
|
461
496
|
width: pageWidth_1,
|
@@ -465,31 +500,65 @@ function htmlToPdfNoCanvas(_a) {
|
|
465
500
|
for (var i = 2, j = res.internal.getNumberOfPages(); i <= j; i++) {
|
466
501
|
pdf_3.addPage(pageFormat, pageOrient);
|
467
502
|
}
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
}
|
482
|
-
if (isDownload) {
|
483
|
-
pdf_3.save(pdfName + ".pdf");
|
484
|
-
}
|
485
|
-
resolve({
|
486
|
-
pdfs: [pdf_3],
|
487
|
-
pdfBase64: [pdf_3.output('dataurlstring')],
|
488
|
-
});
|
489
|
-
},
|
503
|
+
for (var i = 1, j = res.internal.getNumberOfPages(); i <= j; i++) {
|
504
|
+
pdf_3.setPage(i);
|
505
|
+
// 添加水印
|
506
|
+
if (isAddWater) {
|
507
|
+
setPdfWater(pdf_3, waterBase64, imgWidth, imgHeight);
|
508
|
+
}
|
509
|
+
}
|
510
|
+
if (isDownload) {
|
511
|
+
pdf_3.save(pdfName + ".pdf");
|
512
|
+
}
|
513
|
+
resolve({
|
514
|
+
pdfs: [pdf_3],
|
515
|
+
pdfBase64: [pdf_3.output('dataurlstring')],
|
490
516
|
});
|
491
517
|
},
|
492
518
|
});
|
519
|
+
// new jsPDF(pdfOptions).html(dom, {
|
520
|
+
// autoPaging: 'text',
|
521
|
+
// margin: [pageMarginY, pageMarginX, pageMarginY, pageMarginX],
|
522
|
+
// width: pageWidth,
|
523
|
+
// windowWidth: pageWidth,
|
524
|
+
// callback: function (res) {
|
525
|
+
// // 添加呈现的HTML所需的页面(从第2页开始)
|
526
|
+
// for (
|
527
|
+
// let i = 2, j = (res as any).internal.getNumberOfPages();
|
528
|
+
// i <= j;
|
529
|
+
// i++
|
530
|
+
// ) {
|
531
|
+
// pdf.addPage(pageFormat, pageOrient);
|
532
|
+
// }
|
533
|
+
// // 正确呈现文档
|
534
|
+
// pdf.html(dom, {
|
535
|
+
// autoPaging: 'text',
|
536
|
+
// margin: [pageMarginY, pageMarginX, pageMarginY, pageMarginX],
|
537
|
+
// width: pageWidth,
|
538
|
+
// windowWidth: pageWidth,
|
539
|
+
// callback: function () {
|
540
|
+
// for (
|
541
|
+
// let i = 1, j = (res as any).internal.getNumberOfPages();
|
542
|
+
// i <= j;
|
543
|
+
// i++
|
544
|
+
// ) {
|
545
|
+
// pdf.setPage(i);
|
546
|
+
// // 添加水印
|
547
|
+
// if (isAddWater) {
|
548
|
+
// setPdfWater(pdf, waterBase64, imgWidth, imgHeight);
|
549
|
+
// }
|
550
|
+
// }
|
551
|
+
// if (isDownload) {
|
552
|
+
// pdf.save(`${pdfName}.pdf`);
|
553
|
+
// }
|
554
|
+
// resolve({
|
555
|
+
// pdfs: [pdf],
|
556
|
+
// pdfBase64: [pdf.output('dataurlstring')],
|
557
|
+
// });
|
558
|
+
// },
|
559
|
+
// });
|
560
|
+
// },
|
561
|
+
// });
|
493
562
|
})];
|
494
563
|
}
|
495
564
|
});
|
@@ -616,9 +616,9 @@ var getNative$5 = _getNative,
|
|
616
616
|
root$5 = _root;
|
617
617
|
|
618
618
|
/* Built-in method references that are verified to be native. */
|
619
|
-
var Map$
|
619
|
+
var Map$4 = getNative$5(root$5, 'Map');
|
620
620
|
|
621
|
-
var _Map = Map$
|
621
|
+
var _Map = Map$4;
|
622
622
|
|
623
623
|
var getNative$4 = _getNative;
|
624
624
|
|
@@ -776,7 +776,7 @@ var _Hash = Hash$1;
|
|
776
776
|
|
777
777
|
var Hash = _Hash,
|
778
778
|
ListCache$2 = _ListCache,
|
779
|
-
Map$
|
779
|
+
Map$3 = _Map;
|
780
780
|
|
781
781
|
/**
|
782
782
|
* Removes all key-value entries from the map.
|
@@ -789,7 +789,7 @@ function mapCacheClear$1() {
|
|
789
789
|
this.size = 0;
|
790
790
|
this.__data__ = {
|
791
791
|
'hash': new Hash,
|
792
|
-
'map': new (Map$
|
792
|
+
'map': new (Map$3 || ListCache$2),
|
793
793
|
'string': new Hash
|
794
794
|
};
|
795
795
|
}
|
@@ -942,7 +942,7 @@ MapCache$2.prototype.set = mapCacheSet;
|
|
942
942
|
var _MapCache = MapCache$2;
|
943
943
|
|
944
944
|
var ListCache$1 = _ListCache,
|
945
|
-
Map$
|
945
|
+
Map$2 = _Map,
|
946
946
|
MapCache$1 = _MapCache;
|
947
947
|
|
948
948
|
/** Used as the size to enable large array optimizations. */
|
@@ -962,7 +962,7 @@ function stackSet$1(key, value) {
|
|
962
962
|
var data = this.__data__;
|
963
963
|
if (data instanceof ListCache$1) {
|
964
964
|
var pairs = data.__data__;
|
965
|
-
if (!Map$
|
965
|
+
if (!Map$2 || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
|
966
966
|
pairs.push([key, value]);
|
967
967
|
this.size = ++data.size;
|
968
968
|
return this;
|
@@ -2222,7 +2222,7 @@ var WeakMap$1 = getNative(root, 'WeakMap');
|
|
2222
2222
|
var _WeakMap = WeakMap$1;
|
2223
2223
|
|
2224
2224
|
var DataView = _DataView,
|
2225
|
-
Map = _Map,
|
2225
|
+
Map$1 = _Map,
|
2226
2226
|
Promise$1 = _Promise,
|
2227
2227
|
Set = _Set,
|
2228
2228
|
WeakMap = _WeakMap,
|
@@ -2240,7 +2240,7 @@ var dataViewTag = '[object DataView]';
|
|
2240
2240
|
|
2241
2241
|
/** Used to detect maps, sets, and weakmaps. */
|
2242
2242
|
var dataViewCtorString = toSource(DataView),
|
2243
|
-
mapCtorString = toSource(Map),
|
2243
|
+
mapCtorString = toSource(Map$1),
|
2244
2244
|
promiseCtorString = toSource(Promise$1),
|
2245
2245
|
setCtorString = toSource(Set),
|
2246
2246
|
weakMapCtorString = toSource(WeakMap);
|
@@ -2256,7 +2256,7 @@ var getTag$1 = baseGetTag;
|
|
2256
2256
|
|
2257
2257
|
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
|
2258
2258
|
if ((DataView && getTag$1(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
|
2259
|
-
(Map && getTag$1(new Map) != mapTag) ||
|
2259
|
+
(Map$1 && getTag$1(new Map$1) != mapTag) ||
|
2260
2260
|
(Promise$1 && getTag$1(Promise$1.resolve()) != promiseTag) ||
|
2261
2261
|
(Set && getTag$1(new Set) != setTag) ||
|
2262
2262
|
(WeakMap && getTag$1(new WeakMap) != weakMapTag)) {
|
@@ -2429,6 +2429,47 @@ function isEqual(value, other) {
|
|
2429
2429
|
|
2430
2430
|
var isEqual_1 = isEqual;
|
2431
2431
|
|
2432
|
+
var AxiosCancel = /** @class */ (function () {
|
2433
|
+
function AxiosCancel() {
|
2434
|
+
// private axiosCancelToken = new AxiosCancelToken();
|
2435
|
+
this.pendingRequests = new Map();
|
2436
|
+
}
|
2437
|
+
/**
|
2438
|
+
* 获取请求参数唯一key值
|
2439
|
+
*/
|
2440
|
+
AxiosCancel.prototype.getKey = function (config) {
|
2441
|
+
return [config.url, config.params, config.data]
|
2442
|
+
.filter(function (item) { return item; })
|
2443
|
+
.map(function (item) { return JSON.stringify(item); })
|
2444
|
+
.join('-');
|
2445
|
+
};
|
2446
|
+
/**
|
2447
|
+
* @description 发起请求之前,拦截重复请求
|
2448
|
+
*/
|
2449
|
+
AxiosCancel.prototype.pendingRequestCancel = function (config) {
|
2450
|
+
var key = this.getKey(config);
|
2451
|
+
var cancelTokenObj = axios.CancelToken.source();
|
2452
|
+
// 将token挂载到当前接口的请求头里面
|
2453
|
+
config.cancelToken = cancelTokenObj.token;
|
2454
|
+
if (this.pendingRequests.has(key)) {
|
2455
|
+
this.pendingRequests.get(key).cancel('拦截重复请求');
|
2456
|
+
this.pendingRequests.delete(key);
|
2457
|
+
}
|
2458
|
+
this.pendingRequests.set(key, {
|
2459
|
+
cancel: cancelTokenObj.cancel,
|
2460
|
+
});
|
2461
|
+
};
|
2462
|
+
/**
|
2463
|
+
* @description 请求完成之后, 清除pendingRequest
|
2464
|
+
*/
|
2465
|
+
AxiosCancel.prototype.clearPendingRequest = function (reponse) {
|
2466
|
+
var key = this.getKey(reponse.config);
|
2467
|
+
this.pendingRequests.delete(key);
|
2468
|
+
};
|
2469
|
+
return AxiosCancel;
|
2470
|
+
}());
|
2471
|
+
var axiosCancel = new AxiosCancel();
|
2472
|
+
|
2432
2473
|
var timeoutNum = 60000;
|
2433
2474
|
var isRefreshing = true; // 是否需要刷新
|
2434
2475
|
var subscribers = []; // 缓存需要帮助请求的接口
|
@@ -2446,6 +2487,8 @@ var isFirstSet = false; // 首次初始化
|
|
2446
2487
|
var OLD_AUTHORIZATION = 'Basic c3dvcmQ6c3dvcmRfc2VjcmV0';
|
2447
2488
|
var NEW_AUTHORIZATION = 'Basic em1kbXM6em1kbXNfc2VjcmV0';
|
2448
2489
|
var Authorization = OLD_AUTHORIZATION;
|
2490
|
+
// 用于存储目前状态为pending的请求标识信息 2023-05-15
|
2491
|
+
var pendingRequest = [];
|
2449
2492
|
function loginRequest(params, InnerAuthorization) {
|
2450
2493
|
return request({
|
2451
2494
|
method: 'POST',
|
@@ -2564,6 +2607,7 @@ function setInterceptorsResponse(jumpCallback, otherOptions) {
|
|
2564
2607
|
axios.interceptors.response.use(function (response) {
|
2565
2608
|
var _a, _b;
|
2566
2609
|
// catchPromiseObj = [];
|
2610
|
+
axiosCancel.clearPendingRequest(response);
|
2567
2611
|
if (response.status === 200) {
|
2568
2612
|
if ((_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.code) {
|
2569
2613
|
if (((_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.code) === 200) {
|
@@ -2667,12 +2711,25 @@ function setInterceptorsResponse(jumpCallback, otherOptions) {
|
|
2667
2711
|
return Promise.reject(error);
|
2668
2712
|
});
|
2669
2713
|
}
|
2670
|
-
|
2671
|
-
//
|
2672
|
-
|
2673
|
-
|
2674
|
-
|
2675
|
-
|
2714
|
+
function setInterceptorsRequest() {
|
2715
|
+
// 拦截器,拦截响应头信息
|
2716
|
+
axios.interceptors.request.use(function (config) {
|
2717
|
+
var _a, _b, _c;
|
2718
|
+
if (config.isCancelRepeat) {
|
2719
|
+
axiosCancel.pendingRequestCancel(config);
|
2720
|
+
}
|
2721
|
+
// 如果需要清除未完成的请求 2023-05-15
|
2722
|
+
if (config.isCancelNoCompleteRequest &&
|
2723
|
+
!config.cancelToken &&
|
2724
|
+
((_a = config.method) === null || _a === void 0 ? void 0 : _a.toUpperCase()) !== 'POST' &&
|
2725
|
+
!((_c = (_b = config.url) === null || _b === void 0 ? void 0 : _b.includes) === null || _c === void 0 ? void 0 : _c.call(_b, 'zmdms-resource'))) {
|
2726
|
+
var cancelTokenObj = axios.CancelToken.source();
|
2727
|
+
config.cancelToken = cancelTokenObj.token;
|
2728
|
+
pendingRequest.push(cancelTokenObj.cancel);
|
2729
|
+
}
|
2730
|
+
return config;
|
2731
|
+
});
|
2732
|
+
}
|
2676
2733
|
function transformObj(obj) {
|
2677
2734
|
if (typeof obj === 'undefined') {
|
2678
2735
|
return null;
|
@@ -2703,7 +2760,7 @@ function request(myOptions, jumpCallback, otherOptions) {
|
|
2703
2760
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
2704
2761
|
var InnerAuthorization = (otherOptions || {}).InnerAuthorization;
|
2705
2762
|
if (!isFirstSet) {
|
2706
|
-
|
2763
|
+
setInterceptorsRequest();
|
2707
2764
|
setInterceptorsResponse(jumpCallback, otherOptions);
|
2708
2765
|
isFirstSet = true;
|
2709
2766
|
}
|
@@ -2823,6 +2880,13 @@ function request(myOptions, jumpCallback, otherOptions) {
|
|
2823
2880
|
}
|
2824
2881
|
return axios(newOptions);
|
2825
2882
|
}
|
2883
|
+
// 清除未完成的请求 2023-05-15
|
2884
|
+
function clearNoCompleteRequest() {
|
2885
|
+
pendingRequest.forEach(function (cancel, index) {
|
2886
|
+
cancel && cancel();
|
2887
|
+
});
|
2888
|
+
pendingRequest = [];
|
2889
|
+
}
|
2826
2890
|
function clearCatch() {
|
2827
2891
|
catchPromiseObj = [];
|
2828
2892
|
}
|
@@ -2832,7 +2896,8 @@ var request$1 = /*#__PURE__*/Object.freeze({
|
|
2832
2896
|
OLD_AUTHORIZATION: OLD_AUTHORIZATION,
|
2833
2897
|
NEW_AUTHORIZATION: NEW_AUTHORIZATION,
|
2834
2898
|
'default': request,
|
2899
|
+
clearNoCompleteRequest: clearNoCompleteRequest,
|
2835
2900
|
clearCatch: clearCatch
|
2836
2901
|
});
|
2837
2902
|
|
2838
|
-
export { NEW_AUTHORIZATION as N, OLD_AUTHORIZATION as O, request as a, clearCatch as c, request$1 as r };
|
2903
|
+
export { NEW_AUTHORIZATION as N, OLD_AUTHORIZATION as O, request as a, clearCatch as b, clearNoCompleteRequest as c, request$1 as r };
|
package/dist/request.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import './tslib.es6-35653116.js';
|
2
2
|
import 'axios';
|
3
3
|
import 'ztxkui';
|
4
|
-
export { N as NEW_AUTHORIZATION, O as OLD_AUTHORIZATION, b as clearCatch, c as clearNoCompleteRequest, a as default } from './request-
|
4
|
+
export { N as NEW_AUTHORIZATION, O as OLD_AUTHORIZATION, b as clearCatch, c as clearNoCompleteRequest, a as default } from './request-2c8dff05.js';
|
5
5
|
import './authority-e6bde99f.js';
|
6
6
|
import './crypto-c481f616.js';
|
7
7
|
import 'crypto';
|
package/dist/statistic.d.ts
CHANGED
@@ -1 +1,36 @@
|
|
1
|
-
|
1
|
+
declare const PV_URL_SET: Set<unknown>;
|
2
|
+
declare const EVENT_URL = "/api/zmdms-log/web/submit";
|
3
|
+
declare const ERROR_URL = "/api/zmdms-log/web/submit";
|
4
|
+
/**
|
5
|
+
* routeUrl: string
|
6
|
+
* systemId: string
|
7
|
+
* userId: string
|
8
|
+
* navigator: string // 浏览器信息 userAgent
|
9
|
+
* platform: string // 系统信息
|
10
|
+
* memory: string // 内存信息
|
11
|
+
* eventKey: string // 事件名
|
12
|
+
* eventValue: string // 事件值
|
13
|
+
* {
|
14
|
+
* jsHeapSizeLimit: 上下文内可用堆的最大体积,以字节计算。
|
15
|
+
* totalJSHeapSize: 已分配的堆体积,以字节计算。
|
16
|
+
* usedJSHeapSize: 当前 JS 堆活跃段(segment)的体积,以字节计算。
|
17
|
+
* }
|
18
|
+
*/
|
19
|
+
declare function getUserOsInfo(userAgent?: string): "Windows 10" | "Windows 8" | "Windows 7" | "Windows Vista" | "Windows XP" | "Windows 2000" | "Mac/iOS" | "UNIX" | "Linux" | "Other";
|
20
|
+
declare class MyStatistic {
|
21
|
+
private systemId;
|
22
|
+
private userId;
|
23
|
+
private navigator;
|
24
|
+
private platform;
|
25
|
+
constructor(systemId: any, userId: any);
|
26
|
+
private send;
|
27
|
+
private initPerformance;
|
28
|
+
sendPerformance(): void;
|
29
|
+
private errorHandle;
|
30
|
+
private unhandledrejectionHandle;
|
31
|
+
private initError;
|
32
|
+
removeError(): void;
|
33
|
+
pv(): void;
|
34
|
+
event(eventKey: string, eventValue: string): void;
|
35
|
+
error(error: Error, info?: any): void;
|
36
|
+
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "ztxkutils",
|
3
|
-
"version": "2.10.
|
3
|
+
"version": "2.10.49",
|
4
4
|
"description": "",
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"module": "./dist/index.js",
|
@@ -55,8 +55,8 @@
|
|
55
55
|
"screenfull": "^5.1.0",
|
56
56
|
"sockjs-client": "^1.5.1",
|
57
57
|
"stompjs": "^2.3.3",
|
58
|
-
"zt-sockjs-client": "^0.0.
|
59
|
-
"zt-stompjs": "^1.
|
58
|
+
"zt-sockjs-client": "^0.0.2",
|
59
|
+
"zt-stompjs": "^1.1.2"
|
60
60
|
},
|
61
61
|
"peerDependencies": {
|
62
62
|
"axios": ">=0.21.1",
|
@@ -70,4 +70,4 @@
|
|
70
70
|
"react-router-dom": ">=5.2.0",
|
71
71
|
"ztxkui": ">=0.4.1"
|
72
72
|
}
|
73
|
-
}
|
73
|
+
}
|
@@ -1,79 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @description 常用正则表达式
|
3
|
-
*/
|
4
|
-
var validate = {
|
5
|
-
/**
|
6
|
-
* @description 长度验证,最小长度字符,0-200个字符
|
7
|
-
*/
|
8
|
-
smallLenValidate: /^(?:\s*)[\s\S]{0,200}(?:\s*)$/,
|
9
|
-
/**
|
10
|
-
* @description 长度验证,中等长度字符,0-400个字符
|
11
|
-
*/
|
12
|
-
middleLenValidate: /^(?:\s*)[\s\S]{0,400}(?:\s*)$/,
|
13
|
-
/**
|
14
|
-
* @description 长度验证,最大长度字符,0-600个字符
|
15
|
-
*/
|
16
|
-
largeLenValidate: /^(?:\s*)[\s\S]{0,600}(?:\s*)$/,
|
17
|
-
/**
|
18
|
-
* @description 长度验证,最大长度字符,0-5000个字符
|
19
|
-
*/
|
20
|
-
maxlargeLenValidate: /^(?:\s*)[\s\S]{0,5000}(?:\s*)$/,
|
21
|
-
/**
|
22
|
-
* @description 电话号码验证
|
23
|
-
*/
|
24
|
-
// phoneValidate: /^1(3\d|4\d|5\d|6\d|7\d|8\d|9\d)\d{8}$/,
|
25
|
-
// 数字 横线 长度 0 - 15位/^([0-9])|(\-)*$/
|
26
|
-
phoneValidate: /^[0-9\-]{0,15}$/,
|
27
|
-
/**
|
28
|
-
* @description 短信验证码 接受11位手机号
|
29
|
-
*/
|
30
|
-
shortPhoneValidate: /^1[0-9]{10}$/,
|
31
|
-
/**
|
32
|
-
* @description 身份证验证
|
33
|
-
* 18位 最后一位可以是X x
|
34
|
-
*/
|
35
|
-
idCardValidate: /^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
|
36
|
-
/**
|
37
|
-
* @description 邮箱验证
|
38
|
-
*/
|
39
|
-
emailValidate: /^([\s\S])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,8})$/,
|
40
|
-
/**
|
41
|
-
* @description 密码验证
|
42
|
-
*/
|
43
|
-
passwordValidate: /^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?!([^(0-9a-zA-Z)])+$)^.{8,16}$/,
|
44
|
-
/**
|
45
|
-
* @description 空格验证
|
46
|
-
*/
|
47
|
-
spaceValidate: /^[^\s]*$/g,
|
48
|
-
};
|
49
|
-
var commonMessage = {
|
50
|
-
smallLenMessage: function (type) {
|
51
|
-
if (type === void 0) { type = ''; }
|
52
|
-
return type + "\u8D85\u8FC7\u6700\u5927\u5B57\u7B26\u957F\u5EA6200";
|
53
|
-
},
|
54
|
-
middleLenMessage: function (type) {
|
55
|
-
if (type === void 0) { type = ''; }
|
56
|
-
return type + "\u8D85\u8FC7\u6700\u5927\u5B57\u7B26\u957F\u5EA6400";
|
57
|
-
},
|
58
|
-
largeLenMessage: function (type) {
|
59
|
-
if (type === void 0) { type = ''; }
|
60
|
-
return type + "\u8D85\u8FC7\u6700\u5927\u5B57\u7B26\u957F\u5EA6600";
|
61
|
-
},
|
62
|
-
maxlargeLenValidate: function (type) {
|
63
|
-
if (type === void 0) { type = ''; }
|
64
|
-
return type + "\u8D85\u8FC7\u6700\u5927\u5B57\u7B26\u957F\u5EA65000";
|
65
|
-
},
|
66
|
-
phoneMessage: '请输入正确的手机号',
|
67
|
-
idCardMessage: '请输入正确的身份证',
|
68
|
-
emailMessage: '请输入正确的邮箱',
|
69
|
-
passwordMessage: '密码由8-16位的字母+数字,字母+特殊字符,数字+特殊字符组成',
|
70
|
-
spaceMessage: '请勿输入空格',
|
71
|
-
};
|
72
|
-
|
73
|
-
var validate$1 = /*#__PURE__*/Object.freeze({
|
74
|
-
__proto__: null,
|
75
|
-
validate: validate,
|
76
|
-
commonMessage: commonMessage
|
77
|
-
});
|
78
|
-
|
79
|
-
export { validate as a, commonMessage as c, validate$1 as v };
|