eoss-ui 0.8.4 → 0.8.6

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 (144) hide show
  1. package/lib/button-group.js +64 -57
  2. package/lib/button.js +64 -57
  3. package/lib/calogin.js +107 -69
  4. package/lib/checkbox-group.js +64 -57
  5. package/lib/data-table-form.js +64 -57
  6. package/lib/data-table.js +64 -57
  7. package/lib/date-picker.js +64 -57
  8. package/lib/dialog.js +64 -57
  9. package/lib/eoss-ui.common.js +631 -582
  10. package/lib/flow-group.js +64 -57
  11. package/lib/flow-list.js +160 -153
  12. package/lib/flow.js +465 -444
  13. package/lib/form.js +64 -57
  14. package/lib/handle-user.js +64 -57
  15. package/lib/handler.js +64 -57
  16. package/lib/icon.js +64 -57
  17. package/lib/index.js +1 -1
  18. package/lib/input-number.js +64 -57
  19. package/lib/input.js +64 -57
  20. package/lib/login.js +64 -57
  21. package/lib/main.js +86 -78
  22. package/lib/nav.js +64 -57
  23. package/lib/page.js +64 -57
  24. package/lib/pagination.js +64 -57
  25. package/lib/player.js +64 -57
  26. package/lib/qr-code.js +64 -57
  27. package/lib/radio-group.js +64 -57
  28. package/lib/retrial-auth.js +64 -57
  29. package/lib/select-ganged.js +64 -57
  30. package/lib/select.js +64 -57
  31. package/lib/selector-panel.js +64 -57
  32. package/lib/selector.js +64 -57
  33. package/lib/sizer.js +64 -57
  34. package/lib/steps.js +64 -57
  35. package/lib/switch.js +64 -57
  36. package/lib/table-form.js +64 -57
  37. package/lib/tabs.js +64 -57
  38. package/lib/theme-chalk/index.css +1 -1
  39. package/lib/theme-chalk/login.css +1 -1
  40. package/lib/tips.js +64 -57
  41. package/lib/tree-group.js +64 -57
  42. package/lib/tree.js +64 -57
  43. package/lib/upload.js +64 -57
  44. package/lib/utils/util.js +64 -57
  45. package/lib/wujie.js +64 -57
  46. package/lib/wxlogin.js +64 -57
  47. package/package.json +1 -1
  48. package/packages/.DS_Store +0 -0
  49. package/packages/button-group/src/main.vue +346 -346
  50. package/packages/calogin/.DS_Store +0 -0
  51. package/packages/calogin/src/main.vue +412 -412
  52. package/packages/calogin/src/plugin.js +3 -3
  53. package/packages/clients/src/main.vue +151 -151
  54. package/packages/date-picker/.DS_Store +0 -0
  55. package/packages/date-picker/src/.DS_Store +0 -0
  56. package/packages/dialog/.DS_Store +0 -0
  57. package/packages/flow/.DS_Store +0 -0
  58. package/packages/flow/src/.DS_Store +0 -0
  59. package/packages/flow/src/component/Circulate.vue +417 -417
  60. package/packages/flow/src/component/CommonOpinions.vue +376 -376
  61. package/packages/flow/src/component/CustomPreset.vue +324 -324
  62. package/packages/flow/src/component/FileList.vue +97 -97
  63. package/packages/flow/src/component/Preset.vue +257 -257
  64. package/packages/flow/src/component/SendMsg.vue +242 -242
  65. package/packages/flow/src/component/SortFlow.vue +110 -110
  66. package/packages/flow/src/component/taskUnionExamine.vue +761 -761
  67. package/packages/flow/src/form.vue +123 -123
  68. package/packages/flow/src/freeStartFlow.vue +2855 -2855
  69. package/packages/flow/src/processForm.vue +1711 -1680
  70. package/packages/flow/src/processReject.vue +309 -309
  71. package/packages/flow/src/reset.vue +946 -946
  72. package/packages/flow/src/startTaskRead.vue +695 -695
  73. package/packages/flow/src/supervise.vue +159 -159
  74. package/packages/flow/src/table.vue +58 -58
  75. package/packages/flow-list/.DS_Store +0 -0
  76. package/packages/flow-list/src/main.vue +2337 -2337
  77. package/packages/form/.DS_Store +0 -0
  78. package/packages/form/src/main.vue +3901 -3901
  79. package/packages/form/src/table.vue +1512 -1512
  80. package/packages/icon/.DS_Store +0 -0
  81. package/packages/icon/src/main.vue +104 -104
  82. package/packages/login/.DS_Store +0 -0
  83. package/packages/login/src/resetPassword.vue +557 -557
  84. package/packages/main/.DS_Store +0 -0
  85. package/packages/main/src/.DS_Store +0 -0
  86. package/packages/main/src/main.vue +1 -1
  87. package/packages/main/src/public/online.vue +89 -89
  88. package/packages/main/src/public/search.vue +464 -464
  89. package/packages/main/src/public/settings.vue +273 -273
  90. package/packages/main/src/simplicity/apps.vue +388 -388
  91. package/packages/main/src/simplicity/avatar.vue +82 -82
  92. package/packages/main/src/simplicity/handler.vue +158 -158
  93. package/packages/main/src/simplicity/menu-list.vue +135 -135
  94. package/packages/main/src/simplicity/message.vue +293 -293
  95. package/packages/main/src/simplicity/notice.vue +222 -222
  96. package/packages/main/src/simplicity/sub-menu.vue +276 -276
  97. package/packages/main/src/simplicity/user.vue +259 -259
  98. package/packages/main/src/simplicityTop/apps.vue +388 -388
  99. package/packages/main/src/simplicityTop/avatar.vue +82 -82
  100. package/packages/main/src/simplicityTop/handler.vue +215 -215
  101. package/packages/main/src/simplicityTop/index.vue +6 -5
  102. package/packages/main/src/simplicityTop/lists.vue +84 -84
  103. package/packages/main/src/simplicityTop/menu-list.vue +135 -135
  104. package/packages/main/src/simplicityTop/message.vue +293 -293
  105. package/packages/main/src/simplicityTop/notice.vue +222 -222
  106. package/packages/main/src/simplicityTop/router-page.vue +45 -45
  107. package/packages/main/src/simplicityTop/sub-menu.vue +274 -274
  108. package/packages/main/src/simplicityTop/user.vue +259 -259
  109. package/packages/menu/.DS_Store +0 -0
  110. package/packages/menu/src/main.vue +595 -595
  111. package/packages/nav/src/main.vue +351 -351
  112. package/packages/select/.DS_Store +0 -0
  113. package/packages/selector/.DS_Store +0 -0
  114. package/packages/selector/src/main.vue +761 -761
  115. package/packages/selector-panel/.DS_Store +0 -0
  116. package/packages/selector-panel/src/main.vue +1036 -1036
  117. package/packages/selector-panel/src/selection.vue +174 -174
  118. package/packages/switch/src/main.vue +170 -170
  119. package/packages/theme-chalk/lib/index.css +1 -1
  120. package/packages/theme-chalk/lib/login.css +1 -1
  121. package/packages/theme-chalk/src/.DS_Store +0 -0
  122. package/packages/theme-chalk/src/data-table.scss +297 -297
  123. package/packages/theme-chalk/src/flow-list.scss +55 -55
  124. package/packages/theme-chalk/src/flow.scss +373 -373
  125. package/packages/theme-chalk/src/form.scss +501 -501
  126. package/packages/theme-chalk/src/handler.scss +148 -148
  127. package/packages/theme-chalk/src/icon.scss +3452 -3452
  128. package/packages/theme-chalk/src/login.scss +1006 -1006
  129. package/packages/theme-chalk/src/main.scss +664 -664
  130. package/packages/theme-chalk/src/menu.scss +224 -224
  131. package/packages/theme-chalk/src/selector.scss +114 -114
  132. package/packages/theme-chalk/src/simplicity-top.scss +1845 -1845
  133. package/packages/theme-chalk/src/simplicity.scss +1403 -1403
  134. package/packages/theme-chalk/src/tree.scss +165 -165
  135. package/packages/theme-chalk/src/upload.scss +172 -172
  136. package/packages/tips/src/main.vue +141 -141
  137. package/packages/upload/.DS_Store +0 -0
  138. package/packages/wujie/src/main.vue +146 -146
  139. package/src/.DS_Store +0 -0
  140. package/src/config/api.js +348 -348
  141. package/src/index.js +163 -163
  142. package/src/utils/.DS_Store +0 -0
  143. package/src/utils/rules.js +18 -18
  144. package/src/utils/util.js +54 -48
