eoss-ui 0.5.81-beta1 → 0.5.81-beta10

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 (78) hide show
  1. package/lib/data-table.js +145 -124
  2. package/lib/eoss-ui.common.js +2085 -1113
  3. package/lib/form.js +40 -2
  4. package/lib/handle-user.js +16 -3
  5. package/lib/handler.js +9 -3
  6. package/lib/icon.js +14 -7
  7. package/lib/index.js +1 -1
  8. package/lib/login.js +8 -6
  9. package/lib/main.js +1752 -919
  10. package/lib/select.js +1 -1
  11. package/lib/selector-panel.js +65 -17
  12. package/lib/selector.js +8 -4
  13. package/lib/theme-chalk/base.css +1 -1
  14. package/lib/theme-chalk/button-group.css +1 -1
  15. package/lib/theme-chalk/data-table.css +1 -1
  16. package/lib/theme-chalk/form.css +1 -1
  17. package/lib/theme-chalk/handler.css +1 -1
  18. package/lib/theme-chalk/index.css +1 -1
  19. package/lib/theme-chalk/main.css +1 -1
  20. package/lib/theme-chalk/menu.css +1 -1
  21. package/lib/theme-chalk/nav.css +1 -1
  22. package/lib/theme-chalk/selector-panel.css +1 -1
  23. package/lib/theme-chalk/simplicity.css +1 -1
  24. package/lib/theme-chalk/sizer.css +1 -1
  25. package/lib/theme-chalk/tree.css +1 -1
  26. package/lib/theme-chalk/upload.css +1 -1
  27. package/lib/upload.js +6 -6
  28. package/package.json +2 -2
  29. package/packages/data-table/src/main.vue +53 -28
  30. package/packages/form/src/main.vue +38 -8
  31. package/packages/handle-user/src/main.vue +10 -3
  32. package/packages/handler/src/main.vue +2 -0
  33. package/packages/icon/src/main.vue +12 -5
  34. package/packages/login/src/main.vue +10 -4
  35. package/packages/main/src/default/index.vue +4 -3
  36. package/packages/main/src/main.vue +16 -12
  37. package/packages/main/src/simplicity/apps.vue +176 -145
  38. package/packages/main/src/simplicity/avatar.vue +16 -6
  39. package/packages/main/src/simplicity/index.vue +372 -179
  40. package/packages/main/src/simplicity/menu-list.vue +74 -24
  41. package/packages/main/src/simplicity/message.vue +35 -25
  42. package/packages/main/src/simplicity/notice.vue +72 -39
  43. package/packages/main/src/simplicity/router-page.vue +53 -0
  44. package/packages/main/src/simplicity/settings.vue +1 -1
  45. package/packages/main/src/simplicity/sub-menu.vue +159 -57
  46. package/packages/main/src/simplicity/user.vue +10 -5
  47. package/packages/main/src/simplicity/userinfo.vue +1 -0
  48. package/packages/select/src/main.vue +4 -1
  49. package/packages/selector/src/main.vue +6 -2
  50. package/packages/selector-panel/src/main.vue +22 -8
  51. package/packages/selector-panel/src/selection.vue +6 -0
  52. package/packages/theme-chalk/lib/base.css +1 -1
  53. package/packages/theme-chalk/lib/button-group.css +1 -1
  54. package/packages/theme-chalk/lib/data-table.css +1 -1
  55. package/packages/theme-chalk/lib/form.css +1 -1
  56. package/packages/theme-chalk/lib/handler.css +1 -1
  57. package/packages/theme-chalk/lib/index.css +1 -1
  58. package/packages/theme-chalk/lib/main.css +1 -1
  59. package/packages/theme-chalk/lib/menu.css +1 -1
  60. package/packages/theme-chalk/lib/nav.css +1 -1
  61. package/packages/theme-chalk/lib/selector-panel.css +1 -1
  62. package/packages/theme-chalk/lib/simplicity.css +1 -1
  63. package/packages/theme-chalk/lib/sizer.css +1 -1
  64. package/packages/theme-chalk/lib/tree.css +1 -1
  65. package/packages/theme-chalk/lib/upload.css +1 -1
  66. package/packages/theme-chalk/src/base.scss +5 -0
  67. package/packages/theme-chalk/src/button-group.scss +3 -3
  68. package/packages/theme-chalk/src/common/var.scss +6 -0
  69. package/packages/theme-chalk/src/data-table.scss +9 -9
  70. package/packages/theme-chalk/src/form.scss +2 -4
  71. package/packages/theme-chalk/src/handler.scss +5 -1
  72. package/packages/theme-chalk/src/login.scss +2 -2
  73. package/packages/theme-chalk/src/nav.scss +3 -2
  74. package/packages/theme-chalk/src/selector-panel.scss +2 -1
  75. package/packages/theme-chalk/src/simplicity.scss +340 -58
  76. package/packages/theme-chalk/src/tree.scss +4 -2
  77. package/packages/upload/src/main.vue +3 -1
  78. package/src/index.js +1 -1
