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
@@ -82,12 +82,11 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 35);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 36);
86
86
  /******/ })
87
87
  /************************************************************************/
88
- /******/ ({
89
-
90
- /***/ 0:
88
+ /******/ ([
89
+ /* 0 */
91
90
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
92
91
 
93
92
  "use strict";
@@ -98,14 +97,9 @@ module.exports =
98
97
  /* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_2__);
99
98
  /* harmony import */ var json_bigint__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6);
100
99
  /* 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
-
100
+ /* harmony import */ var _webSocket__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
101
+ /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2);
102
+ /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(eoss_element__WEBPACK_IMPORTED_MODULE_5__);
109
103
  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
104
 
111
105
  /**
@@ -116,8 +110,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
116
110
  **/
117
111
 
118
112
  /* eslint-disable indent */
119
- var sm2 = __webpack_require__(9).sm2;
120
-
113
+ var sm2 = __webpack_require__(10).sm2;
121
114
 
122
115
 
123
116
 
@@ -265,7 +258,7 @@ var ajax = function ajax(_ref) {
265
258
  clearTimeout(loginMsg);
266
259
  loginMsg = setTimeout(function () {
267
260
  sessionStorage.setItem('remind', 1);
268
- eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
261
+ eoss_element__WEBPACK_IMPORTED_MODULE_5__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
269
262
  confirmButtonText: '确定',
270
263
  closeOnClickModal: false,
271
264
  type: 'warning'
@@ -312,7 +305,7 @@ var ajax = function ajax(_ref) {
312
305
  } else if (response.data.rCode === 61) {
313
306
  clearTimeout(initAuth);
314
307
  initAuth = setTimeout(function () {
315
- Object(eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"])({
308
+ Object(eoss_element__WEBPACK_IMPORTED_MODULE_5__["MessageBox"])({
316
309
  title: '请进行二次鉴权',
317
310
  closeOnClickModal: false,
318
311
  closeOnPressEscape: false,
@@ -2013,7 +2006,7 @@ var isLogined = function isLogined(_ref8) {
2013
2006
  win.top.location.href = href;
2014
2007
  break;
2015
2008
  case 4:
2016
- eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
2009
+ eoss_element__WEBPACK_IMPORTED_MODULE_5__["MessageBox"].alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
2017
2010
  confirmButtonText: '确定',
2018
2011
  type: 'error',
2019
2012
  callback: function callback() {
@@ -2033,7 +2026,7 @@ var isLogined = function isLogined(_ref8) {
2033
2026
  default:
2034
2027
  }
2035
2028
  } else {
2036
- eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].alert(res.msg, '提示', {
2029
+ eoss_element__WEBPACK_IMPORTED_MODULE_5__["MessageBox"].alert(res.msg, '提示', {
2037
2030
  confirmButtonText: '确定',
2038
2031
  type: 'error',
2039
2032
  callback: function callback() {
@@ -2164,7 +2157,7 @@ var loadJs = function loadJs(_ref10) {
2164
2157
  **/
2165
2158
  var loading = function loading($loading, res) {
2166
2159
  if (!$loading) {
2167
- $loading = eoss_element__WEBPACK_IMPORTED_MODULE_6__["Loading"].service;
2160
+ $loading = eoss_element__WEBPACK_IMPORTED_MODULE_5__["Loading"].service;
2168
2161
  }
2169
2162
  if (isObject(res)) {
2170
2163
  var config = extend({}, {
@@ -2532,60 +2525,13 @@ var setStorage = function setStorage(_ref14) {
2532
2525
  * @param {String} [take] - 订阅地址
2533
2526
  * @param {String} [debug] - 调试
2534
2527
  * @param {String} [interval] - 重连间隔时间
2528
+ * @param {Function} [success] - 调试
2529
+ * @param {Function} [error] - 重连间隔时间
2535
2530
  **/
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
- });
2531
+ function socket(option, vm) {
2532
+ var socket = new _webSocket__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"]();
2533
+ socket.init(option, vm);
2534
+ return socket;
2589
2535
  }
2590
2536
  /**
2591
2537
  * sum
@@ -3025,8 +2971,7 @@ var watermark = function watermark(option) {
3025
2971
  });
3026
2972
 
3027
2973
  /***/ }),
3028
-
3029
- /***/ 1:
2974
+ /* 1 */
3030
2975
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3031
2976
 
3032
2977
  "use strict";
@@ -3365,15 +3310,13 @@ var sendBatch = '/notify2/sendRecord/reSendNotifyMessageBatch';
3365
3310
  var formContents = '/config/admin/online/onlineForm/render';
3366
3311
 
3367
3312
  /***/ }),
3368
-
3369
- /***/ 2:
3313
+ /* 2 */
3370
3314
  /***/ (function(module, exports) {
3371
3315
 
3372
3316
  module.exports = require("eoss-element");
3373
3317
 
3374
3318
  /***/ }),
3375
-
3376
- /***/ 3:
3319
+ /* 3 */
3377
3320
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3378
3321
 
3379
3322
  "use strict";
@@ -3477,8 +3420,200 @@ function normalizeComponent(
3477
3420
 
3478
3421
 
3479
3422
  /***/ }),
3423
+ /* 4 */
3424
+ /***/ (function(module, exports) {
3425
+
3426
+ module.exports = require("qs");
3427
+
3428
+ /***/ }),
3429
+ /* 5 */
3430
+ /***/ (function(module, exports) {
3431
+
3432
+ module.exports = require("axios");
3433
+
3434
+ /***/ }),
3435
+ /* 6 */
3436
+ /***/ (function(module, exports) {
3437
+
3438
+ module.exports = require("json-bigint");
3439
+
3440
+ /***/ }),
3441
+ /* 7 */
3442
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
3443
+
3444
+ "use strict";
3445
+ /* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
3446
+ /* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(sockjs_client__WEBPACK_IMPORTED_MODULE_0__);
3447
+ /* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
3448
+ /* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(stompjs__WEBPACK_IMPORTED_MODULE_1__);
3449
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3450
+
3451
+
3452
+
3453
+
3454
+ var WebSocket = function () {
3455
+ // 构造函数
3456
+ function WebSocket() {
3457
+ _classCallCheck(this, WebSocket);
3458
+
3459
+ this.host = sessionStorage.getItem('wshost') || '';
3460
+ this.tryTimes = 1; // 重连次数
3461
+ this.callback = null; // 回调函数
3462
+ this.client = null; // stomp对象
3463
+ this.reconTimeout = null; // 重连延时器
3464
+ this.debug = true; // 调试
3465
+ this.interval = 20; // 重连间隔时间
3466
+ this.vm = null;
3467
+ this.nextDate = 0;
3468
+ this.connects = 1;
3469
+ this.recon = false;
3470
+ this.sendTimeout = null;
3471
+ }
3472
+
3473
+ /** socket连接 */
3474
+
3475
+
3476
+ WebSocket.prototype.connect = function connect() {
3477
+ var _this = this;
3478
+
3479
+ if (!this.client) {
3480
+ // 连接SockJS
3481
+ var socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url);
3482
+ // 获取STOMP子协议的客户端对象
3483
+ this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(socket);
3484
+ }
3485
+
3486
+ // 日志不打印
3487
+ if (!this.debug) {
3488
+ console.log(111);
3489
+ this.client.debug = function () {};
3490
+ }
3491
+
3492
+ // 向服务器发起websocket连接
3493
+ this.client.connect({}, function () {
3494
+ _this.recon = true;
3495
+ // tryTimes定义重置
3496
+ _this.connects = 1;
3497
+ // 订阅消息
3498
+ _this.subscribe();
3499
+ }, function (error) {
3500
+ var diffSecond = parseInt((new Date() - _this.nextDate) / 1000, 10);
3501
+ if (_this.connects > 5 && diffSecond < _this.interval) {
3502
+ _this.client.disconnect();
3503
+ _this.error && _this.error(error);
3504
+ } else {
3505
+ _this.reconTimeout = setTimeout(function () {
3506
+ _this.connect();
3507
+ _this.connects++;
3508
+ }, 5000);
3509
+ }
3510
+ });
3511
+ };
3512
+ /** 订阅服务端 */
3513
+
3514
+
3515
+ WebSocket.prototype.subscribe = function subscribe() {
3516
+ var _this2 = this;
3517
+
3518
+ // 订阅服务端提供的某个topic
3519
+ this.client.subscribe(this.take, function (response) {
3520
+ if (response && (_this2.callback || _this2.success)) {
3521
+ var callback = _this2.callback || _this2.success;
3522
+ callback(JSON.parse(response.body));
3523
+ }
3524
+ });
3525
+ };
3526
+
3527
+ /** 赋值、初始化socket */
3528
+
3529
+
3530
+ WebSocket.prototype.init = function init(option, vm) {
3531
+ for (var i in option) {
3532
+ this[i] = option[i];
3533
+ }
3534
+ this.vm = vm;
3535
+ // 初始化连接
3536
+ this.connect();
3537
+ };
3538
+
3539
+ /** 发送消息 */
3540
+
3541
+
3542
+ WebSocket.prototype.send = function send(data) {
3543
+ var _this3 = this;
3544
+
3545
+ if (this.recon) {
3546
+ clearTimeout(this.sendTimeout);
3547
+ this.client.send(this.take, {}, typeof data === 'string' ? data : JSON.stringify(data));
3548
+ } else {
3549
+ this.sendTimeout = setTimeout(function () {
3550
+ _this3.send(data);
3551
+ }, 1000);
3552
+ }
3553
+ };
3554
+
3555
+ /** 销毁 */
3556
+
3557
+
3558
+ WebSocket.prototype.destroy = function destroy() {
3559
+ // 断开连接,清除定时器
3560
+ if (this.client) {
3561
+ this.client.disconnect();
3562
+ };
3563
+ this.reconTimeout && clearTimeout(this.reconTimeout);
3564
+ this.sendTimeout && clearTimeout(this.sendTimeout);
3565
+ };
3566
+
3567
+ return WebSocket;
3568
+ }();
3569
+
3570
+ /* harmony default export */ __webpack_exports__["a"] = (WebSocket);
3571
+
3572
+ /***/ }),
3573
+ /* 8 */
3574
+ /***/ (function(module, exports) {
3575
+
3576
+ module.exports = require("sockjs-client");
3577
+
3578
+ /***/ }),
3579
+ /* 9 */
3580
+ /***/ (function(module, exports) {
3480
3581
 
3481
- /***/ 35:
3582
+ module.exports = require("stompjs");
3583
+
3584
+ /***/ }),
3585
+ /* 10 */
3586
+ /***/ (function(module, exports) {
3587
+
3588
+ module.exports = require("sm-crypto");
3589
+
3590
+ /***/ }),
3591
+ /* 11 */,
3592
+ /* 12 */,
3593
+ /* 13 */,
3594
+ /* 14 */,
3595
+ /* 15 */,
3596
+ /* 16 */,
3597
+ /* 17 */,
3598
+ /* 18 */,
3599
+ /* 19 */,
3600
+ /* 20 */,
3601
+ /* 21 */,
3602
+ /* 22 */,
3603
+ /* 23 */,
3604
+ /* 24 */,
3605
+ /* 25 */,
3606
+ /* 26 */,
3607
+ /* 27 */,
3608
+ /* 28 */,
3609
+ /* 29 */,
3610
+ /* 30 */,
3611
+ /* 31 */,
3612
+ /* 32 */,
3613
+ /* 33 */,
3614
+ /* 34 */,
3615
+ /* 35 */,
3616
+ /* 36 */
3482
3617
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3483
3618
 
3484
3619
  "use strict";
@@ -3747,48 +3882,5 @@ main.install = function (Vue) {
3747
3882
 
3748
3883
  /* harmony default export */ var button_group = __webpack_exports__["default"] = (main);
3749
3884
 
3750
- /***/ }),
3751
-
3752
- /***/ 4:
3753
- /***/ (function(module, exports) {
3754
-
3755
- module.exports = require("qs");
3756
-
3757
- /***/ }),
3758
-
3759
- /***/ 5:
3760
- /***/ (function(module, exports) {
3761
-
3762
- module.exports = require("axios");
3763
-
3764
- /***/ }),
3765
-
3766
- /***/ 6:
3767
- /***/ (function(module, exports) {
3768
-
3769
- module.exports = require("json-bigint");
3770
-
3771
- /***/ }),
3772
-
3773
- /***/ 7:
3774
- /***/ (function(module, exports) {
3775
-
3776
- module.exports = require("sockjs-client");
3777
-
3778
- /***/ }),
3779
-
3780
- /***/ 8:
3781
- /***/ (function(module, exports) {
3782
-
3783
- module.exports = require("stompjs");
3784
-
3785
- /***/ }),
3786
-
3787
- /***/ 9:
3788
- /***/ (function(module, exports) {
3789
-
3790
- module.exports = require("sm-crypto");
3791
-
3792
3885
  /***/ })
3793
-
3794
- /******/ });
3886
+ /******/ ]);