eoss-ui 0.5.81-beta → 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 (109) hide show
  1. package/lib/button-group.js +50 -50
  2. package/lib/button.js +50 -50
  3. package/lib/checkbox-group.js +50 -50
  4. package/lib/data-table-form.js +50 -50
  5. package/lib/data-table.js +195 -174
  6. package/lib/date-picker.js +50 -50
  7. package/lib/dialog.js +50 -50
  8. package/lib/eoss-ui.common.js +2592 -1440
  9. package/lib/flow-group.js +50 -50
  10. package/lib/flow-list.js +53 -53
  11. package/lib/flow.js +71 -71
  12. package/lib/form.js +90 -52
  13. package/lib/handle-user.js +67 -54
  14. package/lib/handler.js +59 -53
  15. package/lib/icon.js +78 -58
  16. package/lib/index.js +1 -1
  17. package/lib/input-number.js +50 -50
  18. package/lib/input.js +50 -50
  19. package/lib/login.js +59 -56
  20. package/lib/main.js +2214 -1212
  21. package/lib/nav.js +50 -50
  22. package/lib/notify.js +55 -55
  23. package/lib/page.js +50 -50
  24. package/lib/player.js +50 -50
  25. package/lib/qr-code.js +50 -50
  26. package/lib/radio-group.js +50 -50
  27. package/lib/retrial-auth.js +51 -51
  28. package/lib/select-ganged.js +50 -50
  29. package/lib/select.js +51 -51
  30. package/lib/selector-panel.js +115 -67
  31. package/lib/selector.js +58 -54
  32. package/lib/sizer.js +50 -50
  33. package/lib/steps.js +50 -50
  34. package/lib/switch.js +50 -50
  35. package/lib/table-form.js +50 -50
  36. package/lib/tabs.js +50 -50
  37. package/lib/theme-chalk/base.css +1 -1
  38. package/lib/theme-chalk/button-group.css +1 -1
  39. package/lib/theme-chalk/data-table.css +1 -1
  40. package/lib/theme-chalk/form.css +1 -1
  41. package/lib/theme-chalk/handler.css +1 -1
  42. package/lib/theme-chalk/index.css +1 -1
  43. package/lib/theme-chalk/main.css +1 -1
  44. package/lib/theme-chalk/menu.css +1 -1
  45. package/lib/theme-chalk/nav.css +1 -1
  46. package/lib/theme-chalk/selector-panel.css +1 -1
  47. package/lib/theme-chalk/simplicity.css +1 -1
  48. package/lib/theme-chalk/sizer.css +1 -1
  49. package/lib/theme-chalk/tree.css +1 -1
  50. package/lib/theme-chalk/upload.css +1 -1
  51. package/lib/tips.js +50 -50
  52. package/lib/tree-group.js +50 -50
  53. package/lib/tree.js +50 -50
  54. package/lib/upload.js +63 -63
  55. package/lib/wujie.js +50 -50
  56. package/lib/wxlogin.js +50 -50
  57. package/package.json +2 -2
  58. package/packages/data-table/src/main.vue +53 -28
  59. package/packages/form/src/main.vue +38 -8
  60. package/packages/handle-user/src/main.vue +10 -3
  61. package/packages/handler/src/main.vue +2 -0
  62. package/packages/icon/src/main.vue +23 -6
  63. package/packages/login/src/main.vue +11 -4
  64. package/packages/main/src/default/index.vue +32 -109
  65. package/packages/main/src/main.vue +17 -16
  66. package/packages/main/src/simplicity/apps.vue +201 -133
  67. package/packages/main/src/simplicity/avatar.vue +16 -6
  68. package/packages/main/src/simplicity/handler.vue +77 -37
  69. package/packages/main/src/simplicity/index.vue +485 -199
  70. package/packages/main/src/simplicity/menu-list.vue +75 -22
  71. package/packages/main/src/simplicity/message.vue +35 -25
  72. package/packages/main/src/simplicity/notice.vue +72 -39
  73. package/packages/main/src/simplicity/router-page.vue +53 -0
  74. package/packages/main/src/simplicity/settings.vue +1 -1
  75. package/packages/main/src/simplicity/sub-menu.vue +163 -55
  76. package/packages/main/src/simplicity/user.vue +10 -5
  77. package/packages/main/src/simplicity/userinfo.vue +1 -0
  78. package/packages/select/src/main.vue +4 -1
  79. package/packages/selector/src/main.vue +6 -2
  80. package/packages/selector-panel/src/main.vue +22 -8
  81. package/packages/selector-panel/src/selection.vue +6 -0
  82. package/packages/theme-chalk/lib/base.css +1 -1
  83. package/packages/theme-chalk/lib/button-group.css +1 -1
  84. package/packages/theme-chalk/lib/data-table.css +1 -1
  85. package/packages/theme-chalk/lib/form.css +1 -1
  86. package/packages/theme-chalk/lib/handler.css +1 -1
  87. package/packages/theme-chalk/lib/index.css +1 -1
  88. package/packages/theme-chalk/lib/main.css +1 -1
  89. package/packages/theme-chalk/lib/menu.css +1 -1
  90. package/packages/theme-chalk/lib/nav.css +1 -1
  91. package/packages/theme-chalk/lib/selector-panel.css +1 -1
  92. package/packages/theme-chalk/lib/simplicity.css +1 -1
  93. package/packages/theme-chalk/lib/sizer.css +1 -1
  94. package/packages/theme-chalk/lib/tree.css +1 -1
  95. package/packages/theme-chalk/lib/upload.css +1 -1
  96. package/packages/theme-chalk/src/base.scss +5 -0
  97. package/packages/theme-chalk/src/button-group.scss +3 -3
  98. package/packages/theme-chalk/src/common/var.scss +6 -0
  99. package/packages/theme-chalk/src/data-table.scss +9 -12
  100. package/packages/theme-chalk/src/form.scss +2 -4
  101. package/packages/theme-chalk/src/handler.scss +5 -1
  102. package/packages/theme-chalk/src/login.scss +2 -2
  103. package/packages/theme-chalk/src/main.scss +2 -2
  104. package/packages/theme-chalk/src/nav.scss +3 -2
  105. package/packages/theme-chalk/src/selector-panel.scss +2 -1
  106. package/packages/theme-chalk/src/simplicity.scss +364 -61
  107. package/packages/theme-chalk/src/tree.scss +4 -2
  108. package/packages/upload/src/main.vue +3 -1
  109. 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>
