eoss-ui 0.5.81-beta2 → 0.5.81-beta21

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 (131) 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 +471 -256
  8. package/lib/date-picker.js +49 -45
  9. package/lib/dialog.js +71 -70
  10. package/lib/eoss-ui.common.js +4165 -2449
  11. package/lib/flow-group.js +98 -63
  12. package/lib/flow-list.js +50 -46
  13. package/lib/flow.js +152 -83
  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 +2677 -1479
  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 +117 -65
  35. package/lib/selector.js +493 -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 +86 -79
  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/tabs.css +1 -1
  54. package/lib/theme-chalk/toolbar.css +1 -1
  55. package/lib/theme-chalk/tree.css +1 -1
  56. package/lib/theme-chalk/upload.css +1 -1
  57. package/lib/tips.js +49 -45
  58. package/lib/tree-group.js +49 -45
  59. package/lib/tree.js +49 -45
  60. package/lib/upload.js +59 -55
  61. package/lib/wujie.js +49 -45
  62. package/lib/wxlogin.js +49 -45
  63. package/package.json +3 -3
  64. package/packages/button/src/main.vue +2 -1
  65. package/packages/button-group/src/main.vue +8 -6
  66. package/packages/clients/src/main.vue +2 -1
  67. package/packages/data-table/src/column.vue +132 -53
  68. package/packages/data-table/src/formItem.vue +430 -0
  69. package/packages/data-table/src/main.vue +85 -45
  70. package/packages/data-table/src/sizer.vue +2 -0
  71. package/packages/dialog/src/main.vue +17 -23
  72. package/packages/flow/src/main.vue +32 -17
  73. package/packages/flow-group/src/main.vue +18 -11
  74. package/packages/form/src/main.vue +45 -10
  75. package/packages/handle-user/src/main.vue +10 -3
  76. package/packages/handler/src/main.vue +5 -3
  77. package/packages/login/src/main.vue +13 -6
  78. package/packages/main/src/default/index.vue +102 -179
  79. package/packages/main/src/main.vue +243 -16
  80. package/packages/main/src/public/online.vue +90 -0
  81. package/packages/main/src/simplicity/apps.vue +176 -145
  82. package/packages/main/src/simplicity/avatar.vue +16 -6
  83. package/packages/main/src/simplicity/handler.vue +6 -2
  84. package/packages/main/src/simplicity/index.vue +555 -344
  85. package/packages/main/src/simplicity/menu-list.vue +75 -24
  86. package/packages/main/src/simplicity/message.vue +35 -25
  87. package/packages/main/src/simplicity/notice.vue +72 -39
  88. package/packages/main/src/simplicity/router-page.vue +44 -0
  89. package/packages/main/src/simplicity/settings.vue +1 -1
  90. package/packages/main/src/simplicity/sub-menu.vue +169 -54
  91. package/packages/main/src/simplicity/user.vue +10 -5
  92. package/packages/main/src/simplicity/userinfo.vue +1 -0
  93. package/packages/menu/src/main.vue +4 -3
  94. package/packages/pagination/src/main.vue +20 -1
  95. package/packages/select/src/main.vue +4 -1
  96. package/packages/selector/src/main.vue +152 -136
  97. package/packages/selector-panel/src/main.vue +23 -9
  98. package/packages/selector-panel/src/selection.vue +8 -2
  99. package/packages/tabs/src/main.vue +14 -14
  100. package/packages/theme-chalk/lib/base.css +1 -1
  101. package/packages/theme-chalk/lib/button-group.css +1 -1
  102. package/packages/theme-chalk/lib/data-table.css +1 -1
  103. package/packages/theme-chalk/lib/handler.css +1 -1
  104. package/packages/theme-chalk/lib/index.css +1 -1
  105. package/packages/theme-chalk/lib/main.css +1 -1
  106. package/packages/theme-chalk/lib/menu.css +1 -1
  107. package/packages/theme-chalk/lib/nav.css +1 -1
  108. package/packages/theme-chalk/lib/pagination.css +1 -1
  109. package/packages/theme-chalk/lib/selector-panel.css +1 -1
  110. package/packages/theme-chalk/lib/simplicity.css +1 -1
  111. package/packages/theme-chalk/lib/sizer.css +1 -1
  112. package/packages/theme-chalk/lib/tabs.css +1 -1
  113. package/packages/theme-chalk/lib/toolbar.css +1 -1
  114. package/packages/theme-chalk/lib/tree.css +1 -1
  115. package/packages/theme-chalk/lib/upload.css +1 -1
  116. package/packages/theme-chalk/src/base.scss +5 -0
  117. package/packages/theme-chalk/src/button-group.scss +18 -4
  118. package/packages/theme-chalk/src/common/var.scss +9 -2
  119. package/packages/theme-chalk/src/data-table.scss +60 -23
  120. package/packages/theme-chalk/src/handler.scss +5 -1
  121. package/packages/theme-chalk/src/login.scss +2 -2
  122. package/packages/theme-chalk/src/nav.scss +3 -2
  123. package/packages/theme-chalk/src/pagination.scss +7 -0
  124. package/packages/theme-chalk/src/selector-panel.scss +2 -1
  125. package/packages/theme-chalk/src/simplicity.scss +355 -58
  126. package/packages/theme-chalk/src/tabs.scss +24 -28
  127. package/packages/theme-chalk/src/toolbar.scss +16 -4
  128. package/packages/theme-chalk/src/tree.scss +4 -2
  129. package/packages/upload/src/main.vue +3 -1
  130. package/src/config/api.js +3 -1
  131. 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,39 +209,51 @@
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"
216
232
  :label="item.text || item.name"
