eoss-ui 0.4.51 → 0.4.52
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/button-group.js +92 -88
- package/lib/button.js +92 -88
- package/lib/checkbox-group.js +93 -89
- package/lib/config/api.js +2 -0
- package/lib/data-table-form.js +93 -89
- package/lib/data-table.js +95 -91
- package/lib/date-picker.js +92 -88
- package/lib/dialog.js +92 -88
- package/lib/eoss-ui.common.js +973 -591
- package/lib/flow-group.js +92 -88
- package/lib/flow-list.js +96 -92
- package/lib/flow.js +495 -370
- package/lib/form.js +93 -89
- package/lib/handle-user.js +93 -89
- package/lib/handler.js +114 -110
- package/lib/index.js +1 -1
- package/lib/input-number.js +92 -88
- package/lib/input.js +92 -88
- package/lib/login.js +121 -99
- package/lib/main.js +412 -173
- package/lib/mainComp.js +108 -104
- package/lib/nav.js +107 -95
- package/lib/notify.js +95 -91
- package/lib/page.js +92 -88
- package/lib/player.js +92 -88
- package/lib/qr-code.js +92 -88
- package/lib/radio-group.js +93 -89
- package/lib/select-ganged.js +92 -88
- package/lib/select.js +93 -89
- package/lib/selector-panel.js +110 -106
- package/lib/selector.js +93 -89
- package/lib/sizer.js +94 -90
- package/lib/steps.js +92 -88
- package/lib/switch.js +92 -88
- package/lib/table-form.js +92 -88
- package/lib/tabs.js +92 -88
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/main.css +1 -1
- package/lib/theme-chalk/menu.css +1 -1
- package/lib/tips.js +93 -89
- package/lib/tree-group.js +92 -88
- package/lib/tree.js +93 -89
- package/lib/upload.js +101 -97
- package/lib/utils/util.js +2 -2
- package/lib/wujie.js +92 -88
- package/lib/wxlogin.js +92 -88
- package/package.json +1 -1
- package/packages/flow/src/main.vue +108 -34
- package/packages/flow/src/startTaskRead.vue +15 -3
- package/packages/handler/src/main.vue +13 -15
- package/packages/login/src/main.vue +34 -3
- package/packages/main/src/main.vue +128 -68
- package/packages/main/src/settings.vue +51 -4
- package/packages/nav/src/main.vue +22 -10
- package/packages/theme-chalk/lib/index.css +1 -1
- package/packages/theme-chalk/lib/main.css +1 -1
- package/packages/theme-chalk/lib/menu.css +1 -1
- package/packages/theme-chalk/src/main.scss +45 -6
- package/packages/theme-chalk/src/menu.scss +0 -1
- package/src/config/api.js +2 -0
- package/src/index.js +1 -1
- package/src/utils/util.js +2 -2
|
@@ -326,6 +326,8 @@ import {
|
|
|
326
326
|
doQrLogin,
|
|
327
327
|
getLoginCode,
|
|
328
328
|
doCodeLogin,
|
|
329
|
+
getTwoFactorLoginCode,
|
|
330
|
+
doTwoFactorLogin,
|
|
329
331
|
doWechatQrLogin,
|
|
330
332
|
doCaLogin
|
|
331
333
|
} from 'eoss-ui/src/config/api.js';
|
|
@@ -447,6 +449,14 @@ export default {
|
|
|
447
449
|
type: String,
|
|
448
450
|
default: doCodeLogin
|
|
449
451
|
},
|
|
452
|
+
getTwoFactorLoginCode: {
|
|
453
|
+
type: String,
|
|
454
|
+
default: getTwoFactorLoginCode
|
|
455
|
+
},
|
|
456
|
+
doTwoFactorLogin: {
|
|
457
|
+
type: String,
|
|
458
|
+
default: doTwoFactorLogin
|
|
459
|
+
},
|
|
450
460
|
doWechatQrLogin: {
|
|
451
461
|
type: String,
|
|
452
462
|
default: doWechatQrLogin
|
|
@@ -903,6 +913,7 @@ export default {
|
|
|
903
913
|
this.app = res.appName || res.subsystemName;
|
|
904
914
|
this.qrimg = res.qrimg || res.qrImg;
|
|
905
915
|
this.loginModel = res.loginModel;
|
|
916
|
+
// this.loginModel = '0,3,11,6,9,2';
|
|
906
917
|
this.loginBackgroundImg = res.loginBackgroundUrl
|
|
907
918
|
? res.loginBackgroundUrl.split(',')
|
|
908
919
|
: null;
|
|
@@ -979,8 +990,9 @@ export default {
|
|
|
979
990
|
return false;
|
|
980
991
|
}
|
|
981
992
|
data = {
|
|
982
|
-
|
|
993
|
+
username: this.formData.username,
|
|
983
994
|
targetType: this.passModifyModel.indexOf('11') > -1 ? 'EMAIL' : 'SMS'
|
|
995
|
+
// targetType: 'SMS'
|
|
984
996
|
};
|
|
985
997
|
} else {
|
|
986
998
|
if (!this.formData.target) {
|
|
@@ -1012,7 +1024,8 @@ export default {
|
|
|
1012
1024
|
util
|
|
1013
1025
|
.ajax({
|
|
1014
1026
|
method: 'post',
|
|
1015
|
-
url:
|
|
1027
|
+
url:
|
|
1028
|
+
this.active == 2 ? this.getTwoFactorLoginCode : this.getLoginCode,
|
|
1016
1029
|
data: data
|
|
1017
1030
|
})
|
|
1018
1031
|
.then((res) => {
|
|
@@ -1056,6 +1069,19 @@ export default {
|
|
|
1056
1069
|
identifyingCode: this.formData.identifyingCode,
|
|
1057
1070
|
identifyingId: this.identifyingId
|
|
1058
1071
|
}
|
|
1072
|
+
: this.active == '2'
|
|
1073
|
+
? {
|
|
1074
|
+
username: this.formData.username,
|
|
1075
|
+
password:
|
|
1076
|
+
this.secret && this.isEncrypt
|
|
1077
|
+
? util.esmEncrypt({
|
|
1078
|
+
data: this.formData.password,
|
|
1079
|
+
key: this.secret
|
|
1080
|
+
})
|
|
1081
|
+
: this.formData.password,
|
|
1082
|
+
targetType: this.passModifyModel.indexOf('11') > -1 ? 'EMAIL' : 'SMS',
|
|
1083
|
+
verificationCode:this.formData.identifyingCode
|
|
1084
|
+
}
|
|
1059
1085
|
: {
|
|
1060
1086
|
target: this.formData.target,
|
|
1061
1087
|
verificationCode: this.formData.verificationCode,
|
|
@@ -1091,7 +1117,12 @@ export default {
|
|
|
1091
1117
|
util
|
|
1092
1118
|
.ajax({
|
|
1093
1119
|
method: 'post',
|
|
1094
|
-
url:
|
|
1120
|
+
url:
|
|
1121
|
+
this.active == '0'
|
|
1122
|
+
? this.actionUrl
|
|
1123
|
+
: this.active == '2'
|
|
1124
|
+
? this.doTwoFactorLogin
|
|
1125
|
+
: this.doCodeLogin,
|
|
1095
1126
|
data: extUserBindHandleId
|
|
1096
1127
|
? { ...data, extUserBindHandleId: extUserBindHandleId }
|
|
1097
1128
|
: data
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="es-main" :class="{ 'es-main-topside':
|
|
2
|
+
<div class="es-main" :class="{ 'es-main-topside': layout === 'topside' }">
|
|
3
3
|
<div
|
|
4
4
|
v-if="showHeader"
|
|
5
5
|
class="es-main-header"
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<img
|
|
16
16
|
class="es-main-logo"
|
|
17
17
|
:src="logoUrl"
|
|
18
|
-
v-if="
|
|
18
|
+
v-if="layout !== 'topside' && logoUrl && showDefault"
|
|
19
19
|
/>
|
|
20
20
|
<div class="es-main-top-nav">
|
|
21
21
|
<es-menu
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
class="es-fourth-tabs"
|
|
24
24
|
mode="horizontal"
|
|
25
25
|
:icons="icons"
|
|
26
|
-
:popperClass="`el-menu--popup-${
|
|
26
|
+
:popperClass="`el-menu--popup-${layout}`"
|
|
27
27
|
:data="navs"
|
|
28
|
-
:deep="
|
|
28
|
+
:deep="layout === 'topnav'"
|
|
29
29
|
:default-active="topActive"
|
|
30
30
|
@select="
|
|
31
31
|
(res) => {
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
></es-handler>
|
|
74
74
|
</div>
|
|
75
75
|
<div class="es-main-box" v-if="reset">
|
|
76
|
-
<div class="es-main-left" v-if="
|
|
77
|
-
<div class="es-main-side" v-if="
|
|
76
|
+
<div class="es-main-left" v-if="layout !== 'topnav' && showSide">
|
|
77
|
+
<div class="es-main-side" v-if="layout === 'topside'">
|
|
78
78
|
<div class="es-main-side-logo">
|
|
79
79
|
<img class="es-main-logo" :src="logoUrl" v-if="logoUrl" />
|
|
80
80
|
</div>
|
|
@@ -110,6 +110,7 @@
|
|
|
110
110
|
/>
|
|
111
111
|
<es-nav
|
|
112
112
|
v-if="showMenu && showDefault"
|
|
113
|
+
:is-top="layout == 'topside'"
|
|
113
114
|
:data="menu"
|
|
114
115
|
:default-active="active"
|
|
115
116
|
:width="navWidth"
|
|
@@ -121,7 +122,7 @@
|
|
|
121
122
|
:is-default="isDefault"
|
|
122
123
|
@open="
|
|
123
124
|
(res) => {
|
|
124
|
-
handleSelect(res, 'menu');
|
|
125
|
+
handleSelect(res, 'menu', true);
|
|
125
126
|
}
|
|
126
127
|
"
|
|
127
128
|
@trigger="
|
|
@@ -220,7 +221,9 @@
|
|
|
220
221
|
:theme="color"
|
|
221
222
|
:predefine="themes"
|
|
222
223
|
:visible.sync="showSet"
|
|
224
|
+
:layout.sync="layout"
|
|
223
225
|
@change="handleChange"
|
|
226
|
+
@layout="handleLayout"
|
|
224
227
|
></settings>
|
|
225
228
|
<es-dialog
|
|
226
229
|
v-if="showUserInfo"
|
|
@@ -389,10 +392,6 @@ export default {
|
|
|
389
392
|
}
|
|
390
393
|
},
|
|
391
394
|
computed: {
|
|
392
|
-
//菜单类型
|
|
393
|
-
modal() {
|
|
394
|
-
return this.scene.toLowerCase();
|
|
395
|
-
},
|
|
396
395
|
showHeader() {
|
|
397
396
|
return this.isHeader == 0 ? false : this.header;
|
|
398
397
|
},
|
|
@@ -416,10 +415,11 @@ export default {
|
|
|
416
415
|
return true;
|
|
417
416
|
},
|
|
418
417
|
navWidth() {
|
|
419
|
-
|
|
418
|
+
console.log(this.layout === 'topside' ? '230px' : undefined, 9000);
|
|
419
|
+
return this.layout === 'topside' ? '230px' : undefined;
|
|
420
420
|
},
|
|
421
421
|
showNavTitle() {
|
|
422
|
-
return this.
|
|
422
|
+
return this.layout !== 'topside';
|
|
423
423
|
},
|
|
424
424
|
//tabs菜单
|
|
425
425
|
fourthTabs() {
|
|
@@ -438,8 +438,8 @@ export default {
|
|
|
438
438
|
//是否双列右侧菜单
|
|
439
439
|
biserial() {
|
|
440
440
|
if (
|
|
441
|
-
this.
|
|
442
|
-
this.
|
|
441
|
+
this.layout === 'subsystem' ||
|
|
442
|
+
this.layout === 'topside' ||
|
|
443
443
|
this.application
|
|
444
444
|
) {
|
|
445
445
|
return false;
|
|
@@ -449,13 +449,13 @@ export default {
|
|
|
449
449
|
},
|
|
450
450
|
//隐藏操作按键
|
|
451
451
|
hide() {
|
|
452
|
-
if (this.
|
|
452
|
+
if (this.layout === 'subsystem' || this.application) {
|
|
453
453
|
if (this.hides && Object.keys(this.hides).length) {
|
|
454
454
|
return { ...this.hides, set: !this.set, system: false };
|
|
455
455
|
} else {
|
|
456
456
|
return { set: !this.set, system: false };
|
|
457
457
|
}
|
|
458
|
-
} else if (this.
|
|
458
|
+
} else if (this.layout === 'topside') {
|
|
459
459
|
if (this.hides && Object.keys(this.hides).length) {
|
|
460
460
|
return {
|
|
461
461
|
...this.hides,
|
|
@@ -517,6 +517,7 @@ export default {
|
|
|
517
517
|
},
|
|
518
518
|
data() {
|
|
519
519
|
return {
|
|
520
|
+
layout: this.scene.toLowerCase(),
|
|
520
521
|
showDefault: false,
|
|
521
522
|
themeJSON: {
|
|
522
523
|
logo: { comp: '', data: {} },
|
|
@@ -600,7 +601,8 @@ export default {
|
|
|
600
601
|
defaultwjprops: {},
|
|
601
602
|
isTabs: false,
|
|
602
603
|
isHeader: '',
|
|
603
|
-
isSide: null
|
|
604
|
+
isSide: null,
|
|
605
|
+
navIds: null
|
|
604
606
|
};
|
|
605
607
|
},
|
|
606
608
|
created() {
|
|
@@ -894,11 +896,22 @@ export default {
|
|
|
894
896
|
}
|
|
895
897
|
});
|
|
896
898
|
},
|
|
897
|
-
jumpMenu(res) {
|
|
899
|
+
jumpMenu(res, flag) {
|
|
900
|
+
let ids;
|
|
898
901
|
if (typeof res === 'string') {
|
|
899
|
-
|
|
902
|
+
if (flag) {
|
|
903
|
+
ids = this.getId(this.menus, res, true);
|
|
904
|
+
if (!ids) {
|
|
905
|
+
this.$message.error('未在菜单栏中找到此地址');
|
|
906
|
+
return;
|
|
907
|
+
}
|
|
908
|
+
} else {
|
|
909
|
+
ids = res.split(',');
|
|
910
|
+
}
|
|
911
|
+
} else {
|
|
912
|
+
ids = res;
|
|
900
913
|
}
|
|
901
|
-
this.setDefault(this.menus,
|
|
914
|
+
this.setDefault(this.menus, ids);
|
|
902
915
|
},
|
|
903
916
|
getId(arry, res, path) {
|
|
904
917
|
if (!res) {
|
|
@@ -1012,6 +1025,7 @@ export default {
|
|
|
1012
1025
|
},
|
|
1013
1026
|
//设置默认左侧导航
|
|
1014
1027
|
setMenu(res) {
|
|
1028
|
+
console.log(9000);
|
|
1015
1029
|
if (this.defaultActive && this.defaultActive.length) {
|
|
1016
1030
|
this.isDefault = false;
|
|
1017
1031
|
this.setDefault(res, this.defaultActive);
|
|
@@ -1035,14 +1049,16 @@ export default {
|
|
|
1035
1049
|
} else {
|
|
1036
1050
|
this.isDefault = false;
|
|
1037
1051
|
}
|
|
1038
|
-
if (this.
|
|
1039
|
-
if (this.
|
|
1052
|
+
if (this.layout === 'subsystem' || this.layout === 'topside') {
|
|
1053
|
+
if (this.layout === 'subsystem') {
|
|
1054
|
+
this.navs = [];
|
|
1040
1055
|
if (this.menuType === 'custom') {
|
|
1041
1056
|
this.subsystem = this.customMenu;
|
|
1042
1057
|
} else {
|
|
1043
1058
|
this.subsystem = res;
|
|
1044
1059
|
}
|
|
1045
|
-
} else if (this.
|
|
1060
|
+
} else if (this.layout === 'topside') {
|
|
1061
|
+
this.subsystem = [];
|
|
1046
1062
|
if (this.menuType === 'custom') {
|
|
1047
1063
|
this.navs = this.customMenu;
|
|
1048
1064
|
this.topActive = res[0].id;
|
|
@@ -1064,21 +1080,23 @@ export default {
|
|
|
1064
1080
|
this.title = res[0].text;
|
|
1065
1081
|
}
|
|
1066
1082
|
if (!this.isDefault) {
|
|
1067
|
-
this.active = this.getFirst(this.menu[0]);
|
|
1083
|
+
this.active = this.getFirst(this.menu[0]).id;
|
|
1068
1084
|
}
|
|
1069
|
-
} else if (this.
|
|
1085
|
+
} else if (this.layout === 'topnav') {
|
|
1070
1086
|
if (this.menuType === 'custom') {
|
|
1071
1087
|
this.navs = this.customMenu;
|
|
1072
|
-
this.topActive = this.getFirst(res[0]);
|
|
1088
|
+
this.topActive = this.getFirst(res[0]).id;
|
|
1073
1089
|
} else {
|
|
1074
1090
|
this.navs = res;
|
|
1075
|
-
this.topActive = this.getFirst(res[0]);
|
|
1091
|
+
this.topActive = this.getFirst(res[0]).id;
|
|
1076
1092
|
}
|
|
1077
1093
|
} else {
|
|
1094
|
+
this.nav = [];
|
|
1095
|
+
this.subsystem = [];
|
|
1078
1096
|
this.menu = res;
|
|
1079
1097
|
if (!this.isDefault) {
|
|
1080
1098
|
this.active = [this.menu[0].id];
|
|
1081
|
-
let id = this.getFirst(this.menu[0]);
|
|
1099
|
+
let id = this.getFirst(this.menu[0]).id;
|
|
1082
1100
|
if (id && this.menu[0].id !== id) {
|
|
1083
1101
|
this.active.push(id);
|
|
1084
1102
|
} else {
|
|
@@ -1100,7 +1118,7 @@ export default {
|
|
|
1100
1118
|
if (obj.children && obj.children.length) {
|
|
1101
1119
|
return this.getFirst(obj.children[0]);
|
|
1102
1120
|
} else if (obj.fourthTabs && obj.fourthTabs.length) {
|
|
1103
|
-
if (this.
|
|
1121
|
+
if (this.layout === 'topnav') {
|
|
1104
1122
|
return this.getFirst(obj.fourthTabs[0]);
|
|
1105
1123
|
} else {
|
|
1106
1124
|
this.tabs = obj.fourthTabs;
|
|
@@ -1120,12 +1138,11 @@ export default {
|
|
|
1120
1138
|
this.tabs[0]
|
|
1121
1139
|
);
|
|
1122
1140
|
}
|
|
1123
|
-
return obj.id;
|
|
1124
1141
|
}
|
|
1125
1142
|
} else {
|
|
1126
1143
|
this.handleJump(obj.url, obj.urlopenmode, obj);
|
|
1127
1144
|
}
|
|
1128
|
-
return obj
|
|
1145
|
+
return obj;
|
|
1129
1146
|
},
|
|
1130
1147
|
//遍历设置菜单气泡提醒
|
|
1131
1148
|
setTips(obj) {
|
|
@@ -1175,14 +1192,15 @@ export default {
|
|
|
1175
1192
|
this.active = '';
|
|
1176
1193
|
this.getUrl(res, active);
|
|
1177
1194
|
if (
|
|
1178
|
-
this.
|
|
1179
|
-
this.
|
|
1180
|
-
this.
|
|
1181
|
-
this.
|
|
1182
|
-
this.
|
|
1183
|
-
this.
|
|
1195
|
+
this.layout === 'subsystem' ||
|
|
1196
|
+
this.layout === 'subSystem' ||
|
|
1197
|
+
this.layout === 'topnav' ||
|
|
1198
|
+
this.layout === 'topNav' ||
|
|
1199
|
+
this.layout === 'topside' ||
|
|
1200
|
+
this.layout === 'topSide'
|
|
1184
1201
|
) {
|
|
1185
|
-
if (this.
|
|
1202
|
+
if (this.layout === 'subsystem' || this.layout === 'subSystem') {
|
|
1203
|
+
this.navs = [];
|
|
1186
1204
|
if (this.menuType === 'custom') {
|
|
1187
1205
|
this.subsystem = this.customMenu;
|
|
1188
1206
|
this.sysId = active[0];
|
|
@@ -1191,11 +1209,12 @@ export default {
|
|
|
1191
1209
|
this.sysId = active[0];
|
|
1192
1210
|
}
|
|
1193
1211
|
} else if (
|
|
1194
|
-
this.
|
|
1195
|
-
this.
|
|
1196
|
-
this.
|
|
1197
|
-
this.
|
|
1212
|
+
this.layout === 'topnav' ||
|
|
1213
|
+
this.layout === 'topNav' ||
|
|
1214
|
+
this.layout === 'topside' ||
|
|
1215
|
+
this.layout === 'topSide'
|
|
1198
1216
|
) {
|
|
1217
|
+
this.subsystem = [];
|
|
1199
1218
|
if (this.menuType === 'custom') {
|
|
1200
1219
|
this.navs = this.customMenu;
|
|
1201
1220
|
this.topActive = active[0];
|
|
@@ -1218,6 +1237,8 @@ export default {
|
|
|
1218
1237
|
}
|
|
1219
1238
|
}
|
|
1220
1239
|
} else {
|
|
1240
|
+
this.navs = [];
|
|
1241
|
+
this.subsystem = [];
|
|
1221
1242
|
this.menu = res;
|
|
1222
1243
|
if (this.biserial) {
|
|
1223
1244
|
this.active = active.slice(
|
|
@@ -1275,30 +1296,42 @@ export default {
|
|
|
1275
1296
|
let _url = params._baseUrl ? params._baseUrl : './primary.html';
|
|
1276
1297
|
return util.urlJoinParams({ url: _url, param: obj });
|
|
1277
1298
|
},
|
|
1299
|
+
handleOpenNav(res) {
|
|
1300
|
+
console.log(res, 777);
|
|
1301
|
+
},
|
|
1278
1302
|
//应用导航交互
|
|
1279
|
-
handleSelect(res, type) {
|
|
1303
|
+
handleSelect(res, type, open) {
|
|
1304
|
+
console.log(type);
|
|
1280
1305
|
const { node } = res;
|
|
1281
|
-
if (
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1306
|
+
if (!open) {
|
|
1307
|
+
if (
|
|
1308
|
+
node.extendData &&
|
|
1309
|
+
node.extendData.businessStatus == 0 &&
|
|
1310
|
+
node.extendData.businessWarnMsg
|
|
1311
|
+
) {
|
|
1312
|
+
this.$alert(node.extendData.businessWarnMsg, '提示', {
|
|
1313
|
+
type: 'warning'
|
|
1314
|
+
});
|
|
1315
|
+
return;
|
|
1316
|
+
}
|
|
1317
|
+
this.isDefault = false;
|
|
1318
|
+
this.tabsId = '';
|
|
1290
1319
|
}
|
|
1291
|
-
this.isDefault = false;
|
|
1292
|
-
this.tabsId = '';
|
|
1293
1320
|
switch (type) {
|
|
1294
1321
|
case 'nav':
|
|
1295
1322
|
this.tabs = [];
|
|
1296
1323
|
this.active = '';
|
|
1297
|
-
if (this.
|
|
1324
|
+
if (this.layout === 'topside') {
|
|
1325
|
+
this.navIds = [node.id];
|
|
1298
1326
|
this.menu = node.children;
|
|
1299
1327
|
this.title = node.text;
|
|
1300
|
-
|
|
1328
|
+
let subNode = this.getFirst(node.children[0]);
|
|
1329
|
+
if (subNode) {
|
|
1330
|
+
this.active = subNode.id;
|
|
1331
|
+
this.navIds = [node.id, ...this.getId(subNode.url)];
|
|
1332
|
+
}
|
|
1301
1333
|
} else {
|
|
1334
|
+
this.navIds = this.getId(this.menus, node.url, true);
|
|
1302
1335
|
if (node.url) {
|
|
1303
1336
|
let tab = node.fourthTabs.filter((item) => {
|
|
1304
1337
|
return item.url === node.url;
|
|
@@ -1321,31 +1354,37 @@ export default {
|
|
|
1321
1354
|
}
|
|
1322
1355
|
break;
|
|
1323
1356
|
case 'sys':
|
|
1357
|
+
this.navIds = [node.id];
|
|
1324
1358
|
this.tabs = [];
|
|
1325
1359
|
this.menu = node.children;
|
|
1326
1360
|
this.title = node.text;
|
|
1327
|
-
this.active = this.getFirst(node.children[0]);
|
|
1361
|
+
this.active = this.getFirst(node.children[0]).id;
|
|
1328
1362
|
this.isSide = true;
|
|
1329
1363
|
break;
|
|
1330
1364
|
case 'sub':
|
|
1365
|
+
this.navIds = [node.id];
|
|
1331
1366
|
if (node.url) {
|
|
1332
1367
|
this.tabs = [];
|
|
1333
1368
|
}
|
|
1334
1369
|
if (this.setFirstAsDefault) {
|
|
1335
|
-
let
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1370
|
+
let subNode = this.getFirst(node);
|
|
1371
|
+
this.$set(this.active, 0, node.id);
|
|
1372
|
+
if (subNode && node.id !== subNode.id) {
|
|
1373
|
+
console.log(subNode, subNode.url);
|
|
1374
|
+
console.log(this.getId(this.menus, subNode.url, true));
|
|
1375
|
+
this.$set(this.active, 1, subNode.id);
|
|
1339
1376
|
}
|
|
1340
1377
|
}
|
|
1341
1378
|
break;
|
|
1342
1379
|
case 'menu':
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
if (this.
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1380
|
+
if (!open) {
|
|
1381
|
+
this.tabs = [];
|
|
1382
|
+
if (this.setFirstAsDefault) {
|
|
1383
|
+
if (this.biserial) {
|
|
1384
|
+
this.$set(this.active, 1, node.id);
|
|
1385
|
+
} else {
|
|
1386
|
+
this.active = node.id;
|
|
1387
|
+
}
|
|
1349
1388
|
}
|
|
1350
1389
|
}
|
|
1351
1390
|
if (node.url) {
|
|
@@ -1575,6 +1614,27 @@ export default {
|
|
|
1575
1614
|
break;
|
|
1576
1615
|
}
|
|
1577
1616
|
},
|
|
1617
|
+
handleLayout(res, old) {
|
|
1618
|
+
switch (res) {
|
|
1619
|
+
case 'topnav':
|
|
1620
|
+
this.navs = this.menus;
|
|
1621
|
+
this.tabs = [];
|
|
1622
|
+
this.subsystem = [];
|
|
1623
|
+
switch (old) {
|
|
1624
|
+
case 'subsystem':
|
|
1625
|
+
break;
|
|
1626
|
+
default:
|
|
1627
|
+
this.topActive = this.active.length
|
|
1628
|
+
? this.active[this.active.length - 1]
|
|
1629
|
+
: '';
|
|
1630
|
+
console.log(this.active, this.topActive, 666);
|
|
1631
|
+
}
|
|
1632
|
+
break;
|
|
1633
|
+
}
|
|
1634
|
+
console.log(this.sysId, this.topActive, this.active, this.tabsId);
|
|
1635
|
+
//this.setMenu(this.menus);
|
|
1636
|
+
console.log(this.layout, old, this.hide);
|
|
1637
|
+
},
|
|
1578
1638
|
//监听改变菜单
|
|
1579
1639
|
handleListener() {
|
|
1580
1640
|
util.win.addEventListener(
|
|
@@ -42,16 +42,51 @@
|
|
|
42
42
|
content="顶部菜单布局"
|
|
43
43
|
placement="bottom"
|
|
44
44
|
>
|
|
45
|
-
<div
|
|
45
|
+
<div
|
|
46
|
+
class="es-setting-navs es-setting-top-nav"
|
|
47
|
+
@click.stop="handleLayout('topnav')"
|
|
48
|
+
>
|
|
49
|
+
<i class="es-icon-gou" v-show="activeName == 'topnav'"></i>
|
|
50
|
+
</div>
|
|
46
51
|
</el-tooltip>
|
|
47
52
|
<el-tooltip
|
|
48
53
|
class="es-setting-navs-item"
|
|
49
54
|
effect="dark"
|
|
50
|
-
content="
|
|
55
|
+
content="侧边双列菜单布局"
|
|
51
56
|
placement="bottom"
|
|
52
57
|
>
|
|
53
|
-
<div
|
|
58
|
+
<div
|
|
59
|
+
class="es-setting-navs es-setting-side-nav"
|
|
60
|
+
@click.stop="handleLayout('default')"
|
|
61
|
+
>
|
|
54
62
|
<div class="es-setting-side-sub-nav"></div>
|
|
63
|
+
<i class="es-icon-gou" v-show="activeName == 'default'"></i>
|
|
64
|
+
</div>
|
|
65
|
+
</el-tooltip>
|
|
66
|
+
<el-tooltip
|
|
67
|
+
class="es-setting-navs-item"
|
|
68
|
+
effect="dark"
|
|
69
|
+
content="子系统+侧边菜单布局"
|
|
70
|
+
placement="bottom"
|
|
71
|
+
>
|
|
72
|
+
<div
|
|
73
|
+
class="es-setting-navs es-setting-subsystem-nav"
|
|
74
|
+
@click.stop="handleLayout('subsystem')"
|
|
75
|
+
>
|
|
76
|
+
<i class="es-icon-gou" v-show="activeName == 'subsystem'"></i>
|
|
77
|
+
</div>
|
|
78
|
+
</el-tooltip>
|
|
79
|
+
<el-tooltip
|
|
80
|
+
class="es-setting-navs-item"
|
|
81
|
+
effect="dark"
|
|
82
|
+
content="顶部+侧边菜单布局"
|
|
83
|
+
placement="bottom"
|
|
84
|
+
>
|
|
85
|
+
<div
|
|
86
|
+
class="es-setting-navs es-setting-top-side-nav"
|
|
87
|
+
@click.stop="handleLayout('topside')"
|
|
88
|
+
>
|
|
89
|
+
<i class="es-icon-gou" v-show="activeName == 'topside'"></i>
|
|
55
90
|
</div>
|
|
56
91
|
</el-tooltip>
|
|
57
92
|
</div>
|
|
@@ -74,6 +109,10 @@ export default {
|
|
|
74
109
|
default() {
|
|
75
110
|
return ['#a60006', '#409eff'];
|
|
76
111
|
}
|
|
112
|
+
},
|
|
113
|
+
layout: {
|
|
114
|
+
type: String,
|
|
115
|
+
default: 'default'
|
|
77
116
|
}
|
|
78
117
|
},
|
|
79
118
|
computed: {
|
|
@@ -110,7 +149,8 @@ export default {
|
|
|
110
149
|
},
|
|
111
150
|
data() {
|
|
112
151
|
return {
|
|
113
|
-
color: ''
|
|
152
|
+
color: '',
|
|
153
|
+
activeName: this.layout
|
|
114
154
|
};
|
|
115
155
|
},
|
|
116
156
|
mounted() {},
|
|
@@ -124,6 +164,13 @@ export default {
|
|
|
124
164
|
this.color = res;
|
|
125
165
|
this.$emit('change', { type: 'theme', value: res });
|
|
126
166
|
//this.setTheme(res);
|
|
167
|
+
},
|
|
168
|
+
//选择菜单布局
|
|
169
|
+
handleLayout(res) {
|
|
170
|
+
let old = this.activeName;
|
|
171
|
+
this.activeName = res;
|
|
172
|
+
this.$emit('update:layout', res);
|
|
173
|
+
this.$emit('layout', res, old);
|
|
127
174
|
}
|
|
128
175
|
}
|
|
129
176
|
};
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
</div>
|
|
20
20
|
<div
|
|
21
21
|
class="es-nav-main"
|
|
22
|
-
:style="{ width: biserial ? width :
|
|
22
|
+
:style="{ width: biserial ? width : boxWidth }"
|
|
23
23
|
v-show="biserial ? subMenu.length : menu.length"
|
|
24
24
|
>
|
|
25
25
|
<div class="es-nav-title" v-if="showTitle">
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
:data="biserial ? subMenu : menu"
|
|
44
44
|
:collapse="isCollapse"
|
|
45
45
|
:default-active="menuActive"
|
|
46
|
-
:width="menuWidth"
|
|
46
|
+
:width="isTop ? boxWidth : menuWidth"
|
|
47
47
|
:style="{ height: menuHeight }"
|
|
48
48
|
:is-default="isDefault"
|
|
49
49
|
:biserial="biserial"
|
|
@@ -60,6 +60,7 @@ export default {
|
|
|
60
60
|
name: 'EsNav',
|
|
61
61
|
inheritAttrs: false,
|
|
62
62
|
props: {
|
|
63
|
+
isTop: Boolean,
|
|
63
64
|
data: {
|
|
64
65
|
type: Array,
|
|
65
66
|
default: []
|
|
@@ -96,17 +97,23 @@ export default {
|
|
|
96
97
|
return true;
|
|
97
98
|
},
|
|
98
99
|
subActive() {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
let active =
|
|
101
|
+
this.biserial &&
|
|
102
|
+
Array.isArray(this.defaultActive) &&
|
|
103
|
+
this.defaultActive.length
|
|
104
|
+
? this.defaultActive[0]
|
|
105
|
+
: undefined;
|
|
106
|
+
console.log(active, 555);
|
|
107
|
+
return active;
|
|
102
108
|
},
|
|
103
109
|
menuActive() {
|
|
104
|
-
let active =
|
|
105
|
-
|
|
106
|
-
typeof this.defaultActive === 'string'
|
|
110
|
+
let active =
|
|
111
|
+
this.defaultActive === 'string'
|
|
107
112
|
? this.defaultActive
|
|
108
|
-
: this.defaultActive
|
|
109
|
-
|
|
113
|
+
: this.defaultActive.length
|
|
114
|
+
? this.defaultActive[this.defaultActive.length - 1]
|
|
115
|
+
: undefined;
|
|
116
|
+
console.log(active, 444);
|
|
110
117
|
return active;
|
|
111
118
|
},
|
|
112
119
|
boxWidth() {
|
|
@@ -132,6 +139,11 @@ export default {
|
|
|
132
139
|
this.headline = val;
|
|
133
140
|
}
|
|
134
141
|
},
|
|
142
|
+
biserial: {
|
|
143
|
+
handler(val) {
|
|
144
|
+
this.isShow = !val;
|
|
145
|
+
}
|
|
146
|
+
},
|
|
135
147
|
defaultActive: {
|
|
136
148
|
immediate: true,
|
|
137
149
|
deep: true,
|