eoss-ui 0.5.81-beta2 → 0.5.81-beta20

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 (127) hide show
  1. package/lib/button-group.js +76 -53
  2. package/lib/button.js +51 -46
  3. package/lib/checkbox-group.js +49 -45
  4. package/lib/clients.js +4 -3
  5. package/lib/config/api.js +3 -1
  6. package/lib/data-table-form.js +49 -45
  7. package/lib/data-table.js +443 -240
  8. package/lib/date-picker.js +49 -45
  9. package/lib/dialog.js +58 -53
  10. package/lib/eoss-ui.common.js +3698 -2064
  11. package/lib/flow-group.js +52 -48
  12. package/lib/flow-list.js +50 -46
  13. package/lib/flow.js +138 -75
  14. package/lib/form.js +96 -49
  15. package/lib/handle-user.js +66 -49
  16. package/lib/handler.js +61 -48
  17. package/lib/icon.js +49 -45
  18. package/lib/index.js +1 -1
  19. package/lib/input-number.js +49 -45
  20. package/lib/input.js +49 -45
  21. package/lib/login.js +64 -53
  22. package/lib/main.js +2632 -1466
  23. package/lib/menu.js +1 -1
  24. package/lib/nav.js +49 -45
  25. package/lib/notify.js +54 -50
  26. package/lib/page.js +49 -45
  27. package/lib/pagination.js +3719 -3
  28. package/lib/player.js +54 -50
  29. package/lib/qr-code.js +49 -45
  30. package/lib/radio-group.js +49 -45
  31. package/lib/retrial-auth.js +50 -46
  32. package/lib/select-ganged.js +49 -45
  33. package/lib/select.js +50 -46
  34. package/lib/selector-panel.js +115 -63
  35. package/lib/selector.js +491 -422
  36. package/lib/sizer.js +49 -45
  37. package/lib/steps.js +49 -45
  38. package/lib/switch.js +49 -45
  39. package/lib/table-form.js +49 -45
  40. package/lib/tabs.js +49 -45
  41. package/lib/theme-chalk/base.css +1 -1
  42. package/lib/theme-chalk/button-group.css +1 -1
  43. package/lib/theme-chalk/data-table.css +1 -1
  44. package/lib/theme-chalk/handler.css +1 -1
  45. package/lib/theme-chalk/index.css +1 -1
  46. package/lib/theme-chalk/main.css +1 -1
  47. package/lib/theme-chalk/menu.css +1 -1
  48. package/lib/theme-chalk/nav.css +1 -1
  49. package/lib/theme-chalk/pagination.css +1 -1
  50. package/lib/theme-chalk/selector-panel.css +1 -1
  51. package/lib/theme-chalk/simplicity.css +1 -1
  52. package/lib/theme-chalk/sizer.css +1 -1
  53. package/lib/theme-chalk/toolbar.css +1 -1
  54. package/lib/theme-chalk/tree.css +1 -1
  55. package/lib/theme-chalk/upload.css +1 -1
  56. package/lib/tips.js +49 -45
  57. package/lib/tree-group.js +49 -45
  58. package/lib/tree.js +49 -45
  59. package/lib/upload.js +59 -55
  60. package/lib/wujie.js +49 -45
  61. package/lib/wxlogin.js +49 -45
  62. package/package.json +2 -2
  63. package/packages/button/src/main.vue +2 -1
  64. package/packages/button-group/src/main.vue +8 -6
  65. package/packages/clients/src/main.vue +2 -1
  66. package/packages/data-table/src/column.vue +113 -41
  67. package/packages/data-table/src/formItem.vue +430 -0
  68. package/packages/data-table/src/main.vue +85 -45
  69. package/packages/data-table/src/sizer.vue +2 -0
  70. package/packages/dialog/src/main.vue +4 -3
  71. package/packages/flow/src/main.vue +30 -17
  72. package/packages/flow-group/src/main.vue +1 -1
  73. package/packages/form/src/main.vue +45 -10
  74. package/packages/handle-user/src/main.vue +10 -3
  75. package/packages/handler/src/main.vue +5 -3
  76. package/packages/login/src/main.vue +13 -6
  77. package/packages/main/src/default/index.vue +102 -179
  78. package/packages/main/src/main.vue +243 -16
  79. package/packages/main/src/public/online.vue +90 -0
  80. package/packages/main/src/simplicity/apps.vue +176 -145
  81. package/packages/main/src/simplicity/avatar.vue +16 -6
  82. package/packages/main/src/simplicity/handler.vue +6 -2
  83. package/packages/main/src/simplicity/index.vue +477 -323
  84. package/packages/main/src/simplicity/menu-list.vue +75 -24
  85. package/packages/main/src/simplicity/message.vue +35 -25
  86. package/packages/main/src/simplicity/notice.vue +72 -39
  87. package/packages/main/src/simplicity/router-page.vue +53 -0
  88. package/packages/main/src/simplicity/settings.vue +1 -1
  89. package/packages/main/src/simplicity/sub-menu.vue +169 -54
  90. package/packages/main/src/simplicity/user.vue +10 -5
  91. package/packages/main/src/simplicity/userinfo.vue +1 -0
  92. package/packages/menu/src/main.vue +4 -3
  93. package/packages/pagination/src/main.vue +20 -1
  94. package/packages/select/src/main.vue +4 -1
  95. package/packages/selector/src/main.vue +151 -136
  96. package/packages/selector-panel/src/main.vue +23 -9
  97. package/packages/selector-panel/src/selection.vue +6 -0
  98. package/packages/theme-chalk/lib/base.css +1 -1
  99. package/packages/theme-chalk/lib/button-group.css +1 -1
  100. package/packages/theme-chalk/lib/data-table.css +1 -1
  101. package/packages/theme-chalk/lib/handler.css +1 -1
  102. package/packages/theme-chalk/lib/index.css +1 -1
  103. package/packages/theme-chalk/lib/main.css +1 -1
  104. package/packages/theme-chalk/lib/menu.css +1 -1
  105. package/packages/theme-chalk/lib/nav.css +1 -1
  106. package/packages/theme-chalk/lib/pagination.css +1 -1
  107. package/packages/theme-chalk/lib/selector-panel.css +1 -1
  108. package/packages/theme-chalk/lib/simplicity.css +1 -1
  109. package/packages/theme-chalk/lib/sizer.css +1 -1
  110. package/packages/theme-chalk/lib/toolbar.css +1 -1
  111. package/packages/theme-chalk/lib/tree.css +1 -1
  112. package/packages/theme-chalk/lib/upload.css +1 -1
  113. package/packages/theme-chalk/src/base.scss +5 -0
  114. package/packages/theme-chalk/src/button-group.scss +18 -4
  115. package/packages/theme-chalk/src/common/var.scss +9 -2
  116. package/packages/theme-chalk/src/data-table.scss +60 -23
  117. package/packages/theme-chalk/src/handler.scss +5 -1
  118. package/packages/theme-chalk/src/login.scss +2 -2
  119. package/packages/theme-chalk/src/nav.scss +3 -2
  120. package/packages/theme-chalk/src/pagination.scss +7 -0
  121. package/packages/theme-chalk/src/selector-panel.scss +2 -1
  122. package/packages/theme-chalk/src/simplicity.scss +355 -58
  123. package/packages/theme-chalk/src/toolbar.scss +16 -4
  124. package/packages/theme-chalk/src/tree.scss +4 -2
  125. package/packages/upload/src/main.vue +3 -1
  126. package/src/config/api.js +3 -1
  127. package/src/index.js +1 -1