@@ -57,7 +87,7 @@
57
87
  class="es-simplicity-side-app"
58
88
  v-if="_aiConfig"
59
89
  :style="_aibackground"
60
- @click="handlerClickAi"
90
+ @click="handlerSetDrawer(_aiConfig)"
61
91
  >
62
92
  <es-icon
63
93
  v-show="_aiConfig.icon"
@@ -71,63 +101,66 @@
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
- :color="menuColor"
85
- :backgroundColor="menuBackgroundColor"
86
- :menu-icon="menuIcon"
87
- v-bind="subMenus"
88
- @command="handlerClickMenu"
89
- ></sub-menu>
90
- </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>
91
116
  <!-- 菜单 end -->
92
117
 
93
118
  <!-- 应用 -->
94
- <el-drawer
95
- class="es-simplicity-apps"
96
- direction="ltr"
97
- modal-class="es-simplicity-apps-modal"
98
- size="90%"
99
- :modal-append-to-body="false"
100
- :with-header="false"
119
+ <apps
101
120
  :visible.sync="showApps"
102
- >
103
- <apps
104
- :menu-icon="menuIcon"
105
- :color="appColor"
106
- :backgroundColor="appBackgroundColor"
107
- :applications="applications"
108
- :business="business"
109
- :systems="systems"
110
- @click="handlerClickApp"
111
- ></apps>
112
- </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>
113
129
  <!-- 应用 end -->
114
130
 
115
131
  <!-- AI -->
116
132
  <el-drawer
117
- class="es-simplicity-subMenus"
133
+ class="es-simplicity-public-drawer"
118
134
  direction="ltr"
119
135
  modal-class="es-simplicity-apps-modal"
120
136
  size="100%"
137
+ show-close
121
138
  :modal-append-to-body="false"
122
- :with-header="false"
123
- :visible.sync="showAi"
139
+ :visible.sync="drawer.visible"
124
140
  >
125
- <iframe
126
- frameborder="0"
127
- width="100%"
128
- height="100%"
129
- :src="_aiConfig.url"
130
- ></iframe>
141
+ <!-- <i
142
+ class="es-icon-close es-simplicity-drawer-close"
143
+ @click="handleCloseDrawer"
144
+ ></i> -->
145
+ <template v-if="drawer.url">
146
+ <template v-if="isIE || drawer.method !== 'wujie'">
147
+ <iframe
148
+ frameborder="0"
149
+ width="100%"
150
+ height="100%"
151
+ :src="drawer.url"
152
+ ></iframe>
153
+ </template>
154
+ <template v-else>
155
+ <es-wujie
156
+ :show="true"
157
+ :props="wjProps"
158
+ :attrs="wjAttrs"
159
+ :name="drawer.name"
160
+ :url="drawer.url"
161
+ ></es-wujie>
162
+ </template>
163
+ </template>
131
164
  </el-drawer>
