eoss-ui 0.5.11 → 0.5.13

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 (76) hide show
  1. package/lib/button-group.js +215 -123
  2. package/lib/button.js +154 -74
  3. package/lib/card.js +2 -2
  4. package/lib/cascader.js +2 -2
  5. package/lib/checkbox-group.js +154 -75
  6. package/lib/clients.js +2 -2
  7. package/lib/data-table-form.js +154 -75
  8. package/lib/data-table.js +192 -99
  9. package/lib/date-picker.js +159 -79
  10. package/lib/dialog.js +163 -84
  11. package/lib/enterprise.js +2 -2
  12. package/lib/eoss-ui.common.js +357 -219
  13. package/lib/error-page.js +2 -2
  14. package/lib/flow-group.js +154 -74
  15. package/lib/flow-list.js +189 -84
  16. package/lib/flow.js +215 -119
  17. package/lib/form.js +247 -152
  18. package/lib/handle-user.js +155 -75
  19. package/lib/handler.js +154 -74
  20. package/lib/icons.js +4 -4
  21. package/lib/index.js +1 -1
  22. package/lib/input-number.js +154 -74
  23. package/lib/input.js +156 -76
  24. package/lib/label.js +5 -4
  25. package/lib/layout.js +4 -4
  26. package/lib/login.js +157 -78
  27. package/lib/main.js +203 -122
  28. package/lib/menu.js +2 -2
  29. package/lib/nav.js +154 -74
  30. package/lib/notify.js +2 -2
  31. package/lib/page.js +154 -74
  32. package/lib/pagination.js +2 -2
  33. package/lib/player.js +160 -80
  34. package/lib/qr-code.js +156 -76
  35. package/lib/radio-group.js +155 -75
  36. package/lib/retrial-auth.js +154 -74
  37. package/lib/select-ganged.js +154 -74
  38. package/lib/select.js +155 -75
  39. package/lib/selector-panel.js +155 -76
  40. package/lib/selector.js +156 -76
  41. package/lib/sizer.js +156 -76
  42. package/lib/steps.js +154 -74
  43. package/lib/switch.js +154 -74
  44. package/lib/table-form.js +156 -76
  45. package/lib/tabs-panel.js +2 -2
  46. package/lib/tabs.js +159 -79
  47. package/lib/theme-chalk/index.css +1 -1
  48. package/lib/theme-chalk/nav.css +1 -1
  49. package/lib/tips.js +154 -74
  50. package/lib/toolbar.js +2 -2
  51. package/lib/tree-group.js +154 -74
  52. package/lib/tree.js +154 -74
  53. package/lib/upload.js +157 -78
  54. package/lib/utils/util.js +8 -61
  55. package/lib/utils/webSocket.js +131 -0
  56. package/lib/wujie.js +154 -74
  57. package/lib/wxlogin.js +154 -74
  58. package/package.json +1 -1
  59. package/packages/data-table/src/column copy.vue +977 -0
  60. package/packages/data-table/src/main copy.vue +1325 -0
  61. package/packages/data-table/src/main.vue +31 -8
  62. package/packages/data-table/src/sizer.vue +1 -1
  63. package/packages/flow/src/component/taskUnionExamine.vue +1 -1
  64. package/packages/flow/src/main.vue +3 -1
  65. package/packages/flow/src/processForm.vue +24 -10
  66. package/packages/flow/src/processReject.vue +1 -1
  67. package/packages/flow/src/startTaskRead.vue +1 -1
  68. package/packages/flow-list/src/main.vue +25 -2
  69. package/packages/label/src/main.vue +3 -2
  70. package/packages/main/src/main.vue +19 -18
  71. package/packages/theme-chalk/lib/index.css +1 -1
  72. package/packages/theme-chalk/lib/nav.css +1 -1
  73. package/packages/theme-chalk/src/nav.scss +21 -2
  74. package/src/index.js +1 -1
  75. package/src/utils/util.js +29 -81
  76. package/src/utils/webSocket.js +100 -0
