eoss-ui 0.4.98 → 0.5.10

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 (56) hide show
  1. package/lib/button-group.js +117 -27
  2. package/lib/button.js +118 -28
  3. package/lib/checkbox-group.js +198 -96
  4. package/lib/data-table-form.js +117 -31
  5. package/lib/data-table.js +173 -75
  6. package/lib/date-picker.js +117 -27
  7. package/lib/dialog.js +127 -41
  8. package/lib/eoss-ui.common.js +1006 -707
  9. package/lib/flow-group.js +117 -27
  10. package/lib/flow-list.js +136 -36
  11. package/lib/flow.js +147 -41
  12. package/lib/form.js +682 -434
  13. package/lib/handle-user.js +142 -52
  14. package/lib/handler.js +117 -27
  15. package/lib/icons.js +2 -2
  16. package/lib/index.js +1 -1
  17. package/lib/input-number.js +118 -28
  18. package/lib/input.js +120 -30
  19. package/lib/layout.js +2 -2
  20. package/lib/login.js +123 -36
  21. package/lib/main.js +232 -151
  22. package/lib/nav.js +117 -27
  23. package/lib/page.js +117 -27
  24. package/lib/player.js +119 -29
  25. package/lib/qr-code.js +117 -27
  26. package/lib/radio-group.js +146 -54
  27. package/lib/retrial-auth.js +117 -27
  28. package/lib/select-ganged.js +118 -28
  29. package/lib/select.js +142 -52
  30. package/lib/selector-panel.js +171 -74
  31. package/lib/selector.js +117 -27
  32. package/lib/sizer.js +120 -30
  33. package/lib/steps.js +117 -27
  34. package/lib/switch.js +118 -28
  35. package/lib/table-form.js +182 -76
  36. package/lib/tabs.js +117 -27
  37. package/lib/tips.js +117 -27
  38. package/lib/tree-group.js +117 -27
  39. package/lib/tree.js +117 -27
  40. package/lib/upload.js +206 -109
  41. package/lib/utils/util.js +97 -19
  42. package/lib/wujie.js +117 -27
  43. package/lib/wxlogin.js +117 -27
  44. package/package.json +1 -1
  45. package/packages/button/src/main.vue +1 -10
  46. package/packages/data-table/src/column.vue +6 -0
  47. package/packages/flow/src/main.vue +20 -3
  48. package/packages/flow-list/src/main.vue +4 -3
  49. package/packages/form/src/main.vue +60 -1
  50. package/packages/form/src/table.vue +6 -0
  51. package/packages/login/src/main.vue +1 -0
  52. package/packages/main/src/main.vue +117 -97
  53. package/packages/radio-group/src/main.vue +1 -0
  54. package/packages/upload/src/main.vue +0 -1
  55. package/src/index.js +1 -1
  56. package/src/utils/util.js +94 -20
@@ -98,8 +98,14 @@ 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 eoss_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2);
102
- /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(eoss_element__WEBPACK_IMPORTED_MODULE_4__);
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
+
103
109
  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; };
104
110
 
105
111
  /**
@@ -110,7 +116,9 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
110
116
  **/
111
117
 
112
118
  /* eslint-disable indent */
113
- var sm2 = __webpack_require__(7).sm2;
119
+ var sm2 = __webpack_require__(9).sm2;
120
+
121
+
114
122
 
115
123
 
116
124
 