132
165
  <!-- AI end -->
133
166
 
@@ -136,7 +169,8 @@
136
169
  <el-card class="es-simplicity-tabs-handler" ref="tabsHandler">
137
170
  <div
138
171
  class="es-simplicity-tabs-handler-item"
139
- @click="handleTabsEvents(0)"
172
+ :class="{ 'is-disabled': isDisabled.refresh }"
173
+ @click="isDisabled.refresh ? '' : handleTabsEvents(0)"
140
174
  >
141
175
  刷新
142
176
  </div>
@@ -171,17 +205,24 @@
171
205
  </div>
172
206
  <el-tabs
173
207
  class="es-simplicity-iframe"
208
+ :class="{ 'is-open': showMenu, 'is-fold': fold }"
174
209
  v-model="activeName"
175
210
  closable
176
211
  hide-bar
177
- @tab-click="handleTab"
212
+ opacity
178
213
  @tab-remove="handleRemove"
179
214
  @tab-contextmenu="handleContextmenu"
180
215
  >
181
216
  <handler
182
217
  slot="append"
183
- :hide="hides"
184
- :notice="notice"
218
+ v-bind="handleConfig"
219
+ :data="handleData"
220
+ :hide="{
221
+ home: indexUrl ? false : true,
222
+ index: doorIndex ? false : true,
223
+ ...hides
224
+ }"
225
+ :notice-num="notice"
185
226
  @click="handleClick"
186
227
  ></handler>
187
228
  <el-tab-pane
@@ -212,10 +253,11 @@
212
253
  ></es-wujie>
213
254
  </template>
214
255
  <template v-else-if="item.method === 'router' && item.refresh">
215
- <router-view v-if="!isKeepAlive" :name="item.appCode" />
216
- <keep-alive>
217
- <router-view v-if="isKeepAlive" :name="item.appCode" />
218
- </keep-alive>
256
+ <router-page
257
+ v-bind="item"
258
+ :show="activeName == item.id"
259
+ :query="$parent.params"
260
+ ></router-page>
219
261
  </template>
220
262
  </el-tab-pane>
221
263
  </el-tabs>
@@ -271,8 +313,10 @@ import user from './user.vue';
271
313
  import message from './message.vue';
272
314
  import notice from './notice.vue';
273
315
  import settings from './settings.vue';
