eoss-ui 0.7.91 → 0.7.92

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 (67) hide show
  1. package/lib/button-group.js +45 -0
  2. package/lib/button.js +45 -0
  3. package/lib/calogin.js +45 -0
  4. package/lib/checkbox-group.js +45 -0
  5. package/lib/data-table-form.js +45 -0
  6. package/lib/data-table.js +57 -7
  7. package/lib/date-picker.js +45 -0
  8. package/lib/dialog.js +52 -11
  9. package/lib/eoss-ui.common.js +289 -174
  10. package/lib/flow-group.js +81 -12
  11. package/lib/flow-list.js +45 -0
  12. package/lib/flow.js +45 -0
  13. package/lib/form.js +45 -0
  14. package/lib/handle-user.js +45 -0
  15. package/lib/handler.js +45 -0
  16. package/lib/icon.js +45 -0
  17. package/lib/index.js +1 -1
  18. package/lib/input-number.js +45 -0
  19. package/lib/input.js +45 -0
  20. package/lib/login.js +52 -6
  21. package/lib/main.js +160 -87
  22. package/lib/nav.js +45 -0
  23. package/lib/page.js +45 -0
  24. package/lib/pagination.js +48 -3
  25. package/lib/player.js +45 -0
  26. package/lib/qr-code.js +45 -0
  27. package/lib/radio-group.js +45 -0
  28. package/lib/retrial-auth.js +67 -6
  29. package/lib/select-ganged.js +45 -0
  30. package/lib/select.js +45 -0
  31. package/lib/selector-panel.js +45 -0
  32. package/lib/selector.js +45 -0
  33. package/lib/sizer.js +45 -0
  34. package/lib/steps.js +45 -0
  35. package/lib/switch.js +45 -0
  36. package/lib/table-form.js +45 -0
  37. package/lib/tabs.js +45 -0
  38. package/lib/tips.js +45 -0
  39. package/lib/tree-group.js +48 -3
  40. package/lib/tree.js +45 -0
  41. package/lib/upload.js +45 -0
  42. package/lib/utils/util.js +45 -0
  43. package/lib/wujie.js +45 -0
  44. package/lib/wxlogin.js +45 -0
  45. package/package.json +1 -1
  46. package/packages/.DS_Store +0 -0
  47. package/packages/data-table/src/main.vue +7 -3
  48. package/packages/dialog/.DS_Store +0 -0
  49. package/packages/dialog/src/main.vue +5 -11
  50. package/packages/flow/.DS_Store +0 -0
  51. package/packages/flow-group/src/main.vue +34 -12
  52. package/packages/flow-list/.DS_Store +0 -0
  53. package/packages/login/src/main.vue +2 -1
  54. package/packages/main/.DS_Store +0 -0
  55. package/packages/main/src/default/userinfo.vue +22 -14
  56. package/packages/main/src/main.vue +11 -12
  57. package/packages/main/src/simplicity/index.vue +19 -14
  58. package/packages/main/src/simplicity/userinfo.vue +18 -13
  59. package/packages/main/src/simplicityTop/index.vue +1 -1
  60. package/packages/main/src/simplicityTop/userinfo.vue +18 -13
  61. package/packages/pagination/src/main.vue +4 -4
  62. package/packages/retrial-auth/src/main.vue +23 -4
  63. package/packages/select/.DS_Store +0 -0
  64. package/packages/tree-group/src/main.vue +1 -2
  65. package/src/.DS_Store +0 -0
  66. package/src/index.js +1 -1
  67. package/src/utils/util.js +45 -0
