eoss-ui 0.5.81-beta3 → 0.5.81-beta5

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 (33) hide show
  1. package/lib/eoss-ui.common.js +1708 -1144
  2. package/lib/index.js +1 -1
  3. package/lib/main.js +1588 -1081
  4. package/lib/selector-panel.js +64 -11
  5. package/lib/selector.js +8 -4
  6. package/lib/theme-chalk/index.css +1 -1
  7. package/lib/theme-chalk/main.css +1 -1
  8. package/lib/theme-chalk/selector-panel.css +1 -1
  9. package/lib/theme-chalk/simplicity.css +1 -1
  10. package/package.json +1 -1
  11. package/packages/main/src/default/index.vue +1 -1
  12. package/packages/main/src/main.vue +12 -16
  13. package/packages/main/src/simplicity/apps.vue +176 -145
  14. package/packages/main/src/simplicity/index.vue +224 -191
  15. package/packages/main/src/simplicity/menu-list.vue +96 -26
  16. package/packages/main/src/simplicity/message.vue +35 -25
  17. package/packages/main/src/simplicity/notice.vue +72 -39
  18. package/packages/main/src/simplicity/router-page.vue +53 -0
  19. package/packages/main/src/simplicity/settings.vue +1 -1
  20. package/packages/main/src/simplicity/sub-menu.vue +67 -68
  21. package/packages/main/src/simplicity/user.vue +4 -4
  22. package/packages/main/src/simplicity/userinfo.vue +1 -0
  23. package/packages/selector/src/main.vue +6 -2
  24. package/packages/selector-panel/src/main.vue +21 -2
  25. package/packages/selector-panel/src/selection.vue +6 -0
  26. package/packages/theme-chalk/lib/index.css +1 -1
  27. package/packages/theme-chalk/lib/main.css +1 -1
  28. package/packages/theme-chalk/lib/selector-panel.css +1 -1
  29. package/packages/theme-chalk/lib/simplicity.css +1 -1
  30. package/packages/theme-chalk/src/common/var.scss +2 -0
  31. package/packages/theme-chalk/src/selector-panel.scss +2 -1
  32. package/packages/theme-chalk/src/simplicity.scss +194 -6
  33. package/src/index.js +1 -1
@@ -74,46 +74,31 @@
74
74
  </div>
75
75
  <div class="es-simplicity-main">
76
76
  <!-- 菜单 -->
77
- <el-drawer
78
- class="es-simplicity-subMenus"
79
- direction="ltr"
80
- modal-class="es-simplicity-apps-modal"
81
- :size="width"
82
- :modal-append-to-body="false"
83
- :with-header="false"
77
+ <sub-menu
78
+ ref="subMenus"
84
79
  :visible.sync="showMenu"
85
- >
86
- <sub-menu
87
- ref="subMenus"
88
- :color="menuColor"
89
- :backgroundColor="menuBackgroundColor"
90
- :menu-icon="menuIcon"
91
- v-bind="subMenus"
92
- @command="handlerClickMenu"
93
- ></sub-menu>
94
- </el-drawer>
80
+ :fold.sync="fold"
81
+ :size="menuWidth"
82
+ :title="title"
83
+ :color="menuColor"
84
+ :backgroundColor="menuBackgroundColor"
85
+ :menu-icon="menuIcon"
86
+ v-bind="subMenus"
87
+ @command="handlerClickMenu"
88
+ ></sub-menu>
95
89
  <!-- 菜单 end -->
96
90
 
97
91
  <!-- 应用 -->
98
- <el-drawer
99
- class="es-simplicity-apps"
100
- direction="ltr"
101
- modal-class="es-simplicity-apps-modal"
102
- size="90%"
103
- :modal-append-to-body="false"
104
- :with-header="false"
92
+ <apps
105
93
  :visible.sync="showApps"
106
- >
107
- <apps
108
- :menu-icon="menuIcon"
109
- :color="appColor"
110
- :backgroundColor="appBackgroundColor"
111
- :applications="applications"
112
- :business="business"
113
- :systems="systems"
114
- @click="handlerClickApp"
115
- ></apps>
116
- </el-drawer>
94
+ :menu-icon="menuIcon"
95
+ :color="appColor"
96
+ :backgroundColor="appBackgroundColor"
97
+ :applications="applications"
98
+ :business="business"
99
+ :systems="systems"
100
+ @click="handlerClickApp"
101
+ ></apps>
117
102
  <!-- 应用 end -->
