eoss-ui 0.5.81-beta1 → 0.5.81-beta11

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 (119) hide show
  1. package/lib/button-group.js +3 -1
  2. package/lib/button.js +3 -1
  3. package/lib/checkbox-group.js +3 -1
  4. package/lib/config/api.js +1 -0
  5. package/lib/data-table-form.js +3 -1
  6. package/lib/data-table.js +151 -128
  7. package/lib/date-picker.js +3 -1
  8. package/lib/dialog.js +9 -6
  9. package/lib/eoss-ui.common.js +2638 -1494
  10. package/lib/flow-group.js +6 -4
  11. package/lib/flow-list.js +3 -1
  12. package/lib/flow.js +3 -1
  13. package/lib/form.js +50 -5
  14. package/lib/handle-user.js +19 -4
  15. package/lib/handler.js +15 -4
  16. package/lib/icon.js +17 -8
  17. package/lib/index.js +1 -1
  18. package/lib/input-number.js +3 -1
  19. package/lib/input.js +3 -1
  20. package/lib/login.js +11 -7
  21. package/lib/main.js +1968 -984
  22. package/lib/nav.js +3 -1
  23. package/lib/notify.js +3 -1
  24. package/lib/page.js +3 -1
  25. package/lib/pagination.js +3717 -3
  26. package/lib/player.js +3 -1
  27. package/lib/qr-code.js +3 -1
  28. package/lib/radio-group.js +3 -1
  29. package/lib/retrial-auth.js +3 -1
  30. package/lib/select-ganged.js +3 -1
  31. package/lib/select.js +4 -2
  32. package/lib/selector-panel.js +68 -18
  33. package/lib/selector.js +11 -5
  34. package/lib/sizer.js +3 -1
  35. package/lib/steps.js +3 -1
  36. package/lib/switch.js +3 -1
  37. package/lib/table-form.js +3 -1
  38. package/lib/tabs.js +3 -1
  39. package/lib/theme-chalk/base.css +1 -1
  40. package/lib/theme-chalk/button-group.css +1 -1
  41. package/lib/theme-chalk/data-table.css +1 -1
  42. package/lib/theme-chalk/form.css +1 -1
  43. package/lib/theme-chalk/handler.css +1 -1
  44. package/lib/theme-chalk/index.css +1 -1
  45. package/lib/theme-chalk/main.css +1 -1
  46. package/lib/theme-chalk/menu.css +1 -1
  47. package/lib/theme-chalk/nav.css +1 -1
  48. package/lib/theme-chalk/pagination.css +1 -1
  49. package/lib/theme-chalk/selector-panel.css +1 -1
  50. package/lib/theme-chalk/simplicity.css +1 -1
  51. package/lib/theme-chalk/sizer.css +1 -1
  52. package/lib/theme-chalk/tree.css +1 -1
  53. package/lib/theme-chalk/upload.css +1 -1
  54. package/lib/tips.js +3 -1
  55. package/lib/tree-group.js +3 -1
  56. package/lib/tree.js +3 -1
  57. package/lib/upload.js +9 -7
  58. package/lib/wujie.js +3 -1
  59. package/lib/wxlogin.js +3 -1
  60. package/package.json +2 -2
  61. package/packages/data-table/src/main.vue +55 -29
  62. package/packages/dialog/src/main.vue +4 -3
  63. package/packages/flow-group/src/main.vue +1 -1
  64. package/packages/form/src/main.vue +45 -10
  65. package/packages/handle-user/src/main.vue +10 -3
  66. package/packages/handler/src/main.vue +5 -3
  67. package/packages/icon/src/main.vue +12 -5
  68. package/packages/login/src/main.vue +10 -4
  69. package/packages/main/src/default/index.vue +17 -15
  70. package/packages/main/src/main.vue +16 -12
  71. package/packages/main/src/public/online.vue +90 -0
  72. package/packages/main/src/simplicity/apps.vue +176 -145
  73. package/packages/main/src/simplicity/avatar.vue +16 -6
  74. package/packages/main/src/simplicity/handler.vue +5 -1
  75. package/packages/main/src/simplicity/index.vue +393 -188
  76. package/packages/main/src/simplicity/menu-list.vue +74 -24
  77. package/packages/main/src/simplicity/message.vue +35 -25
  78. package/packages/main/src/simplicity/notice.vue +72 -39
  79. package/packages/main/src/simplicity/router-page.vue +53 -0
  80. package/packages/main/src/simplicity/settings.vue +1 -1
  81. package/packages/main/src/simplicity/sub-menu.vue +159 -57
  82. package/packages/main/src/simplicity/user.vue +10 -5
  83. package/packages/main/src/simplicity/userinfo.vue +1 -0
  84. package/packages/pagination/src/main.vue +20 -1
  85. package/packages/select/src/main.vue +4 -1
  86. package/packages/selector/src/main.vue +6 -2
  87. package/packages/selector-panel/src/main.vue +22 -8
  88. package/packages/selector-panel/src/selection.vue +6 -0
  89. package/packages/theme-chalk/lib/base.css +1 -1
  90. package/packages/theme-chalk/lib/button-group.css +1 -1
  91. package/packages/theme-chalk/lib/data-table.css +1 -1
  92. package/packages/theme-chalk/lib/form.css +1 -1
  93. package/packages/theme-chalk/lib/handler.css +1 -1
  94. package/packages/theme-chalk/lib/index.css +1 -1
  95. package/packages/theme-chalk/lib/main.css +1 -1
  96. package/packages/theme-chalk/lib/menu.css +1 -1
  97. package/packages/theme-chalk/lib/nav.css +1 -1
  98. package/packages/theme-chalk/lib/pagination.css +1 -1
  99. package/packages/theme-chalk/lib/selector-panel.css +1 -1
  100. package/packages/theme-chalk/lib/simplicity.css +1 -1
  101. package/packages/theme-chalk/lib/sizer.css +1 -1
  102. package/packages/theme-chalk/lib/tree.css +1 -1
  103. package/packages/theme-chalk/lib/upload.css +1 -1
  104. package/packages/theme-chalk/src/base.scss +5 -0
  105. package/packages/theme-chalk/src/button-group.scss +3 -3
  106. package/packages/theme-chalk/src/common/var.scss +6 -0
  107. package/packages/theme-chalk/src/data-table.scss +10 -10
  108. package/packages/theme-chalk/src/form.scss +2 -4
  109. package/packages/theme-chalk/src/handler.scss +5 -1
  110. package/packages/theme-chalk/src/login.scss +2 -2
  111. package/packages/theme-chalk/src/nav.scss +3 -2
  112. package/packages/theme-chalk/src/pagination.scss +7 -0
  113. package/packages/theme-chalk/src/selector-panel.scss +2 -1
  114. package/packages/theme-chalk/src/simplicity.scss +340 -58
  115. package/packages/theme-chalk/src/tree.scss +4 -2
  116. package/packages/upload/src/main.vue +3 -1
  117. package/src/config/api.js +1 -0
  118. package/src/index.js +157 -157
  119. package/CHANGELOG.md +0 -929