@@ -1,30 +1,36 @@
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
26
31
  class="es-simplicity-side-app"
27
32
  v-for="item in userApps"
33
+ :class="{ 'is-active': active == item.id }"
28
34
  :key="item.id"
29
35
  :title="item.text || item.name"
30
36
  @click="handlerClickApp(item)"
@@ -50,6 +56,30 @@
50
56
  ></es-icon>
51
57
  <div class="es-simplicity-side-app-text">更多</div>
52
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
+ >
66
+ <i
67
+ class="el-icon-circle-close"
68
+ @click.stop="handleDelete(index)"
69
+ ></i>
70
+ <el-badge
71
+ v-bind="getBadge(item)"
72
+ @click.stop="handlerClickApp(item)"
73
+ >
74
+ <es-icon
75
+ class="es-simplicity-side-app-icon"
76
+ :contents="item.icons || item.icon || menuIcon"
77
+ ></es-icon>
78
+ <div class="es-simplicity-side-app-text">
79
+ {{ item.text || item.name }}
80
+ </div>
81
+ </el-badge>
82
+ </div>
53
83
  </el-scrollbar>
54
84
  <!-- 常用应用 end -->
55
85
  </div>
@@ -71,63 +101,47 @@
71
101
  </div>
72
102
  <div class="es-simplicity-main">
73
103
  <!-- 菜单 -->
74
- <el-drawer
75
- class="es-simplicity-subMenus"
76
- direction="ltr"
77
- modal-class="es-simplicity-apps-modal"
78
- :size="width"
79
- :modal-append-to-body="false"
80
- :with-header="false"
104
+ <sub-menu
81
105
  :visible.sync="showMenu"
82
- >
83
- <sub-menu
84
- ref="subMenus"
85
- :color="menuColor"
86
- :backgroundColor="menuBackgroundColor"
87
- :menu-icon="menuIcon"
88
- v-bind="subMenus"
89
- @command="handlerClickMenu"
90
- ></sub-menu>
91
- </el-drawer>
106
+ :closed.sync="fold"
107
+ :size="menuWidth"
108
+ :title="title"
109
+ :color="menuColor"
110
+ :backgroundColor="menuBackgroundColor"
111
+ :menu-icon="menuIcon"
112
+ :active="subActive"
113
+ v-bind="subMenus"
114
+ @command="handlerClickMenu"
115
+ ></sub-menu>
92
116
  <!-- 菜单 end -->
93
117
 
94
118
  <!-- 应用 -->
95
- <el-drawer
96
- class="es-simplicity-apps"
97
- direction="ltr"
98
- modal-class="es-simplicity-apps-modal"
99
- size="90%"
100
- :modal-append-to-body="false"
101
- :with-header="false"
119
+ <apps
102
120
  :visible.sync="showApps"
103
- >
104
- <apps
105
- :menu-icon="menuIcon"
106
- :color="appColor"
107
- :backgroundColor="appBackgroundColor"
108
- :applications="applications"
109
- :business="business"
110
- :systems="systems"
111
- @click="handlerClickApp"
112
- ></apps>
113
- </el-drawer>
121
+ :menu-icon="menuIcon"
122
+ :color="appColor"
123
+ :backgroundColor="appBackgroundColor"
124
+ :applications="applications"
125
+ :business="business"
126
+ :systems="systems"
127
+ @click="handlerClickApps"
128
+ ></apps>
114
129
  <!-- 应用 end -->
115
130
 
116
131
  <!-- AI -->
117
132
  <el-drawer
118
- class="es-simplicity-subMenus"
133
+ class="es-simplicity-public-drawer"
119
134
  direction="ltr"
120
135
  modal-class="es-simplicity-apps-modal"
121
136
  size="100%"
122
137
  show-close
123
138
  :modal-append-to-body="false"
124
- :with-header="false"
125
139
  :visible.sync="drawer.visible"
126
140
  >
127
- <i
141
+ <!-- <i
128
142
  class="es-icon-close es-simplicity-drawer-close"
129
143
  @click="handleCloseDrawer"
130
- ></i>
144
+ ></i> -->
131
145
  <template v-if="drawer.url">
132
146
  <template v-if="isIE || drawer.method !== 'wujie'">
133
147
  <iframe
@@ -155,7 +169,8 @@
155
169
  <el-card class="es-simplicity-tabs-handler" ref="tabsHandler">
156
170
  <div
157
171
  class="es-simplicity-tabs-handler-item"