316
+ import routerPage from './router-page.vue';
274
317
  import {
275
318
  wss,
319
+ logout,
276
320
  topic,
277
321
  getUserAppWithTag,
278
322
  getComplexApplications,
@@ -282,37 +326,57 @@ import store from 'eoss-ui/src/utils/store';
282
326
  import util from 'eoss-ui/src/utils/util';
283
327
  const isIE = navigator.userAgent.indexOf('MSIE') != -1;
284
328
  let events = [
285
- (tabs, index) => {
329
+ (tabs, index, that) => {
286
330
  let tab = tabs[index];
287
331
 
288
332
  if (tab.method == 'iframe') {
289
333
  tabs[index].url = util.handlerUrl(tab.url);
290
334
  } else {
291
335
  tabs[index].refresh = false;
292
- this.$nextTick(() => {
336
+ that.$nextTick(() => {
293
337
  tabs[index].refresh = true;
294
338
  });
295
339
  }
296
340
  return tabs;
297
341
  },
298
- (tabs, index) => {
342
+ (tabs, index, that) => {
343
+ let i = util.indexOfObj(tabs, that.activeName, 'id');
344
+ if (tabs.length == 1) {
345
+ that.activeName = '';
346
+ } else if (i == index) {
347
+ if (index < tabs.length - 1) {
348
+ that.activeName = tabs[index + 1].id;
349
+ } else {
350
+ that.activeName = tabs[index - 1].id;
351
+ }
352
+ }
299
353
  tabs.splice(index, 1);
300
354
  return tabs;
301
355
  },
302
- (tabs, index) => {
303
- return tabs.slice(index, index + 1);
356
+ (tabs, index, that) => {
357
+ let tab = tabs.slice(index, index + 1);
358
+ that.activeName = tab[0].id;
359
+ return tab;
304
360
  },
305
- (tabs, index) => {
361
+ (tabs, index, that) => {
362
+ let i = util.indexOfObj(tabs, that.activeName, 'id');
363
+ if (i < index) {
364
+ that.activeName = tabs[index].id;
365
+ }
306
366
  tabs.splice(0, index);
307
367
  return tabs;
308
368
  },
309
- (tabs, index) => {
310
- tabs.slice(index + 1, tabs.length - index);
369
+ (tabs, index, that) => {
370
+ let i = util.indexOfObj(tabs, that.activeName, 'id');
371
+ if (i > index) {
372
+ that.activeName = tabs[index].id;
373
+ }
374
+ tabs.splice(index + 1, tabs.length - index);
311
375
  return tabs;
312
376
  }
313
377
  ];
314
378
  export default {
315
- name: 'EsMainSimplicity',
379
+ name: 'Simplicity',
316
380
  components: {
317
381
  avatar,
318
382
  handler,
@@ -321,9 +385,11 @@ export default {
321
385
  user,
322
386
  message,
323
387
  notice,
324
- settings
388
+ settings,
389
+ routerPage
325
390
  },
326
391
  props: {
392
+ appCode: String,
327
393
  //logo
328
394
  logo: String,
329
395
  //菜单、应用默认图标
@@ -338,8 +404,12 @@ export default {
338
404
  },
339
405
  //主题颜色选择颜色集合
340
406
  themes: Array,
407
+ //操作栏配置
408
+ handleData: Array,
409
+ //操作栏单项配置
410
+ handleConfig: Object,
341
411
  //需要隐藏的头部功能
342
- hides: [Object, Array],
412
+ hides: Object,
343
413
  //菜单颜色
344
414
  menuColor: [String, Array],
345
415
  //菜单背景颜色
@@ -397,7 +467,14 @@ export default {
397
467
  //无界微前端Props属性
398
468
  wjProps: Object,
399
469
  //无界微前端Attrs属性
400
- wjAttrs: Object
470
+ wjAttrs: Object,
471
+ //菜单宽度
472
+ menuWidth: {
473
+ type: Number,
474
+ default: 220
475
+ },
476
+ //路由方式
477
+ routeType: String
401
478
  },
402
479
  data() {
403
480
  return {
@@ -409,18 +486,26 @@ export default {
409
486
  mainLogo: this.logo,
410
487
  //侧边用户应用
411
488
  userApps: [],
489
+ //点击应用存侧边
490
+ newApps: [],
412
491
  //所有菜单
413
492
  menus: [],
493
+ //菜单名称
494
+ title: '',
414
495
  //子菜单
415
- subMenus: [],
496
+ subMenus: null,
416
497
  //展示菜单导航
417
498
  showMenu: false,
418
- //展示菜单导航宽度
419
- width: '296px',
499
+ //子菜单选中
500
+ subActive: '',
501
+ //折叠菜单
502
+ fold: false,
420
503
  //人工智能配置
421
504
  aiConfig: null,
422
- //展示人工智能界面
423
- showAi: false,
505
+ //公用窗口面板配置
506
+ drawer: {
507
+ visible: false
508
+ },
424
509
  //所有应用
425
510
  applications: [],
426
511
  //业务系统
@@ -449,6 +534,10 @@ export default {
449
534
  initApps: null,
450
535
  //首页地址
451
536
  indexUrl: '',
537
+ //首页配置
538
+ homePage: {},
539
+ //门户跳转页地址
540
+ doorIndex: '',
452
541
  //弹窗
453
542
  dialog: {},
454
543
  //消息列表展示状态
@@ -467,7 +556,11 @@ export default {
467
556
  //显示页签操作
468
557
  showTabsHandler: false,
469
558
  //页签对象
470
- pane: null
559
+ pane: null,
560
+ //选中菜单
561
+ active: '',
562
+ //单位名称
563
+ simpleUserInfo: {}
471
564
  };
472
565
  },
473
566
  computed: {
@@ -532,12 +625,14 @@ export default {
532
625
  const results = JSON.parse(mainConfig);
533
626
  this.init(results);
534
627
  }
628
+ this.doorIndex = sessionStorage.getItem('doorIndex');
535
629
  },
536
630
  mounted() {
537
631
  util.win.reLogin = this.handleReLogin;
538
632
  util.win.refresh = this.handleRefresh;
539
633
  util.win.jumpMenu = this.jumpMenu;
540
634
  util.win.windowOpen = this.openPage;
635
+ this.handleListener();
541
636
  },
542
637
  methods: {
543
638
  /**
@@ -545,13 +640,13 @@ export default {
545
640
  * @author huangbo
546
641
  * @date 2024年9月7日
547
642
  **/
548
- hasRouter(res, url, code, parentName) {
643
+ hasRouter(res, url, code) {
549
644
  if (!url) {
550
645
  return false;
551
646
  }
552
647
  if (Array.isArray(res)) {
553
648
  for (let i in res) {
554
- let path = this.hasRouter(res[i], url, code, parentName);
649
+ let path = this.hasRouter(res[i], url, code);
555
650
  if (path) {
556
651
  return path;
557
652
  }
@@ -562,24 +657,22 @@ export default {
562
657
  path = path.replace(path[1], path[1].toLowerCase());
563
658
  }
564
659
  let pathname = url.substring(url.indexOf('#/') + 1);
565
- pathname = pathname
566
- .replace(pathname[1], pathname[1].toLowerCase())
567
- .split('?')[0];
660
+ pathname = pathname.split('?')[0];
568
661
  if (res.path !== '/' && pathname == path) {
569
- if (typeof res.component === 'function') {
570
- let component = {};
571
- component[code] = res.component;
572
- res.component = component;
573
- if (parentName) {
574
- this.$router.addRoute({ parentName, route: res });
575
- } else {
576
- this.$router.addRoute(res);
662
+ if (res.components) {
663
+ if (!res.components[code]) {
664
+ console.error('“命名视图”规范属性名称与菜单appCode不一致', res);
577
665
  }
666
+ } else {
667
+ console.error(
668
+ '请根据“命名视图”规范,正确添加components属性名称',
669
+ res
670
+ );
578
671
  }
579
672
  return pathname;
580
673
  }
581
674
  if (res && Object.prototype.hasOwnProperty.call(res, 'children')) {
582
- let path = this.hasRouter(res.children, url, code, parentName);
675
+ let path = this.hasRouter(res.children, url, code);
583
676
  if (path) {
584
677
  return path;
585
678
  }
@@ -596,7 +689,6 @@ export default {
596
689
  this.setConfig(results);
597
690
  if (this.remote) {
598
691
  this.getApplications();
599
- this.getMenus();
600
692
  }
601
693
  },
602
694
  /**
@@ -716,6 +808,7 @@ export default {
716
808
  * @date 2024年9月7日
717
809
  **/
718
810
  getApplications() {
811
+ let loading = util.loading('', '加载中...');
719
812
  util
720
813
  .ajax({
721
814
  url: this.appsUrl,
@@ -739,12 +832,15 @@ export default {
739
832
  } else {
740
833
  this.$message.error('未分配应用菜单权限,请联系管理员!');
741
834
  }
835
+ this.getMenus(loading);
742
836
  } else {
837
+ loading.close();
743
838
  let msg = res.msg || '系统错误,请联系管理员!';
744
839
  this.$message.error(msg);
745
840
  }
746
841
  })
747
842
  .catch((err) => {
843
+ loading.close();
748
844
  if (err.message && err.message !== 'canceled') {
749
845
  this.$message.error(err.message);
750
846
  }
@@ -755,41 +851,106 @@ export default {
755
851
  * @author huangbo
756
852
  * @date 2024年9月7日
757
853
  **/
758
- getMenus(appCode, url) {
759
- let params = appCode ? { menuCode: appCode } : {};
854
+ getMenus(loading) {
760
855
  util
761
- .ajax({ url: url || this._menuUrl, params: params })
856
+ .ajax({ url: this._menuUrl })
762
857
  .then((res) => {
858
+ loading.close();
763
859
  if (res.rCode === 0) {
764
860
  if (res.results && res.results.length) {
765
861
  this.menus = res.results;
766
862
  this.setTips(this.menus);
767
863
  store.set('nav', this.menus);
768
- if (this.indexUrl) {
769
- let obj = this.getMenu(this.menus, this.indexUrl);
770
- if (obj) {
771
- this.tabs = [this.setIframeType(obj)];
772
- this.activeName = obj.id;
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
+ }
880
+ }
881
+ let subMenus = this.getMenu(
882
+ this.menus,
883
+ this.appCode,
884
+ 'appCode'
885
+ );
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;
773
900
  } else {
774
- this.tabs = [
775
- this.setIframeType({
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({
776
916
  url: this.indexUrl,
777
917
  text: '工作台',
778
918
  id: '0',
779
919
  appCode: 'indexUrl'
780
- })
781
- ];
782
- this.activeName = '0';
783
- }
784
- }
785
- if (this.initApps && this.initApps.length) {
786
- let obj = this.getMenu(
787
- this.menus,
788
- this.initApps[this.initApps.length - 1]
789
- );
790
- if (obj) {
791
- this.tabs.push(this.setIframeType(obj));
792
- this.activeName = obj.id;
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
+ }
793
954
  }
794
955
  }
795
956
  } else {
@@ -801,19 +962,22 @@ export default {
801
962
  }
802
963
  })
803
964
  .catch((err) => {
965
+ loading.close();
804
966
  if (err.message && err.message !== 'canceled') {
805
967
  this.$message.error(err.message);
806
968
  }
807
969
  });
808
970
  },
971
+ /**
972
+ * @desc:设置页面加载类型
973
+ * @author huangbo
974
+ * @date 2024年9月7日
975
+ **/
809
976
  setIframeType(res) {
810
977
  let { url } = res;
811
978
  let urls = url.split('?');
812
979
  if (urls[0].indexOf('.js') > 1 && !isIE) {
813
980
  res.method = 'wujie';
814
- this.$nextTick(() => {
815
- res.refresh = true;
816
- });
817
981
  } else if (
818
982
  urls[0].indexOf('.dhtml') > 0 ||
819
983
  (urls[0].indexOf('.html') > 0 && urls[0].indexOf('.html#') === -1)
@@ -826,15 +990,9 @@ export default {
826
990
  const routes = this.$router.options.routes;
827
991
  if (routes) {
828
992
  let path = this.hasRouter(routes, urls[0], res.appCode);
829
- if (path) {
830
- let params = util.getParams({ url: url });
831
- this.$router.push({
832
- path: path,
833
- query: params
834
- });
835
- this.$nextTick(() => {
836
- res.refresh = true;
837
- });
993
+ if (path && this.routeType !== 'wujie') {
994
+ res.method = 'router';
995
+ res.path = path;
838
996
  } else {
839
997
  let urlopenmode = util.getParams({
840
998
  url: url,
@@ -849,9 +1007,6 @@ export default {
849
1007
  res.method = 'iframe';
850
1008
  } else {
851
1009
  res.method = 'wujie';
852
- this.$nextTick(() => {
853
- res.refresh = true;
854
- });
855
1010
  }
856
1011
  }
857
1012
  } else if (
@@ -859,14 +1014,12 @@ export default {
859
1014
  urls[0].indexOf('/#/') > -1
860
1015
  ) {
861
1016
  res.method = 'wujie';
862
- this.$nextTick(() => {
863
- res.refresh = true;
864
- });
865
1017
  } else {
866
1018
  res.method = 'iframe';
867
1019
  }
868
1020
  }
869
1021
  }
1022
+ res.refresh = true;
870
1023
  return res;
871
1024
  },
872
1025
  /**
@@ -878,10 +1031,11 @@ export default {
878
1031
  if (Array.isArray(menus)) {
879
1032
  for (let i = 0; i < menus.length; i++) {
880
1033
  let item = menus[i];
881
- if (key && item[key] === res) {
882
- return item;
883
- }
884
- if (item.url === res || item.id === res) {
1034
+ if (key) {
1035
+ if (item[key] === res) {
1036
+ return item;
1037
+ }
1038
+ } else if (item.url === res || item.id === res) {
885
1039
  return item;
886
1040
  }
887
1041
  if (
@@ -905,6 +1059,37 @@ export default {
905
1059
  }
906
1060
  return false;
907
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
+ },
908
1093
  /**
909
1094
  * @desc:遍历设置菜单气泡提醒
910
1095
  * @author huangbo
@@ -924,31 +1109,30 @@ export default {
924
1109
  this.$set(obj, 'tips', false);
925
1110
  delete obj.tips;
926
1111
  }
927
- let flag = false;
1112
+ let flag = 0;
928
1113
  if (obj.children && obj.children.length) {
929
1114
  obj.children.forEach((item) => {
930
- if (this.setTips(item)) {
931
- flag = true;
932
- }
1115
+ let n = this.setTips(item);
1116
+ flag += n ? parseInt(n) : 0;
933
1117
  });
934
1118
  if (flag) {
935
- this.$set(obj, 'tips', true);
936
- return true;
1119
+ this.$set(obj, 'tips', flag);
1120
+ return flag;
937
1121
  }
938
1122
  } else if (obj.fourthTabs && obj.fourthTabs.length) {
939
1123
  obj.fourthTabs.forEach((item) => {
940
- if (this.setTips(item)) {
941
- flag = true;
942
- }
1124
+ let n = this.setTips(item);
1125
+ flag += n ? parseInt(n) : 0;
943
1126
  });
944
1127
  if (flag) {
945
- this.$set(obj, 'tips', true);
946
- return true;
1128
+ this.$set(obj, 'tips', flag);
1129
+ return flag;
947
1130
  }
948
1131
  } else {
949
- if (this.menuTips[obj.id] && Number(this.menuTips[obj.id])) {
950
- this.$set(obj, 'tips', Number(this.menuTips[obj.id]));
951
- 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];
952
1136
  }
953
1137
  }
954
1138
  }
@@ -1019,12 +1203,35 @@ export default {
1019
1203
  }
1020
1204
  });
1021
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
+ },
1022
1226
  /**
1023
1227
  * @desc:侧边应用菜单点击
1024
1228
  * @author huangbo
1025
1229
  * @date 2024年9月7日
1026
1230
  **/
1027
1231
  handlerClickApp(res) {
1232
+ this.showMsg = false;
1233
+ this.showSet = false;
1234
+ this.fold = false;
1028
1235
  if (res) {
1029
1236
  if (res.permission === false) {
1030
1237
  return false;
@@ -1036,38 +1243,75 @@ export default {
1036
1243
  this.subMenus = res;
1037
1244
  this.showMenu = true;
1038
1245
  this.showApps = false;
1039
- } else {
1040
- if (res.code) {
1041
- this.subMenus = this.getMenu(this.menus, res.code, 'appCode');
1042
- this.showMenu = true;
1043
- this.showApps = false;
1044
- }
1045
1246
  }
1247
+ let set = true;
1046
1248
  if (res.url) {
1047
1249
  if (res.urlopenmode == 1 || res.openModel == 1) {
1250
+ set = false;
1048
1251
  util.win.open(res.url);
1049
1252
  } else if (res.urlopenmode == 2 || res.openModel == 2) {
1253
+ set = false;
1050
1254
  util.win.location.href = res.url;
1051
1255
  } else {
1052
1256
  let i = util.indexOfObj(this.tabs, res, 'id');
1053
1257
  this.activeName = res.id;
1054
1258
  if (i == -1) {
1055
- 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);
1056
1287
  }
1057
1288
  }
1058
- } else {
1059
1289
  }
1290
+ this.active = res.id;
1060
1291
  } else {
1061
1292
  this.showApps = !this.showApps;
1062
1293
  }
1063
1294
  },
1064
1295
  /**
1065
- * @desc:显示人工智能界面
1296
+ * @desc:显示Drawer界面
1066
1297
  * @author huangbo
1067
1298
  * @date 2024年9月7日
1068
1299
  **/
1069
- handlerClickAi() {
1070
- this.showAi = !this.showAi;
1300
+ handlerSetDrawer(res) {
1301
+ this.drawer.visible = !this.drawer.visible;
1302
+ this.drawer.mounted = res.mounted;
1303
+ this.drawer.url = res.url;
1304
+ if (res.mounted === 'wujie') {
1305
+ this.drawer.name = res.name || util.uuid();
1306
+ }
1307
+ },
1308
+ /**
1309
+ * @desc:关闭Drawer界面
1310
+ * @author huangbo
1311
+ * @date 2024年9月7日
1312
+ **/
1313
+ handleCloseDrawer() {
1314
+ this.drawer = { visible: false };
1071
1315
  },
1072
1316
  /**
1073
1317
  * @desc:菜单点击
@@ -1075,17 +1319,24 @@ export default {
1075
1319
  * @date 2024年9月7日
1076
1320
  **/
1077
1321
  handlerClickMenu(res) {
1078
- if (typeof res === 'number') {
1079
- let num = 296;
1080
- this.width = num * res + 'px';
1081
- } else {
1082
- let i = util.indexOfObj(this.tabs, res, 'id');
1083
- this.activeName = res.id;
1084
- if (i == -1) {
1085
- this.tabs.push(this.setIframeType(res));
1086
- }
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);
1087
1329
  }
1088
1330
  },
1331
+
1332
+ /**
1333
+ * @desc:用户详情请求成功
1334
+ * @author huangbo
1335
+ * @date 2024年9月7日
1336
+ **/
1337
+ handleSuccess(res) {
1338
+ this.simpleUserInfo = res.simpleUserInfo;
1339
+ },
1089
1340
  /**
1090
1341
  * @desc:修改用户配置
1091
1342
  * @author huangbo
@@ -1120,35 +1371,20 @@ export default {
1120
1371
  this.webSocket.destroy();
1121
1372
  }
1122
1373
  },
1123
- /**
1124
- * @desc:选中iframe页签刷新
1125
- * @author huangbo
1126
- * @date 2024年9月7日
1127
- **/
1128
- handleTab(res) {
1129
- let index;
1130
- if (res) {
1131
- index = parseInt(res.index);
1132
- } else {
1133
- index = util.indexOfObj(this.tabs, this.activeName, 'id');
1134
- }
1135
- let item = this.tabs[index];
1136
- if (item.method == 'iframe') {
1137
- item.url = util.handlerUrl(item.url);
1138
- } else {
1139
- item.refresh = false;
1140
- this.$nextTick(() => {
1141
- item.refresh = true;
1142
- });
1143
- }
1144
- },
1145
1374
  /**
1146
1375
  * @desc:刷新选中iframe页签
1147
1376
  * @author huangbo
1148
1377
  * @date 2024年9月7日
1149
1378
  **/
1150
1379
  handleRefresh() {
1151
- 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
+ });
1152
1388
  },
1153
1389
  /**
1154
1390
  * @desc:删除iframe
@@ -1156,9 +1392,17 @@ export default {
1156
1392
  * @date 2024年9月7日
1157
1393
  **/
1158
1394
  handleRemove(name) {
1395
+ let len = this.tabs.length - 1;
1159
1396
  let i = util.indexOfObj(this.tabs, name, 'id');
1160
1397
  if (i > -1) {
1161
1398
  this.tabs.splice(i, 1);
1399
+ if (this.tabs.length == 0) {
1400
+ this.activeName = '';
1401
+ } else if (i == len) {
1402
+ this.activeName = this.tabs[len - 1].id;
1403
+ } else {
1404
+ this.activeName = this.tabs[i].id;
1405
+ }
1162
1406
  }
1163
1407
  },
1164
1408
  /**
@@ -1178,6 +1422,9 @@ export default {
1178
1422
  if (this.tabs.length == 1) {
1179
1423
  disabled.other = true;
1180
1424
  }
1425
+ if (this.tabs[index].id != this.activeName) {
1426
+ disabled.refresh = true;
1427
+ }
1181
1428
  this.isDisabled = disabled;
1182
1429
  this.$refs.tabsHandler.$el.style.setProperty('left', `${e.x}px`);
1183
1430
  this.$refs.tabsHandler.$el.style.setProperty('top', `${e.y}px`);
@@ -1192,7 +1439,7 @@ export default {
1192
1439
  **/
1193
1440
  handleTabsEvents(num) {
1194
1441
  if (this.pane !== null) {
1195
- this.tabs = events[num](this.tabs, this.pane);
1442
+ this.tabs = events[num](this.tabs, this.pane, this);
1196
1443
  }
1197
1444
  this.showTabsHandler = false;
1198
1445
  window.removeEventListener('click', this.closeTabsEvents);
@@ -1226,6 +1473,8 @@ export default {
1226
1473
  this.handleQuit();
1227
1474
  break;
1228
1475
  case 'online':
1476
+ this.showMsg = false;
1477
+ this.showSet = false;
1229
1478
  if (this.onlineUrl) {
1230
1479
  this.dialog = {
1231
1480
  title: '查看在线人员',
@@ -1236,9 +1485,27 @@ export default {
1236
1485
  break;
1237
1486
  case 'notice':
1238
1487
  this.showMsg = !this.showMsg;
1488
+ this.showSet = false;
1239
1489
  break;
1240
1490
  case 'set':
1241
1491
  this.showSet = !this.showSet;
1492
+ this.showMsg = false;
1493
+ break;
1494
+ case 'home':
1495
+ if (this.homePage.id !== this.activeName) {
1496
+ let i = util.indexOfObj(this.tabs, this.homePage.id, 'id');
1497
+ if (i == -1) {
1498
+ this.tabs.unshift(this.homePage);
1499
+ }
1500
+ this.activeName = this.homePage.id;
1501
+ this.showMsg = false;
1502
+ this.showSet = false;
1503
+ }
1504
+ break;
1505
+ case 'search':
1506
+ this.handlerSetDrawer(res);
1507
+ this.showMsg = false;
1508
+ this.showSet = false;
1242
1509
  break;
1243
1510
  case 'goView':
1244
1511
  util.win.open(res.path, '_blank');
@@ -1489,17 +1756,36 @@ export default {
1489
1756
  }
1490
1757
  },
1491
1758
  jumpMenu(res) {
1492
- let apps = res.split(',');
1759
+ let apps = res;
1760
+ if (typeof res === 'string') {
1761
+ apps = res.split(',');
1762
+ }
1493
1763
  let obj = this.getMenu(this.menus, apps[apps.length - 1]);
1494
1764
  if (obj) {
1495
1765
  let i = util.indexOfObj(this.tabs, obj, 'id');
1766
+ let n = util.indexOfObj(this.tabs, this.activeName, 'id');
1767
+ this.activeName = obj.id;
1496
1768
  if (i == -1) {
1497
- this.tabs.push(this.setIframeType(obj));
1769
+ let tab = this.setIframeType(obj);
1770
+ this.tabs.splice(n + 1, 0, tab);
1498
1771
  }
1499
- this.activeName = obj.id;
1500
1772
  } else {
1501
1773
  this.$message.error('没有此菜单!');
1502
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
+ );
1503
1789
  }
1504
1790
  },
1505
1791
  beforeDestroy() {