eoss-ui 0.5.81-beta8 → 0.5.82

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 (126) hide show
  1. package/lib/button-group.js +82 -55
  2. package/lib/button.js +57 -48
  3. package/lib/checkbox-group.js +55 -47
  4. package/lib/clients.js +4 -3
  5. package/lib/config/api.js +3 -1
  6. package/lib/data-table-form.js +55 -47
  7. package/lib/data-table.js +473 -276
  8. package/lib/date-picker.js +69 -59
  9. package/lib/dialog.js +77 -72
  10. package/lib/eoss-ui.common.js +4299 -3288
  11. package/lib/flow-group.js +102 -65
  12. package/lib/flow-list.js +56 -48
  13. package/lib/flow.js +158 -85
  14. package/lib/form.js +88 -59
  15. package/lib/handle-user.js +66 -51
  16. package/lib/handler.js +69 -50
  17. package/lib/icon.js +55 -47
  18. package/lib/index.js +1 -1
  19. package/lib/input-number.js +55 -47
  20. package/lib/input.js +55 -47
  21. package/lib/login.js +104 -85
  22. package/lib/main.js +1684 -1158
  23. package/lib/menu.js +1 -1
  24. package/lib/nav.js +55 -47
  25. package/lib/notify.js +54 -50
  26. package/lib/page.js +55 -47
  27. package/lib/pagination.js +3723 -3
  28. package/lib/player.js +60 -52
  29. package/lib/qr-code.js +55 -47
  30. package/lib/radio-group.js +55 -47
  31. package/lib/retrial-auth.js +56 -48
  32. package/lib/select-ganged.js +55 -47
  33. package/lib/select.js +55 -47
  34. package/lib/selector-panel.js +69 -60
  35. package/lib/selector.js +495 -424
  36. package/lib/sizer.js +55 -47
  37. package/lib/steps.js +55 -47
  38. package/lib/switch.js +55 -47
  39. package/lib/table-form.js +55 -47
  40. package/lib/tabs.js +1532 -1480
  41. package/lib/theme-chalk/base.css +1 -1
  42. package/lib/theme-chalk/button-group.css +1 -1
  43. package/lib/theme-chalk/data-table.css +1 -1
  44. package/lib/theme-chalk/form.css +1 -1
  45. package/lib/theme-chalk/index.css +1 -1
  46. package/lib/theme-chalk/main.css +1 -1
  47. package/lib/theme-chalk/menu.css +1 -1
  48. package/lib/theme-chalk/pagination.css +1 -1
  49. package/lib/theme-chalk/simplicity.css +1 -1
  50. package/lib/theme-chalk/sizer.css +1 -1
  51. package/lib/theme-chalk/tabs.css +1 -1
  52. package/lib/theme-chalk/toolbar.css +1 -1
  53. package/lib/theme-chalk/tree-group.css +1 -1
  54. package/lib/theme-chalk/tree.css +1 -1
  55. package/lib/theme-chalk/upload.css +1 -1
  56. package/lib/tips.js +55 -47
  57. package/lib/tree-group.js +79 -50
  58. package/lib/tree.js +55 -47
  59. package/lib/upload.js +59 -51
  60. package/lib/utils/util.js +6 -2
  61. package/lib/wujie.js +55 -47
  62. package/lib/wxlogin.js +55 -47
  63. package/package.json +3 -3
  64. package/packages/button/src/main.vue +2 -1
  65. package/packages/button-group/src/main.vue +8 -6
  66. package/packages/clients/src/main.vue +2 -1
  67. package/packages/data-table/src/column.vue +137 -54
  68. package/packages/data-table/src/main.vue +77 -68
  69. package/packages/data-table/src/sizer.vue +2 -0
  70. package/packages/date-picker/src/main.vue +22 -14
  71. package/packages/dialog/src/main.vue +17 -23
  72. package/packages/flow/src/main.vue +32 -17
  73. package/packages/flow-group/src/main.vue +18 -11
  74. package/packages/form/src/main.vue +21 -10
  75. package/packages/handle-user/src/main.vue +5 -1
  76. package/packages/handler/src/main.vue +7 -3
  77. package/packages/login/src/main.vue +22 -15
  78. package/packages/main/src/default/index.vue +111 -179
  79. package/packages/main/src/main.vue +233 -4
  80. package/packages/main/src/public/online.vue +89 -0
  81. package/packages/main/src/simplicity/apps.vue +3 -3
  82. package/packages/main/src/simplicity/avatar.vue +16 -5
  83. package/packages/main/src/simplicity/handler.vue +6 -2
  84. package/packages/main/src/simplicity/index.vue +314 -238
  85. package/packages/main/src/simplicity/menu-list.vue +22 -74
  86. package/packages/main/src/simplicity/router-page.vue +5 -14
  87. package/packages/main/src/simplicity/sub-menu.vue +111 -7
  88. package/packages/main/src/simplicity/user.vue +5 -1
  89. package/packages/menu/src/main.vue +4 -3
  90. package/packages/pagination/src/main.vue +20 -1
  91. package/packages/selector/src/main.vue +147 -135
  92. package/packages/selector-panel/src/main.vue +3 -2
  93. package/packages/selector-panel/src/selection.vue +2 -2
  94. package/packages/tabs/src/main.vue +25 -15
  95. package/packages/theme-chalk/lib/base.css +1 -1
  96. package/packages/theme-chalk/lib/button-group.css +1 -1
  97. package/packages/theme-chalk/lib/data-table.css +1 -1
  98. package/packages/theme-chalk/lib/form.css +1 -1
  99. package/packages/theme-chalk/lib/index.css +1 -1
  100. package/packages/theme-chalk/lib/main.css +1 -1
  101. package/packages/theme-chalk/lib/menu.css +1 -1
  102. package/packages/theme-chalk/lib/pagination.css +1 -1
  103. package/packages/theme-chalk/lib/simplicity.css +1 -1
  104. package/packages/theme-chalk/lib/sizer.css +1 -1
  105. package/packages/theme-chalk/lib/tabs.css +1 -1
  106. package/packages/theme-chalk/lib/toolbar.css +1 -1
  107. package/packages/theme-chalk/lib/tree-group.css +1 -1
  108. package/packages/theme-chalk/lib/tree.css +1 -1
  109. package/packages/theme-chalk/lib/upload.css +1 -1
  110. package/packages/theme-chalk/src/base.scss +39 -0
  111. package/packages/theme-chalk/src/button-group.scss +16 -2
  112. package/packages/theme-chalk/src/common/var.scss +7 -2
  113. package/packages/theme-chalk/src/data-table.scss +60 -23
  114. package/packages/theme-chalk/src/form.scss +42 -40
  115. package/packages/theme-chalk/src/main.scss +11 -0
  116. package/packages/theme-chalk/src/pagination.scss +7 -0
  117. package/packages/theme-chalk/src/simplicity.scss +108 -40
  118. package/packages/theme-chalk/src/tabs.scss +24 -28
  119. package/packages/theme-chalk/src/toolbar.scss +16 -4
  120. package/packages/theme-chalk/src/tree-group.scss +8 -0
  121. package/packages/theme-chalk/src/tree.scss +19 -6
  122. package/packages/tree-group/src/main.vue +16 -7
  123. package/src/config/api.js +3 -1
  124. package/src/index.js +157 -157
  125. package/src/utils/util.js +6 -1
  126. package/CHANGELOG.md +0 -929