@@ -257,7 +265,7 @@ var ajax = function ajax(_ref) {
257
265
  clearTimeout(loginMsg);
258
266
  loginMsg = setTimeout(function () {
259
267
  sessionStorage.setItem('remind', 1);
260
- eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
268
+ eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
261
269
  confirmButtonText: '确定',
262
270
  closeOnClickModal: false,
263
271
  type: 'warning'
@@ -304,7 +312,7 @@ var ajax = function ajax(_ref) {
304
312
  } else if (response.data.rCode === 61) {
305
313
  clearTimeout(initAuth);
306
314
  initAuth = setTimeout(function () {
307
- Object(eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"])({
315
+ Object(eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"])({
308
316
  title: '请进行二次鉴权',
309
317
  closeOnClickModal: false,
310
318
  closeOnPressEscape: false,
@@ -1753,7 +1761,7 @@ var getWeekday = function getWeekday(date) {
1753
1761
  * @param {String} [url] - url地址
1754
1762
  **/
1755
1763
 
1756
- var handlerUrl = function handlerUrl(url, before) {
1764
+ var handlerUrl = function handlerUrl(url, param, before) {
1757
1765
  var arry = url.split('?');
1758
1766
  if (arry.length > 2) {
1759
1767
  var ary = arry.splice(1, arry.length);
@@ -1775,6 +1783,10 @@ var handlerUrl = function handlerUrl(url, before) {
1775
1783
  } else {
1776
1784
  url += '?_tt=' + new Date().getTime();
1777
1785
  }
1786
+ if (param) {
1787
+ var str = queryParams(param);
1788
+ url += '&' + str;
1789
+ }
1778
1790
  if (before && before === arry[0]) {
1779
1791
  var pathname = win.location.pathname;
1780
1792
  if (pathname === '/') {
@@ -1939,29 +1951,29 @@ var isLogined = function isLogined(_ref8) {
1939
1951
  loginPage = _ref8.loginPage,
1940
1952
  redirect = _ref8.redirect;
1941
1953
 
1942
- var logined = getStorage('logined');
1943
1954
  if (cookie === undefined) {
1944
1955
  cookie = getParams({ name: 'cookie' });
1945
1956
  }
1946
- // eslint-disable-next-line eqeqeq
1947
- if (logined || cookie == true || cookie == 1) {
1948
- if (loginPage) {
1949
- sessionStorage.setItem('loginPage', loginPage);
1950
- if (!startWith(loginPage, ['http', '/'], true)) {
1951
- var pathname = win.top.location.pathname;
1952
- if (pathname !== '/') {
1953
- pathname = pathname.split('/');
1954
- pathname.splice(pathname.length - 1);
1955
- pathname = pathname.join('/');
1956
- loginPage = pathname + '/' + loginPage.replace('./', '');
1957
- } else {
1958
- loginPage = pathname + loginPage.replace('./', '');
1959
- }
1957
+ if (loginPage) {
1958
+ sessionStorage.setItem('loginPage', loginPage);
1959
+ if (!startWith(loginPage, ['http', '/'], true)) {
1960
+ var pathname = win.top.location.pathname;
1961
+ if (pathname !== '/') {
1962
+ pathname = pathname.split('/');
1963
+ pathname.splice(pathname.length - 1);
1964
+ pathname = pathname.join('/');
1965
+ loginPage = pathname + '/' + loginPage.replace('./', '');
1966
+ } else {
1967
+ loginPage = pathname + loginPage.replace('./', '');
1960
1968
  }
1961
1969
  }
1962
- next();
1970
+ }
1971
+ var token = getStorage('token') || getStorage('Authorization');
1972
+ var logined = getStorage('logined');
1973
+ // eslint-disable-next-line eqeqeq
1974
+ if (token || logined || cookie == true || cookie == 1) {
1975
+ next && next();
1963
1976
  } else {
1964
- var token = getStorage('token') || getStorage('Authorization');
1965
1977
  if (!token && Object.prototype.hasOwnProperty.call(to.query, 'serverId') && Object.prototype.hasOwnProperty.call(to.query, 'authType')) {
1966
1978
  ajax({
1967
1979
  method: 'post',
@@ -2016,7 +2028,7 @@ var isLogined = function isLogined(_ref8) {
2016
2028
  }
2017
2029
  break;
2018
2030
  case 4:
2019
- eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
2031
+ eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
2020
2032
  confirmButtonText: '确定',
2021
2033
  type: 'error',
2022
2034
  callback: function callback() {
@@ -2036,7 +2048,7 @@ var isLogined = function isLogined(_ref8) {
2036
2048
  default:
2037
2049
  }
2038
2050
  } else {
2039
- eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].alert(res.msg, '提示', {
2051
+ eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].alert(res.msg, '提示', {
2040
2052
  confirmButtonText: '确定',
2041
2053
  type: 'error',
2042
2054
  callback: function callback() {
@@ -2167,7 +2179,7 @@ var loadJs = function loadJs(_ref10) {
2167
2179
  **/
2168
2180
  var loading = function loading($loading, res) {
2169
2181
  if (!$loading) {
2170
- $loading = eoss_element__WEBPACK_IMPORTED_MODULE_4__["Loading"].service;
2182
+ $loading = eoss_element__WEBPACK_IMPORTED_MODULE_6__["Loading"].service;
2171
2183
  }
2172
2184
  if (isObject(res)) {
2173
2185
  var config = extend({}, {
@@ -2526,6 +2538,70 @@ var setStorage = function setStorage(_ref14) {
2526
2538
  }
2527
2539
  };
2528
2540
 
2541
+ /**
2542
+ * socket
2543
+ * @desc:webSocket
2544
+ * @author huangbo
2545
+ * @date 2022年5月7日
2546
+ * @param {String} [url] - 连接地址
2547
+ * @param {String} [take] - 订阅地址
2548
+ * @param {String} [debug] - 调试
2549
+ * @param {String} [interval] - 重连间隔时间
2550
+ **/
2551
+ function socket(options) {
2552
+ var nextDate = 0;
2553
+ var connect = 1;
2554
+ return new Promise(function (resolve, reject) {
2555
+ var wshost = getStorage('wshost') || '';
2556
+ var option = {
2557
+ url: wshost + _config_api__WEBPACK_IMPORTED_MODULE_0__[/* wss */ "Zb"],
2558
+ take: _config_api__WEBPACK_IMPORTED_MODULE_0__[/* topic */ "Qb"],
2559
+ debug: true,
2560
+ interval: 20
2561
+ };
2562
+ var websocket = win.websocket || {};
2563
+ if (options && isObject(options)) {
2564
+ option = _extends({}, option, options);
2565
+ }
2566
+ var key = window.btoa(option.url);
2567
+ if (!websocket[key]) {
2568
+ websocket[key] = { socket: new sockjs_client__WEBPACK_IMPORTED_MODULE_4___default.a(option.url) };
2569
+ win.websocket = websocket;
2570
+ }
2571
+
2572
+ var client = websocket[key] ? websocket[key].client : null;
2573
+ if (!client) {
2574
+ client = websocket[key].client = stompjs__WEBPACK_IMPORTED_MODULE_5___default.a.over(websocket[key].socket);
2575
+ !option.debug && (client.debug = null);
2576
+ }
2577
+ client.connect({}, function () {
2578
+ client.subscribe(option.take, function (response) {
2579
+ var res = JSON.parse(response.body);
2580
+ resolve(res, function () {
2581
+ client.disconnect();
2582
+ win.top.websocket && win.top.websocket[key] && delete win.top.websocket[key];
2583
+ }, client, websocket[key]);
2584
+ });
2585
+ }, function (error) {
2586
+ var diffSecond = parseInt((new Date() - nextDate) / 1000, 10);
2587
+ if (connect > 5 && diffSecond < option.interval) {
2588
+ client.disconnect();
2589
+ if (win.top.websocket) {
2590
+ if (Object.keys(win.top.websocket).length > 1) {
2591
+ delete win.top.websocket[key];
2592
+ } else {
2593
+ delete win.top.websocket;
2594
+ }
2595
+ }
2596
+ } else {
2597
+ win.top.websocket && win.top.websocket[key] && setTimeout(function () {
2598
+ socket(options);
2599
+ }, 5000);
2600
+ }
2601
+ reject(error);
2602
+ });
2603
+ });
2604
+ }
2529
2605
  /**
2530
2606
  * sum
2531
2607
  * @desc 求和
@@ -2778,7 +2854,6 @@ var urlJoinParams = function urlJoinParams(_ref15) {
2778
2854
  params[items[0]] = items[1];
2779
2855
  });
2780
2856
  }
2781
- '&_tt=' + new Date().getTime();
2782
2857
  params = extend(true, params, param);
2783
2858
  var str = queryParams(params);
2784
2859
  if (str) {
@@ -2946,6 +3021,7 @@ var watermark = function watermark(option) {
2946
3021
  sendMessage: sendMessage,
2947
3022
  setFavicon: setFavicon,
2948
3023
  setStorage: setStorage,
3024
+ socket: socket,
2949
3025
  startWith: startWith,
2950
3026
  sum: sum,
2951
3027
  takeLeft: takeLeft,
@@ -3305,6 +3381,34 @@ var formContents = '/config/admin/online/onlineForm/render';
3305
3381
 
3306
3382
  /***/ }),
3307
3383
 
3384
+ /***/ 10:
3385
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
3386
+
3387
+ "use strict";
3388
+ var store = {
3389
+ state: {},
3390
+ set: function set(name, value) {
3391
+ this.state[name] = value;
3392
+ },
3393
+ get: function get(name) {
3394
+ return this.state[name];
3395
+ },
3396
+ clear: function clear(name) {
3397
+ this.state[name] = null;
3398
+ },
3399
+ remove: function remove(name) {
3400
+ if (name) {
3401
+ delete this.state[name];
3402
+ } else {
3403
+ this.state = {};
3404
+ }
3405
+ }
3406
+ };
3407
+ window.__store = store;
3408
+ /* harmony default export */ __webpack_exports__["a"] = (store);
3409
+
3410
+ /***/ }),
3411
+
3308
3412
  /***/ 2:
3309
3413
  /***/ (function(module, exports) {
3310
3414
 
@@ -3438,7 +3542,7 @@ module.exports = require("axios");
3438
3542
  // ESM COMPAT FLAG
3439
3543
  __webpack_require__.r(__webpack_exports__);
3440
3544
 
3441
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/radio-group/src/main.vue?vue&type=template&id=64807cce&
3545
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/radio-group/src/main.vue?vue&type=template&id=0995e7f2&
3442
3546
  var render = function () {
3443
3547
  var _vm = this
3444
3548
  var _h = _vm.$createElement
@@ -3470,6 +3574,7 @@ var render = function () {
3470
3574
  expression: "display",
3471
3575
  },
3472
3576
  ],
3577
+ attrs: { "value-key": _vm.valueKey },
3473
3578
  model: {
3474
3579
  value: _vm.model,
3475
3580
  callback: function ($$v) {
@@ -3571,13 +3676,13 @@ var staticRenderFns = []
3571
3676
  render._withStripped = true
3572
3677
 
3573
3678
 
3574
- // CONCATENATED MODULE: ./packages/radio-group/src/main.vue?vue&type=template&id=64807cce&
3679
+ // CONCATENATED MODULE: ./packages/radio-group/src/main.vue?vue&type=template&id=0995e7f2&
3575
3680
 
3576
3681
  // EXTERNAL MODULE: ./src/config/api.js
3577
3682
  var api = __webpack_require__(1);
3578
3683
 
3579
3684
  // EXTERNAL MODULE: ./src/utils/store.js
3580
- var store = __webpack_require__(8);
3685
+ var store = __webpack_require__(10);
3581
3686
 
3582
3687
  // EXTERNAL MODULE: ./src/utils/util.js
3583
3688
  var util = __webpack_require__(0);
@@ -3642,6 +3747,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
3642
3747
  //
3643
3748
  //
3644
3749
  //
3750
+ //
3645
3751
 
3646
3752
 
3647
3753
 
@@ -3926,35 +4032,21 @@ module.exports = require("json-bigint");
3926
4032
  /***/ 7:
3927
4033
  /***/ (function(module, exports) {
3928
4034
 
3929
- module.exports = require("sm-crypto");
4035
+ module.exports = require("sockjs-client");
3930
4036
 
3931
4037
  /***/ }),
3932
4038
 
3933
4039
  /***/ 8:
3934
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
4040
+ /***/ (function(module, exports) {
3935
4041
 
3936
- "use strict";
3937
- var store = {
3938
- state: {},
3939
- set: function set(name, value) {
3940
- this.state[name] = value;
3941
- },
3942
- get: function get(name) {
3943
- return this.state[name];
3944
- },
3945
- clear: function clear(name) {
3946
- this.state[name] = null;
3947
- },
3948
- remove: function remove(name) {
3949
- if (name) {
3950
- delete this.state[name];
3951
- } else {
3952
- this.state = {};
3953
- }
3954
- }
3955
- };
3956
- window.__store = store;
3957
- /* harmony default export */ __webpack_exports__["a"] = (store);
4042
+ module.exports = require("stompjs");
4043
+
4044
+ /***/ }),
4045
+
4046
+ /***/ 9:
4047
+ /***/ (function(module, exports) {
4048
+
4049
+ module.exports = require("sm-crypto");
3958
4050
 
3959
4051
  /***/ })
3960
4052
 
@@ -98,8 +98,14 @@ 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 eoss_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2);
102
- /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(eoss_element__WEBPACK_IMPORTED_MODULE_4__);
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
+
103
109
  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; };
104
110
 
105
111
  /**
@@ -110,7 +116,9 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
110
116
  **/
111
117
 
112
118
  /* eslint-disable indent */
113
- var sm2 = __webpack_require__(7).sm2;
119
+ var sm2 = __webpack_require__(9).sm2;
120
+
121
+
114
122
 
115
123
 
116
124
 
@@ -257,7 +265,7 @@ var ajax = function ajax(_ref) {
257
265
  clearTimeout(loginMsg);
258
266
  loginMsg = setTimeout(function () {
259
267
  sessionStorage.setItem('remind', 1);
260
- eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
268
+ eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
261
269
  confirmButtonText: '确定',
262
270
  closeOnClickModal: false,
263
271
  type: 'warning'
@@ -304,7 +312,7 @@ var ajax = function ajax(_ref) {
304
312
  } else if (response.data.rCode === 61) {
305
313
  clearTimeout(initAuth);
306
314
  initAuth = setTimeout(function () {
307
- Object(eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"])({
315
+ Object(eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"])({
308
316
  title: '请进行二次鉴权',
309
317
  closeOnClickModal: false,
310
318
  closeOnPressEscape: false,
@@ -1753,7 +1761,7 @@ var getWeekday = function getWeekday(date) {
1753
1761
  * @param {String} [url] - url地址
1754
1762
  **/
1755
1763
 
1756
- var handlerUrl = function handlerUrl(url, before) {
1764
+ var handlerUrl = function handlerUrl(url, param, before) {
1757
1765
  var arry = url.split('?');
1758
1766
  if (arry.length > 2) {
1759
1767
  var ary = arry.splice(1, arry.length);
@@ -1775,6 +1783,10 @@ var handlerUrl = function handlerUrl(url, before) {
1775
1783
  } else {
1776
1784
  url += '?_tt=' + new Date().getTime();
1777
1785
  }
1786
+ if (param) {
1787
+ var str = queryParams(param);
1788
+ url += '&' + str;
1789
+ }
1778
1790
  if (before && before === arry[0]) {
1779
1791
  var pathname = win.location.pathname;
1780
1792
  if (pathname === '/') {
@@ -1939,29 +1951,29 @@ var isLogined = function isLogined(_ref8) {
1939
1951
  loginPage = _ref8.loginPage,
1940
1952
  redirect = _ref8.redirect;
1941
1953
 
1942
- var logined = getStorage('logined');
1943
1954
  if (cookie === undefined) {
1944
1955
  cookie = getParams({ name: 'cookie' });
1945
1956
  }
1946
- // eslint-disable-next-line eqeqeq
1947
- if (logined || cookie == true || cookie == 1) {
1948
- if (loginPage) {
1949
- sessionStorage.setItem('loginPage', loginPage);
1950
- if (!startWith(loginPage, ['http', '/'], true)) {
1951
- var pathname = win.top.location.pathname;
1952
- if (pathname !== '/') {
1953
- pathname = pathname.split('/');
1954
- pathname.splice(pathname.length - 1);
1955
- pathname = pathname.join('/');
1956
- loginPage = pathname + '/' + loginPage.replace('./', '');
1957
- } else {
1958
- loginPage = pathname + loginPage.replace('./', '');
1959
- }
1957
+ if (loginPage) {
1958
+ sessionStorage.setItem('loginPage', loginPage);
1959
+ if (!startWith(loginPage, ['http', '/'], true)) {
1960
+ var pathname = win.top.location.pathname;
1961
+ if (pathname !== '/') {
1962
+ pathname = pathname.split('/');
1963
+ pathname.splice(pathname.length - 1);
1964
+ pathname = pathname.join('/');
1965
+ loginPage = pathname + '/' + loginPage.replace('./', '');
1966
+ } else {
1967
+ loginPage = pathname + loginPage.replace('./', '');
1960
1968
  }
1961
1969
  }
1962
- next();
1970
+ }
1971
+ var token = getStorage('token') || getStorage('Authorization');
1972
+ var logined = getStorage('logined');
1973
+ // eslint-disable-next-line eqeqeq
1974
+ if (token || logined || cookie == true || cookie == 1) {
1975
+ next && next();
1963
1976
  } else {
1964
- var token = getStorage('token') || getStorage('Authorization');
1965
1977
  if (!token && Object.prototype.hasOwnProperty.call(to.query, 'serverId') && Object.prototype.hasOwnProperty.call(to.query, 'authType')) {
1966
1978
  ajax({
1967
1979
  method: 'post',
@@ -2016,7 +2028,7 @@ var isLogined = function isLogined(_ref8) {
2016
2028
  }
2017
2029
  break;
2018
2030
  case 4:
2019
- eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
2031
+ eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
2020
2032
  confirmButtonText: '确定',
2021
2033
  type: 'error',
2022
2034
  callback: function callback() {
@@ -2036,7 +2048,7 @@ var isLogined = function isLogined(_ref8) {
2036
2048
  default:
2037
2049
  }
2038
2050
  } else {
2039
- eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].alert(res.msg, '提示', {
2051
+ eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].alert(res.msg, '提示', {
2040
2052
  confirmButtonText: '确定',
2041
2053
  type: 'error',
2042
2054
  callback: function callback() {
@@ -2167,7 +2179,7 @@ var loadJs = function loadJs(_ref10) {
2167
2179
  **/
2168
2180
  var loading = function loading($loading, res) {
2169
2181
  if (!$loading) {
2170
- $loading = eoss_element__WEBPACK_IMPORTED_MODULE_4__["Loading"].service;
2182
+ $loading = eoss_element__WEBPACK_IMPORTED_MODULE_6__["Loading"].service;
2171
2183
  }
2172
2184
  if (isObject(res)) {
2173
2185
  var config = extend({}, {
@@ -2526,6 +2538,70 @@ var setStorage = function setStorage(_ref14) {
2526
2538
  }
2527
2539
  };
2528
2540
 
2541
+ /**
2542
+ * socket
2543
+ * @desc:webSocket
2544
+ * @author huangbo
2545
+ * @date 2022年5月7日
2546
+ * @param {String} [url] - 连接地址
2547
+ * @param {String} [take] - 订阅地址
2548
+ * @param {String} [debug] - 调试
2549
+ * @param {String} [interval] - 重连间隔时间
2550
+ **/
2551
+ function socket(options) {
2552
+ var nextDate = 0;
2553
+ var connect = 1;
2554
+ return new Promise(function (resolve, reject) {
2555
+ var wshost = getStorage('wshost') || '';
2556
+ var option = {
2557
+ url: wshost + _config_api__WEBPACK_IMPORTED_MODULE_0__[/* wss */ "Zb"],
2558
+ take: _config_api__WEBPACK_IMPORTED_MODULE_0__[/* topic */ "Qb"],
2559
+ debug: true,
2560
+ interval: 20
2561
+ };
2562
+ var websocket = win.websocket || {};
2563
+ if (options && isObject(options)) {
2564
+ option = _extends({}, option, options);
2565
+ }
2566
+ var key = window.btoa(option.url);
2567
+ if (!websocket[key]) {
2568
+ websocket[key] = { socket: new sockjs_client__WEBPACK_IMPORTED_MODULE_4___default.a(option.url) };
2569
+ win.websocket = websocket;
2570
+ }
2571
+
2572
+ var client = websocket[key] ? websocket[key].client : null;
2573
+ if (!client) {
2574
+ client = websocket[key].client = stompjs__WEBPACK_IMPORTED_MODULE_5___default.a.over(websocket[key].socket);
2575
+ !option.debug && (client.debug = null);
2576
+ }
2577
+ client.connect({}, function () {
2578
+ client.subscribe(option.take, function (response) {
2579
+ var res = JSON.parse(response.body);
2580
+ resolve(res, function () {
2581
+ client.disconnect();
2582
+ win.top.websocket && win.top.websocket[key] && delete win.top.websocket[key];
2583
+ }, client, websocket[key]);
2584
+ });
2585
+ }, function (error) {
2586
+ var diffSecond = parseInt((new Date() - nextDate) / 1000, 10);
2587
+ if (connect > 5 && diffSecond < option.interval) {
2588
+ client.disconnect();
2589
+ if (win.top.websocket) {
2590
+ if (Object.keys(win.top.websocket).length > 1) {
2591
+ delete win.top.websocket[key];
2592
+ } else {
2593
+ delete win.top.websocket;
2594
+ }
2595
+ }
2596
+ } else {
2597
+ win.top.websocket && win.top.websocket[key] && setTimeout(function () {
2598
+ socket(options);
2599
+ }, 5000);
2600
+ }
2601
+ reject(error);
2602
+ });
2603
+ });
2604
+ }
2529
2605
  /**
2530
2606
  * sum
2531
2607
  * @desc 求和
@@ -2778,7 +2854,6 @@ var urlJoinParams = function urlJoinParams(_ref15) {
2778
2854
  params[items[0]] = items[1];
2779
2855
  });
2780
2856
  }
2781
- '&_tt=' + new Date().getTime();
2782
2857
  params = extend(true, params, param);
2783
2858
  var str = queryParams(params);
2784
2859
  if (str) {
@@ -2946,6 +3021,7 @@ var watermark = function watermark(option) {
2946
3021
  sendMessage: sendMessage,
2947
3022
  setFavicon: setFavicon,
2948
3023
  setStorage: setStorage,
3024
+ socket: socket,
2949
3025
  startWith: startWith,
2950
3026
  sum: sum,
2951
3027
  takeLeft: takeLeft,
@@ -3916,6 +3992,20 @@ module.exports = require("json-bigint");
3916
3992
  /***/ 7:
3917
3993
  /***/ (function(module, exports) {
3918
3994
 
3995
+ module.exports = require("sockjs-client");
3996
+
3997
+ /***/ }),
3998
+
3999
+ /***/ 8:
4000
+ /***/ (function(module, exports) {
4001
+
4002
+ module.exports = require("stompjs");
4003
+
4004
+ /***/ }),
4005
+
4006
+ /***/ 9:
4007
+ /***/ (function(module, exports) {
4008
+
3919
4009
  module.exports = require("sm-crypto");
3920
4010
 
3921
4011
  /***/ })