217
233
  :name="item.id"
218
234
  >
219
- <template
235
+ <iframe
220
236
  v-if="(isIE && item.method !== 'router') || item.method == 'iframe'"
221
- >
222
- <iframe
223
- :id="iframeId"
224
- :name="iframeId"
225
- frameborder="0"
226
- width="100%"
227
- height="100%"
228
- :src="item.url"
229
- ></iframe>
230
- </template>
231
- <template v-else-if="item.method === 'wujie' && item.refresh">
232
- <es-wujie
233
- :show="true"
234
- :props="wjProps"
235
- :attrs="wjAttrs"
236
- :name="item.appCode"
237
- :url="item.url"
238
- ></es-wujie>
239
- </template>
240
- <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>
245
- </template>
237
+ :id="activeName == item.id ? iframeId : ''"
238
+ :name="activeName == item.id ? iframeId : ''"
239
+ frameborder="0"
240
+ width="100%"
241
+ height="100%"
242
+ :src="item.url"
243
+ ></iframe>
244
+ <es-wujie
245
+ v-else-if="item.method === 'wujie' && item.refresh"
246
+ :show="true"
247
+ :props="wjProps"
248
+ :attrs="wjAttrs"
249
+ :name="item.appCode"
250
+ :url="item.url"
251
+ ></es-wujie>
252
+ <router-page
253
+ v-else-if="item.method === 'router' && item.refresh"
254
+ v-bind="item"
255
+ :query="$parent.params"
256
+ ></router-page>
246
257
  </el-tab-pane>
247
258
  </el-tabs>
248
259
  <!-- 路由、iframe end -->
@@ -275,8 +286,11 @@
275
286
 
276
287
  <!-- 公用弹窗 -->
277
288
  <es-dialog :title="dialog.title" :visible.sync="dialog.show" size="md">
289
+ <template v-if="dialog.title == '查看在线人员' && !dialog.src">
290
+ <online></online>
291
+ </template>
278
292
  <iframe
279
- v-if="dialog.show"
293
+ v-else-if="dialog.show"
280
294
  width="100%"
281
295
  height="100%"
282
296
  frameborder="0"
@@ -297,25 +311,30 @@ import user from './user.vue';
297
311
  import message from './message.vue';
298
312
  import notice from './notice.vue';
299
313
  import settings from './settings.vue';
314
+ import routerPage from './router-page.vue';
315
+ import online from '../public/online.vue';
300
316
  import {
301
317
  wss,
318
+ logout,
302
319
  topic,
303
320
  getUserAppWithTag,
321
+ recordUserApp,
304
322
  getComplexApplications,
305
323
  getComplexApplicationsNew
306
324
  } from 'eoss-ui/src/config/api.js';
307
325
  import store from 'eoss-ui/src/utils/store';
308
326
  import util from 'eoss-ui/src/utils/util';
309
327
  const isIE = navigator.userAgent.indexOf('MSIE') != -1;