118
103
 
119
104
  <!-- AI -->
@@ -157,7 +142,8 @@
157
142
  <el-card class="es-simplicity-tabs-handler" ref="tabsHandler">
158
143
  <div
159
144
  class="es-simplicity-tabs-handler-item"
160
- @click="handleTabsEvents(0)"
145
+ :class="{ 'is-disabled': isDisabled.refresh }"
146
+ @click="isDisabled.refresh ? '' : handleTabsEvents(0)"
161
147
  >
162
148
  刷新
163
149
  </div>
@@ -192,10 +178,10 @@
192
178
  </div>
193
179
  <el-tabs
194
180
  class="es-simplicity-iframe"
181
+ :class="{ 'is-open': showMenu, 'is-fold': fold }"
195
182
  v-model="activeName"
196
183
  closable
197
184
  hide-bar
198
- @tab-click="handleTab"
199
185
  @tab-remove="handleRemove"
200
186
  @tab-contextmenu="handleContextmenu"
201
187
  >
@@ -211,14 +197,6 @@
211
197
  :notice-num="notice"
212
198
  @click="handleClick"
213
199
  ></handler>
214
- <div
215
- class="es-simplicity-unfold"
216
- ref="box"
217
- v-show="!showMenu && subMenus"
218
- @click="handleShowMenus"
219
- >
220
- <i class="el-icon-s-unfold" ref="area"></i>
221
- </div>
222
200
  <el-tab-pane
223
201
  v-for="item in tabs"
224
202
  :key="item.id"
@@ -247,7 +225,11 @@
247
225
  ></es-wujie>
248
226
  </template>
249
227
  <template v-else-if="item.method === 'router' && item.refresh">
250
- <router-view :name="item.appCode" />
228
+ <router-page
229
+ v-bind="item"
230
+ :show="activeName == item.id"
231
+ :query="$parent.params"
232
+ ></router-page>
251
233
  </template>
252
234
  </el-tab-pane>
253
235
  </el-tabs>
@@ -303,6 +285,7 @@ import user from './user.vue';
303
285
  import message from './message.vue';
304
286
  import notice from './notice.vue';
305
287
  import settings from './settings.vue';
