eoss-ui 0.5.81-beta9 → 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 (124) 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 -275
  8. package/lib/date-picker.js +69 -59
  9. package/lib/dialog.js +77 -72
  10. package/lib/eoss-ui.common.js +3985 -3049
  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 +1375 -925
  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 -67
  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/handler.vue +6 -2
  83. package/packages/main/src/simplicity/index.vue +283 -238
  84. package/packages/main/src/simplicity/menu-list.vue +3 -2
  85. package/packages/main/src/simplicity/router-page.vue +5 -14
  86. package/packages/main/src/simplicity/sub-menu.vue +31 -9
  87. package/packages/menu/src/main.vue +4 -3
  88. package/packages/pagination/src/main.vue +20 -1
  89. package/packages/selector/src/main.vue +147 -135
  90. package/packages/selector-panel/src/main.vue +3 -2
  91. package/packages/selector-panel/src/selection.vue +2 -2
  92. package/packages/tabs/src/main.vue +25 -15
  93. package/packages/theme-chalk/lib/base.css +1 -1
  94. package/packages/theme-chalk/lib/button-group.css +1 -1
  95. package/packages/theme-chalk/lib/data-table.css +1 -1
  96. package/packages/theme-chalk/lib/form.css +1 -1
  97. package/packages/theme-chalk/lib/index.css +1 -1
  98. package/packages/theme-chalk/lib/main.css +1 -1
  99. package/packages/theme-chalk/lib/menu.css +1 -1
  100. package/packages/theme-chalk/lib/pagination.css +1 -1
  101. package/packages/theme-chalk/lib/simplicity.css +1 -1
  102. package/packages/theme-chalk/lib/sizer.css +1 -1
  103. package/packages/theme-chalk/lib/tabs.css +1 -1
  104. package/packages/theme-chalk/lib/toolbar.css +1 -1
  105. package/packages/theme-chalk/lib/tree-group.css +1 -1
  106. package/packages/theme-chalk/lib/tree.css +1 -1
  107. package/packages/theme-chalk/lib/upload.css +1 -1
  108. package/packages/theme-chalk/src/base.scss +39 -0
  109. package/packages/theme-chalk/src/button-group.scss +16 -2
  110. package/packages/theme-chalk/src/common/var.scss +7 -2
  111. package/packages/theme-chalk/src/data-table.scss +60 -23
  112. package/packages/theme-chalk/src/form.scss +42 -40
  113. package/packages/theme-chalk/src/main.scss +11 -0
  114. package/packages/theme-chalk/src/pagination.scss +7 -0
  115. package/packages/theme-chalk/src/simplicity.scss +45 -4
  116. package/packages/theme-chalk/src/tabs.scss +24 -28
  117. package/packages/theme-chalk/src/toolbar.scss +16 -4
  118. package/packages/theme-chalk/src/tree-group.scss +8 -0
  119. package/packages/theme-chalk/src/tree.scss +19 -6
  120. package/packages/tree-group/src/main.vue +16 -7
  121. package/src/config/api.js +3 -1
  122. package/src/index.js +157 -157
  123. package/src/utils/util.js +6 -1
  124. 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"
@@ -58,12 +60,16 @@
58
60
  </div>
59
61
  <div
60
62
  class="es-simplicity-side-app"
61
- v-for="item in newApps"
63
+ v-for="(item, index) in newApps"
62
64
  :class="{ 'is-active': active == item.id }"
63
65
  :key="item.id"
64
66
  :title="item.text || item.name"
65
- @click="handlerClickApp(item)"
67
+ @click.stop="handlerClickApp(item)"
66
68
  >
69
+ <i
70
+ class="el-icon-circle-close"
71
+ @click.stop="handleDelete(index)"
72
+ ></i>
67
73
  <el-badge v-bind="getBadge(item)">
68
74
  <es-icon
69
75
  class="es-simplicity-side-app-icon"
@@ -94,21 +100,6 @@
94
100
  </div>
95
101
  </div>
96
102
  <div class="es-simplicity-main">