@@ -1,25 +1,30 @@
1
1
  <template>
2
2
  <div class="es-main">
3
3
  <div class="es-simplicity-side">
4
- <img
5
- class="es-simplicity-side-item es-simplicity-logo"
6
- v-if="mainLogo"
7
- :src="mainLogo"
8
- />
9
- <el-popover placement="right-start" width="360" trigger="click">
4
+ <img class="es-simplicity-logo" v-if="mainLogo" :src="mainLogo" />
5
+ <div class="es-simplicity-org-name">
6
+ {{ simpleUserInfo.orgShortName || simpleUserInfo.orgName }}
7
+ </div>
8
+ <el-popover
9
+ class="es-simplicity-user-popover"
10
+ placement="right-start"
11
+ width="360"
12
+ trigger="click"
13
+ >
10
14
  <!-- 用户信息 -->
11
15
  <user
12
16
  :user="user"
13
17
  :notifyList="notifyList"
14
18
  :notify="notify"
15
19
  :contents="userInfoContents"
20
+ @success="handleSuccess"
16
21
  @change="handleChangeConfig"
17
22
  @close="handlerClose"
18
23
  ></user>
19
- <avatar slot="reference" :user="user"> </avatar>
24
+ <avatar slot="reference" :user="user" :size="56"> </avatar>
20
25
  <!-- 用户信息 end -->
21
26
  </el-popover>
22
- <div class="es-simplicity-side-item es-simplicity-side-Application">
27
+ <div class="es-simplicity-side-Application">
23
28
  <!-- 常用应用 -->
24
29
  <el-scrollbar>
25
30
  <div
@@ -51,6 +56,28 @@
51
56
  ></es-icon>
52
57
  <div class="es-simplicity-side-app-text">更多</div>
53
58
  </div>
59
+ <div
60
+ class="es-simplicity-side-app"
61
+ v-for="(item, index) in newApps"
62
+ :class="{ 'is-active': active == item.id }"
63
+ :key="item.id"
64
+ :title="item.text || item.name"
65
+ @click.stop="handlerClickApp(item)"
66
+ >
67
+ <i
68
+ class="el-icon-circle-close"
69
+ @click.stop="handleDelete(index)"
70
+ ></i>
71
+ <el-badge v-bind="getBadge(item)">
72
+ <es-icon
73
+ class="es-simplicity-side-app-icon"
74
+ :contents="item.icons || item.icon || menuIcon"
75
+ ></es-icon>
76
+ <div class="es-simplicity-side-app-text">
77
+ {{ item.text || item.name }}
78
+ </div>
79
+ </el-badge>
80
+ </div>
54
81
  </el-scrollbar>
55
82
  <!-- 常用应用 end -->
56
83
  </div>
@@ -71,64 +98,33 @@
71
98
  </div>
72
99
  </div>
73
100
  <div class="es-simplicity-main">
74
- <!-- 菜单 -->
75
- <el-drawer
76
- class="es-simplicity-subMenus"
77
- direction="ltr"
78
- modal-class="es-simplicity-apps-modal"
79
- :size="width"
80
- :modal-append-to-body="false"
81
- :with-header="false"
82
- :visible.sync="showMenu"
83
- >
84
- <sub-menu
85
- ref="subMenus"
86
- :color="menuColor"
87
- :backgroundColor="menuBackgroundColor"
88
- :menu-icon="menuIcon"
89
- v-bind="subMenus"
90
- @command="handlerClickMenu"
91
- ></sub-menu>
92
- </el-drawer>
93
- <!-- 菜单 end -->
94
-
95
101
  <!-- 应用 -->
96
- <el-drawer
97
- class="es-simplicity-apps"
98
- direction="ltr"
99
- modal-class="es-simplicity-apps-modal"
100
- size="90%"
101
- :modal-append-to-body="false"
102
- :with-header="false"
102
+ <apps
103
103
  :visible.sync="showApps"
104
- >
105
- <apps
106
- :menu-icon="menuIcon"
107
- :color="appColor"
108
- :backgroundColor="appBackgroundColor"
109
- :applications="applications"
110
- :business="business"
111
- :systems="systems"
112
- @click="handlerClickApp"
113
- ></apps>
114
- </el-drawer>
104
+ :menu-icon="menuIcon"
105
+ :color="appColor"
106
+ :backgroundColor="appBackgroundColor"
107
+ :applications="applications"
108
+ :business="business"
109
+ :systems="systems"
110
+ @click="handlerClickApps"
111
+ ></apps>
115
112
  <!-- 应用 end -->
116
113
 
117
114
  <!-- AI -->
118
115
  <el-drawer
119
- class="es-simplicity-subMenus"
116
+ class="es-simplicity-public-drawer"
120
117
  direction="ltr"
121
118
  modal-class="es-simplicity-apps-modal"
122
119
  size="100%"
123
120
  show-close
124
121
  :modal-append-to-body="false"
125
- :with-header="false"
126
122
  :visible.sync="drawer.visible"
127
123
  >
128
- <i
124
+ <!-- <i
129
125
  class="es-icon-close es-simplicity-drawer-close"
130
126
  @click="handleCloseDrawer"
131
- ></i>
127
+ ></i> -->
132
128
  <template v-if="drawer.url">
133
129
  <template v-if="isIE || drawer.method !== 'wujie'">
134
130
  <iframe
@@ -156,7 +152,8 @@
156
152
  <el-card class="es-simplicity-tabs-handler" ref="tabsHandler">
157
153
  <div
158
154
  class="es-simplicity-tabs-handler-item"
