ztxkutils 2.0.9 → 2.1.3

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.
@@ -19,6 +19,6 @@ interface IColumns {
19
19
  * @description 表格验证相关操作
20
20
  */
21
21
  declare function useTableValidate(records: any, columns: IColumns[], tableName?: string): {
22
- tableValidate: () => Promise<any>;
22
+ tableValidate: () => Promise<void>;
23
23
  };
24
24
  export default useTableValidate;
package/dist/hooks.js CHANGED
@@ -113,7 +113,9 @@ function useTableValidate(records, columns, tableName) {
113
113
  if (!validate) return [3 /*break*/, 7];
114
114
  if (!(typeof validate === 'function')) return [3 /*break*/, 4];
115
115
  return [4 /*yield*/, validate(value, item, i + 1, title)];
116
- case 3: return [2 /*return*/, _c.sent()];
116
+ case 3:
117
+ _c.sent();
118
+ return [3 /*break*/, 6];
117
119
  case 4:
118
120
  if (!!((_b = validate.pattern) === null || _b === void 0 ? void 0 : _b.test(value))) return [3 /*break*/, 6];
119
121
  return [4 /*yield*/, Promise.reject({
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export { c as authority } from './authority-17b7fde2.js';
2
2
  export { d as dataModel } from './dataModel-1fbaff40.js';
3
3
  export { t as tools } from './tools-49b33116.js';
4
- export { v as validate } from './validate-743d8f98.js';
4
+ export { v as validate } from './validate-8cbc61e4.js';
5
5
  export { r as request } from './request-74ca7860.js';
6
6
  export { r as reqUrl } from './reqUrl-68c864fb.js';
7
7
  import './tslib.es6-b9033aad.js';
@@ -3,6 +3,7 @@ interface IConnectWsConfig {
3
3
  userId: string;
4
4
  clientType: string | number;
5
5
  systemType?: string;
6
+ token?: string;
6
7
  debug?: boolean;
7
8
  heartbeat?: {
8
9
  outgoing?: number;
@@ -17,7 +17,7 @@ var StompClient = /** @class */ (function () {
17
17
  var _this = this;
18
18
  var _a, _b, _c, _d;
19
19
  this.isInit = true;
20
- var token = getToken();
20
+ var token = this.connectWsConfig.token || getToken();
21
21
  // 建立连接对象,还未发起连接
22
22
  var socket = new SockJS(this.connectWsConfig.baseUrl + "/api/zmdms-csc-ztim/ws?token=" + token + "&system=" + this.connectWsConfig.systemType + "&clientType=" + this.connectWsConfig.clientType);
23
23
  // 获取 STOMP 子协议的客户端对象
@@ -170,6 +170,7 @@ var StompClient = /** @class */ (function () {
170
170
  this.isInit = false;
171
171
  return new Promise(function (resolve, reject) {
172
172
  _this.client.disconnect(function () {
173
+ _this.client = null;
173
174
  callback && callback();
174
175
  resolve(null);
175
176
  });
@@ -0,0 +1,60 @@
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 电话号码验证
19
+ */
20
+ phoneValidate: /^1(3\d|4\d|5\d|6\d|7\d|8\d|9\d)\d{8}$/,
21
+ /**
22
+ * @description 身份证验证
23
+ * 18位 最后一位可以是X x
24
+ */
25
+ 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]$/,
26
+ /**
27
+ * @description 邮箱验证
28
+ */
29
+ emailValidate: /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/,
30
+ /**
31
+ * @description 密码验证
32
+ */
33
+ passwordValidate: /^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&*]+$)([a-zA-Z\d!@#$%^&*]+){9,128}$/,
34
+ };
35
+ var commonMessage = {
36
+ smallLenMessage: function (type) {
37
+ if (type === void 0) { type = ''; }
38
+ return type + "\u8D85\u8FC7\u6700\u5927\u5B57\u7B26\u957F\u5EA6200";
39
+ },
40
+ middleLenMessage: function (type) {
41
+ if (type === void 0) { type = ''; }
42
+ return type + "\u8D85\u8FC7\u6700\u5927\u5B57\u7B26\u957F\u5EA6400";
43
+ },
44
+ largeLenMessage: function (type) {
45
+ if (type === void 0) { type = ''; }
46
+ return type + "\u8D85\u8FC7\u6700\u5927\u5B57\u7B26\u957F\u5EA6600";
47
+ },
48
+ phoneMessage: '请输入正确的手机号',
49
+ idCardMessage: '请输入正确的身份证',
50
+ emailMessage: '请输入正确的邮箱',
51
+ passwordMessage: '由9-128位的字母+数字,字母+特殊字符,数字+特殊字符组成',
52
+ };
53
+
54
+ var validate$1 = /*#__PURE__*/Object.freeze({
55
+ __proto__: null,
56
+ validate: validate,
57
+ commonMessage: commonMessage
58
+ });
59
+
60
+ export { validate as a, commonMessage as c, validate$1 as v };
@@ -0,0 +1,60 @@
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 电话号码验证
19
+ */
20
+ phoneValidate: /^1[0-9]{10}$/,
21
+ /**
22
+ * @description 身份证验证
23
+ * 18位 最后一位可以是X x
24
+ */
25
+ 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]$/,
26
+ /**
27
+ * @description 邮箱验证
28
+ */
29
+ emailValidate: /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/,
30
+ /**
31
+ * @description 密码验证
32
+ */
33
+ passwordValidate: /^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&*]+$)([a-zA-Z\d!@#$%^&*]+){9,128}$/,
34
+ };
35
+ var commonMessage = {
36
+ smallLenMessage: function (type) {
37
+ if (type === void 0) { type = ''; }
38
+ return type + "\u8D85\u8FC7\u6700\u5927\u5B57\u7B26\u957F\u5EA6200";
39
+ },
40
+ middleLenMessage: function (type) {
41
+ if (type === void 0) { type = ''; }
42
+ return type + "\u8D85\u8FC7\u6700\u5927\u5B57\u7B26\u957F\u5EA6400";
43
+ },
44
+ largeLenMessage: function (type) {
45
+ if (type === void 0) { type = ''; }
46
+ return type + "\u8D85\u8FC7\u6700\u5927\u5B57\u7B26\u957F\u5EA6600";
47
+ },
48
+ phoneMessage: '请输入正确的手机号',
49
+ idCardMessage: '请输入正确的身份证',
50
+ emailMessage: '请输入正确的邮箱',
51
+ passwordMessage: '由9-128位的字母+数字,字母+特殊字符,数字+特殊字符组成',
52
+ };
53
+
54
+ var validate$1 = /*#__PURE__*/Object.freeze({
55
+ __proto__: null,
56
+ validate: validate,
57
+ commonMessage: commonMessage
58
+ });
59
+
60
+ export { validate as a, commonMessage as c, validate$1 as v };
package/dist/validate.js CHANGED
@@ -1 +1 @@
1
- export { c as commonMessage, a as validate } from './validate-743d8f98.js';
1
+ export { c as commonMessage, a as validate } from './validate-8cbc61e4.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkutils",
3
- "version": "2.0.9",
3
+ "version": "2.1.3",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",