eoss-ui 0.5.73 → 0.5.74

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 (54) hide show
  1. package/lib/button-group.js +16 -6
  2. package/lib/button.js +16 -6
  3. package/lib/checkbox-group.js +16 -6
  4. package/lib/clients.js +16 -7
  5. package/lib/data-table-form.js +16 -6
  6. package/lib/data-table.js +16 -6
  7. package/lib/date-picker.js +16 -6
  8. package/lib/dialog.js +16 -6
  9. package/lib/eoss-ui.common.js +176 -82
  10. package/lib/flow-group.js +16 -6
  11. package/lib/flow-list.js +16 -6
  12. package/lib/flow.js +16 -6
  13. package/lib/form.js +16 -6
  14. package/lib/handle-user.js +16 -6
  15. package/lib/handler.js +16 -6
  16. package/lib/index.js +1 -1
  17. package/lib/input-number.js +16 -6
  18. package/lib/input.js +16 -6
  19. package/lib/login.js +24 -14
  20. package/lib/main.js +98 -28
  21. package/lib/nav.js +64 -29
  22. package/lib/page.js +16 -6
  23. package/lib/player.js +16 -6
  24. package/lib/qr-code.js +16 -6
  25. package/lib/radio-group.js +16 -6
  26. package/lib/retrial-auth.js +16 -6
  27. package/lib/select-ganged.js +16 -6
  28. package/lib/select.js +16 -6
  29. package/lib/selector-panel.js +16 -6
  30. package/lib/selector.js +16 -6
  31. package/lib/sizer.js +16 -6
  32. package/lib/steps.js +16 -6
  33. package/lib/switch.js +16 -6
  34. package/lib/table-form.js +16 -6
  35. package/lib/tabs.js +16 -6
  36. package/lib/theme-chalk/index.css +1 -1
  37. package/lib/theme-chalk/nav.css +1 -1
  38. package/lib/tips.js +16 -6
  39. package/lib/tree-group.js +16 -6
  40. package/lib/tree.js +16 -6
  41. package/lib/upload.js +16 -6
  42. package/lib/utils/webSocket.js +16 -6
  43. package/lib/wujie.js +16 -6
  44. package/lib/wxlogin.js +16 -6
  45. package/package.json +1 -1
  46. package/packages/clients/src/main.vue +3 -1
  47. package/packages/login/src/resetPassword.vue +1 -1
  48. package/packages/main/src/main.vue +44 -10
  49. package/packages/nav/src/main.vue +25 -8
  50. package/packages/theme-chalk/lib/index.css +1 -1
  51. package/packages/theme-chalk/lib/nav.css +1 -1
  52. package/packages/theme-chalk/src/nav.scss +4 -1
  53. package/src/index.js +1 -1
  54. package/src/utils/webSocket.js +14 -7
package/lib/flow-list.js CHANGED
@@ -5121,6 +5121,8 @@ var WebSocket = function () {
5121
5121
  this.connects = 1;
5122
5122
  this.recon = false;
5123
5123
  this.sendTimeout = null;
5124
+ this.socket = null;
5125
+ this.subscription = null;
5124
5126
  }
5125
5127
 
5126
5128
  /** socket连接 */
@@ -5131,14 +5133,12 @@ var WebSocket = function () {
5131
5133
 
5132
5134
  if (!this.client) {
5133
5135
  // 连接SockJS
5134
- var socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url);
5135
- // 获取STOMP子协议的客户端对象
5136
- this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(socket);
5136
+ this.socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url, { timeout: 60000 });
5137
+ this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(this.socket);
5137
5138
  }
5138
5139
 
5139
5140
  // 日志不打印
5140
5141
  if (!this.debug) {
5141
- console.log(111);
5142
5142
  this.client.debug = function () {};
5143
5143
  }
5144
5144
 
@@ -5150,9 +5150,10 @@ var WebSocket = function () {
5150
5150
  // 订阅消息
5151
5151
  _this.subscribe();
5152
5152
  }, function (error) {
5153
+ _this.unsubscribe();
5154
+ _this.client = null;
5153
5155
  var diffSecond = parseInt((new Date() - _this.nextDate) / 1000, 10);
5154
5156
  if (_this.connects > 5 && diffSecond < _this.interval) {
5155
- _this.client.disconnect();
5156
5157
  _this.error && _this.error(error);
5157
5158
  } else {
5158
5159
  _this.reconTimeout = setTimeout(function () {
@@ -5161,6 +5162,14 @@ var WebSocket = function () {
5161
5162
  }, 5000);
5162
5163
  }
5163
5164
  });