@@ -10,9 +10,11 @@
10
10
  placement="right-start"
11
11
  width="360"
12
12
  trigger="click"
13
+ @show="showUserInfo"
13
14
  >
14
15
  <!-- 用户信息 -->
15
16
  <user
17
+ v-if="showUser"
16
18
  :user="user"
17
19
  :notifyList="notifyList"
18
20
  :notify="notify"
@@ -21,7 +23,7 @@
21
23
  @change="handleChangeConfig"
22
24
  @close="handlerClose"
23
25
  ></user>
24
- <avatar slot="reference" :user="user"> </avatar>
26
+ <avatar slot="reference" :user="user" :size="56"> </avatar>
25
27
  <!-- 用户信息 end -->
26
28
  </el-popover>
27
29
  <div class="es-simplicity-side-Application">
@@ -56,6 +58,28 @@
56
58
  ></es-icon>
57
59
  <div class="es-simplicity-side-app-text">更多</div>
58
60
  </div>
61
+ <div
62
+ class="es-simplicity-side-app"
63
+ v-for="(item, index) in newApps"
64
+ :class="{ 'is-active': active == item.id }"
65
+ :key="item.id"
66
+ :title="item.text || item.name"
67
+ @click.stop="handlerClickApp(item)"
68
+ >
69
+ <i
70
+ class="el-icon-circle-close"
71
+ @click.stop="handleDelete(index)"
72
+ ></i>
73
+ <el-badge v-bind="getBadge(item)">
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>
59
83
  </el-scrollbar>
60
84
  <!-- 常用应用 end -->
61
85
  </div>
@@ -76,22 +100,6 @@
76
100
  </div>
77
101
  </div>
78
102
  <div class="es-simplicity-main">
79
- <!-- 菜单 -->
80
- <sub-menu
81
- ref="subMenus"
82
- :visible.sync="showMenu"
83
- :fold.sync="fold"
84
- :size="menuWidth"
85
- :title="title"
86
- :color="menuColor"
87
- :backgroundColor="menuBackgroundColor"
88
- :menu-icon="menuIcon"
89
- :active="subActive"
90
- v-bind="subMenus"
91
- @command="handlerClickMenu"
92
- ></sub-menu>
93
- <!-- 菜单 end -->
94
-
95
103
  <!-- 应用 -->
96
104
  <apps
97
105
  :visible.sync="showApps"