288
+ import routerPage from './router-page.vue';
306
289
  import {
307
290
  wss,
308
291
  logout,
@@ -315,14 +298,14 @@ import store from 'eoss-ui/src/utils/store';
315
298
  import util from 'eoss-ui/src/utils/util';
316
299
  const isIE = navigator.userAgent.indexOf('MSIE') != -1;
317
300
  let events = [
318
- (tabs, index) => {
301
+ (tabs, index, that) => {
319
302
  let tab = tabs[index];
320
303
 
321
304
  if (tab.method == 'iframe') {
322
305
  tabs[index].url = util.handlerUrl(tab.url);
323
306
  } else {
324
307
  tabs[index].refresh = false;
325
- this.$nextTick(() => {
308
+ that.$nextTick(() => {
326
309
  tabs[index].refresh = true;
327
310
  });
328
311
  }
@@ -365,7 +348,7 @@ let events = [
365
348
  }
366
349
  ];
367
350
  export default {
368
- name: 'EsMainSimplicity',
351
+ name: 'Simplicity',
369
352
  components: {
370
353
  avatar,
371
354
  handler,
@@ -374,7 +357,8 @@ export default {
374
357
  user,
375
358
  message,
376
359
  notice,
377
- settings
360
+ settings,
361
+ routerPage
378
362
  },
379
363
  props: {
380
364
  appCode: String,
@@ -455,7 +439,14 @@ export default {
455
439
  //无界微前端Props属性
456
440
  wjProps: Object,
457
441
  //无界微前端Attrs属性
458
- wjAttrs: Object
442
+ wjAttrs: Object,
443
+ //菜单宽度
444
+ menuWidth: {
445
+ type: Number,
446
+ default: 220
447
+ },
448
+ //路由方式
449
+ routeType: String
459
450
  },
460
451
  data() {
461
452
  return {
@@ -469,12 +460,14 @@ export default {
469
460
  userApps: [],
470
461
  //所有菜单
471
462
  menus: [],
463
+ //菜单名称
464
+ title: '',
472
465
  //子菜单
473
466
  subMenus: null,
474
467
  //展示菜单导航
475
468
  showMenu: false,
476
- //展示菜单导航宽度
477
- width: '296px',
469
+ //折叠菜单
470
+ fold: false,
478
471
  //人工智能配置
479
472
  aiConfig: null,
480
473
  //公用窗口面板配置
@@ -607,7 +600,7 @@ export default {
607
600
  util.win.refresh = this.handleRefresh;
608
601
  util.win.jumpMenu = this.jumpMenu;
609
602
  util.win.windowOpen = this.openPage;
610
- this.move();
603
+ this.handleListener();
611
604
  },
612
605
  methods: {
613
606
  /**
@@ -615,13 +608,13 @@ export default {
615
608
  * @author huangbo
616
609
  * @date 2024年9月7日
617
610
  **/
618
- hasRouter(res, url, code, parentName) {
611
+ hasRouter(res, url, code) {
619
612
  if (!url) {
620
613
  return false;
621
614
  }
622
615
  if (Array.isArray(res)) {
623
616
  for (let i in res) {
624
- let path = this.hasRouter(res[i], url, code, parentName);
617
+ let path = this.hasRouter(res[i], url, code);
625
618
  if (path) {
626
619
  return path;
627
620
  }
@@ -647,7 +640,7 @@ export default {
647
640
  return pathname;
648
641
  }
649
642
  if (res && Object.prototype.hasOwnProperty.call(res, 'children')) {
650
- let path = this.hasRouter(res.children, url, code, res.name);
643
+ let path = this.hasRouter(res.children, url, code);
651
644
  if (path) {
652
645
  return path;
653
646
  }
@@ -664,7 +657,6 @@ export default {
664
657
  this.setConfig(results);
665
658
  if (this.remote) {
666
659
  this.getApplications();
667
- this.getMenus();
668
660
  }
669
661
  },
670
662
  /**
@@ -784,6 +776,7 @@ export default {
784
776
  * @date 2024年9月7日
785
777
  **/
786
778
  getApplications() {
779
+ let loading = util.loading('', '加载中...');
787
780
  util
788
781
  .ajax({
789
782
  url: this.appsUrl,
@@ -807,12 +800,15 @@ export default {
807
800
  } else {
808
801
  this.$message.error('未分配应用菜单权限,请联系管理员!');
809
802
  }
803
+ this.getMenus(loading);
810
804
  } else {
805
+ loading.close();
811
806
  let msg = res.msg || '系统错误,请联系管理员!';
812
807
  this.$message.error(msg);
813
808
  }
814
809
  })
815
810
  .catch((err) => {
811
+ loading.close();
816
812
  if (err.message && err.message !== 'canceled') {
817
813
  this.$message.error(err.message);
818
814
  }
@@ -823,20 +819,83 @@ export default {
823
819
  * @author huangbo
824
820
  * @date 2024年9月7日
825
821
  **/
826
- getMenus() {
822
+ getMenus(loading) {
827
823
  util
828
824
  .ajax({ url: this._menuUrl })
829
825
  .then((res) => {
826
+ loading.close();
830
827
  if (res.rCode === 0) {
831
828
  if (res.results && res.results.length) {
832
829
  this.menus = res.results;
833
830
  this.setTips(this.menus);
834
831
  store.set('nav', this.menus);
832
+ if (this.appCode) {
833
+ let app = this.userApps.filter((item) => {
834
+ return item.code === this.appCode;
835
+ })[0];
836
+ if (app) {
837
+ this.active = app.id;
838
+ if (app.url) {
839
+ let obj = this.getMenu(this.menus, app.url);
840
+ if (obj) {
841
+ let tab = this.setIframeType(obj);
842
+ this.tabs = [tab];
843
+ this.activeName = tab.id;
844
+ // if (tab.method == 'router') {
845
+ // let params = util.getParams({ url: tab.url });
846
+ // this.$router.push({
847
+ // path: tab.path,
848
+ // query: { ...this.$parent.params, ...params }
849
+ // });
850
+ // }
851
+ }
852
+ }
853
+ }
854
+ if (this.tabs.length == 0) {
855
+ let subMenus = this.getMenu(
856
+ this.menus,
857
+ this.appCode,
858
+ 'appCode'
859
+ );
860
+ if (subMenus) {
861
+ // this.subMenus = subMenus;
862
+ // this.showMenu = true;
863
+ let obj = this.getFirst(subMenus);
864
+ if (obj) {
865
+ let tab = this.setIframeType(obj);
866
+ this.tabs = [tab];
867
+ this.activeName = tab.id;
868
+ // if (tab.method == 'router') {
869
+ // let params = util.getParams({ url: tab.url });
870
+ // this.$router.push({
871
+ // path: tab.path,
872
+ // query: { ...this.$parent.params, ...params }
873
+ // });
874
+ // }
875
+ }
876
+ } else {
877
+ this.subMenus = null;
878
+ this.showMenu = false;
879
+ }
880
+ }
881
+ // this.width = this.menuWidth;
882
+ // this.$refs.subMenus && this.$refs.subMenus.clearSubmenu();
883
+ }
835
884
  if (this.indexUrl) {
836
885
  let obj = this.getMenu(this.menus, this.indexUrl);
837
886
  if (obj) {
838
- this.tabs = [this.setIframeType(obj)];
839
- this.activeName = obj.id;
887
+ if (!this.appCode) {
888
+ let tab = this.setIframeType(obj);
889
+ this.tabs = [tab];
890
+ this.activeName = tab.id;
891
+ // if (tab.method == 'router') {
892
+ // let params = util.getParams({ url: tab.url });
893
+ // this.$router.push({
894
+ // path: tab.path,
895
+ // query: { ...this.$parent.params, ...params }
896
+ // });
897
+ // }
898
+ }
840
899
  this.homePage = obj;
841
900
  } else {
842
901
  this.homePage = this.setIframeType({
@@ -845,28 +904,40 @@ export default {
845
904
  id: '0',
846
905
  appCode: 'indexUrl'
847
906
  });
848
- this.tabs = [this.homePage];
849
- this.activeName = '0';
907
+ if (!this.appCode) {
908
+ this.tabs = [this.homePage];
909
+ this.activeName = '0';
910
+ // if (this.homePage.method == 'router') {
911
+ // let params = util.getParams({ url: this.homePage.url });
912
+ // this.$router.push({
913
+ // path: this.homePage.path,
914
+ // query: { ...this.$parent.params, ...params }
915
+ // });
916
+ // }
917
+ }
850
918
  }
851
- }
852
- if (this.initApps && this.initApps.length) {
919
+ } else if (
920
+ this.initApps &&
921
+ this.initApps.length &&
922
+ !this.appCode
923
+ ) {
853
924
  let obj = this.getMenu(
854
925
  this.menus,
855
926
  this.initApps[this.initApps.length - 1]
856
927
  );
857
928
  if (obj) {
858
- this.tabs.push(this.setIframeType(obj));
859
- this.activeName = obj.id;
929
+ let tab = this.setIframeType(obj);
930
+ this.tabs.push(tab);
931
+ this.activeName = tab.id;
932
+ // if (tab.method == 'router') {
933
+ // let params = util.getParams({ url: tab.url });
934
+ // this.$router.push({
935
+ // path: tab.path,
936
+ // query: { ...this.$parent.params, ...params }
937
+ // });
938
+ // }
860
939
  }
861
940
  }
862
- if (this.appCode) {
863
- let subMenus = this.getMenu(this.menus, res.code, 'appCode');
864
- this.subMenus = subMenus ? subMenus : null;
865
- this.showMenu = subMenus !== false;
866
- this.showApps = false;
867
- this.width = '296px';
868
- this.$refs.subMenus && this.$refs.subMenus.clearSubmenu();
869
- }
870
941
  } else {
871
942
  this.$message.error('未分配菜单权限,请联系管理员!');
872
943
  }
@@ -876,6 +947,7 @@ export default {
876
947
  }
877
948
  })
878
949
  .catch((err) => {
950
+ loading.close();
879
951
  if (err.message && err.message !== 'canceled') {
880
952
  this.$message.error(err.message);
881
953
  }
@@ -891,9 +963,6 @@ export default {
891
963
  let urls = url.split('?');
892
964
  if (urls[0].indexOf('.js') > 1 && !isIE) {
893
965
  res.method = 'wujie';
894
- this.$nextTick(() => {
895
- res.refresh = true;
896
- });
897
966
  } else if (
898
967
  urls[0].indexOf('.dhtml') > 0 ||
899
968
  (urls[0].indexOf('.html') > 0 && urls[0].indexOf('.html#') === -1)
@@ -906,16 +975,9 @@ export default {
906
975
  const routes = this.$router.options.routes;
907
976
  if (routes) {
908
977
  let path = this.hasRouter(routes, urls[0], res.appCode);
909
- if (path) {
978
+ if (path && this.routeType !== 'wujie') {
910
979
  res.method = 'router';
911
- let params = util.getParams({ url: url });
912
- this.$router.push({
913
- path: path,
914
- query: params
915
- });
916
- this.$nextTick(() => {
917
- res.refresh = true;
918
- });
980
+ res.path = path;
919
981
  } else {
920
982
  let urlopenmode = util.getParams({
921
983
  url: url,
@@ -930,9 +992,6 @@ export default {
930
992
  res.method = 'iframe';
931
993
  } else {
932
994
  res.method = 'wujie';
933
- this.$nextTick(() => {
934
- res.refresh = true;
935
- });
936
995
  }
937
996
  }
938
997
  } else if (
@@ -940,14 +999,12 @@ export default {
940
999
  urls[0].indexOf('/#/') > -1
941
1000
  ) {
942
1001
  res.method = 'wujie';
943
- this.$nextTick(() => {
944
- res.refresh = true;
945
- });
946
1002
  } else {
947
1003
  res.method = 'iframe';
948
1004
  }
949
1005
  }
950
1006
  }
1007
+ res.refresh = true;
951
1008
  return res;
952
1009
  },
953
1010
  /**
@@ -987,6 +1044,37 @@ export default {
987
1044
  }
988
1045
  return false;
989
1046
  },
1047
+ /**
1048
+ * @desc:获取菜单第一条数据
1049
+ * @author huangbo
1050
+ * @date 2024年9月7日
1051
+ **/
1052
+ getFirst(obj) {
1053
+ if (!obj) {
1054
+ return '';
1055
+ }
1056
+ let openIdex = 0;
1057
+ if (
1058
+ obj.extendData &&
1059
+ (obj.extendData.subDefOpenIndex || obj.extendData.subDefOpen)
1060
+ ) {
1061
+ openIdex = parseInt(
1062
+ obj.extendData.subDefOpenIndex || obj.extendData.subDefOpen,
1063
+ 10
1064
+ );
1065
+ }
1066
+ if (obj.children && obj.children.length && obj.children[openIdex]) {
1067
+ return this.getFirst(obj.children[openIdex]);
1068
+ } else if (
1069
+ obj.fourthTabs &&
1070
+ obj.fourthTabs.length &&
1071
+ obj.fourthTabs[openIdex]
1072
+ ) {
1073
+ return this.getFirst(obj.fourthTabs[openIdex]);
1074
+ } else if (obj.url) {
1075
+ return obj;
1076
+ }
1077
+ },
990
1078
  /**
991
1079
  * @desc:遍历设置菜单气泡提醒
992
1080
  * @author huangbo
@@ -1105,6 +1193,8 @@ export default {
1105
1193
  * @date 2024年9月7日
1106
1194
  **/
1107
1195
  handlerClickApp(res) {
1196
+ this.showMsg = false;
1197
+ this.showSet = false;
1108
1198
  if (res) {
1109
1199
  if (res.permission === false) {
1110
1200
  return false;
@@ -1116,8 +1206,6 @@ export default {
1116
1206
  this.subMenus = res;
1117
1207
  this.showMenu = true;
1118
1208
  this.showApps = false;
1119
- this.width = '296px';
1120
- this.$refs.subMenus && this.$refs.subMenus.clearSubmenu();
1121
1209
  } else {
1122
1210
  let set = true;
1123
1211
  if (res.url) {
@@ -1131,17 +1219,17 @@ export default {
1131
1219
  let i = util.indexOfObj(this.tabs, res, 'id');
1132
1220
  this.activeName = res.id;
1133
1221
  if (i == -1) {
1134
- this.tabs.push(this.setIframeType(res));
1222
+ let tab = this.setIframeType(res);
1223
+ this.tabs.push(tab);
1135
1224
  }
1136
1225
  }
1137
1226
  }
1138
1227
  if (set && res.code) {
1139
1228
  let subMenus = this.getMenu(this.menus, res.code, 'appCode');
1229
+ this.title = res.text || res.name;
1140
1230
  this.subMenus = subMenus ? subMenus : null;
1141
1231
  this.showMenu = subMenus !== false;
1142
1232
  this.showApps = false;
1143
- this.width = '296px';
1144
- this.$refs.subMenus && this.$refs.subMenus.clearSubmenu();
1145
1233
  }
1146
1234
  }
1147
1235
  this.active = res.id;
@@ -1150,14 +1238,6 @@ export default {
1150
1238
  this.showApps = !this.showApps;
1151
1239
  }
1152
1240
  },
1153
- /**
1154
- * @desc:显示菜单界面
1155
- * @author huangbo
1156
- * @date 2024年9月7日
1157
- **/
1158
- handleShowMenus() {
1159
- this.showMenu = true;
1160
- },
1161
1241
  /**
1162
1242
  * @desc:显示Drawer界面
1163
1243
  * @author huangbo
@@ -1185,16 +1265,13 @@ export default {
1185
1265
  * @date 2024年9月7日
1186
1266
  **/
1187
1267
  handlerClickMenu(res) {
1188
- if (typeof res === 'number') {
1189
- let num = 296;
1190
- this.width = num * res + 'px';
1191
- } else {
1192
- let i = util.indexOfObj(this.tabs, res, 'id');
1193
- this.activeName = res.id;
1194
- if (i == -1) {
1195
- this.tabs.push(this.setIframeType(res));
1196
- }
1197
- this.showMenu = false;
1268
+ this.showMsg = false;
1269
+ this.showSet = false;
1270
+ let i = util.indexOfObj(this.tabs, res, 'id');
1271
+ this.activeName = res.id;
1272
+ if (i == -1) {
1273
+ let tab = this.setIframeType(res);
1274
+ this.tabs.push(tab);
1198
1275
  }
1199
1276
  },
1200
1277
  /**
@@ -1231,28 +1308,6 @@ export default {
1231
1308
  this.webSocket.destroy();
1232
1309
  }
1233
1310
  },
1234
- /**
1235
- * @desc:选中iframe页签刷新
1236
- * @author huangbo
1237
- * @date 2024年9月7日
1238
- **/
1239
- handleTab(res) {
1240
- let index;
1241
- if (res) {
1242
- index = parseInt(res.index);
1243
- } else {
1244
- index = util.indexOfObj(this.tabs, this.activeName, 'id');
1245
- }
1246
- let item = this.tabs[index];
1247
- if (item.method == 'iframe') {
1248
- item.url = util.handlerUrl(item.url);
1249
- } else {
1250
- item.refresh = false;
1251
- this.$nextTick(() => {
1252
- item.refresh = true;
1253
- });
1254
- }
1255
- },
1256
1311
  /**
1257
1312
  * @desc:刷新选中iframe页签
1258
1313
  * @author huangbo
@@ -1297,6 +1352,9 @@ export default {
1297
1352
  if (this.tabs.length == 1) {
1298
1353
  disabled.other = true;
1299
1354
  }
1355
+ if (this.tabs[index].id != this.activeName) {
1356
+ disabled.refresh = true;
1357
+ }
1300
1358
  this.isDisabled = disabled;
1301
1359
  this.$refs.tabsHandler.$el.style.setProperty('left', `${e.x}px`);
1302
1360
  this.$refs.tabsHandler.$el.style.setProperty('top', `${e.y}px`);
@@ -1345,6 +1403,8 @@ export default {
1345
1403
  this.handleQuit();
1346
1404
  break;
1347
1405
  case 'online':
1406
+ this.showMsg = false;
1407
+ this.showSet = false;
1348
1408
  if (this.onlineUrl) {
1349
1409
  this.dialog = {
1350
1410
  title: '查看在线人员',
@@ -1355,9 +1415,11 @@ export default {
1355
1415
  break;
1356
1416
  case 'notice':
1357
1417
  this.showMsg = !this.showMsg;
1418
+ this.showSet = false;
1358
1419
  break;
1359
1420
  case 'set':
1360
1421
  this.showSet = !this.showSet;
1422
+ this.showMsg = false;
1361
1423
  break;
1362
1424
  case 'home':
1363
1425
  if (this.homePage.id !== this.activeName) {
@@ -1366,10 +1428,14 @@ export default {
1366
1428
  this.tabs.unshift(this.homePage);
1367
1429
  }
1368
1430
  this.activeName = this.homePage.id;
1431
+ this.showMsg = false;
1432
+ this.showSet = false;
1369
1433
  }
1370
1434
  break;
1371
1435
  case 'search':
1372
1436
  this.handlerSetDrawer(res);
1437
+ this.showMsg = false;
1438
+ this.showSet = false;
1373
1439
  break;
1374
1440
  case 'goView':
1375
1441
  util.win.open(res.path, '_blank');
@@ -1620,69 +1686,36 @@ export default {
1620
1686
  }
1621
1687
  },
1622
1688
  jumpMenu(res) {
1623
- let apps = res.split(',');
1689
+ let apps = res;
1690
+ if (typeof res === 'string') {
1691
+ apps = res.split(',');
1692
+ }
1624
1693
  let obj = this.getMenu(this.menus, apps[apps.length - 1]);
1625
1694
  if (obj) {
1626
1695
  let i = util.indexOfObj(this.tabs, obj, 'id');
1696
+ let n = util.indexOfObj(this.tabs, this.activeName, 'id');
1697
+ this.activeName = obj.id;
1627
1698
  if (i == -1) {
1628
- this.tabs.push(this.setIframeType(obj));
1699
+ let tab = this.setIframeType(obj);
1700
+ this.tabs.splice(n + 1, 0, tab);
1629
1701
  }
1630
- this.activeName = obj.id;
1631
1702
  } else {
1632
1703
  this.$message.error('没有此菜单!');
1633
1704
  }
1634
1705
  },
1635
- //移动
1636
- move() {
1637
- let area = this.$refs.area;
1638
- let box = this.$refs.box;
1639
- let [sTime, eTime] = [0, 0];
1640
- area.addEventListener('mousedown', (e) => {
1641
- sTime = new Date().getTime();
1642
- let { y: downY, x: downX } = e;
1643
- let { height: winH, width: winW } =
1644
- document.body.getBoundingClientRect();
1645
- //防止拖动期间选中和复制网页文本
1646
- document.body.onselectstart = document.body.oncontextmenu = () => {
1647
- return false;
1648
- };
1649
- document.onmousemove = (eve) => {
1650
- let size = 40;
1651
- let { y: moveY, x: moveX } = eve;
1652
- let { top: boxTop, left: boxLeft } = box.getBoundingClientRect();
1653
- boxTop += moveY - downY;
1654
- boxLeft += moveX - downX;
1655
- boxTop >= winH - size && (boxTop = winH - size);
1656
- boxTop <= -size && (boxTop = -size);
1657
- boxLeft >= winW - size && (boxLeft = winW - size);
1658
- boxLeft <= -size && (boxLeft = -size);
1659
- if (boxTop < 60) {
1660
- boxTop = 60;
1706
+ //监听改变菜单
1707
+ handleListener() {
1708
+ util.win.addEventListener(
1709
+ 'message',
1710
+ (e) => {
1711
+ var msg = e.data;
1712
+ if (msg.key == 'jump_Menu') {
1713
+ let res = msg.data1;
1714
+ this.jumpMenu(res);
1661
1715
  }
1662
- if (boxLeft < 80) {
1663
- boxLeft = 80;
1664
- }
1665
- box.style.top = boxTop + 'px';
1666
- box.style.left = boxLeft + 'px';
1667
- downY = moveY;
1668
- downX = moveX;
1669
- };
1670
- document.onmouseup = () => {
1671
- eTime = new Date().getTime();
1672
- let isClick = eTime - sTime < 200;
1673
- if (isClick) {
1674
- let onArea = () => {
1675
- this.subMenu = [];
1676
- area.removeEventListener('click', onArea);
1677
- };
1678
- area.addEventListener('click', onArea);
1679
- }
1680
- document.onmousemove = null;
1681
- document.body.onselectstart = document.body.oncontextmenu = () => {
1682
- return true;
1683
- };
1684
- };
1685
- });
1716
+ },
1717
+ false
1718
+ );
1686
1719
  }
1687
1720
  },
1688
1721
  beforeDestroy() {