158
- @click="handleTabsEvents(0)"
172
+ :class="{ 'is-disabled': isDisabled.refresh }"
173
+ @click="isDisabled.refresh ? '' : handleTabsEvents(0)"
159
174
  >
160
175
  刷新
161
176
  </div>
@@ -190,10 +205,11 @@
190
205
  </div>
191
206
  <el-tabs
192
207
  class="es-simplicity-iframe"
208
+ :class="{ 'is-open': showMenu, 'is-fold': fold }"
193
209
  v-model="activeName"
194
210
  closable
195
211
  hide-bar
196
- @tab-click="handleTab"
212
+ opacity
197
213
  @tab-remove="handleRemove"
198
214
  @tab-contextmenu="handleContextmenu"
199
215
  >
@@ -237,10 +253,11 @@
237
253
  ></es-wujie>
238
254
  </template>
239
255
  <template v-else-if="item.method === 'router' && item.refresh">
240
- <router-view v-if="!isKeepAlive" :name="item.appCode" />
241
- <keep-alive>
242
- <router-view v-if="isKeepAlive" :name="item.appCode" />
243
- </keep-alive>
256
+ <router-page
257
+ v-bind="item"
258
+ :show="activeName == item.id"
259
+ :query="$parent.params"
260
+ ></router-page>
244
261
  </template>
245
262
  </el-tab-pane>
246
263
  </el-tabs>
@@ -296,8 +313,10 @@ import user from './user.vue';
296
313
  import message from './message.vue';
297
314
  import notice from './notice.vue';
298
315
  import settings from './settings.vue';
