ztxkutils 2.10.66-3 → 2.10.66-31
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/dist/businessTools.js +4 -3
- package/dist/{dataModel-1fbaff40.js → dataModel-f1ef06bc.js} +4 -2
- package/dist/dataModel.js +2 -1
- package/dist/fileOperation.d.ts +19 -0
- package/dist/fileOperation.js +60 -18
- package/dist/hooks.js +34 -22
- package/dist/i18next.d.ts +2 -0
- package/dist/i18next.js +2401 -0
- package/dist/index.js +5 -4
- package/dist/myIndexDb.d.ts +1 -1
- package/dist/print.d.ts +2 -4
- package/dist/print.js +3 -2
- package/dist/{reqUrl-22b880a4.js → reqUrl-ea7ef876.js} +3 -2
- package/dist/reqUrl.js +1 -1
- package/dist/{request-87d93572.js → request-40e9ca7b.js} +16 -8
- package/dist/request.js +2 -1
- package/dist/stompClient.js +21 -8
- package/dist/useHistory.js +7 -0
- package/dist/{validate-18e52490.js → validate-2138d94a.js} +29 -15
- package/dist/validate.d.ts +1 -0
- package/dist/validate.js +2 -1
- package/dist/workflow.js +3 -5
- package/locales/en-US.json +64 -0
- package/locales/zh-CN.json +64 -0
- package/package.json +112 -75
- package/zti18n-cli/bin/index.js +3 -0
- package/zti18n-cli/index.js +23 -0
- package/zti18n-cli/src/command/collect.js +353 -0
- package/zti18n-cli/src/command/convert.js +17 -0
- package/zti18n-cli/src/command/convert2.js +35 -0
- package/zti18n-cli/src/command/initFileConf.js +133 -0
- package/zti18n-cli/src/command/publish.js +24 -0
- package/zti18n-cli/src/conf/BaseConf.js +21 -0
- package/zti18n-cli/src/conf/FileConf.js +116 -0
- package/zti18n-cli/src/index.js +75 -0
- package/zti18n-cli/src/translate/google.js +87 -0
- package/zti18n-cli/src/utils/isChinese.js +3 -0
- package/zti18n-cli/src/utils/log.js +8 -0
- package/zti18n-cli/src/utils/mergeOptions.js +45 -0
- package/zti18n-cli/src/utils/reactOptions.js +73 -0
- package/zti18n-cli/src/utils/vueOptions.js +69 -0
- package/zti18n-core/index.js +1 -0
- package/zti18n-core/src/index.js +5 -0
- package/zti18n-core/src/plugin/reactIntlToReactIntlUniversal.js +224 -0
- package/zti18n-core/src/plugin/reactIntlUniversalToDi18n.js +64 -0
- package/zti18n-core/src/transform/defaultPkMap.js +79 -0
- package/zti18n-core/src/transform/transformHtml.js +271 -0
- package/zti18n-core/src/transform/transformJs.js +489 -0
- package/zti18n-core/src/transform/transformPug.js +272 -0
- package/zti18n-core/src/transform/transformReactIntlToReactIntlUniversal.js +96 -0
- package/zti18n-core/src/transform/transformReactIntlUniveralToDi18n.js +90 -0
- package/zti18n-core/src/transform/transformToDi18n.js +22 -0
- package/zti18n-core/src/transform/transformTs.js +41 -0
- package/zti18n-core/src/transform/transformVue.js +126 -0
- package/zti18n-core/src/transform/transformZeroToDi18n.js +105 -0
- package/zti18n-core/src/translate/google.js +6 -0
- package/zti18n-core/src/utils/constants.js +3 -0
- package/zti18n-core/src/utils/getIgnoreLines.js +14 -0
- package/zti18n-core/src/utils/isChinese.js +3 -0
- package/zti18n-core/src/utils/log.js +8 -0
- package/dist/request-3c906c2d.js +0 -2913
- package/dist/request-dc69f021.js +0 -2972
- package/dist/tools-16a7fb45.js +0 -2446
package/dist/index.js
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
export { d as authority } from './authority-7a91cb9f.js';
|
2
|
-
export { d as dataModel } from './dataModel-
|
2
|
+
export { d as dataModel } from './dataModel-f1ef06bc.js';
|
3
3
|
export { t as tools } from './tools-390e3466.js';
|
4
|
-
export { v as validate } from './validate-
|
5
|
-
export { r as request } from './request-
|
6
|
-
export { r as reqUrl } from './reqUrl-
|
4
|
+
export { v as validate } from './validate-2138d94a.js';
|
5
|
+
export { r as request } from './request-40e9ca7b.js';
|
6
|
+
export { r as reqUrl } from './reqUrl-ea7ef876.js';
|
7
|
+
import './i18next.js';
|
7
8
|
import './tslib.es6-35653116.js';
|
8
9
|
import 'dayjs';
|
9
10
|
import 'axios';
|
package/dist/myIndexDb.d.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
export {};
|
package/dist/print.d.ts
CHANGED
@@ -66,10 +66,8 @@ export declare function htmlToPdfNoCanvas({ pageClassName, dom, isShowPage, file
|
|
66
66
|
pdfName?: string;
|
67
67
|
isDownload?: boolean;
|
68
68
|
pdfOption?: IPdfOption;
|
69
|
-
/** 是否添加水印 */
|
70
|
-
|
71
|
-
/** 水印base 64字符串 */
|
72
|
-
waterBase64?: string;
|
69
|
+
/** 是否添加水印 */ isAddWater?: boolean;
|
70
|
+
/** 水印base 64字符串 */ waterBase64?: string;
|
73
71
|
imgWidth?: number;
|
74
72
|
imgHeight?: number;
|
75
73
|
isCompress?: boolean;
|
package/dist/print.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import { d as __spreadArray, _ as __assign, b as __awaiter, c as __generator } from './tslib.es6-35653116.js';
|
2
|
+
import instance from './i18next.js';
|
2
3
|
import { jsPDF } from 'jspdf';
|
3
4
|
import html2canvas from 'html2canvas';
|
4
5
|
|
@@ -74,7 +75,7 @@ function createWaterHandle(obj) {
|
|
74
75
|
// console.log(err);
|
75
76
|
// }
|
76
77
|
// }
|
77
|
-
var defaultWaterText = '浙商中拓';
|
78
|
+
var defaultWaterText = instance.t('浙商中拓');
|
78
79
|
var _a = obj || {}, waterText = _a.waterText, opacity = _a.opacity, fontSize = _a.fontSize, cavansWidth = _a.cavansWidth, cavansHeight = _a.cavansHeight;
|
79
80
|
var canvas = document.createElement('canvas');
|
80
81
|
var defaultCanvasWidth = waterText
|
@@ -92,7 +93,7 @@ function createWaterHandle(obj) {
|
|
92
93
|
var ctx = canvas.getContext('2d');
|
93
94
|
if (ctx) {
|
94
95
|
ctx.rotate((-10 * Math.PI) / 180); // 水印旋转角度
|
95
|
-
ctx.font = (fontSize || '18px')
|
96
|
+
ctx.font = instance.t('{{slot0}} 微软雅黑', { slot0: fontSize || '18px' });
|
96
97
|
ctx.fillStyle = "rgba(0,0,0," + (opacity ? opacity : '0.07') + ")";
|
97
98
|
ctx.textAlign = 'center';
|
98
99
|
ctx.textBaseline = 'middle';
|
@@ -14,9 +14,10 @@ function getReqUrl(processObj) {
|
|
14
14
|
'https://nportal.zmd.com.cn:18998'; // 生产环境外网api地址 https://m-portal.zmd.com.cn:18998 http://dz.zmd.com.cn:48000
|
15
15
|
// 文件服务器
|
16
16
|
var ZT_FILE_PREVIEW_DEV = processObj.REACT_APP_ZT_FILE_PREVIEW_DEV || 'http://192.168.0.83:88'; // 开发环境
|
17
|
-
var ZT_FILE_PREVIEW_TEST = processObj.REACT_APP_ZT_FILE_PREVIEW_TEST ||
|
17
|
+
var ZT_FILE_PREVIEW_TEST = processObj.REACT_APP_ZT_FILE_PREVIEW_TEST ||
|
18
|
+
'http://preview-test.zmdms.com.cn:30079'; // 测试环境 http://172.55.5.101:33013
|
18
19
|
var ZT_FILE_PREVIEW_STAGE = processObj.REACT_APP_ZT_FILE_PREVIEW_STAGE ||
|
19
|
-
'
|
20
|
+
'http://preview-stage.zmdms.com.cn:30079'; // 阶段性环境 https://dzfile-prod.zmd.com.cn/
|
20
21
|
var ZT_FILE_PREVIEW_SIM = processObj.REACT_APP_ZT_FILE_PREVIEW_SIM ||
|
21
22
|
'https://dzfile-data.zmd.com.cn/'; // 阶段性环境 http://192.168.0.134:8012
|
22
23
|
var ZT_FILE_PREVIEW_PRODUCT = processObj.REACT_APP_ZT_FILE_PREVIEW_PRODUCT ||
|
package/dist/reqUrl.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export { g as getReqUrl } from './reqUrl-
|
1
|
+
export { g as getReqUrl } from './reqUrl-ea7ef876.js';
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { a as __rest, _ as __assign } from './tslib.es6-35653116.js';
|
2
|
+
import instance from './i18next.js';
|
2
3
|
import axios from 'axios';
|
3
4
|
import { Modal, message } from 'ztxkui';
|
4
5
|
import { c as commonjsGlobal, a as crypto } from './crypto-c481f616.js';
|
@@ -2452,7 +2453,7 @@ var AxiosCancel = /** @class */ (function () {
|
|
2452
2453
|
// 将token挂载到当前接口的请求头里面
|
2453
2454
|
config.cancelToken = cancelTokenObj.token;
|
2454
2455
|
if (this.pendingRequests.has(key)) {
|
2455
|
-
this.pendingRequests.get(key).cancel('拦截重复请求');
|
2456
|
+
this.pendingRequests.get(key).cancel(instance.t('拦截重复请求'));
|
2456
2457
|
this.pendingRequests.delete(key);
|
2457
2458
|
}
|
2458
2459
|
this.pendingRequests.set(key, {
|
@@ -2512,7 +2513,7 @@ function checkStatus(response, jumpCallback, otherOptions) {
|
|
2512
2513
|
refreshTokenRequst(jumpCallback, InnerAuthorization);
|
2513
2514
|
}
|
2514
2515
|
else {
|
2515
|
-
message.info(
|
2516
|
+
message.info(instance.t('刷新token遭到频繁调用,请联系管理员查看是否接口权限出现问题,可能是{{slot0}}接口出现问题', { slot0: response === null || response === void 0 ? void 0 : response.config.url }), 5);
|
2516
2517
|
requestTokenEndTime = 0;
|
2517
2518
|
}
|
2518
2519
|
}
|
@@ -2560,6 +2561,7 @@ function refreshTokenRequst(jumpCallback, Authorization) {
|
|
2560
2561
|
// 刷新成功 重置token 重置refresh-token
|
2561
2562
|
setToken(data === null || data === void 0 ? void 0 : data.access_token);
|
2562
2563
|
setRefreshToken(data === null || data === void 0 ? void 0 : data.refresh_token);
|
2564
|
+
message.info(instance.t('token已经刷新成功,请重新提交!', {}));
|
2563
2565
|
onAccessTokenFetched();
|
2564
2566
|
isRefreshing = true;
|
2565
2567
|
}
|
@@ -2573,7 +2575,7 @@ function refreshTokenRequst(jumpCallback, Authorization) {
|
|
2573
2575
|
jumpCallback(401);
|
2574
2576
|
}
|
2575
2577
|
else {
|
2576
|
-
message.info(
|
2578
|
+
message.info(instance.t('登录过期!', {}), 3.5, function () {
|
2577
2579
|
isExpiration = false;
|
2578
2580
|
});
|
2579
2581
|
window.location.href = '/login';
|
@@ -2589,7 +2591,7 @@ function refreshTokenRequst(jumpCallback, Authorization) {
|
|
2589
2591
|
jumpCallback(401);
|
2590
2592
|
}
|
2591
2593
|
else {
|
2592
|
-
message.info(
|
2594
|
+
message.info(instance.t('登录过期!', {}), 3.5, function () {
|
2593
2595
|
isExpiration = false;
|
2594
2596
|
});
|
2595
2597
|
window.location.href = '/login';
|
@@ -2665,7 +2667,11 @@ function setInterceptorsResponse(jumpCallback, otherOptions) {
|
|
2665
2667
|
__isTimeoutMessage) {
|
2666
2668
|
isMessage = true;
|
2667
2669
|
Modal.confirm({
|
2668
|
-
title:
|
2670
|
+
title: instance.t('请求超时,请稍后再试,请去列表确认数据是否插入成功,请勿重复提交! 接口地址:{{slot0}} 请求方式:{{slot1}} 请求超时时间:{{slot2}}', {
|
2671
|
+
slot0: (_d = error === null || error === void 0 ? void 0 : error.config) === null || _d === void 0 ? void 0 : _d.url,
|
2672
|
+
slot1: (_e = error === null || error === void 0 ? void 0 : error.config) === null || _e === void 0 ? void 0 : _e.method,
|
2673
|
+
slot2: (_f = error === null || error === void 0 ? void 0 : error.config) === null || _f === void 0 ? void 0 : _f.timeout,
|
2674
|
+
}),
|
2669
2675
|
okCancel: false,
|
2670
2676
|
onOk: function () {
|
2671
2677
|
isMessage = false;
|
@@ -2679,7 +2685,7 @@ function setInterceptorsResponse(jumpCallback, otherOptions) {
|
|
2679
2685
|
if ((errRes === null || errRes === void 0 ? void 0 : errRes.status) === 404) {
|
2680
2686
|
if (!isNotFound) {
|
2681
2687
|
isNotFound = true;
|
2682
|
-
message.info(
|
2688
|
+
message.info(instance.t('接口: {{slot0}} 未找到!', { slot0: errRes.config.url }), 3.5, function () {
|
2683
2689
|
isNotFound = false;
|
2684
2690
|
});
|
2685
2691
|
}
|
@@ -2695,7 +2701,7 @@ function setInterceptorsResponse(jumpCallback, otherOptions) {
|
|
2695
2701
|
jumpCallback(errRes === null || errRes === void 0 ? void 0 : errRes.status);
|
2696
2702
|
}
|
2697
2703
|
else {
|
2698
|
-
message.info(
|
2704
|
+
message.info(instance.t('你的账号已在其他地方登录!', {}), 3.5, function () {
|
2699
2705
|
isOffSite = false;
|
2700
2706
|
});
|
2701
2707
|
window.location.href = '/login';
|
@@ -2713,7 +2719,7 @@ function setInterceptorsResponse(jumpCallback, otherOptions) {
|
|
2713
2719
|
jumpCallback(errRes === null || errRes === void 0 ? void 0 : errRes.status);
|
2714
2720
|
}
|
2715
2721
|
else {
|
2716
|
-
message.info(
|
2722
|
+
message.info(instance.t('登录过期!', {}), 3.5, function () {
|
2717
2723
|
isExpiration = false;
|
2718
2724
|
});
|
2719
2725
|
window.location.href = '/login';
|
@@ -2793,6 +2799,8 @@ function request(myOptions, jumpCallback, otherOptions) {
|
|
2793
2799
|
'Zmdms-Auth': "bearer " + token,
|
2794
2800
|
'Tenant-Id': '000000',
|
2795
2801
|
Authorization: InnerAuthorization ? InnerAuthorization : Authorization,
|
2802
|
+
// 设置语言包请求头
|
2803
|
+
'Zmdms-Lang': window.localStorage.getItem('languageType') || 'zh_CN',
|
2796
2804
|
},
|
2797
2805
|
};
|
2798
2806
|
if ((_a = options.baseURL) === null || _a === void 0 ? void 0 : _a.endsWith('/')) {
|
package/dist/request.js
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
import './tslib.es6-35653116.js';
|
2
|
+
import './i18next.js';
|
2
3
|
import 'axios';
|
3
4
|
import 'ztxkui';
|
4
|
-
export { N as NEW_AUTHORIZATION, O as OLD_AUTHORIZATION, d as clearAutonomousCatch, b as clearCatch, c as clearNoCompleteRequest, a as default } from './request-
|
5
|
+
export { N as NEW_AUTHORIZATION, O as OLD_AUTHORIZATION, d as clearAutonomousCatch, b as clearCatch, c as clearNoCompleteRequest, a as default } from './request-40e9ca7b.js';
|
5
6
|
import './authority-7a91cb9f.js';
|
6
7
|
import './crypto-c481f616.js';
|
7
8
|
import 'crypto';
|
package/dist/stompClient.js
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import instance from './i18next.js';
|
1
2
|
import Stomp from 'zt-stompjs';
|
2
3
|
import SockJS from 'zt-sockjs-client';
|
3
4
|
import { g as getToken } from './authority-7a91cb9f.js';
|
@@ -58,18 +59,22 @@ var StompClient = /** @class */ (function () {
|
|
58
59
|
this.clearIsClient = setTimeout(function () {
|
59
60
|
_this.clearIsClient = null;
|
60
61
|
if (!_this.isClient) {
|
61
|
-
console.log(
|
62
|
+
console.log(instance.t('连接已发起,但是10秒后未成功建立连接,手动断开重连!system={{slot0}}', { slot0: _this.connectWsConfig.systemType }));
|
62
63
|
try {
|
63
64
|
_this.client.disconnect(function () {
|
64
65
|
_this.client = null;
|
65
66
|
});
|
66
67
|
}
|
67
68
|
catch (err) {
|
68
|
-
console.log('---连接未建立的关闭出错---', err);
|
69
|
+
console.log(instance.t('---连接未建立的关闭出错---'), err);
|
69
70
|
}
|
70
71
|
_this.reconnectionNum++;
|
71
72
|
var timeInterval = _this.getReconnectionTime();
|
72
|
-
console.log(
|
73
|
+
console.log(instance.t('---第{{slot0}}次重连!time={{slot1}}system={{slot2}}---', {
|
74
|
+
slot0: _this.reconnectionNum,
|
75
|
+
slot1: Date.now(),
|
76
|
+
slot2: _this.connectWsConfig.systemType,
|
77
|
+
}));
|
73
78
|
if (_this.clearIsClientNo) {
|
74
79
|
clearTimeout(_this.clearIsClientNo);
|
75
80
|
_this.clearIsClientNo = null;
|
@@ -112,7 +117,11 @@ var StompClient = /** @class */ (function () {
|
|
112
117
|
_this.clearIsClientYes = null;
|
113
118
|
}
|
114
119
|
_this.reconnectionNum = 0;
|
115
|
-
console.log(
|
120
|
+
console.log(instance.t('---------连接成功 time={{slot0}} system={{slot1}} time={{slot2}}--------', {
|
121
|
+
slot0: Date.now(),
|
122
|
+
slot1: _this.connectWsConfig.systemType,
|
123
|
+
slot2: Date.now(),
|
124
|
+
}));
|
116
125
|
// 连接成功后,将当前已注册的,未执行的 连接通道 连接
|
117
126
|
var subscriptionsFnKeys = Object.keys(_this.subscriptionsFn);
|
118
127
|
if (Array.isArray(subscriptionsFnKeys)) {
|
@@ -145,7 +154,7 @@ var StompClient = /** @class */ (function () {
|
|
145
154
|
},
|
146
155
|
// 连接失败回调
|
147
156
|
function (err) {
|
148
|
-
console.log(
|
157
|
+
console.log(instance.t('---------连接失败 system={{slot0}} time={{slot1}}--------', { slot0: _this.connectWsConfig.systemType, slot1: Date.now() }));
|
149
158
|
console.log(err);
|
150
159
|
if (_this.userClose) {
|
151
160
|
_this.userClose = false; // 重新初始化 重新计算
|
@@ -161,7 +170,7 @@ var StompClient = /** @class */ (function () {
|
|
161
170
|
clearTimeout(_this.clearIsClientYes);
|
162
171
|
_this.clearIsClientYes = null;
|
163
172
|
}
|
164
|
-
console.log('用户主动关闭');
|
173
|
+
console.log(instance.t('用户主动关闭'));
|
165
174
|
return;
|
166
175
|
}
|
167
176
|
_this.isClient = true;
|
@@ -211,14 +220,18 @@ var StompClient = /** @class */ (function () {
|
|
211
220
|
});
|
212
221
|
}
|
213
222
|
catch (err) {
|
214
|
-
console.log(
|
223
|
+
console.log(instance.t('---连接已建立的关闭出错 time={{slot0}}system={{slot1}}---', { slot0: Date.now(), slot1: _this.connectWsConfig.systemType }), err);
|
215
224
|
}
|
216
225
|
_this.reconnectionNum++;
|
217
226
|
// const timeInterval =
|
218
227
|
// Math.ceil(this.reconnectionNum / 5) *
|
219
228
|
// (this.connectWsConfig.reconnectionTime ?? 3000);
|
220
229
|
var timeInterval = _this.getReconnectionTime();
|
221
|
-
console.log(
|
230
|
+
console.log(instance.t('---第{{slot0}}次重连!time={{slot1}}system={{slot2}}', {
|
231
|
+
slot0: _this.reconnectionNum,
|
232
|
+
slot1: Date.now(),
|
233
|
+
slot2: _this.connectWsConfig.systemType,
|
234
|
+
}));
|
222
235
|
_this.clearIsClientYes = setTimeout(function () {
|
223
236
|
_this.init();
|
224
237
|
}, timeInterval > _this.maxReconnectiontime
|
package/dist/useHistory.js
CHANGED
@@ -126,6 +126,13 @@ function setSession(name, value) {
|
|
126
126
|
sessionStorage.setItem(name, value);
|
127
127
|
}
|
128
128
|
function getSession(name) {
|
129
|
+
// 这里有两种场景需要处理:
|
130
|
+
// 1. 从统一门户单点到流程中心,流程中心嵌入的表单是不需要权限控制的。
|
131
|
+
// 因为这里认为,既然待办到了某人那里,那么这个路由的不管某人是否有权限,都需要能够查看。
|
132
|
+
// 2. 第二种情况,就是到了流程这里后,再跳转到其他页面的权限控制。
|
133
|
+
// 这里认为,跟流程表单关联的页面都不应该做权限控制。因为是跟流程相关的。
|
134
|
+
// 处理第一个问题的解决方案是:流程中心会通过iframe传递一个标识给子应用,子应用来设置一些逻辑。
|
135
|
+
// 处理第二个问题的解决方案是:通过opener来获取来源地址,来源地址如果是正确的,那么也应该权限通过。
|
129
136
|
if (window.opener && Object.getOwnPropertyNames(window.opener).length > 0) {
|
130
137
|
// let v = ROUTER_FILTER_RULES_VALUE;
|
131
138
|
// try {
|
@@ -1,3 +1,5 @@
|
|
1
|
+
import instance from './i18next.js';
|
2
|
+
|
1
3
|
/**
|
2
4
|
* @description 常用正则表达式
|
3
5
|
*/
|
@@ -23,7 +25,10 @@ var validate = {
|
|
23
25
|
*/
|
24
26
|
// phoneValidate: /^1(3\d|4\d|5\d|6\d|7\d|8\d|9\d)\d{8}$/,
|
25
27
|
// 数字 横线 长度 0 - 15位/^([0-9])|(\-)*$/
|
28
|
+
// /^[0-9\-]{0,15}$/ 老版
|
29
|
+
// /^(?:\+?\d{1,20})$/g
|
26
30
|
phoneValidate: /^[0-9\-]{0,15}$/,
|
31
|
+
abroadPhoneValidate: /^(?:\+?\d{1,20})$/g,
|
27
32
|
/**
|
28
33
|
* @description 短信验证码 接受11位手机号
|
29
34
|
*/
|
@@ -50,26 +55,26 @@ var validate = {
|
|
50
55
|
var commonMessage = {
|
51
56
|
smallLenMessage: function (type) {
|
52
57
|
if (type === void 0) { type = ''; }
|
53
|
-
return type
|
58
|
+
return instance.t('{{type}}超过最大字符长度200', { type: type });
|
54
59
|
},
|
55
60
|
middleLenMessage: function (type) {
|
56
61
|
if (type === void 0) { type = ''; }
|
57
|
-
return type
|
62
|
+
return instance.t('{{type}}超过最大字符长度400', { type: type });
|
58
63
|
},
|
59
64
|
largeLenMessage: function (type) {
|
60
65
|
if (type === void 0) { type = ''; }
|
61
|
-
return type
|
66
|
+
return instance.t('{{type}}超过最大字符长度600', { type: type });
|
62
67
|
},
|
63
68
|
maxlargeLenValidate: function (type) {
|
64
69
|
if (type === void 0) { type = ''; }
|
65
|
-
return type
|
70
|
+
return instance.t('{{type}}超过最大字符长度5000', { type: type });
|
66
71
|
},
|
67
|
-
phoneMessage: '请输入正确的手机号',
|
68
|
-
idCardMessage: '请输入正确的身份证',
|
69
|
-
emailMessage: '请输入正确的邮箱',
|
72
|
+
phoneMessage: instance.t('请输入正确的手机号'),
|
73
|
+
idCardMessage: instance.t('请输入正确的身份证'),
|
74
|
+
emailMessage: instance.t('请输入正确的邮箱'),
|
70
75
|
// passwordMessage: '密码由8-16位的字母+数字,字母+特殊字符,数字+特殊字符组成',
|
71
|
-
passwordMessage: '密码必须包含大小写字母、数字、特殊字符且最小长度为8,且不能出现连续数字或字符,不能出现相同字符,且禁止使用用户账号作为密码',
|
72
|
-
spaceMessage: '请勿输入空格',
|
76
|
+
passwordMessage: instance.t('密码必须包含大小写字母、数字、特殊字符且最小长度为8,且不能出现连续数字或字符,不能出现相同字符,且禁止使用用户账号作为密码'),
|
77
|
+
spaceMessage: instance.t('请勿输入空格'),
|
73
78
|
};
|
74
79
|
var alphabet1 = [
|
75
80
|
'abcdefghijklmnopqrstuvwxyz',
|
@@ -98,14 +103,14 @@ function validatePassword(password, username) {
|
|
98
103
|
if (!regex.test(password)) {
|
99
104
|
return {
|
100
105
|
result: false,
|
101
|
-
message: '密码中必须包含大小写字母、数字、特殊字符,且长度必须大于8个字符!',
|
106
|
+
message: instance.t('密码中必须包含大小写字母、数字、特殊字符,且长度必须大于8个字符!'),
|
102
107
|
};
|
103
108
|
}
|
104
109
|
// 检查密码是否与用户名相同
|
105
110
|
if (password === username) {
|
106
111
|
return {
|
107
112
|
result: false,
|
108
|
-
message: '密码与用户名相同!',
|
113
|
+
message: instance.t('密码与用户名相同!'),
|
109
114
|
};
|
110
115
|
}
|
111
116
|
// 检查密码中是否有相同且连续的字符 超过三次
|
@@ -116,7 +121,7 @@ function validatePassword(password, username) {
|
|
116
121
|
if (count1 >= 2) {
|
117
122
|
return {
|
118
123
|
result: false,
|
119
|
-
message: '密码中有相同且连续超过三次的字符!',
|
124
|
+
message: instance.t('密码中有相同且连续超过三次的字符!'),
|
120
125
|
};
|
121
126
|
}
|
122
127
|
}
|
@@ -146,7 +151,10 @@ function validatePassword(password, username) {
|
|
146
151
|
// 密码中不应含有连续的字母或数字
|
147
152
|
return {
|
148
153
|
result: false,
|
149
|
-
message:
|
154
|
+
message: instance.t('从第{{slot0}}个字符开始,有连续{{slot1}}超过三位的字母或数字!', {
|
155
|
+
slot0: startChart + 1,
|
156
|
+
slot1: currentConsecutiveCount === 1 ? '递减' : '递增',
|
157
|
+
}),
|
150
158
|
};
|
151
159
|
}
|
152
160
|
}
|
@@ -181,7 +189,10 @@ function validatePassword(password, username) {
|
|
181
189
|
// 密码中不应含有连续的字母或数字
|
182
190
|
return {
|
183
191
|
result: false,
|
184
|
-
message:
|
192
|
+
message: instance.t('从第{{slot0}}个字符开始,有按键盘横向连续{{slot1}}超过三位的字母!', {
|
193
|
+
slot0: startChart + 1,
|
194
|
+
slot1: currentConsecutiveCount === 1 ? '递减' : '递增',
|
195
|
+
}),
|
185
196
|
};
|
186
197
|
}
|
187
198
|
}
|
@@ -216,7 +227,10 @@ function validatePassword(password, username) {
|
|
216
227
|
// 密码中不应含有连续的字母或数字
|
217
228
|
return {
|
218
229
|
result: false,
|
219
|
-
message:
|
230
|
+
message: instance.t('从第{{slot0}}个字符开始,有按键盘竖向连续{{slot1}}超过三位的字母或数字!', {
|
231
|
+
slot0: startChart + 1,
|
232
|
+
slot1: currentConsecutiveCount === 1 ? '递减' : '递增',
|
233
|
+
}),
|
220
234
|
};
|
221
235
|
}
|
222
236
|
}
|
package/dist/validate.d.ts
CHANGED
package/dist/validate.js
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
import './i18next.js';
|
2
|
+
export { c as commonMessage, b as validate, a as validatePassword } from './validate-2138d94a.js';
|
package/dist/workflow.js
CHANGED
@@ -1,12 +1,10 @@
|
|
1
|
+
import instance from './i18next.js';
|
1
2
|
import { useEffect } from 'react';
|
2
3
|
import { g as getUrlSearch } from './tools-390e3466.js';
|
3
4
|
import { WORKFLOW_HIDEFRAME_KEY } from './constants.js';
|
4
5
|
import './tslib.es6-35653116.js';
|
5
6
|
import 'dayjs';
|
6
7
|
|
7
|
-
/**
|
8
|
-
* @description 审批工作流相关操作
|
9
|
-
*/
|
10
8
|
/**
|
11
9
|
* @description 通过iframe双向通信逻辑
|
12
10
|
*/
|
@@ -14,7 +12,7 @@ function useOnmessage(messageFn, isDebugger) {
|
|
14
12
|
useEffect(function () {
|
15
13
|
var messageHandle = function (e) {
|
16
14
|
if (isDebugger) {
|
17
|
-
console.log('父页面传递过来的消息', e);
|
15
|
+
console.log(instance.t('父页面传递过来的消息'), e);
|
18
16
|
}
|
19
17
|
var messageData = {};
|
20
18
|
try {
|
@@ -22,7 +20,7 @@ function useOnmessage(messageFn, isDebugger) {
|
|
22
20
|
}
|
23
21
|
catch (err) {
|
24
22
|
if (isDebugger) {
|
25
|
-
console.log('父页面传递过来的消息解析报错', err);
|
23
|
+
console.log(instance.t('父页面传递过来的消息解析报错'), err);
|
26
24
|
}
|
27
25
|
}
|
28
26
|
messageFn && messageFn(messageData);
|
@@ -0,0 +1,64 @@
|
|
1
|
+
{
|
2
|
+
"拦截重复请求": "拦截重复请求",
|
3
|
+
"切换将清空已选数据!": "切换将清空已选数据!",
|
4
|
+
"确认": "确认",
|
5
|
+
"取消": "取消",
|
6
|
+
"数据请求成功": "数据请求成功",
|
7
|
+
"数据请求失败": "数据请求失败",
|
8
|
+
"必须传入获取Ws长连接的方法": "必须传入获取Ws长连接的方法",
|
9
|
+
"获取ws链接地址失败!": "获取ws链接地址失败!",
|
10
|
+
"获取ws地址失败!": "获取ws地址失败!",
|
11
|
+
"浏览器不支持WebSocket": "浏览器不支持WebSocket",
|
12
|
+
"连接建立": "连接建立",
|
13
|
+
"识别结果:": "识别结果:",
|
14
|
+
"ws连接出错了!": "ws连接出错了!",
|
15
|
+
"连接异常": "连接异常",
|
16
|
+
"连接关闭": "连接关闭",
|
17
|
+
"你没有引入路由相关API,请引入!": "你没有引入路由相关API,请引入!",
|
18
|
+
"握手成功": "握手成功",
|
19
|
+
"收到讯飞的语音提示": "收到讯飞的语音提示",
|
20
|
+
"出错了:": "出错了:",
|
21
|
+
"连接出错了": "连接出错了",
|
22
|
+
"收到录音的最后帧!": "收到录音的最后帧!",
|
23
|
+
"你没有传入 获取指令的接口,这将导致错误!": "你没有传入 获取指令的接口,这将导致错误!",
|
24
|
+
"不支持处理该指令,请重说!": "不支持处理该指令,请重说!",
|
25
|
+
"{{slot0}} 第{{slot1}}行{{title}} {{slot2}}": "{{slot0}} 第{{slot1}}行{{title}} {{slot2}}",
|
26
|
+
"{{slot0}} 第{{slot1}}行{{title}}为空!": "{{slot0}} 第{{slot1}}行{{title}}为空!",
|
27
|
+
"中文": "中文",
|
28
|
+
"英文": "英文",
|
29
|
+
"数据库打开成功": "数据库打开成功",
|
30
|
+
"数据库打开报错!": "数据库打开报错!",
|
31
|
+
"浙商中拓": "浙商中拓",
|
32
|
+
"{{slot0}} 微软雅黑": "{{slot0}} 微软雅黑",
|
33
|
+
"刷新token遭到频繁调用,请联系管理员查看是否接口权限出现问题,可能是{{slot0}}接口出现问题": "刷新token遭到频繁调用,请联系管理员查看是否接口权限出现问题,可能是{{slot0}}接口出现问题",
|
34
|
+
"token已经刷新成功,请重新提交!": "token已经刷新成功,请重新提交!",
|
35
|
+
"登录过期!": "登录过期!",
|
36
|
+
"请求超时,请稍后再试,请去列表确认数据是否插入成功,请勿重复提交! 接口地址:{{slot0}} 请求方式:{{slot1}} 请求超时时间:{{slot2}}": "请求超时,请稍后再试,请去列表确认数据是否插入成功,请勿重复提交! 接口地址:{{slot0}} 请求方式:{{slot1}} 请求超时时间:{{slot2}}",
|
37
|
+
"接口: {{slot0}} 未找到!": "接口: {{slot0}} 未找到!",
|
38
|
+
"你的账号已在其他地方登录!": "你的账号已在其他地方登录!",
|
39
|
+
"连接已发起,但是10秒后未成功建立连接,手动断开重连!system={{slot0}}": "连接已发起,但是10秒后未成功建立连接,手动断开重连!system={{slot0}}",
|
40
|
+
"---连接未建立的关闭出错---": "---连接未建立的关闭出错---",
|
41
|
+
"---第{{slot0}}次重连!time={{slot1}}system={{slot2}}---": "---第{{slot0}}次重连!time={{slot1}}system={{slot2}}---",
|
42
|
+
"---------连接成功 time={{slot0}} system={{slot1}} time={{slot2}}--------": "---------连接成功 time={{slot0}} system={{slot1}} time={{slot2}}--------",
|
43
|
+
"---------连接失败 system={{slot0}} time={{slot1}}--------": "---------连接失败 system={{slot0}} time={{slot1}}--------",
|
44
|
+
"用户主动关闭": "用户主动关闭",
|
45
|
+
"---连接已建立的关闭出错 time={{slot0}}system={{slot1}}---": "---连接已建立的关闭出错 time={{slot0}}system={{slot1}}---",
|
46
|
+
"---第{{slot0}}次重连!time={{slot1}}system={{slot2}}": "---第{{slot0}}次重连!time={{slot1}}system={{slot2}}",
|
47
|
+
"{{type}}超过最大字符长度200": "{{type}}超过最大字符长度200",
|
48
|
+
"{{type}}超过最大字符长度400": "{{type}}超过最大字符长度400",
|
49
|
+
"{{type}}超过最大字符长度600": "{{type}}超过最大字符长度600",
|
50
|
+
"{{type}}超过最大字符长度5000": "{{type}}超过最大字符长度5000",
|
51
|
+
"请输入正确的手机号": "请输入正确的手机号",
|
52
|
+
"请输入正确的身份证": "请输入正确的身份证",
|
53
|
+
"请输入正确的邮箱": "请输入正确的邮箱",
|
54
|
+
"密码必须包含大小写字母、数字、特殊字符且最小长度为8,且不能出现连续数字或字符,不能出现相同字符,且禁止使用用户账号作为密码": "密码必须包含大小写字母、数字、特殊字符且最小长度为8,且不能出现连续数字或字符,不能出现相同字符,且禁止使用用户账号作为密码",
|
55
|
+
"请勿输入空格": "请勿输入空格",
|
56
|
+
"密码中必须包含大小写字母、数字、特殊字符,且长度必须大于8个字符!": "密码中必须包含大小写字母、数字、特殊字符,且长度必须大于8个字符!",
|
57
|
+
"密码与用户名相同!": "密码与用户名相同!",
|
58
|
+
"密码中有相同且连续超过三次的字符!": "密码中有相同且连续超过三次的字符!",
|
59
|
+
"从第{{slot0}}个字符开始,有连续{{slot1}}超过三位的字母或数字!": "从第{{slot0}}个字符开始,有连续{{slot1}}超过三位的字母或数字!",
|
60
|
+
"从第{{slot0}}个字符开始,有按键盘横向连续{{slot1}}超过三位的字母!": "从第{{slot0}}个字符开始,有按键盘横向连续{{slot1}}超过三位的字母!",
|
61
|
+
"从第{{slot0}}个字符开始,有按键盘竖向连续{{slot1}}超过三位的字母或数字!": "从第{{slot0}}个字符开始,有按键盘竖向连续{{slot1}}超过三位的字母或数字!",
|
62
|
+
"父页面传递过来的消息": "父页面传递过来的消息",
|
63
|
+
"父页面传递过来的消息解析报错": "父页面传递过来的消息解析报错"
|
64
|
+
}
|
@@ -0,0 +1,64 @@
|
|
1
|
+
{
|
2
|
+
"拦截重复请求": "拦截重复请求",
|
3
|
+
"切换将清空已选数据!": "切换将清空已选数据!",
|
4
|
+
"确认": "确认",
|
5
|
+
"取消": "取消",
|
6
|
+
"数据请求成功": "数据请求成功",
|
7
|
+
"数据请求失败": "数据请求失败",
|
8
|
+
"必须传入获取Ws长连接的方法": "必须传入获取Ws长连接的方法",
|
9
|
+
"获取ws链接地址失败!": "获取ws链接地址失败!",
|
10
|
+
"获取ws地址失败!": "获取ws地址失败!",
|
11
|
+
"浏览器不支持WebSocket": "浏览器不支持WebSocket",
|
12
|
+
"连接建立": "连接建立",
|
13
|
+
"识别结果:": "识别结果:",
|
14
|
+
"ws连接出错了!": "ws连接出错了!",
|
15
|
+
"连接异常": "连接异常",
|
16
|
+
"连接关闭": "连接关闭",
|
17
|
+
"你没有引入路由相关API,请引入!": "你没有引入路由相关API,请引入!",
|
18
|
+
"握手成功": "握手成功",
|
19
|
+
"收到讯飞的语音提示": "收到讯飞的语音提示",
|
20
|
+
"出错了:": "出错了:",
|
21
|
+
"连接出错了": "连接出错了",
|
22
|
+
"收到录音的最后帧!": "收到录音的最后帧!",
|
23
|
+
"你没有传入 获取指令的接口,这将导致错误!": "你没有传入 获取指令的接口,这将导致错误!",
|
24
|
+
"不支持处理该指令,请重说!": "不支持处理该指令,请重说!",
|
25
|
+
"{{slot0}} 第{{slot1}}行{{title}} {{slot2}}": "{{slot0}} 第{{slot1}}行{{title}} {{slot2}}",
|
26
|
+
"{{slot0}} 第{{slot1}}行{{title}}为空!": "{{slot0}} 第{{slot1}}行{{title}}为空!",
|
27
|
+
"中文": "中文",
|
28
|
+
"英文": "英文",
|
29
|
+
"数据库打开成功": "数据库打开成功",
|
30
|
+
"数据库打开报错!": "数据库打开报错!",
|
31
|
+
"浙商中拓": "浙商中拓",
|
32
|
+
"{{slot0}} 微软雅黑": "{{slot0}} 微软雅黑",
|
33
|
+
"刷新token遭到频繁调用,请联系管理员查看是否接口权限出现问题,可能是{{slot0}}接口出现问题": "刷新token遭到频繁调用,请联系管理员查看是否接口权限出现问题,可能是{{slot0}}接口出现问题",
|
34
|
+
"token已经刷新成功,请重新提交!": "token已经刷新成功,请重新提交!",
|
35
|
+
"登录过期!": "登录过期!",
|
36
|
+
"请求超时,请稍后再试,请去列表确认数据是否插入成功,请勿重复提交! 接口地址:{{slot0}} 请求方式:{{slot1}} 请求超时时间:{{slot2}}": "请求超时,请稍后再试,请去列表确认数据是否插入成功,请勿重复提交! 接口地址:{{slot0}} 请求方式:{{slot1}} 请求超时时间:{{slot2}}",
|
37
|
+
"接口: {{slot0}} 未找到!": "接口: {{slot0}} 未找到!",
|
38
|
+
"你的账号已在其他地方登录!": "你的账号已在其他地方登录!",
|
39
|
+
"连接已发起,但是10秒后未成功建立连接,手动断开重连!system={{slot0}}": "连接已发起,但是10秒后未成功建立连接,手动断开重连!system={{slot0}}",
|
40
|
+
"---连接未建立的关闭出错---": "---连接未建立的关闭出错---",
|
41
|
+
"---第{{slot0}}次重连!time={{slot1}}system={{slot2}}---": "---第{{slot0}}次重连!time={{slot1}}system={{slot2}}---",
|
42
|
+
"---------连接成功 time={{slot0}} system={{slot1}} time={{slot2}}--------": "---------连接成功 time={{slot0}} system={{slot1}} time={{slot2}}--------",
|
43
|
+
"---------连接失败 system={{slot0}} time={{slot1}}--------": "---------连接失败 system={{slot0}} time={{slot1}}--------",
|
44
|
+
"用户主动关闭": "用户主动关闭",
|
45
|
+
"---连接已建立的关闭出错 time={{slot0}}system={{slot1}}---": "---连接已建立的关闭出错 time={{slot0}}system={{slot1}}---",
|
46
|
+
"---第{{slot0}}次重连!time={{slot1}}system={{slot2}}": "---第{{slot0}}次重连!time={{slot1}}system={{slot2}}",
|
47
|
+
"{{type}}超过最大字符长度200": "{{type}}超过最大字符长度200",
|
48
|
+
"{{type}}超过最大字符长度400": "{{type}}超过最大字符长度400",
|
49
|
+
"{{type}}超过最大字符长度600": "{{type}}超过最大字符长度600",
|
50
|
+
"{{type}}超过最大字符长度5000": "{{type}}超过最大字符长度5000",
|
51
|
+
"请输入正确的手机号": "请输入正确的手机号",
|
52
|
+
"请输入正确的身份证": "请输入正确的身份证",
|
53
|
+
"请输入正确的邮箱": "请输入正确的邮箱",
|
54
|
+
"密码必须包含大小写字母、数字、特殊字符且最小长度为8,且不能出现连续数字或字符,不能出现相同字符,且禁止使用用户账号作为密码": "密码必须包含大小写字母、数字、特殊字符且最小长度为8,且不能出现连续数字或字符,不能出现相同字符,且禁止使用用户账号作为密码",
|
55
|
+
"请勿输入空格": "请勿输入空格",
|
56
|
+
"密码中必须包含大小写字母、数字、特殊字符,且长度必须大于8个字符!": "密码中必须包含大小写字母、数字、特殊字符,且长度必须大于8个字符!",
|
57
|
+
"密码与用户名相同!": "密码与用户名相同!",
|
58
|
+
"密码中有相同且连续超过三次的字符!": "密码中有相同且连续超过三次的字符!",
|
59
|
+
"从第{{slot0}}个字符开始,有连续{{slot1}}超过三位的字母或数字!": "从第{{slot0}}个字符开始,有连续{{slot1}}超过三位的字母或数字!",
|
60
|
+
"从第{{slot0}}个字符开始,有按键盘横向连续{{slot1}}超过三位的字母!": "从第{{slot0}}个字符开始,有按键盘横向连续{{slot1}}超过三位的字母!",
|
61
|
+
"从第{{slot0}}个字符开始,有按键盘竖向连续{{slot1}}超过三位的字母或数字!": "从第{{slot0}}个字符开始,有按键盘竖向连续{{slot1}}超过三位的字母或数字!",
|
62
|
+
"父页面传递过来的消息": "父页面传递过来的消息",
|
63
|
+
"父页面传递过来的消息解析报错": "父页面传递过来的消息解析报错"
|
64
|
+
}
|