eoss-ui 0.5.72 → 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 (63) 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 +31 -13
  7. package/lib/date-picker.js +16 -6
  8. package/lib/dialog.js +16 -6
  9. package/lib/eoss-ui.common.js +252 -115
  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 +128 -40
  21. package/lib/menu.js +3 -0
  22. package/lib/nav.js +73 -25
  23. package/lib/page.js +16 -6
  24. package/lib/player.js +16 -6
  25. package/lib/qr-code.js +16 -6
  26. package/lib/radio-group.js +16 -6
  27. package/lib/retrial-auth.js +16 -6
  28. package/lib/select-ganged.js +16 -6
  29. package/lib/select.js +17 -6
  30. package/lib/selector-panel.js +16 -6
  31. package/lib/selector.js +19 -9
  32. package/lib/sizer.js +16 -6
  33. package/lib/steps.js +16 -6
  34. package/lib/switch.js +16 -6
  35. package/lib/table-form.js +16 -6
  36. package/lib/tabs.js +16 -6
  37. package/lib/theme-chalk/index.css +1 -1
  38. package/lib/theme-chalk/main.css +1 -1
  39. package/lib/theme-chalk/nav.css +1 -1
  40. package/lib/tips.js +16 -6
  41. package/lib/tree-group.js +16 -6
  42. package/lib/tree.js +19 -9
  43. package/lib/upload.js +16 -6
  44. package/lib/utils/webSocket.js +16 -6
  45. package/lib/wujie.js +16 -6
  46. package/lib/wxlogin.js +16 -6
  47. package/package.json +2 -2
  48. package/packages/clients/src/main.vue +3 -1
  49. package/packages/data-table/src/main.vue +9 -7
  50. package/packages/login/src/resetPassword.vue +1 -1
  51. package/packages/main/src/main.vue +53 -14
  52. package/packages/menu/src/main.vue +3 -0
  53. package/packages/nav/src/main.vue +37 -8
  54. package/packages/select/src/main.vue +1 -0
  55. package/packages/selector/src/main.vue +1 -1
  56. package/packages/theme-chalk/lib/index.css +1 -1
  57. package/packages/theme-chalk/lib/main.css +1 -1
  58. package/packages/theme-chalk/lib/nav.css +1 -1
  59. package/packages/theme-chalk/src/main.scss +3 -1
  60. package/packages/theme-chalk/src/nav.scss +4 -1
  61. package/packages/tree/src/main.vue +1 -1
  62. package/src/index.js +1 -1
  63. package/src/utils/webSocket.js +14 -7
@@ -4196,6 +4196,8 @@ var WebSocket = function () {
4196
4196
  this.connects = 1;
4197
4197
  this.recon = false;
4198
4198
  this.sendTimeout = null;
4199
+ this.socket = null;
4200
+ this.subscription = null;
4199
4201
  }
4200
4202
 
4201
4203
  /** socket连接 */
@@ -4206,14 +4208,12 @@ var WebSocket = function () {
4206
4208
 
4207
4209
  if (!this.client) {
4208
4210
  // 连接SockJS
4209
- var socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url);
4210
- // 获取STOMP子协议的客户端对象
4211
- this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(socket);
4211
+ this.socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url, { timeout: 60000 });
4212
+ this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(this.socket);
4212
4213
  }
4213
4214
 
4214
4215
  // 日志不打印
4215
4216
  if (!this.debug) {
4216
- console.log(111);
4217
4217
  this.client.debug = function () {};
4218
4218
  }
4219
4219
 
@@ -4225,9 +4225,10 @@ var WebSocket = function () {
4225
4225
  // 订阅消息
4226
4226
  _this.subscribe();
4227
4227
  }, function (error) {
4228
+ _this.unsubscribe();
4229
+ _this.client = null;
4228
4230
  var diffSecond = parseInt((new Date() - _this.nextDate) / 1000, 10);
4229
4231
  if (_this.connects > 5 && diffSecond < _this.interval) {
4230
- _this.client.disconnect();
4231
4232
  _this.error && _this.error(error);
4232
4233
  } else {
4233
4234
  _this.reconTimeout = setTimeout(function () {
@@ -4236,6 +4237,14 @@ var WebSocket = function () {
4236
4237
  }, 5000);
4237
4238
  }
4238
4239
  });