@@ -1 +1 @@
1
- @charset "UTF-8";.es-nav,.es-nav .es-nav-main{display:inline-block;overflow:hidden}.es-nav{transition:all .2s;-webkit-transition:all .2s}.es-nav .el-menu,.es-nav .es-menu{background-color:transparent}.es-nav .es-nav-main{position:relative;height:100%;background-color:#002766;border-right:1px solid #d9d9d9}.es-nav .es-nav-main .es-nav-title{width:100%;height:45px;font-size:16px;line-height:44px;text-align:center;overflow:hidden;padding-right:32px;background-color:#096dd9;color:#fff;position:relative;z-index:1;-webkit-box-shadow:0 4px 10px 0 rgba(0,0,0,.2);box-shadow:0 4px 10px 0 rgba(0,0,0,.2)}.es-nav .es-nav-main .es-nav-title .es-collapse-handle{font-size:20px;cursor:pointer;position:absolute;right:12px;top:50%;margin-top:-10px;color:#fff}.es-nav .es-nav-main .es-nav-title .es-collapse-handle.es-icon-zengjiasuojinliang{right:50%;margin-right:-10px}.es-nav .es-nav-initial{width:70px;-webkit-box-shadow:0 6px 30px 5px rgba(0,0,0,.05),0 16px 24px 2px rgba(0,0,0,.04),0 8px 10px -5px rgba(0,0,0,.08);box-shadow:0 6px 30px 5px rgba(0,0,0,.05),0 16px 24px 2px rgba(0,0,0,.04),0 8px 10px -5px rgba(0,0,0,.08);position:relative;z-index:2;height:100%;background:#003a8c}.es-nav .es-nav-initial .el-menu-item,.es-nav .es-nav-initial .es-menu-vertical{height:auto}.es-nav .es-nav-initial .el-menu-item.is-active,.es-nav .es-nav-initial .es-menu-vertical.is-active{background:#096dd9}.es-nav.es-nav-biserial{position:relative}.es-nav.es-nav-biserial .es-nav-main{position:absolute;left:70px;top:0;bottom:0}.es-nav.es-nav-biserial .es-menu-title-vertical{margin-right:0}
1
+ @charset "UTF-8";.es-nav,.es-nav .es-nav-main{display:inline-block;overflow:hidden}.es-nav{transition:all .2s;-webkit-transition:all .2s}.es-nav .el-menu,.es-nav .es-menu{background-color:transparent}.es-nav .es-nav-main{position:relative;height:100%;background-color:#002766;border-right:1px solid #d9d9d9}.es-nav .es-nav-main .es-nav-title{width:100%;height:45px;font-size:15px;line-height:30px;text-align:center;overflow:hidden;padding:7px 32px 7px 0;background-color:#096dd9;color:#fff;position:relative;z-index:1;-webkit-box-shadow:0 4px 10px 0 rgba(0,0,0,.2);box-shadow:0 4px 10px 0 rgba(0,0,0,.2)}.es-nav .es-nav-main .es-nav-title .es-collapse-handle{font-size:20px;cursor:pointer;position:absolute;right:12px;top:50%;margin-top:-10px;color:#fff}.es-nav .es-nav-main .es-nav-title .es-collapse-handle.es-icon-zengjiasuojinliang{right:50%;margin-right:-10px}.es-nav .es-nav-main .es-nav-title .el-tooltip{text-align:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;position:relative;padding:0 4px}.es-nav .es-nav-main .es-nav-title .el-tooltip.es-nav-title-filter{padding-right:10px;cursor:pointer}.es-nav .es-nav-main .es-nav-title .el-tooltip.es-nav-title-filter .el-icon--right{position:absolute;right:6px;top:50%;margin-top:-4px}.es-nav .es-nav-initial{width:70px;-webkit-box-shadow:0 6px 30px 5px rgba(0,0,0,.05),0 16px 24px 2px rgba(0,0,0,.04),0 8px 10px -5px rgba(0,0,0,.08);box-shadow:0 6px 30px 5px rgba(0,0,0,.05),0 16px 24px 2px rgba(0,0,0,.04),0 8px 10px -5px rgba(0,0,0,.08);position:relative;z-index:2;height:100%;background:#003a8c}.es-nav .es-nav-initial .el-menu-item,.es-nav .es-nav-initial .es-menu-vertical{height:auto}.es-nav .es-nav-initial .el-menu-item.is-active,.es-nav .es-nav-initial .es-menu-vertical.is-active{background:#096dd9}.es-nav.es-nav-biserial{position:relative}.es-nav.es-nav-biserial .es-nav-main{position:absolute;left:70px;top:0;bottom:0}.es-nav.es-nav-biserial .es-menu-title-vertical{margin-right:0}
package/lib/tips.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 61);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 62);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -98,14 +98,9 @@ module.exports =
98
98
  /* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_2__);
99
99
  /* harmony import */ var json_bigint__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6);