316
+ import routerPage from './router-page.vue';
299
317
  import {
300
318
  wss,
319
+ logout,
301
320
  topic,
302
321
  getUserAppWithTag,
303
322
  getComplexApplications,
@@ -307,14 +326,14 @@ import store from 'eoss-ui/src/utils/store';
307
326
  import util from 'eoss-ui/src/utils/util';
308
327
  const isIE = navigator.userAgent.indexOf('MSIE') != -1;
309
328
  let events = [
310
- (tabs, index) => {
329
+ (tabs, index, that) => {
311
330
  let tab = tabs[index];
312
331
 
313
332
  if (tab.method == 'iframe') {
314
333
  tabs[index].url = util.handlerUrl(tab.url);
315
334
  } else {
316
335
  tabs[index].refresh = false;
317
- this.$nextTick(() => {
336
+ that.$nextTick(() => {
318
337
  tabs[index].refresh = true;
319
338
  });
320
339
  }
@@ -357,7 +376,7 @@ let events = [
357
376
  }
358
377
  ];
359
378
  export default {
360
- name: 'EsMainSimplicity',
379
+ name: 'Simplicity',
361
380
  components: {
362
381
  avatar,
363
382
  handler,
@@ -366,9 +385,11 @@ export default {
366
385
  user,
367
386
  message,
368
387
  notice,
369
- settings
388
+ settings,
389
+ routerPage
370
390
  },
371
391
  props: {
392
+ appCode: String,
372
393
  //logo
373
394
  logo: String,
374
395
  //菜单、应用默认图标
@@ -446,7 +467,14 @@ export default {
446
467
  //无界微前端Props属性
447
468
  wjProps: Object,
448
469
  //无界微前端Attrs属性
449
- wjAttrs: Object
470
+ wjAttrs: Object,
471
+ //菜单宽度
472
+ menuWidth: {
473
+ type: Number,
474
+ default: 220
475
+ },
476
+ //路由方式
477
+ routeType: String
450
478
  },
451
479
  data() {
452
480
  return {
@@ -458,14 +486,20 @@ export default {
458
486
  mainLogo: this.logo,
459
487
  //侧边用户应用
460
488
  userApps: [],
489
+ //点击应用存侧边
490
+ newApps: [],
461
491
  //所有菜单
462
492
  menus: [],
493
+ //菜单名称
494
+ title: '',
463
495
  //子菜单
464
- subMenus: [],
496
+ subMenus: null,
465
497
  //展示菜单导航
466
498
  showMenu: false,
467
- //展示菜单导航宽度
468
- width: '296px',
499
+ //子菜单选中
500
+ subActive: '',
501
+ //折叠菜单
502
+ fold: false,
469
503
  //人工智能配置
470
504
  aiConfig: null,
471
505
  //公用窗口面板配置
@@ -522,7 +556,11 @@ export default {
522
556
  //显示页签操作
523
557
  showTabsHandler: false,
524
558
  //页签对象
525
- pane: null
559
+ pane: null,
560
+ //选中菜单
561
+ active: '',
562
+ //单位名称
563
+ simpleUserInfo: {}
526
564
  };
527
565
  },
528
566
  computed: {
@@ -594,6 +632,7 @@ export default {
594
632
  util.win.refresh = this.handleRefresh;
595
633
  util.win.jumpMenu = this.jumpMenu;
596
634
  util.win.windowOpen = this.openPage;
635
+ this.handleListener();
597
636
  },
598
637
  methods: {
599
638
  /**
@@ -601,13 +640,13 @@ export default {
601
640
  * @author huangbo
602
641
  * @date 2024年9月7日
603
642
  **/
604
- hasRouter(res, url, code, parentName) {
643
+ hasRouter(res, url, code) {
605
644
  if (!url) {
606
645
  return false;
607
646
  }
608
647
  if (Array.isArray(res)) {
609
648
  for (let i in res) {
610
- let path = this.hasRouter(res[i], url, code, parentName);
649
+ let path = this.hasRouter(res[i], url, code);
611
650
  if (path) {
612
651
  return path;
613
652
  }
@@ -620,20 +659,20 @@ export default {
620
659
  let pathname = url.substring(url.indexOf('#/') + 1);
621
660
  pathname = pathname.split('?')[0];
622
661
  if (res.path !== '/' && pathname == path) {
623
- if (typeof res.component === 'function') {
624
- let component = {};
625
- component[code] = res.component;
626
- res.component = component;
627
- if (parentName) {
628
- this.$router.addRoute({ parentName, route: res });
629
- } else {
630
- this.$router.addRoute(res);
662
+ if (res.components) {
663
+ if (!res.components[code]) {
664
+ console.error('“命名视图”规范属性名称与菜单appCode不一致', res);
631
665
  }
666
+ } else {
667
+ console.error(
668
+ '请根据“命名视图”规范,正确添加components属性名称',
669
+ res
670
+ );
632
671
  }
633
672
  return pathname;
634
673
  }
635
674
  if (res && Object.prototype.hasOwnProperty.call(res, 'children')) {
636
- let path = this.hasRouter(res.children, url, code, parentName);
675
+ let path = this.hasRouter(res.children, url, code);
637
676
  if (path) {
638
677
  return path;
639
678
  }
@@ -650,7 +689,6 @@ export default {
650
689
  this.setConfig(results);
651
690
  if (this.remote) {
652
691
  this.getApplications();
653
- this.getMenus();
654
692
  }
655
693
  },
656
694
  /**
@@ -770,6 +808,7 @@ export default {
770
808
  * @date 2024年9月7日
771
809
  **/
772
810
  getApplications() {
811
+ let loading = util.loading('', '加载中...');
773
812
  util
774
813
  .ajax({
775
814
  url: this.appsUrl,
@@ -793,12 +832,15 @@ export default {
793
832
  } else {
794
833
  this.$message.error('未分配应用菜单权限,请联系管理员!');
795
834
  }
835
+ this.getMenus(loading);
796
836
  } else {
837
+ loading.close();
797
838
  let msg = res.msg || '系统错误,请联系管理员!';
798
839
  this.$message.error(msg);
799
840
  }
800
841
  })
801
842
  .catch((err) => {
843
+ loading.close();
802
844
  if (err.message && err.message !== 'canceled') {
803
845
  this.$message.error(err.message);
804
846
  }
@@ -809,41 +851,106 @@ export default {
809
851
  * @author huangbo
810
852
  * @date 2024年9月7日
811
853
  **/
812
- getMenus(appCode, url) {
813
- let params = appCode ? { menuCode: appCode } : {};
854
+ getMenus(loading) {
814
855
  util
815
- .ajax({ url: url || this._menuUrl, params: params })
856
+ .ajax({ url: this._menuUrl })
816
857
  .then((res) => {
858
+ loading.close();
817
859
  if (res.rCode === 0) {
818
860
  if (res.results && res.results.length) {
819
861
  this.menus = res.results;
820
862
  this.setTips(this.menus);
821
863
  store.set('nav', this.menus);
822
- if (this.indexUrl) {
823
- let obj = this.getMenu(this.menus, this.indexUrl);
824
- if (obj) {
825
- this.tabs = [this.setIframeType(obj)];
826
- this.activeName = obj.id;
827
- this.homePage = obj;
828
- } else {
829
- this.homePage = this.setIframeType({
830
- url: this.indexUrl,
831
- text: '工作台',
832
- id: '0',
833
- appCode: 'indexUrl'
834
- });
835
- this.tabs = [this.homePage];
836
- this.activeName = '0';
864
+ if (this.appCode) {
865
+ let app = this.userApps.filter((item) => {
866
+ return item.code === this.appCode;
867
+ })[0];
868
+ if (app) {
869
+ this.active = app.id;
870
+ if (app.url) {
871
+ let obj = this.getMenu(this.menus, app.url);
872
+ if (obj) {
873
+ let tab = this.setIframeType(obj);
874
+ this.tabs = [tab];
875
+ this.activeName = tab.id;
876
+ } else {
877
+ this.tabs = [app];
878
+ }
879
+ }
837
880
  }
838
- }
839
- if (this.initApps && this.initApps.length) {
840
- let obj = this.getMenu(
881
+ let subMenus = this.getMenu(
841
882
  this.menus,
842
- this.initApps[this.initApps.length - 1]
883
+ this.appCode,
884
+ 'appCode'
843
885
  );
844
- if (obj) {
845
- this.tabs.push(this.setIframeType(obj));
846
- this.activeName = obj.id;
886
+ if (subMenus) {
887
+ if (this.tabs.length == 0) {
888
+ let obj = this.getFirst(subMenus);
889
+ if (obj) {
890
+ this.subActive = obj.id;
891
+ let tab = this.setIframeType(obj);
892
+ this.tabs = [tab];
893
+ this.activeName = tab.id;
894
+ } else {
895
+ this.subActive = '';
896
+ }
897
+ }
898
+ this.subMenus = subMenus;
899
+ this.showMenu = true;
900
+ } else {
901
+ this.subMenus = null;
902
+ this.showMenu = false;
903
+ }
904
+ } else {
905
+ if (this.indexUrl) {
906
+ let obj = this.getMenu(this.menus, this.indexUrl);
907
+ if (obj) {
908
+ if (!this.appCode) {
909
+ let tab = this.setIframeType(obj);
910
+ this.tabs = [tab];
911
+ this.activeName = tab.id;
912
+ }
913
+ this.homePage = obj;
914
+ } else {
915
+ this.homePage = this.setIframeType({
916
+ url: this.indexUrl,
917
+ text: '工作台',
918
+ id: '0',
919
+ appCode: 'indexUrl'
920
+ });
921
+ if (!this.appCode) {
922
+ this.tabs = [this.homePage];
923
+ this.activeName = '0';
924
+ // if (this.homePage.method == 'router') {
925
+ // let params = util.getParams({ url: this.homePage.url });
926
+ // this.$router.push({
927
+ // path: this.homePage.path,
928
+ // query: { ...this.$parent.params, ...params }
929
+ // });
930
+ // }
931
+ }
932
+ }
933
+ } else if (
934
+ this.initApps &&
935
+ this.initApps.length &&
936
+ !this.appCode
937
+ ) {
938
+ let obj = this.getMenu(
939
+ this.menus,
940
+ this.initApps[this.initApps.length - 1]
941
+ );
942
+ if (obj) {
943
+ let tab = this.setIframeType(obj);
944
+ this.tabs.push(tab);
945
+ this.activeName = tab.id;
946
+ // if (tab.method == 'router') {
947
+ // let params = util.getParams({ url: tab.url });
948
+ // this.$router.push({
949
+ // path: tab.path,
950
+ // query: { ...this.$parent.params, ...params }
951
+ // });
952
+ // }
953
+ }
847
954
  }
848
955
  }
849
956
  } else {
@@ -855,19 +962,22 @@ export default {
855
962
  }
856
963
  })
857
964
  .catch((err) => {
965
+ loading.close();
858
966
  if (err.message && err.message !== 'canceled') {
859
967
  this.$message.error(err.message);
860
968
  }
861
969
  });
862
970
  },
971
+ /**
972
+ * @desc:设置页面加载类型
973
+ * @author huangbo
974
+ * @date 2024年9月7日
975
+ **/
863
976
  setIframeType(res) {
864
977
  let { url } = res;
865
978
  let urls = url.split('?');
866
979
  if (urls[0].indexOf('.js') > 1 && !isIE) {
867
980
  res.method = 'wujie';
868
- this.$nextTick(() => {
869
- res.refresh = true;
870
- });
871
981
  } else if (
872
982
  urls[0].indexOf('.dhtml') > 0 ||
873
983
  (urls[0].indexOf('.html') > 0 && urls[0].indexOf('.html#') === -1)
@@ -880,15 +990,9 @@ export default {
880
990
  const routes = this.$router.options.routes;
881
991
  if (routes) {
882
992
  let path = this.hasRouter(routes, urls[0], res.appCode);
883
- if (path) {
884
- let params = util.getParams({ url: url });
885
- this.$router.push({
886
- path: path,
887
- query: params
888
- });
889
- this.$nextTick(() => {
890
- res.refresh = true;
891
- });
993
+ if (path && this.routeType !== 'wujie') {
994
+ res.method = 'router';
995
+ res.path = path;
892
996
  } else {
893
997
  let urlopenmode = util.getParams({
894
998
  url: url,
@@ -903,9 +1007,6 @@ export default {
903
1007
  res.method = 'iframe';
904
1008
  } else {
905
1009
  res.method = 'wujie';
906
- this.$nextTick(() => {
907
- res.refresh = true;
908
- });
909
1010
  }
910
1011
  }
911
1012
  } else if (
@@ -913,14 +1014,12 @@ export default {
913
1014
  urls[0].indexOf('/#/') > -1
914
1015
  ) {
915
1016
  res.method = 'wujie';
916
- this.$nextTick(() => {
917
- res.refresh = true;
918
- });
919
1017
  } else {
920
1018
  res.method = 'iframe';
921
1019
  }
922
1020
  }
923
1021
  }
1022
+ res.refresh = true;
924
1023
  return res;
925
1024
  },
926
1025
  /**
@@ -960,6 +1059,37 @@ export default {
960
1059
  }
961
1060
  return false;
962
1061
  },
1062
+ /**
1063
+ * @desc:获取菜单第一条数据
1064
+ * @author huangbo
1065
+ * @date 2024年9月7日
1066
+ **/
1067
+ getFirst(obj) {
1068
+ if (!obj) {
1069
+ return '';
1070
+ }
1071
+ let openIdex = 0;
1072
+ if (
1073
+ obj.extendData &&
1074
+ (obj.extendData.subDefOpenIndex || obj.extendData.subDefOpen)
1075
+ ) {
1076
+ openIdex = parseInt(
1077
+ obj.extendData.subDefOpenIndex || obj.extendData.subDefOpen,
1078
+ 10
1079
+ );
1080
+ }
1081
+ if (obj.children && obj.children.length && obj.children[openIdex]) {
1082
+ return this.getFirst(obj.children[openIdex]);
1083
+ } else if (
1084
+ obj.fourthTabs &&
1085
+ obj.fourthTabs.length &&
1086
+ obj.fourthTabs[openIdex]
1087
+ ) {
1088
+ return this.getFirst(obj.fourthTabs[openIdex]);
1089
+ } else if (obj.url) {
1090
+ return obj;
1091
+ }
1092
+ },
963
1093
  /**
964
1094
  * @desc:遍历设置菜单气泡提醒
965
1095
  * @author huangbo
@@ -979,31 +1109,30 @@ export default {
979
1109
  this.$set(obj, 'tips', false);
980
1110
  delete obj.tips;
981
1111
  }
982
- let flag = false;
1112
+ let flag = 0;
983
1113
  if (obj.children && obj.children.length) {
984
1114
  obj.children.forEach((item) => {
985
- if (this.setTips(item)) {
986
- flag = true;
987
- }
1115
+ let n = this.setTips(item);
1116
+ flag += n ? parseInt(n) : 0;
988
1117
  });
989
1118
  if (flag) {
990
- this.$set(obj, 'tips', true);
991
- return true;
1119
+ this.$set(obj, 'tips', flag);
1120
+ return flag;
992
1121
  }
993
1122
  } else if (obj.fourthTabs && obj.fourthTabs.length) {
994
1123
  obj.fourthTabs.forEach((item) => {
995
- if (this.setTips(item)) {
996
- flag = true;
997
- }
1124
+ let n = this.setTips(item);
1125
+ flag += n ? parseInt(n) : 0;
998
1126
  });
999
1127
  if (flag) {
1000
- this.$set(obj, 'tips', true);
1001
- return true;
1128
+ this.$set(obj, 'tips', flag);
1129
+ return flag;
1002
1130
  }
1003
1131
  } else {
1004
- if (this.menuTips[obj.id] && Number(this.menuTips[obj.id])) {
1005
- this.$set(obj, 'tips', Number(this.menuTips[obj.id]));
1006
- return true;
1132
+ let num = this.menuTips[obj.id] || this.menuTips[obj.code];
1133
+ if (num && Number(num)) {
1134
+ this.$set(obj, 'tips', Number(num));
1135
+ return this.menuTips[obj.id];
1007
1136
  }
1008
1137
  }
1009
1138
  }
@@ -1074,12 +1203,35 @@ export default {
1074
1203
  }
1075
1204
  });
1076
1205
  },
1206
+ /**
1207
+ * @desc:删除更多应用菜单点击
1208
+ * @author huangbo
1209
+ * @date 2024年9月7日
1210
+ **/
1211
+ handleDelete(index) {
1212
+ this.newApps.splice(index, 1);
1213
+ },
1214
+ /**
1215
+ * @desc:储存更多应用菜单点击
1216
+ * @author huangbo
1217
+ * @date 2024年9月7日
1218
+ **/
1219
+ handlerClickApps(res) {
1220
+ let i = util.indexOfObj(this.newApps, res, 'id');
1221
+ if (i == -1) {
1222
+ this.newApps.push(res);
1223
+ }
1224
+ this.handlerClickApp(res);
1225
+ },
1077
1226
  /**
1078
1227
  * @desc:侧边应用菜单点击
1079
1228
  * @author huangbo
1080
1229
  * @date 2024年9月7日
1081
1230
  **/
1082
1231
  handlerClickApp(res) {
1232
+ this.showMsg = false;
1233
+ this.showSet = false;
1234
+ this.fold = false;
1083
1235
  if (res) {
1084
1236
  if (res.permission === false) {
1085
1237
  return false;
@@ -1091,33 +1243,52 @@ export default {
1091
1243
  this.subMenus = res;
1092
1244
  this.showMenu = true;
1093
1245
  this.showApps = false;
1094
- this.width = '296px';
1095
- this.$refs.subMenus && this.$refs.subMenus.clearSubmenu();
1096
- } else {
1097
- if (res.code) {
1098
- let subMenus = this.getMenu(this.menus, res.code, 'appCode');
1099
- this.subMenus = subMenus ? subMenus : [];
1100
- this.showMenu = subMenus !== false;
1101
- this.showApps = false;
1102
- this.width = '296px';
1103
- this.$refs.subMenus && this.$refs.subMenus.clearSubmenu();
1104
- }
1105
1246
  }
1247
+ let set = true;
1106
1248
  if (res.url) {
1107
1249
  if (res.urlopenmode == 1 || res.openModel == 1) {
1250
+ set = false;
1108
1251
  util.win.open(res.url);
1109
1252
  } else if (res.urlopenmode == 2 || res.openModel == 2) {
1253
+ set = false;
1110
1254
  util.win.location.href = res.url;
1111
1255
  } else {
1112
1256
  let i = util.indexOfObj(this.tabs, res, 'id');
1113
1257
  this.activeName = res.id;
1114
1258
  if (i == -1) {
1115
- this.tabs.push(this.setIframeType(res));
1259
+ let obj = this.getMenu(this.menus, res.url);
1260
+ if (obj) {
1261
+ let n = util.indexOfObj(this.tabs, obj, 'id');
1262
+ if (n == -1) {
1263
+ let tab = this.setIframeType(obj);
1264
+ this.tabs.push(tab);
1265
+ this.activeName = tab.id;
1266
+ }
1267
+ } else {
1268
+ let tab = this.setIframeType(res);
1269
+ this.tabs.push(tab);
1270
+ this.activeName = tab.id;
1271
+ }
1272
+ }
1273
+ }
1274
+ }
1275
+ if (set && res.code) {
1276
+ let subMenus = this.getMenu(this.menus, res.code, 'appCode');
1277
+ this.title = res.text || res.name;
1278
+ this.subMenus = subMenus ? subMenus : null;
1279
+ this.showMenu = subMenus !== false;
1280
+ this.showApps = false;
1281
+ if (subMenus && subMenus.url) {
1282
+ let i = util.indexOfObj(this.tabs, subMenus, 'id');
1283
+ this.activeName = subMenus.id;
1284
+ if (i == -1) {
1285
+ let tab = this.setIframeType(subMenus);
1286
+ this.tabs.push(tab);
1116
1287
  }
1117
1288
  }
1118
1289
  }
1290
+ this.active = res.id;
1119
1291
  } else {
1120
- this.showMenu = false;
1121
1292
  this.showApps = !this.showApps;
1122
1293
  }
1123
1294
  },
@@ -1148,17 +1319,24 @@ export default {
1148
1319
  * @date 2024年9月7日
1149
1320
  **/
1150
1321
  handlerClickMenu(res) {
1151
- if (typeof res === 'number') {
1152
- let num = 296;
1153
- this.width = num * res + 'px';
1154
- } else {
1155
- let i = util.indexOfObj(this.tabs, res, 'id');
1156
- this.activeName = res.id;
1157
- if (i == -1) {
1158
- this.tabs.push(this.setIframeType(res));
1159
- }
1322
+ this.showMsg = false;
1323
+ this.showSet = false;
1324
+ let i = util.indexOfObj(this.tabs, res, 'id');
1325
+ this.activeName = res.id;
1326
+ if (i == -1) {
1327
+ let tab = this.setIframeType(res);
1328
+ this.tabs.push(tab);
1160
1329
  }
1161
1330
  },
1331
+
1332
+ /**
1333
+ * @desc:用户详情请求成功
1334
+ * @author huangbo
1335
+ * @date 2024年9月7日
1336
+ **/
1337
+ handleSuccess(res) {
1338
+ this.simpleUserInfo = res.simpleUserInfo;
1339
+ },
1162
1340
  /**
1163
1341
  * @desc:修改用户配置
1164
1342
  * @author huangbo
@@ -1193,35 +1371,20 @@ export default {
1193
1371
  this.webSocket.destroy();
1194
1372
  }
1195
1373
  },
1196
- /**
1197
- * @desc:选中iframe页签刷新
1198
- * @author huangbo
1199
- * @date 2024年9月7日
1200
- **/
1201
- handleTab(res) {
1202
- let index;
1203
- if (res) {
1204
- index = parseInt(res.index);
1205
- } else {
1206
- index = util.indexOfObj(this.tabs, this.activeName, 'id');
1207
- }
1208
- let item = this.tabs[index];
1209
- if (item.method == 'iframe') {
1210
- item.url = util.handlerUrl(item.url);
1211
- } else {
1212
- item.refresh = false;
1213
- this.$nextTick(() => {
1214
- item.refresh = true;
1215
- });
1216
- }
1217
- },
1218
1374
  /**
1219
1375
  * @desc:刷新选中iframe页签
1220
1376
  * @author huangbo
1221
1377
  * @date 2024年9月7日
1222
1378
  **/
1223
1379
  handleRefresh() {
1224
- this.handleTab();
1380
+ let tab = this.tabs[this.activeName];
1381
+ if (tab.method === 'iframe') {
1382
+ tab.url = util.handlerUrl(tab.url);
1383
+ }
1384
+ tab.refresh = false;
1385
+ this.$nextTick(() => {
1386
+ tab.refresh = true;
1387
+ });
1225
1388
  },
1226
1389
  /**
1227
1390
  * @desc:删除iframe
@@ -1259,6 +1422,9 @@ export default {
1259
1422
  if (this.tabs.length == 1) {
1260
1423
  disabled.other = true;
1261
1424
  }
1425
+ if (this.tabs[index].id != this.activeName) {
1426
+ disabled.refresh = true;
1427
+ }
1262
1428
  this.isDisabled = disabled;
1263
1429
  this.$refs.tabsHandler.$el.style.setProperty('left', `${e.x}px`);
1264
1430
  this.$refs.tabsHandler.$el.style.setProperty('top', `${e.y}px`);
@@ -1307,6 +1473,8 @@ export default {
1307
1473
  this.handleQuit();
1308
1474
  break;
1309
1475
  case 'online':
1476
+ this.showMsg = false;
1477
+ this.showSet = false;
1310
1478
  if (this.onlineUrl) {
1311
1479
  this.dialog = {
1312
1480
  title: '查看在线人员',
@@ -1317,9 +1485,11 @@ export default {
1317
1485
  break;
1318
1486
  case 'notice':
1319
1487
  this.showMsg = !this.showMsg;
1488
+ this.showSet = false;
1320
1489
  break;
1321
1490
  case 'set':
1322
1491
  this.showSet = !this.showSet;
1492
+ this.showMsg = false;
1323
1493
  break;
1324
1494
  case 'home':
1325
1495
  if (this.homePage.id !== this.activeName) {
@@ -1328,10 +1498,14 @@ export default {
1328
1498
  this.tabs.unshift(this.homePage);
1329
1499
  }
1330
1500
  this.activeName = this.homePage.id;
1501
+ this.showMsg = false;
1502
+ this.showSet = false;
1331
1503
  }
1332
1504
  break;
1333
1505
  case 'search':
1334
1506
  this.handlerSetDrawer(res);
1507
+ this.showMsg = false;
1508
+ this.showSet = false;
1335
1509
  break;
1336
1510
  case 'goView':
1337
1511
  util.win.open(res.path, '_blank');
@@ -1582,17 +1756,36 @@ export default {
1582
1756
  }
1583
1757
  },
1584
1758
  jumpMenu(res) {
1585
- let apps = res.split(',');
1759
+ let apps = res;
1760
+ if (typeof res === 'string') {
1761
+ apps = res.split(',');
1762
+ }
1586
1763
  let obj = this.getMenu(this.menus, apps[apps.length - 1]);
1587
1764
  if (obj) {
1588
1765
  let i = util.indexOfObj(this.tabs, obj, 'id');
1766
+ let n = util.indexOfObj(this.tabs, this.activeName, 'id');
1767
+ this.activeName = obj.id;
1589
1768
  if (i == -1) {
1590
- this.tabs.push(this.setIframeType(obj));
1769
+ let tab = this.setIframeType(obj);
1770
+ this.tabs.splice(n + 1, 0, tab);
1591
1771
  }
1592
- this.activeName = obj.id;
1593
1772
  } else {
1594
1773
  this.$message.error('没有此菜单!');
1595
1774
  }
1775
+ },
1776
+ //监听改变菜单
1777
+ handleListener() {
1778
+ util.win.addEventListener(
1779
+ 'message',
1780
+ (e) => {
1781
+ var msg = e.data;
1782
+ if (msg.key == 'jump_Menu') {
1783
+ let res = msg.data1;
1784
+ this.jumpMenu(res);
1785
+ }
1786
+ },
1787
+ false
1788
+ );
1596
1789
  }
1597
1790
  },
1598
1791
  beforeDestroy() {