eoss-ui 0.8.3 → 0.8.5

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 (52) hide show
  1. package/lib/button-group.js +46 -45
  2. package/lib/button.js +46 -45
  3. package/lib/calogin.js +89 -57
  4. package/lib/checkbox-group.js +46 -45
  5. package/lib/data-table-form.js +46 -45
  6. package/lib/data-table.js +95 -69
  7. package/lib/date-picker.js +46 -45
  8. package/lib/dialog.js +46 -45
  9. package/lib/eoss-ui.common.js +401 -333
  10. package/lib/flow-group.js +46 -45
  11. package/lib/flow-list.js +46 -45
  12. package/lib/flow.js +285 -270
  13. package/lib/form.js +46 -45
  14. package/lib/handle-user.js +46 -45
  15. package/lib/handler.js +46 -45
  16. package/lib/icon.js +46 -45
  17. package/lib/index.js +1 -1
  18. package/lib/input-number.js +46 -45
  19. package/lib/input.js +46 -45
  20. package/lib/login.js +46 -45
  21. package/lib/main.js +63 -61
  22. package/lib/nav.js +46 -45
  23. package/lib/page.js +46 -45
  24. package/lib/pagination.js +46 -45
  25. package/lib/player.js +46 -45
  26. package/lib/qr-code.js +46 -45
  27. package/lib/radio-group.js +46 -45
  28. package/lib/retrial-auth.js +46 -45
  29. package/lib/select-ganged.js +46 -45
  30. package/lib/select.js +46 -45
  31. package/lib/selector-panel.js +46 -45
  32. package/lib/selector.js +46 -45
  33. package/lib/sizer.js +46 -45
  34. package/lib/steps.js +46 -45
  35. package/lib/switch.js +46 -45
  36. package/lib/table-form.js +46 -45
  37. package/lib/tabs.js +46 -45
  38. package/lib/tips.js +46 -45
  39. package/lib/tree-group.js +46 -45
  40. package/lib/tree.js +46 -45
  41. package/lib/upload.js +46 -45
  42. package/lib/utils/util.js +46 -45
  43. package/lib/wujie.js +46 -45
  44. package/lib/wxlogin.js +46 -45
  45. package/package.json +1 -1
  46. package/packages/calogin/src/plugin.js +3 -3
  47. package/packages/data-table/src/main.vue +49 -20
  48. package/packages/flow/src/processForm.vue +259 -228
  49. package/packages/main/src/main.vue +1 -1
  50. package/packages/main/src/simplicityTop/index.vue +6 -5
  51. package/src/index.js +1 -1
  52. package/src/utils/util.js +49 -48
package/lib/wxlogin.js CHANGED
@@ -287,6 +287,7 @@ var lodash = __webpack_require__(12);
287
287
 
288
288
 
289
289
  var win = window.__WUJIE_RAW_WINDOW__ ? window.__WUJIE_RAW_WINDOW__ : window;
290
+ var winTop = getWinTop();
290
291
  var isIE = /MSIE|Trident/.test(navigator.userAgent);
291
292
  var parser = new external_ua_parser_js_["UAParser"]();
292
293
  var $hueStep = 2;
@@ -834,19 +835,19 @@ var busEmit = function busEmit(that, _ref3) {
834
835
  return;
835
836
  }