159
- @click="handleTabsEvents(0)"
155
+ :class="{ 'is-disabled': isDisabled.refresh }"
156
+ @click="isDisabled.refresh ? '' : handleTabsEvents(0)"
160
157
  >
161
158
  刷新
162
159
  </div>
@@ -191,13 +188,15 @@
191
188
  </div>
192
189
  <el-tabs
193
190
  class="es-simplicity-iframe"
191
+ :class="{ 'is-open': showMenu, 'is-fold': fold }"
194
192
  v-model="activeName"
195
193
  closable
196
194
  hide-bar
197
- @tab-click="handleTab"
195
+ opacity
198
196
  @tab-remove="handleRemove"
199
197
  @tab-contextmenu="handleContextmenu"
200
198
  >
199
+ <!-- 操作栏 -->
201
200
  <handler
202
201
  slot="append"
203
202
  v-bind="handleConfig"
@@ -210,6 +209,23 @@
210
209
  :notice-num="notice"
211
210
  @click="handleClick"
212
211
  ></handler>
212
+ <!-- 操作栏 end-->
213
+
214
+ <!-- 菜单 -->
215
+ <sub-menu
216
+ :mode="mode"
217
+ :visible.sync="showMenu"
218
+ :closed.sync="fold"
219
+ :size="menuWidth"
220
+ :title="title"
221
+ :color="menuColor"
222
+ :backgroundColor="menuBackgroundColor"
223
+ :menu-icon="menuIcon"
224
+ :active="subActive"
225
+ v-bind="subMenus"
226
+ @command="handlerClickMenu"
227
+ ></sub-menu>
228
+ <!-- 菜单 end -->
213
229
  <el-tab-pane
214
230
  v-for="item in tabs"
215
231
  :key="item.id"
@@ -220,8 +236,8 @@
220
236
  v-if="(isIE && item.method !== 'router') || item.method == 'iframe'"
221
237
  >
222
238
  <iframe
223
- :id="iframeId"
224
- :name="iframeId"
239
+ :id="activeName == item.id ? iframeId : ''"
240
+ :name="activeName == item.id ? iframeId : ''"
225
241
  frameborder="0"
226
242
  width="100%"
227
243
  height="100%"
@@ -238,10 +254,11 @@
238
254
  ></es-wujie>
239
255
  </template>
240
256
  <template v-else-if="item.method === 'router' && item.refresh">
241
- <router-view v-if="!isKeepAlive" :name="item.appCode" />
242
- <keep-alive>
243
- <router-view v-if="isKeepAlive" :name="item.appCode" />
244
- </keep-alive>
257
+ <router-page
258
+ v-bind="item"
259
+ :show="activeName == item.id"
260
+ :query="$parent.params"
261
+ ></router-page>
245
262
  </template>
246
263
  </el-tab-pane>
247
264
  </el-tabs>
@@ -275,8 +292,11 @@
275
292
 
276
293
  <!-- 公用弹窗 -->
277
294
  <es-dialog :title="dialog.title" :visible.sync="dialog.show" size="md">
295
+ <template v-if="dialog.title == '查看在线人员' && !dialog.src">
296
+ <online></online>
297
+ </template>
278
298
  <iframe
279
- v-if="dialog.show"
299
+ v-else-if="dialog.show"
280
300
  width="100%"
281
301
  height="100%"
282
302
  frameborder="0"
@@ -297,25 +317,30 @@ import user from './user.vue';
297
317
  import message from './message.vue';
298
318
  import notice from './notice.vue';
299
319
  import settings from './settings.vue';
320
+ import routerPage from './router-page.vue';
321
+ import online from '../public/online.vue';
300
322
  import {
301
323
  wss,
324
+ logout,
302
325
  topic,
303
326
  getUserAppWithTag,
327
+ recordUserApp,
304
328
  getComplexApplications,
305
329
  getComplexApplicationsNew
306
330
  } from 'eoss-ui/src/config/api.js';
307
331
  import store from 'eoss-ui/src/utils/store';
308
332
  import util from 'eoss-ui/src/utils/util';
309
333
  const isIE = navigator.userAgent.indexOf('MSIE') != -1;
