eoss-ui 0.4.99 → 0.5.11

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 (123) hide show
  1. package/CHANGELOG.md +929 -0
  2. package/lib/button-group.js +118 -43
  3. package/lib/button.js +119 -44
  4. package/lib/checkbox-group.js +199 -112
  5. package/lib/data-table-form.js +118 -47
  6. package/lib/data-table.js +192 -100
  7. package/lib/date-picker.js +118 -43
  8. package/lib/dialog.js +128 -57
  9. package/lib/eoss-ui.common.js +1174 -1167
  10. package/lib/flow-group.js +118 -43
  11. package/lib/flow-list.js +137 -52
  12. package/lib/flow.js +123 -52
  13. package/lib/form.js +673 -547
  14. package/lib/handle-user.js +143 -68
  15. package/lib/handler.js +118 -43
  16. package/lib/icons.js +2 -2
  17. package/lib/index.js +1 -1
  18. package/lib/input-number.js +119 -44
  19. package/lib/input.js +121 -46
  20. package/lib/layout.js +2 -2
  21. package/lib/login.js +124 -52
  22. package/lib/main.js +299 -386
  23. package/lib/nav.js +118 -43
  24. package/lib/page.js +118 -43
  25. package/lib/player.js +120 -45
  26. package/lib/qr-code.js +118 -43
  27. package/lib/radio-group.js +148 -71
  28. package/lib/retrial-auth.js +118 -43
  29. package/lib/select-ganged.js +119 -44
  30. package/lib/select.js +143 -68
  31. package/lib/selector-panel.js +172 -90
  32. package/lib/selector.js +118 -43
  33. package/lib/sizer.js +121 -46
  34. package/lib/steps.js +118 -43
  35. package/lib/switch.js +119 -44
  36. package/lib/table-form.js +184 -109
  37. package/lib/tabs.js +118 -43
  38. package/lib/theme-chalk/index.css +1 -1
  39. package/lib/theme-chalk/pagination.css +1 -1
  40. package/lib/theme-chalk/toolbar.css +1 -1
  41. package/lib/tips.js +118 -43
  42. package/lib/toolbar.js +19 -9
  43. package/lib/tree-group.js +118 -43
  44. package/lib/tree.js +118 -43
  45. package/lib/upload.js +207 -125
  46. package/lib/utils/util.js +98 -35
  47. package/lib/wujie.js +118 -43
  48. package/lib/wxlogin.js +118 -43
  49. package/package.json +1 -1
  50. package/packages/button/src/main.vue +1 -10
  51. package/packages/data-table/src/column.vue +6 -0
  52. package/packages/data-table/src/main.vue +14 -6
  53. package/packages/flow-list/src/main.vue +4 -3
  54. package/packages/form/src/main.vue +71 -47
  55. package/packages/form/src/table.vue +12 -11
  56. package/packages/login/src/main.vue +1 -0
  57. package/packages/main/src/main.vue +118 -247
  58. package/packages/radio-group/src/main.vue +2 -5
  59. package/packages/theme-chalk/lib/base.css +1 -0
  60. package/packages/theme-chalk/lib/button-group.css +1 -0
  61. package/packages/theme-chalk/lib/button.css +0 -0
  62. package/packages/theme-chalk/lib/card.css +1 -0
  63. package/packages/theme-chalk/lib/cascader.css +0 -0
  64. package/packages/theme-chalk/lib/checkbox-group.css +1 -0
  65. package/packages/theme-chalk/lib/clients.css +1 -0
  66. package/packages/theme-chalk/lib/data-table-form.css +1 -0
  67. package/packages/theme-chalk/lib/data-table.css +1 -0
  68. package/packages/theme-chalk/lib/date-picker.css +1 -0
  69. package/packages/theme-chalk/lib/dialog.css +1 -0
  70. package/packages/theme-chalk/lib/enterprise.css +1 -0
  71. package/packages/theme-chalk/lib/error-page.css +1 -0
  72. package/packages/theme-chalk/lib/flow-chart.css +0 -0
  73. package/packages/theme-chalk/lib/flow-group.css +1 -0
  74. package/packages/theme-chalk/lib/flow-list.css +1 -0
  75. package/packages/theme-chalk/lib/flow.css +1 -0
  76. package/packages/theme-chalk/lib/fonts/iconfont.ttf +0 -0
  77. package/packages/theme-chalk/lib/fonts/iconfont.woff +0 -0
  78. package/packages/theme-chalk/lib/form.css +1 -0
  79. package/packages/theme-chalk/lib/handle-user.css +1 -0
  80. package/packages/theme-chalk/lib/handler.css +1 -0
  81. package/packages/theme-chalk/lib/icon.css +1 -0
  82. package/packages/theme-chalk/lib/icons.css +1 -0
  83. package/packages/theme-chalk/lib/index.css +1 -0
  84. package/packages/theme-chalk/lib/input-number.css +0 -0
  85. package/packages/theme-chalk/lib/input.css +1 -0
  86. package/packages/theme-chalk/lib/label.css +1 -0
  87. package/packages/theme-chalk/lib/layout.css +1 -0
  88. package/packages/theme-chalk/lib/login.css +1 -0
  89. package/packages/theme-chalk/lib/main.css +1 -0
  90. package/packages/theme-chalk/lib/mainComp.css +0 -0
  91. package/packages/theme-chalk/lib/menu.css +1 -0
  92. package/packages/theme-chalk/lib/nav.css +1 -0
  93. package/packages/theme-chalk/lib/notify.css +0 -0
  94. package/packages/theme-chalk/lib/page.css +1 -0
  95. package/packages/theme-chalk/lib/pagination.css +1 -0
  96. package/packages/theme-chalk/lib/player.css +1 -0
  97. package/packages/theme-chalk/lib/qr-code.css +1 -0
  98. package/packages/theme-chalk/lib/radio-group.css +1 -0
  99. package/packages/theme-chalk/lib/retrial-auth.css +1 -0
  100. package/packages/theme-chalk/lib/select-ganged.css +1 -0
  101. package/packages/theme-chalk/lib/select.css +0 -0
  102. package/packages/theme-chalk/lib/selector-panel.css +1 -0
  103. package/packages/theme-chalk/lib/selector.css +1 -0
  104. package/packages/theme-chalk/lib/sizer.css +1 -0
  105. package/packages/theme-chalk/lib/steps.css +1 -0
  106. package/packages/theme-chalk/lib/switch.css +1 -0
  107. package/packages/theme-chalk/lib/table-form.css +0 -0
  108. package/packages/theme-chalk/lib/tabs-panel.css +0 -0
  109. package/packages/theme-chalk/lib/tabs.css +1 -0
  110. package/packages/theme-chalk/lib/tips.css +1 -0
  111. package/packages/theme-chalk/lib/toolbar.css +1 -0
  112. package/packages/theme-chalk/lib/tree-group.css +1 -0
  113. package/packages/theme-chalk/lib/tree.css +1 -0
  114. package/packages/theme-chalk/lib/upload.css +1 -0
  115. package/packages/theme-chalk/lib/wujie.css +0 -0
  116. package/packages/theme-chalk/lib/wxlogin.css +1 -0
  117. package/packages/theme-chalk/src/pagination.scss +8 -0
  118. package/packages/theme-chalk/src/toolbar.scss +1 -0
  119. package/packages/toolbar/src/main.vue +17 -8
  120. package/packages/upload/src/main.vue +0 -1
  121. package/src/index.js +1 -1
  122. package/src/utils/util.js +97 -37
  123. package/packages/theme-chalk/gulpfile.js +0 -25
package/lib/main.js CHANGED
@@ -97,8 +97,14 @@ module.exports =
97
97
  /* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_2__);
98
98
  /* harmony import */ var json_bigint__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6);
99
99
  /* harmony import */ var json_bigint__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(json_bigint__WEBPACK_IMPORTED_MODULE_3__);