4240
+ }; // 清除订阅
4241
+
4242
+
4243
+ WebSocket.prototype.unsubscribe = function unsubscribe() {
4244
+ if (this.subscription) {
4245
+ this.subscription.unsubscribe();
4246
+ this.subscription = null;
4247
+ }
4239
4248
  };
4240
4249
  /** 订阅服务端 */
4241
4250
 
@@ -4244,7 +4253,7 @@ var WebSocket = function () {
4244
4253
  var _this2 = this;
4245
4254
 
4246
4255
  // 订阅服务端提供的某个topic
4247
- this.client.subscribe(this.take, function (response) {
4256
+ this.subscription = this.client.subscribe(this.take, function (response) {
4248
4257
  if (response && (_this2.callback || _this2.success)) {
4249
4258
  var callback = _this2.callback || _this2.success;
4250
4259
  callback(JSON.parse(response.body));
@@ -4285,6 +4294,7 @@ var WebSocket = function () {
4285
4294
 
4286
4295
  WebSocket.prototype.destroy = function destroy() {
4287
4296
  // 断开连接,清除定时器
4297
+ this.unsubscribe();
4288
4298
  if (this.client) {
4289
4299
  this.client.disconnect();
4290
4300
  };
package/lib/button.js CHANGED
@@ -3658,6 +3658,8 @@ var WebSocket = function () {
3658
3658
  this.connects = 1;
3659
3659
  this.recon = false;
3660
3660
  this.sendTimeout = null;
3661
+ this.socket = null;
3662
+ this.subscription = null;
3661
3663
  }
3662
3664
 
3663
3665
  /** socket连接 */
@@ -3668,14 +3670,12 @@ var WebSocket = function () {
3668
3670
 
3669
3671
  if (!this.client) {
3670
3672
  // 连接SockJS
3671
- var socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url);
3672
- // 获取STOMP子协议的客户端对象
3673
- this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(socket);
3673
+ this.socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url, { timeout: 60000 });
3674
+ this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(this.socket);
3674
3675
  }
3675
3676
 
3676
3677
  // 日志不打印
3677
3678
  if (!this.debug) {
3678
- console.log(111);
3679
3679
  this.client.debug = function () {};
3680
3680
  }
3681
3681
 
@@ -3687,9 +3687,10 @@ var WebSocket = function () {
3687
3687
  // 订阅消息
3688
3688
  _this.subscribe();
3689
3689
  }, function (error) {
3690
+ _this.unsubscribe();
3691
+ _this.client = null;
3690
3692
  var diffSecond = parseInt((new Date() - _this.nextDate) / 1000, 10);
3691
3693
  if (_this.connects > 5 && diffSecond < _this.interval) {
3692
- _this.client.disconnect();
3693
3694
  _this.error && _this.error(error);
3694
3695
  } else {
3695
3696
  _this.reconTimeout = setTimeout(function () {
@@ -3698,6 +3699,14 @@ var WebSocket = function () {
3698
3699
  }, 5000);
3699
3700
  }
3700
3701
  });
3702
+ }; // 清除订阅
3703
+
3704
+
3705
+ WebSocket.prototype.unsubscribe = function unsubscribe() {
3706
+ if (this.subscription) {
3707
+ this.subscription.unsubscribe();
3708
+ this.subscription = null;
3709
+ }
3701
3710
  };
3702
3711
  /** 订阅服务端 */
3703
3712
 
@@ -3706,7 +3715,7 @@ var WebSocket = function () {
3706
3715
  var _this2 = this;
3707
3716
 
3708
3717
  // 订阅服务端提供的某个topic
3709
- this.client.subscribe(this.take, function (response) {
3718
+ this.subscription = this.client.subscribe(this.take, function (response) {
3710
3719
  if (response && (_this2.callback || _this2.success)) {
3711
3720
  var callback = _this2.callback || _this2.success;
3712
3721
  callback(JSON.parse(response.body));
@@ -3747,6 +3756,7 @@ var WebSocket = function () {
3747
3756
 
3748
3757
  WebSocket.prototype.destroy = function destroy() {
3749
3758
  // 断开连接,清除定时器
3759
+ this.unsubscribe();
3750
3760
  if (this.client) {
3751
3761
  this.client.disconnect();
3752
3762
  };
@@ -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/clients.js CHANGED
@@ -199,7 +199,7 @@ function normalizeComponent(
199
199
  // ESM COMPAT FLAG
200
200
  __webpack_require__.r(__webpack_exports__);
201
201
 
202
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/clients/src/main.vue?vue&type=template&id=2f0c03c7&
202
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/clients/src/main.vue?vue&type=template&id=12fa73ca&
203
203
  var render = function () {
204
204
  var _vm = this
205
205
  var _h = _vm.$createElement
@@ -208,11 +208,18 @@ var render = function () {
208
208
  _vm.logo
209
209
  ? _c("img", { staticClass: "es-clients-logo", attrs: { src: _vm.logo } })
210
210
  : _vm._e(),
211
- _c("div", { staticClass: "es-clients-title" }, [
212
- _vm._v(
213
- "\n 请通过手机浏览器(iOS11版本以上的苹果手机使用照相功能)扫码下载安装\n "
214
- ),
215
- ]),
211
+ _c(
212
+ "div",
213
+ { staticClass: "es-clients-title" },
214
+ [
215
+ _vm._v("\n 请通过手机浏览器\n "),
216
+ _vm.ios
217
+ ? [_vm._v(" (iOS11版本以上的苹果手机使用照相功能) ")]
218
+ : _vm._e(),
219
+ _vm._v("\n 扫码下载安装\n "),
220
+ ],
221
+ 2
222
+ ),
216
223
  _c("ul", { staticClass: "es-clients-list" }, [
217
224
  _vm.ios
218
225
  ? _c(
@@ -325,7 +332,7 @@ var staticRenderFns = [
325
332
  render._withStripped = true
326
333
 
327
334
 
328
- // CONCATENATED MODULE: ./packages/clients/src/main.vue?vue&type=template&id=2f0c03c7&
335
+ // CONCATENATED MODULE: ./packages/clients/src/main.vue?vue&type=template&id=12fa73ca&
329
336
 
330
337
  // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/clients/src/main.vue?vue&type=script&lang=js&
331
338
  var _props;
@@ -373,6 +380,8 @@ var _props;
373
380
  //
374
381
  //
375
382
  //
383
+ //
384
+ //
376
385
 
377
386
  //import util from 'eoss-ui/src/utils/util';
378
387
  /* harmony default export */ var mainvue_type_script_lang_js_ = ({
@@ -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/data-table.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
  };
@@ -3816,8 +3826,8 @@ module.exports = require("vue");
3816
3826
  // ESM COMPAT FLAG
3817
3827
  __webpack_require__.r(__webpack_exports__);
3818
3828
 
3819
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/data-table/src/main.vue?vue&type=template&id=f4b01d22&
3820
- var mainvue_type_template_id_f4b01d22_render = function () {
3829
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/data-table/src/main.vue?vue&type=template&id=7b641b60&
3830
+ var mainvue_type_template_id_7b641b60_render = function () {
3821
3831
  var _vm = this
3822
3832
  var _h = _vm.$createElement
3823
3833
  var _c = _vm._self._c || _h
@@ -4128,10 +4138,10 @@ var mainvue_type_template_id_f4b01d22_render = function () {
4128
4138
  )
4129
4139
  }
4130
4140
  var staticRenderFns = []
4131
- mainvue_type_template_id_f4b01d22_render._withStripped = true
4141
+ mainvue_type_template_id_7b641b60_render._withStripped = true
4132
4142
 
4133
4143
 
4134
- // CONCATENATED MODULE: ./packages/data-table/src/main.vue?vue&type=template&id=f4b01d22&
4144
+ // CONCATENATED MODULE: ./packages/data-table/src/main.vue?vue&type=template&id=7b641b60&
4135
4145
 
4136
4146
  // EXTERNAL MODULE: ./src/config/api.js
4137
4147
  var api = __webpack_require__(1);
@@ -6633,8 +6643,8 @@ var mainvue_type_script_lang_js_components, _watch;
6633
6643
  if (this.list && this.list.length) {
6634
6644
  return this.list;
6635
6645
  }
6636
- if (this.page && this.data && this.data.length && this.config.totalCount < this.data.length + 2) {
6637
- this.config.totalCount = this.data.length - this.lose;
6646
+ this.config.totalCount = this.data.length - this.lose;
6647
+ if (this.page && this.data.length > this.config.pageSize) {
6638
6648
  return this.data.filter(function (item, index) {
6639
6649
  return index > (_this.config.pageNum - 1) * _this.config.pageSize - 1 && index < _this.config.pageNum * _this.config.pageSize;
6640
6650
  });
@@ -6699,6 +6709,14 @@ var mainvue_type_script_lang_js_components, _watch;
6699
6709
  this.resetHeight();
6700
6710
  this.doLayout();
6701
6711
  },
6712
+
6713
+ // data: {
6714
+ // immediate: true,
6715
+ // deep: true,
6716
+ // handler(val) {
6717
+ // this.config.totalCount = val.length - this.lose;
6718
+ // }
6719
+ // },
6702
6720
  page: function page() {
6703
6721
  this.resetHeight();
6704
6722
  this.doLayout();
@@ -7571,7 +7589,7 @@ var mainvue_type_script_lang_js_components, _watch;
7571
7589
 
7572
7590
  var main_component = Object(componentNormalizer["a" /* default */])(
7573
7591
  src_mainvue_type_script_lang_js_,
7574
- mainvue_type_template_id_f4b01d22_render,
7592
+ mainvue_type_template_id_7b641b60_render,
7575
7593
  staticRenderFns,
7576
7594
  false,
7577
7595
  null,
@@ -3658,6 +3658,8 @@ var WebSocket = function () {
3658
3658
  this.connects = 1;
3659
3659
  this.recon = false;
3660
3660
  this.sendTimeout = null;
3661
+ this.socket = null;
3662
+ this.subscription = null;
3661
3663
  }
3662
3664
 
3663
3665
  /** socket连接 */
@@ -3668,14 +3670,12 @@ var WebSocket = function () {
3668
3670
 
3669
3671
  if (!this.client) {
3670
3672
  // 连接SockJS
3671
- var socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url);
3672
- // 获取STOMP子协议的客户端对象
3673
- this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(socket);
3673
+ this.socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url, { timeout: 60000 });
3674
+ this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(this.socket);
3674
3675
  }
3675
3676
 
3676
3677
  // 日志不打印
3677
3678
  if (!this.debug) {
3678
- console.log(111);
3679
3679
  this.client.debug = function () {};
3680
3680
  }
3681
3681
 
@@ -3687,9 +3687,10 @@ var WebSocket = function () {
3687
3687
  // 订阅消息
3688
3688
  _this.subscribe();
3689
3689
  }, function (error) {
3690
+ _this.unsubscribe();
3691
+ _this.client = null;
3690
3692
  var diffSecond = parseInt((new Date() - _this.nextDate) / 1000, 10);
3691
3693
  if (_this.connects > 5 && diffSecond < _this.interval) {
3692
- _this.client.disconnect();
3693
3694
  _this.error && _this.error(error);
3694
3695
  } else {
3695
3696
  _this.reconTimeout = setTimeout(function () {
@@ -3698,6 +3699,14 @@ var WebSocket = function () {
3698
3699
  }, 5000);
3699
3700
  }
3700
3701
  });
3702
+ }; // 清除订阅
3703
+
3704
+
3705
+ WebSocket.prototype.unsubscribe = function unsubscribe() {
3706
+ if (this.subscription) {
3707
+ this.subscription.unsubscribe();
3708
+ this.subscription = null;
3709
+ }
3701
3710
  };
3702
3711
  /** 订阅服务端 */
3703
3712
 
@@ -3706,7 +3715,7 @@ var WebSocket = function () {
3706
3715
  var _this2 = this;
3707
3716
 
3708
3717
  // 订阅服务端提供的某个topic
3709
- this.client.subscribe(this.take, function (response) {
3718
+ this.subscription = this.client.subscribe(this.take, function (response) {
3710
3719
  if (response && (_this2.callback || _this2.success)) {
3711
3720
  var callback = _this2.callback || _this2.success;
3712
3721
  callback(JSON.parse(response.body));
@@ -3747,6 +3756,7 @@ var WebSocket = function () {
3747
3756
 
3748
3757
  WebSocket.prototype.destroy = function destroy() {
3749
3758
  // 断开连接,清除定时器
3759
+ this.unsubscribe();
3750
3760
  if (this.client) {
3751
3761
  this.client.disconnect();
3752
3762
  };
package/lib/dialog.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
  };