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.
Files changed (63) hide show
  1. package/dist/businessTools.js +4 -3
  2. package/dist/{dataModel-1fbaff40.js → dataModel-f1ef06bc.js} +4 -2
  3. package/dist/dataModel.js +2 -1
  4. package/dist/fileOperation.d.ts +19 -0
  5. package/dist/fileOperation.js +60 -18
  6. package/dist/hooks.js +34 -22
  7. package/dist/i18next.d.ts +2 -0
  8. package/dist/i18next.js +2401 -0
  9. package/dist/index.js +5 -4
  10. package/dist/myIndexDb.d.ts +1 -1
  11. package/dist/print.d.ts +2 -4
  12. package/dist/print.js +3 -2
  13. package/dist/{reqUrl-22b880a4.js → reqUrl-ea7ef876.js} +3 -2
  14. package/dist/reqUrl.js +1 -1
  15. package/dist/{request-87d93572.js → request-40e9ca7b.js} +16 -8
  16. package/dist/request.js +2 -1
  17. package/dist/stompClient.js +21 -8
  18. package/dist/useHistory.js +7 -0
  19. package/dist/{validate-18e52490.js → validate-2138d94a.js} +29 -15
  20. package/dist/validate.d.ts +1 -0
  21. package/dist/validate.js +2 -1
  22. package/dist/workflow.js +3 -5
  23. package/locales/en-US.json +64 -0
  24. package/locales/zh-CN.json +64 -0
  25. package/package.json +112 -75
  26. package/zti18n-cli/bin/index.js +3 -0
  27. package/zti18n-cli/index.js +23 -0
  28. package/zti18n-cli/src/command/collect.js +353 -0
  29. package/zti18n-cli/src/command/convert.js +17 -0
  30. package/zti18n-cli/src/command/convert2.js +35 -0
  31. package/zti18n-cli/src/command/initFileConf.js +133 -0
  32. package/zti18n-cli/src/command/publish.js +24 -0
  33. package/zti18n-cli/src/conf/BaseConf.js +21 -0
  34. package/zti18n-cli/src/conf/FileConf.js +116 -0
  35. package/zti18n-cli/src/index.js +75 -0
  36. package/zti18n-cli/src/translate/google.js +87 -0
  37. package/zti18n-cli/src/utils/isChinese.js +3 -0
  38. package/zti18n-cli/src/utils/log.js +8 -0
  39. package/zti18n-cli/src/utils/mergeOptions.js +45 -0
  40. package/zti18n-cli/src/utils/reactOptions.js +73 -0
  41. package/zti18n-cli/src/utils/vueOptions.js +69 -0
  42. package/zti18n-core/index.js +1 -0
  43. package/zti18n-core/src/index.js +5 -0
  44. package/zti18n-core/src/plugin/reactIntlToReactIntlUniversal.js +224 -0
  45. package/zti18n-core/src/plugin/reactIntlUniversalToDi18n.js +64 -0
  46. package/zti18n-core/src/transform/defaultPkMap.js +79 -0
  47. package/zti18n-core/src/transform/transformHtml.js +271 -0
  48. package/zti18n-core/src/transform/transformJs.js +489 -0
  49. package/zti18n-core/src/transform/transformPug.js +272 -0
  50. package/zti18n-core/src/transform/transformReactIntlToReactIntlUniversal.js +96 -0
  51. package/zti18n-core/src/transform/transformReactIntlUniveralToDi18n.js +90 -0
  52. package/zti18n-core/src/transform/transformToDi18n.js +22 -0
  53. package/zti18n-core/src/transform/transformTs.js +41 -0
  54. package/zti18n-core/src/transform/transformVue.js +126 -0
  55. package/zti18n-core/src/transform/transformZeroToDi18n.js +105 -0
  56. package/zti18n-core/src/translate/google.js +6 -0
  57. package/zti18n-core/src/utils/constants.js +3 -0
  58. package/zti18n-core/src/utils/getIgnoreLines.js +14 -0
  59. package/zti18n-core/src/utils/isChinese.js +3 -0
  60. package/zti18n-core/src/utils/log.js +8 -0
  61. package/dist/request-3c906c2d.js +0 -2913
  62. package/dist/request-dc69f021.js +0 -2972
  63. 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-1fbaff40.js';
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-18e52490.js';
5
- export { r as request } from './request-87d93572.js';
6
- export { r as reqUrl } from './reqUrl-22b880a4.js';
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';
@@ -1 +1 @@
1
- declare function openDB(dbName: string, version?: number): Promise<unknown>;
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
- isAddWater?: boolean;
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') + " \u5FAE\u8F6F\u96C5\u9ED1";
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 || 'http://172.55.5.101:33013'; // 测试环境 https://192.168.0.135:18012
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
- 'https://dzfile-prod.zmd.com.cn/'; // 阶段性环境 http://192.168.0.134:8012
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-22b880a4.js';
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("\u5237\u65B0token\u906D\u5230\u9891\u7E41\u8C03\u7528\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u67E5\u770B\u662F\u5426\u63A5\u53E3\u6743\u9650\u51FA\u73B0\u95EE\u9898\uFF0C\u53EF\u80FD\u662F" + (response === null || response === void 0 ? void 0 : response.config.url) + "\u63A5\u53E3\u51FA\u73B0\u95EE\u9898", 5);
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("\u767B\u5F55\u8FC7\u671F\uFF01", 3.5, function () {
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("\u767B\u5F55\u8FC7\u671F\uFF01", 3.5, function () {
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: "\u8BF7\u6C42\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\uFF0C\u8BF7\u53BB\u5217\u8868\u786E\u8BA4\u6570\u636E\u662F\u5426\u63D2\u5165\u6210\u529F\uFF0C\u8BF7\u52FF\u91CD\u590D\u63D0\u4EA4\uFF01\n\u63A5\u53E3\u5730\u5740:" + ((_d = error === null || error === void 0 ? void 0 : error.config) === null || _d === void 0 ? void 0 : _d.url) + "\n\u8BF7\u6C42\u65B9\u5F0F:" + ((_e = error === null || error === void 0 ? void 0 : error.config) === null || _e === void 0 ? void 0 : _e.method) + "\n\u8BF7\u6C42\u8D85\u65F6\u65F6\u95F4:" + ((_f = error === null || error === void 0 ? void 0 : error.config) === null || _f === void 0 ? void 0 : _f.timeout),
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("\u63A5\u53E3: " + errRes.config.url + " \u672A\u627E\u5230\uFF01", 3.5, function () {
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("\u4F60\u7684\u8D26\u53F7\u5DF2\u5728\u5176\u4ED6\u5730\u65B9\u767B\u5F55\uFF01", 3.5, function () {
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("\u767B\u5F55\u8FC7\u671F\uFF01", 3.5, function () {
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-87d93572.js';
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';
@@ -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("\u8FDE\u63A5\u5DF2\u53D1\u8D77\uFF0C\u4F46\u662F10\u79D2\u540E\u672A\u6210\u529F\u5EFA\u7ACB\u8FDE\u63A5\uFF0C\u624B\u52A8\u65AD\u5F00\u91CD\u8FDE!system=" + _this.connectWsConfig.systemType);
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("---\u7B2C" + _this.reconnectionNum + "\u6B21\u91CD\u8FDE\uFF01time=" + Date.now() + "system=" + _this.connectWsConfig.systemType + "---");
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("---------\u8FDE\u63A5\u6210\u529F time=" + Date.now() + " system=" + _this.connectWsConfig.systemType + " time=" + Date.now() + "--------");
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("---------\u8FDE\u63A5\u5931\u8D25 system=" + _this.connectWsConfig.systemType + " time=" + Date.now() + "--------");
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("---\u8FDE\u63A5\u5DF2\u5EFA\u7ACB\u7684\u5173\u95ED\u51FA\u9519 time=" + Date.now() + "system=" + _this.connectWsConfig.systemType + "---", err);
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("---\u7B2C" + _this.reconnectionNum + "\u6B21\u91CD\u8FDE\uFF01time=" + Date.now() + "system=" + _this.connectWsConfig.systemType);
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
@@ -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 + "\u8D85\u8FC7\u6700\u5927\u5B57\u7B26\u957F\u5EA6200";
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 + "\u8D85\u8FC7\u6700\u5927\u5B57\u7B26\u957F\u5EA6400";
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 + "\u8D85\u8FC7\u6700\u5927\u5B57\u7B26\u957F\u5EA6600";
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 + "\u8D85\u8FC7\u6700\u5927\u5B57\u7B26\u957F\u5EA65000";
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: "\u4ECE\u7B2C" + (startChart + 1) + "\u4E2A\u5B57\u7B26\u5F00\u59CB\uFF0C\u6709\u8FDE\u7EED" + (currentConsecutiveCount === 1 ? '递减' : '递增') + "\u8D85\u8FC7\u4E09\u4F4D\u7684\u5B57\u6BCD\u6216\u6570\u5B57!",
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: "\u4ECE\u7B2C" + (startChart + 1) + "\u4E2A\u5B57\u7B26\u5F00\u59CB\uFF0C\u6709\u6309\u952E\u76D8\u6A2A\u5411\u8FDE\u7EED" + (currentConsecutiveCount === 1 ? '递减' : '递增') + "\u8D85\u8FC7\u4E09\u4F4D\u7684\u5B57\u6BCD!",
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: "\u4ECE\u7B2C" + (startChart + 1) + "\u4E2A\u5B57\u7B26\u5F00\u59CB\uFF0C\u6709\u6309\u952E\u76D8\u7AD6\u5411\u8FDE\u7EED" + (currentConsecutiveCount === 1 ? '递减' : '递增') + "\u8D85\u8FC7\u4E09\u4F4D\u7684\u5B57\u6BCD\u6216\u6570\u5B57!",
230
+ message: instance.t('从第{{slot0}}个字符开始,有按键盘竖向连续{{slot1}}超过三位的字母或数字!', {
231
+ slot0: startChart + 1,
232
+ slot1: currentConsecutiveCount === 1 ? '递减' : '递增',
233
+ }),
220
234
  };
221
235
  }
222
236
  }
@@ -22,6 +22,7 @@ declare const validate: {
22
22
  * @description 电话号码验证
23
23
  */
24
24
  phoneValidate: RegExp;
25
+ abroadPhoneValidate: RegExp;
25
26
  /**
26
27
  * @description 短信验证码 接受11位手机号
27
28
  */
package/dist/validate.js CHANGED
@@ -1 +1,2 @@
1
- export { c as commonMessage, b as validate, a as validatePassword } from './validate-18e52490.js';
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
+ }