100
- /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2);
101
- /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(eoss_element__WEBPACK_IMPORTED_MODULE_4__);
100
+ /* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
101
+ /* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(sockjs_client__WEBPACK_IMPORTED_MODULE_4__);
102
+ /* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8);
103
+ /* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(stompjs__WEBPACK_IMPORTED_MODULE_5__);
104
+ /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2);
105
+ /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(eoss_element__WEBPACK_IMPORTED_MODULE_6__);
106
+ 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; };
107
+
102
108
  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; };
103
109
 
104
110
  /**
@@ -109,7 +115,9 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
109
115
  **/
110
116
 
111
117
  /* eslint-disable indent */
112
- var sm2 = __webpack_require__(7).sm2;
118
+ var sm2 = __webpack_require__(9).sm2;
119
+
120
+
113
121
 
114
122
 
115
123
 
@@ -256,7 +264,7 @@ var ajax = function ajax(_ref) {
256
264
  clearTimeout(loginMsg);
257
265
  loginMsg = setTimeout(function () {
258
266
  sessionStorage.setItem('remind', 1);
259
- eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
267
+ eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
260
268
  confirmButtonText: '确定',
261
269
  closeOnClickModal: false,
262
270
  type: 'warning'
@@ -303,7 +311,7 @@ var ajax = function ajax(_ref) {
303
311
  } else if (response.data.rCode === 61) {
304
312
  clearTimeout(initAuth);
305
313
  initAuth = setTimeout(function () {
306
- Object(eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"])({
314
+ Object(eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"])({
307
315
  title: '请进行二次鉴权',
308
316
  closeOnClickModal: false,
309
317
  closeOnPressEscape: false,
@@ -737,6 +745,7 @@ var delUrlParam = function delUrlParam(_ref2) {
737
745
  key.forEach(function (item) {
738
746
  if (param.hasOwnProperty(item)) {
739
747
  var reg = item + '=' + param[item];
748
+ console.log(reg);
740
749
  if (src.indexOf(reg + '&') > -1) {
741
750
  src = src.replace(reg + '&', '');
742
751
  } else if (src.indexOf('&' + reg) > -1) {
@@ -1752,7 +1761,7 @@ var getWeekday = function getWeekday(date) {
1752
1761
  * @param {String} [url] - url地址
1753
1762
  **/
1754
1763
 
1755
- var handlerUrl = function handlerUrl(url, before) {
1764
+ var handlerUrl = function handlerUrl(url, param, before) {
1756
1765
  var arry = url.split('?');
1757
1766
  if (arry.length > 2) {
1758
1767
  var ary = arry.splice(1, arry.length);
@@ -1774,6 +1783,10 @@ var handlerUrl = function handlerUrl(url, before) {
1774
1783
  } else {
1775
1784
  url += '?_tt=' + new Date().getTime();
1776
1785
  }
1786
+ if (param) {
1787
+ var str = queryParams(param);
1788
+ url += '&' + str;
1789
+ }
1777
1790
  if (before && before === arry[0]) {
1778
1791
  var pathname = win.location.pathname;
1779
1792
  if (pathname === '/') {
@@ -1933,7 +1946,6 @@ var isLogined = function isLogined(_ref8) {
1933
1946
  next = _ref8.next,
1934
1947
  _ref8$exclude = _ref8.exclude,
1935
1948
  exclude = _ref8$exclude === undefined ? [] : _ref8$exclude,
1936
- open = _ref8.open,
1937
1949
  cookie = _ref8.cookie,
1938
1950
  loginPage = _ref8.loginPage,
1939
1951
  redirect = _ref8.redirect;
@@ -1941,24 +1953,24 @@ var isLogined = function isLogined(_ref8) {
1941
1953
  if (cookie === undefined) {
1942
1954
  cookie = getParams({ name: 'cookie' });
1943
1955
  }
1956
+ var pathname = win.top.location.pathname;
1944
1957
  if (loginPage) {
1945
1958
  sessionStorage.setItem('loginPage', loginPage);
1946
1959
  if (!startWith(loginPage, ['http', '/'], true)) {
1947
- var pathname = win.top.location.pathname;
1948
1960
  if (pathname !== '/') {
1949
- pathname = pathname.split('/');
1950
- pathname.splice(pathname.length - 1);
1951
- pathname = pathname.join('/');
1952
- loginPage = pathname + '/' + loginPage.replace('./', '');
1961
+ var path = pathname.split('/');
1962
+ path.splice(pathname.length - 1);
1963
+ path = path.join('/');
1964
+ loginPage = path + '/' + loginPage.replace('./', '');
1953
1965
  } else {
1954
1966
  loginPage = pathname + loginPage.replace('./', '');
1955
1967
  }
1956
1968
  }
1957
1969
  }
1958
1970
  var token = getStorage('token') || getStorage('Authorization');
1959
- var logined = getStorage('logined');
1971
+ // const logined = getStorage('logined');
1960
1972
  // eslint-disable-next-line eqeqeq
1961
- if (token || logined || cookie == true || cookie == 1) {
1973
+ if (token || cookie == true || cookie == 1) {
1962
1974
  next && next();
1963
1975
  } else {
1964
1976
  if (!token && Object.prototype.hasOwnProperty.call(to.query, 'serverId') && Object.prototype.hasOwnProperty.call(to.query, 'authType')) {
@@ -1982,40 +1994,25 @@ var isLogined = function isLogined(_ref8) {
1982
1994
  deviceUnique: results.deviceUnique
1983
1995
  }
1984
1996
  });
1985
- next();
1997
+ var url = delUrlParam({
1998
+ url: win.top.location.href,
1999
+ key: ['serverId', 'authType', 'code', 'sessionId']
2000
+ });
2001
+ win.top.location.href = url;
2002
+ setTimeout(function () {
2003
+ win.top.location.reload();
2004
+ }, 200);
1986
2005
  break;
1987
2006
  case 1:
1988
2007
  break;
1989
2008
  case 2:
1990
2009
  break;
1991
2010
  case 3:
1992
- var url = win.top.location.href;
1993
- var href = results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(url));
1994
- if (to.query.openType) {
1995
- switch (to.query.openType) {
1996
- case 'self':
1997
- win.location.href = href;
1998
- break;
1999
- case 'blank':
2000
- win.open(href);
2001
- break;
2002
- case 'top':
2003
- win.top.location.href = href;
2004
- break;
2005
- case 'parent':
2006
- win.parent.location.href = href;
2007
- break;
2008
- }
2009
- } else {
2010
- if (open) {
2011
- win.open(href);
2012
- } else {
2013
- win.top.location.href = href;
2014
- }
2015
- }
2011
+ var href = results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(win.top.location.href));
2012
+ win.top.location.href = href;
2016
2013
  break;
2017
2014
  case 4:
2018
- eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
2015
+ eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
2019
2016
  confirmButtonText: '确定',
2020
2017
  type: 'error',
2021
2018
  callback: function callback() {
@@ -2035,7 +2032,7 @@ var isLogined = function isLogined(_ref8) {
2035
2032
  default:
2036
2033
  }
2037
2034
  } else {
2038
- eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].alert(res.msg, '提示', {
2035
+ eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].alert(res.msg, '提示', {
2039
2036
  confirmButtonText: '确定',
2040
2037
  type: 'error',
2041
2038
  callback: function callback() {
@@ -2166,7 +2163,7 @@ var loadJs = function loadJs(_ref10) {
2166
2163
  **/
2167
2164
  var loading = function loading($loading, res) {
2168
2165
  if (!$loading) {
2169
- $loading = eoss_element__WEBPACK_IMPORTED_MODULE_4__["Loading"].service;
2166
+ $loading = eoss_element__WEBPACK_IMPORTED_MODULE_6__["Loading"].service;
2170
2167
  }
2171
2168
  if (isObject(res)) {
2172
2169
  var config = extend({}, {
@@ -2525,6 +2522,70 @@ var setStorage = function setStorage(_ref14) {
2525
2522
  }
2526
2523
  };
2527
2524
 
2525
+ /**
2526
+ * socket
2527
+ * @desc:webSocket
2528
+ * @author huangbo
2529
+ * @date 2022年5月7日
2530
+ * @param {String} [url] - 连接地址
2531
+ * @param {String} [take] - 订阅地址
2532
+ * @param {String} [debug] - 调试
2533
+ * @param {String} [interval] - 重连间隔时间
2534
+ **/
2535
+ function socket(options) {
2536
+ var nextDate = 0;
2537
+ var connect = 1;
2538
+ return new Promise(function (resolve, reject) {
2539
+ var wshost = getStorage('wshost') || '';
2540
+ var option = {
2541
+ url: wshost + _config_api__WEBPACK_IMPORTED_MODULE_0__[/* wss */ "Zb"],
2542
+ take: _config_api__WEBPACK_IMPORTED_MODULE_0__[/* topic */ "Qb"],
2543
+ debug: true,
2544
+ interval: 20
2545
+ };
2546
+ var websocket = win.websocket || {};
2547
+ if (options && isObject(options)) {
2548
+ option = _extends({}, option, options);
2549
+ }
2550
+ var key = window.btoa(option.url);
2551
+ if (!websocket[key]) {
2552
+ websocket[key] = { socket: new sockjs_client__WEBPACK_IMPORTED_MODULE_4___default.a(option.url) };
2553
+ win.websocket = websocket;
2554
+ }
2555
+
2556
+ var client = websocket[key] ? websocket[key].client : null;
2557
+ if (!client) {
2558
+ client = websocket[key].client = stompjs__WEBPACK_IMPORTED_MODULE_5___default.a.over(websocket[key].socket);
2559
+ !option.debug && (client.debug = null);
2560
+ }
2561
+ client.connect({}, function () {
2562
+ client.subscribe(option.take, function (response) {
2563
+ var res = JSON.parse(response.body);
2564
+ resolve(res, function () {
2565
+ client.disconnect();
2566
+ win.top.websocket && win.top.websocket[key] && delete win.top.websocket[key];
2567
+ }, client, websocket[key]);
2568
+ });
2569
+ }, function (error) {
2570
+ var diffSecond = parseInt((new Date() - nextDate) / 1000, 10);
2571
+ if (connect > 5 && diffSecond < option.interval) {
2572
+ client.disconnect();
2573
+ if (win.top.websocket) {
2574
+ if (Object.keys(win.top.websocket).length > 1) {
2575
+ delete win.top.websocket[key];
2576
+ } else {
2577
+ delete win.top.websocket;
2578
+ }
2579
+ }
2580
+ } else {
2581
+ win.top.websocket && win.top.websocket[key] && setTimeout(function () {
2582
+ socket(options);
2583
+ }, 5000);
2584
+ }
2585
+ reject(error);
2586
+ });
2587
+ });
2588
+ }
2528
2589
  /**
2529
2590
  * sum
2530
2591
  * @desc 求和
@@ -2777,7 +2838,6 @@ var urlJoinParams = function urlJoinParams(_ref15) {
2777
2838
  params[items[0]] = items[1];
2778
2839
  });
2779
2840
  }
2780
- '&_tt=' + new Date().getTime();
2781
2841
  params = extend(true, params, param);
2782
2842
  var str = queryParams(params);
2783
2843
  if (str) {
@@ -2945,6 +3005,7 @@ var watermark = function watermark(option) {
2945
3005
  sendMessage: sendMessage,
2946
3006
  setFavicon: setFavicon,
2947
3007
  setStorage: setStorage,
3008
+ socket: socket,
2948
3009
  startWith: startWith,
2949
3010
  sum: sum,
2950
3011
  takeLeft: takeLeft,
@@ -3433,10 +3494,22 @@ module.exports = require("json-bigint");
3433
3494
  /* 7 */
3434
3495
  /***/ (function(module, exports) {
3435
3496
 
3436
- module.exports = require("sm-crypto");
3497
+ module.exports = require("sockjs-client");
3437
3498
 
3438
3499
  /***/ }),
3439
3500
  /* 8 */
3501
+ /***/ (function(module, exports) {
3502
+
3503
+ module.exports = require("stompjs");
3504
+
3505
+ /***/ }),
3506
+ /* 9 */
3507
+ /***/ (function(module, exports) {
3508
+
3509
+ module.exports = require("sm-crypto");
3510
+
3511
+ /***/ }),
3512
+ /* 10 */
3440
3513
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3441
3514
 
3442
3515
  "use strict";
@@ -3463,36 +3536,24 @@ window.__store = store;
3463
3536
  /* harmony default export */ __webpack_exports__["a"] = (store);
3464
3537
 
3465
3538
  /***/ }),
3466
- /* 9 */
3539
+ /* 11 */
3467
3540
  /***/ (function(module, exports) {
3468
3541
 
3469
3542
  module.exports = require("babel-runtime/regenerator");
3470
3543
 
3471
3544
  /***/ }),
3472
- /* 10 */,
3473
- /* 11 */,
3474
3545
  /* 12 */,
3475
3546
  /* 13 */,
3476
3547
  /* 14 */,
3477
3548
  /* 15 */,
3478
3549
  /* 16 */,
3479
3550
  /* 17 */,
3480
- /* 18 */
3481
- /***/ (function(module, exports) {
3482
-
3483
- module.exports = require("runtime-import");
3484
-
3485
- /***/ }),
3486
- /* 19 */
3487
- /***/ (function(module, exports) {
3488
-
3489
- module.exports = require("sockjs-client");
3490
-
3491
- /***/ }),
3551
+ /* 18 */,
3552
+ /* 19 */,
3492
3553
  /* 20 */
3493
3554
  /***/ (function(module, exports) {
3494
3555
 
3495
- module.exports = require("stompjs");
3556
+ module.exports = require("runtime-import");
3496
3557
 
3497
3558
  /***/ }),
3498
3559
  /* 21 */,
@@ -3510,7 +3571,7 @@ module.exports = require("stompjs");
3510
3571
  // ESM COMPAT FLAG
3511
3572
  __webpack_require__.r(__webpack_exports__);
3512
3573
 
3513
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/main/src/main.vue?vue&type=template&id=6d42b802&
3574
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/main/src/main.vue?vue&type=template&id=e6267c3c&
3514
3575
  var render = function () {
3515
3576
  var _vm = this
3516
3577
  var _h = _vm.$createElement
@@ -3940,11 +4001,7 @@ var staticRenderFns = []
3940
4001
  render._withStripped = true
3941
4002
 
3942
4003
 
3943
- // CONCATENATED MODULE: ./packages/main/src/main.vue?vue&type=template&id=6d42b802&
3944
-
3945
- // EXTERNAL MODULE: external "babel-runtime/regenerator"
3946
- var regenerator_ = __webpack_require__(9);
3947
- var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator_);
4004
+ // CONCATENATED MODULE: ./packages/main/src/main.vue?vue&type=template&id=e6267c3c&
3948
4005
 
3949
4006
  // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/main/src/userinfo.vue?vue&type=template&id=799780ee&
3950
4007
  var userinfovue_type_template_id_799780ee_render = function () {
@@ -3973,7 +4030,7 @@ userinfovue_type_template_id_799780ee_render._withStripped = true
3973
4030
  var api = __webpack_require__(1);
3974
4031
 
3975
4032
  // EXTERNAL MODULE: ./src/utils/store.js
3976
- var store = __webpack_require__(8);
4033
+ var store = __webpack_require__(10);
3977
4034
 
3978
4035
  // EXTERNAL MODULE: ./src/utils/util.js
3979
4036
  var util = __webpack_require__(0);
@@ -5589,8 +5646,12 @@ async_componentvue_type_template_id_51f0233c_scoped_true_render._withStripped =
5589
5646
 
5590
5647
  // CONCATENATED MODULE: ./packages/main/src/async-component/index.vue?vue&type=template&id=51f0233c&scoped=true&
5591
5648
 
5649
+ // EXTERNAL MODULE: external "babel-runtime/regenerator"
5650
+ var regenerator_ = __webpack_require__(11);
5651
+ var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator_);
5652
+
5592
5653
  // EXTERNAL MODULE: external "runtime-import"
5593
- var external_runtime_import_ = __webpack_require__(18);
5654
+ var external_runtime_import_ = __webpack_require__(20);
5594
5655
 
5595
5656
  // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/main/src/async-component/index.vue?vue&type=script&lang=js&
5596
5657
 
@@ -5741,21 +5802,9 @@ var async_component_component = Object(componentNormalizer["a" /* default */])(
5741
5802
  )
5742
5803
 
5743
5804
  /* harmony default export */ var async_component = (async_component_component.exports);
5744
- // EXTERNAL MODULE: external "sockjs-client"
5745
- var external_sockjs_client_ = __webpack_require__(19);
5746
- var external_sockjs_client_default = /*#__PURE__*/__webpack_require__.n(external_sockjs_client_);
5747
-
5748
- // EXTERNAL MODULE: external "stompjs"
5749
- var external_stompjs_ = __webpack_require__(20);
5750
- var external_stompjs_default = /*#__PURE__*/__webpack_require__.n(external_stompjs_);
5751
-
5752
5805
  // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/main/src/main.vue?vue&type=script&lang=js&
5753
-
5754
-
5755
5806
  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; };
5756
5807
 
5757
- function mainvue_type_script_lang_js_asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
5758
-
5759
5808
  //
5760
5809
  //
5761
5810
  //
@@ -6013,13 +6062,17 @@ function mainvue_type_script_lang_js_asyncToGenerator(fn) { return function () {
6013
6062
 
6014
6063
 
6015
6064
 
6016
-
6017
-
6018
6065
  var isIE = navigator.userAgent.indexOf('MSIE') != -1;
6019
6066
  var log = util["a" /* default */].getParams('console');
6020
6067
  /* harmony default export */ var mainvue_type_script_lang_js_ = ({
6021
6068
  name: 'EsMain',
6022
6069
  inheritAttrs: false,
6070
+ provide: function provide() {
6071
+ return {
6072
+ esMain: this
6073
+ };
6074
+ },
6075
+
6023
6076
  components: {
6024
6077
  userinfo: userinfo,
6025
6078
  settings: settings,
@@ -6282,8 +6335,7 @@ var log = util["a" /* default */].getParams('console');
6282
6335
  copyright: { comp: '', data: {} }
6283
6336
  },
6284
6337
  pageLoading: false,
6285
- client: null,
6286
- websocket: null,
6338
+ close: null,
6287
6339
  connect: 0,
6288
6340
  wjName: 'singlespa',
6289
6341
  menus: '',
@@ -6366,14 +6418,11 @@ var log = util["a" /* default */].getParams('console');
6366
6418
  },
6367
6419
  created: function created() {
6368
6420
  var params = util["a" /* default */].getParams() || {};
6369
- if (Object.prototype.hasOwnProperty.call(params, 'history')) {
6370
- this.history = params.history == true || params.history == 'true' || params.history == 1;
6371
- }
6372
6421
  this.homePage = typeof this.loadHomePage === 'string' ? this.loadHomePage : '';
6373
6422
  this.isHeader = params.header;
6374
6423
  var sysLogoIco = sessionStorage.getItem('sysLogoIco');
6375
6424
  sysLogoIco && util["a" /* default */].setFavicon(sysLogoIco);
6376
- this.isLogin(params);
6425
+ this.getConfig(params);
6377
6426
  },
6378
6427
  mounted: function mounted() {
6379
6428
  util["a" /* default */].win.reLogin = this.handleReLogin;
@@ -6389,156 +6438,6 @@ var log = util["a" /* default */].getParams('console');
6389
6438
  },
6390
6439
 
6391
6440
  methods: {
6392
- isLogin: function isLogin(query) {
6393
- var _this = this;
6394
-
6395
- return mainvue_type_script_lang_js_asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee() {
6396
- var token, loginPage, pathname;
6397
- return regenerator_default.a.wrap(function _callee$(_context) {
6398
- while (1) {
6399
- switch (_context.prev = _context.next) {
6400
- case 0:
6401
- token = util["a" /* default */].getStorage('token') || util["a" /* default */].getStorage('Authorization');
6402
- loginPage = util["a" /* default */].getStorage('login') || util["a" /* default */].getStorage('loginPage');
6403
-
6404
- if (loginPage) {
6405
- if (!util["a" /* default */].startWith(loginPage, ['http', '/'], true)) {
6406
- pathname = util["a" /* default */].win.top.location.pathname;
6407
-
6408
- if (pathname !== '/') {
6409
- pathname = pathname.split('/');
6410
- pathname.splice(pathname.length - 1);
6411
- pathname = pathname.join('/');
6412
- loginPage = pathname + '/' + loginPage.replace('./', '');
6413
- } else {
6414
- loginPage = pathname + loginPage.replace('./', '');
6415
- }
6416
- }
6417
- }
6418
-
6419
- if (!(!token && query && Object.prototype.hasOwnProperty.call(query, 'serverId') && Object.prototype.hasOwnProperty.call(query, 'authType'))) {
6420
- _context.next = 8;
6421
- break;
6422
- }
6423
-
6424
- _context.next = 6;
6425
- return util["a" /* default */].ajax({
6426
- method: 'post',
6427
- url: api["b" /* authCenter */],
6428
- data: query
6429
- }).then(function (res) {
6430
- if (res.rCode === 0) {
6431
- var results = res.results;
6432
-
6433
- switch (results.statusCode) {
6434
- case 0:
6435
- util["a" /* default */].setStorage({
6436
- type: _this.storage,
6437
- key: {
6438
- ssId: results.ssId,
6439
- token: results.token,
6440
- Authorization: results.token,
6441
- deviceUnique: results.deviceUnique
6442
- }
6443
- });
6444
- if (query.openType) {
6445
- var _url2 = util["a" /* default */].win.top.location.href;
6446
- var newUrl = util["a" /* default */].delUrlParam({
6447
- url: _url2,
6448
- key: ['serverId', 'authType', 'openType']
6449
- });
6450
- switch (query.openType) {
6451
- case 'self':
6452
- util["a" /* default */].win.location.href = newUrl;
6453
- break;
6454
- case 'blank':
6455
- util["a" /* default */].win.open(newUrl);
6456
- break;
6457
- case 'parent':
6458
- util["a" /* default */].win.parent.location.href = _href;
6459
- break;
6460
- default:
6461
- util["a" /* default */].win.top.location.href = _href;
6462
- }
6463
- } else {
6464
- _this.getConfig();
6465
- }
6466
- break;
6467
- case 1:
6468
- break;
6469
- case 2:
6470
- break;
6471
- case 3:
6472
- var _href = results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(url));
6473
- switch (query.openType) {
6474
- case 'self':
6475
- util["a" /* default */].win.location.href = _href;
6476
- break;
6477
- case 'blank':
6478
- util["a" /* default */].win.open(_href);
6479
- break;
6480
- case 'parent':
6481
- util["a" /* default */].win.parent.location.href = _href;
6482
- break;
6483
- default:
6484
- util["a" /* default */].win.top.location.href = _href;
6485
- }
6486
- break;
6487
- case 4:
6488
- _this.$alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
6489
- confirmButtonText: '确定',
6490
- type: 'error',
6491
- callback: function callback() {
6492
- sessionStorage.setItem('extUserBindHandleId', results.extUserBindHandleId);
6493
- //window.location.href = delUrlParam({ key: 'code' });
6494
- if (loginPage) {
6495
- util["a" /* default */].win.top.location.replace(loginPage);
6496
- } else if (document.referrer) {
6497
- util["a" /* default */].win.top.location.replace(document.referrer);
6498
- } else if (util["a" /* default */].win.top.location.href.indexOf('main.html') > -1) {
6499
- util["a" /* default */].win.top.location.href = './login.html';
6500
- } else {
6501
- _this.$router.replace('/login');
6502
- }
6503
- }
6504
- });
6505
- break;
6506
- default:
6507
- }
6508
- } else {
6509
- _this.$alert(res.msg, '提示', {
6510
- confirmButtonText: '确定',
6511
- type: 'error',
6512
- callback: function callback() {
6513
- if (loginPage) {
6514
- util["a" /* default */].win.top.location.replace(loginPage);
6515
- } else if (document.referrer) {
6516
- util["a" /* default */].win.top.location.replace(document.referrer);
6517
- } else if (util["a" /* default */].win.top.location.href.indexOf('main.html') > -1) {
6518
- util["a" /* default */].win.top.location.href = './login.html';
6519
- } else {
6520
- _this.$router.replace('/login');
6521
- }
6522
- }
6523
- });
6524
- }
6525
- }).catch(function (e) {});
6526
-
6527
- case 6:
6528
- _context.next = 9;
6529
- break;
6530
-
6531
- case 8:
6532
- _this.getConfig();
6533
-
6534
- case 9:
6535
- case 'end':
6536
- return _context.stop();
6537
- }
6538
- }
6539
- }, _callee, _this);
6540
- }))();
6541
- },
6542
6441
  menuSuccess: function menuSuccess(res) {
6543
6442
  // this.menus
6544
6443
  this.menuType = 'custom';
@@ -6550,14 +6449,14 @@ var log = util["a" /* default */].getParams('console');
6550
6449
 
6551
6450
  //获取主题模板JSON
6552
6451
  getMainDetail: function getMainDetail(id) {
6553
- var _this2 = this;
6452
+ var _this = this;
6554
6453
 
6555
6454
  var params = {
6556
6455
  url: api["cb" /* mainDetail */],
6557
6456
  params: { id: id }
6558
6457
  };
6559
6458
  util["a" /* default */].ajax(params).then(function (res) {
6560
- var _that = _this2;
6459
+ var _that = _this;
6561
6460
  if (!res.results) {
6562
6461
  _that.showDefault = true;
6563
6462
  }
@@ -6593,7 +6492,7 @@ var log = util["a" /* default */].getParams('console');
6593
6492
  }
6594
6493
  }).catch(function (err) {
6595
6494
  if (err.message && err.message !== 'canceled') {
6596
- _this2.$message.error(err.message);
6495
+ _this.$message.error(err.message);
6597
6496
  }
6598
6497
  });
6599
6498
  },
@@ -6635,7 +6534,7 @@ var log = util["a" /* default */].getParams('console');
6635
6534
  this.navIds = ids;
6636
6535
  this.setTitle(ids[0]);
6637
6536
  }
6638
- } else if (sessionStorage.getItem('jump') && this.history) {
6537
+ } else if (sessionStorage.getItem('jump') && this.isHistory) {
6639
6538
  var _ids = this.getId(this.menus, sessionStorage.getItem('jump'), true);
6640
6539
  if (_ids) {
6641
6540
  this.defaultActive = _ids;
@@ -6654,7 +6553,7 @@ var log = util["a" /* default */].getParams('console');
6654
6553
  this.navIds = _ids2;
6655
6554
  this.setTitle(_ids2[0]);
6656
6555
  }
6657
- } else if (sessionStorage.getItem('jump') && this.history) {
6556
+ } else if (sessionStorage.getItem('jump') && this.isHistory) {
6658
6557
  var _ids3 = this.getId(this.menus, sessionStorage.getItem('jump'), true);
6659
6558
  if (_ids3) {
6660
6559
  this.defaultActive = _ids3;
@@ -6669,7 +6568,7 @@ var log = util["a" /* default */].getParams('console');
6669
6568
 
6670
6569
  //设置主题颜色
6671
6570
  setTheme: function setTheme(color) {
6672
- var _this3 = this;
6571
+ var _this2 = this;
6673
6572
 
6674
6573
  if (!color) {
6675
6574
  return;
@@ -6680,24 +6579,24 @@ var log = util["a" /* default */].getParams('console');
6680
6579
  data: { color: escape(color.toLowerCase()) }
6681
6580
  }).then(function (res) {
6682
6581
  if (res.rCode === 0) {
6683
- _this3.color = color;
6582
+ _this2.color = color;
6684
6583
  localStorage.setItem('theme', color);
6685
6584
  var _mainConfig = JSON.parse(util["a" /* default */].getStorage('mainConfig'));
6686
- _mainConfig.userStyle.color = _this3.color;
6585
+ _mainConfig.userStyle.color = _this2.color;
6687
6586
  sessionStorage.setItem('mainConfig', JSON.stringify(_mainConfig));
6688
- _this3.$emit('setting', 'theme', _this3.color);
6689
- _this3.$message({
6587
+ _this2.$emit('setting', 'theme', _this2.color);
6588
+ _this2.$message({
6690
6589
  message: res.msg,
6691
6590
  type: 'success',
6692
6591
  duration: 2000
6693
6592
  });
6694
6593
  } else {
6695
6594
  var msg = res.msg || '系统错误,请联系管理员!';
6696
- _this3.$message.error(msg);
6595
+ _this2.$message.error(msg);
6697
6596
  }
6698
6597
  }).catch(function (err) {
6699
6598
  if (err.message && err.message !== 'canceled') {
6700
- _this3.$message.error(err.message);
6599
+ _this2.$message.error(err.message);
6701
6600
  }
6702
6601
  });
6703
6602
  },
@@ -6729,18 +6628,28 @@ var log = util["a" /* default */].getParams('console');
6729
6628
  this.results[i] = results[i].split(',');
6730
6629
  }
6731
6630
  if (i === 'indexUrl' && this.loadHomePage) {
6732
- this.homePage = typeof this.loadHomePage === 'string' ? this.loadHomePage : results[i];
6733
- if (this.isHomePage && this.homePage) {
6734
- if (this.menus && this.menus.length) {
6735
- var ids = null;
6736
- this.homePage && (ids = this.getId(this.menus, this.homePage));
6737
- if (ids) {
6738
- this.defaultActive = ids;
6739
- } else if (this.homePage) {
6740
- this.handleJump(this.homePage);
6631
+ var applicationid = util["a" /* default */].getParams('applicationid') || util["a" /* default */].getParams('applicationId');
6632
+ var hash = util["a" /* default */].win.location.hash;
6633
+ if (hash) {
6634
+ hash = hash.split('?')[0];
6635
+ }
6636
+ var jump = sessionStorage.getItem('jump');
6637
+ if (!applicationid && (!jump || !this.isHistory) && hash === '#/' && hash === '#/main') {
6638
+ this.homePage = typeof this.loadHomePage === 'string' ? this.loadHomePage : results[i];
6639
+ if (this.isHomePage && this.homePage) {
6640
+ if (this.menus && this.menus.length) {
6641
+ var ids = null;
6642
+ this.homePage && (ids = this.getId(this.menus, this.homePage));
6643
+ if (ids) {
6644
+ this.defaultActive = ids;
6645
+ } else if (this.homePage) {
6646
+ this.handleJump(this.homePage);
6647
+ }
6648
+ this.setMenu(this.menus);
6741
6649
  }
6742
- this.setMenu(this.menus);
6743
6650
  }
6651
+ } else if (this.menus && this.menus.length) {
6652
+ this.setMenu(this.menus);
6744
6653
  }
6745
6654
  }
6746
6655
  if (i === 'doorIndex' && results[i]) {
@@ -6774,9 +6683,13 @@ var log = util["a" /* default */].getParams('console');
6774
6683
  },
6775
6684
 
6776
6685
  //获取用户配置及信息
6777
- getConfig: function getConfig() {
6778
- var _this4 = this;
6686
+ getConfig: function getConfig(query) {
6687
+ var _this3 = this;
6779
6688
 
6689
+ var token = util["a" /* default */].getStorage('token') || util["a" /* default */].getStorage('Authorization');
6690
+ if (!token && Object.prototype.hasOwnProperty.call(query, 'serverId') && Object.prototype.hasOwnProperty.call(query, 'authType')) {
6691
+ return false;
6692
+ }
6780
6693
  if (util["a" /* default */].getStorage('mainConfig')) {
6781
6694
  var results = JSON.parse(util["a" /* default */].getStorage('mainConfig'));
6782
6695
  this.setConfig(results);
@@ -6789,58 +6702,62 @@ var log = util["a" /* default */].getParams('console');
6789
6702
  }
6790
6703
  util["a" /* default */].ajax({ url: this.mainConfig }).then(function (res) {
6791
6704
  if (res && res.rCode === 0) {
6792
- _this4.setConfig(res.results, 1);
6793
- if (_this4.socket) {
6794
- _this4.initWebSocket();
6705
+ _this3.setConfig(res.results, 1);
6706
+ if (_this3.socket) {
6707
+ _this3.initWebSocket();
6795
6708
  }
6796
- if (_this4.remote) {
6797
- _this4.getMenu();
6709
+ if (_this3.remote) {
6710
+ _this3.getMenu();
6798
6711
  } else {
6799
- _this4.renderMenu();
6712
+ _this3.renderMenu();
6800
6713
  }
6801
6714
  } else {
6802
6715
  var msg = res.msg || '系统错误,请联系管理员!';
6803
- _this4.$message.error(msg);
6716
+ _this3.$message.error(msg);
6804
6717
  }
6805
6718
  }).catch(function (err) {
6806
6719
  if (err.message && err.message !== 'canceled') {
6807
- _this4.$message.error(err.message);
6720
+ _this3.$message.error(err.message);
6808
6721
  }
6809
6722
  });
6810
6723
  },
6811
6724
  reGetConfig: function reGetConfig() {
6812
- var _this5 = this;
6725
+ var _this4 = this;
6813
6726
 
6814
6727
  util["a" /* default */].ajax({ url: this.mainConfig }).then(function (res) {
6815
6728
  if (res && res.rCode === 0) {
6816
6729
  var results = JSON.parse(JSON.stringify(res.results));
6817
- _this5.setConfig(results, 1);
6730
+ _this4.setConfig(results, 1);
6818
6731
  } else {
6819
6732
  var msg = res.msg || '系统错误,请联系管理员!';
6820
- _this5.$message.error(msg);
6733
+ _this4.$message.error(msg);
6821
6734
  }
6822
6735
  }).catch(function (err) {
6823
6736
  if (err.message && err.message !== 'canceled') {
6824
- _this5.$message.error(err.message);
6737
+ _this4.$message.error(err.message);
6825
6738
  }
6826
6739
  });
6827
6740
  },
6828
- jumpMenu: function jumpMenu(res, flag) {
6741
+ jumpMenu: function jumpMenu(res, flag, param) {
6742
+ var option = { url: res, flag: flag, param: param };
6743
+ if (util["a" /* default */].isObject(res)) {
6744
+ option = _extends({}, option, res);
6745
+ }
6829
6746
  var ids = void 0;
6830
- if (typeof res === 'string') {
6831
- if (flag) {
6832
- ids = this.getId(this.menus, res, true);
6747
+ if (typeof option.url === 'string') {
6748
+ if (option.flag) {
6749
+ ids = this.getId(this.menus, option.url, true);
6833
6750
  if (!ids) {
6834
6751
  this.$message.error('未在菜单栏中找到此地址');
6835
6752
  return;
6836
6753
  }
6837
6754
  } else {
6838
- ids = res.split(',');
6755
+ ids = option.url.split(',');
6839
6756
  }
6840
6757
  } else {
6841
- ids = res;
6758
+ ids = option.url;
6842
6759
  }
6843
- this.setDefault(this.menus, ids);
6760
+ this.setDefault(this.menus, ids, option.param);
6844
6761
  },
6845
6762
  getId: function getId(arry, res, path) {
6846
6763
  if (!res) {
@@ -6878,8 +6795,8 @@ var log = util["a" /* default */].getParams('console');
6878
6795
  return item.id;
6879
6796
  } else {
6880
6797
  if (path && item.url) {
6881
- var _url3 = new URL(item.url, window.location.origin);
6882
- if (_url3.hash == res) {
6798
+ var url = new URL(item.url, window.location.origin);
6799
+ if (url.hash == res) {
6883
6800
  return item.id;
6884
6801
  }
6885
6802
  }
@@ -6890,24 +6807,24 @@ var log = util["a" /* default */].getParams('console');
6890
6807
 
6891
6808
  //获取应用导航菜单
6892
6809
  getMenu: function getMenu() {
6893
- var _this6 = this;
6810
+ var _this5 = this;
6894
6811
 
6895
6812
  util["a" /* default */].ajax({ url: this.action, params: this.param ? this.param : {} }).then(function (res) {
6896
6813
  if (res.rCode === 0) {
6897
6814
  if (res.results && res.results.length) {
6898
- _this6.menus = JSON.parse(JSON.stringify(res.results));
6815
+ _this5.menus = JSON.parse(JSON.stringify(res.results));
6899
6816
  var applicationid = util["a" /* default */].getParams('applicationid') || util["a" /* default */].getParams('applicationId');
6900
6817
  if (applicationid) {
6901
- var ids = _this6.getId(_this6.menus, applicationid);
6818
+ var ids = _this5.getId(_this5.menus, applicationid);
6902
6819
  if (ids) {
6903
- _this6.defaultActive = ids;
6820
+ _this5.defaultActive = ids;
6904
6821
  }
6905
- } else if (sessionStorage.getItem('jump') && _this6.history) {
6906
- var _ids4 = _this6.getId(_this6.menus, sessionStorage.getItem('jump'), true);
6822
+ } else if (sessionStorage.getItem('jump') && _this5.isHistory) {
6823
+ var _ids4 = _this5.getId(_this5.menus, sessionStorage.getItem('jump'), true);
6907
6824
  if (_ids4) {
6908
- _this6.defaultActive = _ids4;
6909
- _this6.navIds = _ids4;
6910
- _this6.setTitle(_ids4[0]);
6825
+ _this5.defaultActive = _ids4;
6826
+ _this5.navIds = _ids4;
6827
+ _this5.setTitle(_ids4[0]);
6911
6828
  }
6912
6829
  } else if (util["a" /* default */].win.location.hash) {
6913
6830
  var hash = util["a" /* default */].win.location.hash;
@@ -6915,34 +6832,34 @@ var log = util["a" /* default */].getParams('console');
6915
6832
  hash = hash.split('?')[0];
6916
6833
  }
6917
6834
  if (hash !== '#/' && hash !== '#/main') {
6918
- var _ids5 = _this6.getId(_this6.menus, util["a" /* default */].win.location.hash, true);
6835
+ var _ids5 = _this5.getId(_this5.menus, util["a" /* default */].win.location.hash, true);
6919
6836
  if (_ids5) {
6920
- _this6.defaultActive = _ids5;
6921
- _this6.navIds = _ids5;
6922
- _this6.setTitle(_ids5[0]);
6837
+ _this5.defaultActive = _ids5;
6838
+ _this5.navIds = _ids5;
6839
+ _this5.setTitle(_ids5[0]);
6923
6840
  }
6924
- } else if (sessionStorage.getItem('jump') && _this6.history) {
6925
- var _ids6 = _this6.getId(_this6.menus, sessionStorage.getItem('jump'), true);
6841
+ } else if (sessionStorage.getItem('jump') && _this5.isHistory) {
6842
+ var _ids6 = _this5.getId(_this5.menus, sessionStorage.getItem('jump'), true);
6926
6843
  if (_ids6) {
6927
- _this6.defaultActive = _ids6;
6928
- _this6.navIds = _ids6;
6929
- _this6.setTitle(_ids6[0]);
6844
+ _this5.defaultActive = _ids6;
6845
+ _this5.navIds = _ids6;
6846
+ _this5.setTitle(_ids6[0]);
6930
6847
  }
6931
6848
  }
6932
6849
  }
6933
- _this6.setTips(_this6.menus);
6934
- store["a" /* default */].set('nav', _this6.menus);
6935
- _this6.setMenu(_this6.menus);
6850
+ _this5.setTips(_this5.menus);
6851
+ store["a" /* default */].set('nav', _this5.menus);
6852
+ _this5.setMenu(_this5.menus);
6936
6853
  } else {
6937
- _this6.$message.error('未分配菜单权限,请联系管理员!');
6854
+ _this5.$message.error('未分配菜单权限,请联系管理员!');
6938
6855
  }
6939
6856
  } else {
6940
6857
  var msg = res.msg || '系统错误,请联系管理员!';
6941
- _this6.$message.error(msg);
6858
+ _this5.$message.error(msg);
6942
6859
  }
6943
6860
  }).catch(function (err) {
6944
6861
  if (err.message && err.message !== 'canceled') {
6945
- _this6.$message.error(err.message);
6862
+ _this5.$message.error(err.message);
6946
6863
  }
6947
6864
  });
6948
6865
  },
@@ -7064,11 +6981,11 @@ var log = util["a" /* default */].getParams('console');
7064
6981
 
7065
6982
  //遍历设置菜单气泡提醒
7066
6983
  setTips: function setTips(obj) {
7067
- var _this7 = this;
6984
+ var _this6 = this;
7068
6985
 
7069
6986
  if (Array.isArray(obj)) {
7070
6987
  obj.forEach(function (item) {
7071
- _this7.setTips(item);
6988
+ _this6.setTips(item);
7072
6989
  });
7073
6990
  } else {
7074
6991
  if (obj && Object.prototype.hasOwnProperty.call(obj, 'tips') && obj.tips) {
@@ -7078,7 +6995,7 @@ var log = util["a" /* default */].getParams('console');
7078
6995
  var flag = false;
7079
6996
  if (obj.children && obj.children.length) {
7080
6997
  obj.children.forEach(function (item) {
7081
- if (_this7.setTips(item)) {
6998
+ if (_this6.setTips(item)) {
7082
6999
  flag = true;
7083
7000
  }
7084
7001
  });
@@ -7088,7 +7005,7 @@ var log = util["a" /* default */].getParams('console');
7088
7005
  }
7089
7006
  } else if (obj.fourthTabs && obj.fourthTabs.length) {
7090
7007
  obj.fourthTabs.forEach(function (item) {
7091
- if (_this7.setTips(item)) {
7008
+ if (_this6.setTips(item)) {
7092
7009
  flag = true;
7093
7010
  }
7094
7011
  });
@@ -7107,12 +7024,12 @@ var log = util["a" /* default */].getParams('console');
7107
7024
  },
7108
7025
 
7109
7026
  //设置默认导航页面
7110
- setDefault: function setDefault(res, active) {
7027
+ setDefault: function setDefault(res, active, param) {
7111
7028
  this.navIds = JSON.parse(JSON.stringify(active));
7112
7029
  this.sysId = '';
7113
7030
  this.tabsId = '';
7114
7031
  this.active = '';
7115
- this.getUrl(res, active);
7032
+ this.getUrl(res, active, param);
7116
7033
  if (this.layout === 'subsystem' || this.layout === 'subSystem' || this.layout === 'topnav' || this.layout === 'topNav' || this.layout === 'topside' || this.layout === 'topSide') {
7117
7034
  if (this.layout === 'subsystem' || this.layout === 'subSystem') {
7118
7035
  this.navs = [];
@@ -7161,34 +7078,34 @@ var log = util["a" /* default */].getParams('console');
7161
7078
  },
7162
7079
 
7163
7080
  //获取页面类型及地址
7164
- getUrl: function getUrl(res, active, index) {
7081
+ getUrl: function getUrl(res, active, index, param) {
7165
7082
  index = index === undefined ? 0 : index;
7166
7083
  for (var i = 0; i < res.length; i++) {
7167
7084
  var item = res[i];
7168
7085
  if (item.id === active[index]) {
7169
7086
  if (index === active.length - 1) {
7170
- this.handleJump(item.url, item.urlopenmode, item);
7087
+ this.handleJump(item.url, item.urlopenmode, item, param);
7171
7088
  return item.url;
7172
7089
  } else {
7173
7090
  if (item.children && item.children.length) {
7174
7091
  index++;
7175
- var _url4 = this.getUrl(item.children, active, index);
7176
- if (_url4 && index === active.length - 1) {
7092
+ var url = this.getUrl(item.children, active, index, param);
7093
+ if (url && index === active.length - 1) {
7177
7094
  this.tabs = '';
7178
7095
  }
7179
- return _url4;
7096
+ return url;
7180
7097
  }
7181
7098
  if (item.fourthTabs && item.fourthTabs.length) {
7182
7099
  index++;
7183
- var _url5 = this.getUrl(item.fourthTabs, active, index);
7184
- if (_url5) {
7100
+ var _url2 = this.getUrl(item.fourthTabs, active, index, param);
7101
+ if (_url2) {
7185
7102
  this.$set(this, 'tabs', item.fourthTabs);
7186
7103
  }
7187
- return _url5;
7104
+ return _url2;
7188
7105
  }
7189
7106
  }
7190
7107
  } else if (item.children && item.children.length) {
7191
- this.getUrl(item.children, active, index);
7108
+ this.getUrl(item.children, active, index, param);
7192
7109
  }
7193
7110
  }
7194
7111
  return false;
@@ -7382,7 +7299,7 @@ var log = util["a" /* default */].getParams('console');
7382
7299
 
7383
7300
  //头部工具交互事件
7384
7301
  handleClick: function handleClick(res) {
7385
- var _this8 = this;
7302
+ var _this7 = this;
7386
7303
 
7387
7304
  var type = res.type;
7388
7305
 
@@ -7403,7 +7320,7 @@ var log = util["a" /* default */].getParams('console');
7403
7320
  this.setMenu(this.menus);
7404
7321
  }
7405
7322
  this.$nextTick(function () {
7406
- _this8.reset = true;
7323
+ _this7.reset = true;
7407
7324
  });
7408
7325
  break;
7409
7326
  case 'user':
@@ -7431,22 +7348,23 @@ var log = util["a" /* default */].getParams('console');
7431
7348
 
7432
7349
  //刷新子页面、子路由
7433
7350
  handleRefresh: function handleRefresh() {
7434
- var _this9 = this;
7351
+ var _this8 = this;
7435
7352
 
7436
7353
  if (this.method === 'iframe') {
7437
7354
  this.page = util["a" /* default */].handlerUrl(this.page);
7438
7355
  } else {
7439
7356
  this.refresh = false;
7440
7357
  this.$nextTick(function () {
7441
- _this9.refresh = true;
7358
+ _this8.refresh = true;
7442
7359
  });
7443
7360
  }
7444
7361
  },
7445
7362
 
7446
7363
  //跳转页面
7447
- handleJump: function handleJump(page, type, res) {
7448
- var _this10 = this;
7364
+ handleJump: function handleJump(page, type, res, param) {
7365
+ var _this9 = this;
7449
7366
 
7367
+ console.log(page);
7450
7368
  var prevPage = sessionStorage.getItem('jump');
7451
7369
  sessionStorage.setItem('jump', page);
7452
7370
  if (res) {
@@ -7467,7 +7385,7 @@ var log = util["a" /* default */].getParams('console');
7467
7385
  } else if (type == 3) {
7468
7386
  this.method = 'iframe';
7469
7387
  this.refresh = false;
7470
- this.page = util["a" /* default */].handlerUrl(page);
7388
+ this.page = util["a" /* default */].handlerUrl(page, param);
7471
7389
  } else if (page) {
7472
7390
  var urls = page.split('?');
7473
7391
  if (urls[0].indexOf('.js') > 1) {
@@ -7475,17 +7393,17 @@ var log = util["a" /* default */].getParams('console');
7475
7393
  this.wjName = 'singlespa';
7476
7394
  this.page = this.host + page;
7477
7395
  this.$nextTick(function () {
7478
- _this10.refresh = true;
7396
+ _this9.refresh = true;
7479
7397
  });
7480
7398
  } else if (urls[0].indexOf('.dhtml') > 0 || urls[0].indexOf('.html') > 0 && urls[0].indexOf('.html#') === -1) {
7481
7399
  this.method = 'iframe';
7482
7400
  this.refresh = false;
7483
- this.page = util["a" /* default */].handlerUrl(page);
7401
+ this.page = util["a" /* default */].handlerUrl(page, param);
7484
7402
  } else {
7485
7403
  if (urls[0].indexOf('.html') === -1 && urls[0].indexOf('#/') === -1) {
7486
7404
  this.method = 'iframe';
7487
7405
  this.refresh = false;
7488
- this.page = util["a" /* default */].handlerUrl(page);
7406
+ this.page = util["a" /* default */].handlerUrl(page, param);
7489
7407
  } else {
7490
7408
  this.method = 'router';
7491
7409
  var routes = this.$router.options.routes;
@@ -7493,6 +7411,9 @@ var log = util["a" /* default */].getParams('console');
7493
7411
  var path = this.hasRouter(routes, urls[0]);
7494
7412
  if (path) {
7495
7413
  var params = util["a" /* default */].getParams({ url: page });
7414
+ if (param) {
7415
+ params = _extends({}, params, param);
7416
+ }
7496
7417
  if (res) {
7497
7418
  this.routerKey = res.id;
7498
7419
  if (Object.prototype.hasOwnProperty.call(res, 'keepAlive')) {
@@ -7504,7 +7425,7 @@ var log = util["a" /* default */].getParams('console');
7504
7425
  query: params
7505
7426
  });
7506
7427
  this.$nextTick(function () {
7507
- _this10.refresh = true;
7428
+ _this9.refresh = true;
7508
7429
  });
7509
7430
  } else {
7510
7431
  var urlopenmode = util["a" /* default */].getParams({
@@ -7514,13 +7435,13 @@ var log = util["a" /* default */].getParams('console');
7514
7435
  if (this.loadWujie === false || this.downgrade && isIE || urlopenmode == 3) {
7515
7436
  this.method = 'iframe';
7516
7437
  this.refresh = false;
7517
- this.page = util["a" /* default */].handlerUrl(page);
7438
+ this.page = util["a" /* default */].handlerUrl(page, param);
7518
7439
  } else {
7519
7440
  this.method = 'wujie';
7520
7441
  this.wjName = res && res.appCode ? res.appCode : 'application';
7521
7442
  this.page = this.host + page;
7522
7443
  this.$nextTick(function () {
7523
- _this10.refresh = true;
7444
+ _this9.refresh = true;
7524
7445
  });
7525
7446
  }
7526
7447
  }
@@ -7532,7 +7453,7 @@ var log = util["a" /* default */].getParams('console');
7532
7453
  }
7533
7454
  }
7534
7455
  this.$nextTick(function () {
7535
- _this10.showPage = true;
7456
+ _this9.showPage = true;
7536
7457
  });
7537
7458
  },
7538
7459
 
@@ -7644,7 +7565,7 @@ var log = util["a" /* default */].getParams('console');
7644
7565
 
7645
7566
  //监听改变菜单
7646
7567
  handleListener: function handleListener() {
7647
- var _this11 = this;
7568
+ var _this10 = this;
7648
7569
 
7649
7570
  util["a" /* default */].win.addEventListener('message', function (e) {
7650
7571
  var msg = e.data;
@@ -7653,69 +7574,61 @@ var log = util["a" /* default */].getParams('console');
7653
7574
  if (typeof res === 'string') {
7654
7575
  res = res.split(',');
7655
7576
  }
7656
- _this11.setDefault(_this11.menus, res);
7577
+ _this10.setDefault(_this10.menus, res);
7657
7578
  }
7658
7579
  }, false);
7659
7580
  },
7660
7581
 
7661
7582
  //开启weosocket
7662
7583
  initWebSocket: function initWebSocket() {
7663
- //初始化weosocket
7664
- if (!this.websocket) {
7665
- var _url6 = (util["a" /* default */].getStorage('wshost') || '') + api["Zb" /* wss */];
7666
- this.websocket = new external_sockjs_client_default.a(_url6);
7667
- }
7668
- this.client = external_stompjs_default.a.over(this.websocket);
7669
- if (!this.isConsole && this.client) {
7670
- this.client.debug = null;
7671
- }
7672
- this.handleConnect(this.client);
7673
- },
7674
- handleConnect: function handleConnect(client) {
7675
- var _this12 = this;
7584
+ var _this11 = this;
7676
7585
 
7677
- client.connect({}, function () {
7678
- //localStorage.setItem("socket",true);
7679
- //订阅服务端的
7680
- client.subscribe(api["Qb" /* topic */], function (response) {
7681
- var res = JSON.parse(response.body);
7682
- var data = res.data;
7683
- for (var i in data) {
7684
- if (data[i] !== null && data[i] !== undefined) {
7685
- if (i === 'onlineUserNums' && data[i] > 0) {
7686
- _this12.online = data[i];
7687
- }
7688
- if (i === 'sysMsgNums') {
7689
- _this12.notice = data[i];
7690
- if (_this12.showMsg) {
7691
- _this12.$refs.message.getMsg(true);
7692
- }
7693
- }
7694
- if (i === 'menuTipsMap') {
7695
- _this12.menuTips = data[i];
7696
- }
7697
- if (i === 'sysMsgList') {
7698
- _this12.sysMsg = data[i];
7699
- }
7700
- if (i === 'extraData') {
7701
- _this12.extraData = data[i];
7586
+ util["a" /* default */].socket().then(function (res, close) {
7587
+ _this11.close = close;
7588
+ var data = res.data;
7589
+ for (var i in data) {
7590
+ if (data[i] !== null && data[i] !== undefined) {
7591
+ if (i === 'onlineUserNums' && data[i] > 0) {
7592
+ _this11.online = data[i];
7593
+ }
7594
+ if (i === 'sysMsgNums') {
7595
+ _this11.notice = data[i];
7596
+ if (_this11.showMsg) {
7597
+ _this11.$refs.message.getMsg(true);
7702
7598
  }
7703
7599
  }
7600
+ if (i === 'menuTipsMap') {
7601
+ _this11.menuTips = data[i];
7602
+ }
7603
+ if (i === 'sysMsgList') {
7604
+ _this11.sysMsg = data[i];
7605
+ }
7606
+ if (i === 'extraData') {
7607
+ _this11.extraData = data[i];
7608
+ }
7704
7609
  }
7705
- });
7706
- }, function (error) {
7707
- console.log('webSocket连接失败');
7708
- client.disconnect();
7610
+ }
7611
+ if (_this11.$store) {
7612
+ _this11.$store.commit('websocket', data);
7613
+ }
7614
+ if (_this11.$eventBus) {
7615
+ _this11.$eventBus.$emit('websocket', data);
7616
+ }
7617
+ if (util["a" /* default */].win.eventBus) {
7618
+ util["a" /* default */].win.eventBus.$emit('websocket', data);
7619
+ }
7620
+ }).catch(function (err) {
7621
+ console.log(err);
7709
7622
  });
7710
7623
  },
7711
7624
  handleOpened: function handleOpened(res) {
7712
- var _this13 = this;
7625
+ var _this12 = this;
7713
7626
 
7714
7627
  if (res === undefined) {
7715
7628
  this.sysMsg = [];
7716
7629
  } else if (res == false && this.sysMsg.length) {
7717
7630
  this.sysMsgOut = setTimeout(function () {
7718
- _this13.sysMsg = [];
7631
+ _this12.sysMsg = [];
7719
7632
  }, 3000);
7720
7633
  } else if (this.sysMsgOut) {
7721
7634
  clearTimeout(this.sysMsgOut);
@@ -7736,7 +7649,7 @@ var log = util["a" /* default */].getParams('console');
7736
7649
  }
7737
7650
  },
7738
7651
  handleReLogin: function handleReLogin(res) {
7739
- var _this14 = this;
7652
+ var _this13 = this;
7740
7653
 
7741
7654
  if (res && typeof res == 'string') {
7742
7655
  res = JSON.parse(res);
@@ -7767,7 +7680,7 @@ var log = util["a" /* default */].getParams('console');
7767
7680
  this.timer = setTimeout(function () {
7768
7681
  console.log('handleReLogin');
7769
7682
  sessionStorage.setItem('remind', 1);
7770
- _this14.$confirm(msg, btn).then(function () {
7683
+ _this13.$confirm(msg, btn).then(function () {
7771
7684
  util["a" /* default */].removeStorage(['Authorization', 'token', 'ssId', 'userId', 'userName', 'auth', 'deviceUnique', 'menus', 'useCaseCodes', 'mainConfig', 'jump']);
7772
7685
  var loginPage = util["a" /* default */].getStorage('login') || util["a" /* default */].getStorage('loginPage');
7773
7686
  if (loginPage) {
@@ -7825,8 +7738,8 @@ var log = util["a" /* default */].getParams('console');
7825
7738
  },
7826
7739
  beforeDestroy: function beforeDestroy() {
7827
7740
  this.timer = null;
7828
- if (this.client && this.client.connected) {
7829
- this.client.disconnect();
7741
+ if (this.close) {
7742
+ this.close();
7830
7743
  }
7831
7744
  }
7832
7745
  });