100
100
  /* harmony import */ var json_bigint__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(json_bigint__WEBPACK_IMPORTED_MODULE_3__);
101
- /* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
102
- /* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(sockjs_client__WEBPACK_IMPORTED_MODULE_4__);
103
- /* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8);
104
- /* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(stompjs__WEBPACK_IMPORTED_MODULE_5__);
105
- /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2);
106
- /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(eoss_element__WEBPACK_IMPORTED_MODULE_6__);
107
- var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
108
-
101
+ /* harmony import */ var _webSocket__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
102
+ /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2);
103
+ /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(eoss_element__WEBPACK_IMPORTED_MODULE_5__);
109
104
  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
110
105
 
111
106
  /**
@@ -116,8 +111,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
116
111
  **/
117
112
 
118
113
  /* eslint-disable indent */
119
- var sm2 = __webpack_require__(9).sm2;
120
-
114
+ var sm2 = __webpack_require__(10).sm2;
121
115
 
122
116
 
123
117
 
@@ -265,7 +259,7 @@ var ajax = function ajax(_ref) {
265
259
  clearTimeout(loginMsg);
266
260
  loginMsg = setTimeout(function () {
267
261
  sessionStorage.setItem('remind', 1);
268
- eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
262
+ eoss_element__WEBPACK_IMPORTED_MODULE_5__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
269
263
  confirmButtonText: '确定',
270
264
  closeOnClickModal: false,
271
265
  type: 'warning'
@@ -312,7 +306,7 @@ var ajax = function ajax(_ref) {
312
306
  } else if (response.data.rCode === 61) {
313
307
  clearTimeout(initAuth);
314
308
  initAuth = setTimeout(function () {
315
- Object(eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"])({
309
+ Object(eoss_element__WEBPACK_IMPORTED_MODULE_5__["MessageBox"])({
316
310
  title: '请进行二次鉴权',
317
311
  closeOnClickModal: false,
318
312
  closeOnPressEscape: false,
@@ -2013,7 +2007,7 @@ var isLogined = function isLogined(_ref8) {
2013
2007
  win.top.location.href = href;
2014
2008
  break;
2015
2009
  case 4:
2016
- eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
2010
+ eoss_element__WEBPACK_IMPORTED_MODULE_5__["MessageBox"].alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
2017
2011
  confirmButtonText: '确定',
2018
2012
  type: 'error',
2019
2013
  callback: function callback() {
@@ -2033,7 +2027,7 @@ var isLogined = function isLogined(_ref8) {
2033
2027
  default:
2034
2028
  }
2035
2029
  } else {
2036
- eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].alert(res.msg, '提示', {
2030
+ eoss_element__WEBPACK_IMPORTED_MODULE_5__["MessageBox"].alert(res.msg, '提示', {
2037
2031
  confirmButtonText: '确定',
2038
2032
  type: 'error',
2039
2033
  callback: function callback() {
@@ -2164,7 +2158,7 @@ var loadJs = function loadJs(_ref10) {
2164
2158
  **/
2165
2159
  var loading = function loading($loading, res) {
2166
2160
  if (!$loading) {
2167
- $loading = eoss_element__WEBPACK_IMPORTED_MODULE_6__["Loading"].service;
2161
+ $loading = eoss_element__WEBPACK_IMPORTED_MODULE_5__["Loading"].service;
2168
2162
  }
2169
2163
  if (isObject(res)) {
2170
2164
  var config = extend({}, {
@@ -2532,60 +2526,13 @@ var setStorage = function setStorage(_ref14) {
2532
2526
  * @param {String} [take] - 订阅地址
2533
2527
  * @param {String} [debug] - 调试
2534
2528
  * @param {String} [interval] - 重连间隔时间
2529
+ * @param {Function} [success] - 调试
2530
+ * @param {Function} [error] - 重连间隔时间
2535
2531
  **/
2536
- function socket(options) {
2537
- var nextDate = 0;
2538
- var connect = 1;
2539
- return new Promise(function (resolve, reject) {
2540
- var wshost = getStorage('wshost') || '';
2541
- var option = {
2542
- url: wshost + _config_api__WEBPACK_IMPORTED_MODULE_0__[/* wss */ "Zb"],
2543
- take: _config_api__WEBPACK_IMPORTED_MODULE_0__[/* topic */ "Qb"],
2544
- debug: true,
2545
- interval: 20
2546
- };
2547
- var websocket = win.websocket || {};
2548
- if (options && isObject(options)) {
2549
- option = _extends({}, option, options);
2550
- }
2551
- var key = window.btoa(option.url);
2552
- if (!websocket[key]) {
2553
- websocket[key] = { socket: new sockjs_client__WEBPACK_IMPORTED_MODULE_4___default.a(option.url) };
2554
- win.websocket = websocket;
2555
- }
2556
-
2557
- var client = websocket[key] ? websocket[key].client : null;
2558
- if (!client) {
2559
- client = websocket[key].client = stompjs__WEBPACK_IMPORTED_MODULE_5___default.a.over(websocket[key].socket);
2560
- !option.debug && (client.debug = null);
2561
- }
2562
- client.connect({}, function () {
2563
- client.subscribe(option.take, function (response) {
2564
- var res = JSON.parse(response.body);
2565
- resolve(res, function () {
2566
- client.disconnect();
2567
- win.top.websocket && win.top.websocket[key] && delete win.top.websocket[key];
2568
- }, client, websocket[key]);
2569
- });
2570
- }, function (error) {
2571
- var diffSecond = parseInt((new Date() - nextDate) / 1000, 10);
2572
- if (connect > 5 && diffSecond < option.interval) {
2573
- client.disconnect();
2574
- if (win.top.websocket) {
2575
- if (Object.keys(win.top.websocket).length > 1) {
2576
- delete win.top.websocket[key];
2577
- } else {
2578
- delete win.top.websocket;
2579
- }
2580
- }
2581
- } else {
2582
- win.top.websocket && win.top.websocket[key] && setTimeout(function () {
2583
- socket(options);
2584
- }, 5000);
2585
- }
2586
- reject(error);
2587
- });
2588
- });
2532
+ function socket(option, vm) {
2533
+ var socket = new _webSocket__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"]();
2534
+ socket.init(option, vm);
2535
+ return socket;
2589
2536
  }
2590
2537
  /**
2591
2538
  * sum
@@ -3366,6 +3313,13 @@ var formContents = '/config/admin/online/onlineForm/render';
3366
3313
 
3367
3314
  /***/ }),
3368
3315
 
3316
+ /***/ 10:
3317
+ /***/ (function(module, exports) {
3318
+
3319
+ module.exports = require("sm-crypto");
3320
+
3321
+ /***/ }),
3322
+
3369
3323
  /***/ 2:
3370
3324
  /***/ (function(module, exports) {
3371
3325
 
@@ -3499,7 +3453,7 @@ module.exports = require("json-bigint");
3499
3453
 
3500
3454
  /***/ }),
3501
3455
 
3502
- /***/ 61:
3456
+ /***/ 62:
3503
3457
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3504
3458
 
3505
3459
  "use strict";
@@ -3731,23 +3685,149 @@ main.install = function (Vue) {
3731
3685
  /***/ }),
3732
3686
 
3733
3687
  /***/ 7:
3734
- /***/ (function(module, exports) {
3688
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
3735
3689
 
3736
- module.exports = require("sockjs-client");
3690
+ "use strict";
3691
+ /* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
3692
+ /* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(sockjs_client__WEBPACK_IMPORTED_MODULE_0__);
3693
+ /* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
3694
+ /* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(stompjs__WEBPACK_IMPORTED_MODULE_1__);
3695
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3696
+
3697
+
3698
+
3699
+
3700
+ var WebSocket = function () {
3701
+ // 构造函数
3702
+ function WebSocket() {
3703
+ _classCallCheck(this, WebSocket);
3704
+
3705
+ this.host = sessionStorage.getItem('wshost') || '';
3706
+ this.tryTimes = 1; // 重连次数
3707
+ this.callback = null; // 回调函数
3708
+ this.client = null; // stomp对象
3709
+ this.reconTimeout = null; // 重连延时器
3710
+ this.debug = true; // 调试
3711
+ this.interval = 20; // 重连间隔时间
3712
+ this.vm = null;
3713
+ this.nextDate = 0;
3714
+ this.connects = 1;
3715
+ this.recon = false;
3716
+ this.sendTimeout = null;
3717
+ }
3718
+
3719
+ /** socket连接 */
3720
+
3721
+
3722
+ WebSocket.prototype.connect = function connect() {
3723
+ var _this = this;
3724
+
3725
+ if (!this.client) {
3726
+ // 连接SockJS
3727
+ var socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url);
3728
+ // 获取STOMP子协议的客户端对象
3729
+ this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(socket);
3730
+ }
3731
+
3732
+ // 日志不打印
3733
+ if (!this.debug) {
3734
+ console.log(111);
3735
+ this.client.debug = function () {};
3736
+ }
3737
+
3738
+ // 向服务器发起websocket连接
3739
+ this.client.connect({}, function () {
3740
+ _this.recon = true;
3741
+ // tryTimes定义重置
3742
+ _this.connects = 1;
3743
+ // 订阅消息
3744
+ _this.subscribe();
3745
+ }, function (error) {
3746
+ var diffSecond = parseInt((new Date() - _this.nextDate) / 1000, 10);
3747
+ if (_this.connects > 5 && diffSecond < _this.interval) {
3748
+ _this.client.disconnect();
3749
+ _this.error && _this.error(error);
3750
+ } else {
3751
+ _this.reconTimeout = setTimeout(function () {
3752
+ _this.connect();
3753
+ _this.connects++;
3754
+ }, 5000);
3755
+ }
3756
+ });
3757
+ };
3758
+ /** 订阅服务端 */
3759
+
3760
+
3761
+ WebSocket.prototype.subscribe = function subscribe() {
3762
+ var _this2 = this;
3763
+
3764
+ // 订阅服务端提供的某个topic
3765
+ this.client.subscribe(this.take, function (response) {
3766
+ if (response && (_this2.callback || _this2.success)) {
3767
+ var callback = _this2.callback || _this2.success;
3768
+ callback(JSON.parse(response.body));
3769
+ }
3770
+ });
3771
+ };
3772
+
3773
+ /** 赋值、初始化socket */
3774
+
3775
+
3776
+ WebSocket.prototype.init = function init(option, vm) {
3777
+ for (var i in option) {
3778
+ this[i] = option[i];
3779
+ }
3780
+ this.vm = vm;
3781
+ // 初始化连接
3782
+ this.connect();
3783
+ };
3784
+
3785
+ /** 发送消息 */
3786
+
3787
+
3788
+ WebSocket.prototype.send = function send(data) {
3789
+ var _this3 = this;
3790
+
3791
+ if (this.recon) {
3792
+ clearTimeout(this.sendTimeout);
3793
+ this.client.send(this.take, {}, typeof data === 'string' ? data : JSON.stringify(data));
3794
+ } else {
3795
+ this.sendTimeout = setTimeout(function () {
3796
+ _this3.send(data);
3797
+ }, 1000);
3798
+ }
3799
+ };
3800
+
3801
+ /** 销毁 */
3802
+
3803
+
3804
+ WebSocket.prototype.destroy = function destroy() {
3805
+ // 断开连接,清除定时器
3806
+ if (this.client) {
3807
+ this.client.disconnect();
3808
+ };
3809
+ this.reconTimeout && clearTimeout(this.reconTimeout);
3810
+ this.sendTimeout && clearTimeout(this.sendTimeout);
3811
+ };
3812
+
3813
+ return WebSocket;
3814
+ }();
3815
+
3816
+ /* harmony default export */ __webpack_exports__["a"] = (WebSocket);
3737
3817
 
3738
3818
  /***/ }),
3739
3819
 
3740
3820
  /***/ 8:
3741
3821
  /***/ (function(module, exports) {
3742
3822
 
3743
- module.exports = require("stompjs");
3823
+ module.exports = require("sockjs-client");
3744
3824
 
3745
3825
  /***/ }),
3746
3826
 
3747
3827
  /***/ 9:
3748
3828
  /***/ (function(module, exports) {
3749
3829
 
3750
- module.exports = require("sm-crypto");
3830
+ module.exports = require("stompjs");
3751
3831
 
3752
3832
  /***/ })
3753
3833
 
package/lib/toolbar.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 77);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 78);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -192,7 +192,7 @@ function normalizeComponent(
192
192
 
193
193
  /***/ }),
194
194
 
195
- /***/ 77:
195
+ /***/ 78:
196
196
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
197
197
 
198
198
  "use strict";
package/lib/tree-group.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 63);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 64);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -98,14 +98,9 @@ module.exports =
98
98
  /* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_2__);
99
99
  /* harmony import */ var json_bigint__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6);
100
100
  /* harmony import */ var json_bigint__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(json_bigint__WEBPACK_IMPORTED_MODULE_3__);
101
- /* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
102
- /* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(sockjs_client__WEBPACK_IMPORTED_MODULE_4__);
103
- /* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8);
104
- /* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(stompjs__WEBPACK_IMPORTED_MODULE_5__);
105
- /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2);
106
- /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(eoss_element__WEBPACK_IMPORTED_MODULE_6__);
107
- var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
108
-
101
+ /* harmony import */ var _webSocket__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
102
+ /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2);
103
+ /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(eoss_element__WEBPACK_IMPORTED_MODULE_5__);
109
104
  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
110
105
 
111
106
  /**
@@ -116,8 +111,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
116
111
  **/
117
112
 
118
113
  /* eslint-disable indent */
119
- var sm2 = __webpack_require__(9).sm2;
120
-
114
+ var sm2 = __webpack_require__(10).sm2;
121
115
 
122
116
 
123
117
 
@@ -265,7 +259,7 @@ var ajax = function ajax(_ref) {
265
259
  clearTimeout(loginMsg);
266
260
  loginMsg = setTimeout(function () {
267
261
  sessionStorage.setItem('remind', 1);
268
- eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
262
+ eoss_element__WEBPACK_IMPORTED_MODULE_5__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
269
263
  confirmButtonText: '确定',
270
264
  closeOnClickModal: false,
271
265
  type: 'warning'
@@ -312,7 +306,7 @@ var ajax = function ajax(_ref) {
312
306
  } else if (response.data.rCode === 61) {
313
307
  clearTimeout(initAuth);
314
308
  initAuth = setTimeout(function () {
315
- Object(eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"])({
309
+ Object(eoss_element__WEBPACK_IMPORTED_MODULE_5__["MessageBox"])({
316
310
  title: '请进行二次鉴权',
317
311
  closeOnClickModal: false,
318
312
  closeOnPressEscape: false,
@@ -2013,7 +2007,7 @@ var isLogined = function isLogined(_ref8) {
2013
2007
  win.top.location.href = href;
2014
2008
  break;
2015
2009
  case 4:
2016
- eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
2010
+ eoss_element__WEBPACK_IMPORTED_MODULE_5__["MessageBox"].alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
2017
2011
  confirmButtonText: '确定',
2018
2012
  type: 'error',
2019
2013
  callback: function callback() {
@@ -2033,7 +2027,7 @@ var isLogined = function isLogined(_ref8) {
2033
2027
  default:
2034
2028
  }
2035
2029
  } else {
2036
- eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].alert(res.msg, '提示', {
2030
+ eoss_element__WEBPACK_IMPORTED_MODULE_5__["MessageBox"].alert(res.msg, '提示', {
2037
2031
  confirmButtonText: '确定',
2038
2032
  type: 'error',
2039
2033
  callback: function callback() {
@@ -2164,7 +2158,7 @@ var loadJs = function loadJs(_ref10) {
2164
2158
  **/
2165
2159
  var loading = function loading($loading, res) {
2166
2160
  if (!$loading) {
2167
- $loading = eoss_element__WEBPACK_IMPORTED_MODULE_6__["Loading"].service;
2161
+ $loading = eoss_element__WEBPACK_IMPORTED_MODULE_5__["Loading"].service;
2168
2162
  }
2169
2163
  if (isObject(res)) {
2170
2164
  var config = extend({}, {
@@ -2532,60 +2526,13 @@ var setStorage = function setStorage(_ref14) {
2532
2526
  * @param {String} [take] - 订阅地址
2533
2527
  * @param {String} [debug] - 调试
2534
2528
  * @param {String} [interval] - 重连间隔时间
2529
+ * @param {Function} [success] - 调试
2530
+ * @param {Function} [error] - 重连间隔时间
2535
2531
  **/
2536
- function socket(options) {
2537
- var nextDate = 0;
2538
- var connect = 1;
2539
- return new Promise(function (resolve, reject) {
2540
- var wshost = getStorage('wshost') || '';
2541
- var option = {
2542
- url: wshost + _config_api__WEBPACK_IMPORTED_MODULE_0__[/* wss */ "Zb"],
2543
- take: _config_api__WEBPACK_IMPORTED_MODULE_0__[/* topic */ "Qb"],
2544
- debug: true,
2545
- interval: 20
2546
- };
2547
- var websocket = win.websocket || {};
2548
- if (options && isObject(options)) {
2549
- option = _extends({}, option, options);
2550
- }
2551
- var key = window.btoa(option.url);
2552
- if (!websocket[key]) {
2553
- websocket[key] = { socket: new sockjs_client__WEBPACK_IMPORTED_MODULE_4___default.a(option.url) };
2554
- win.websocket = websocket;
2555
- }
2556
-
2557
- var client = websocket[key] ? websocket[key].client : null;
2558
- if (!client) {
2559
- client = websocket[key].client = stompjs__WEBPACK_IMPORTED_MODULE_5___default.a.over(websocket[key].socket);
2560
- !option.debug && (client.debug = null);
2561
- }
2562
- client.connect({}, function () {
2563
- client.subscribe(option.take, function (response) {
2564
- var res = JSON.parse(response.body);
2565
- resolve(res, function () {
2566
- client.disconnect();
2567
- win.top.websocket && win.top.websocket[key] && delete win.top.websocket[key];
2568
- }, client, websocket[key]);
2569
- });
2570
- }, function (error) {
2571
- var diffSecond = parseInt((new Date() - nextDate) / 1000, 10);
2572
- if (connect > 5 && diffSecond < option.interval) {
2573
- client.disconnect();
2574
- if (win.top.websocket) {
2575
- if (Object.keys(win.top.websocket).length > 1) {
2576
- delete win.top.websocket[key];
2577
- } else {
2578
- delete win.top.websocket;
2579
- }
2580
- }
2581
- } else {
2582
- win.top.websocket && win.top.websocket[key] && setTimeout(function () {
2583
- socket(options);
2584
- }, 5000);
2585
- }
2586
- reject(error);
2587
- });
2588
- });
2532
+ function socket(option, vm) {
2533
+ var socket = new _webSocket__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"]();
2534
+ socket.init(option, vm);
2535
+ return socket;
2589
2536
  }
2590
2537
  /**
2591
2538
  * sum
@@ -3366,6 +3313,13 @@ var formContents = '/config/admin/online/onlineForm/render';
3366
3313
 
3367
3314
  /***/ }),
3368
3315
 
3316
+ /***/ 10:
3317
+ /***/ (function(module, exports) {
3318
+
3319
+ module.exports = require("sm-crypto");
3320
+
3321
+ /***/ }),
3322
+
3369
3323
  /***/ 2:
3370
3324
  /***/ (function(module, exports) {
3371
3325
 
@@ -3499,7 +3453,7 @@ module.exports = require("json-bigint");
3499
3453
 
3500
3454
  /***/ }),
3501
3455
 
3502
- /***/ 63:
3456
+ /***/ 64:
3503
3457
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3504
3458
 
3505
3459
  "use strict";
@@ -4350,23 +4304,149 @@ main.install = function (Vue) {
4350
4304
  /***/ }),
4351
4305
 
4352
4306
  /***/ 7:
4353
- /***/ (function(module, exports) {
4307
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4354
4308
 
4355
- module.exports = require("sockjs-client");
4309
+ "use strict";
4310
+ /* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
4311
+ /* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(sockjs_client__WEBPACK_IMPORTED_MODULE_0__);
4312
+ /* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
4313
+ /* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(stompjs__WEBPACK_IMPORTED_MODULE_1__);
4314
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4315
+
4316
+
4317
+
4318
+
4319
+ var WebSocket = function () {
4320
+ // 构造函数
4321
+ function WebSocket() {
4322
+ _classCallCheck(this, WebSocket);
4323
+
4324
+ this.host = sessionStorage.getItem('wshost') || '';
4325
+ this.tryTimes = 1; // 重连次数
4326
+ this.callback = null; // 回调函数
4327
+ this.client = null; // stomp对象
4328
+ this.reconTimeout = null; // 重连延时器
4329
+ this.debug = true; // 调试
4330
+ this.interval = 20; // 重连间隔时间
4331
+ this.vm = null;
4332
+ this.nextDate = 0;
4333
+ this.connects = 1;
4334
+ this.recon = false;
4335
+ this.sendTimeout = null;
4336
+ }
4337
+
4338
+ /** socket连接 */
4339
+
4340
+
4341
+ WebSocket.prototype.connect = function connect() {
4342
+ var _this = this;
4343
+
4344
+ if (!this.client) {
4345
+ // 连接SockJS
4346
+ var socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url);
4347
+ // 获取STOMP子协议的客户端对象
4348
+ this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(socket);
4349
+ }
4350
+
4351
+ // 日志不打印
4352
+ if (!this.debug) {
4353
+ console.log(111);
4354
+ this.client.debug = function () {};
4355
+ }
4356
+
4357
+ // 向服务器发起websocket连接
4358
+ this.client.connect({}, function () {
4359
+ _this.recon = true;
4360
+ // tryTimes定义重置
4361
+ _this.connects = 1;
4362
+ // 订阅消息
4363
+ _this.subscribe();
4364
+ }, function (error) {
4365
+ var diffSecond = parseInt((new Date() - _this.nextDate) / 1000, 10);
4366
+ if (_this.connects > 5 && diffSecond < _this.interval) {
4367
+ _this.client.disconnect();
4368
+ _this.error && _this.error(error);
4369
+ } else {
4370
+ _this.reconTimeout = setTimeout(function () {
4371
+ _this.connect();
4372
+ _this.connects++;
4373
+ }, 5000);
4374
+ }
4375
+ });
4376
+ };
4377
+ /** 订阅服务端 */
4378
+
4379
+
4380
+ WebSocket.prototype.subscribe = function subscribe() {
4381
+ var _this2 = this;
4382
+
4383
+ // 订阅服务端提供的某个topic
4384
+ this.client.subscribe(this.take, function (response) {
4385
+ if (response && (_this2.callback || _this2.success)) {
4386
+ var callback = _this2.callback || _this2.success;
4387
+ callback(JSON.parse(response.body));
4388
+ }
4389
+ });
4390
+ };
4391
+
4392
+ /** 赋值、初始化socket */
4393
+
4394
+
4395
+ WebSocket.prototype.init = function init(option, vm) {
4396
+ for (var i in option) {
4397
+ this[i] = option[i];
4398
+ }
4399
+ this.vm = vm;
4400
+ // 初始化连接
4401
+ this.connect();
4402
+ };
4403
+
4404
+ /** 发送消息 */
4405
+
4406
+
4407
+ WebSocket.prototype.send = function send(data) {
4408
+ var _this3 = this;
4409
+
4410
+ if (this.recon) {
4411
+ clearTimeout(this.sendTimeout);
4412
+ this.client.send(this.take, {}, typeof data === 'string' ? data : JSON.stringify(data));
4413
+ } else {
4414
+ this.sendTimeout = setTimeout(function () {
4415
+ _this3.send(data);
4416
+ }, 1000);
4417
+ }
4418
+ };
4419
+
4420
+ /** 销毁 */
4421
+
4422
+
4423
+ WebSocket.prototype.destroy = function destroy() {
4424
+ // 断开连接,清除定时器
4425
+ if (this.client) {
4426
+ this.client.disconnect();
4427
+ };
4428
+ this.reconTimeout && clearTimeout(this.reconTimeout);
4429
+ this.sendTimeout && clearTimeout(this.sendTimeout);
4430
+ };
4431
+
4432
+ return WebSocket;
4433
+ }();
4434
+
4435
+ /* harmony default export */ __webpack_exports__["a"] = (WebSocket);
4356
4436
 
4357
4437
  /***/ }),
4358
4438
 
4359
4439
  /***/ 8:
4360
4440
  /***/ (function(module, exports) {
4361
4441
 
4362
- module.exports = require("stompjs");
4442
+ module.exports = require("sockjs-client");
4363
4443
 
4364
4444
  /***/ }),
4365
4445
 
4366
4446
  /***/ 9:
4367
4447
  /***/ (function(module, exports) {
4368
4448
 
4369
- module.exports = require("sm-crypto");
4449
+ module.exports = require("stompjs");
4370
4450
 
4371
4451
  /***/ })
4372
4452