328
+ const dataTableMode = util.win.dataTableMode || 'default';
310
329
  let events = [
311
- (tabs, index) => {
330
+ (tabs, index, that) => {
312
331
  let tab = tabs[index];
313
332
 
314
333
  if (tab.method == 'iframe') {
315
334
  tabs[index].url = util.handlerUrl(tab.url);
316
335
  } else {
317
336
  tabs[index].refresh = false;
318
- this.$nextTick(() => {
337
+ that.$nextTick(() => {
319
338
  tabs[index].refresh = true;
320
339
  });
321
340
  }
@@ -358,7 +377,14 @@ let events = [
358
377
  }
359
378
  ];
360
379
  export default {
361
- name: 'EsMainSimplicity',
380
+ name: 'Simplicity',
381
+ provide() {
382
+ return {
383
+ esMain: this,
384
+ refresh: this.handleRefresh,
385
+ jumpMenu: this.jumpMenu
386
+ };
387
+ },
362
388
  components: {
363
389
  avatar,
364
390
  handler,
@@ -367,9 +393,21 @@ export default {
367
393
  user,
368
394
  message,
369
395
  notice,
370
- settings
396
+ settings,
397
+ routerPage,
398
+ online
371
399
  },
372
400
  props: {
401
+ //模式
402
+ mode: {
403
+ type: String,
404
+ default: dataTableMode
405
+ },
406
+ //记录菜单点击率作为工作台常用应用数据
407
+ recordApp: {
408
+ type: Boolean,
409
+ default: true
410
+ },
373
411
  appCode: String,
374
412
  //logo
375
413
  logo: String,
@@ -448,7 +486,14 @@ export default {
448
486
  //无界微前端Props属性
449
487
  wjProps: Object,
450
488
  //无界微前端Attrs属性
451
- wjAttrs: Object
489
+ wjAttrs: Object,
490
+ //菜单宽度
491
+ menuWidth: {
492
+ type: Number,
493
+ default: 220
494
+ },
495
+ //路由方式
496
+ routeType: String
452
497
  },
453
498
  data() {
454
499
  return {
@@ -460,14 +505,20 @@ export default {
460
505
  mainLogo: this.logo,
461
506
  //侧边用户应用
462
507
  userApps: [],
508
+ //点击应用存侧边
509
+ newApps: [],
463
510
  //所有菜单
464
511
  menus: [],
512
+ //菜单名称
513
+ title: '',
465
514
  //子菜单
466
- subMenus: [],
515
+ subMenus: null,
467
516
  //展示菜单导航
468
517
  showMenu: false,
469
- //展示菜单导航宽度
470
- width: '296px',
518
+ //子菜单选中
519
+ subActive: '',
520
+ //折叠菜单
521
+ fold: false,
471
522
  //人工智能配置
472
523
  aiConfig: null,
473
524
  //公用窗口面板配置
@@ -526,7 +577,9 @@ export default {
526
577
  //页签对象
527
578
  pane: null,
528
579
  //选中菜单
529
- active: ''
580
+ active: '',
581
+ //单位名称
582
+ simpleUserInfo: {}
530
583
  };
531
584
  },
532
585
  computed: {
@@ -566,9 +619,7 @@ export default {
566
619
  //在线人数列表地址
567
620
  onlineUrl() {
568
621
  if (this.onlineView) {
569
- return typeof this.onlineView == 'string'
570
- ? this.onlineView
571
- : '/main/sysuseronline/list.dhtml';
622
+ return typeof this.onlineView == 'string' ? this.onlineView : '';
572
623
  }
573
624
  return false;
574
625
  }
@@ -589,15 +640,14 @@ export default {
589
640
  let mainConfig = util.getStorage('mainConfig');
590
641
  if (mainConfig) {
591
642
  const results = JSON.parse(mainConfig);
592
- this.init(results);
643
+ if (Object.keys(results).length) {
644
+ this.init(results);
645
+ }
593
646
  }
594
647
  this.doorIndex = sessionStorage.getItem('doorIndex');
595
648
  },
596
649
  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;
650
+ this.handleListener();
601
651
  },
602
652
  methods: {
603
653
  /**
@@ -605,13 +655,13 @@ export default {
605
655
  * @author huangbo
606
656
  * @date 2024年9月7日
607
657
  **/
608
- hasRouter(res, url, code, parentName) {
658
+ hasRouter(res, url, code) {
609
659
  if (!url) {
610
660
  return false;
611
661
  }
612
662
  if (Array.isArray(res)) {
613
663
  for (let i in res) {
614
- let path = this.hasRouter(res[i], url, code, parentName);
664
+ let path = this.hasRouter(res[i], url, code);
615
665
  if (path) {
616
666
  return path;
617
667
  }
@@ -624,20 +674,20 @@ export default {
624
674
  let pathname = url.substring(url.indexOf('#/') + 1);
625
675
  pathname = pathname.split('?')[0];
626
676
  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);
677
+ if (res.components) {
678
+ if (!res.components[code]) {
679
+ console.error('“命名视图”规范属性名称与菜单appCode不一致', res);
635
680
  }
681
+ } else {
682
+ console.error(
683
+ '请根据“命名视图”规范,正确添加components属性名称',
684
+ res
685
+ );
636
686
  }
637
687
  return pathname;
638
688
  }
639
689
  if (res && Object.prototype.hasOwnProperty.call(res, 'children')) {
640
- let path = this.hasRouter(res.children, url, code, parentName);
690
+ let path = this.hasRouter(res.children, url, code);
641
691
  if (path) {
642
692
  return path;
643
693
  }
@@ -654,7 +704,6 @@ export default {
654
704
  this.setConfig(results);
655
705
  if (this.remote) {
656
706
  this.getApplications();
657
- this.getMenus();
658
707
  }
659
708
  },
660
709
  /**
@@ -774,6 +823,7 @@ export default {
774
823
  * @date 2024年9月7日
775
824
  **/
776
825
  getApplications() {
826
+ let loading = util.loading('', '加载中...');
777
827
  util
778
828
  .ajax({
779
829
  url: this.appsUrl,
@@ -797,57 +847,173 @@ export default {
797
847
  } else {
798
848
  this.$message.error('未分配应用菜单权限,请联系管理员!');
799
849
  }
850
+ this.getMenus(loading);
800
851
  } else {
852
+ loading.close();
801
853
  let msg = res.msg || '系统错误,请联系管理员!';
802
854
  this.$message.error(msg);
803
855
  }
804
856
  })
805
857
  .catch((err) => {
858
+ loading.close();
806
859
  if (err.message && err.message !== 'canceled') {
807
860
  this.$message.error(err.message);
808
861
  }
809
862
  });
810
863
  },
864
+ /**
865
+ * @desc 获取菜单层级id
866
+ * @param {Array} [menus] - 系统菜单数据对象
867
+ * @param {String} [url] - 菜单id或url地址
868
+ */
869
+ getId(menus, code) {
870
+ if (!code) {
871
+ return false;
872
+ }
873
+ for (let i = 0; i < menus.length; i++) {
874
+ let item = menus[i];
875
+ if (item.appCode === code) {
876
+ return item.id;
877
+ } else if (
878
+ Object.prototype.hasOwnProperty.call(item, 'children') &&
879
+ item.children.length
880
+ ) {
881
+ let id = this.getId(item.children, code);
882
+ if (id) {
883
+ if (item.pid === 'root' || Array.isArray(id)) {
884
+ return [item.id].concat(id);
885
+ } else if (typeof id === 'string') {
886
+ return [item.id, id];
887
+ }
888
+ return id;
889
+ }
890
+ } else if (
891
+ Object.prototype.hasOwnProperty.call(item, 'fourthTabs') &&
892
+ item.fourthTabs.length
893
+ ) {
894
+ let id = this.getId(item.fourthTabs, code);
895
+ if (id) {
896
+ if (item.pid === 'root' || Array.isArray(id)) {
897
+ return [item.id].concat(id);
898
+ } else if (typeof id === 'string') {
899
+ return [item.id, id];
900
+ }
901
+ return id;
902
+ }
903
+ }
904
+ }
905
+ return false;
906
+ },
811
907
  /**
812
908
  * @desc:获取菜单列表
813
909
  * @author huangbo
814
910
  * @date 2024年9月7日
815
911
  **/
816
- getMenus(appCode, url) {
817
- let params = appCode ? { menuCode: appCode } : {};
912
+ getMenus(loading) {
818
913
  util
819
- .ajax({ url: url || this._menuUrl, params: params })
914
+ .ajax({ url: this._menuUrl })
820
915
  .then((res) => {
916
+ loading.close();
821
917
  if (res.rCode === 0) {
822
918
  if (res.results && res.results.length) {
823
919
  this.menus = res.results;
824
920
  this.setTips(this.menus);
825
921
  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;
922
+ if (this.appCode) {
923
+ let app = this.userApps.filter((item) => {
924
+ return item.code === this.appCode;
925
+ })[0];
926
+ if (app) {
927
+ this.active = app.id;
928
+ if (app.url) {
929
+ let obj = this.getMenu(this.menus, app.url);
930
+ if (obj) {
931
+ let tab = this.setIframeType(obj);
932
+ this.tabs = [tab];
933
+ this.activeName = tab.id;
934
+ } else {
935
+ this.tabs = [app];
936
+ }
937
+ }
938
+ }
939
+ let ids = this.getId(this.menus, this.appCode);
940
+ let subMenus;
941
+ if (ids && Array.isArray(ids) && ids.length > 1) {
942
+ subMenus = this.getMenu(this.menus, ids[0], 'id');
943
+ if (subMenus) {
944
+ let obj = this.getMenu(
945
+ this.menus,
946
+ ids[ids.length - 1],
947
+ 'id'
948
+ );
949
+ if (obj) {
950
+ this.subActive = obj.id;
951
+ let tab = this.setIframeType(obj);
952
+ this.tabs = [tab];
953
+ this.activeName = tab.id;
954
+ } else {
955
+ this.subActive = '';
956
+ }
957
+ }
958
+ } else {
959
+ subMenus = this.getMenu(this.menus, this.appCode, 'appCode');
960
+ if (subMenus) {
961
+ if (this.tabs.length == 0) {
962
+ let obj = this.getFirst(subMenus);
963
+ if (obj) {
964
+ this.subActive = obj.id;
965
+ let tab = this.setIframeType(obj);
966
+ this.tabs = [tab];
967
+ this.activeName = tab.id;
968
+ } else {
969
+ this.subActive = '';
970
+ }
971
+ }
972
+ }
973
+ }
974
+ if (subMenus) {
975
+ this.subMenus = subMenus;
976
+ this.showMenu = true;
832
977
  } 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';
978
+ this.subMenus = null;
979
+ this.showMenu = false;
841
980
  }
842
- }
843
- if (this.initApps && this.initApps.length) {
844
- let obj = this.getMenu(
845
- this.menus,
846
- this.initApps[this.initApps.length - 1]
847
- );
848
- if (obj) {
849
- this.tabs.push(this.setIframeType(obj));
850
- this.activeName = obj.id;
981
+ } else {
982
+ if (this.indexUrl) {
983
+ let obj = this.getMenu(this.menus, this.indexUrl);
984
+ if (obj) {
985
+ if (!this.appCode) {
986
+ let tab = this.setIframeType(obj);
987
+ this.tabs = [tab];
988
+ this.activeName = tab.id;
989
+ }
990
+ this.homePage = obj;
991
+ } else {
992
+ this.homePage = this.setIframeType({
993
+ url: this.indexUrl,
994
+ text: '工作台',
995
+ id: '0',
996
+ appCode: 'indexUrl'
997
+ });
998
+ if (!this.appCode) {
999
+ this.tabs = [this.homePage];
1000
+ this.activeName = '0';
1001
+ }
1002
+ }
1003
+ } else if (
1004
+ this.initApps &&
1005
+ this.initApps.length &&
1006
+ !this.appCode
1007
+ ) {
1008
+ let obj = this.getMenu(
1009
+ this.menus,
1010
+ this.initApps[this.initApps.length - 1]
1011
+ );
1012
+ if (obj) {
1013
+ let tab = this.setIframeType(obj);
1014
+ this.tabs.push(tab);
1015
+ this.activeName = tab.id;
1016
+ }
851
1017
  }
852
1018
  }
853
1019
  } else {
@@ -859,19 +1025,25 @@ export default {
859
1025
  }
860
1026
  })
861
1027
  .catch((err) => {
1028
+ loading.close();
862
1029
  if (err.message && err.message !== 'canceled') {
863
1030
  this.$message.error(err.message);
864
1031
  }
865
1032
  });
866
1033
  },
1034
+ /**
1035
+ * @desc:设置页面加载类型
1036
+ * @author huangbo
1037
+ * @date 2024年9月7日
1038
+ **/
867
1039
  setIframeType(res) {
868
1040
  let { url } = res;
1041
+ if (url) {
1042
+ res.refresh = false;
1043
+ }
869
1044
  let urls = url.split('?');
870
1045
  if (urls[0].indexOf('.js') > 1 && !isIE) {
871
1046
  res.method = 'wujie';
872
- this.$nextTick(() => {
873
- res.refresh = true;
874
- });
875
1047
  } else if (
876
1048
  urls[0].indexOf('.dhtml') > 0 ||
877
1049
  (urls[0].indexOf('.html') > 0 && urls[0].indexOf('.html#') === -1)
@@ -884,15 +1056,9 @@ export default {
884
1056
  const routes = this.$router.options.routes;
885
1057
  if (routes) {
886
1058
  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
- });
1059
+ if (path && this.routeType !== 'wujie') {
1060
+ res.method = 'router';
1061
+ res.path = path;
896
1062
  } else {
897
1063
  let urlopenmode = util.getParams({
898
1064
  url: url,
@@ -907,9 +1073,6 @@ export default {
907
1073
  res.method = 'iframe';
908
1074
  } else {
909
1075
  res.method = 'wujie';
910
- this.$nextTick(() => {
911
- res.refresh = true;
912
- });
913
1076
  }
914
1077
  }
915
1078
  } else if (
@@ -917,14 +1080,14 @@ export default {
917
1080
  urls[0].indexOf('/#/') > -1
918
1081
  ) {
919
1082
  res.method = 'wujie';
920
- this.$nextTick(() => {
921
- res.refresh = true;
922
- });
923
1083
  } else {
924
1084
  res.method = 'iframe';
925
1085
  }
926
1086
  }
927
1087
  }
1088
+ if (Object.prototype.hasOwnProperty.call(res, 'refresh')) {
1089
+ res.refresh = true;
1090
+ }
928
1091
  return res;
929
1092
  },
930
1093
  /**
@@ -964,6 +1127,37 @@ export default {
964
1127
  }
965
1128
  return false;
966
1129
  },
1130
+ /**
1131
+ * @desc:获取菜单第一条数据
1132
+ * @author huangbo
1133
+ * @date 2024年9月7日
1134
+ **/
1135
+ getFirst(obj) {
1136
+ if (!obj) {
1137
+ return '';
1138
+ }
1139
+ let openIdex = 0;
1140
+ if (
1141
+ obj.extendData &&
1142
+ (obj.extendData.subDefOpenIndex || obj.extendData.subDefOpen)
1143
+ ) {
1144
+ openIdex = parseInt(
1145
+ obj.extendData.subDefOpenIndex || obj.extendData.subDefOpen,
1146
+ 10
1147
+ );
1148
+ }
1149
+ if (obj.children && obj.children.length && obj.children[openIdex]) {
1150
+ return this.getFirst(obj.children[openIdex]);
1151
+ } else if (
1152
+ obj.fourthTabs &&
1153
+ obj.fourthTabs.length &&
1154
+ obj.fourthTabs[openIdex]
1155
+ ) {
1156
+ return this.getFirst(obj.fourthTabs[openIdex]);
1157
+ } else if (obj.url) {
1158
+ return obj;
1159
+ }
1160
+ },
967
1161
  /**
968
1162
  * @desc:遍历设置菜单气泡提醒
969
1163
  * @author huangbo
@@ -983,31 +1177,30 @@ export default {
983
1177
  this.$set(obj, 'tips', false);
984
1178
  delete obj.tips;
985
1179
  }
986
- let flag = false;
1180
+ let flag = 0;
987
1181
  if (obj.children && obj.children.length) {
988
1182
  obj.children.forEach((item) => {
989
- if (this.setTips(item)) {
990
- flag = true;
991
- }
1183
+ let n = this.setTips(item);
1184
+ flag += n ? parseInt(n) : 0;
992
1185
  });
993
1186
  if (flag) {
994
- this.$set(obj, 'tips', true);
995
- return true;
1187
+ this.$set(obj, 'tips', flag);
1188
+ return flag;
996
1189
  }
997
1190
  } else if (obj.fourthTabs && obj.fourthTabs.length) {
998
1191
  obj.fourthTabs.forEach((item) => {
999
- if (this.setTips(item)) {
1000
- flag = true;
1001
- }
1192
+ let n = this.setTips(item);
1193
+ flag += n ? parseInt(n) : 0;
1002
1194
  });
1003
1195
  if (flag) {
1004
- this.$set(obj, 'tips', true);
1005
- return true;
1196
+ this.$set(obj, 'tips', flag);
1197
+ return flag;
1006
1198
  }
1007
1199
  } 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;
1200
+ let num = this.menuTips[obj.id] || this.menuTips[obj.code];
1201
+ if (num && Number(num)) {
1202
+ this.$set(obj, 'tips', Number(num));
1203
+ return this.menuTips[obj.id];
1011
1204
  }
1012
1205
  }
1013
1206
  }
@@ -1078,12 +1271,38 @@ export default {
1078
1271
  }
1079
1272
  });
1080
1273
  },
1274
+ /**
1275
+ * @desc:删除更多应用菜单点击
1276
+ * @author huangbo
1277
+ * @date 2024年9月7日
1278
+ **/
1279
+ handleDelete(index) {
1280
+ this.newApps.splice(index, 1);
1281
+ },
1282
+ /**
1283
+ * @desc:储存更多应用菜单点击
1284
+ * @author huangbo
1285
+ * @date 2024年9月7日
1286
+ **/
1287
+ handlerClickApps(res) {
1288
+ if (res.permission === false) {
1289
+ return false;
1290
+ }
1291
+ let i = util.indexOfObj(this.newApps, res, 'id');
1292
+ if (i == -1) {
1293
+ this.newApps.push(res);
1294
+ }
1295
+ this.handlerClickApp(res);
1296
+ },
1081
1297
  /**
1082
1298
  * @desc:侧边应用菜单点击
1083
1299
  * @author huangbo
1084
1300
  * @date 2024年9月7日
1085
1301
  **/
1086
1302
  handlerClickApp(res) {
1303
+ this.showMsg = false;
1304
+ this.showSet = false;
1305
+ this.fold = false;
1087
1306
  if (res) {
1088
1307
  if (res.permission === false) {
1089
1308
  return false;
@@ -1095,34 +1314,71 @@ export default {
1095
1314
  this.subMenus = res;
1096
1315
  this.showMenu = true;
1097
1316
  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
1317
  }
1318
+ let set = true;
1110
1319
  if (res.url) {
1111
1320
  if (res.urlopenmode == 1 || res.openModel == 1) {
1321
+ set = false;
1112
1322
  util.win.open(res.url);
1113
1323
  } else if (res.urlopenmode == 2 || res.openModel == 2) {
1114
- util.win.location.href = res.url;
1324
+ set = false;
1325
+ util.win.open(res.url, '_self');
1115
1326
  } else {
1116
1327
  let i = util.indexOfObj(this.tabs, res, 'id');
1117
1328
  this.activeName = res.id;
1118
1329
  if (i == -1) {
1119
- this.tabs.push(this.setIframeType(res));
1330
+ let obj = this.getMenu(this.menus, res.url);
1331
+ if (obj) {
1332
+ let n = util.indexOfObj(this.tabs, obj, 'id');
1333
+ if (n == -1) {
1334
+ let tab = this.setIframeType(obj);
1335
+ this.tabs.push(tab);
1336
+ this.activeName = tab.id;
1337
+ } else {
1338
+ if (obj.method == 'iframe') {
1339
+ obj.url = util.handlerUrl(obj.url);
1340
+ }
1341
+ }
1342
+ } else {
1343
+ let tab = this.setIframeType(res);
1344
+ this.tabs.push(tab);
1345
+ this.activeName = tab.id;
1346
+ }
1347
+ } else {
1348
+ if (res.method == 'iframe') {
1349
+ res.url = util.handlerUrl(res.url);
1350
+ }
1351
+ }
1352
+ }
1353
+ }
1354
+ if (set && res.code) {
1355
+ let subMenus = this.getMenu(this.menus, res.code, 'appCode');
1356
+ if (!subMenus && !res.url) {
1357
+ this.$alert('没有关联菜单,请联系管理员!', '提示', {
1358
+ confirmButtonText: '确定',
1359
+ type: 'warning'
1360
+ }).catch(() => {});
1361
+ } else {
1362
+ this.title = res.text || res.name;
1363
+ this.subMenus = subMenus ? subMenus : null;
1364
+ this.showMenu = subMenus !== false;
1365
+ this.showApps = false;
1366
+ if (subMenus && subMenus.url) {
1367
+ let i = util.indexOfObj(this.tabs, subMenus, 'id');
1368
+ this.activeName = subMenus.id;
1369
+ if (i == -1) {
1370
+ let tab = this.setIframeType(subMenus);
1371
+ this.tabs.push(tab);
1372
+ } else {
1373
+ if (subMenus.method == 'iframe') {
1374
+ subMenus.url = util.handlerUrl(subMenus.url);
1375
+ }
1376
+ }
1120
1377
  }
1121
1378
  }
1122
1379
  }
1123
1380
  this.active = res.id;
1124
1381
  } else {
1125
- this.showMenu = false;
1126
1382
  this.showApps = !this.showApps;
1127
1383
  }
1128
1384
  },
@@ -1153,17 +1409,51 @@ export default {
1153
1409
  * @date 2024年9月7日
1154
1410
  **/
1155
1411
  handlerClickMenu(res) {
1156
- if (typeof res === 'number') {
1157
- let num = 296;
1158
- this.width = num * res + 'px';
1159
- } else {
1160
- let i = util.indexOfObj(this.tabs, res, 'id');
1412
+ if (this.recordApp) {
1413
+ util
1414
+ .ajax({
1415
+ url: recordUserApp,
1416
+ params: {
1417
+ userId: this.user.userId,
1418
+ appId: res.id
1419
+ }
1420
+ })
1421
+ .then(() => {})
1422
+ .catch(() => {});
1423
+ }
1424
+ this.showMsg = false;
1425
+ this.showSet = false;
1426
+ let i = util.indexOfObj(this.tabs, res, 'id');
1427
+ if (i == -1) {
1428
+ let tab = this.setIframeType(res);
1429
+ this.tabs.push(tab);
1161
1430
  this.activeName = res.id;
1162
- if (i == -1) {
1163
- this.tabs.push(this.setIframeType(res));
1431
+ } else {
1432
+ let tab = this.tabs[i];
1433
+ if (tab.method === 'iframe') {
1434
+ this.activeName = res.id;
1435
+ this.$set(this.tabs[i], 'url', util.handlerUrl(tab.url));
1436
+ } else {
1437
+ this.$set(this.tabs[i], 'refresh', false);
1438
+ if (tab.method === 'wujie') {
1439
+ this.activeName = res.id;
1440
+ }
1441
+ this.$nextTick(() => {
1442
+ this.$set(this.tabs[i], 'refresh', true);
1443
+ this.activeName = res.id;
1444
+ });
1164
1445
  }
1165
1446
  }
1166
1447
  },
1448
+
1449
+ /**
1450
+ * @desc:用户详情请求成功
1451
+ * @author huangbo
1452
+ * @date 2024年9月7日
1453
+ **/
1454
+ handleSuccess(res) {
1455
+ this.simpleUserInfo = res.simpleUserInfo;
1456
+ },
1167
1457
  /**
1168
1458
  * @desc:修改用户配置
1169
1459
  * @author huangbo
@@ -1198,35 +1488,27 @@ export default {
1198
1488
  this.webSocket.destroy();
1199
1489
  }
1200
1490
  },
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
1491
  /**
1224
1492
  * @desc:刷新选中iframe页签
1225
1493
  * @author huangbo
1226
1494
  * @date 2024年9月7日
1227
1495
  **/
1228
1496
  handleRefresh() {
1229
- this.handleTab();
1497
+ let i = util.indexOfObj(this.tabs, this.activeName, 'id');
1498
+ let tab = this.tabs[i];
1499
+ if (tab.method === 'iframe') {
1500
+ tab.url = util.handlerUrl(tab.url);
1501
+ } else {
1502
+ let tab = this.tabs[i];
1503
+ if (tab.method === 'iframe') {
1504
+ this.$set(this.tabs[i], 'url', util.handlerUrl(tab.url));
1505
+ } else {
1506
+ this.$set(this.tabs[i], 'refresh', false);
1507
+ this.$nextTick(() => {
1508
+ this.$set(this.tabs[i], 'refresh', true);
1509
+ });
1510
+ }
1511
+ }
1230
1512
  },
1231
1513
  /**
1232
1514
  * @desc:删除iframe
@@ -1264,6 +1546,9 @@ export default {
1264
1546
  if (this.tabs.length == 1) {
1265
1547
  disabled.other = true;
1266
1548
  }
1549
+ if (this.tabs[index].id != this.activeName) {
1550
+ disabled.refresh = true;
1551
+ }
1267
1552
  this.isDisabled = disabled;
1268
1553
  this.$refs.tabsHandler.$el.style.setProperty('left', `${e.x}px`);
1269
1554
  this.$refs.tabsHandler.$el.style.setProperty('top', `${e.y}px`);
@@ -1305,38 +1590,52 @@ export default {
1305
1590
  } else if (open) {
1306
1591
  util.win.open(open);
1307
1592
  } else if (link) {
1308
- util.win.location.href = link;
1593
+ util.win.open(link, '_self');
1309
1594
  } else {
1310
1595
  switch (type) {
1311
1596
  case 'quit':
1312
1597
  this.handleQuit();
1313
1598
  break;
1314
1599
  case 'online':
1315
- if (this.onlineUrl) {
1316
- this.dialog = {
1317
- title: '查看在线人员',
1318
- show: true,
1319
- src: this.onlineUrl
1320
- };
1321
- }
1600
+ this.showMsg = false;
1601
+ this.showSet = false;
1602
+ this.dialog = {
1603
+ title: '查看在线人员',
1604
+ show: true,
1605
+ src: this.onlineUrl
1606
+ };
1322
1607
  break;
1323
1608
  case 'notice':
1324
1609
  this.showMsg = !this.showMsg;
1610
+ this.showSet = false;
1325
1611
  break;
1326
1612
  case 'set':
1327
1613
  this.showSet = !this.showSet;
1614
+ this.showMsg = false;
1328
1615
  break;
1329
1616
  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);
1617
+ let i = util.indexOfObj(this.tabs, this.homePage.id, 'id');
1618
+ if (i == -1) {
1619
+ this.tabs.unshift(this.homePage);
1620
+ } else {
1621
+ let tab = this.tabs[i];
1622
+ if (tab.method === 'iframe') {
1623
+ this.$set(this.tabs[i], 'url', util.handlerUrl(tab.url));
1624
+ } else {
1625
+ this.$set(this.tabs[i], 'refresh', false);
1626
+ this.$nextTick(() => {
1627
+ this.$set(this.tabs[i], 'refresh', true);
1628
+ });
1334
1629
  }
1335
- this.activeName = this.homePage.id;
1336
1630
  }
1631
+ this.activeName = this.homePage.id;
1632
+ this.showMsg = false;
1633
+ this.showSet = false;
1337
1634
  break;
1338
1635
  case 'search':
1339
1636
  this.handlerSetDrawer(res);
1637
+ this.showMsg = false;
1638
+ this.showSet = false;
1340
1639
  break;
1341
1640
  case 'goView':
1342
1641
  util.win.open(res.path, '_blank');
@@ -1469,135 +1768,47 @@ export default {
1469
1768
  clearTimeout(this.sysMsgOut);
1470
1769
  }
1471
1770
  },
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
1771
  jumpMenu(res) {
1590
- let apps = res.split(',');
1772
+ let apps = res;
1773
+ if (typeof res === 'string') {
1774
+ apps = res.split(',');
1775
+ }
1591
1776
  let obj = this.getMenu(this.menus, apps[apps.length - 1]);
1592
1777
  if (obj) {
1593
1778
  let i = util.indexOfObj(this.tabs, obj, 'id');
1779
+ let n = util.indexOfObj(this.tabs, this.activeName, 'id');
1780
+ this.activeName = obj.id;
1594
1781
  if (i == -1) {
1595
- this.tabs.push(this.setIframeType(obj));
1782
+ let tab = this.setIframeType(obj);
1783
+ this.tabs.splice(n + 1, 0, tab);
1784
+ } else {
1785
+ let tab = this.tabs[i];
1786
+ if (tab.method === 'iframe') {
1787
+ this.$set(this.tabs[i], 'url', util.handlerUrl(tab.url));
1788
+ } else {
1789
+ this.$set(this.tabs[i], 'refresh', false);
1790
+ this.$nextTick(() => {
1791
+ this.$set(this.tabs[i], 'refresh', true);
1792
+ });
1793
+ }
1596
1794
  }
1597
- this.activeName = obj.id;
1598
1795
  } else {
1599
1796
  this.$message.error('没有此菜单!');
1600
1797
  }
1798
+ },
1799
+ //监听改变菜单
1800
+ handleListener() {
1801
+ util.win.addEventListener(
1802
+ 'message',
1803
+ (e) => {
1804
+ var msg = e.data;
1805
+ if (msg.key == 'jump_Menu') {
1806
+ let res = msg.data1;
1807
+ this.jumpMenu(res);
1808
+ }
1809
+ },
1810
+ false
1811
+ );
1601
1812
  }
1602
1813
  },
1603
1814
  beforeDestroy() {