5165
+ }; // 清除订阅
5166
+
5167
+
5168
+ WebSocket.prototype.unsubscribe = function unsubscribe() {
5169
+ if (this.subscription) {
5170
+ this.subscription.unsubscribe();
5171
+ this.subscription = null;
5172
+ }
5164
5173
  };
5165
5174
  /** 订阅服务端 */
5166
5175
 
@@ -5169,7 +5178,7 @@ var WebSocket = function () {
5169
5178
  var _this2 = this;
5170
5179
 
5171
5180
  // 订阅服务端提供的某个topic
5172
- this.client.subscribe(this.take, function (response) {
5181
+ this.subscription = this.client.subscribe(this.take, function (response) {
5173
5182
  if (response && (_this2.callback || _this2.success)) {
5174
5183
  var callback = _this2.callback || _this2.success;
5175
5184
  callback(JSON.parse(response.body));
@@ -5210,6 +5219,7 @@ var WebSocket = function () {
5210
5219
 
5211
5220
  WebSocket.prototype.destroy = function destroy() {
5212
5221
  // 断开连接,清除定时器
5222
+ this.unsubscribe();
5213
5223
  if (this.client) {
5214
5224
  this.client.disconnect();
5215
5225
  };
package/lib/flow.js CHANGED
@@ -3643,6 +3643,8 @@ var WebSocket = function () {
3643
3643
  this.connects = 1;
3644
3644
  this.recon = false;
3645
3645
  this.sendTimeout = null;
3646
+ this.socket = null;
3647
+ this.subscription = null;
3646
3648
  }
3647
3649
 
3648
3650
  /** socket连接 */
@@ -3653,14 +3655,12 @@ var WebSocket = function () {
3653
3655
 
3654
3656
  if (!this.client) {
3655
3657
  // 连接SockJS
3656
- var socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url);
3657
- // 获取STOMP子协议的客户端对象
3658
- this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(socket);
3658
+ this.socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url, { timeout: 60000 });
3659
+ this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(this.socket);
3659
3660
  }
3660
3661
 
3661
3662
  // 日志不打印
3662
3663
  if (!this.debug) {
3663
- console.log(111);
3664
3664
  this.client.debug = function () {};
3665
3665
  }
3666
3666
 
@@ -3672,9 +3672,10 @@ var WebSocket = function () {
3672
3672
  // 订阅消息
3673
3673
  _this.subscribe();
3674
3674
  }, function (error) {
3675
+ _this.unsubscribe();
3676
+ _this.client = null;
3675
3677
  var diffSecond = parseInt((new Date() - _this.nextDate) / 1000, 10);
3676
3678
  if (_this.connects > 5 && diffSecond < _this.interval) {
3677
- _this.client.disconnect();
3678
3679
  _this.error && _this.error(error);
3679
3680
  } else {
3680
3681
  _this.reconTimeout = setTimeout(function () {
@@ -3683,6 +3684,14 @@ var WebSocket = function () {
3683
3684
  }, 5000);
3684
3685
  }
3685
3686
  });
3687
+ }; // 清除订阅
3688
+
3689
+
3690
+ WebSocket.prototype.unsubscribe = function unsubscribe() {
3691
+ if (this.subscription) {
3692
+ this.subscription.unsubscribe();
3693
+ this.subscription = null;
3694
+ }
3686
3695
  };
3687
3696
  /** 订阅服务端 */
3688
3697
 
@@ -3691,7 +3700,7 @@ var WebSocket = function () {
3691
3700
  var _this2 = this;
3692
3701
 
3693
3702
  // 订阅服务端提供的某个topic
3694
- this.client.subscribe(this.take, function (response) {
3703
+ this.subscription = this.client.subscribe(this.take, function (response) {
3695
3704
  if (response && (_this2.callback || _this2.success)) {
3696
3705
  var callback = _this2.callback || _this2.success;
3697
3706
  callback(JSON.parse(response.body));
@@ -3732,6 +3741,7 @@ var WebSocket = function () {
3732
3741
 
3733
3742
  WebSocket.prototype.destroy = function destroy() {
3734
3743
  // 断开连接,清除定时器
3744
+ this.unsubscribe();
3735
3745
  if (this.client) {
3736
3746
  this.client.disconnect();
3737
3747
  };
package/lib/form.js CHANGED
@@ -3643,6 +3643,8 @@ var WebSocket = function () {
3643
3643
  this.connects = 1;
3644
3644
  this.recon = false;
3645
3645
  this.sendTimeout = null;
3646
+ this.socket = null;
3647
+ this.subscription = null;
3646
3648
  }
3647
3649
 
3648
3650
  /** socket连接 */
@@ -3653,14 +3655,12 @@ var WebSocket = function () {
3653
3655
 
3654
3656
  if (!this.client) {
3655
3657
  // 连接SockJS
3656
- var socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url);
3657
- // 获取STOMP子协议的客户端对象
3658
- this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(socket);
3658
+ this.socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url, { timeout: 60000 });
3659
+ this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(this.socket);
3659
3660
  }
3660
3661
 
3661
3662
  // 日志不打印
3662
3663
  if (!this.debug) {
3663
- console.log(111);
3664
3664
  this.client.debug = function () {};
3665
3665
  }
3666
3666
 
@@ -3672,9 +3672,10 @@ var WebSocket = function () {
3672
3672
  // 订阅消息
3673
3673
  _this.subscribe();
3674
3674
  }, function (error) {
3675
+ _this.unsubscribe();
3676
+ _this.client = null;
3675
3677
  var diffSecond = parseInt((new Date() - _this.nextDate) / 1000, 10);
3676
3678
  if (_this.connects > 5 && diffSecond < _this.interval) {
3677
- _this.client.disconnect();
3678
3679
  _this.error && _this.error(error);
3679
3680
  } else {
3680
3681
  _this.reconTimeout = setTimeout(function () {
@@ -3683,6 +3684,14 @@ var WebSocket = function () {
3683
3684
  }, 5000);
3684
3685
  }
3685
3686
  });
3687
+ }; // 清除订阅
3688
+
3689
+
3690
+ WebSocket.prototype.unsubscribe = function unsubscribe() {
3691
+ if (this.subscription) {
3692
+ this.subscription.unsubscribe();
3693
+ this.subscription = null;
3694
+ }
3686
3695
  };
3687
3696
  /** 订阅服务端 */
3688
3697
 
@@ -3691,7 +3700,7 @@ var WebSocket = function () {
3691
3700
  var _this2 = this;
3692
3701
 
3693
3702
  // 订阅服务端提供的某个topic
3694
- this.client.subscribe(this.take, function (response) {
3703
+ this.subscription = this.client.subscribe(this.take, function (response) {
3695
3704
  if (response && (_this2.callback || _this2.success)) {
3696
3705
  var callback = _this2.callback || _this2.success;
3697
3706
  callback(JSON.parse(response.body));
@@ -3732,6 +3741,7 @@ var WebSocket = function () {
3732
3741
 
3733
3742
  WebSocket.prototype.destroy = function destroy() {
3734
3743
  // 断开连接,清除定时器
3744
+ this.unsubscribe();
3735
3745
  if (this.client) {
3736
3746
  this.client.disconnect();
3737
3747
  };
@@ -3949,6 +3949,8 @@ var WebSocket = function () {
3949
3949
  this.connects = 1;
3950
3950
  this.recon = false;
3951
3951
  this.sendTimeout = null;
3952
+ this.socket = null;
3953
+ this.subscription = null;
3952
3954
  }
3953
3955
 
3954
3956
  /** socket连接 */
@@ -3959,14 +3961,12 @@ var WebSocket = function () {
3959
3961
 
3960
3962
  if (!this.client) {
3961
3963
  // 连接SockJS
3962
- var socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url);
3963
- // 获取STOMP子协议的客户端对象
3964
- this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(socket);
3964
+ this.socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url, { timeout: 60000 });
3965
+ this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(this.socket);
3965
3966
  }
3966
3967
 
3967
3968
  // 日志不打印
3968
3969
  if (!this.debug) {
3969
- console.log(111);
3970
3970
  this.client.debug = function () {};
3971
3971
  }
3972
3972
 
@@ -3978,9 +3978,10 @@ var WebSocket = function () {
3978
3978
  // 订阅消息
3979
3979
  _this.subscribe();
3980
3980
  }, function (error) {
3981
+ _this.unsubscribe();
3982
+ _this.client = null;
3981
3983
  var diffSecond = parseInt((new Date() - _this.nextDate) / 1000, 10);
3982
3984
  if (_this.connects > 5 && diffSecond < _this.interval) {
3983
- _this.client.disconnect();
3984
3985
  _this.error && _this.error(error);
3985
3986
  } else {
3986
3987
  _this.reconTimeout = setTimeout(function () {
@@ -3989,6 +3990,14 @@ var WebSocket = function () {
3989
3990
  }, 5000);
3990
3991
  }
3991
3992
  });
3993
+ }; // 清除订阅
3994
+
3995
+
3996
+ WebSocket.prototype.unsubscribe = function unsubscribe() {
3997
+ if (this.subscription) {
3998
+ this.subscription.unsubscribe();
3999
+ this.subscription = null;
4000
+ }
3992
4001
  };
3993
4002
  /** 订阅服务端 */
3994
4003
 
@@ -3997,7 +4006,7 @@ var WebSocket = function () {
3997
4006
  var _this2 = this;
3998
4007
 
3999
4008
  // 订阅服务端提供的某个topic
4000
- this.client.subscribe(this.take, function (response) {
4009
+ this.subscription = this.client.subscribe(this.take, function (response) {
4001
4010
  if (response && (_this2.callback || _this2.success)) {
4002
4011
  var callback = _this2.callback || _this2.success;
4003
4012
  callback(JSON.parse(response.body));
@@ -4038,6 +4047,7 @@ var WebSocket = function () {
4038
4047
 
4039
4048
  WebSocket.prototype.destroy = function destroy() {
4040
4049
  // 断开连接,清除定时器
4050
+ this.unsubscribe();
4041
4051
  if (this.client) {
4042
4052
  this.client.disconnect();
4043
4053
  };
package/lib/handler.js CHANGED
@@ -4243,6 +4243,8 @@ var WebSocket = function () {
4243
4243
  this.connects = 1;
4244
4244
  this.recon = false;
4245
4245
  this.sendTimeout = null;
4246
+ this.socket = null;
4247
+ this.subscription = null;
4246
4248
  }
4247
4249
 
4248
4250
  /** socket连接 */
@@ -4253,14 +4255,12 @@ var WebSocket = function () {
4253
4255
 
4254
4256
  if (!this.client) {
4255
4257
  // 连接SockJS
4256
- var socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url);
4257
- // 获取STOMP子协议的客户端对象
4258
- this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(socket);
4258
+ this.socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url, { timeout: 60000 });
4259
+ this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(this.socket);
4259
4260
  }
4260
4261
 
4261
4262
  // 日志不打印
4262
4263
  if (!this.debug) {
4263
- console.log(111);
4264
4264
  this.client.debug = function () {};
4265
4265
  }
4266
4266
 
@@ -4272,9 +4272,10 @@ var WebSocket = function () {
4272
4272
  // 订阅消息
4273
4273
  _this.subscribe();
4274
4274
  }, function (error) {
4275
+ _this.unsubscribe();
4276
+ _this.client = null;
4275
4277
  var diffSecond = parseInt((new Date() - _this.nextDate) / 1000, 10);
4276
4278
  if (_this.connects > 5 && diffSecond < _this.interval) {
4277
- _this.client.disconnect();
4278
4279
  _this.error && _this.error(error);
4279
4280
  } else {
4280
4281
  _this.reconTimeout = setTimeout(function () {
@@ -4283,6 +4284,14 @@ var WebSocket = function () {
4283
4284
  }, 5000);
4284
4285
  }
4285
4286
  });
4287
+ }; // 清除订阅
4288
+
4289
+
4290
+ WebSocket.prototype.unsubscribe = function unsubscribe() {
4291
+ if (this.subscription) {
4292
+ this.subscription.unsubscribe();
4293
+ this.subscription = null;
4294
+ }
4286
4295
  };
4287
4296
  /** 订阅服务端 */
4288
4297
 
@@ -4291,7 +4300,7 @@ var WebSocket = function () {
4291
4300
  var _this2 = this;
4292
4301
 
4293
4302
  // 订阅服务端提供的某个topic
4294
- this.client.subscribe(this.take, function (response) {
4303
+ this.subscription = this.client.subscribe(this.take, function (response) {
4295
4304
  if (response && (_this2.callback || _this2.success)) {
4296
4305
  var callback = _this2.callback || _this2.success;
4297
4306
  callback(JSON.parse(response.body));
@@ -4332,6 +4341,7 @@ var WebSocket = function () {
4332
4341
 
4333
4342
  WebSocket.prototype.destroy = function destroy() {
4334
4343
  // 断开连接,清除定时器
4344
+ this.unsubscribe();
4335
4345
  if (this.client) {
4336
4346
  this.client.disconnect();
4337
4347
  };