97
- <!-- 菜单 -->
98
- <sub-menu
99
- :visible.sync="showMenu"
100
- :fold.sync="fold"
101
- :size="menuWidth"
102
- :title="title"
103
- :color="menuColor"
104
- :backgroundColor="menuBackgroundColor"
105
- :menu-icon="menuIcon"
106
- :active="subActive"
107
- v-bind="subMenus"
108
- @command="handlerClickMenu"
109
- ></sub-menu>
110
- <!-- 菜单 end -->
111
-
112
103
  <!-- 应用 -->
113
104
  <apps
114
105
  :visible.sync="showApps"
@@ -207,6 +198,7 @@
207
198
  @tab-remove="handleRemove"
208
199
  @tab-contextmenu="handleContextmenu"
209
200
  >
201
+ <!-- 操作栏 -->
210
202
  <handler
211
203
  slot="append"
212
204
  v-bind="handleConfig"
@@ -216,43 +208,55 @@
216
208
  index: doorIndex ? false : true,
217
209
  ...hides
218
210
  }"
211
+ :online="userNums"
219
212
  :notice-num="notice"
220
213
  @click="handleClick"
221
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 -->
222
232
  <el-tab-pane
223
233
  v-for="item in tabs"
224
234
  :key="item.id"
225
235
  :label="item.text || item.name"
226
236
  :name="item.id"
227
237
  >
228
- <template
238
+ <iframe
229
239
  v-if="(isIE && item.method !== 'router') || item.method == 'iframe'"
230
- >
231
- <iframe
232
- :id="iframeId"
233
- :name="iframeId"
234
- frameborder="0"
235
- width="100%"
236
- height="100%"
237
- :src="item.url"
238
- ></iframe>
239
- </template>
240
- <template v-else-if="item.method === 'wujie' && item.refresh">
241
- <es-wujie
242
- :show="true"
243
- :props="wjProps"
244
- :attrs="wjAttrs"
245
- :name="item.appCode"
246
- :url="item.url"
247
- ></es-wujie>
248
- </template>
249
- <template v-else-if="item.method === 'router' && item.refresh">
250
- <router-page
251
- v-bind="item"
252
- :show="activeName == item.id"
253
- :query="$parent.params"
254
- ></router-page>
255
- </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>
256
260
  </el-tab-pane>
257
261
  </el-tabs>
258
262
  <!-- 路由、iframe end -->
@@ -285,8 +289,11 @@
285
289
 
286
290
  <!-- 公用弹窗 -->
287
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>
288
295
  <iframe
289
- v-if="dialog.show"
296
+ v-else-if="dialog.show"
290
297
  width="100%"
291
298
  height="100%"
292
299
  frameborder="0"
@@ -308,17 +315,20 @@ import message from './message.vue';
308
315
  import notice from './notice.vue';
309
316
  import settings from './settings.vue';
310
317
  import routerPage from './router-page.vue';
318
+ import online from '../public/online.vue';
311
319
  import {
312
320
  wss,
313
321
  logout,
314
322
  topic,
315
323
  getUserAppWithTag,
324
+ recordUserApp,
316
325
  getComplexApplications,
317
326
  getComplexApplicationsNew
318
327
  } from 'eoss-ui/src/config/api.js';
319
328
  import store from 'eoss-ui/src/utils/store';
320
329
  import util from 'eoss-ui/src/utils/util';
321
330
  const isIE = navigator.userAgent.indexOf('MSIE') != -1;