@@ -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>
@@ -274,8 +291,11 @@
274
291
 
275
292
  <!-- 公用弹窗 -->
276
293
  <es-dialog :title="dialog.title" :visible.sync="dialog.show" size="md">
294
+ <template v-if="dialog.title == '查看在线人员' && !dialog.src">
295
+ <online></online>
296
+ </template>
277
297
  <iframe
278
- v-if="dialog.show"
298
+ v-else-if="dialog.show"
279
299
  width="100%"
280
300
  height="100%"
281
301
  frameborder="0"
@@ -296,8 +316,11 @@ import user from './user.vue';
296
316
  import message from './message.vue';
297
317
  import notice from './notice.vue';
298
318
  import settings from './settings.vue';
319
+ import routerPage from './router-page.vue';
320
+ import online from '../public/online.vue';
299
321
  import {
300
322
  wss,
323
+ logout,
301
324
  topic,
302
325
  getUserAppWithTag,
303
326
  getComplexApplications,
@@ -307,14 +330,14 @@ import store from 'eoss-ui/src/utils/store';
307
330
  import util from 'eoss-ui/src/utils/util';
308
331
  const isIE = navigator.userAgent.indexOf('MSIE') != -1;
309
332
  let events = [
310
- (tabs, index) => {
333
+ (tabs, index, that) => {
311
334
  let tab = tabs[index];
312
335
 
313
336
  if (tab.method == 'iframe') {
314
337
  tabs[index].url = util.handlerUrl(tab.url);
315
338
  } else {
316
339
  tabs[index].refresh = false;
317
- this.$nextTick(() => {
340
+ that.$nextTick(() => {
318
341
  tabs[index].refresh = true;
319
342
  });
320
343
  }
@@ -357,7 +380,7 @@ let events = [
357
380
  }
358
381
  ];
359
382
  export default {
360
- name: 'EsMainSimplicity',
383
+ name: 'Simplicity',
361
384
  components: {
362
385
  avatar,
363
386
  handler,
@@ -366,9 +389,12 @@ export default {
366
389
  user,
367
390
  message,
368
391
  notice,
369
- settings
392
+ settings,
393
+ routerPage,
394
+ online
370
395
  },
371
396
  props: {
397
+ appCode: String,
372
398
  //logo
373
399
  logo: String,
374
400
  //菜单、应用默认图标
@@ -446,7 +472,14 @@ export default {
446
472
  //无界微前端Props属性
447
473
  wjProps: Object,
448
474
  //无界微前端Attrs属性
449
- wjAttrs: Object
475
+ wjAttrs: Object,
476
+ //菜单宽度
477
+ menuWidth: {
478
+ type: Number,
479
+ default: 220
480
+ },
481
+ //路由方式
482
+ routeType: String
450
483
  },
451
484
  data() {
452
485
  return {
@@ -458,14 +491,20 @@ export default {
458
491
  mainLogo: this.logo,
459
492
  //侧边用户应用
460
493
  userApps: [],
494
+ //点击应用存侧边
495
+ newApps: [],
461
496
  //所有菜单
462
497
  menus: [],
498
+ //菜单名称
499
+ title: '',
463
500
  //子菜单
464
- subMenus: [],
501
+ subMenus: null,
465
502
  //展示菜单导航
466
503
  showMenu: false,
467
- //展示菜单导航宽度
468
- width: '296px',
504
+ //子菜单选中
505
+ subActive: '',
506
+ //折叠菜单
507
+ fold: false,
469
508
  //人工智能配置
470
509
  aiConfig: null,
471
510
  //公用窗口面板配置
@@ -522,7 +561,11 @@ export default {
522
561
  //显示页签操作
523
562
  showTabsHandler: false,
524
563
  //页签对象
525
- pane: null
564
+ pane: null,
565
+ //选中菜单
566
+ active: '',
567
+ //单位名称
568
+ simpleUserInfo: {}
526
569
  };
527
570
  },
528
571
  computed: {
@@ -562,9 +605,7 @@ export default {
562
605
  //在线人数列表地址
563
606
  onlineUrl() {
564
607
  if (this.onlineView) {
565
- return typeof this.onlineView == 'string'
566
- ? this.onlineView
567
- : '/main/sysuseronline/list.dhtml';
608
+ return typeof this.onlineView == 'string' ? this.onlineView : '';
568
609
  }
569
610
  return false;
570
611
  }
@@ -594,6 +635,7 @@ export default {
594
635
  util.win.refresh = this.handleRefresh;
595
636
  util.win.jumpMenu = this.jumpMenu;
596
637
  util.win.windowOpen = this.openPage;
638
+ this.handleListener();
597
639
  },
598
640
  methods: {
599
641
  /**
@@ -601,13 +643,13 @@ export default {
601
643
  * @author huangbo
602
644
  * @date 2024年9月7日
603
645
  **/
604
- hasRouter(res, url, code, parentName) {
646
+ hasRouter(res, url, code) {
605
647
  if (!url) {
606
648
  return false;
607
649
  }
608
650
  if (Array.isArray(res)) {
609
651
  for (let i in res) {
610
- let path = this.hasRouter(res[i], url, code, parentName);
652
+ let path = this.hasRouter(res[i], url, code);
611
653
  if (path) {
612
654
  return path;
613
655
  }
@@ -620,20 +662,20 @@ export default {
620
662
  let pathname = url.substring(url.indexOf('#/') + 1);
621
663
  pathname = pathname.split('?')[0];
622
664
  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);
665
+ if (res.components) {
666
+ if (!res.components[code]) {
667
+ console.error('“命名视图”规范属性名称与菜单appCode不一致', res);
631
668
  }
669
+ } else {
670
+ console.error(
671
+ '请根据“命名视图”规范,正确添加components属性名称',
672
+ res
673
+ );
632
674
  }
633
675
  return pathname;
634
676
  }
635
677
  if (res && Object.prototype.hasOwnProperty.call(res, 'children')) {
636
- let path = this.hasRouter(res.children, url, code, parentName);
678
+ let path = this.hasRouter(res.children, url, code);
637
679
  if (path) {
638
680
  return path;
639
681
  }
@@ -650,7 +692,6 @@ export default {
650
692
  this.setConfig(results);
651
693
  if (this.remote) {
652
694
  this.getApplications();
653
- this.getMenus();
654
695
  }
655
696
  },
656
697
  /**
@@ -770,6 +811,7 @@ export default {
770
811
  * @date 2024年9月7日
771
812
  **/
772
813
  getApplications() {
814
+ let loading = util.loading('', '加载中...');
773
815
  util
774
816
  .ajax({
775
817
  url: this.appsUrl,
@@ -793,12 +835,15 @@ export default {
793
835
  } else {
794
836
  this.$message.error('未分配应用菜单权限,请联系管理员!');
795
837
  }
838
+ this.getMenus(loading);
796
839
  } else {
840
+ loading.close();
797
841
  let msg = res.msg || '系统错误,请联系管理员!';
798
842
  this.$message.error(msg);
799
843
  }
800
844
  })
801
845
  .catch((err) => {
846
+ loading.close();
802
847
  if (err.message && err.message !== 'canceled') {
803
848
  this.$message.error(err.message);
804
849
  }
@@ -809,41 +854,92 @@ export default {
809
854
  * @author huangbo
810
855
  * @date 2024年9月7日
811
856
  **/
812
- getMenus(appCode, url) {
813
- let params = appCode ? { menuCode: appCode } : {};
857
+ getMenus(loading) {
814
858
  util
815
- .ajax({ url: url || this._menuUrl, params: params })
859
+ .ajax({ url: this._menuUrl })
816
860
  .then((res) => {
861
+ loading.close();
817
862
  if (res.rCode === 0) {
818
863
  if (res.results && res.results.length) {
819
864
  this.menus = res.results;
820
865
  this.setTips(this.menus);
821
866
  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';
867
+ if (this.appCode) {
868
+ let app = this.userApps.filter((item) => {
869
+ return item.code === this.appCode;
870
+ })[0];
871
+ if (app) {
872
+ this.active = app.id;
873
+ if (app.url) {
874
+ let obj = this.getMenu(this.menus, app.url);
875
+ if (obj) {
876
+ let tab = this.setIframeType(obj);
877
+ this.tabs = [tab];
878
+ this.activeName = tab.id;
879
+ } else {
880
+ this.tabs = [app];
881
+ }
882
+ }
837
883
  }
838
- }
839
- if (this.initApps && this.initApps.length) {
840
- let obj = this.getMenu(
884
+ let subMenus = this.getMenu(
841
885
  this.menus,
842
- this.initApps[this.initApps.length - 1]
886
+ this.appCode,
887
+ 'appCode'
843
888
  );
844
- if (obj) {
845
- this.tabs.push(this.setIframeType(obj));
846
- this.activeName = obj.id;
889
+ if (subMenus) {
890
+ if (this.tabs.length == 0) {
891
+ let obj = this.getFirst(subMenus);
892
+ if (obj) {
893
+ this.subActive = obj.id;
894
+ let tab = this.setIframeType(obj);
895
+ this.tabs = [tab];
896
+ this.activeName = tab.id;
897
+ } else {
898
+ this.subActive = '';
899
+ }
900
+ }
901
+ this.subMenus = subMenus;
902
+ this.showMenu = true;
903
+ } else {
904
+ this.subMenus = null;
905
+ this.showMenu = false;
906
+ }
907
+ } else {
908
+ if (this.indexUrl) {
909
+ let obj = this.getMenu(this.menus, this.indexUrl);
910
+ if (obj) {
911
+ if (!this.appCode) {
912
+ let tab = this.setIframeType(obj);
913
+ this.tabs = [tab];
914
+ this.activeName = tab.id;
915
+ }
916
+ this.homePage = obj;
917
+ } else {
918
+ this.homePage = this.setIframeType({
919
+ url: this.indexUrl,
920
+ text: '工作台',
921
+ id: '0',
922
+ appCode: 'indexUrl'
923
+ });
924
+ if (!this.appCode) {
925
+ this.tabs = [this.homePage];
926
+ this.activeName = '0';
927
+ }
928
+ }
929
+ } else if (
930
+ this.initApps &&
931
+ this.initApps.length &&
932
+ !this.appCode
933
+ ) {
934
+ let obj = this.getMenu(
935
+ this.menus,
936
+ this.initApps[this.initApps.length - 1]
937
+ );
938
+ if (obj) {
939
+ let tab = this.setIframeType(obj);
940
+ this.tabs.push(tab);
941
+ this.activeName = tab.id;
942
+ }
847
943
  }
848
944
  }
849
945
  } else {
@@ -855,19 +951,25 @@ export default {
855
951
  }
856
952
  })
857
953
  .catch((err) => {
954
+ loading.close();
858
955
  if (err.message && err.message !== 'canceled') {
859
956
  this.$message.error(err.message);
860
957
  }
861
958
  });
862
959
  },
960
+ /**
961
+ * @desc:设置页面加载类型
962
+ * @author huangbo
963
+ * @date 2024年9月7日
964
+ **/
863
965
  setIframeType(res) {
864
966
  let { url } = res;
967
+ if (url) {
968
+ res.refresh = false;
969
+ }
865
970
  let urls = url.split('?');
866
971
  if (urls[0].indexOf('.js') > 1 && !isIE) {
867
972
  res.method = 'wujie';
868
- this.$nextTick(() => {
869
- res.refresh = true;
870
- });
871
973
  } else if (
872
974
  urls[0].indexOf('.dhtml') > 0 ||
873
975
  (urls[0].indexOf('.html') > 0 && urls[0].indexOf('.html#') === -1)
@@ -880,15 +982,9 @@ export default {
880
982
  const routes = this.$router.options.routes;
881
983
  if (routes) {
882
984
  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
- });
985
+ if (path && this.routeType !== 'wujie') {
986
+ res.method = 'router';
987
+ res.path = path;
892
988
  } else {
893
989
  let urlopenmode = util.getParams({
894
990
  url: url,
@@ -903,9 +999,6 @@ export default {
903
999
  res.method = 'iframe';
904
1000
  } else {
905
1001
  res.method = 'wujie';
906
- this.$nextTick(() => {
907
- res.refresh = true;
908
- });
909
1002
  }
910
1003
  }
911
1004
  } else if (
@@ -913,14 +1006,14 @@ export default {
913
1006
  urls[0].indexOf('/#/') > -1
914
1007
  ) {
915
1008
  res.method = 'wujie';
916
- this.$nextTick(() => {
917
- res.refresh = true;
918
- });
919
1009
  } else {
920
1010
  res.method = 'iframe';
921
1011
  }
922
1012
  }
923
1013
  }
1014
+ if (Object.prototype.hasOwnProperty.call(res, 'refresh')) {
1015
+ res.refresh = true;
1016
+ }
924
1017
  return res;
925
1018
  },
926
1019
  /**
@@ -960,6 +1053,37 @@ export default {
960
1053
  }
961
1054
  return false;
962
1055
  },
1056
+ /**
1057
+ * @desc:获取菜单第一条数据
1058
+ * @author huangbo
1059
+ * @date 2024年9月7日
1060
+ **/
1061
+ getFirst(obj) {
1062
+ if (!obj) {
1063
+ return '';
1064
+ }
1065
+ let openIdex = 0;
1066
+ if (
1067
+ obj.extendData &&
1068
+ (obj.extendData.subDefOpenIndex || obj.extendData.subDefOpen)
1069
+ ) {
1070
+ openIdex = parseInt(
1071
+ obj.extendData.subDefOpenIndex || obj.extendData.subDefOpen,
1072
+ 10
1073
+ );
1074
+ }
1075
+ if (obj.children && obj.children.length && obj.children[openIdex]) {
1076
+ return this.getFirst(obj.children[openIdex]);
1077
+ } else if (
1078
+ obj.fourthTabs &&
1079
+ obj.fourthTabs.length &&
1080
+ obj.fourthTabs[openIdex]
1081
+ ) {
1082
+ return this.getFirst(obj.fourthTabs[openIdex]);
1083
+ } else if (obj.url) {
1084
+ return obj;
1085
+ }
1086
+ },
963
1087
  /**
964
1088
  * @desc:遍历设置菜单气泡提醒
965
1089
  * @author huangbo
@@ -979,31 +1103,30 @@ export default {
979
1103
  this.$set(obj, 'tips', false);
980
1104
  delete obj.tips;
981
1105
  }
982
- let flag = false;
1106
+ let flag = 0;
983
1107
  if (obj.children && obj.children.length) {
984
1108
  obj.children.forEach((item) => {
985
- if (this.setTips(item)) {
986
- flag = true;
987
- }
1109
+ let n = this.setTips(item);
1110
+ flag += n ? parseInt(n) : 0;
988
1111
  });
989
1112
  if (flag) {
990
- this.$set(obj, 'tips', true);
991
- return true;
1113
+ this.$set(obj, 'tips', flag);
1114
+ return flag;
992
1115
  }
993
1116
  } else if (obj.fourthTabs && obj.fourthTabs.length) {
994
1117
  obj.fourthTabs.forEach((item) => {
995
- if (this.setTips(item)) {
996
- flag = true;
997
- }
1118
+ let n = this.setTips(item);
1119
+ flag += n ? parseInt(n) : 0;
998
1120
  });
999
1121
  if (flag) {
1000
- this.$set(obj, 'tips', true);
1001
- return true;
1122
+ this.$set(obj, 'tips', flag);
1123
+ return flag;
1002
1124
  }
1003
1125
  } 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;
1126
+ let num = this.menuTips[obj.id] || this.menuTips[obj.code];
1127
+ if (num && Number(num)) {
1128
+ this.$set(obj, 'tips', Number(num));
1129
+ return this.menuTips[obj.id];
1007
1130
  }
1008
1131
  }
1009
1132
  }
@@ -1074,12 +1197,38 @@ export default {
1074
1197
  }
1075
1198
  });
1076
1199
  },
1200
+ /**
1201
+ * @desc:删除更多应用菜单点击
1202
+ * @author huangbo
1203
+ * @date 2024年9月7日
1204
+ **/
1205
+ handleDelete(index) {
1206
+ this.newApps.splice(index, 1);
1207
+ },
1208
+ /**
1209
+ * @desc:储存更多应用菜单点击
1210
+ * @author huangbo
1211
+ * @date 2024年9月7日
1212
+ **/
1213
+ handlerClickApps(res) {
1214
+ if (res.permission === false) {
1215
+ return false;
1216
+ }
1217
+ let i = util.indexOfObj(this.newApps, res, 'id');
1218
+ if (i == -1) {
1219
+ this.newApps.push(res);
1220
+ }
1221
+ this.handlerClickApp(res);
1222
+ },
1077
1223
  /**
1078
1224
  * @desc:侧边应用菜单点击
1079
1225
  * @author huangbo
1080
1226
  * @date 2024年9月7日
1081
1227
  **/
1082
1228
  handlerClickApp(res) {
1229
+ this.showMsg = false;
1230
+ this.showSet = false;
1231
+ this.fold = false;
1083
1232
  if (res) {
1084
1233
  if (res.permission === false) {
1085
1234
  return false;
@@ -1091,33 +1240,64 @@ export default {
1091
1240
  this.subMenus = res;
1092
1241
  this.showMenu = true;
1093
1242
  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
1243
  }
1244
+ let set = true;
1106
1245
  if (res.url) {
1107
1246
  if (res.urlopenmode == 1 || res.openModel == 1) {
1247
+ set = false;
1108
1248
  util.win.open(res.url);
1109
1249
  } else if (res.urlopenmode == 2 || res.openModel == 2) {
1250
+ set = false;
1110
1251
  util.win.location.href = res.url;
1111
1252
  } else {
1112
1253
  let i = util.indexOfObj(this.tabs, res, 'id');
1113
1254
  this.activeName = res.id;
1114
1255
  if (i == -1) {
1115
- this.tabs.push(this.setIframeType(res));
1256
+ let obj = this.getMenu(this.menus, res.url);
1257
+ if (obj) {
1258
+ let n = util.indexOfObj(this.tabs, obj, 'id');
1259
+ if (n == -1) {
1260
+ let tab = this.setIframeType(obj);
1261
+ this.tabs.push(tab);
1262
+ this.activeName = tab.id;
1263
+ } else {
1264
+ if (obj.method == 'iframe') {
1265
+ obj.url = util.handlerUrl(obj.url);
1266
+ }
1267
+ }
1268
+ } else {
1269
+ let tab = this.setIframeType(res);
1270
+ this.tabs.push(tab);
1271
+ this.activeName = tab.id;
1272
+ }
1273
+ } else {
1274
+ if (res.method == 'iframe') {
1275
+ res.url = util.handlerUrl(res.url);
1276
+ }
1116
1277
  }
1117
1278
  }
1118
1279
  }
1280
+ if (set && res.code) {
1281
+ let subMenus = this.getMenu(this.menus, res.code, 'appCode');
1282
+ this.title = res.text || res.name;
1283
+ this.subMenus = subMenus ? subMenus : null;
1284
+ this.showMenu = subMenus !== false;
1285
+ this.showApps = false;
1286
+ if (subMenus && subMenus.url) {
1287
+ let i = util.indexOfObj(this.tabs, subMenus, 'id');
1288
+ this.activeName = subMenus.id;
1289
+ if (i == -1) {
1290
+ let tab = this.setIframeType(subMenus);
1291
+ this.tabs.push(tab);
1292
+ } else {
1293
+ if (subMenus.method == 'iframe') {
1294
+ subMenus.url = util.handlerUrl(subMenus.url);
1295
+ }
1296
+ }
1297
+ }
1298
+ }
1299
+ this.active = res.id;
1119
1300
  } else {
1120
- this.showMenu = false;
1121
1301
  this.showApps = !this.showApps;
1122
1302
  }
1123
1303
  },
@@ -1148,17 +1328,28 @@ export default {
1148
1328
  * @date 2024年9月7日
1149
1329
  **/
1150
1330
  handlerClickMenu(res) {
1151
- if (typeof res === 'number') {
1152
- let num = 296;
1153
- this.width = num * res + 'px';
1331
+ this.showMsg = false;
1332
+ this.showSet = false;
1333
+ let i = util.indexOfObj(this.tabs, res, 'id');
1334
+ this.activeName = res.id;
1335
+ if (i == -1) {
1336
+ let tab = this.setIframeType(res);
1337
+ this.tabs.push(tab);
1154
1338
  } 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));
1339
+ if (res.method == 'iframe') {
1340
+ res.url = util.handlerUrl(res.url);
1159
1341
  }
1160
1342
  }
1161
1343
  },
1344
+
1345
+ /**
1346
+ * @desc:用户详情请求成功
1347
+ * @author huangbo
1348
+ * @date 2024年9月7日
1349
+ **/
1350
+ handleSuccess(res) {
1351
+ this.simpleUserInfo = res.simpleUserInfo;
1352
+ },
1162
1353
  /**
1163
1354
  * @desc:修改用户配置
1164
1355
  * @author huangbo
@@ -1193,35 +1384,21 @@ export default {
1193
1384
  this.webSocket.destroy();
1194
1385
  }
1195
1386
  },
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
1387
  /**
1219
1388
  * @desc:刷新选中iframe页签
1220
1389
  * @author huangbo
1221
1390
  * @date 2024年9月7日
1222
1391
  **/
1223
1392
  handleRefresh() {
1224
- this.handleTab();
1393
+ let i = util.indexOfObj(this.tabs, this.activeName, 'id');
1394
+ let tab = this.tabs[i];
1395
+ if (tab.method === 'iframe') {
1396
+ tab.url = util.handlerUrl(tab.url);
1397
+ }
1398
+ tab.refresh = false;
1399
+ this.$nextTick(() => {
1400
+ tab.refresh = true;
1401
+ });
1225
1402
  },
1226
1403
  /**
1227
1404
  * @desc:删除iframe
@@ -1259,6 +1436,9 @@ export default {
1259
1436
  if (this.tabs.length == 1) {
1260
1437
  disabled.other = true;
1261
1438
  }
1439
+ if (this.tabs[index].id != this.activeName) {
1440
+ disabled.refresh = true;
1441
+ }
1262
1442
  this.isDisabled = disabled;
1263
1443
  this.$refs.tabsHandler.$el.style.setProperty('left', `${e.x}px`);
1264
1444
  this.$refs.tabsHandler.$el.style.setProperty('top', `${e.y}px`);
@@ -1307,19 +1487,21 @@ export default {
1307
1487
  this.handleQuit();
1308
1488
  break;
1309
1489
  case 'online':
1310
- if (this.onlineUrl) {
1311
- this.dialog = {
1312
- title: '查看在线人员',
1313
- show: true,
1314
- src: this.onlineUrl
1315
- };
1316
- }
1490
+ this.showMsg = false;
1491
+ this.showSet = false;
1492
+ this.dialog = {
1493
+ title: '查看在线人员',
1494
+ show: true,
1495
+ src: this.onlineUrl
1496
+ };
1317
1497
  break;
1318
1498
  case 'notice':
1319
1499
  this.showMsg = !this.showMsg;
1500
+ this.showSet = false;
1320
1501
  break;
1321
1502
  case 'set':
1322
1503
  this.showSet = !this.showSet;
1504
+ this.showMsg = false;
1323
1505
  break;
1324
1506
  case 'home':
1325
1507
  if (this.homePage.id !== this.activeName) {
@@ -1328,10 +1510,14 @@ export default {
1328
1510
  this.tabs.unshift(this.homePage);
1329
1511
  }
1330
1512
  this.activeName = this.homePage.id;
1513
+ this.showMsg = false;
1514
+ this.showSet = false;
1331
1515
  }
1332
1516
  break;
1333
1517
  case 'search':
1334
1518
  this.handlerSetDrawer(res);
1519
+ this.showMsg = false;
1520
+ this.showSet = false;
1335
1521
  break;
1336
1522
  case 'goView':
1337
1523
  util.win.open(res.path, '_blank');
@@ -1582,17 +1768,36 @@ export default {
1582
1768
  }
1583
1769
  },
1584
1770
  jumpMenu(res) {
1585
- let apps = res.split(',');
1771
+ let apps = res;
1772
+ if (typeof res === 'string') {
1773
+ apps = res.split(',');
1774
+ }
1586
1775
  let obj = this.getMenu(this.menus, apps[apps.length - 1]);
1587
1776
  if (obj) {
1588
1777
  let i = util.indexOfObj(this.tabs, obj, 'id');
1778
+ let n = util.indexOfObj(this.tabs, this.activeName, 'id');
1779
+ this.activeName = obj.id;
1589
1780
  if (i == -1) {
1590
- this.tabs.push(this.setIframeType(obj));
1781
+ let tab = this.setIframeType(obj);
1782
+ this.tabs.splice(n + 1, 0, tab);
1591
1783
  }
1592
- this.activeName = obj.id;
1593
1784
  } else {
1594
1785
  this.$message.error('没有此菜单!');
1595
1786
  }
1787
+ },
1788
+ //监听改变菜单
1789
+ handleListener() {
1790
+ util.win.addEventListener(
1791
+ 'message',
1792
+ (e) => {
1793
+ var msg = e.data;
1794
+ if (msg.key == 'jump_Menu') {
1795
+ let res = msg.data1;
1796
+ this.jumpMenu(res);
1797
+ }
1798
+ },
1799
+ false
1800
+ );
1596
1801
  }
1597
1802
  },
1598
1803
  beforeDestroy() {