eoss-ui 0.5.81-beta4 → 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.
- package/lib/eoss-ui.common.js +1614 -1134
- package/lib/index.js +1 -1
- package/lib/main.js +1541 -1118
- package/lib/selector-panel.js +64 -11
- package/lib/selector.js +8 -4
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/main.css +1 -1
- package/lib/theme-chalk/selector-panel.css +1 -1
- package/lib/theme-chalk/simplicity.css +1 -1
- package/package.json +1 -1
- package/packages/main/src/default/index.vue +1 -1
- package/packages/main/src/main.vue +12 -16
- package/packages/main/src/simplicity/apps.vue +176 -145
- package/packages/main/src/simplicity/index.vue +120 -190
- package/packages/main/src/simplicity/menu-list.vue +96 -26
- package/packages/main/src/simplicity/message.vue +35 -25
- package/packages/main/src/simplicity/notice.vue +72 -39
- package/packages/main/src/simplicity/router-page.vue +53 -0
- package/packages/main/src/simplicity/settings.vue +1 -1
- package/packages/main/src/simplicity/sub-menu.vue +67 -68
- package/packages/main/src/simplicity/user.vue +4 -4
- package/packages/main/src/simplicity/userinfo.vue +1 -0
- package/packages/selector/src/main.vue +6 -2
- package/packages/selector-panel/src/main.vue +21 -2
- package/packages/selector-panel/src/selection.vue +6 -0
- package/packages/theme-chalk/lib/index.css +1 -1
- package/packages/theme-chalk/lib/main.css +1 -1
- package/packages/theme-chalk/lib/selector-panel.css +1 -1
- package/packages/theme-chalk/lib/simplicity.css +1 -1
- package/packages/theme-chalk/src/common/var.scss +2 -0
- package/packages/theme-chalk/src/selector-panel.scss +2 -1
- package/packages/theme-chalk/src/simplicity.scss +191 -5
- package/src/index.js +1 -1
|
@@ -74,46 +74,31 @@
|
|
|
74
74
|
</div>
|
|
75
75
|
<div class="es-simplicity-main">
|
|
76
76
|
<!-- 菜单 -->
|
|
77
|
-
<
|
|
78
|
-
|
|
79
|
-
direction="ltr"
|
|
80
|
-
modal-class="es-simplicity-apps-modal"
|
|
81
|
-
:size="width + 'px'"
|
|
82
|
-
:modal-append-to-body="false"
|
|
83
|
-
:with-header="false"
|
|
77
|
+
<sub-menu
|
|
78
|
+
ref="subMenus"
|
|
84
79
|
:visible.sync="showMenu"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
<
|
|
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
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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
|
-
|
|
145
|
+
:class="{ 'is-disabled': isDisabled.refresh }"
|
|
146
|
+
@click="isDisabled.refresh ? '' : handleTabsEvents(0)"
|
|
161
147
|
>
|
|
162
148
|
刷新
|
|
163
149
|
</div>
|
|
@@ -192,6 +178,7 @@
|
|
|
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
|
|
@@ -210,14 +197,6 @@
|
|
|
210
197
|
:notice-num="notice"
|
|
211
198
|
@click="handleClick"
|
|
212
199
|
></handler>
|
|
213
|
-
<div
|
|
214
|
-
class="es-simplicity-unfold"
|
|
215
|
-
ref="box"
|
|
216
|
-
v-show="!showMenu && subMenus"
|
|
217
|
-
@click="handleShowMenus"
|
|
218
|
-
>
|
|
219
|
-
<i class="el-icon-s-unfold" ref="area"></i>
|
|
220
|
-
</div>
|
|
221
200
|
<el-tab-pane
|
|
222
201
|
v-for="item in tabs"
|
|
223
202
|
:key="item.id"
|
|
@@ -246,7 +225,11 @@
|
|
|
246
225
|
></es-wujie>
|
|
247
226
|
</template>
|
|
248
227
|
<template v-else-if="item.method === 'router' && item.refresh">
|
|
249
|
-
<router-
|
|
228
|
+
<router-page
|
|
229
|
+
v-bind="item"
|
|
230
|
+
:show="activeName == item.id"
|
|
231
|
+
:query="$parent.params"
|
|
232
|
+
></router-page>
|
|
250
233
|
</template>
|
|
251
234
|
</el-tab-pane>
|
|
252
235
|
</el-tabs>
|
|
@@ -302,6 +285,7 @@ import user from './user.vue';
|
|
|
302
285
|
import message from './message.vue';
|
|
303
286
|
import notice from './notice.vue';
|
|
304
287
|
import settings from './settings.vue';
|
|
288
|
+
import routerPage from './router-page.vue';
|
|
305
289
|
import {
|
|
306
290
|
wss,
|
|
307
291
|
logout,
|
|
@@ -314,14 +298,14 @@ import store from 'eoss-ui/src/utils/store';
|
|
|
314
298
|
import util from 'eoss-ui/src/utils/util';
|
|
315
299
|
const isIE = navigator.userAgent.indexOf('MSIE') != -1;
|
|
316
300
|
let events = [
|
|
317
|
-
(tabs, index) => {
|
|
301
|
+
(tabs, index, that) => {
|
|
318
302
|
let tab = tabs[index];
|
|
319
303
|
|
|
320
304
|
if (tab.method == 'iframe') {
|
|
321
305
|
tabs[index].url = util.handlerUrl(tab.url);
|
|
322
306
|
} else {
|
|
323
307
|
tabs[index].refresh = false;
|
|
324
|
-
|
|
308
|
+
that.$nextTick(() => {
|
|
325
309
|
tabs[index].refresh = true;
|
|
326
310
|
});
|
|
327
311
|
}
|
|
@@ -364,7 +348,7 @@ let events = [
|
|
|
364
348
|
}
|
|
365
349
|
];
|
|
366
350
|
export default {
|
|
367
|
-
name: '
|
|
351
|
+
name: 'Simplicity',
|
|
368
352
|
components: {
|
|
369
353
|
avatar,
|
|
370
354
|
handler,
|
|
@@ -373,7 +357,8 @@ export default {
|
|
|
373
357
|
user,
|
|
374
358
|
message,
|
|
375
359
|
notice,
|
|
376
|
-
settings
|
|
360
|
+
settings,
|
|
361
|
+
routerPage
|
|
377
362
|
},
|
|
378
363
|
props: {
|
|
379
364
|
appCode: String,
|
|
@@ -455,10 +440,13 @@ export default {
|
|
|
455
440
|
wjProps: Object,
|
|
456
441
|
//无界微前端Attrs属性
|
|
457
442
|
wjAttrs: Object,
|
|
443
|
+
//菜单宽度
|
|
458
444
|
menuWidth: {
|
|
459
445
|
type: Number,
|
|
460
446
|
default: 220
|
|
461
|
-
}
|
|
447
|
+
},
|
|
448
|
+
//路由方式
|
|
449
|
+
routeType: String
|
|
462
450
|
},
|
|
463
451
|
data() {
|
|
464
452
|
return {
|
|
@@ -472,12 +460,14 @@ export default {
|
|
|
472
460
|
userApps: [],
|
|
473
461
|
//所有菜单
|
|
474
462
|
menus: [],
|
|
463
|
+
//菜单名称
|
|
464
|
+
title: '',
|
|
475
465
|
//子菜单
|
|
476
466
|
subMenus: null,
|
|
477
467
|
//展示菜单导航
|
|
478
468
|
showMenu: false,
|
|
479
|
-
|
|
480
|
-
|
|
469
|
+
//折叠菜单
|
|
470
|
+
fold: false,
|
|
481
471
|
//人工智能配置
|
|
482
472
|
aiConfig: null,
|
|
483
473
|
//公用窗口面板配置
|
|
@@ -610,7 +600,7 @@ export default {
|
|
|
610
600
|
util.win.refresh = this.handleRefresh;
|
|
611
601
|
util.win.jumpMenu = this.jumpMenu;
|
|
612
602
|
util.win.windowOpen = this.openPage;
|
|
613
|
-
this.
|
|
603
|
+
this.handleListener();
|
|
614
604
|
},
|
|
615
605
|
methods: {
|
|
616
606
|
/**
|
|
@@ -618,13 +608,13 @@ export default {
|
|
|
618
608
|
* @author huangbo
|
|
619
609
|
* @date 2024年9月7日
|
|
620
610
|
**/
|
|
621
|
-
hasRouter(res, url, code
|
|
611
|
+
hasRouter(res, url, code) {
|
|
622
612
|
if (!url) {
|
|
623
613
|
return false;
|
|
624
614
|
}
|
|
625
615
|
if (Array.isArray(res)) {
|
|
626
616
|
for (let i in res) {
|
|
627
|
-
let path = this.hasRouter(res[i], url, code
|
|
617
|
+
let path = this.hasRouter(res[i], url, code);
|
|
628
618
|
if (path) {
|
|
629
619
|
return path;
|
|
630
620
|
}
|
|
@@ -650,7 +640,7 @@ export default {
|
|
|
650
640
|
return pathname;
|
|
651
641
|
}
|
|
652
642
|
if (res && Object.prototype.hasOwnProperty.call(res, 'children')) {
|
|
653
|
-
let path = this.hasRouter(res.children, url, code
|
|
643
|
+
let path = this.hasRouter(res.children, url, code);
|
|
654
644
|
if (path) {
|
|
655
645
|
return path;
|
|
656
646
|
}
|
|
@@ -839,7 +829,6 @@ export default {
|
|
|
839
829
|
this.menus = res.results;
|
|
840
830
|
this.setTips(this.menus);
|
|
841
831
|
store.set('nav', this.menus);
|
|
842
|
-
console.log(12121);
|
|
843
832
|
if (this.appCode) {
|
|
844
833
|
let app = this.userApps.filter((item) => {
|
|
845
834
|
return item.code === this.appCode;
|
|
@@ -852,13 +841,13 @@ export default {
|
|
|
852
841
|
let tab = this.setIframeType(obj);
|
|
853
842
|
this.tabs = [tab];
|
|
854
843
|
this.activeName = tab.id;
|
|
855
|
-
if (tab.method == 'router') {
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
}
|
|
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
|
+
// }
|
|
862
851
|
}
|
|
863
852
|
}
|
|
864
853
|
}
|
|
@@ -876,13 +865,13 @@ export default {
|
|
|
876
865
|
let tab = this.setIframeType(obj);
|
|
877
866
|
this.tabs = [tab];
|
|
878
867
|
this.activeName = tab.id;
|
|
879
|
-
if (tab.method == 'router') {
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
}
|
|
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
|
+
// }
|
|
886
875
|
}
|
|
887
876
|
} else {
|
|
888
877
|
this.subMenus = null;
|
|
@@ -899,13 +888,13 @@ export default {
|
|
|
899
888
|
let tab = this.setIframeType(obj);
|
|
900
889
|
this.tabs = [tab];
|
|
901
890
|
this.activeName = tab.id;
|
|
902
|
-
if (tab.method == 'router') {
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
}
|
|
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
|
+
// }
|
|
909
898
|
}
|
|
910
899
|
this.homePage = obj;
|
|
911
900
|
} else {
|
|
@@ -918,13 +907,13 @@ export default {
|
|
|
918
907
|
if (!this.appCode) {
|
|
919
908
|
this.tabs = [this.homePage];
|
|
920
909
|
this.activeName = '0';
|
|
921
|
-
if (this.homePage.method == 'router') {
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
}
|
|
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
|
+
// }
|
|
928
917
|
}
|
|
929
918
|
}
|
|
930
919
|
} else if (
|
|
@@ -940,13 +929,13 @@ export default {
|
|
|
940
929
|
let tab = this.setIframeType(obj);
|
|
941
930
|
this.tabs.push(tab);
|
|
942
931
|
this.activeName = tab.id;
|
|
943
|
-
if (tab.method == 'router') {
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
}
|
|
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
|
+
// }
|
|
950
939
|
}
|
|
951
940
|
}
|
|
952
941
|
} else {
|
|
@@ -986,7 +975,7 @@ export default {
|
|
|
986
975
|
const routes = this.$router.options.routes;
|
|
987
976
|
if (routes) {
|
|
988
977
|
let path = this.hasRouter(routes, urls[0], res.appCode);
|
|
989
|
-
if (path) {
|
|
978
|
+
if (path && this.routeType !== 'wujie') {
|
|
990
979
|
res.method = 'router';
|
|
991
980
|
res.path = path;
|
|
992
981
|
} else {
|
|
@@ -1204,6 +1193,8 @@ export default {
|
|
|
1204
1193
|
* @date 2024年9月7日
|
|
1205
1194
|
**/
|
|
1206
1195
|
handlerClickApp(res) {
|
|
1196
|
+
this.showMsg = false;
|
|
1197
|
+
this.showSet = false;
|
|
1207
1198
|
if (res) {
|
|
1208
1199
|
if (res.permission === false) {
|
|
1209
1200
|
return false;
|
|
@@ -1215,8 +1206,6 @@ export default {
|
|
|
1215
1206
|
this.subMenus = res;
|
|
1216
1207
|
this.showMenu = true;
|
|
1217
1208
|
this.showApps = false;
|
|
1218
|
-
this.width = this.menuWidth;
|
|
1219
|
-
this.$refs.subMenus && this.$refs.subMenus.clearSubmenu();
|
|
1220
1209
|
} else {
|
|
1221
1210
|
let set = true;
|
|
1222
1211
|
if (res.url) {
|
|
@@ -1231,25 +1220,16 @@ export default {
|
|
|
1231
1220
|
this.activeName = res.id;
|
|
1232
1221
|
if (i == -1) {
|
|
1233
1222
|
let tab = this.setIframeType(res);
|
|
1234
|
-
this.tabs.push(
|
|
1235
|
-
if (tab.method == 'router') {
|
|
1236
|
-
let params = util.getParams({ url: tab.url });
|
|
1237
|
-
this.$router.push({
|
|
1238
|
-
path: tab.path,
|
|
1239
|
-
query: params
|
|
1240
|
-
});
|
|
1241
|
-
}
|
|
1223
|
+
this.tabs.push(tab);
|
|
1242
1224
|
}
|
|
1243
1225
|
}
|
|
1244
1226
|
}
|
|
1245
1227
|
if (set && res.code) {
|
|
1246
1228
|
let subMenus = this.getMenu(this.menus, res.code, 'appCode');
|
|
1247
|
-
|
|
1229
|
+
this.title = res.text || res.name;
|
|
1248
1230
|
this.subMenus = subMenus ? subMenus : null;
|
|
1249
1231
|
this.showMenu = subMenus !== false;
|
|
1250
1232
|
this.showApps = false;
|
|
1251
|
-
this.width = this.menuWidth;
|
|
1252
|
-
this.$refs.subMenus && this.$refs.subMenus.clearSubmenu();
|
|
1253
1233
|
}
|
|
1254
1234
|
}
|
|
1255
1235
|
this.active = res.id;
|
|
@@ -1258,14 +1238,6 @@ export default {
|
|
|
1258
1238
|
this.showApps = !this.showApps;
|
|
1259
1239
|
}
|
|
1260
1240
|
},
|
|
1261
|
-
/**
|
|
1262
|
-
* @desc:显示菜单界面
|
|
1263
|
-
* @author huangbo
|
|
1264
|
-
* @date 2024年9月7日
|
|
1265
|
-
**/
|
|
1266
|
-
handleShowMenus() {
|
|
1267
|
-
this.showMenu = true;
|
|
1268
|
-
},
|
|
1269
1241
|
/**
|
|
1270
1242
|
* @desc:显示Drawer界面
|
|
1271
1243
|
* @author huangbo
|
|
@@ -1293,24 +1265,13 @@ export default {
|
|
|
1293
1265
|
* @date 2024年9月7日
|
|
1294
1266
|
**/
|
|
1295
1267
|
handlerClickMenu(res) {
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
let tab = this.setIframeType(res);
|
|
1304
|
-
this.tabs.push(tab);
|
|
1305
|
-
if (tab.method == 'router') {
|
|
1306
|
-
let params = util.getParams({ url: tab.url });
|
|
1307
|
-
this.$router.push({
|
|
1308
|
-
path: tab.path,
|
|
1309
|
-
query: params
|
|
1310
|
-
});
|
|
1311
|
-
}
|
|
1312
|
-
}
|
|
1313
|
-
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);
|
|
1314
1275
|
}
|
|
1315
1276
|
},
|
|
1316
1277
|
/**
|
|
@@ -1391,6 +1352,9 @@ export default {
|
|
|
1391
1352
|
if (this.tabs.length == 1) {
|
|
1392
1353
|
disabled.other = true;
|
|
1393
1354
|
}
|
|
1355
|
+
if (this.tabs[index].id != this.activeName) {
|
|
1356
|
+
disabled.refresh = true;
|
|
1357
|
+
}
|
|
1394
1358
|
this.isDisabled = disabled;
|
|
1395
1359
|
this.$refs.tabsHandler.$el.style.setProperty('left', `${e.x}px`);
|
|
1396
1360
|
this.$refs.tabsHandler.$el.style.setProperty('top', `${e.y}px`);
|
|
@@ -1439,6 +1403,8 @@ export default {
|
|
|
1439
1403
|
this.handleQuit();
|
|
1440
1404
|
break;
|
|
1441
1405
|
case 'online':
|
|
1406
|
+
this.showMsg = false;
|
|
1407
|
+
this.showSet = false;
|
|
1442
1408
|
if (this.onlineUrl) {
|
|
1443
1409
|
this.dialog = {
|
|
1444
1410
|
title: '查看在线人员',
|
|
@@ -1449,9 +1415,11 @@ export default {
|
|
|
1449
1415
|
break;
|
|
1450
1416
|
case 'notice':
|
|
1451
1417
|
this.showMsg = !this.showMsg;
|
|
1418
|
+
this.showSet = false;
|
|
1452
1419
|
break;
|
|
1453
1420
|
case 'set':
|
|
1454
1421
|
this.showSet = !this.showSet;
|
|
1422
|
+
this.showMsg = false;
|
|
1455
1423
|
break;
|
|
1456
1424
|
case 'home':
|
|
1457
1425
|
if (this.homePage.id !== this.activeName) {
|
|
@@ -1460,10 +1428,14 @@ export default {
|
|
|
1460
1428
|
this.tabs.unshift(this.homePage);
|
|
1461
1429
|
}
|
|
1462
1430
|
this.activeName = this.homePage.id;
|
|
1431
|
+
this.showMsg = false;
|
|
1432
|
+
this.showSet = false;
|
|
1463
1433
|
}
|
|
1464
1434
|
break;
|
|
1465
1435
|
case 'search':
|
|
1466
1436
|
this.handlerSetDrawer(res);
|
|
1437
|
+
this.showMsg = false;
|
|
1438
|
+
this.showSet = false;
|
|
1467
1439
|
break;
|
|
1468
1440
|
case 'goView':
|
|
1469
1441
|
util.win.open(res.path, '_blank');
|
|
@@ -1714,7 +1686,10 @@ export default {
|
|
|
1714
1686
|
}
|
|
1715
1687
|
},
|
|
1716
1688
|
jumpMenu(res) {
|
|
1717
|
-
let apps = res
|
|
1689
|
+
let apps = res;
|
|
1690
|
+
if (typeof res === 'string') {
|
|
1691
|
+
apps = res.split(',');
|
|
1692
|
+
}
|
|
1718
1693
|
let obj = this.getMenu(this.menus, apps[apps.length - 1]);
|
|
1719
1694
|
if (obj) {
|
|
1720
1695
|
let i = util.indexOfObj(this.tabs, obj, 'id');
|
|
@@ -1723,69 +1698,24 @@ export default {
|
|
|
1723
1698
|
if (i == -1) {
|
|
1724
1699
|
let tab = this.setIframeType(obj);
|
|
1725
1700
|
this.tabs.splice(n + 1, 0, tab);
|
|
1726
|
-
if (tab.method == 'router') {
|
|
1727
|
-
let params = util.getParams({ url: tab.url });
|
|
1728
|
-
this.$router.push({
|
|
1729
|
-
path: tab.path,
|
|
1730
|
-
query: params
|
|
1731
|
-
});
|
|
1732
|
-
}
|
|
1733
1701
|
}
|
|
1734
1702
|
} else {
|
|
1735
1703
|
this.$message.error('没有此菜单!');
|
|
1736
1704
|
}
|
|
1737
1705
|
},
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
document.body.getBoundingClientRect();
|
|
1748
|
-
//防止拖动期间选中和复制网页文本
|
|
1749
|
-
document.body.onselectstart = document.body.oncontextmenu = () => {
|
|
1750
|
-
return false;
|
|
1751
|
-
};
|
|
1752
|
-
document.onmousemove = (eve) => {
|
|
1753
|
-
let size = 40;
|
|
1754
|
-
let { y: moveY, x: moveX } = eve;
|
|
1755
|
-
let { top: boxTop, left: boxLeft } = box.getBoundingClientRect();
|
|
1756
|
-
boxTop += moveY - downY;
|
|
1757
|
-
boxLeft += moveX - downX;
|
|
1758
|
-
boxTop >= winH - size && (boxTop = winH - size);
|
|
1759
|
-
boxTop <= -size && (boxTop = -size);
|
|
1760
|
-
boxLeft >= winW - size && (boxLeft = winW - size);
|
|
1761
|
-
boxLeft <= -size && (boxLeft = -size);
|
|
1762
|
-
if (boxTop < 60) {
|
|
1763
|
-
boxTop = 60;
|
|
1764
|
-
}
|
|
1765
|
-
if (boxLeft < 80) {
|
|
1766
|
-
boxLeft = 80;
|
|
1767
|
-
}
|
|
1768
|
-
box.style.top = boxTop + 'px';
|
|
1769
|
-
box.style.left = boxLeft + 'px';
|
|
1770
|
-
downY = moveY;
|
|
1771
|
-
downX = moveX;
|
|
1772
|
-
};
|
|
1773
|
-
document.onmouseup = () => {
|
|
1774
|
-
eTime = new Date().getTime();
|
|
1775
|
-
let isClick = eTime - sTime < 200;
|
|
1776
|
-
if (isClick) {
|
|
1777
|
-
let onArea = () => {
|
|
1778
|
-
this.subMenu = [];
|
|
1779
|
-
area.removeEventListener('click', onArea);
|
|
1780
|
-
};
|
|
1781
|
-
area.addEventListener('click', onArea);
|
|
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);
|
|
1782
1715
|
}
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
};
|
|
1787
|
-
};
|
|
1788
|
-
});
|
|
1716
|
+
},
|
|
1717
|
+
false
|
|
1718
|
+
);
|
|
1789
1719
|
}
|
|
1790
1720
|
},
|
|
1791
1721
|
beforeDestroy() {
|