331
+ const dataTableMode = util.win.dataTableMode || 'default';
322
332
  let events = [
323
333
  (tabs, index, that) => {
324
334
  let tab = tabs[index];
@@ -371,6 +381,13 @@ let events = [
371
381
  ];
372
382
  export default {
373
383
  name: 'Simplicity',
384
+ provide() {
385
+ return {
386
+ esMain: this,
387
+ refresh: this.handleRefresh,
388
+ jumpMenu: this.jumpMenu
389
+ };
390
+ },
374
391
  components: {
375
392
  avatar,
376
393
  handler,
@@ -380,9 +397,21 @@ export default {
380
397
  message,
381
398
  notice,
382
399
  settings,
383
- routerPage
400
+ routerPage,
401
+ online
384
402
  },
385
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,
386
415
  appCode: String,
387
416
  //logo
388
417
  logo: String,
@@ -472,6 +501,8 @@ export default {
472
501
  },
473
502
  data() {
474
503
  return {
504
+ //显示用户信息
505
+ showUser: false,
475
506
  //主题色
476
507
  themeColor: this.theme,
477
508
  //是否ie浏览器
@@ -534,8 +565,11 @@ export default {
534
565
  doorIndex: '',
535
566
  //弹窗
536
567
  dialog: {},
568
+ //在线人数
569
+ userNums: 1,
537
570
  //消息列表展示状态
538
571
  showMsg: false,
572
+ //消息数
539
573
  notice: 0,
540
574
  //即时消息
541
575
  sysMsg: [],
@@ -594,9 +628,7 @@ export default {
594
628
  //在线人数列表地址
595
629
  onlineUrl() {
596
630
  if (this.onlineView) {
597
- return typeof this.onlineView == 'string'
598
- ? this.onlineView
599
- : '/main/sysuseronline/list.dhtml';
631
+ return typeof this.onlineView == 'string' ? this.onlineView : '';
600
632
  }
601
633
  return false;
602
634
  }
@@ -617,15 +649,13 @@ export default {
617
649
  let mainConfig = util.getStorage('mainConfig');
618
650
  if (mainConfig) {
619
651
  const results = JSON.parse(mainConfig);
620
- this.init(results);
652
+ if (Object.keys(results).length) {
653
+ this.init(results);
654
+ }
621
655
  }
622
656
  this.doorIndex = sessionStorage.getItem('doorIndex');
623
657
  },
624
658
  mounted() {
625
- util.win.reLogin = this.handleReLogin;
626
- util.win.refresh = this.handleRefresh;
627
- util.win.jumpMenu = this.jumpMenu;
628
- util.win.windowOpen = this.openPage;
629
659
  this.handleListener();
630
660
  },
631
661
  methods: {
@@ -698,6 +728,8 @@ export default {
698
728
  util.setStorage({
699
729
  type: this.storage,
700
730
  key: {
731
+ depId: results.userModel.depId,
732
+ orgId: results.userModel.orgId,
701
733
  userId: results.userModel.userId,
702
734
  userName: results.userModel.username,
703
735
  useCaseCodes: results.resourceCodes || results.userModel.resourceCodes
@@ -856,8 +888,9 @@ export default {
856
888
  this.setTips(this.menus);
857
889
  store.set('nav', this.menus);
858
890
  if (this.appCode) {
891
+ let code = this.sysCode || this.appCode;
859
892
  let app = this.userApps.filter((item) => {
860
- return item.code === this.appCode;
893
+ return item.code === code;
861
894
  })[0];
862
895
  if (app) {
863
896
  this.active = app.id;
@@ -867,18 +900,23 @@ export default {
867
900
  let tab = this.setIframeType(obj);
868
901
  this.tabs = [tab];
869
902
  this.activeName = tab.id;
903
+ } else {
904
+ this.tabs = [app];
870
905
  }
871
906
  }
872
907
  }
873
- let subMenus = this.getMenu(
874
- this.menus,
875
- this.appCode,
876
- 'appCode'
877
- );
878
- if (subMenus) {
879
- if (this.tabs.length == 0) {
880
- 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');
881
916
  if (obj) {
917
+ if (!obj.url) {
918
+ obj = this.getFirst(obj);
919
+ }
882
920
  this.subActive = obj.id;
883
921
  let tab = this.setIframeType(obj);
884
922
  this.tabs = [tab];
@@ -886,12 +924,36 @@ export default {
886
924
  } else {
887
925
  this.subActive = '';
888
926
  }
927
+ this.subMenus = subMenus;
928
+ this.showMenu = true;
929
+ } else {
930
+ this.subMenus = null;
931
+ this.showMenu = false;
889
932
  }
890
- this.subMenus = subMenus;
891
- this.showMenu = true;
892
933
  } else {
893
- this.subMenus = null;
894
- 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
+ }
895
957
  }
896
958
  } else {
897
959
  if (this.indexUrl) {
@@ -913,13 +975,6 @@ export default {
913
975
  if (!this.appCode) {
914
976
  this.tabs = [this.homePage];
915
977
  this.activeName = '0';
916
- // if (this.homePage.method == 'router') {
917
- // let params = util.getParams({ url: this.homePage.url });
918
- // this.$router.push({
919
- // path: this.homePage.path,
920
- // query: { ...this.$parent.params, ...params }
921
- // });
922
- // }
923
978
  }
924
979
  }
925
980
  } else if (
@@ -935,13 +990,6 @@ export default {
935
990
  let tab = this.setIframeType(obj);
936
991
  this.tabs.push(tab);
937
992
  this.activeName = tab.id;
938
- // if (tab.method == 'router') {
939
- // let params = util.getParams({ url: tab.url });
940
- // this.$router.push({
941
- // path: tab.path,
942
- // query: { ...this.$parent.params, ...params }
943
- // });
944
- // }
945
993
  }
946
994
  }
947
995
  }
@@ -967,6 +1015,9 @@ export default {
967
1015
  **/
968
1016
  setIframeType(res) {
969
1017
  let { url } = res;
1018
+ if (url) {
1019
+ res.refresh = false;
1020
+ }
970
1021
  let urls = url.split('?');
971
1022
  if (urls[0].indexOf('.js') > 1 && !isIE) {
972
1023
  res.method = 'wujie';
@@ -1011,7 +1062,9 @@ export default {
1011
1062
  }
1012
1063
  }
1013
1064
  }
1014
- res.refresh = true;
1065
+ if (Object.prototype.hasOwnProperty.call(res, 'refresh')) {
1066
+ res.refresh = true;
1067
+ }
1015
1068
  return res;
1016
1069
  },
1017
1070
  /**
@@ -1078,7 +1131,7 @@ export default {
1078
1131
  obj.fourthTabs[openIdex]
1079
1132
  ) {
1080
1133
  return this.getFirst(obj.fourthTabs[openIdex]);
1081
- } else if (obj.url) {
1134
+ } else if (obj.url && obj.urlopenmode !== 1 && obj.urlopenmode !== 2) {
1082
1135
  return obj;
1083
1136
  }
1084
1137
  },
@@ -1162,7 +1215,7 @@ export default {
1162
1215
  for (let i in data) {
1163
1216
  if (data[i] !== null && data[i] !== undefined) {
1164
1217
  if (i === 'onlineUserNums' && data[i] > 0) {
1165
- this.online = data[i];
1218
+ this.userNums = data[i];
1166
1219
  }
1167
1220
  if (i === 'sysMsgNums') {
1168
1221
  this.notice = data[i];
@@ -1196,11 +1249,32 @@ export default {
1196
1249
  });
1197
1250
  },
1198
1251
  /**
1199
- * @desc:更多应用菜单点击
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:储存更多应用菜单点击
1200
1271
  * @author huangbo
1201
1272
  * @date 2024年9月7日
1202
1273
  **/
1203
1274
  handlerClickApps(res) {
1275
+ if (res.permission === false) {
1276
+ return false;
1277
+ }
1204
1278
  let i = util.indexOfObj(this.newApps, res, 'id');
1205
1279
  if (i == -1) {
1206
1280
  this.newApps.push(res);
@@ -1215,6 +1289,7 @@ export default {
1215
1289
  handlerClickApp(res) {
1216
1290
  this.showMsg = false;
1217
1291
  this.showSet = false;
1292
+ this.fold = false;
1218
1293
  if (res) {
1219
1294
  if (res.permission === false) {
1220
1295
  return false;
@@ -1226,30 +1301,67 @@ export default {
1226
1301
  this.subMenus = res;
1227
1302
  this.showMenu = true;
1228
1303
  this.showApps = false;
1229
- } else {
1230
- let set = true;
1231
- if (res.url) {
1232
- if (res.urlopenmode == 1 || res.openModel == 1) {
1233
- set = false;
1234
- util.win.open(res.url);
1235
- } else if (res.urlopenmode == 2 || res.openModel == 2) {
1236
- set = false;
1237
- util.win.location.href = res.url;
1238
- } else {
1239
- let i = util.indexOfObj(this.tabs, res, 'id');
1240
- this.activeName = res.id;
1241
- 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 {
1242
1330
  let tab = this.setIframeType(res);
1243
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);
1244
1337
  }
1245
1338
  }
1246
1339
  }
1247
- if (set && res.code) {
1248
- 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 {
1249
1349
  this.title = res.text || res.name;
1250
1350
  this.subMenus = subMenus ? subMenus : null;
1251
1351
  this.showMenu = subMenus !== false;
1252
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
+ }
1253
1365
  }
1254
1366
  }
1255
1367
  this.active = res.id;
@@ -1284,13 +1396,40 @@ export default {
1284
1396
  * @date 2024年9月7日
1285
1397
  **/
1286
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
+ }
1287
1411
  this.showMsg = false;
1288
1412
  this.showSet = false;
1289
1413
  let i = util.indexOfObj(this.tabs, res, 'id');
1290
- this.activeName = res.id;
1291
1414
  if (i == -1) {
1292
1415
  let tab = this.setIframeType(res);
1293
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
+ }
1294
1433
  }
1295
1434
  },
1296
1435
 
@@ -1342,14 +1481,21 @@ export default {
1342
1481
  * @date 2024年9月7日
1343
1482
  **/
1344
1483
  handleRefresh() {
1345
- let tab = this.tabs[this.activeName];
1484
+ let i = util.indexOfObj(this.tabs, this.activeName, 'id');
1485
+ let tab = this.tabs[i];
1346
1486
  if (tab.method === 'iframe') {
1347
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
+ }
1348
1498
  }
1349
- tab.refresh = false;
1350
- this.$nextTick(() => {
1351
- tab.refresh = true;
1352
- });
1353
1499
  },
1354
1500
  /**
1355
1501
  * @desc:删除iframe
@@ -1431,7 +1577,7 @@ export default {
1431
1577
  } else if (open) {
1432
1578
  util.win.open(open);
1433
1579
  } else if (link) {
1434
- util.win.location.href = link;
1580
+ util.win.open(link, '_self');
1435
1581
  } else {
1436
1582
  switch (type) {
1437
1583
  case 'quit':
@@ -1440,13 +1586,11 @@ export default {
1440
1586
  case 'online':
1441
1587
  this.showMsg = false;
1442
1588
  this.showSet = false;
1443
- if (this.onlineUrl) {
1444
- this.dialog = {
1445
- title: '查看在线人员',
1446
- show: true,
1447
- src: this.onlineUrl
1448
- };
1449
- }
1589
+ this.dialog = {
1590
+ title: '查看在线人员',
1591
+ show: true,
1592
+ src: this.onlineUrl
1593
+ };
1450
1594
  break;
1451
1595
  case 'notice':
1452
1596
  this.showMsg = !this.showMsg;
@@ -1457,15 +1601,23 @@ export default {
1457
1601
  this.showMsg = false;
1458
1602
  break;
1459
1603
  case 'home':
1460
- if (this.homePage.id !== this.activeName) {
1461
- let i = util.indexOfObj(this.tabs, this.homePage.id, 'id');
1462
- if (i == -1) {
1463
- 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
+ });
1464
1616
  }
1465
- this.activeName = this.homePage.id;
1466
- this.showMsg = false;
1467
- this.showSet = false;
1468
1617
  }
1618
+ this.activeName = this.homePage.id;
1619
+ this.showMsg = false;
1620
+ this.showSet = false;
1469
1621
  break;
1470
1622
  case 'search':
1471
1623
  this.handlerSetDrawer(res);
@@ -1603,123 +1755,6 @@ export default {
1603
1755
  clearTimeout(this.sysMsgOut);
1604
1756
  }
1605
1757
  },
1606
- handleReLogin(res) {
1607
- if (res && typeof res == 'string') {
1608
- res = JSON.parse(res);
1609
- }
1610
- let msg = '提示';
1611
- let btn = {
1612
- confirmButtonText: '确定',
1613
- cancelButtonText: '取消',
1614
- closeOnClickModal: false,
1615
- type: 'warning'
1616
- };
1617
- if (res) {
1618
- if (res.rCode === 69) {
1619
- msg = '该账号在其他地方已登陆!';
1620
- btn = {
1621
- confirmButtonText: '确定',
1622
- closeOnClickModal: false,
1623
- type: 'warning'
1624
- };
1625
- } else {
1626
- msg = '登录已过期,请重新登录!';
1627
- }
1628
- }
1629
- cl;
1630
- let remind = sessionStorage.getItem('remind');
1631
- if (!remind) {
1632
- clearTimeout(this.timer);
1633
- this.timer = setTimeout(() => {
1634
- sessionStorage.setItem('remind', 1);
1635
- this.$confirm(msg, btn)
1636
- .then(() => {
1637
- util.removeStorage([
1638
- 'Authorization',
1639
- 'token',
1640
- 'ssId',
1641
- 'userId',
1642
- 'userName',
1643
- 'auth',
1644
- 'deviceUnique',
1645
- 'menus',
1646
- 'useCaseCodes',
1647
- 'mainConfig',
1648
- 'jump'
1649
- ]);
1650
- const loginPage =
1651
- util.getStorage('login') || util.getStorage('loginPage');
1652
- try {
1653
- if (loginPage) {
1654
- let src;
1655
- if (!util.startWith(loginPage, ['http', '/'], true)) {
1656
- let pathname = util.win.top.location.pathname;
1657
- if (pathname !== '/') {
1658
- pathname = pathname.split('/');
1659
- pathname.splice(pathname.length - 1);
1660
- pathname = pathname.join('/');
1661
- src = pathname + '/' + loginPage.replace('./', '');
1662
- } else {
1663
- src = pathname + loginPage.replace('./', '');
1664
- }
1665
- } else {
1666
- src = loginPage;
1667
- }
1668
- util.win.top.location.href = src;
1669
- } else if (
1670
- util.win.top.location.href.indexOf('main.html') > -1
1671
- ) {
1672
- util.win.top.location.href = './login.html';
1673
- } else {
1674
- const hash = util.win.top.location.hash;
1675
- if (hash) {
1676
- const len = util.win.top.location.href.indexOf(hash);
1677
- util.win.top.location.href =
1678
- util.win.location.href.slice(0, len) + '#/login';
1679
- } else {
1680
- util.win.top.location.href = '/login.html';
1681
- }
1682
- }
1683
- } catch (error) {
1684
- util.win.postMessage({ type: 1 }, '*');
1685
- }
1686
- })
1687
- .catch((e) => {
1688
- sessionStorage.removeItem('remind');
1689
- });
1690
- }, 2000);
1691
- }
1692
- },
1693
- openPage(url, name, width, height) {
1694
- let src = url;
1695
- if (!util.startWith(url, ['http', '/'], true)) {
1696
- let pathname = window.location.pathname;
1697
- if (pathname !== '/') {
1698
- pathname = pathname.split('/');
1699
- pathname.splice(pathname.length - 1);
1700
- pathname = pathname.join('/');
1701
- }
1702
- src = pathname + url.replace('./', '/');
1703
- }
1704
- if (name) {
1705
- let w = 0;
1706
- let h = 0;
1707
- try {
1708
- w = width ? width : util.win.top.screen.availWidth - 10;
1709
- h = height ? height : util.win.top.screen.availHeight - 60;
1710
- } catch (error) {
1711
- w = width ? width : util.win.screen.availWidth - 10;
1712
- h = height ? height : util.win.screen.availHeight - 60;
1713
- }
1714
- return util.win.open(
1715
- src,
1716
- name,
1717
- `width=${w}px,height=${h}px,resizable=yes,status=yes,menubar=no,scrollbars=yes`
1718
- );
1719
- } else {
1720
- return util.win.open(src);
1721
- }
1722
- },
1723
1758
  jumpMenu(res) {
1724
1759
  let apps = res;
1725
1760
  if (typeof res === 'string') {
@@ -1733,6 +1768,16 @@ export default {
1733
1768
  if (i == -1) {
1734
1769
  let tab = this.setIframeType(obj);
1735
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
+ }
1736
1781
  }
1737
1782
  } else {
1738
1783
  this.$message.error('没有此菜单!');