package/lib/utils/util.js CHANGED
@@ -1900,6 +1900,10 @@ var getWeekday = function getWeekday(date) {
1900
1900
  var getWinTop = function getWinTop(wind) {
1901
1901
  wind = wind ? wind : window.__WUJIE_RAW_WINDOW__ ? window.__WUJIE_RAW_WINDOW__ : window;
1902
1902
  try {
1903
+ // 检查是否已经是顶层窗口,避免无限递归
1904
+ if (wind === wind.parent) {
1905
+ return wind;
1906
+ }
1903
1907
  wind.parent.document;
1904
1908
  return getWinTop(wind.parent);
1905
1909
  } catch (error) {
@@ -1907,6 +1911,46 @@ var getWinTop = function getWinTop(wind) {
1907
1911
  }
1908
1912
  };
1909
1913
 
1914
+ /**
1915
+ * getWinTopProperty
1916
+ * @desc 安全获取顶层窗口的属性,避免跨域访问错误
1917
+ * @param {string} propertyName - 要获取的属性名
1918
+ * @param {any} defaultValue - 默认值,当属性获取失败时返回
1919
+ * @return {any} 属性值或默认值
1920
+ **/
1921
+ var getWinTopProperty = function getWinTopProperty(propertyName, defaultValue) {
1922
+ // 1. 先尝试获取 window.top 的属性
1923
+ try {
1924
+ if (window.top && window.top[propertyName] !== undefined) {
1925
+ return window.top[propertyName];
1926
+ }
1927
+ } catch (topError) {}
1928
+ // window.top 跨域,继续尝试
1929
+
1930
+
1931
+ // 2. 尝试获取同源的最上层窗口的属性
1932
+ try {
1933
+ var sameOriginTop = getWinTop();
1934
+ if (sameOriginTop && sameOriginTop[propertyName] !== undefined) {
1935
+ return sameOriginTop[propertyName];
1936
+ }
1937
+ } catch (sameOriginError) {}
1938
+ // 同源最上层窗口获取失败,继续尝试
1939
+
1940
+
1941
+ // 3. 尝试获取当前窗口的属性
1942
+ try {
1943
+ if (window[propertyName] !== undefined) {
1944
+ return window[propertyName];
1945
+ }
1946
+ } catch (currentWinError) {}
1947
+ // 当前窗口获取失败,返回默认值
1948
+
1949
+
1950
+ // 4. 所有尝试都失败,返回默认值
1951
+ return defaultValue;
1952
+ };
1953
+
1910
1954
  /**
1911
1955
  * getZoom
1912
1956
  * @desc 获取缩放比
@@ -3652,6 +3696,7 @@ exports.default = {
3652
3696
  getValues: getValues,
3653
3697
  getWeekday: getWeekday,
3654
3698
  getWinTop: getWinTop,
3699
+ getWinTopProperty: getWinTopProperty,
3655
3700
  handlerUrl: handlerUrl,
3656
3701
  hasChars: hasChars,
3657
3702
  hasClass: hasClass,
package/lib/wujie.js CHANGED
@@ -2138,6 +2138,10 @@ var getWeekday = function getWeekday(date) {
2138
2138
  var getWinTop = function getWinTop(wind) {
2139
2139
  wind = wind ? wind : window.__WUJIE_RAW_WINDOW__ ? window.__WUJIE_RAW_WINDOW__ : window;
2140
2140
  try {
2141
+ // 检查是否已经是顶层窗口,避免无限递归
2142
+ if (wind === wind.parent) {
2143
+ return wind;
2144
+ }
2141
2145
  wind.parent.document;
2142
2146
  return getWinTop(wind.parent);
2143
2147
  } catch (error) {
@@ -2145,6 +2149,46 @@ var getWinTop = function getWinTop(wind) {
2145
2149
  }
2146
2150
  };
2147
2151
 
2152
+ /**
2153
+ * getWinTopProperty
2154
+ * @desc 安全获取顶层窗口的属性,避免跨域访问错误
2155
+ * @param {string} propertyName - 要获取的属性名
2156
+ * @param {any} defaultValue - 默认值,当属性获取失败时返回
2157
+ * @return {any} 属性值或默认值
2158
+ **/
2159
+ var getWinTopProperty = function getWinTopProperty(propertyName, defaultValue) {
2160
+ // 1. 先尝试获取 window.top 的属性
2161
+ try {
2162
+ if (window.top && window.top[propertyName] !== undefined) {
2163
+ return window.top[propertyName];
2164
+ }
2165
+ } catch (topError) {}
2166
+ // window.top 跨域,继续尝试
2167
+
2168
+
2169
+ // 2. 尝试获取同源的最上层窗口的属性
2170
+ try {
2171
+ var sameOriginTop = getWinTop();
2172
+ if (sameOriginTop && sameOriginTop[propertyName] !== undefined) {
2173
+ return sameOriginTop[propertyName];
2174
+ }
2175
+ } catch (sameOriginError) {}
2176
+ // 同源最上层窗口获取失败,继续尝试
2177
+
2178
+
2179
+ // 3. 尝试获取当前窗口的属性
2180
+ try {
2181
+ if (window[propertyName] !== undefined) {
2182
+ return window[propertyName];
2183
+ }
2184
+ } catch (currentWinError) {}
2185
+ // 当前窗口获取失败,返回默认值
2186
+
2187
+
2188
+ // 4. 所有尝试都失败,返回默认值
2189
+ return defaultValue;
2190
+ };
2191
+
2148
2192
  /**
2149
2193
  * getZoom
2150
2194
  * @desc 获取缩放比
@@ -3890,6 +3934,7 @@ var winTopOpen = function winTopOpen(config) {
3890
3934
  getValues: getValues,
3891
3935
  getWeekday: getWeekday,
3892
3936
  getWinTop: getWinTop,
3937
+ getWinTopProperty: getWinTopProperty,
3893
3938
  handlerUrl: handlerUrl,
3894
3939
  hasChars: hasChars,
3895
3940
  hasClass: hasClass,
package/lib/wxlogin.js CHANGED
@@ -2138,6 +2138,10 @@ var getWeekday = function getWeekday(date) {
2138
2138
  var getWinTop = function getWinTop(wind) {
2139
2139
  wind = wind ? wind : window.__WUJIE_RAW_WINDOW__ ? window.__WUJIE_RAW_WINDOW__ : window;
2140
2140
  try {
2141
+ // 检查是否已经是顶层窗口,避免无限递归
2142
+ if (wind === wind.parent) {
2143
+ return wind;
2144
+ }
2141
2145
  wind.parent.document;
2142
2146
  return getWinTop(wind.parent);
2143
2147
  } catch (error) {
@@ -2145,6 +2149,46 @@ var getWinTop = function getWinTop(wind) {
2145
2149
  }
2146
2150
  };
2147
2151
 
2152
+ /**
2153
+ * getWinTopProperty
2154
+ * @desc 安全获取顶层窗口的属性,避免跨域访问错误
2155
+ * @param {string} propertyName - 要获取的属性名
2156
+ * @param {any} defaultValue - 默认值,当属性获取失败时返回
2157
+ * @return {any} 属性值或默认值
2158
+ **/
2159
+ var getWinTopProperty = function getWinTopProperty(propertyName, defaultValue) {
2160
+ // 1. 先尝试获取 window.top 的属性
2161
+ try {
2162
+ if (window.top && window.top[propertyName] !== undefined) {
2163
+ return window.top[propertyName];
2164
+ }
2165
+ } catch (topError) {}
2166
+ // window.top 跨域,继续尝试
2167
+
2168
+
2169
+ // 2. 尝试获取同源的最上层窗口的属性
2170
+ try {
2171
+ var sameOriginTop = getWinTop();
2172
+ if (sameOriginTop && sameOriginTop[propertyName] !== undefined) {
2173
+ return sameOriginTop[propertyName];
2174
+ }
2175
+ } catch (sameOriginError) {}
2176
+ // 同源最上层窗口获取失败,继续尝试
2177
+
2178
+
2179
+ // 3. 尝试获取当前窗口的属性
2180
+ try {
2181
+ if (window[propertyName] !== undefined) {
2182
+ return window[propertyName];
2183
+ }
2184
+ } catch (currentWinError) {}
2185
+ // 当前窗口获取失败,返回默认值
2186
+
2187
+
2188
+ // 4. 所有尝试都失败,返回默认值
2189
+ return defaultValue;
2190
+ };
2191
+
2148
2192
  /**
2149
2193
  * getZoom
2150
2194
  * @desc 获取缩放比
@@ -3890,6 +3934,7 @@ var winTopOpen = function winTopOpen(config) {
3890
3934
  getValues: getValues,
3891
3935
  getWeekday: getWeekday,
3892
3936
  getWinTop: getWinTop,
3937
+ getWinTopProperty: getWinTopProperty,
3893
3938
  handlerUrl: handlerUrl,
3894
3939
  hasChars: hasChars,
3895
3940
  hasClass: hasClass,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eoss-ui",
3
- "version": "0.7.91",
3
+ "version": "0.7.92",
4
4
  "description": "eoss内部业务组件",
5
5
  "main": "lib/eoss-ui.common.js",
6
6
  "files": [
Binary file
@@ -219,8 +219,7 @@ import children from './children.vue';
219
219
  import sizer from './sizer.vue';
220
220
  import util from 'eoss-ui/src/utils/util';
221
221
  import qs from 'qs';
222
- const systemMode =
223
- util.getWinTop().systemMode || util.win.systemMode || 'default';
222
+ const systemMode = util.getWinTopProperty('systemMode', 'default');
224
223
  const pageView = util.getParams('pageView');
225
224
  export default {
226
225
  name: 'EsDataTable',
@@ -877,7 +876,12 @@ export default {
877
876
  },
878
877
  showEditPage(val) {
879
878
  if (val === false) {
880
- util.getwintop().refresh();
879
+ try {
880
+ const topWin = util.getWinTop();
881
+ topWin.refresh();
882
+ } catch (error) {
883
+ console.warn('Failed to refresh page:', error);
884
+ }
881
885
  }
882
886
  }
883
887
  },
Binary file
@@ -268,8 +268,10 @@ import WujieVue from 'wujie-vue2';
268
268
  import util from 'eoss-ui/src/utils/util';
269
269
  let availWidth = 0;
270
270
  let availHeight = 0;
271
- availWidth = util.getWinTop().document.body.offsetWidth - 260;
272
- availHeight = util.getWinTop().document.body.offsetHeight - 60;
271
+ const wind = util.getWinTop();
272
+ availWidth = wind.document.body.offsetWidth - 260;
273
+ availHeight = wind.document.body.offsetHeight - 60;
274
+ const systemMode = wind.systemMode || util.win.systemMode || 'default';
273
275
  export default {
274
276
  name: 'EsDialog',
275
277
  inheritAttrs: false,
@@ -293,15 +295,7 @@ export default {
293
295
  props: {
294
296
  mode: {
295
297
  type: String,
296
- default() {
297
- try {
298
- return (
299
- util.getWinTop().systemMode || util.win.systemMode || 'default'
300
- );
301
- } catch (e) {
302
- return util.win.systemMode || 'default';
303
- }
304
- }
298
+ default: systemMode
305
299
  },
306
300
  title: String,
307
301
  busEvent: String,
Binary file
@@ -683,14 +683,25 @@ export default {
683
683
  method: 'windowClose',
684
684
  ...JSON.parse(windowOpenConfig)
685
685
  });
686
- util.getWinTop().windowClose(JSON.parse(windowOpenConfig));
686
+ try {
687
+ const topWin = util.getWinTop();
688
+ topWin.windowClose(JSON.parse(windowOpenConfig));
689
+ } catch (error) {
690
+ console.warn('Failed to call windowClose:', error);
691
+ }
687
692
  } else if (this.closeDialog && this.esDialog) {
688
693
  this.esDialog.handleClose();
689
- } else if (util.getWinTop().COOS_SDK) {
690
- util.getWinTop().COOS_SDK.closePopup &&
691
- util.getWinTop().COOS_SDK.closePopup();
692
- } else if (util.getWinTop().opener) {
693
- util.getWinTop().close();
694
+ } else {
695
+ try {
696
+ const topWin = util.getWinTop();
697
+ if (topWin.COOS_SDK) {
698
+ topWin.COOS_SDK.closePopup && topWin.COOS_SDK.closePopup();
699
+ } else if (topWin.opener) {
700
+ topWin.close();
701
+ }
702
+ } catch (error) {
703
+ console.warn('Failed to close window/popup:', error);
704
+ }
694
705
  }
695
706
  if (this.events && this.events.success) {
696
707
  this.events.success();
@@ -704,14 +715,25 @@ export default {
704
715
  method: 'windowClose',
705
716
  ...JSON.parse(windowOpenConfig)
706
717
  });
707
- util.getWinTop().windowClose(JSON.parse(windowOpenConfig));
718
+ try {
719
+ const topWin = util.getWinTop();
720
+ topWin.windowClose(JSON.parse(windowOpenConfig));
721
+ } catch (error) {
722
+ console.warn('Failed to call windowClose:', error);
723
+ }
708
724
  } else if (this.closeDialog && this.esDialog) {
709
725
  this.esDialog.handleClose();
710
- } else if (util.getWinTop().COOS_SDK) {
711
- util.getWinTop().COOS_SDK.closePopup &&
712
- util.getWinTop().COOS_SDK.closePopup();
713
- } else if (util.getWinTop().opener) {
714
- util.getWinTop().close();
726
+ } else {
727
+ try {
728
+ const topWin = util.getWinTop();
729
+ if (topWin.COOS_SDK) {
730
+ topWin.COOS_SDK.closePopup && topWin.COOS_SDK.closePopup();
731
+ } else if (topWin.opener) {
732
+ topWin.close();
733
+ }
734
+ } catch (error) {
735
+ console.warn('Failed to close window/popup:', error);
736
+ }
715
737
  }
716
738
  this.events && this.events.save(id, event);
717
739
  this.$emit('save', id, event);
Binary file
@@ -1506,7 +1506,8 @@ export default {
1506
1506
  let isMarkdown = regex.test(content);
1507
1507
  if (isMarkdown) {
1508
1508
  content = await util.ajax({ url: content });
1509
- content = this.renderMarkdown(content);
1509
+ console.log(content);
1510
+ content = content ? this.renderMarkdown(content) : content;
1510
1511
  }
1511
1512
  this.$alert(content, title, {
1512
1513
  dangerouslyUseHTMLString: isMarkdown,
Binary file
@@ -408,11 +408,12 @@ export default {
408
408
  .then(() => {
409
409
  const loginPage =
410
410
  util.getStorage('login') || util.getStorage('loginPage');
411
+ const topWin = util.getWinTop();
411
412
  try {
412
413
  if (loginPage) {
413
414
  let src;
414
415
  if (!util.startWith(loginPage, ['http', '/'], true)) {
415
- let pathname = util.getWinTop().location.pathname;
416
+ let pathname = topWin.location.pathname;
416
417
  if (pathname !== '/') {
417
418
  pathname = pathname.split('/');
418
419
  pathname.splice(pathname.length - 1);
@@ -424,24 +425,31 @@ export default {
424
425
  } else {
425
426
  src = loginPage;
426
427
  }
427
- util.getWinTop().location.href = src;
428
- } else if (
429
- util.getWinTop().location.href.indexOf('main.html') > -1
430
- ) {
431
- util.getWinTop().location.href = './login.html';
428
+ topWin.location.href = src;
429
+ } else if (topWin.location.href.indexOf('main.html') > -1) {
430
+ topWin.location.href = './login.html';
432
431
  } else {
433
- const hash = util.getWinTop().location.hash;
432
+ const hash = topWin.location.hash;
434
433
  if (hash) {
435
- const len = util
436
- .getWinTop()
437
- .location.href.indexOf(hash);
438
- util.getWinTop().location.href =
439
- util.win.location.href.slice(0, len) + '#/login';
434
+ const len = topWin.location.href.indexOf(hash);
435
+ topWin.location.href =
436
+ topWin.location.href.slice(0, len) + '#/login';
440
437
  } else {
441
- util.getWinTop().location.href = '/login.html';
438
+ topWin.location.href = '/login.html';
442
439
  }
443
440
  }
444
- } catch (error) {}
441
+ } catch (error) {
442
+ console.warn('Failed to handle login redirect:', error);
443
+ try {
444
+ // Fallback to postMessage if direct access fails
445
+ topWin.postMessage({ type: 1 }, '*');
446
+ } catch (postMessageError) {
447
+ console.warn(
448
+ 'Failed to send postMessage:',
449
+ postMessageError
450
+ );
451
+ }
452
+ }
445
453
  })
446
454
  .catch((e) => {});
447
455
  } else {
@@ -232,12 +232,12 @@ export default {
232
232
  ) {
233
233
  window.location.href = './login.html';
234
234
  } else {
235
- next('/login');
235
+ this.$router.replace('/login');
236
236
  }
237
237
  } else if (window.location.href.indexOf('main.html') > -1) {
238
238
  window.location.href = './login.html';
239
239
  } else {
240
- next('/login');
240
+ this.$router.replace('/login');
241
241
  }
242
242
  }
243
243
  },
@@ -350,10 +350,11 @@ export default {
350
350
  const loginPage =
351
351
  util.getStorage('login') || util.getStorage('loginPage');
352
352
  try {
353
+ const topWin = util.getWinTop();
353
354
  if (loginPage) {
354
355
  let src;
355
356
  if (!util.startWith(loginPage, ['http', '/'], true)) {
356
- let pathname = util.getWinTop().location.pathname;
357
+ let pathname = topWin.location.pathname;
357
358
  if (pathname !== '/') {
358
359
  pathname = pathname.split('/');
359
360
  pathname.splice(pathname.length - 1);
@@ -365,19 +366,17 @@ export default {
365
366
  } else {
366
367
  src = loginPage;
367
368
  }
368
- util.getWinTop().location.href = src;
369
- } else if (
370
- util.getWinTop().location.href.indexOf('main.html') > -1
371
- ) {
372
- util.getWinTop().location.href = './login.html';
369
+ topWin.location.href = src;
370
+ } else if (topWin.location.href.indexOf('main.html') > -1) {
371
+ topWin.location.href = './login.html';
373
372
  } else {
374
- const hash = util.getWinTop().location.hash;
373
+ const hash = topWin.location.hash;
375
374
  if (hash) {
376
- const len = util.getWinTop().location.href.indexOf(hash);
377
- util.getWinTop().location.href =
375
+ const len = topWin.location.href.indexOf(hash);
376
+ topWin.location.href =
378
377
  util.win.location.href.slice(0, len) + '#/login';
379
378
  } else {
380
- util.getWinTop().location.href = '/login.html';
379
+ topWin.location.href = '/login.html';
381
380
  }
382
381
  }
383
382
  } catch (error) {}
@@ -407,7 +407,7 @@ import {
407
407
  import store from 'eoss-ui/src/utils/store';
408
408
  import util from 'eoss-ui/src/utils/util';
409
409
  const isIE = /MSIE|Trident/.test(navigator.userAgent);
410
- const systemMode = util.win.systemMode || 'default';
410
+ const systemMode = util.getWinTopProperty('systemMode', 'default');
411
411
  import WujieVue from 'wujie-vue2';
412
412
  let events = [
413
413
  (tabs, index, that) => {
@@ -2118,10 +2118,11 @@ export default {
2118
2118
  try {
2119
2119
  const loginPage =
2120
2120
  util.getStorage('login') || util.getStorage('loginPage');
2121
+ const topWin = util.getWinTop();
2121
2122
  if (loginPage) {
2122
2123
  let src;
2123
2124
  if (!util.startWith(loginPage, ['http', '/'], true)) {
2124
- let pathname = util.getWinTop().location.pathname;
2125
+ let pathname = topWin.location.pathname;
2125
2126
  if (pathname !== '/') {
2126
2127
  pathname = pathname.split('/');
2127
2128
  pathname.splice(pathname.length - 1);
@@ -2133,25 +2134,29 @@ export default {
2133
2134
  } else {
2134
2135
  src = loginPage;
2135
2136
  }
2136
- util.getWinTop().location.href = src;
2137
- } else if (
2138
- util.getWinTop().location.href.indexOf('main.html') > -1
2139
- ) {
2140
- util.getWinTop().location.href = './login.html';
2137
+ topWin.location.href = src;
2138
+ } else if (topWin.location.href.indexOf('main.html') > -1) {
2139
+ topWin.location.href = './login.html';
2141
2140
  } else {
2142
- const hash = util.getWinTop().location.hash;
2141
+ const hash = topWin.location.hash;
2143
2142
  if (hash) {
2144
- const len = util
2145
- .getWinTop()
2146
- .location.href.indexOf(hash);
2147
- util.getWinTop().location.href =
2143
+ const len = topWin.location.href.indexOf(hash);
2144
+ topWin.location.href =
2148
2145
  util.win.location.href.slice(0, len) + '#/login';
2149
2146
  } else {
2150
- util.getWinTop().location.href = '/login.html';
2147
+ topWin.location.href = '/login.html';
2151
2148
  }
2152
2149
  }
2153
2150
  } catch (error) {
2154
- util.getWinTop().postMessage({ type: 1 }, '*');
2151
+ console.warn('Failed to handle login redirect:', error);
2152
+ try {
2153
+ util.getWinTop().postMessage({ type: 1 }, '*');
2154
+ } catch (postMessageError) {
2155
+ console.warn(
2156
+ 'Failed to send postMessage:',
2157
+ postMessageError
2158
+ );
2159
+ }
2155
2160
  }
2156
2161
  }
2157
2162
  }
@@ -338,10 +338,11 @@ export default {
338
338
  const loginPage =
339
339
  util.getStorage('login') || util.getStorage('loginPage');
340
340
  try {
341
+ const topWin = util.getWinTop();
341
342
  if (loginPage) {
342
343
  let src;
343
344
  if (!util.startWith(loginPage, ['http', '/'], true)) {
344
- let pathname = util.getWinTop().location.pathname;
345
+ let pathname = topWin.location.pathname;
345
346
  if (pathname !== '/') {
346
347
  pathname = pathname.split('/');
347
348
  pathname.splice(pathname.length - 1);
@@ -353,25 +354,29 @@ export default {
353
354
  } else {
354
355
  src = loginPage;
355
356
  }
356
- util.getWinTop().location.href = src;
357
- } else if (
358
- util.getWinTop().location.href.indexOf('main.html') > -1
359
- ) {
360
- util.getWinTop().location.href = './login.html';
357
+ topWin.location.href = src;
358
+ } else if (topWin.location.href.indexOf('main.html') > -1) {
359
+ topWin.location.href = './login.html';
361
360
  } else {
362
- const hash = util.getWinTop().location.hash;
361
+ const hash = topWin.location.hash;
363
362
  if (hash) {
364
- const len = util
365
- .getWinTop()
366
- .location.href.indexOf(hash);
367
- util.getWinTop().location.href =
363
+ const len = topWin.location.href.indexOf(hash);
364
+ topWin.location.href =
368
365
  util.win.location.href.slice(0, len) + '#/login';
369
366
  } else {
370
- util.getWinTop().location.href = '/login.html';
367
+ topWin.location.href = '/login.html';
371
368
  }
372
369
  }
373
370
  } catch (error) {
374
- util.getWinTop().postMessage({ type: 1 }, '*');
371
+ console.warn('Failed to handle login redirect:', error);
372
+ try {
373
+ util.getWinTop().postMessage({ type: 1 }, '*');
374
+ } catch (postMessageError) {
375
+ console.warn(
376
+ 'Failed to send postMessage:',
377
+ postMessageError
378
+ );
379
+ }
375
380
  }
376
381
  })
377
382
  .catch((e) => {});
@@ -329,7 +329,7 @@ import {
329
329
  import store from 'eoss-ui/src/utils/store';
330
330
  import util from 'eoss-ui/src/utils/util';
331
331
  const isIE = /MSIE|Trident/.test(navigator.userAgent);
332
- const systemMode = util.win.systemMode || 'default';
332
+ const systemMode = util.getWinTopProperty('systemMode', 'default');
333
333
  // let events = [
334
334
  // (tabs, index, that) => {
335
335
  // let tab = tabs[index];
@@ -338,10 +338,11 @@ export default {
338
338
  const loginPage =
339
339
  util.getStorage('login') || util.getStorage('loginPage');
340
340
  try {
341
+ const topWin = util.getWinTop();
341
342
  if (loginPage) {
342
343
  let src;
343
344
  if (!util.startWith(loginPage, ['http', '/'], true)) {
344
- let pathname = util.getWinTop().location.pathname;
345
+ let pathname = topWin.location.pathname;
345
346
  if (pathname !== '/') {
346
347
  pathname = pathname.split('/');
347
348
  pathname.splice(pathname.length - 1);
@@ -353,25 +354,29 @@ export default {
353
354
  } else {
354
355
  src = loginPage;
355
356
  }
356
- util.getWinTop().location.href = src;
357
- } else if (
358
- util.getWinTop().location.href.indexOf('main.html') > -1
359
- ) {
360
- util.getWinTop().location.href = './login.html';
357
+ topWin.location.href = src;
358
+ } else if (topWin.location.href.indexOf('main.html') > -1) {
359
+ topWin.location.href = './login.html';
361
360
  } else {
362
- const hash = util.getWinTop().location.hash;
361
+ const hash = topWin.location.hash;
363
362
  if (hash) {
364
- const len = util
365
- .getWinTop()
366
- .location.href.indexOf(hash);
367
- util.getWinTop().location.href =
363
+ const len = topWin.location.href.indexOf(hash);
364
+ topWin.location.href =
368
365
  util.win.location.href.slice(0, len) + '#/login';
369
366
  } else {
370
- util.getWinTop().location.href = '/login.html';
367
+ topWin.location.href = '/login.html';
371
368
  }
372
369
  }
373
370
  } catch (error) {
374
- util.getWinTop().postMessage({ type: 1 }, '*');
371
+ console.warn('Failed to handle login redirect:', error);
372
+ try {
373
+ util.getWinTop().postMessage({ type: 1 }, '*');
374
+ } catch (postMessageError) {
375
+ console.warn(
376
+ 'Failed to send postMessage:',
377
+ postMessageError
378
+ );
379
+ }
375
380
  }
376
381
  })
377
382
  .catch((e) => {});
@@ -20,10 +20,10 @@
20
20
  </template>
21
21
  <script>
22
22
  import util from 'eoss-ui/src/utils/util';
23
- const paginationLayout =
24
- util.getWinTop().tableLayout ||
25
- util.win.tableLayout ||
26
- 'prev, pager, next, sizes, total';
23
+ const paginationLayout = util.getWinTopProperty(
24
+ 'tableLayout',
25
+ 'prev, pager, next, sizes, total'
26
+ );
27
27
  export default {
28
28
  name: 'EsPagination',
29
29
  inheritAttrs: false,