@@ -101,7 +109,7 @@
101
109
  :applications="applications"
102
110
  :business="business"
103
111
  :systems="systems"
104
- @click="handlerClickApp"
112
+ @click="handlerClickApps"
105
113
  ></apps>
106
114
  <!-- 应用 end -->
107
115
 
@@ -190,6 +198,7 @@
190
198
  @tab-remove="handleRemove"
191
199
  @tab-contextmenu="handleContextmenu"
192
200
  >
201
+ <!-- 操作栏 -->
193
202
  <handler
194
203
  slot="append"
195
204
  v-bind="handleConfig"
@@ -199,43 +208,55 @@
199
208
  index: doorIndex ? false : true,
200
209
  ...hides
201
210
  }"
211
+ :online="userNums"
202
212
  :notice-num="notice"
203
213
  @click="handleClick"
204
214
  ></handler>
215
+ <!-- 操作栏 end-->
216
+
217
+ <!-- 菜单 -->
218
+ <sub-menu
219
+ :mode="mode"
220
+ :visible.sync="showMenu"
221
+ :closed.sync="fold"
222
+ :size="menuWidth"
223
+ :title="title"
224
+ :color="menuColor"
225
+ :backgroundColor="menuBackgroundColor"
226
+ :menu-icon="menuIcon"
227
+ :active="subActive"
228
+ v-bind="subMenus"
229
+ @command="handlerClickMenu"
230
+ ></sub-menu>
231
+ <!-- 菜单 end -->
205
232
  <el-tab-pane
206
233
  v-for="item in tabs"
207
234
  :key="item.id"
208
235
  :label="item.text || item.name"
209
236
  :name="item.id"
210
237
  >
211
- <template
238
+ <iframe
212
239
  v-if="(isIE && item.method !== 'router') || item.method == 'iframe'"
213
- >
214
- <iframe
215
- :id="iframeId"
216
- :name="iframeId"
217
- frameborder="0"
218
- width="100%"
219
- height="100%"
220
- :src="item.url"
221
- ></iframe>
222
- </template>
223
- <template v-else-if="item.method === 'wujie' && item.refresh">
224
- <es-wujie
225
- :show="true"
226
- :props="wjProps"
227
- :attrs="wjAttrs"
228
- :name="item.appCode"
229
- :url="item.url"
230
- ></es-wujie>
231
- </template>
232
- <template v-else-if="item.method === 'router' && item.refresh">
233
- <router-page
234
- v-bind="item"
235
- :show="activeName == item.id"
236
- :query="$parent.params"
237
- ></router-page>
238
- </template>
240
+ :id="activeName == item.id ? iframeId : ''"
241
+ :name="activeName == item.id ? iframeId : ''"
242
+ frameborder="0"
243
+ width="100%"
244
+ height="100%"
245
+ :src="item.url"
246
+ ></iframe>
247
+ <es-wujie
248
+ v-else-if="item.method === 'wujie' && item.refresh"
249
+ :show="true"
250
+ :props="wjProps"
251
+ :attrs="wjAttrs"
252
+ :name="item.appCode"
253
+ :url="item.url"
254
+ ></es-wujie>
255
+ <router-page
256
+ v-else-if="item.method === 'router' && item.refresh"
257
+ v-bind="item"
258
+ :query="$parent.params"
259
+ ></router-page>
239
260
  </el-tab-pane>
240
261
  </el-tabs>
241
262
  <!-- 路由、iframe end -->
@@ -268,8 +289,11 @@
268
289
 
269
290
  <!-- 公用弹窗 -->
270
291
  <es-dialog :title="dialog.title" :visible.sync="dialog.show" size="md">
292
+ <template v-if="dialog.title == '查看在线人员' && !dialog.src">
293
+ <online></online>
294
+ </template>
271
295
  <iframe
272
- v-if="dialog.show"
296
+ v-else-if="dialog.show"
273
297
  width="100%"
274
298
  height="100%"
275
299
  frameborder="0"
@@ -291,17 +315,20 @@ import message from './message.vue';
291
315
  import notice from './notice.vue';
292
316
  import settings from './settings.vue';
293
317
  import routerPage from './router-page.vue';
318
+ import online from '../public/online.vue';
294
319
  import {
295
320
  wss,
296
321
  logout,
297
322
  topic,
298
323
  getUserAppWithTag,
324
+ recordUserApp,
299
325
  getComplexApplications,
300
326
  getComplexApplicationsNew
301
327
  } from 'eoss-ui/src/config/api.js';
302
328
  import store from 'eoss-ui/src/utils/store';
303
329
  import util from 'eoss-ui/src/utils/util';
304
330
  const isIE = navigator.userAgent.indexOf('MSIE') != -1;