334
+ const dataTableMode = util.win.dataTableMode || 'default';
310
335
  let events = [
311
- (tabs, index) => {
336
+ (tabs, index, that) => {
312
337
  let tab = tabs[index];
313
338
 
314
339
  if (tab.method == 'iframe') {
315
340
  tabs[index].url = util.handlerUrl(tab.url);
316
341
  } else {
317
342
  tabs[index].refresh = false;
318
- this.$nextTick(() => {
343
+ that.$nextTick(() => {
319
344
  tabs[index].refresh = true;
320
345
  });
321
346
  }
@@ -358,7 +383,14 @@ let events = [
358
383
  }
359
384
  ];
360
385
  export default {
361
- name: 'EsMainSimplicity',
386
+ name: 'Simplicity',
387
+ provide() {
388
+ return {
389
+ esMain: this,
390
+ refresh: this.handleRefresh,
391
+ jumpMenu: this.jumpMenu
392
+ };
393
+ },
362
394
  components: {
363
395
  avatar,
364
396
  handler,
@@ -367,9 +399,21 @@ export default {
367
399
  user,
368
400
  message,
369
401
  notice,
370
- settings
402
+ settings,
403
+ routerPage,
404
+ online
371
405
  },
372
406
  props: {
407
+ //模式
408
+ mode: {
409
+ type: String,
410
+ default: dataTableMode
411
+ },
412
+ //记录菜单点击率作为工作台常用应用数据
413
+ recordApp: {
414
+ type: Boolean,
415
+ default: true
416
+ },
373
417
  appCode: String,
374
418
  //logo
375
419
  logo: String,
@@ -448,7 +492,14 @@ export default {
448
492
  //无界微前端Props属性
449
493
  wjProps: Object,
450
494
  //无界微前端Attrs属性
451
- wjAttrs: Object
495
+ wjAttrs: Object,
496
+ //菜单宽度
497
+ menuWidth: {
498
+ type: Number,
499
+ default: 220
500
+ },
501
+ //路由方式
502
+ routeType: String
452
503
  },
453
504
  data() {
454
505
  return {
@@ -460,14 +511,20 @@ export default {
460
511
  mainLogo: this.logo,
461
512
  //侧边用户应用
462
513
  userApps: [],
514
+ //点击应用存侧边
515
+ newApps: [],
463
516
  //所有菜单
464
517
  menus: [],
518
+ //菜单名称
519
+ title: '',
465
520
  //子菜单
466
- subMenus: [],
521
+ subMenus: null,
467
522
  //展示菜单导航
468
523
  showMenu: false,
469
- //展示菜单导航宽度
470
- width: '296px',
524
+ //子菜单选中
525
+ subActive: '',
526
+ //折叠菜单
527
+ fold: false,
471
528
  //人工智能配置
472
529
  aiConfig: null,
473
530
  //公用窗口面板配置
@@ -526,7 +583,9 @@ export default {
526
583
  //页签对象
527
584
  pane: null,
528
585
  //选中菜单
529
- active: ''
586
+ active: '',
587
+ //单位名称
588
+ simpleUserInfo: {}
530
589
  };
531
590
  },
532
591
  computed: {
@@ -566,9 +625,7 @@ export default {
566
625
  //在线人数列表地址
567
626
  onlineUrl() {
568
627
  if (this.onlineView) {
569
- return typeof this.onlineView == 'string'
570
- ? this.onlineView
571
- : '/main/sysuseronline/list.dhtml';
628
+ return typeof this.onlineView == 'string' ? this.onlineView : '';
572
629
  }
573
630
  return false;
574
631
  }
@@ -589,15 +646,14 @@ export default {
589
646
  let mainConfig = util.getStorage('mainConfig');
590
647
  if (mainConfig) {
591
648
  const results = JSON.parse(mainConfig);
592
- this.init(results);
649
+ if (Object.keys(results).length) {
650
+ this.init(results);
651
+ }
593
652
  }
594
653
  this.doorIndex = sessionStorage.getItem('doorIndex');
595
654
  },
596
655
  mounted() {
597
- util.win.reLogin = this.handleReLogin;
598
- util.win.refresh = this.handleRefresh;
599
- util.win.jumpMenu = this.jumpMenu;
600
- util.win.windowOpen = this.openPage;
656
+ this.handleListener();
601
657
  },
602
658
  methods: {
603
659
  /**
@@ -605,13 +661,13 @@ export default {
605
661
  * @author huangbo
606
662
  * @date 2024年9月7日
607
663
  **/
608
- hasRouter(res, url, code, parentName) {
664
+ hasRouter(res, url, code) {
609
665
  if (!url) {
610
666
  return false;
611
667
  }
612
668
  if (Array.isArray(res)) {
613
669
  for (let i in res) {
614
- let path = this.hasRouter(res[i], url, code, parentName);
670
+ let path = this.hasRouter(res[i], url, code);
615
671
  if (path) {
616
672
  return path;
617
673
  }
@@ -624,20 +680,20 @@ export default {
624
680
  let pathname = url.substring(url.indexOf('#/') + 1);
625
681
  pathname = pathname.split('?')[0];
626
682
  if (res.path !== '/' && pathname == path) {
627
- if (typeof res.component === 'function') {
628
- let component = {};
629
- component[code] = res.component;
630
- res.component = component;
631
- if (parentName) {
632
- this.$router.addRoute({ parentName, route: res });
633
- } else {
634
- this.$router.addRoute(res);
683
+ if (res.components) {
684
+ if (!res.components[code]) {
685
+ console.error('“命名视图”规范属性名称与菜单appCode不一致', res);
635
686
  }
687
+ } else {
688
+ console.error(
689
+ '请根据“命名视图”规范,正确添加components属性名称',
690
+ res
691
+ );
636
692
  }
637
693
  return pathname;
638
694
  }
639
695
  if (res && Object.prototype.hasOwnProperty.call(res, 'children')) {
640
- let path = this.hasRouter(res.children, url, code, parentName);
696
+ let path = this.hasRouter(res.children, url, code);
641
697
  if (path) {
642
698
  return path;
643
699
  }
@@ -654,7 +710,6 @@ export default {
654
710
  this.setConfig(results);
655
711
  if (this.remote) {
656
712
  this.getApplications();
657
- this.getMenus();
658
713
  }
659
714
  },
660
715
  /**
@@ -774,6 +829,7 @@ export default {
774
829
  * @date 2024年9月7日
775
830
  **/
776
831
  getApplications() {
832
+ let loading = util.loading('', '加载中...');
777
833
  util
778
834
  .ajax({
779
835
  url: this.appsUrl,
@@ -797,12 +853,15 @@ export default {
797
853
  } else {
798
854
  this.$message.error('未分配应用菜单权限,请联系管理员!');
799
855
  }
856
+ this.getMenus(loading);
800
857
  } else {
858
+ loading.close();
801
859
  let msg = res.msg || '系统错误,请联系管理员!';
802
860
  this.$message.error(msg);
803
861
  }
804
862
  })
805
863
  .catch((err) => {
864
+ loading.close();
806
865
  if (err.message && err.message !== 'canceled') {
807
866
  this.$message.error(err.message);
808
867
  }
@@ -813,41 +872,92 @@ export default {
813
872
  * @author huangbo
814
873
  * @date 2024年9月7日
815
874
  **/
816
- getMenus(appCode, url) {
817
- let params = appCode ? { menuCode: appCode } : {};
875
+ getMenus(loading) {
818
876
  util
819
- .ajax({ url: url || this._menuUrl, params: params })
877
+ .ajax({ url: this._menuUrl })
820
878
  .then((res) => {
879
+ loading.close();
821
880
  if (res.rCode === 0) {
822
881
  if (res.results && res.results.length) {
823
882
  this.menus = res.results;
824
883
  this.setTips(this.menus);
825
884
  store.set('nav', this.menus);
826
- if (this.indexUrl) {
827
- let obj = this.getMenu(this.menus, this.indexUrl);
828
- if (obj) {
829
- this.tabs = [this.setIframeType(obj)];
830
- this.activeName = obj.id;
831
- this.homePage = obj;
832
- } else {
833
- this.homePage = this.setIframeType({
834
- url: this.indexUrl,
835
- text: '工作台',
836
- id: '0',
837
- appCode: 'indexUrl'
838
- });
839
- this.tabs = [this.homePage];
840
- this.activeName = '0';
885
+ if (this.appCode) {
886
+ let app = this.userApps.filter((item) => {
887
+ return item.code === this.appCode;
888
+ })[0];
889
+ if (app) {
890
+ this.active = app.id;
891
+ if (app.url) {
892
+ let obj = this.getMenu(this.menus, app.url);
893
+ if (obj) {
894
+ let tab = this.setIframeType(obj);
895
+ this.tabs = [tab];
896
+ this.activeName = tab.id;
897
+ } else {
898
+ this.tabs = [app];
899
+ }
900
+ }
841
901
  }
842
- }
843
- if (this.initApps && this.initApps.length) {
844
- let obj = this.getMenu(
902
+ let subMenus = this.getMenu(
845
903
  this.menus,
846
- this.initApps[this.initApps.length - 1]
904
+ this.appCode,
905
+ 'appCode'
847
906
  );
848
- if (obj) {
849
- this.tabs.push(this.setIframeType(obj));
850
- this.activeName = obj.id;
907
+ if (subMenus) {
908
+ if (this.tabs.length == 0) {
909
+ let obj = this.getFirst(subMenus);
910
+ if (obj) {
911
+ this.subActive = obj.id;
912
+ let tab = this.setIframeType(obj);
913
+ this.tabs = [tab];
914
+ this.activeName = tab.id;
915
+ } else {
916
+ this.subActive = '';
917
+ }
918
+ }
919
+ this.subMenus = subMenus;
920
+ this.showMenu = true;
921
+ } else {
922
+ this.subMenus = null;
923
+ this.showMenu = false;
924
+ }
925
+ } else {
926
+ if (this.indexUrl) {
927
+ let obj = this.getMenu(this.menus, this.indexUrl);
928
+ if (obj) {
929
+ if (!this.appCode) {
930
+ let tab = this.setIframeType(obj);
931
+ this.tabs = [tab];
932
+ this.activeName = tab.id;
933
+ }
934
+ this.homePage = obj;
935
+ } else {
936
+ this.homePage = this.setIframeType({
937
+ url: this.indexUrl,
938
+ text: '工作台',
939
+ id: '0',
940
+ appCode: 'indexUrl'
941
+ });
942
+ if (!this.appCode) {
943
+ this.tabs = [this.homePage];
944
+ this.activeName = '0';
945
+ }
946
+ }
947
+ } else if (
948
+ this.initApps &&
949
+ this.initApps.length &&
950
+ !this.appCode
951
+ ) {
952
+ let obj = this.getMenu(
953
+ this.menus,
954
+ this.initApps[this.initApps.length - 1]
955
+ );
956
+ if (obj) {
957
+ let tab = this.setIframeType(obj);
958
+ this.tabs.push(tab);
959
+ this.activeName = tab.id;
960
+ }
851
961
  }
852
962
  }
853
963
  } else {
@@ -859,19 +969,25 @@ export default {
859
969
  }
860
970
  })
861
971
  .catch((err) => {
972
+ loading.close();
862
973
  if (err.message && err.message !== 'canceled') {
863
974
  this.$message.error(err.message);
864
975
  }
865
976
  });
866
977
  },
978
+ /**
979
+ * @desc:设置页面加载类型
980
+ * @author huangbo
981
+ * @date 2024年9月7日
982
+ **/
867
983
  setIframeType(res) {
868
984
  let { url } = res;
985
+ if (url) {
986
+ res.refresh = false;
987
+ }
869
988
  let urls = url.split('?');
870
989
  if (urls[0].indexOf('.js') > 1 && !isIE) {
871
990
  res.method = 'wujie';
872
- this.$nextTick(() => {
873
- res.refresh = true;
874
- });
875
991
  } else if (
876
992
  urls[0].indexOf('.dhtml') > 0 ||
877
993
  (urls[0].indexOf('.html') > 0 && urls[0].indexOf('.html#') === -1)
@@ -884,15 +1000,9 @@ export default {
884
1000
  const routes = this.$router.options.routes;
885
1001
  if (routes) {
886
1002
  let path = this.hasRouter(routes, urls[0], res.appCode);
887
- if (path) {
888
- let params = util.getParams({ url: url });
889
- this.$router.push({
890
- path: path,
891
- query: params
892
- });
893
- this.$nextTick(() => {
894
- res.refresh = true;
895
- });
1003
+ if (path && this.routeType !== 'wujie') {
1004
+ res.method = 'router';
1005
+ res.path = path;
896
1006
  } else {
897
1007
  let urlopenmode = util.getParams({
898
1008
  url: url,
@@ -907,9 +1017,6 @@ export default {
907
1017
  res.method = 'iframe';
908
1018
  } else {
909
1019
  res.method = 'wujie';
910
- this.$nextTick(() => {
911
- res.refresh = true;
912
- });
913
1020
  }
914
1021
  }
915
1022
  } else if (
@@ -917,14 +1024,14 @@ export default {
917
1024
  urls[0].indexOf('/#/') > -1
918
1025
  ) {
919
1026
  res.method = 'wujie';
920
- this.$nextTick(() => {
921
- res.refresh = true;
922
- });
923
1027
  } else {
924
1028
  res.method = 'iframe';
925
1029
  }
926
1030
  }
927
1031
  }
1032
+ if (Object.prototype.hasOwnProperty.call(res, 'refresh')) {
1033
+ res.refresh = true;
1034
+ }
928
1035
  return res;
929
1036
  },
930
1037
  /**
@@ -964,6 +1071,37 @@ export default {
964
1071
  }
965
1072
  return false;
966
1073
  },
1074
+ /**
1075
+ * @desc:获取菜单第一条数据
1076
+ * @author huangbo
1077
+ * @date 2024年9月7日
1078
+ **/
1079
+ getFirst(obj) {
1080
+ if (!obj) {
1081
+ return '';
1082
+ }
1083
+ let openIdex = 0;
1084
+ if (
1085
+ obj.extendData &&
1086
+ (obj.extendData.subDefOpenIndex || obj.extendData.subDefOpen)
1087
+ ) {
1088
+ openIdex = parseInt(
1089
+ obj.extendData.subDefOpenIndex || obj.extendData.subDefOpen,
1090
+ 10
1091
+ );
1092
+ }
1093
+ if (obj.children && obj.children.length && obj.children[openIdex]) {
1094
+ return this.getFirst(obj.children[openIdex]);
1095
+ } else if (
1096
+ obj.fourthTabs &&
1097
+ obj.fourthTabs.length &&
1098
+ obj.fourthTabs[openIdex]
1099
+ ) {
1100
+ return this.getFirst(obj.fourthTabs[openIdex]);
1101
+ } else if (obj.url) {
1102
+ return obj;
1103
+ }
1104
+ },
967
1105
  /**
968
1106
  * @desc:遍历设置菜单气泡提醒
969
1107
  * @author huangbo
@@ -983,31 +1121,30 @@ export default {
983
1121
  this.$set(obj, 'tips', false);
984
1122
  delete obj.tips;
985
1123
  }
986
- let flag = false;
1124
+ let flag = 0;
987
1125
  if (obj.children && obj.children.length) {
988
1126
  obj.children.forEach((item) => {
989
- if (this.setTips(item)) {
990
- flag = true;
991
- }
1127
+ let n = this.setTips(item);
1128
+ flag += n ? parseInt(n) : 0;
992
1129
  });
993
1130
  if (flag) {
994
- this.$set(obj, 'tips', true);
995
- return true;
1131
+ this.$set(obj, 'tips', flag);
1132
+ return flag;
996
1133
  }
997
1134
  } else if (obj.fourthTabs && obj.fourthTabs.length) {
998
1135
  obj.fourthTabs.forEach((item) => {
999
- if (this.setTips(item)) {
1000
- flag = true;
1001
- }
1136
+ let n = this.setTips(item);
1137
+ flag += n ? parseInt(n) : 0;
1002
1138
  });
1003
1139
  if (flag) {
1004
- this.$set(obj, 'tips', true);
1005
- return true;
1140
+ this.$set(obj, 'tips', flag);
1141
+ return flag;
1006
1142
  }
1007
1143
  } else {
1008
- if (this.menuTips[obj.id] && Number(this.menuTips[obj.id])) {
1009
- this.$set(obj, 'tips', Number(this.menuTips[obj.id]));
1010
- return true;
1144
+ let num = this.menuTips[obj.id] || this.menuTips[obj.code];
1145
+ if (num && Number(num)) {
1146
+ this.$set(obj, 'tips', Number(num));
1147
+ return this.menuTips[obj.id];
1011
1148
  }
1012
1149
  }
1013
1150
  }
@@ -1078,12 +1215,38 @@ export default {
1078
1215
  }
1079
1216
  });
1080
1217
  },
1218
+ /**
1219
+ * @desc:删除更多应用菜单点击
1220
+ * @author huangbo
1221
+ * @date 2024年9月7日
1222
+ **/
1223
+ handleDelete(index) {
1224
+ this.newApps.splice(index, 1);
1225
+ },
1226
+ /**
1227
+ * @desc:储存更多应用菜单点击
1228
+ * @author huangbo
1229
+ * @date 2024年9月7日
1230
+ **/
1231
+ handlerClickApps(res) {
1232
+ if (res.permission === false) {
1233
+ return false;
1234
+ }
1235
+ let i = util.indexOfObj(this.newApps, res, 'id');
1236
+ if (i == -1) {
1237
+ this.newApps.push(res);
1238
+ }
1239
+ this.handlerClickApp(res);
1240
+ },
1081
1241
  /**
1082
1242
  * @desc:侧边应用菜单点击
1083
1243
  * @author huangbo
1084
1244
  * @date 2024年9月7日
1085
1245
  **/
1086
1246
  handlerClickApp(res) {
1247
+ this.showMsg = false;
1248
+ this.showSet = false;
1249
+ this.fold = false;
1087
1250
  if (res) {
1088
1251
  if (res.permission === false) {
1089
1252
  return false;
@@ -1095,34 +1258,71 @@ export default {
1095
1258
  this.subMenus = res;
1096
1259
  this.showMenu = true;
1097
1260
  this.showApps = false;
1098
- this.width = '296px';
1099
- this.$refs.subMenus && this.$refs.subMenus.clearSubmenu();
1100
- } else {
1101
- if (res.code) {
1102
- let subMenus = this.getMenu(this.menus, res.code, 'appCode');
1103
- this.subMenus = subMenus ? subMenus : [];
1104
- this.showMenu = subMenus !== false;
1105
- this.showApps = false;
1106
- this.width = '296px';
1107
- this.$refs.subMenus && this.$refs.subMenus.clearSubmenu();
1108
- }
1109
1261
  }
1262
+ let set = true;
1110
1263
  if (res.url) {
1111
1264
  if (res.urlopenmode == 1 || res.openModel == 1) {
1265
+ set = false;
1112
1266
  util.win.open(res.url);
1113
1267
  } else if (res.urlopenmode == 2 || res.openModel == 2) {
1114
- util.win.location.href = res.url;
1268
+ set = false;
1269
+ util.win.open(res.url, '_self');
1115
1270
  } else {
1116
1271
  let i = util.indexOfObj(this.tabs, res, 'id');
1117
1272
  this.activeName = res.id;
1118
1273
  if (i == -1) {
1119
- this.tabs.push(this.setIframeType(res));
1274
+ let obj = this.getMenu(this.menus, res.url);
1275
+ if (obj) {
1276
+ let n = util.indexOfObj(this.tabs, obj, 'id');
1277
+ if (n == -1) {
1278
+ let tab = this.setIframeType(obj);
1279
+ this.tabs.push(tab);
1280
+ this.activeName = tab.id;
1281
+ } else {
1282
+ if (obj.method == 'iframe') {
1283
+ obj.url = util.handlerUrl(obj.url);
1284
+ }
1285
+ }
1286
+ } else {
1287
+ let tab = this.setIframeType(res);
1288
+ this.tabs.push(tab);
1289
+ this.activeName = tab.id;
1290
+ }
1291
+ } else {
1292
+ if (res.method == 'iframe') {
1293
+ res.url = util.handlerUrl(res.url);
1294
+ }
1295
+ }
1296
+ }
1297
+ }
1298
+ if (set && res.code) {
1299
+ let subMenus = this.getMenu(this.menus, res.code, 'appCode');
1300
+ if (!subMenus && !res.url) {
1301
+ this.$alert('没有关联菜单,请联系管理员!', '提示', {
1302
+ confirmButtonText: '确定',
1303
+ type: 'warning'
1304
+ }).catch(() => {});
1305
+ } else {
1306
+ this.title = res.text || res.name;
1307
+ this.subMenus = subMenus ? subMenus : null;
1308
+ this.showMenu = subMenus !== false;
1309
+ this.showApps = false;
1310
+ if (subMenus && subMenus.url) {
1311
+ let i = util.indexOfObj(this.tabs, subMenus, 'id');
1312
+ this.activeName = subMenus.id;
1313
+ if (i == -1) {
1314
+ let tab = this.setIframeType(subMenus);
1315
+ this.tabs.push(tab);
1316
+ } else {
1317
+ if (subMenus.method == 'iframe') {
1318
+ subMenus.url = util.handlerUrl(subMenus.url);
1319
+ }
1320
+ }
1120
1321
  }
1121
1322
  }
1122
1323
  }
1123
1324
  this.active = res.id;
1124
1325
  } else {
1125
- this.showMenu = false;
1126
1326
  this.showApps = !this.showApps;
1127
1327
  }
1128
1328
  },
@@ -1153,17 +1353,50 @@ export default {
1153
1353
  * @date 2024年9月7日
1154
1354
  **/
1155
1355
  handlerClickMenu(res) {
1156
- if (typeof res === 'number') {
1157
- let num = 296;
1158
- this.width = num * res + 'px';
1356
+ if (this.recordApp) {
1357
+ util
1358
+ .ajax({
1359
+ url: recordUserApp,
1360
+ params: {
1361
+ userId: this.user.userId,
1362
+ appId: res.id
1363
+ }
1364
+ })
1365
+ .then(() => {})
1366
+ .catch(() => {});
1367
+ }
1368
+ this.showMsg = false;
1369
+ this.showSet = false;
1370
+ let i = util.indexOfObj(this.tabs, res, 'id');
1371
+ this.activeName = res.id;
1372
+ if (i == -1) {
1373
+ let tab = this.setIframeType(res);
1374
+ this.tabs.push(tab);
1159
1375
  } else {
1160
- let i = util.indexOfObj(this.tabs, res, 'id');
1161
- this.activeName = res.id;
1162
- if (i == -1) {
1163
- this.tabs.push(this.setIframeType(res));
1376
+ if (res.method == 'iframe') {
1377
+ res.url = util.handlerUrl(res.url);
1378
+ } else {
1379
+ let tab = this.tabs[i];
1380
+ if (tab.method === 'iframe') {
1381
+ this.$set(this.tabs[i], 'url', util.handlerUrl(tab.url));
1382
+ } else {
1383
+ this.$set(this.tabs[i], 'refresh', false);
1384
+ this.$nextTick(() => {
1385
+ this.$set(this.tabs[i], 'refresh', true);
1386
+ });
1387
+ }
1164
1388
  }
1165
1389
  }
1166
1390
  },
1391
+
1392
+ /**
1393
+ * @desc:用户详情请求成功
1394
+ * @author huangbo
1395
+ * @date 2024年9月7日
1396
+ **/
1397
+ handleSuccess(res) {
1398
+ this.simpleUserInfo = res.simpleUserInfo;
1399
+ },
1167
1400
  /**
1168
1401
  * @desc:修改用户配置
1169
1402
  * @author huangbo
@@ -1198,35 +1431,27 @@ export default {
1198
1431
  this.webSocket.destroy();
1199
1432
  }
1200
1433
  },
1201
- /**
1202
- * @desc:选中iframe页签刷新
1203
- * @author huangbo
1204
- * @date 2024年9月7日
1205
- **/
1206
- handleTab(res) {
1207
- let index;
1208
- if (res) {
1209
- index = parseInt(res.index);
1210
- } else {
1211
- index = util.indexOfObj(this.tabs, this.activeName, 'id');
1212
- }
1213
- let item = this.tabs[index];
1214
- if (item.method == 'iframe') {
1215
- item.url = util.handlerUrl(item.url);
1216
- } else {
1217
- item.refresh = false;
1218
- this.$nextTick(() => {
1219
- item.refresh = true;
1220
- });
1221
- }
1222
- },
1223
1434
  /**
1224
1435
  * @desc:刷新选中iframe页签
1225
1436
  * @author huangbo
1226
1437
  * @date 2024年9月7日
1227
1438
  **/
1228
1439
  handleRefresh() {
1229
- this.handleTab();
1440
+ let i = util.indexOfObj(this.tabs, this.activeName, 'id');
1441
+ let tab = this.tabs[i];
1442
+ if (tab.method === 'iframe') {
1443
+ tab.url = util.handlerUrl(tab.url);
1444
+ } else {
1445
+ let tab = this.tabs[i];
1446
+ if (tab.method === 'iframe') {
1447
+ this.$set(this.tabs[i], 'url', util.handlerUrl(tab.url));
1448
+ } else {
1449
+ this.$set(this.tabs[i], 'refresh', false);
1450
+ this.$nextTick(() => {
1451
+ this.$set(this.tabs[i], 'refresh', true);
1452
+ });
1453
+ }
1454
+ }
1230
1455
  },
1231
1456
  /**
1232
1457
  * @desc:删除iframe
@@ -1264,6 +1489,9 @@ export default {
1264
1489
  if (this.tabs.length == 1) {
1265
1490
  disabled.other = true;
1266
1491
  }
1492
+ if (this.tabs[index].id != this.activeName) {
1493
+ disabled.refresh = true;
1494
+ }
1267
1495
  this.isDisabled = disabled;
1268
1496
  this.$refs.tabsHandler.$el.style.setProperty('left', `${e.x}px`);
1269
1497
  this.$refs.tabsHandler.$el.style.setProperty('top', `${e.y}px`);
@@ -1305,38 +1533,52 @@ export default {
1305
1533
  } else if (open) {
1306
1534
  util.win.open(open);
1307
1535
  } else if (link) {
1308
- util.win.location.href = link;
1536
+ util.win.open(link, '_self');
1309
1537
  } else {
1310
1538
  switch (type) {
1311
1539
  case 'quit':
1312
1540
  this.handleQuit();
1313
1541
  break;
1314
1542
  case 'online':
1315
- if (this.onlineUrl) {
1316
- this.dialog = {
1317
- title: '查看在线人员',
1318
- show: true,
1319
- src: this.onlineUrl
1320
- };
1321
- }
1543
+ this.showMsg = false;
1544
+ this.showSet = false;
1545
+ this.dialog = {
1546
+ title: '查看在线人员',
1547
+ show: true,
1548
+ src: this.onlineUrl
1549
+ };
1322
1550
  break;
1323
1551
  case 'notice':
1324
1552
  this.showMsg = !this.showMsg;
1553
+ this.showSet = false;
1325
1554
  break;
1326
1555
  case 'set':
1327
1556
  this.showSet = !this.showSet;
1557
+ this.showMsg = false;
1328
1558
  break;
1329
1559
  case 'home':
1330
- if (this.homePage.id !== this.activeName) {
1331
- let i = util.indexOfObj(this.tabs, this.homePage.id, 'id');
1332
- if (i == -1) {
1333
- this.tabs.unshift(this.homePage);
1560
+ let i = util.indexOfObj(this.tabs, this.homePage.id, 'id');
1561
+ if (i == -1) {
1562
+ this.tabs.unshift(this.homePage);
1563
+ } else {
1564
+ let tab = this.tabs[i];
1565
+ if (tab.method === 'iframe') {
1566
+ this.$set(this.tabs[i], 'url', util.handlerUrl(tab.url));
1567
+ } else {
1568
+ this.$set(this.tabs[i], 'refresh', false);
1569
+ this.$nextTick(() => {
1570
+ this.$set(this.tabs[i], 'refresh', true);
1571
+ });
1334
1572
  }
1335
- this.activeName = this.homePage.id;
1336
1573
  }
1574
+ this.activeName = this.homePage.id;
1575
+ this.showMsg = false;
1576
+ this.showSet = false;
1337
1577
  break;
1338
1578
  case 'search':
1339
1579
  this.handlerSetDrawer(res);
1580
+ this.showMsg = false;
1581
+ this.showSet = false;
1340
1582
  break;
1341
1583
  case 'goView':
1342
1584
  util.win.open(res.path, '_blank');
@@ -1469,135 +1711,47 @@ export default {
1469
1711
  clearTimeout(this.sysMsgOut);
1470
1712
  }
1471
1713
  },
1472
- handleReLogin(res) {
1473
- if (res && typeof res == 'string') {
1474
- res = JSON.parse(res);
1475
- }
1476
- let msg = '提示';
1477
- let btn = {
1478
- confirmButtonText: '确定',
1479
- cancelButtonText: '取消',
1480
- closeOnClickModal: false,
1481
- type: 'warning'
1482
- };
1483
- if (res) {
1484
- if (res.rCode === 69) {
1485
- msg = '该账号在其他地方已登陆!';
1486
- btn = {
1487
- confirmButtonText: '确定',
1488
- closeOnClickModal: false,
1489
- type: 'warning'
1490
- };
1491
- } else {
1492
- msg = '登录已过期,请重新登录!';
1493
- }
1494
- }
1495
- cl;
1496
- let remind = sessionStorage.getItem('remind');
1497
- if (!remind) {
1498
- clearTimeout(this.timer);
1499
- this.timer = setTimeout(() => {
1500
- sessionStorage.setItem('remind', 1);
1501
- this.$confirm(msg, btn)
1502
- .then(() => {
1503
- util.removeStorage([
1504
- 'Authorization',
1505
- 'token',
1506
- 'ssId',
1507
- 'userId',
1508
- 'userName',
1509
- 'auth',
1510
- 'deviceUnique',
1511
- 'menus',
1512
- 'useCaseCodes',
1513
- 'mainConfig',
1514
- 'jump'
1515
- ]);
1516
- const loginPage =
1517
- util.getStorage('login') || util.getStorage('loginPage');
1518
- try {
1519
- if (loginPage) {
1520
- let src;
1521
- if (!util.startWith(loginPage, ['http', '/'], true)) {
1522
- let pathname = util.win.top.location.pathname;
1523
- if (pathname !== '/') {
1524
- pathname = pathname.split('/');
1525
- pathname.splice(pathname.length - 1);
1526
- pathname = pathname.join('/');
1527
- src = pathname + '/' + loginPage.replace('./', '');
1528
- } else {
1529
- src = pathname + loginPage.replace('./', '');
1530
- }
1531
- } else {
1532
- src = loginPage;
1533
- }
1534
- util.win.top.location.href = src;
1535
- } else if (
1536
- util.win.top.location.href.indexOf('main.html') > -1
1537
- ) {
1538
- util.win.top.location.href = './login.html';
1539
- } else {
1540
- const hash = util.win.top.location.hash;
1541
- if (hash) {
1542
- const len = util.win.top.location.href.indexOf(hash);
1543
- util.win.top.location.href =
1544
- util.win.location.href.slice(0, len) + '#/login';
1545
- } else {
1546
- util.win.top.location.href = '/login.html';
1547
- }
1548
- }
1549
- } catch (error) {
1550
- util.win.postMessage({ type: 1 }, '*');
1551
- }
1552
- })
1553
- .catch((e) => {
1554
- sessionStorage.removeItem('remind');
1555
- });
1556
- }, 2000);
1557
- }
1558
- },
1559
- openPage(url, name, width, height) {
1560
- let src = url;
1561
- if (!util.startWith(url, ['http', '/'], true)) {
1562
- let pathname = window.location.pathname;
1563
- if (pathname !== '/') {
1564
- pathname = pathname.split('/');
1565
- pathname.splice(pathname.length - 1);
1566
- pathname = pathname.join('/');
1567
- }
1568
- src = pathname + url.replace('./', '/');
1569
- }
1570
- if (name) {
1571
- let w = 0;
1572
- let h = 0;
1573
- try {
1574
- w = width ? width : util.win.top.screen.availWidth - 10;
1575
- h = height ? height : util.win.top.screen.availHeight - 60;
1576
- } catch (error) {
1577
- w = width ? width : util.win.screen.availWidth - 10;
1578
- h = height ? height : util.win.screen.availHeight - 60;
1579
- }
1580
- return util.win.open(
1581
- src,
1582
- name,
1583
- `width=${w}px,height=${h}px,resizable=yes,status=yes,menubar=no,scrollbars=yes`
1584
- );
1585
- } else {
1586
- return util.win.open(src);
1587
- }
1588
- },
1589
1714
  jumpMenu(res) {
1590
- let apps = res.split(',');
1715
+ let apps = res;
1716
+ if (typeof res === 'string') {
1717
+ apps = res.split(',');
1718
+ }
1591
1719
  let obj = this.getMenu(this.menus, apps[apps.length - 1]);
1592
1720
  if (obj) {
1593
1721
  let i = util.indexOfObj(this.tabs, obj, 'id');
1722
+ let n = util.indexOfObj(this.tabs, this.activeName, 'id');
1723
+ this.activeName = obj.id;
1594
1724
  if (i == -1) {
1595
- this.tabs.push(this.setIframeType(obj));
1725
+ let tab = this.setIframeType(obj);
1726
+ this.tabs.splice(n + 1, 0, tab);
1727
+ } else {
1728
+ let tab = this.tabs[i];
1729
+ if (tab.method === 'iframe') {
1730
+ this.$set(this.tabs[i], 'url', util.handlerUrl(tab.url));
1731
+ } else {
1732
+ this.$set(this.tabs[i], 'refresh', false);
1733
+ this.$nextTick(() => {
1734
+ this.$set(this.tabs[i], 'refresh', true);
1735
+ });
1736
+ }
1596
1737
  }
1597
- this.activeName = obj.id;
1598
1738
  } else {
1599
1739
  this.$message.error('没有此菜单!');
1600
1740
  }
1741
+ },
1742
+ //监听改变菜单
1743
+ handleListener() {
1744
+ util.win.addEventListener(
1745
+ 'message',
1746
+ (e) => {
1747
+ var msg = e.data;
1748
+ if (msg.key == 'jump_Menu') {
1749
+ let res = msg.data1;
1750
+ this.jumpMenu(res);
1751
+ }
1752
+ },
1753
+ false
1754
+ );
1601
1755
  }
1602
1756
  },
1603
1757
  beforeDestroy() {