package/lib/upload.js CHANGED
@@ -825,6 +825,7 @@ var busEmit = function busEmit(that, _ref3) {
825
825
  args = _ref3.args,
826
826
  opener = _ref3.opener;
827
827
 
828
+ var winTop = getWinTop();
828
829
  if (opener) {
829
830
  var source = opener.source,
830
831
  origin = opener.origin;
@@ -833,19 +834,19 @@ var busEmit = function busEmit(that, _ref3) {
833
834
  return;
834
835
  }
835
836
  if (isIE) {
836
- if (win.top !== win.self) {
837
- win.top.postMessage({ method: method, query: args, args: args }, '*');
837
+ if (winTop !== win.self) {
838
+ winTop.postMessage({ method: method, query: args, args: args }, '*');
838
839
  return;
839
840
  }
840
841
  var bus = that ? that.bus || that.$root.Bus || that.$root.$bus : null;
841
842
  bus && (Array.isArray(args) ? bus.$emit.apply(bus, [method].concat(args)) : bus.$emit(method, args));
842
843
  } else {
843
- if (win.top !== win.self) {
844
+ if (winTop !== win.self) {
844
845
  var _bus2 = win.$wujie ? win.$wujie.bus : null;
845
846
  if (_bus2) {
846
847
  Array.isArray(args) ? _bus2.$emit.apply(_bus2, [method].concat(args)) : _bus2.$emit(method, args);
847
848
  } else {
848
- win.top.postMessage({ method: method, query: args, args: args }, '*');
849
+ winTop.postMessage({ method: method, query: args, args: args }, '*');
849
850
  }
850
851
  return;
851
852
  }
@@ -1081,9 +1082,10 @@ var delUrlParam = function delUrlParam(_ref4) {
1081
1082
  var url = _ref4.url,
1082
1083
  key = _ref4.key;
1083
1084
 
1085
+ var winTop = getWinTop();
1084
1086
  var pUrl = '';
1085
1087
  try {
1086
- pUrl = win.top.location.href;
1088
+ pUrl = winTop.location.href;
1087
1089
  } catch (error) {
1088
1090
  pUrl = win.location.href;
1089
1091
  }
@@ -2511,18 +2513,20 @@ var isLogined = function () {
2511
2513
  cookie = _ref11.cookie,
2512
2514
  loginPage = _ref11.loginPage,
2513
2515
  redirect = _ref11.redirect;
2514
- var quit, pathname, path, token, loadingInstance, referrerUrl;
2516
+ var winTop, quit, pathname, path, token, loadingInstance, referrerUrl;
2515
2517
  return regenerator_default.a.wrap(function _callee$(_context) {
2516
2518
  while (1) {
2517
2519
  switch (_context.prev = _context.next) {
2518
2520
  case 0:
2521
+ winTop = getWinTop();
2522
+
2519
2523
  if (cookie === undefined) {
2520
2524
  cookie = getParams({ name: 'cookie' });
2521
2525
  }
2522
2526
  quit = getParams('quit') || getParams('logout');
2523
2527
 
2524
2528
  if (!quit) {
2525
- _context.next = 5;
2529
+ _context.next = 6;
2526
2530
  break;
2527
2531
  }
2528
2532
 
@@ -2533,11 +2537,11 @@ var isLogined = function () {
2533
2537
  }).catch(function () {});
2534
2538
  return _context.abrupt('return');
2535
2539
 
2536
- case 5:
2540
+ case 6:
2537
2541
  pathname = '';
2538
2542
 
2539
2543
  try {
2540
- pathname = win.top.location.pathname;
2544
+ pathname = winTop.location.pathname;
2541
2545
  } catch (error) {
2542
2546
  pathname = win.location.pathname;
2543
2547
  }
@@ -2563,17 +2567,17 @@ var isLogined = function () {
2563
2567
  // eslint-disable-next-line eqeqeq
2564
2568
 
2565
2569
  if (!(token || cookie == true || cookie == 1)) {
2566
- _context.next = 13;
2570
+ _context.next = 14;
2567
2571
  break;
2568
2572
  }
2569
2573
 
2570
2574
  next && next();
2571
- _context.next = 20;
2575
+ _context.next = 21;
2572
2576
  break;
2573
2577
 
2574
- case 13:
2578
+ case 14:
2575
2579
  if (!(!token && Object.prototype.hasOwnProperty.call(to.query, 'serverId') && Object.prototype.hasOwnProperty.call(to.query, 'authType'))) {
2576
- _context.next = 19;
2580
+ _context.next = 20;
2577
2581
  break;
2578
2582
  }
2579
2583
 
@@ -2582,7 +2586,7 @@ var isLogined = function () {
2582
2586
  spinner: 'el-icon-loading',
2583
2587
  background: 'rgba(0, 0, 0, 0.65)'
2584
2588
  });
2585
- _context.next = 17;
2589
+ _context.next = 18;
2586
2590
  return util_ajax({
2587
2591
  method: 'post',
2588
2592
  url: api["b" /* authCenter */],
@@ -2603,12 +2607,12 @@ var isLogined = function () {
2603
2607
  });
2604
2608
  try {
2605
2609
  var url = delUrlParam({
2606
- url: win.top.location.href,
2610
+ url: winTop.location.href,
2607
2611
  key: ['serverId', 'authType', 'code', 'sessionId']
2608
2612
  });
2609
- win.top.location.href = url;
2613
+ winTop.location.href = url;
2610
2614
  setTimeout(function () {
2611
- win.top.location.reload();
2615
+ winTop.location.reload();
2612
2616
  }, 200);
2613
2617
  } catch (error) {
2614
2618
  var _url2 = delUrlParam({
@@ -2627,8 +2631,8 @@ var isLogined = function () {
2627
2631
  break;
2628
2632
  case 3:
2629
2633
  try {
2630
- var href = results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(win.top.location.href));
2631
- win.top.location.href = href;
2634
+ var href = results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(winTop.location.href));
2635
+ winTop.location.href = href;
2632
2636
  } catch (error) {
2633
2637
  var _href = results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(win.location.href));
2634
2638
  win.location.href = _href;
@@ -2642,18 +2646,18 @@ var isLogined = function () {
2642
2646
  sessionStorage.setItem('extUserBindHandleId', results.extUserBindHandleId);
2643
2647
  try {
2644
2648
  if (loginPage) {
2645
- win.top.location.replace(loginPage);
2649
+ winTop.location.replace(loginPage);
2646
2650
  } else if (document.referrer) {
2647
2651
  var referrerUrl = new URL(document.referrer);
2648
- if (referrerUrl.host !== win.top.location.host) {
2649
- win.top.location.replace(document.referrer);
2650
- } else if (win.top.location.href.indexOf('main.html') > -1 || win.top.location.href.indexOf('index.html') > -1 || document.referrer.indexOf('main.html') > -1 || document.referrer.indexOf('index.html') > -1) {
2651
- win.top.location.href = './login.html';
2652
+ if (referrerUrl.host !== winTop.location.host) {
2653
+ winTop.location.replace(document.referrer);
2654
+ } else if (winTop.location.href.indexOf('main.html') > -1 || winTop.location.href.indexOf('index.html') > -1 || document.referrer.indexOf('main.html') > -1 || document.referrer.indexOf('index.html') > -1) {
2655
+ winTop.location.href = './login.html';
2652
2656
  } else {
2653
2657
  next('/login');
2654
2658
  }
2655
- } else if (win.top.location.href.indexOf('main.html') > -1) {
2656
- win.top.location.href = './login.html';
2659
+ } else if (winTop.location.href.indexOf('main.html') > -1) {
2660
+ winTop.location.href = './login.html';
2657
2661
  } else {
2658
2662
  next('/login');
2659
2663
  }
@@ -2672,18 +2676,18 @@ var isLogined = function () {
2672
2676
  callback: function callback() {
2673
2677
  try {
2674
2678
  if (loginPage) {
2675
- win.top.location.replace(loginPage);
2679
+ winTop.location.replace(loginPage);
2676
2680
  } else if (document.referrer) {
2677
2681
  var referrerUrl = new URL(document.referrer);
2678
- if (referrerUrl.host !== win.top.location.host) {
2679
- win.top.location.replace(document.referrer);
2680
- } else if (win.top.location.href.indexOf('main.html') > -1 || win.top.location.href.indexOf('index.html') > -1 || document.referrer.indexOf('main.html') > -1 || document.referrer.indexOf('index.html') > -1) {
2681
- win.top.location.href = './login.html';
2682
+ if (referrerUrl.host !== winTop.location.host) {
2683
+ winTop.location.replace(document.referrer);
2684
+ } else if (winTop.location.href.indexOf('main.html') > -1 || winTop.location.href.indexOf('index.html') > -1 || document.referrer.indexOf('main.html') > -1 || document.referrer.indexOf('index.html') > -1) {
2685
+ winTop.location.href = './login.html';
2682
2686
  } else {
2683
2687
  next('/login');
2684
2688
  }
2685
- } else if (win.top.location.href.indexOf('main.html') > -1) {
2686
- win.top.location.href = './login.html';
2689
+ } else if (winTop.location.href.indexOf('main.html') > -1) {
2690
+ winTop.location.href = './login.html';
2687
2691
  } else {
2688
2692
  next('/login');
2689
2693
  }
@@ -2698,11 +2702,11 @@ var isLogined = function () {
2698
2702
  loadingInstance.close();
2699
2703
  });
2700
2704
 
2701
- case 17:
2702
- _context.next = 20;
2705
+ case 18:
2706
+ _context.next = 21;
2703
2707
  break;
2704
2708
 
2705
- case 19:
2709
+ case 20:
2706
2710
  if (token || to.path === '/' || to.path === '/404' || to.path === '/error' || typeof exclude === 'boolean' && exclude || exclude.indexOf(to.path) > -1 || exclude.indexOf(to.name) > -1 || to.path === '/login' || token && to.path === '/main') {
2707
2711
  if (redirect && (to.path === '/main' || to.path === '/login')) {
2708
2712
  window.location.replace(urlJoinParams({ url: '.' + to.path + '.html', param: to.query }));
@@ -2712,19 +2716,19 @@ var isLogined = function () {
2712
2716
  } else {
2713
2717
  try {
2714
2718
  if (loginPage) {
2715
- win.top.location.replace(loginPage);
2719
+ winTop.location.replace(loginPage);
2716
2720
  } else if (document.referrer) {
2717
2721
  referrerUrl = new URL(document.referrer);
2718
2722
 
2719
- if (referrerUrl.host !== win.top.location.host) {
2720
- win.top.location.replace(document.referrer);
2721
- } else if (win.top.location.href.indexOf('main.html') > -1 || win.top.location.href.indexOf('index.html') > -1 || document.referrer.indexOf('main.html') > -1 || document.referrer.indexOf('index.html') > -1) {
2722
- win.top.location.href = './login.html';
2723
+ if (referrerUrl.host !== winTop.location.host) {
2724
+ winTop.location.replace(document.referrer);
2725
+ } else if (winTop.location.href.indexOf('main.html') > -1 || winTop.location.href.indexOf('index.html') > -1 || document.referrer.indexOf('main.html') > -1 || document.referrer.indexOf('index.html') > -1) {
2726
+ winTop.location.href = './login.html';
2723
2727
  } else {
2724
2728
  next('/login');
2725
2729
  }
2726
- } else if (win.top.location.href.indexOf('main.html') > -1) {
2727
- win.top.location.href = './login.html';
2730
+ } else if (winTop.location.href.indexOf('main.html') > -1) {
2731
+ winTop.location.href = './login.html';
2728
2732
  } else {
2729
2733
  next('/login');
2730
2734
  }
@@ -2733,7 +2737,7 @@ var isLogined = function () {
2733
2737
  }
2734
2738
  }
2735
2739
 
2736
- case 20:
2740
+ case 21:
2737
2741
  case 'end':
2738
2742
  return _context.stop();
2739
2743
  }
@@ -2851,12 +2855,13 @@ var loadJs = function loadJs(_ref13) {
2851
2855
  * @param {String} [text] - 显示的文本内容
2852
2856
  **/
2853
2857
  var util_loading = function loading($loading, res) {
2858
+ var winTop = getWinTop();
2854
2859
  if (!$loading) {
2855
2860
  $loading = external_eoss_element_["Loading"].service;
2856
2861
  }
2857
2862
  if (isObject(res)) {
2858
2863
  var config = extend({}, {
2859
- target: win.top.document.body,
2864
+ target: winTop.document.body,
2860
2865
  fullscreen: true,
2861
2866
  background: 'rgba(0, 0, 0, 0.65)',
2862
2867
  spinner: 'el-icon-loading',
@@ -2865,7 +2870,7 @@ var util_loading = function loading($loading, res) {
2865
2870
  return $loading(config);
2866
2871
  } else {
2867
2872
  var _loading = $loading({
2868
- target: win.top.document.body,
2873
+ target: winTop.document.body,
2869
2874
  fullscreen: true,
2870
2875
  background: 'rgba(0, 0, 0, 0.65)',
2871
2876
  spinner: 'el-icon-loading',
@@ -3007,11 +3012,12 @@ var replenish = function replenish(_ref15) {
3007
3012
  * @param {object} [data] - 数字或字符串型数字
3008
3013
  **/
3009
3014
  var util_responses = function responses(data) {
3015
+ var winTop = getWinTop();
3010
3016
  if (data.rCode === 64 || data.rCode === 65 || data.rCode === 67 || data.rCode === 69) {
3011
3017
  removeStorage(['Authorization', 'token', 'ssId', 'userId', 'userName', 'deviceUnique', 'menus', 'useCaseCodes', 'mainConfig', 'jump', 'showLaunch']);
3012
3018
  var href = '';
3013
3019
  try {
3014
- href = win.top.location.href;
3020
+ href = winTop.location.href;
3015
3021
  } catch (error) {
3016
3022
  href = win.location.href;
3017
3023
  }
@@ -3036,7 +3042,7 @@ var util_responses = function responses(data) {
3036
3042
  if (loginPage) {
3037
3043
  var src = void 0;
3038
3044
  if (!startWith(loginPage, ['http', '/'], true)) {
3039
- var pathname = win.top.location.pathname;
3045
+ var pathname = winTop.location.pathname;
3040
3046
  if (pathname !== '/') {
3041
3047
  pathname = pathname.split('/');
3042
3048
  pathname.splice(pathname.length - 1);
@@ -3048,16 +3054,16 @@ var util_responses = function responses(data) {
3048
3054
  } else {
3049
3055
  src = loginPage;
3050
3056
  }
3051
- win.top.location.href = src;
3052
- } else if (win.top.location.href.indexOf('main.html') > -1) {
3053
- win.top.location.href = './login.html';
3057
+ winTop.location.href = src;
3058
+ } else if (winTop.location.href.indexOf('main.html') > -1) {
3059
+ winTop.location.href = './login.html';
3054
3060
  } else {
3055
- var hash = win.top.location.hash;
3061
+ var hash = winTop.location.hash;
3056
3062
  if (hash) {
3057
- var len = win.top.location.href.indexOf(hash);
3058
- win.top.location.href = win.location.href.slice(0, len) + '#/login';
3063
+ var len = winTop.location.href.indexOf(hash);
3064
+ winTop.location.href = win.location.href.slice(0, len) + '#/login';
3059
3065
  } else {
3060
- win.top.location.href = '/login.html';
3066
+ winTop.location.href = '/login.html';
3061
3067
  }
3062
3068
  }
3063
3069
  } catch (error) {
@@ -3875,10 +3881,11 @@ var removeCookie = function removeCookie(key) {
3875
3881
  };
3876
3882
 
3877
3883
  var winTopOpen = function winTopOpen(config) {
3884
+ var winTop = getWinTop();
3878
3885
  if (isIE) {
3879
- if (win.top !== win.self) {
3886
+ if (winTop !== win.self) {
3880
3887
  try {
3881
- win.top.windowOpen(config);
3888
+ winTop.windowOpen(config);
3882
3889
  } catch (error) {
3883
3890
  win.postMessage({ method: 'windowOpen', query: config }, '*');
3884
3891
  }
package/lib/utils/util.js CHANGED
@@ -588,6 +588,7 @@ var busEmit = function busEmit(that, _ref3) {
588
588
  args = _ref3.args,
589
589
  opener = _ref3.opener;
590
590
 
591
+ var winTop = getWinTop();
591
592
  if (opener) {
592
593
  var source = opener.source,
593
594
  origin = opener.origin;
@@ -596,19 +597,19 @@ var busEmit = function busEmit(that, _ref3) {
596
597
  return;
597
598
  }
598
599
  if (isIE) {
599
- if (win.top !== win.self) {
600
- win.top.postMessage({ method: method, query: args, args: args }, '*');
600
+ if (winTop !== win.self) {
601
+ winTop.postMessage({ method: method, query: args, args: args }, '*');
601
602
  return;
602
603
  }
603
604
  var bus = that ? that.bus || that.$root.Bus || that.$root.$bus : null;
604
605
  bus && (Array.isArray(args) ? bus.$emit.apply(bus, [method].concat(args)) : bus.$emit(method, args));
605
606
  } else {
606
- if (win.top !== win.self) {
607
+ if (winTop !== win.self) {
607
608
  var _bus2 = win.$wujie ? win.$wujie.bus : null;
608
609
  if (_bus2) {
609
610
  Array.isArray(args) ? _bus2.$emit.apply(_bus2, [method].concat(args)) : _bus2.$emit(method, args);
610
611
  } else {
611
- win.top.postMessage({ method: method, query: args, args: args }, '*');
612
+ winTop.postMessage({ method: method, query: args, args: args }, '*');
612
613
  }
613
614
  return;
614
615
  }
@@ -844,9 +845,10 @@ var delUrlParam = function delUrlParam(_ref4) {
844
845
  var url = _ref4.url,
845
846
  key = _ref4.key;
846
847
 
848
+ var winTop = getWinTop();
847
849
  var pUrl = '';
848
850
  try {
849
- pUrl = win.top.location.href;
851
+ pUrl = winTop.location.href;
850
852
  } catch (error) {
851
853
  pUrl = win.location.href;
852
854
  }
@@ -2274,18 +2276,20 @@ var isLogined = function () {
2274
2276
  cookie = _ref10.cookie,
2275
2277
  loginPage = _ref10.loginPage,
2276
2278
  redirect = _ref10.redirect;
2277
- var quit, pathname, path, token, loadingInstance, referrerUrl;
2279
+ var winTop, quit, pathname, path, token, loadingInstance, referrerUrl;
2278
2280
  return _regenerator2.default.wrap(function _callee$(_context) {
2279
2281
  while (1) {
2280
2282
  switch (_context.prev = _context.next) {
2281
2283
  case 0:
2284
+ winTop = getWinTop();
2285
+
2282
2286
  if (cookie === undefined) {
2283
2287
  cookie = getParams({ name: 'cookie' });
2284
2288
  }
2285
2289
  quit = getParams('quit') || getParams('logout');
2286
2290
 
2287
2291
  if (!quit) {
2288
- _context.next = 5;
2292
+ _context.next = 6;
2289
2293
  break;
2290
2294
  }
2291
2295
 
@@ -2296,11 +2300,11 @@ var isLogined = function () {
2296
2300
  }).catch(function () {});
2297
2301
  return _context.abrupt('return');
2298
2302
 
2299
- case 5:
2303
+ case 6:
2300
2304
  pathname = '';
2301
2305
 
2302
2306
  try {
2303
- pathname = win.top.location.pathname;
2307
+ pathname = winTop.location.pathname;
2304
2308
  } catch (error) {
2305
2309
  pathname = win.location.pathname;
2306
2310
  }
@@ -2326,17 +2330,17 @@ var isLogined = function () {
2326
2330
  // eslint-disable-next-line eqeqeq
2327
2331
 
2328
2332
  if (!(token || cookie == true || cookie == 1)) {
2329
- _context.next = 13;
2333
+ _context.next = 14;
2330
2334
  break;
2331
2335
  }
2332
2336
 
2333
2337
  next && next();
2334
- _context.next = 20;
2338
+ _context.next = 21;
2335
2339
  break;
2336
2340
 
2337
- case 13:
2341
+ case 14:
2338
2342
  if (!(!token && Object.prototype.hasOwnProperty.call(to.query, 'serverId') && Object.prototype.hasOwnProperty.call(to.query, 'authType'))) {
2339
- _context.next = 19;
2343
+ _context.next = 20;
2340
2344
  break;
2341
2345
  }
2342
2346
 
@@ -2345,7 +2349,7 @@ var isLogined = function () {
2345
2349
  spinner: 'el-icon-loading',
2346
2350
  background: 'rgba(0, 0, 0, 0.65)'
2347
2351
  });
2348
- _context.next = 17;
2352
+ _context.next = 18;
2349
2353
  return ajax({
2350
2354
  method: 'post',
2351
2355
  url: _api.authCenter,
@@ -2366,12 +2370,12 @@ var isLogined = function () {
2366
2370
  });
2367
2371
  try {
2368
2372
  var url = delUrlParam({
2369
- url: win.top.location.href,
2373
+ url: winTop.location.href,
2370
2374
  key: ['serverId', 'authType', 'code', 'sessionId']
2371
2375
  });
2372
- win.top.location.href = url;
2376
+ winTop.location.href = url;
2373
2377
  setTimeout(function () {
2374
- win.top.location.reload();
2378
+ winTop.location.reload();
2375
2379
  }, 200);
2376
2380
  } catch (error) {
2377
2381
  var _url2 = delUrlParam({
@@ -2390,8 +2394,8 @@ var isLogined = function () {
2390
2394
  break;
2391
2395
  case 3:
2392
2396
  try {
2393
- var href = results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(win.top.location.href));
2394
- win.top.location.href = href;
2397
+ var href = results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(winTop.location.href));
2398
+ winTop.location.href = href;
2395
2399
  } catch (error) {
2396
2400
  var _href = results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(win.location.href));
2397
2401
  win.location.href = _href;
@@ -2405,18 +2409,18 @@ var isLogined = function () {
2405
2409
  sessionStorage.setItem('extUserBindHandleId', results.extUserBindHandleId);
2406
2410
  try {
2407
2411
  if (loginPage) {
2408
- win.top.location.replace(loginPage);
2412
+ winTop.location.replace(loginPage);
2409
2413
  } else if (document.referrer) {
2410
2414
  var referrerUrl = new URL(document.referrer);
2411
- if (referrerUrl.host !== win.top.location.host) {
2412
- win.top.location.replace(document.referrer);
2413
- } else if (win.top.location.href.indexOf('main.html') > -1 || win.top.location.href.indexOf('index.html') > -1 || document.referrer.indexOf('main.html') > -1 || document.referrer.indexOf('index.html') > -1) {
2414
- win.top.location.href = './login.html';
2415
+ if (referrerUrl.host !== winTop.location.host) {
2416
+ winTop.location.replace(document.referrer);
2417
+ } else if (winTop.location.href.indexOf('main.html') > -1 || winTop.location.href.indexOf('index.html') > -1 || document.referrer.indexOf('main.html') > -1 || document.referrer.indexOf('index.html') > -1) {
2418
+ winTop.location.href = './login.html';
2415
2419
  } else {
2416
2420
  next('/login');
2417
2421
  }
2418
- } else if (win.top.location.href.indexOf('main.html') > -1) {
2419
- win.top.location.href = './login.html';
2422
+ } else if (winTop.location.href.indexOf('main.html') > -1) {
2423
+ winTop.location.href = './login.html';
2420
2424
  } else {
2421
2425
  next('/login');
2422
2426
  }
@@ -2435,18 +2439,18 @@ var isLogined = function () {
2435
2439
  callback: function callback() {
2436
2440
  try {
2437
2441
  if (loginPage) {
2438
- win.top.location.replace(loginPage);
2442
+ winTop.location.replace(loginPage);
2439
2443
  } else if (document.referrer) {
2440
2444
  var referrerUrl = new URL(document.referrer);
2441
- if (referrerUrl.host !== win.top.location.host) {
2442
- win.top.location.replace(document.referrer);
2443
- } else if (win.top.location.href.indexOf('main.html') > -1 || win.top.location.href.indexOf('index.html') > -1 || document.referrer.indexOf('main.html') > -1 || document.referrer.indexOf('index.html') > -1) {
2444
- win.top.location.href = './login.html';
2445
+ if (referrerUrl.host !== winTop.location.host) {
2446
+ winTop.location.replace(document.referrer);
2447
+ } else if (winTop.location.href.indexOf('main.html') > -1 || winTop.location.href.indexOf('index.html') > -1 || document.referrer.indexOf('main.html') > -1 || document.referrer.indexOf('index.html') > -1) {
2448
+ winTop.location.href = './login.html';
2445
2449
  } else {
2446
2450
  next('/login');
2447
2451
  }
2448
- } else if (win.top.location.href.indexOf('main.html') > -1) {
2449
- win.top.location.href = './login.html';
2452
+ } else if (winTop.location.href.indexOf('main.html') > -1) {
2453
+ winTop.location.href = './login.html';
2450
2454
  } else {
2451
2455
  next('/login');
2452
2456
  }
@@ -2461,11 +2465,11 @@ var isLogined = function () {
2461
2465
  loadingInstance.close();
2462
2466
  });
2463
2467
 
2464
- case 17:
2465
- _context.next = 20;
2468
+ case 18:
2469
+ _context.next = 21;
2466
2470
  break;
2467
2471
 
2468
- case 19:
2472
+ case 20:
2469
2473
  if (token || to.path === '/' || to.path === '/404' || to.path === '/error' || typeof exclude === 'boolean' && exclude || exclude.indexOf(to.path) > -1 || exclude.indexOf(to.name) > -1 || to.path === '/login' || token && to.path === '/main') {
2470
2474
  if (redirect && (to.path === '/main' || to.path === '/login')) {
2471
2475
  window.location.replace(urlJoinParams({ url: '.' + to.path + '.html', param: to.query }));
@@ -2475,19 +2479,19 @@ var isLogined = function () {
2475
2479
  } else {
2476
2480
  try {
2477
2481
  if (loginPage) {
2478
- win.top.location.replace(loginPage);
2482
+ winTop.location.replace(loginPage);
2479
2483
  } else if (document.referrer) {
2480
2484
  referrerUrl = new URL(document.referrer);
2481
2485
 
2482
- if (referrerUrl.host !== win.top.location.host) {
2483
- win.top.location.replace(document.referrer);
2484
- } else if (win.top.location.href.indexOf('main.html') > -1 || win.top.location.href.indexOf('index.html') > -1 || document.referrer.indexOf('main.html') > -1 || document.referrer.indexOf('index.html') > -1) {
2485
- win.top.location.href = './login.html';
2486
+ if (referrerUrl.host !== winTop.location.host) {
2487
+ winTop.location.replace(document.referrer);
2488
+ } else if (winTop.location.href.indexOf('main.html') > -1 || winTop.location.href.indexOf('index.html') > -1 || document.referrer.indexOf('main.html') > -1 || document.referrer.indexOf('index.html') > -1) {
2489
+ winTop.location.href = './login.html';
2486
2490
  } else {
2487
2491
  next('/login');
2488
2492
  }
2489
- } else if (win.top.location.href.indexOf('main.html') > -1) {
2490
- win.top.location.href = './login.html';
2493
+ } else if (winTop.location.href.indexOf('main.html') > -1) {
2494
+ winTop.location.href = './login.html';
2491
2495
  } else {
2492
2496
  next('/login');
2493
2497
  }
@@ -2496,7 +2500,7 @@ var isLogined = function () {
2496
2500
  }
2497
2501
  }
2498
2502
 
2499
- case 20:
2503
+ case 21:
2500
2504
  case 'end':
2501
2505
  return _context.stop();
2502
2506
  }
@@ -2614,12 +2618,13 @@ var loadJs = function loadJs(_ref13) {
2614
2618
  * @param {String} [text] - 显示的文本内容
2615
2619
  **/
2616
2620
  var loading = function loading($loading, res) {
2621
+ var winTop = getWinTop();
2617
2622
  if (!$loading) {
2618
2623
  $loading = _eossElement.Loading.service;
2619
2624
  }
2620
2625
  if (isObject(res)) {
2621
2626
  var config = extend({}, {
2622
- target: win.top.document.body,
2627
+ target: winTop.document.body,
2623
2628
  fullscreen: true,
2624
2629
  background: 'rgba(0, 0, 0, 0.65)',
2625
2630
  spinner: 'el-icon-loading',
@@ -2628,7 +2633,7 @@ var loading = function loading($loading, res) {
2628
2633
  return $loading(config);
2629
2634
  } else {
2630
2635
  var _loading = $loading({
2631
- target: win.top.document.body,
2636
+ target: winTop.document.body,
2632
2637
  fullscreen: true,
2633
2638
  background: 'rgba(0, 0, 0, 0.65)',
2634
2639
  spinner: 'el-icon-loading',
@@ -2770,11 +2775,12 @@ var replenish = function replenish(_ref15) {
2770
2775
  * @param {object} [data] - 数字或字符串型数字
2771
2776
  **/
2772
2777
  var responses = function responses(data) {
2778
+ var winTop = getWinTop();
2773
2779
  if (data.rCode === 64 || data.rCode === 65 || data.rCode === 67 || data.rCode === 69) {
2774
2780
  removeStorage(['Authorization', 'token', 'ssId', 'userId', 'userName', 'deviceUnique', 'menus', 'useCaseCodes', 'mainConfig', 'jump', 'showLaunch']);
2775
2781
  var href = '';
2776
2782
  try {
2777
- href = win.top.location.href;
2783
+ href = winTop.location.href;
2778
2784
  } catch (error) {
2779
2785
  href = win.location.href;
2780
2786
  }
@@ -2799,7 +2805,7 @@ var responses = function responses(data) {
2799
2805
  if (loginPage) {
2800
2806
  var src = void 0;
2801
2807
  if (!startWith(loginPage, ['http', '/'], true)) {
2802
- var pathname = win.top.location.pathname;
2808
+ var pathname = winTop.location.pathname;
2803
2809
  if (pathname !== '/') {
2804
2810
  pathname = pathname.split('/');
2805
2811
  pathname.splice(pathname.length - 1);
@@ -2811,16 +2817,16 @@ var responses = function responses(data) {
2811
2817
  } else {
2812
2818
  src = loginPage;
2813
2819
  }
2814
- win.top.location.href = src;
2815
- } else if (win.top.location.href.indexOf('main.html') > -1) {
2816
- win.top.location.href = './login.html';
2820
+ winTop.location.href = src;
2821
+ } else if (winTop.location.href.indexOf('main.html') > -1) {
2822
+ winTop.location.href = './login.html';
2817
2823
  } else {
2818
- var hash = win.top.location.hash;
2824
+ var hash = winTop.location.hash;
2819
2825
  if (hash) {
2820
- var len = win.top.location.href.indexOf(hash);
2821
- win.top.location.href = win.location.href.slice(0, len) + '#/login';
2826
+ var len = winTop.location.href.indexOf(hash);
2827
+ winTop.location.href = win.location.href.slice(0, len) + '#/login';
2822
2828
  } else {
2823
- win.top.location.href = '/login.html';
2829
+ winTop.location.href = '/login.html';
2824
2830
  }
2825
2831
  }
2826
2832
  } catch (error) {
@@ -3638,10 +3644,11 @@ var removeCookie = function removeCookie(key) {
3638
3644
  };
3639
3645
 
3640
3646
  var winTopOpen = function winTopOpen(config) {
3647
+ var winTop = getWinTop();
3641
3648
  if (isIE) {
3642
- if (win.top !== win.self) {
3649
+ if (winTop !== win.self) {
3643
3650
  try {
3644
- win.top.windowOpen(config);
3651
+ winTop.windowOpen(config);
3645
3652
  } catch (error) {
3646
3653
  win.postMessage({ method: 'windowOpen', query: config }, '*');
3647
3654
  }