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
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,
@@ -1752,7 +1760,7 @@ var getWeekday = function getWeekday(date) {
1752
1760
  * @param {String} [url] - url地址
1753
1761
  **/
1754
1762
 
1755
- var handlerUrl = function handlerUrl(url, before) {
1763
+ var handlerUrl = function handlerUrl(url, param, before) {
1756
1764
  var arry = url.split('?');
1757
1765
  if (arry.length > 2) {
1758
1766
  var ary = arry.splice(1, arry.length);
@@ -1774,6 +1782,10 @@ var handlerUrl = function handlerUrl(url, before) {
1774
1782
  } else {
1775
1783
  url += '?_tt=' + new Date().getTime();
1776
1784
  }
1785
+ if (param) {
1786
+ var str = queryParams(param);
1787
+ url += '&' + str;
1788
+ }
1777
1789
  if (before && before === arry[0]) {
1778
1790
  var pathname = win.location.pathname;
1779
1791
  if (pathname === '/') {
@@ -1938,29 +1950,29 @@ var isLogined = function isLogined(_ref8) {
1938
1950
  loginPage = _ref8.loginPage,
1939
1951
  redirect = _ref8.redirect;
1940
1952
 
1941
- var logined = getStorage('logined');
1942
1953
  if (cookie === undefined) {
1943
1954
  cookie = getParams({ name: 'cookie' });
1944
1955
  }
1945
- // eslint-disable-next-line eqeqeq
1946
- if (logined || cookie == true || cookie == 1) {
1947
- if (loginPage) {
1948
- sessionStorage.setItem('loginPage', loginPage);
1949
- if (!startWith(loginPage, ['http', '/'], true)) {
1950
- var pathname = win.top.location.pathname;
1951
- if (pathname !== '/') {
1952
- pathname = pathname.split('/');
1953
- pathname.splice(pathname.length - 1);
1954
- pathname = pathname.join('/');
1955
- loginPage = pathname + '/' + loginPage.replace('./', '');
1956
- } else {
1957
- loginPage = pathname + loginPage.replace('./', '');
1958
- }
1956
+ if (loginPage) {
1957
+ sessionStorage.setItem('loginPage', loginPage);
1958
+ if (!startWith(loginPage, ['http', '/'], true)) {
1959
+ var pathname = win.top.location.pathname;
1960
+ if (pathname !== '/') {
1961
+ pathname = pathname.split('/');
1962
+ pathname.splice(pathname.length - 1);
1963
+ pathname = pathname.join('/');
1964
+ loginPage = pathname + '/' + loginPage.replace('./', '');
1965
+ } else {
1966
+ loginPage = pathname + loginPage.replace('./', '');
1959
1967
  }
1960
1968
  }
1961
- next();
1969
+ }
1970
+ var token = getStorage('token') || getStorage('Authorization');
1971
+ var logined = getStorage('logined');
1972
+ // eslint-disable-next-line eqeqeq
1973
+ if (token || logined || cookie == true || cookie == 1) {
1974
+ next && next();
1962
1975
  } else {
1963
- var token = getStorage('token') || getStorage('Authorization');
1964
1976
  if (!token && Object.prototype.hasOwnProperty.call(to.query, 'serverId') && Object.prototype.hasOwnProperty.call(to.query, 'authType')) {
1965
1977
  ajax({
1966
1978
  method: 'post',
@@ -2015,7 +2027,7 @@ var isLogined = function isLogined(_ref8) {
2015
2027
  }
2016
2028
  break;
2017
2029
  case 4:
2018
- eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
2030
+ eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
2019
2031
  confirmButtonText: '确定',
2020
2032
  type: 'error',
2021
2033
  callback: function callback() {
@@ -2035,7 +2047,7 @@ var isLogined = function isLogined(_ref8) {
2035
2047
  default:
2036
2048
  }
2037
2049
  } else {
2038
- eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].alert(res.msg, '提示', {
2050
+ eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].alert(res.msg, '提示', {
2039
2051
  confirmButtonText: '确定',
2040
2052
  type: 'error',
2041
2053
  callback: function callback() {
@@ -2166,7 +2178,7 @@ var loadJs = function loadJs(_ref10) {
2166
2178
  **/
2167
2179
  var loading = function loading($loading, res) {
2168
2180
  if (!$loading) {
2169
- $loading = eoss_element__WEBPACK_IMPORTED_MODULE_4__["Loading"].service;
2181
+ $loading = eoss_element__WEBPACK_IMPORTED_MODULE_6__["Loading"].service;
2170
2182
  }
2171
2183
  if (isObject(res)) {
2172
2184
  var config = extend({}, {
@@ -2525,6 +2537,70 @@ var setStorage = function setStorage(_ref14) {
2525
2537
  }
2526
2538
  };
2527
2539
 
2540
+ /**
2541
+ * socket
2542
+ * @desc:webSocket
2543
+ * @author huangbo
2544
+ * @date 2022年5月7日
2545
+ * @param {String} [url] - 连接地址
2546
+ * @param {String} [take] - 订阅地址
2547
+ * @param {String} [debug] - 调试
2548
+ * @param {String} [interval] - 重连间隔时间
2549
+ **/
2550
+ function socket(options) {
2551
+ var nextDate = 0;
2552
+ var connect = 1;
2553
+ return new Promise(function (resolve, reject) {
2554
+ var wshost = getStorage('wshost') || '';
2555
+ var option = {
2556
+ url: wshost + _config_api__WEBPACK_IMPORTED_MODULE_0__[/* wss */ "Zb"],
2557
+ take: _config_api__WEBPACK_IMPORTED_MODULE_0__[/* topic */ "Qb"],
2558
+ debug: true,
2559
+ interval: 20
2560
+ };
2561
+ var websocket = win.websocket || {};
2562
+ if (options && isObject(options)) {
2563
+ option = _extends({}, option, options);
2564
+ }
2565
+ var key = window.btoa(option.url);
2566
+ if (!websocket[key]) {
2567
+ websocket[key] = { socket: new sockjs_client__WEBPACK_IMPORTED_MODULE_4___default.a(option.url) };
2568
+ win.websocket = websocket;
2569
+ }
2570
+
2571
+ var client = websocket[key] ? websocket[key].client : null;
2572
+ if (!client) {
2573
+ client = websocket[key].client = stompjs__WEBPACK_IMPORTED_MODULE_5___default.a.over(websocket[key].socket);
2574
+ !option.debug && (client.debug = null);
2575
+ }
2576
+ client.connect({}, function () {
2577
+ client.subscribe(option.take, function (response) {
2578
+ var res = JSON.parse(response.body);
2579
+ resolve(res, function () {
2580
+ client.disconnect();
2581
+ win.top.websocket && win.top.websocket[key] && delete win.top.websocket[key];
2582
+ }, client, websocket[key]);
2583
+ });
2584
+ }, function (error) {
2585
+ var diffSecond = parseInt((new Date() - nextDate) / 1000, 10);
2586
+ if (connect > 5 && diffSecond < option.interval) {
2587
+ client.disconnect();
2588
+ if (win.top.websocket) {
2589
+ if (Object.keys(win.top.websocket).length > 1) {
2590
+ delete win.top.websocket[key];
2591
+ } else {
2592
+ delete win.top.websocket;
2593
+ }
2594
+ }
2595
+ } else {
2596
+ win.top.websocket && win.top.websocket[key] && setTimeout(function () {
2597
+ socket(options);
2598
+ }, 5000);
2599
+ }
2600
+ reject(error);
2601
+ });
2602
+ });
2603
+ }
2528
2604
  /**
2529
2605
  * sum
2530
2606
  * @desc 求和
@@ -2777,7 +2853,6 @@ var urlJoinParams = function urlJoinParams(_ref15) {
2777
2853
  params[items[0]] = items[1];
2778
2854
  });
2779
2855
  }
2780
- '&_tt=' + new Date().getTime();
2781
2856
  params = extend(true, params, param);
2782
2857
  var str = queryParams(params);
2783
2858
  if (str) {
@@ -2945,6 +3020,7 @@ var watermark = function watermark(option) {
2945
3020
  sendMessage: sendMessage,
2946
3021
  setFavicon: setFavicon,
2947
3022
  setStorage: setStorage,
3023
+ socket: socket,
2948
3024
  startWith: startWith,
2949
3025
  sum: sum,
2950
3026
  takeLeft: takeLeft,
@@ -3433,10 +3509,22 @@ module.exports = require("json-bigint");
3433
3509
  /* 7 */
3434
3510
  /***/ (function(module, exports) {
3435
3511
 
3436
- module.exports = require("sm-crypto");
3512
+ module.exports = require("sockjs-client");
3437
3513
 
3438
3514
  /***/ }),
3439
3515
  /* 8 */
3516
+ /***/ (function(module, exports) {
3517
+
3518
+ module.exports = require("stompjs");
3519
+
3520
+ /***/ }),
3521
+ /* 9 */
3522
+ /***/ (function(module, exports) {
3523
+
3524
+ module.exports = require("sm-crypto");
3525
+
3526
+ /***/ }),
3527
+ /* 10 */
3440
3528
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3441
3529
 
3442
3530
  "use strict";
@@ -3463,36 +3551,24 @@ window.__store = store;
3463
3551
  /* harmony default export */ __webpack_exports__["a"] = (store);
3464
3552
 
3465
3553
  /***/ }),
3466
- /* 9 */
3554
+ /* 11 */
3467
3555
  /***/ (function(module, exports) {
3468
3556
 
3469
3557
  module.exports = require("babel-runtime/regenerator");
3470
3558
 
3471
3559
  /***/ }),
3472
- /* 10 */,
3473
- /* 11 */,
3474
3560
  /* 12 */,
3475
3561
  /* 13 */,
3476
3562
  /* 14 */,
3477
3563
  /* 15 */,
3478
3564
  /* 16 */,
3479
3565
  /* 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
- /***/ }),
3566
+ /* 18 */,
3567
+ /* 19 */,
3492
3568
  /* 20 */
3493
3569
  /***/ (function(module, exports) {
3494
3570
 
3495
- module.exports = require("stompjs");
3571
+ module.exports = require("runtime-import");
3496
3572
 
3497
3573
  /***/ }),
3498
3574
  /* 21 */,
@@ -3510,7 +3586,7 @@ module.exports = require("stompjs");
3510
3586
  // ESM COMPAT FLAG
3511
3587
  __webpack_require__.r(__webpack_exports__);
3512
3588
 
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=67d8ca27&
3589
+ // 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=cef5b378&
3514
3590
  var render = function () {
3515
3591
  var _vm = this
3516
3592
  var _h = _vm.$createElement
@@ -3940,10 +4016,10 @@ var staticRenderFns = []
3940
4016
  render._withStripped = true
3941
4017
 
3942
4018
 
3943
- // CONCATENATED MODULE: ./packages/main/src/main.vue?vue&type=template&id=67d8ca27&
4019
+ // CONCATENATED MODULE: ./packages/main/src/main.vue?vue&type=template&id=cef5b378&
3944
4020
 
3945
4021
  // EXTERNAL MODULE: external "babel-runtime/regenerator"
3946
- var regenerator_ = __webpack_require__(9);
4022
+ var regenerator_ = __webpack_require__(11);
3947
4023
  var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator_);
3948
4024
 
3949
4025
  // 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&
@@ -3973,7 +4049,7 @@ userinfovue_type_template_id_799780ee_render._withStripped = true
3973
4049
  var api = __webpack_require__(1);
3974
4050
 
3975
4051
  // EXTERNAL MODULE: ./src/utils/store.js
3976
- var store = __webpack_require__(8);
4052
+ var store = __webpack_require__(10);
3977
4053
 
3978
4054
  // EXTERNAL MODULE: ./src/utils/util.js
3979
4055
  var util = __webpack_require__(0);
@@ -5590,7 +5666,7 @@ async_componentvue_type_template_id_51f0233c_scoped_true_render._withStripped =
5590
5666
  // CONCATENATED MODULE: ./packages/main/src/async-component/index.vue?vue&type=template&id=51f0233c&scoped=true&
5591
5667
 
5592
5668
  // EXTERNAL MODULE: external "runtime-import"
5593
- var external_runtime_import_ = __webpack_require__(18);
5669
+ var external_runtime_import_ = __webpack_require__(20);
5594
5670
 
5595
5671
  // 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
5672
 
@@ -5741,14 +5817,6 @@ var async_component_component = Object(componentNormalizer["a" /* default */])(
5741
5817
  )
5742
5818
 
5743
5819
  /* 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
5820
  // 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
5821
 
5754
5822
 
@@ -6013,13 +6081,17 @@ function mainvue_type_script_lang_js_asyncToGenerator(fn) { return function () {
6013
6081
 
6014
6082
 
6015
6083
 
6016
-
6017
-
6018
6084
  var isIE = navigator.userAgent.indexOf('MSIE') != -1;
6019
6085
  var log = util["a" /* default */].getParams('console');
6020
6086
  /* harmony default export */ var mainvue_type_script_lang_js_ = ({
6021
6087
  name: 'EsMain',
6022
6088
  inheritAttrs: false,
6089
+ provide: function provide() {
6090
+ return {
6091
+ esMain: this
6092
+ };
6093
+ },
6094
+
6023
6095
  components: {
6024
6096
  userinfo: userinfo,
6025
6097
  settings: settings,
@@ -6282,8 +6354,7 @@ var log = util["a" /* default */].getParams('console');
6282
6354
  copyright: { comp: '', data: {} }
6283
6355
  },
6284
6356
  pageLoading: false,
6285
- client: null,
6286
- websocket: null,
6357
+ close: null,
6287
6358
  connect: 0,
6288
6359
  wjName: 'singlespa',
6289
6360
  menus: '',
@@ -6365,11 +6436,12 @@ var log = util["a" /* default */].getParams('console');
6365
6436
  };
6366
6437
  },
6367
6438
  created: function created() {
6439
+ var params = util["a" /* default */].getParams() || {};
6368
6440
  this.homePage = typeof this.loadHomePage === 'string' ? this.loadHomePage : '';
6369
- this.isHeader = util["a" /* default */].getParams('header');
6441
+ this.isHeader = params.header;
6370
6442
  var sysLogoIco = sessionStorage.getItem('sysLogoIco');
6371
6443
  sysLogoIco && util["a" /* default */].setFavicon(sysLogoIco);
6372
- this.isLogin();
6444
+ this.isLogin(params);
6373
6445
  },
6374
6446
  mounted: function mounted() {
6375
6447
  util["a" /* default */].win.reLogin = this.handleReLogin;
@@ -6385,16 +6457,15 @@ var log = util["a" /* default */].getParams('console');
6385
6457
  },
6386
6458
 
6387
6459
  methods: {
6388
- isLogin: function isLogin() {
6460
+ isLogin: function isLogin(query) {
6389
6461
  var _this = this;
6390
6462
 
6391
6463
  return mainvue_type_script_lang_js_asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee() {
6392
- var query, token, loginPage, pathname;
6464
+ var token, loginPage, pathname;
6393
6465
  return regenerator_default.a.wrap(function _callee$(_context) {
6394
6466
  while (1) {
6395
6467
  switch (_context.prev = _context.next) {
6396
6468
  case 0:
6397
- query = util["a" /* default */].getParams();
6398
6469
  token = util["a" /* default */].getStorage('token') || util["a" /* default */].getStorage('Authorization');
6399
6470
  loginPage = util["a" /* default */].getStorage('login') || util["a" /* default */].getStorage('loginPage');
6400
6471
 
@@ -6413,12 +6484,12 @@ var log = util["a" /* default */].getParams('console');
6413
6484
  }
6414
6485
  }
6415
6486
 
6416
- if (!(!token && Object.prototype.hasOwnProperty.call(query, 'serverId') && Object.prototype.hasOwnProperty.call(query, 'authType'))) {
6417
- _context.next = 9;
6487
+ if (!(!token && query && Object.prototype.hasOwnProperty.call(query, 'serverId') && Object.prototype.hasOwnProperty.call(query, 'authType'))) {
6488
+ _context.next = 8;
6418
6489
  break;
6419
6490
  }
6420
6491
 
6421
- _context.next = 7;
6492
+ _context.next = 6;
6422
6493
  return util["a" /* default */].ajax({
6423
6494
  method: 'post',
6424
6495
  url: api["b" /* authCenter */],
@@ -6521,14 +6592,14 @@ var log = util["a" /* default */].getParams('console');
6521
6592
  }
6522
6593
  }).catch(function (e) {});
6523
6594
 
6524
- case 7:
6525
- _context.next = 10;
6595
+ case 6:
6596
+ _context.next = 9;
6526
6597
  break;
6527
6598
 
6528
- case 9:
6599
+ case 8:
6529
6600
  _this.getConfig();
6530
6601
 
6531
- case 10:
6602
+ case 9:
6532
6603
  case 'end':
6533
6604
  return _context.stop();
6534
6605
  }
@@ -6632,7 +6703,7 @@ var log = util["a" /* default */].getParams('console');
6632
6703
  this.navIds = ids;
6633
6704
  this.setTitle(ids[0]);
6634
6705
  }
6635
- } else if (sessionStorage.getItem('jump') && this.history) {
6706
+ } else if (sessionStorage.getItem('jump') && this.isHistory) {
6636
6707
  var _ids = this.getId(this.menus, sessionStorage.getItem('jump'), true);
6637
6708
  if (_ids) {
6638
6709
  this.defaultActive = _ids;
@@ -6651,7 +6722,7 @@ var log = util["a" /* default */].getParams('console');
6651
6722
  this.navIds = _ids2;
6652
6723
  this.setTitle(_ids2[0]);
6653
6724
  }
6654
- } else if (sessionStorage.getItem('jump') && this.history) {
6725
+ } else if (sessionStorage.getItem('jump') && this.isHistory) {
6655
6726
  var _ids3 = this.getId(this.menus, sessionStorage.getItem('jump'), true);
6656
6727
  if (_ids3) {
6657
6728
  this.defaultActive = _ids3;
@@ -6726,18 +6797,28 @@ var log = util["a" /* default */].getParams('console');
6726
6797
  this.results[i] = results[i].split(',');
6727
6798
  }
6728
6799
  if (i === 'indexUrl' && this.loadHomePage) {
6729
- this.homePage = typeof this.loadHomePage === 'string' ? this.loadHomePage : results[i];
6730
- if (this.isHomePage && this.homePage) {
6731
- if (this.menus && this.menus.length) {
6732
- var ids = null;
6733
- this.homePage && (ids = this.getId(this.menus, this.homePage));
6734
- if (ids) {
6735
- this.defaultActive = ids;
6736
- } else if (this.homePage) {
6737
- this.handleJump(this.homePage);
6800
+ var applicationid = util["a" /* default */].getParams('applicationid') || util["a" /* default */].getParams('applicationId');
6801
+ var hash = util["a" /* default */].win.location.hash;
6802
+ if (hash) {
6803
+ hash = hash.split('?')[0];
6804
+ }
6805
+ var jump = sessionStorage.getItem('jump');
6806
+ if (!applicationid && (!jump || !this.isHistory) && hash === '#/' && hash === '#/main') {
6807
+ this.homePage = typeof this.loadHomePage === 'string' ? this.loadHomePage : results[i];
6808
+ if (this.isHomePage && this.homePage) {
6809
+ if (this.menus && this.menus.length) {
6810
+ var ids = null;
6811
+ this.homePage && (ids = this.getId(this.menus, this.homePage));
6812
+ if (ids) {
6813
+ this.defaultActive = ids;
6814
+ } else if (this.homePage) {
6815
+ this.handleJump(this.homePage);
6816
+ }
6817
+ this.setMenu(this.menus);
6738
6818
  }
6739
- this.setMenu(this.menus);
6740
6819
  }
6820
+ } else if (this.menus && this.menus.length) {
6821
+ this.setMenu(this.menus);
6741
6822
  }
6742
6823
  }
6743
6824
  if (i === 'doorIndex' && results[i]) {
@@ -6822,22 +6903,26 @@ var log = util["a" /* default */].getParams('console');
6822
6903
  }
6823
6904
  });
6824
6905
  },
6825
- jumpMenu: function jumpMenu(res, flag) {
6906
+ jumpMenu: function jumpMenu(res, flag, param) {
6907
+ var option = { url: res, flag: flag, param: param };
6908
+ if (util["a" /* default */].isObject(res)) {
6909
+ option = _extends({}, option, res);
6910
+ }
6826
6911
  var ids = void 0;
6827
- if (typeof res === 'string') {
6828
- if (flag) {
6829
- ids = this.getId(this.menus, res, true);
6912
+ if (typeof option.url === 'string') {
6913
+ if (option.flag) {
6914
+ ids = this.getId(this.menus, option.url, true);
6830
6915
  if (!ids) {
6831
6916
  this.$message.error('未在菜单栏中找到此地址');
6832
6917
  return;
6833
6918
  }
6834
6919
  } else {
6835
- ids = res.split(',');
6920
+ ids = option.url.split(',');
6836
6921
  }
6837
6922
  } else {
6838
- ids = res;
6923
+ ids = option.url;
6839
6924
  }
6840
- this.setDefault(this.menus, ids);
6925
+ this.setDefault(this.menus, ids, option.param);
6841
6926
  },
6842
6927
  getId: function getId(arry, res, path) {
6843
6928
  if (!res) {
@@ -6899,7 +6984,7 @@ var log = util["a" /* default */].getParams('console');
6899
6984
  if (ids) {
6900
6985
  _this6.defaultActive = ids;
6901
6986
  }
6902
- } else if (sessionStorage.getItem('jump') && _this6.history) {
6987
+ } else if (sessionStorage.getItem('jump') && _this6.isHistory) {
6903
6988
  var _ids4 = _this6.getId(_this6.menus, sessionStorage.getItem('jump'), true);
6904
6989
  if (_ids4) {
6905
6990
  _this6.defaultActive = _ids4;
@@ -6918,7 +7003,7 @@ var log = util["a" /* default */].getParams('console');
6918
7003
  _this6.navIds = _ids5;
6919
7004
  _this6.setTitle(_ids5[0]);
6920
7005
  }
6921
- } else if (sessionStorage.getItem('jump') && _this6.history) {
7006
+ } else if (sessionStorage.getItem('jump') && _this6.isHistory) {
6922
7007
  var _ids6 = _this6.getId(_this6.menus, sessionStorage.getItem('jump'), true);
6923
7008
  if (_ids6) {
6924
7009
  _this6.defaultActive = _ids6;
@@ -7068,7 +7153,7 @@ var log = util["a" /* default */].getParams('console');
7068
7153
  _this7.setTips(item);
7069
7154
  });
7070
7155
  } else {
7071
- if (Object.prototype.hasOwnProperty.call(obj, 'tips') && obj.tips) {
7156
+ if (obj && Object.prototype.hasOwnProperty.call(obj, 'tips') && obj.tips) {
7072
7157
  this.$set(obj, 'tips', false);
7073
7158
  delete obj.tips;
7074
7159
  }
@@ -7104,12 +7189,12 @@ var log = util["a" /* default */].getParams('console');
7104
7189
  },
7105
7190
 
7106
7191
  //设置默认导航页面
7107
- setDefault: function setDefault(res, active) {
7192
+ setDefault: function setDefault(res, active, param) {
7108
7193
  this.navIds = JSON.parse(JSON.stringify(active));
7109
7194
  this.sysId = '';
7110
7195
  this.tabsId = '';
7111
7196
  this.active = '';
7112
- this.getUrl(res, active);
7197
+ this.getUrl(res, active, param);
7113
7198
  if (this.layout === 'subsystem' || this.layout === 'subSystem' || this.layout === 'topnav' || this.layout === 'topNav' || this.layout === 'topside' || this.layout === 'topSide') {
7114
7199
  if (this.layout === 'subsystem' || this.layout === 'subSystem') {
7115
7200
  this.navs = [];
@@ -7158,18 +7243,18 @@ var log = util["a" /* default */].getParams('console');
7158
7243
  },
7159
7244
 
7160
7245
  //获取页面类型及地址
7161
- getUrl: function getUrl(res, active, index) {
7246
+ getUrl: function getUrl(res, active, index, param) {
7162
7247
  index = index === undefined ? 0 : index;
7163
7248
  for (var i = 0; i < res.length; i++) {
7164
7249
  var item = res[i];
7165
7250
  if (item.id === active[index]) {
7166
7251
  if (index === active.length - 1) {
7167
- this.handleJump(item.url, item.urlopenmode, item);
7252
+ this.handleJump(item.url, item.urlopenmode, item, param);
7168
7253
  return item.url;
7169
7254
  } else {
7170
7255
  if (item.children && item.children.length) {
7171
7256
  index++;
7172
- var _url4 = this.getUrl(item.children, active, index);
7257
+ var _url4 = this.getUrl(item.children, active, index, param);
7173
7258
  if (_url4 && index === active.length - 1) {
7174
7259
  this.tabs = '';
7175
7260
  }
@@ -7177,7 +7262,7 @@ var log = util["a" /* default */].getParams('console');
7177
7262
  }
7178
7263
  if (item.fourthTabs && item.fourthTabs.length) {
7179
7264
  index++;
7180
- var _url5 = this.getUrl(item.fourthTabs, active, index);
7265
+ var _url5 = this.getUrl(item.fourthTabs, active, index, param);
7181
7266
  if (_url5) {
7182
7267
  this.$set(this, 'tabs', item.fourthTabs);
7183
7268
  }
@@ -7185,7 +7270,7 @@ var log = util["a" /* default */].getParams('console');
7185
7270
  }
7186
7271
  }
7187
7272
  } else if (item.children && item.children.length) {
7188
- this.getUrl(item.children, active, index);
7273
+ this.getUrl(item.children, active, index, param);
7189
7274
  }
7190
7275
  }
7191
7276
  return false;
@@ -7366,7 +7451,7 @@ var log = util["a" /* default */].getParams('console');
7366
7451
  if (res.path !== '/' && pathname == _path) {
7367
7452
  return pathname;
7368
7453
  }
7369
- if (Object.prototype.hasOwnProperty.call(res, 'children')) {
7454
+ if (res && Object.prototype.hasOwnProperty.call(res, 'children')) {
7370
7455
  var _path2 = this.hasRouter(res.children, url);
7371
7456
  if (_path2) {
7372
7457
  return _path2;
@@ -7441,9 +7526,10 @@ var log = util["a" /* default */].getParams('console');
7441
7526
  },
7442
7527
 
7443
7528
  //跳转页面
7444
- handleJump: function handleJump(page, type, res) {
7529
+ handleJump: function handleJump(page, type, res, param) {
7445
7530
  var _this10 = this;
7446
7531
 
7532
+ console.log(page);
7447
7533
  var prevPage = sessionStorage.getItem('jump');
7448
7534
  sessionStorage.setItem('jump', page);
7449
7535
  if (res) {
@@ -7464,7 +7550,7 @@ var log = util["a" /* default */].getParams('console');
7464
7550
  } else if (type == 3) {
7465
7551
  this.method = 'iframe';
7466
7552
  this.refresh = false;
7467
- this.page = util["a" /* default */].handlerUrl(page);
7553
+ this.page = util["a" /* default */].handlerUrl(page, param);
7468
7554
  } else if (page) {
7469
7555
  var urls = page.split('?');
7470
7556
  if (urls[0].indexOf('.js') > 1) {
@@ -7477,12 +7563,12 @@ var log = util["a" /* default */].getParams('console');
7477
7563
  } else if (urls[0].indexOf('.dhtml') > 0 || urls[0].indexOf('.html') > 0 && urls[0].indexOf('.html#') === -1) {
7478
7564
  this.method = 'iframe';
7479
7565
  this.refresh = false;
7480
- this.page = util["a" /* default */].handlerUrl(page);
7566
+ this.page = util["a" /* default */].handlerUrl(page, param);
7481
7567
  } else {
7482
7568
  if (urls[0].indexOf('.html') === -1 && urls[0].indexOf('#/') === -1) {
7483
7569
  this.method = 'iframe';
7484
7570
  this.refresh = false;
7485
- this.page = util["a" /* default */].handlerUrl(page);
7571
+ this.page = util["a" /* default */].handlerUrl(page, param);
7486
7572
  } else {
7487
7573
  this.method = 'router';
7488
7574
  var routes = this.$router.options.routes;
@@ -7490,6 +7576,9 @@ var log = util["a" /* default */].getParams('console');
7490
7576
  var path = this.hasRouter(routes, urls[0]);
7491
7577
  if (path) {
7492
7578
  var params = util["a" /* default */].getParams({ url: page });
7579
+ if (param) {
7580
+ params = _extends({}, params, param);
7581
+ }
7493
7582
  if (res) {
7494
7583
  this.routerKey = res.id;
7495
7584
  if (Object.prototype.hasOwnProperty.call(res, 'keepAlive')) {
@@ -7511,7 +7600,7 @@ var log = util["a" /* default */].getParams('console');
7511
7600
  if (this.loadWujie === false || this.downgrade && isIE || urlopenmode == 3) {
7512
7601
  this.method = 'iframe';
7513
7602
  this.refresh = false;
7514
- this.page = util["a" /* default */].handlerUrl(page);
7603
+ this.page = util["a" /* default */].handlerUrl(page, param);
7515
7604
  } else {
7516
7605
  this.method = 'wujie';
7517
7606
  this.wjName = res && res.appCode ? res.appCode : 'application';
@@ -7657,52 +7746,44 @@ var log = util["a" /* default */].getParams('console');
7657
7746
 
7658
7747
  //开启weosocket
7659
7748
  initWebSocket: function initWebSocket() {
7660
- //初始化weosocket
7661
- if (!this.websocket) {
7662
- var _url6 = (util["a" /* default */].getStorage('wshost') || '') + api["Zb" /* wss */];
7663
- this.websocket = new external_sockjs_client_default.a(_url6);
7664
- }
7665
- this.client = external_stompjs_default.a.over(this.websocket);
7666
- if (!this.isConsole && this.client) {
7667
- this.client.debug = null;
7668
- }
7669
- this.handleConnect(this.client);
7670
- },
7671
- handleConnect: function handleConnect(client) {
7672
7749
  var _this12 = this;
7673
7750
 
7674
- client.connect({}, function () {
7675
- //localStorage.setItem("socket",true);
7676
- //订阅服务端的
7677
- client.subscribe(api["Qb" /* topic */], function (response) {
7678
- var res = JSON.parse(response.body);
7679
- var data = res.data;
7680
- for (var i in data) {
7681
- if (data[i] !== null && data[i] !== undefined) {
7682
- if (i === 'onlineUserNums' && data[i] > 0) {
7683
- _this12.online = data[i];
7684
- }
7685
- if (i === 'sysMsgNums') {
7686
- _this12.notice = data[i];
7687
- if (_this12.showMsg) {
7688
- _this12.$refs.message.getMsg(true);
7689
- }
7690
- }
7691
- if (i === 'menuTipsMap') {
7692
- _this12.menuTips = data[i];
7693
- }
7694
- if (i === 'sysMsgList') {
7695
- _this12.sysMsg = data[i];
7696
- }
7697
- if (i === 'extraData') {
7698
- _this12.extraData = data[i];
7751
+ util["a" /* default */].socket().then(function (res, close) {
7752
+ _this12.close = close;
7753
+ var data = res.data;
7754
+ for (var i in data) {
7755
+ if (data[i] !== null && data[i] !== undefined) {
7756
+ if (i === 'onlineUserNums' && data[i] > 0) {
7757
+ _this12.online = data[i];
7758
+ }
7759
+ if (i === 'sysMsgNums') {
7760
+ _this12.notice = data[i];
7761
+ if (_this12.showMsg) {
7762
+ _this12.$refs.message.getMsg(true);
7699
7763
  }
7700
7764
  }
7765
+ if (i === 'menuTipsMap') {
7766
+ _this12.menuTips = data[i];
7767
+ }
7768
+ if (i === 'sysMsgList') {
7769
+ _this12.sysMsg = data[i];
7770
+ }
7771
+ if (i === 'extraData') {
7772
+ _this12.extraData = data[i];
7773
+ }
7701
7774
  }
7702
- });
7703
- }, function (error) {
7704
- console.log('webSocket连接失败');
7705
- client.disconnect();
7775
+ }
7776
+ if (_this12.$store) {
7777
+ _this12.$store.commit('websocket', data);
7778
+ }
7779
+ if (_this12.$eventBus) {
7780
+ _this12.$eventBus.$emit('websocket', data);
7781
+ }
7782
+ if (util["a" /* default */].win.eventBus) {
7783
+ util["a" /* default */].win.eventBus.$emit('websocket', data);
7784
+ }
7785
+ }).catch(function (err) {
7786
+ console.log(err);
7706
7787
  });
7707
7788
  },
7708
7789
  handleOpened: function handleOpened(res) {
@@ -7822,8 +7903,8 @@ var log = util["a" /* default */].getParams('console');
7822
7903
  },
7823
7904
  beforeDestroy: function beforeDestroy() {
7824
7905
  this.timer = null;
7825
- if (this.client && this.client.connected) {
7826
- this.client.disconnect();
7906
+ if (this.close) {
7907
+ this.close();
7827
7908
  }
7828
7909
  }
7829
7910
  });