331
+ const dataTableMode = util.win.dataTableMode || 'default';
305
332
  let events = [
306
333
  (tabs, index, that) => {
307
334
  let tab = tabs[index];
@@ -354,6 +381,13 @@ let events = [
354
381
  ];
355
382
  export default {
356
383
  name: 'Simplicity',
384
+ provide() {
385
+ return {
386
+ esMain: this,
387
+ refresh: this.handleRefresh,
388
+ jumpMenu: this.jumpMenu
389
+ };
390
+ },
357
391
  components: {
358
392
  avatar,
359
393
  handler,
@@ -363,9 +397,21 @@ export default {
363
397
  message,
364
398
  notice,
365
399
  settings,
366
- routerPage
400
+ routerPage,
401
+ online
367
402
  },
368
403
  props: {
404
+ //模式
405
+ mode: {
406
+ type: String,
407
+ default: dataTableMode
408
+ },
409
+ //记录菜单点击率作为工作台常用应用数据
410
+ recordApp: {
411
+ type: Boolean,
412
+ default: true
413
+ },
414
+ sysCode: String,
369
415
  appCode: String,
370
416
  //logo
371
417
  logo: String,
@@ -455,6 +501,8 @@ export default {
455
501
  },
456
502
  data() {
457
503
  return {
504
+ //显示用户信息
505
+ showUser: false,
458
506
  //主题色
459
507
  themeColor: this.theme,
460
508
  //是否ie浏览器
@@ -463,6 +511,8 @@ export default {
463
511
  mainLogo: this.logo,
464
512
  //侧边用户应用
465
513
  userApps: [],
514
+ //点击应用存侧边
515
+ newApps: [],
466
516
  //所有菜单
467
517
  menus: [],
468
518
  //菜单名称
@@ -515,8 +565,11 @@ export default {
515
565
  doorIndex: '',
516
566
  //弹窗
517
567
  dialog: {},
568
+ //在线人数
569
+ userNums: 1,
518
570
  //消息列表展示状态
519
571
  showMsg: false,
572
+ //消息数
520
573
  notice: 0,
521
574
  //即时消息
522
575
  sysMsg: [],
@@ -575,9 +628,7 @@ export default {
575
628
  //在线人数列表地址
576
629
  onlineUrl() {
577
630
  if (this.onlineView) {
578
- return typeof this.onlineView == 'string'
579
- ? this.onlineView
580
- : '/main/sysuseronline/list.dhtml';
631
+ return typeof this.onlineView == 'string' ? this.onlineView : '';
581
632
  }
582
633
  return false;
583
634
  }
@@ -598,15 +649,13 @@ export default {
598
649
  let mainConfig = util.getStorage('mainConfig');
599
650
  if (mainConfig) {
600
651
  const results = JSON.parse(mainConfig);
601
- this.init(results);
652
+ if (Object.keys(results).length) {
653
+ this.init(results);
654
+ }
602
655
  }
603
656
  this.doorIndex = sessionStorage.getItem('doorIndex');
604
657
  },
605
658
  mounted() {
606
- util.win.reLogin = this.handleReLogin;
607
- util.win.refresh = this.handleRefresh;
608
- util.win.jumpMenu = this.jumpMenu;
609
- util.win.windowOpen = this.openPage;
610
659
  this.handleListener();
611
660
  },
612
661
  methods: {
@@ -679,6 +728,8 @@ export default {
679
728
  util.setStorage({
680
729
  type: this.storage,
681
730
  key: {
731
+ depId: results.userModel.depId,
732
+ orgId: results.userModel.orgId,
682
733
  userId: results.userModel.userId,
683
734
  userName: results.userModel.username,
684
735
  useCaseCodes: results.resourceCodes || results.userModel.resourceCodes
@@ -837,8 +888,9 @@ export default {
837
888
  this.setTips(this.menus);
838
889
  store.set('nav', this.menus);
839
890
  if (this.appCode) {
891
+ let code = this.sysCode || this.appCode;
840
892
  let app = this.userApps.filter((item) => {
841
- return item.code === this.appCode;
893
+ return item.code === code;
842
894
  })[0];
843
895
  if (app) {
844
896
  this.active = app.id;
@@ -848,18 +900,23 @@ export default {
848
900
  let tab = this.setIframeType(obj);
849
901
  this.tabs = [tab];
850
902
  this.activeName = tab.id;
903
+ } else {
904
+ this.tabs = [app];
851
905
  }
852
906
  }
853
907
  }
854
- let subMenus = this.getMenu(
855
- this.menus,
856
- this.appCode,
857
- 'appCode'
858
- );
859
- if (subMenus) {
860
- if (this.tabs.length == 0) {
861
- let obj = this.getFirst(subMenus);
908
+ if (this.sysCode) {
909
+ let subMenus = this.getMenu(
910
+ this.menus,
911
+ this.sysCode,
912
+ 'appCode'
913
+ );
914
+ if (subMenus) {
915
+ let obj = this.getMenu(this.menus, this.appCode, 'appCode');
862
916
  if (obj) {
917
+ if (!obj.url) {
918
+ obj = this.getFirst(obj);
919
+ }
863
920
  this.subActive = obj.id;
864
921
  let tab = this.setIframeType(obj);
865
922
  this.tabs = [tab];
@@ -867,12 +924,36 @@ export default {
867
924
  } else {
868
925
  this.subActive = '';
869
926
  }
927
+ this.subMenus = subMenus;
928
+ this.showMenu = true;
929
+ } else {
930
+ this.subMenus = null;
931
+ this.showMenu = false;
870
932
  }
871
- this.subMenus = subMenus;
872
- this.showMenu = true;
873
933
  } else {
874
- this.subMenus = null;
875
- this.showMenu = false;
934
+ let subMenus = this.getMenu(
935
+ this.menus,
936
+ this.appCode,
937
+ 'appCode'
938
+ );
939
+ if (subMenus) {
940
+ if (this.tabs.length == 0) {
941
+ let obj = this.getFirst(subMenus);
942
+ if (obj) {
943
+ this.subActive = obj.id;
944
+ let tab = this.setIframeType(obj);
945
+ this.tabs = [tab];
946
+ this.activeName = tab.id;
947
+ } else {
948
+ this.subActive = '';
949
+ }
950
+ }
951
+ this.subMenus = subMenus;
952
+ this.showMenu = true;
953
+ } else {
954
+ this.subMenus = null;
955
+ this.showMenu = false;
956
+ }
876
957
  }
877
958
  } else {
878
959
  if (this.indexUrl) {
@@ -894,13 +975,6 @@ export default {
894
975
  if (!this.appCode) {
895
976
  this.tabs = [this.homePage];
896
977
  this.activeName = '0';
897
- // if (this.homePage.method == 'router') {
898
- // let params = util.getParams({ url: this.homePage.url });
899
- // this.$router.push({
900
- // path: this.homePage.path,
901
- // query: { ...this.$parent.params, ...params }
902
- // });
903
- // }
904
978
  }
905
979
  }
906
980
  } else if (
@@ -916,13 +990,6 @@ export default {
916
990
  let tab = this.setIframeType(obj);
917
991
  this.tabs.push(tab);
918
992
  this.activeName = tab.id;
919
- // if (tab.method == 'router') {
920
- // let params = util.getParams({ url: tab.url });
921
- // this.$router.push({
922
- // path: tab.path,
923
- // query: { ...this.$parent.params, ...params }
924
- // });
925
- // }
926
993
  }
927
994
  }
928
995
  }
@@ -948,6 +1015,9 @@ export default {
948
1015
  **/
949
1016
  setIframeType(res) {
950
1017
  let { url } = res;
1018
+ if (url) {
1019
+ res.refresh = false;
1020
+ }
951
1021
  let urls = url.split('?');
952
1022
  if (urls[0].indexOf('.js') > 1 && !isIE) {
953
1023
  res.method = 'wujie';
@@ -992,7 +1062,9 @@ export default {
992
1062
  }
993
1063
  }
994
1064
  }
995
- res.refresh = true;
1065
+ if (Object.prototype.hasOwnProperty.call(res, 'refresh')) {
1066
+ res.refresh = true;
1067
+ }
996
1068
  return res;
997
1069
  },
998
1070
  /**
@@ -1059,7 +1131,7 @@ export default {
1059
1131
  obj.fourthTabs[openIdex]
1060
1132
  ) {
1061
1133
  return this.getFirst(obj.fourthTabs[openIdex]);
1062
- } else if (obj.url) {
1134
+ } else if (obj.url && obj.urlopenmode !== 1 && obj.urlopenmode !== 2) {
1063
1135
  return obj;
1064
1136
  }
1065
1137
  },
@@ -1143,7 +1215,7 @@ export default {
1143
1215
  for (let i in data) {
1144
1216
  if (data[i] !== null && data[i] !== undefined) {
1145
1217
  if (i === 'onlineUserNums' && data[i] > 0) {
1146
- this.online = data[i];
1218
+ this.userNums = data[i];
1147
1219
  }
1148
1220
  if (i === 'sysMsgNums') {
1149
1221
  this.notice = data[i];
@@ -1176,6 +1248,39 @@ export default {
1176
1248
  }
1177
1249
  });
1178
1250
  },
1251
+ /**
1252
+ * @desc:显示用户信息
1253
+ * @author huangbo
1254
+ * @date 2024年9月7日
1255
+ **/
1256
+ showUserInfo() {
1257
+ if (this.showUser === false) {
1258
+ this.showUser = true;
1259
+ }
1260
+ },
1261
+ /**
1262
+ * @desc:删除更多应用菜单点击
1263
+ * @author huangbo
1264
+ * @date 2024年9月7日
1265
+ **/
1266
+ handleDelete(index) {
1267
+ this.newApps.splice(index, 1);
1268
+ },
1269
+ /**
1270
+ * @desc:储存更多应用菜单点击
1271
+ * @author huangbo
1272
+ * @date 2024年9月7日
1273
+ **/
1274
+ handlerClickApps(res) {
1275
+ if (res.permission === false) {
1276
+ return false;
1277
+ }
1278
+ let i = util.indexOfObj(this.newApps, res, 'id');
1279
+ if (i == -1) {
1280
+ this.newApps.push(res);
1281
+ }
1282
+ this.handlerClickApp(res);
1283
+ },
1179
1284
  /**
1180
1285
  * @desc:侧边应用菜单点击
1181
1286
  * @author huangbo
@@ -1184,6 +1289,7 @@ export default {
1184
1289
  handlerClickApp(res) {
1185
1290
  this.showMsg = false;
1186
1291
  this.showSet = false;
1292
+ this.fold = false;
1187
1293
  if (res) {
1188
1294
  if (res.permission === false) {
1189
1295
  return false;
@@ -1195,30 +1301,67 @@ export default {
1195
1301
  this.subMenus = res;
1196
1302
  this.showMenu = true;
1197
1303
  this.showApps = false;
1198
- } else {
1199
- let set = true;
1200
- if (res.url) {
1201
- if (res.urlopenmode == 1 || res.openModel == 1) {
1202
- set = false;
1203
- util.win.open(res.url);
1204
- } else if (res.urlopenmode == 2 || res.openModel == 2) {
1205
- set = false;
1206
- util.win.location.href = res.url;
1207
- } else {
1208
- let i = util.indexOfObj(this.tabs, res, 'id');
1209
- this.activeName = res.id;
1210
- if (i == -1) {
1304
+ }
1305
+ let set = true;
1306
+ if (res.url) {
1307
+ if (res.urlopenmode == 1 || res.openModel == 1) {
1308
+ set = false;
1309
+ util.win.open(res.url);
1310
+ } else if (res.urlopenmode == 2 || res.openModel == 2) {
1311
+ set = false;
1312
+ util.win.open(res.url, '_self');
1313
+ } else {
1314
+ let i = util.indexOfObj(this.tabs, res, 'id');
1315
+ this.activeName = res.id;
1316
+ if (i == -1) {
1317
+ let obj = this.getMenu(this.menus, res.url);
1318
+ if (obj) {
1319
+ let n = util.indexOfObj(this.tabs, obj, 'id');
1320
+ if (n == -1) {
1321
+ let tab = this.setIframeType(obj);
1322
+ this.tabs.push(tab);
1323
+ this.activeName = tab.id;
1324
+ } else {
1325
+ if (obj.method == 'iframe') {
1326
+ obj.url = util.handlerUrl(obj.url);
1327
+ }
1328
+ }
1329
+ } else {
1211
1330
  let tab = this.setIframeType(res);
1212
1331
  this.tabs.push(tab);
1332
+ this.activeName = tab.id;
1333
+ }
1334
+ } else {
1335
+ if (res.method == 'iframe') {
1336
+ res.url = util.handlerUrl(res.url);
1213
1337
  }
1214
1338
  }
1215
1339
  }
1216
- if (set && res.code) {
1217
- let subMenus = this.getMenu(this.menus, res.code, 'appCode');
1340
+ }
1341
+ if (set && res.code) {
1342
+ let subMenus = this.getMenu(this.menus, res.code, 'appCode');
1343
+ if (!subMenus && !res.url) {
1344
+ this.$alert('没有关联菜单,请联系管理员!', '提示', {
1345
+ confirmButtonText: '确定',
1346
+ type: 'warning'
1347
+ }).catch(() => {});
1348
+ } else {
1218
1349
  this.title = res.text || res.name;
1219
1350
  this.subMenus = subMenus ? subMenus : null;
1220
1351
  this.showMenu = subMenus !== false;
1221
1352
  this.showApps = false;
1353
+ if (subMenus && subMenus.url) {
1354
+ let i = util.indexOfObj(this.tabs, subMenus, 'id');
1355
+ this.activeName = subMenus.id;
1356
+ if (i == -1) {
1357
+ let tab = this.setIframeType(subMenus);
1358
+ this.tabs.push(tab);
1359
+ } else {
1360
+ if (subMenus.method == 'iframe') {
1361
+ subMenus.url = util.handlerUrl(subMenus.url);
1362
+ }
1363
+ }
1364
+ }
1222
1365
  }
1223
1366
  }
1224
1367
  this.active = res.id;
@@ -1253,13 +1396,40 @@ export default {
1253
1396
  * @date 2024年9月7日
1254
1397
  **/
1255
1398
  handlerClickMenu(res) {
1399
+ if (this.recordApp) {
1400
+ util
1401
+ .ajax({
1402
+ url: recordUserApp,
1403
+ params: {
1404
+ userId: this.user.userId,
1405
+ appId: res.id
1406
+ }
1407
+ })
1408
+ .then(() => {})
1409
+ .catch(() => {});
1410
+ }
1256
1411
  this.showMsg = false;
1257
1412
  this.showSet = false;
1258
1413
  let i = util.indexOfObj(this.tabs, res, 'id');
1259
- this.activeName = res.id;
1260
1414
  if (i == -1) {
1261
1415
  let tab = this.setIframeType(res);
1262
1416
  this.tabs.push(tab);
1417
+ this.activeName = res.id;
1418
+ } else {
1419
+ let tab = this.tabs[i];
1420
+ if (tab.method === 'iframe') {
1421
+ this.activeName = res.id;
1422
+ this.$set(this.tabs[i], 'url', util.handlerUrl(tab.url));
1423
+ } else {
1424
+ this.$set(this.tabs[i], 'refresh', false);
1425
+ if (tab.method === 'wujie') {
1426
+ this.activeName = res.id;
1427
+ }
1428
+ this.$nextTick(() => {
1429
+ this.$set(this.tabs[i], 'refresh', true);
1430
+ this.activeName = res.id;
1431
+ });
1432
+ }
1263
1433
  }
1264
1434
  },
1265
1435
 
@@ -1311,14 +1481,21 @@ export default {
1311
1481
  * @date 2024年9月7日
1312
1482
  **/
1313
1483
  handleRefresh() {
1314
- let tab = this.tabs[this.activeName];
1484
+ let i = util.indexOfObj(this.tabs, this.activeName, 'id');
1485
+ let tab = this.tabs[i];
1315
1486
  if (tab.method === 'iframe') {
1316
1487
  tab.url = util.handlerUrl(tab.url);
1488
+ } else {
1489
+ let tab = this.tabs[i];
1490
+ if (tab.method === 'iframe') {
1491
+ this.$set(this.tabs[i], 'url', util.handlerUrl(tab.url));
1492
+ } else {
1493
+ this.$set(this.tabs[i], 'refresh', false);
1494
+ this.$nextTick(() => {
1495
+ this.$set(this.tabs[i], 'refresh', true);
1496
+ });
1497
+ }
1317
1498
  }
1318
- tab.refresh = false;
1319
- this.$nextTick(() => {
1320
- tab.refresh = true;
1321
- });
1322
1499
  },
1323
1500
  /**
1324
1501
  * @desc:删除iframe
@@ -1400,7 +1577,7 @@ export default {
1400
1577
  } else if (open) {
1401
1578
  util.win.open(open);
1402
1579
  } else if (link) {
1403
- util.win.location.href = link;
1580
+ util.win.open(link, '_self');
1404
1581
  } else {
1405
1582
  switch (type) {
1406
1583
  case 'quit':
@@ -1409,13 +1586,11 @@ export default {
1409
1586
  case 'online':
1410
1587
  this.showMsg = false;
1411
1588
  this.showSet = false;
1412
- if (this.onlineUrl) {
1413
- this.dialog = {
1414
- title: '查看在线人员',
1415
- show: true,
1416
- src: this.onlineUrl
1417
- };
1418
- }
1589
+ this.dialog = {
1590
+ title: '查看在线人员',
1591
+ show: true,
1592
+ src: this.onlineUrl
1593
+ };
1419
1594
  break;
1420
1595
  case 'notice':
1421
1596
  this.showMsg = !this.showMsg;
@@ -1426,15 +1601,23 @@ export default {
1426
1601
  this.showMsg = false;
1427
1602
  break;
1428
1603
  case 'home':
1429
- if (this.homePage.id !== this.activeName) {
1430
- let i = util.indexOfObj(this.tabs, this.homePage.id, 'id');
1431
- if (i == -1) {
1432
- this.tabs.unshift(this.homePage);
1604
+ let i = util.indexOfObj(this.tabs, this.homePage.id, 'id');
1605
+ if (i == -1) {
1606
+ this.tabs.unshift(this.homePage);
1607
+ } else {
1608
+ let tab = this.tabs[i];
1609
+ if (tab.method === 'iframe') {
1610
+ this.$set(this.tabs[i], 'url', util.handlerUrl(tab.url));
1611
+ } else {
1612
+ this.$set(this.tabs[i], 'refresh', false);
1613
+ this.$nextTick(() => {
1614
+ this.$set(this.tabs[i], 'refresh', true);
1615
+ });
1433
1616
  }
1434
- this.activeName = this.homePage.id;
1435
- this.showMsg = false;
1436
- this.showSet = false;
1437
1617
  }
1618
+ this.activeName = this.homePage.id;
1619
+ this.showMsg = false;
1620
+ this.showSet = false;
1438
1621
  break;
1439
1622
  case 'search':
1440
1623
  this.handlerSetDrawer(res);
@@ -1572,123 +1755,6 @@ export default {
1572
1755
  clearTimeout(this.sysMsgOut);
1573
1756
  }
1574
1757
  },
1575
- handleReLogin(res) {
1576
- if (res && typeof res == 'string') {
1577
- res = JSON.parse(res);
1578
- }
1579
- let msg = '提示';
1580
- let btn = {
1581
- confirmButtonText: '确定',
1582
- cancelButtonText: '取消',
1583
- closeOnClickModal: false,
1584
- type: 'warning'
1585
- };
1586
- if (res) {
1587
- if (res.rCode === 69) {
1588
- msg = '该账号在其他地方已登陆!';
1589
- btn = {
1590
- confirmButtonText: '确定',
1591
- closeOnClickModal: false,
1592
- type: 'warning'
1593
- };
1594
- } else {
1595
- msg = '登录已过期,请重新登录!';
1596
- }
1597
- }
1598
- cl;
1599
- let remind = sessionStorage.getItem('remind');
1600
- if (!remind) {
1601
- clearTimeout(this.timer);
1602
- this.timer = setTimeout(() => {
1603
- sessionStorage.setItem('remind', 1);
1604
- this.$confirm(msg, btn)
1605
- .then(() => {
1606
- util.removeStorage([
1607
- 'Authorization',
1608
- 'token',
1609
- 'ssId',
1610
- 'userId',
1611
- 'userName',
1612
- 'auth',
1613
- 'deviceUnique',
1614
- 'menus',
1615
- 'useCaseCodes',
1616
- 'mainConfig',
1617
- 'jump'
1618
- ]);
1619
- const loginPage =
1620
- util.getStorage('login') || util.getStorage('loginPage');
1621
- try {
1622
- if (loginPage) {
1623
- let src;
1624
- if (!util.startWith(loginPage, ['http', '/'], true)) {
1625
- let pathname = util.win.top.location.pathname;
1626
- if (pathname !== '/') {
1627
- pathname = pathname.split('/');
1628
- pathname.splice(pathname.length - 1);
1629
- pathname = pathname.join('/');
1630
- src = pathname + '/' + loginPage.replace('./', '');
1631
- } else {
1632
- src = pathname + loginPage.replace('./', '');
1633
- }
1634
- } else {
1635
- src = loginPage;
1636
- }
1637
- util.win.top.location.href = src;
1638
- } else if (
1639
- util.win.top.location.href.indexOf('main.html') > -1
1640
- ) {
1641
- util.win.top.location.href = './login.html';
1642
- } else {
1643
- const hash = util.win.top.location.hash;
1644
- if (hash) {
1645
- const len = util.win.top.location.href.indexOf(hash);
1646
- util.win.top.location.href =
1647
- util.win.location.href.slice(0, len) + '#/login';
1648
- } else {
1649
- util.win.top.location.href = '/login.html';
1650
- }
1651
- }
1652
- } catch (error) {
1653
- util.win.postMessage({ type: 1 }, '*');
1654
- }
1655
- })
1656
- .catch((e) => {
1657
- sessionStorage.removeItem('remind');
1658
- });
1659
- }, 2000);
1660
- }
1661
- },
1662
- openPage(url, name, width, height) {
1663
- let src = url;
1664
- if (!util.startWith(url, ['http', '/'], true)) {
1665
- let pathname = window.location.pathname;
1666
- if (pathname !== '/') {
1667
- pathname = pathname.split('/');
1668
- pathname.splice(pathname.length - 1);
1669
- pathname = pathname.join('/');
1670
- }
1671
- src = pathname + url.replace('./', '/');
1672
- }
1673
- if (name) {
1674
- let w = 0;
1675
- let h = 0;
1676
- try {
1677
- w = width ? width : util.win.top.screen.availWidth - 10;
1678
- h = height ? height : util.win.top.screen.availHeight - 60;
1679
- } catch (error) {
1680
- w = width ? width : util.win.screen.availWidth - 10;
1681
- h = height ? height : util.win.screen.availHeight - 60;
1682
- }
1683
- return util.win.open(
1684
- src,
1685
- name,
1686
- `width=${w}px,height=${h}px,resizable=yes,status=yes,menubar=no,scrollbars=yes`
1687
- );
1688
- } else {
1689
- return util.win.open(src);
1690
- }
1691
- },
1692
1758
  jumpMenu(res) {
1693
1759
  let apps = res;
1694
1760
  if (typeof res === 'string') {
@@ -1702,6 +1768,16 @@ export default {
1702
1768
  if (i == -1) {
1703
1769
  let tab = this.setIframeType(obj);
1704
1770
  this.tabs.splice(n + 1, 0, tab);
1771
+ } else {
1772
+ let tab = this.tabs[i];
1773
+ if (tab.method === 'iframe') {
1774
+ this.$set(this.tabs[i], 'url', util.handlerUrl(tab.url));
1775
+ } else {
1776
+ this.$set(this.tabs[i], 'refresh', false);
1777
+ this.$nextTick(() => {
1778
+ this.$set(this.tabs[i], 'refresh', true);
1779
+ });
1780
+ }
1705
1781
  }
1706
1782
  } else {
1707
1783
  this.$message.error('没有此菜单!');