836
837
  if (isIE) {
837
- if (win.top !== win.self) {
838
- win.top.postMessage({ method: method, query: args, args: args }, '*');
838
+ if (winTop !== win.self) {
839
+ winTop.postMessage({ method: method, query: args, args: args }, '*');
839
840
  return;
840
841
  }
841
842
  var bus = that ? that.bus || that.$root.Bus || that.$root.$bus : null;
842
843
  bus && (Array.isArray(args) ? bus.$emit.apply(bus, [method].concat(args)) : bus.$emit(method, args));
843
844
  } else {
844
- if (win.top !== win.self) {
845
+ if (winTop !== win.self) {
845
846
  var _bus2 = win.$wujie ? win.$wujie.bus : null;
846
847
  if (_bus2) {
847
848
  Array.isArray(args) ? _bus2.$emit.apply(_bus2, [method].concat(args)) : _bus2.$emit(method, args);
848
849
  } else {
849
- win.top.postMessage({ method: method, query: args, args: args }, '*');
850
+ winTop.postMessage({ method: method, query: args, args: args }, '*');
850
851
  }
851
852
  return;
852
853
  }
@@ -1084,7 +1085,7 @@ var delUrlParam = function delUrlParam(_ref4) {
1084
1085
 
1085
1086
  var pUrl = '';
1086
1087
  try {
1087
- pUrl = win.top.location.href;
1088
+ pUrl = winTop.location.href;
1088
1089
  } catch (error) {
1089
1090
  pUrl = win.location.href;
1090
1091
  }
@@ -2538,7 +2539,7 @@ var isLogined = function () {
2538
2539
  pathname = '';
2539
2540
 
2540
2541
  try {
2541
- pathname = win.top.location.pathname;
2542
+ pathname = winTop.location.pathname;
2542
2543
  } catch (error) {
2543
2544
  pathname = win.location.pathname;
2544
2545
  }
@@ -2604,12 +2605,12 @@ var isLogined = function () {
2604
2605
  });
2605
2606
  try {
2606
2607
  var url = delUrlParam({
2607
- url: win.top.location.href,
2608
+ url: winTop.location.href,
2608
2609
  key: ['serverId', 'authType', 'code', 'sessionId']
2609
2610
  });
2610
- win.top.location.href = url;
2611
+ winTop.location.href = url;
2611
2612
  setTimeout(function () {
2612
- win.top.location.reload();
2613
+ winTop.location.reload();
2613
2614
  }, 200);
2614
2615
  } catch (error) {
2615
2616
  var _url2 = delUrlParam({
@@ -2628,8 +2629,8 @@ var isLogined = function () {
2628
2629
  break;
2629
2630
  case 3:
2630
2631
  try {
2631
- var href = results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(win.top.location.href));
2632
- win.top.location.href = href;
2632
+ var href = results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(winTop.location.href));
2633
+ winTop.location.href = href;
2633
2634
  } catch (error) {
2634
2635
  var _href = results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(win.location.href));
2635
2636
  win.location.href = _href;
@@ -2643,18 +2644,18 @@ var isLogined = function () {
2643
2644
  sessionStorage.setItem('extUserBindHandleId', results.extUserBindHandleId);
2644
2645
  try {
2645
2646
  if (loginPage) {
2646
- win.top.location.replace(loginPage);
2647
+ winTop.location.replace(loginPage);
2647
2648
  } else if (document.referrer) {
2648
2649
  var referrerUrl = new URL(document.referrer);
2649
- if (referrerUrl.host !== win.top.location.host) {
2650
- win.top.location.replace(document.referrer);
2651
- } 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) {
2652
- win.top.location.href = './login.html';
2650
+ if (referrerUrl.host !== winTop.location.host) {
2651
+ winTop.location.replace(document.referrer);
2652
+ } 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) {
2653
+ winTop.location.href = './login.html';
2653
2654
  } else {
2654
2655
  next('/login');
2655
2656
  }
2656
- } else if (win.top.location.href.indexOf('main.html') > -1) {
2657
- win.top.location.href = './login.html';
2657
+ } else if (winTop.location.href.indexOf('main.html') > -1) {
2658
+ winTop.location.href = './login.html';
2658
2659
  } else {
2659
2660
  next('/login');
2660
2661
  }
@@ -2673,18 +2674,18 @@ var isLogined = function () {
2673
2674
  callback: function callback() {
2674
2675
  try {
2675
2676
  if (loginPage) {
2676
- win.top.location.replace(loginPage);
2677
+ winTop.location.replace(loginPage);
2677
2678
  } else if (document.referrer) {
2678
2679
  var referrerUrl = new URL(document.referrer);
2679
- if (referrerUrl.host !== win.top.location.host) {
2680
- win.top.location.replace(document.referrer);
2681
- } 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) {
2682
- win.top.location.href = './login.html';
2680
+ if (referrerUrl.host !== winTop.location.host) {
2681
+ winTop.location.replace(document.referrer);
2682
+ } 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) {
2683
+ winTop.location.href = './login.html';
2683
2684
  } else {
2684
2685
  next('/login');
2685
2686
  }
2686
- } else if (win.top.location.href.indexOf('main.html') > -1) {
2687
- win.top.location.href = './login.html';
2687
+ } else if (winTop.location.href.indexOf('main.html') > -1) {
2688
+ winTop.location.href = './login.html';
2688
2689
  } else {
2689
2690
  next('/login');
2690
2691
  }
@@ -2713,19 +2714,19 @@ var isLogined = function () {
2713
2714
  } else {
2714
2715
  try {
2715
2716
  if (loginPage) {
2716
- win.top.location.replace(loginPage);
2717
+ winTop.location.replace(loginPage);
2717
2718
  } else if (document.referrer) {
2718
2719
  referrerUrl = new URL(document.referrer);
2719
2720
 
2720
- if (referrerUrl.host !== win.top.location.host) {
2721
- win.top.location.replace(document.referrer);
2722
- } 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) {
2723
- win.top.location.href = './login.html';
2721
+ if (referrerUrl.host !== winTop.location.host) {
2722
+ winTop.location.replace(document.referrer);
2723
+ } 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) {
2724
+ winTop.location.href = './login.html';
2724
2725
  } else {
2725
2726
  next('/login');
2726
2727
  }
2727
- } else if (win.top.location.href.indexOf('main.html') > -1) {
2728
- win.top.location.href = './login.html';
2728
+ } else if (winTop.location.href.indexOf('main.html') > -1) {
2729
+ winTop.location.href = './login.html';
2729
2730
  } else {
2730
2731
  next('/login');
2731
2732
  }
@@ -2857,7 +2858,7 @@ var util_loading = function loading($loading, res) {
2857
2858
  }
2858
2859
  if (isObject(res)) {
2859
2860
  var config = extend({}, {
2860
- target: win.top.document.body,
2861
+ target: winTop.document.body,
2861
2862
  fullscreen: true,
2862
2863
  background: 'rgba(0, 0, 0, 0.65)',
2863
2864
  spinner: 'el-icon-loading',
@@ -2866,7 +2867,7 @@ var util_loading = function loading($loading, res) {
2866
2867
  return $loading(config);
2867
2868
  } else {
2868
2869
  var _loading = $loading({
2869
- target: win.top.document.body,
2870
+ target: winTop.document.body,
2870
2871
  fullscreen: true,
2871
2872
  background: 'rgba(0, 0, 0, 0.65)',
2872
2873
  spinner: 'el-icon-loading',
@@ -3012,7 +3013,7 @@ var util_responses = function responses(data) {
3012
3013
  removeStorage(['Authorization', 'token', 'ssId', 'userId', 'userName', 'deviceUnique', 'menus', 'useCaseCodes', 'mainConfig', 'jump', 'showLaunch']);
3013
3014
  var href = '';
3014
3015
  try {
3015
- href = win.top.location.href;
3016
+ href = winTop.location.href;
3016
3017
  } catch (error) {
3017
3018
  href = win.location.href;
3018
3019
  }
@@ -3037,7 +3038,7 @@ var util_responses = function responses(data) {
3037
3038
  if (loginPage) {
3038
3039
  var src = void 0;
3039
3040
  if (!startWith(loginPage, ['http', '/'], true)) {
3040
- var pathname = win.top.location.pathname;
3041
+ var pathname = winTop.location.pathname;
3041
3042
  if (pathname !== '/') {
3042
3043
  pathname = pathname.split('/');
3043
3044
  pathname.splice(pathname.length - 1);
@@ -3049,16 +3050,16 @@ var util_responses = function responses(data) {
3049
3050
  } else {
3050
3051
  src = loginPage;
3051
3052
  }
3052
- win.top.location.href = src;
3053
- } else if (win.top.location.href.indexOf('main.html') > -1) {
3054
- win.top.location.href = './login.html';
3053
+ winTop.location.href = src;
3054
+ } else if (winTop.location.href.indexOf('main.html') > -1) {
3055
+ winTop.location.href = './login.html';
3055
3056
  } else {
3056
- var hash = win.top.location.hash;
3057
+ var hash = winTop.location.hash;
3057
3058
  if (hash) {
3058
- var len = win.top.location.href.indexOf(hash);
3059
- win.top.location.href = win.location.href.slice(0, len) + '#/login';
3059
+ var len = winTop.location.href.indexOf(hash);
3060
+ winTop.location.href = win.location.href.slice(0, len) + '#/login';
3060
3061
  } else {
3061
- win.top.location.href = '/login.html';
3062
+ winTop.location.href = '/login.html';
3062
3063
  }
3063
3064
  }
3064
3065
  } catch (error) {
@@ -3877,9 +3878,9 @@ var removeCookie = function removeCookie(key) {
3877
3878
 
3878
3879
  var winTopOpen = function winTopOpen(config) {
3879
3880
  if (isIE) {
3880
- if (win.top !== win.self) {
3881
+ if (winTop !== win.self) {
3881
3882
  try {
3882
- win.top.windowOpen(config);
3883
+ winTop.windowOpen(config);
3883
3884
  } catch (error) {
3884
3885
  win.postMessage({ method: 'windowOpen', query: config }, '*');
3885
3886
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eoss-ui",
3
- "version": "0.8.3",
3
+ "version": "0.8.5",
4
4
  "description": "eoss内部业务组件",
5
5
  "main": "lib/eoss-ui.common.js",
6
6
  "files": [
@@ -57,8 +57,8 @@ class CA_ExtInterface {
57
57
  * @param {string} sendMsg - 发送的消息
58
58
  * @returns {string} 响应消息
59
59
  */
60
- sendAndWaitMessageEx(operatorCmd, sendMsg) {
61
- this.checkSessionWSURL();
60
+ async sendAndWaitMessageEx(operatorCmd, sendMsg) {
61
+ await this.checkSessionWSURL();
62
62
  const strSendMsg = operatorCmd + ':' + sendMsg;
63
63
  return this.sendAndWaitMessage(this.currentSessionWSURL, strSendMsg);
64
64
  }
@@ -80,13 +80,13 @@ class CA_ExtInterface {
80
80
  globalXmlHttpRequest.setRequestHeader('Content-Type', 'text/plain;charset=UTF-8');
81
81
  globalXmlHttpRequest.send(sendMsg);
82
82
  ResultMsg = globalXmlHttpRequest.responseText;
83
+ return ResultMsg;
83
84
  } catch (e) {
84
85
  this.currentSessionWSURL = '';
85
86
  if (this.options.onError) {
86
87
  this.options.onError.call(undefined, e);
87
88
  }
88
89
  }
89
- return ResultMsg;
90
90
  }
91
91
 
92
92
  /**
@@ -264,6 +264,7 @@ export default {
264
264
  default: false
265
265
  },
266
266
  readonly: Boolean,
267
+ allowToolbar: Boolean,
267
268
  url: {
268
269
  type: String,
269
270
  default: ''
@@ -691,31 +692,59 @@ export default {
691
692
  },
692
693
  showToolbar() {
693
694
  if (this.readonly) {
694
- return false;
695
- }
696
- if (typeof this.toolbar === 'boolean') {
697
- if (this.toolbar) {
698
- this.toolbars = [
699
- {
700
- type: 'search',
701
- contents: [
695
+ if (this.allowToolbar) {
696
+ if (typeof this.toolbar === 'boolean') {
697
+ if (this.toolbar) {
698
+ this.toolbars = [
702
699
  {
703
- type: 'text',
704
- name: 'keyword',
705
- placeholder: '请输入关键字'
700
+ type: 'search',
701
+ contents: [
702
+ {
703
+ type: 'text',
704
+ name: 'keyword',
705
+ placeholder: '请输入关键字'
706
+ }
707
+ ]
706
708
  }
707
- ]
709
+ ];
708
710
  }
709
- ];
711
+ return this.toolbar;
712
+ } else if (Array.isArray(this.toolbar)) {
713
+ this.toolbars = this.toolbar;
714
+ return true;
715
+ } else {
716
+ this.toolbars = this.toolbar.contents;
717
+ this.toolbarEvents = this.toolbar.events || {};
718
+ return true;
719
+ }
720
+ } else {
721
+ return false;
710
722
  }
711
- return this.toolbar;
712
- } else if (Array.isArray(this.toolbar)) {
713
- this.toolbars = this.toolbar;
714
- return true;
715
723
  } else {
716
- this.toolbars = this.toolbar.contents;
717
- this.toolbarEvents = this.toolbar.events || {};
718
- return true;
724
+ if (typeof this.toolbar === 'boolean') {
725
+ if (this.toolbar) {
726
+ this.toolbars = [
727
+ {
728
+ type: 'search',
729
+ contents: [
730
+ {
731
+ type: 'text',
732
+ name: 'keyword',
733
+ placeholder: '请输入关键字'
734
+ }
735
+ ]
736
+ }
737
+ ];
738
+ }
739
+ return this.toolbar;
740
+ } else if (Array.isArray(this.toolbar)) {
741
+ this.toolbars = this.toolbar;
742
+ return true;
743
+ } else {
744
+ this.toolbars = this.toolbar.contents;
745
+ this.toolbarEvents = this.toolbar.events || {};
746
+ return true;
747
+ }
719
748
  }
720
749
  },
721
750
  optionDatas: {