@lambo-design/pro-layout 1.0.0-beta.10 → 1.0.0-beta.100
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/package.json +6 -7
- package/src/components/pro-layout-header.vue +13 -3
- package/src/components/pro-layout-logo.vue +35 -12
- package/src/components/pro-layout-nav.vue +15 -0
- package/src/components/pro-layout-other-menu.vue +137 -0
- package/src/components/pro-layout-sider.vue +15 -3
- package/src/components/pro-layout-tabs.vue +23 -3
- package/src/components/pro-layout-tools-user.vue +1 -1
- package/src/components/pro-layout-trigger.vue +1 -1
- package/src/index.vue +98 -21
- package/src/styles/images/inspur.png +0 -0
- package/src/styles/other-menu.less +159 -0
- /package/src/styles/images/{logo.png → tobacco.png} +0 -0
package/package.json
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lambo-design/pro-layout",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.100",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
|
|
8
|
-
},
|
|
6
|
+
"scripts": {},
|
|
9
7
|
"author": "lambo",
|
|
10
8
|
"license": "ISC",
|
|
11
9
|
"publishConfig": {
|
|
12
|
-
"access": "public"
|
|
10
|
+
"access": "public",
|
|
11
|
+
"registry": "https://registry.npmjs.org/"
|
|
13
12
|
},
|
|
14
13
|
"devDependencies": {
|
|
15
|
-
"@lambo-design/core": "workspace
|
|
16
|
-
"@lambo-design/shared": "workspace
|
|
14
|
+
"@lambo-design/core": "workspace:^",
|
|
15
|
+
"@lambo-design/shared": "workspace:^"
|
|
17
16
|
}
|
|
18
17
|
}
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
<LamboProTrigger></LamboProTrigger>
|
|
5
5
|
</div>
|
|
6
6
|
<div class="logo-box">
|
|
7
|
-
<LamboProLogo></LamboProLogo>
|
|
7
|
+
<LamboProLogo @clickLogo="handleClick"></LamboProLogo>
|
|
8
8
|
</div>
|
|
9
9
|
<div class="nav-box">
|
|
10
|
-
<LamboProNav></LamboProNav>
|
|
10
|
+
<LamboProNav :accept-app-id="acceptAppId"></LamboProNav>
|
|
11
11
|
</div>
|
|
12
12
|
<div class="tools-box">
|
|
13
13
|
<LamboProTools></LamboProTools>
|
|
@@ -22,11 +22,22 @@ import LamboProNav from './pro-layout-nav'
|
|
|
22
22
|
import LamboProTools from './pro-layout-tools'
|
|
23
23
|
export default {
|
|
24
24
|
name: "pro-layout-header",
|
|
25
|
+
props:{
|
|
26
|
+
acceptAppId: {
|
|
27
|
+
type: String,
|
|
28
|
+
default:''
|
|
29
|
+
}
|
|
30
|
+
},
|
|
25
31
|
components: {
|
|
26
32
|
LamboProTrigger,
|
|
27
33
|
LamboProLogo,
|
|
28
34
|
LamboProNav,
|
|
29
35
|
LamboProTools
|
|
36
|
+
},
|
|
37
|
+
methods:{
|
|
38
|
+
handleClick(){
|
|
39
|
+
this.$emit('clickLogo')
|
|
40
|
+
}
|
|
30
41
|
}
|
|
31
42
|
}
|
|
32
43
|
</script>
|
|
@@ -38,7 +49,6 @@ export default {
|
|
|
38
49
|
.trigger-box{
|
|
39
50
|
float: left;
|
|
40
51
|
height: inherit;
|
|
41
|
-
border: 1px solid #000000;
|
|
42
52
|
}
|
|
43
53
|
.logo-box{
|
|
44
54
|
float: left;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="pro-layout-logo-wrapper">
|
|
3
|
-
<div class="logo"
|
|
3
|
+
<div class="logo" :style="logoStyle"
|
|
4
|
+
@click="handleClick"
|
|
5
|
+
></div>
|
|
4
6
|
<div class="divider"></div>
|
|
5
7
|
<div class="system-name">{{systemName}}</div>
|
|
6
8
|
</div>
|
|
@@ -10,22 +12,44 @@
|
|
|
10
12
|
import Bus from '@lambo-design/shared/utils/bus'
|
|
11
13
|
export default {
|
|
12
14
|
name: "pro-layout-logo",
|
|
15
|
+
props:{
|
|
16
|
+
routeName:String,
|
|
17
|
+
default:''
|
|
18
|
+
},
|
|
13
19
|
data(){
|
|
14
20
|
return {
|
|
15
|
-
|
|
21
|
+
systemInfo: {},
|
|
22
|
+
systemName: '后台管理系统',
|
|
23
|
+
isHovered: false,
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
computed:{
|
|
27
|
+
logoStyle(){
|
|
28
|
+
if (this.systemInfo && this.systemInfo.systemLogo) {
|
|
29
|
+
return 'background: url("' + this.systemInfo.systemLogo + '") no-repeat;background-size: 100%;'
|
|
30
|
+
}
|
|
31
|
+
return '';
|
|
16
32
|
}
|
|
17
33
|
},
|
|
18
34
|
methods: {
|
|
35
|
+
handleClick(){
|
|
36
|
+
this.$emit('clickLogo')
|
|
37
|
+
},
|
|
19
38
|
initListener(){
|
|
20
|
-
Bus.$on('system-
|
|
21
|
-
this.
|
|
39
|
+
Bus.$on('system-info',(data)=>{
|
|
40
|
+
this.initSystem(data)
|
|
22
41
|
});
|
|
23
42
|
},
|
|
24
43
|
destroyListener(){
|
|
25
|
-
Bus.$off('system-
|
|
44
|
+
Bus.$off('system-info')
|
|
26
45
|
},
|
|
27
|
-
|
|
28
|
-
|
|
46
|
+
initSystem(data){
|
|
47
|
+
if (data) {
|
|
48
|
+
this.systemInfo = data;
|
|
49
|
+
if (data.systemName) {
|
|
50
|
+
this.systemName = data.systemName;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
29
53
|
}
|
|
30
54
|
},
|
|
31
55
|
created(){
|
|
@@ -40,15 +64,14 @@ export default {
|
|
|
40
64
|
<style scoped lang="less">
|
|
41
65
|
.pro-layout-logo-wrapper{
|
|
42
66
|
overflow: hidden;
|
|
43
|
-
border-bottom: 1px solid #000000;
|
|
44
67
|
.logo{
|
|
68
|
+
cursor:pointer;
|
|
45
69
|
width: 150px;
|
|
46
70
|
height: 55px;
|
|
47
|
-
background: url("../styles/images/
|
|
71
|
+
background: url("../styles/images/inspur.png") no-repeat;
|
|
48
72
|
background-size: 100%;
|
|
49
73
|
float: left;
|
|
50
|
-
margin-top:
|
|
51
|
-
border-bottom: 1px solid #000000;
|
|
74
|
+
margin-top: 20px;
|
|
52
75
|
}
|
|
53
76
|
.divider{
|
|
54
77
|
height: 33px;
|
|
@@ -64,4 +87,4 @@ export default {
|
|
|
64
87
|
margin-right: 15px;
|
|
65
88
|
}
|
|
66
89
|
}
|
|
67
|
-
</style>
|
|
90
|
+
</style>
|
|
@@ -24,6 +24,12 @@ import config from "@lambo-design/shared/config/config";
|
|
|
24
24
|
|
|
25
25
|
export default {
|
|
26
26
|
name: "pro-layout-logo",
|
|
27
|
+
props:{
|
|
28
|
+
acceptAppId: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: ''
|
|
31
|
+
}
|
|
32
|
+
},
|
|
27
33
|
data(){
|
|
28
34
|
return {
|
|
29
35
|
navList : [],
|
|
@@ -65,6 +71,11 @@ export default {
|
|
|
65
71
|
}
|
|
66
72
|
if (this.topMenList.length > 0){
|
|
67
73
|
let appId = this.topMenList[0].appId;
|
|
74
|
+
for (let i = 0; i < this.topMenList.length; i++) {
|
|
75
|
+
if (this.topMenList[i].selected == true){
|
|
76
|
+
appId = this.topMenList[i].appId;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
68
79
|
if (this.activeName) {
|
|
69
80
|
appId = this.activeName;
|
|
70
81
|
}
|
|
@@ -91,6 +102,10 @@ export default {
|
|
|
91
102
|
this.$nextTick(()=>{
|
|
92
103
|
this.$refs.topNav.updateActiveName();
|
|
93
104
|
})
|
|
105
|
+
},
|
|
106
|
+
acceptAppId(val) {
|
|
107
|
+
console.log('监听成功')
|
|
108
|
+
this.selectApp(val)
|
|
94
109
|
}
|
|
95
110
|
},
|
|
96
111
|
created(){
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="classes">
|
|
3
|
+
<div class="other-menu-item" @click="onChange('history')">
|
|
4
|
+
<Tooltip :disabled="!collapsed" content="历史" placement="right" transfer>
|
|
5
|
+
<div>
|
|
6
|
+
<Icon class="other-menu-icon" type="md-time"/>
|
|
7
|
+
<span class="other-menu-title"> 历史</span>
|
|
8
|
+
</div>
|
|
9
|
+
</Tooltip>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="other-menu-item" @click="onChange('collect')">
|
|
12
|
+
<Tooltip :disabled="!collapsed" content="收藏" placement="right" transfer>
|
|
13
|
+
<div>
|
|
14
|
+
<Icon class="other-menu-icon" type="md-star-outline"/>
|
|
15
|
+
<span class="other-menu-title"> 收藏</span>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
</Tooltip>
|
|
19
|
+
</div>
|
|
20
|
+
<Drawer v-model="drawer.model"
|
|
21
|
+
:class-name="drawerClasses"
|
|
22
|
+
:closable="false"
|
|
23
|
+
:mask-style="{backgroundColor: 'unset'}"
|
|
24
|
+
:scrollable="true"
|
|
25
|
+
:title="drawer.title"
|
|
26
|
+
placement="left"
|
|
27
|
+
>
|
|
28
|
+
<div v-if="drawer.type=='history'" class="other-menu-history">
|
|
29
|
+
<div v-for="item in list" class="other-menu-history-item">
|
|
30
|
+
<div class="content" @click="handleClick(item)">
|
|
31
|
+
<common-icon :type="item.icon"></common-icon>
|
|
32
|
+
<span> {{ item.label }}</span>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="delete">
|
|
35
|
+
<common-icon type="ios-close" @click.native="handleHistoryDelete(item)"></common-icon>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
<div v-if="drawer.type=='collect'" class="other-menu-collect">
|
|
40
|
+
<div v-for="item in list" class="other-menu-collect-item" @click="handleClick(item)">
|
|
41
|
+
<div class="content">
|
|
42
|
+
<Tooltip :content="item.label" :delay="1000">
|
|
43
|
+
<common-icon :size="40" :type="item.icon"></common-icon>
|
|
44
|
+
</Tooltip>
|
|
45
|
+
</div>
|
|
46
|
+
<div class="delete">
|
|
47
|
+
<common-icon type="ios-close" @click.native.stop="handleCollectDelete(item)"></common-icon>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</Drawer>
|
|
52
|
+
</div>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<script>
|
|
56
|
+
import ajax from '@lambo-design/shared/utils/ajax';
|
|
57
|
+
import config from "@lambo-design/shared/config/config";
|
|
58
|
+
|
|
59
|
+
export default {
|
|
60
|
+
name: "other-menu",
|
|
61
|
+
components: {},
|
|
62
|
+
props: {
|
|
63
|
+
collapsed: {
|
|
64
|
+
type: Boolean
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
data() {
|
|
68
|
+
return {
|
|
69
|
+
drawer: {
|
|
70
|
+
model: false,
|
|
71
|
+
url: '',
|
|
72
|
+
title: '',
|
|
73
|
+
type: '',
|
|
74
|
+
},
|
|
75
|
+
list: []
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
computed: {
|
|
79
|
+
classes() {
|
|
80
|
+
let classes = ["other-menu"]
|
|
81
|
+
return this.collapsed ? ["other-menu-collapsed", ...classes] : [...classes]
|
|
82
|
+
},
|
|
83
|
+
drawerClasses() {
|
|
84
|
+
return this.collapsed ? "other-menu-drawer-wrap-collapsed" : "other-menu-drawer-wrap"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
methods: {
|
|
88
|
+
onChange(value) {
|
|
89
|
+
if (value == 'history') {
|
|
90
|
+
this.drawer.title = '历史菜单'
|
|
91
|
+
this.drawer.url = '/manage/upmsMenuHistory/list'
|
|
92
|
+
|
|
93
|
+
} else {
|
|
94
|
+
this.drawer.title = '收藏菜单'
|
|
95
|
+
this.drawer.url = '/manage/upmsMenuCollect/list'
|
|
96
|
+
}
|
|
97
|
+
this.getList()
|
|
98
|
+
this.drawer.type = value
|
|
99
|
+
this.drawer.model = !this.drawer.model
|
|
100
|
+
},
|
|
101
|
+
getList() {
|
|
102
|
+
this.list = []
|
|
103
|
+
ajax.get(config.upmsServerContext + this.drawer.url).then(resp => {
|
|
104
|
+
if (resp.data.code == 1) {
|
|
105
|
+
this.list = resp.data.data
|
|
106
|
+
if (this.drawer.type == 'collect') {
|
|
107
|
+
this.$store.commit('setCollectMenuList', this.list)
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
})
|
|
111
|
+
},
|
|
112
|
+
handleClick(item) {
|
|
113
|
+
this.$emit('on-select', item.name)
|
|
114
|
+
this.drawer.model = false
|
|
115
|
+
},
|
|
116
|
+
handleHistoryDelete(item) {
|
|
117
|
+
ajax.get(config.upmsServerContext + "/manage/upmsMenuHistory/delete/" + item.historyId).then(resp => {
|
|
118
|
+
if (resp.data.code == 1) {
|
|
119
|
+
this.getList()
|
|
120
|
+
}
|
|
121
|
+
})
|
|
122
|
+
},
|
|
123
|
+
handleCollectDelete(item) {
|
|
124
|
+
ajax.get(config.upmsServerContext + "/manage/upmsMenuCollect/delete/" + item.collectId).then(resp => {
|
|
125
|
+
if (resp.data.code == 1) {
|
|
126
|
+
this.getList()
|
|
127
|
+
}
|
|
128
|
+
})
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
</script>
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
<style lang="less">
|
|
136
|
+
@import '../styles/other-menu.less';
|
|
137
|
+
</style>
|
|
@@ -55,7 +55,7 @@ import ProLayoutSiderMenuItem from './pro-layout-sider-menu-item'
|
|
|
55
55
|
import ProLayoutSiderCollapsedMenu from './pro-layout-sider-collapsed-menu'
|
|
56
56
|
import {
|
|
57
57
|
filterMenuName,
|
|
58
|
-
filterMenuUri,
|
|
58
|
+
filterMenuUri, routeEqual,
|
|
59
59
|
tagExists
|
|
60
60
|
} from "@lambo-design/shared/utils/platform";
|
|
61
61
|
|
|
@@ -153,7 +153,6 @@ export default {
|
|
|
153
153
|
}
|
|
154
154
|
Bus.$emit('tag-list', tagList, menu.name)
|
|
155
155
|
}
|
|
156
|
-
//Bus.$emit('menu-click', name)
|
|
157
156
|
},
|
|
158
157
|
triggerChange(data){
|
|
159
158
|
this.collapsed = data;
|
|
@@ -163,7 +162,20 @@ export default {
|
|
|
163
162
|
this.value = name;
|
|
164
163
|
},
|
|
165
164
|
menuClick(current) {
|
|
166
|
-
this.
|
|
165
|
+
let item = this.originMenuList.filter(menu => menu.name === current);
|
|
166
|
+
if (item && item.length > 0){
|
|
167
|
+
let type = item[0].type;
|
|
168
|
+
if (type == 2) {
|
|
169
|
+
this.activeName = current;
|
|
170
|
+
} else {
|
|
171
|
+
let pItem = this.originMenuList.filter(menu => menu.permissionId === item[0].pid);
|
|
172
|
+
if (pItem && pItem.length > 0){
|
|
173
|
+
this.activeName = pItem[0].name;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
} else {
|
|
177
|
+
this.activeName = current;
|
|
178
|
+
}
|
|
167
179
|
},
|
|
168
180
|
getOpenedNamesByActiveName(){
|
|
169
181
|
let res = filterMenuName(this.menuList,this.activeName);
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
<script>
|
|
45
45
|
import {
|
|
46
46
|
getPreviousTagIndex,
|
|
47
|
+
getDelTagIndex,
|
|
47
48
|
setTagNavListInLocalstorage,
|
|
48
49
|
showTitle
|
|
49
50
|
} from '@lambo-design/shared/utils/platform'
|
|
@@ -56,6 +57,8 @@ export default {
|
|
|
56
57
|
name: 'pro-layout-tabs',
|
|
57
58
|
data() {
|
|
58
59
|
return {
|
|
60
|
+
systemInfo: {},
|
|
61
|
+
tabNum : 8,
|
|
59
62
|
appId: '',
|
|
60
63
|
appInfo: {},
|
|
61
64
|
navList: [],
|
|
@@ -76,6 +79,9 @@ export default {
|
|
|
76
79
|
},
|
|
77
80
|
methods: {
|
|
78
81
|
initListener(){
|
|
82
|
+
Bus.$on('system-info',(data)=>{
|
|
83
|
+
this.initSystem(data)
|
|
84
|
+
});
|
|
79
85
|
Bus.$on('nav-list',(data)=>{
|
|
80
86
|
this.initNav(data)
|
|
81
87
|
});
|
|
@@ -90,11 +96,20 @@ export default {
|
|
|
90
96
|
})
|
|
91
97
|
},
|
|
92
98
|
destroyListener(){
|
|
99
|
+
Bus.$off('system-info')
|
|
93
100
|
Bus.$off('nav-list')
|
|
94
101
|
Bus.$off('menu-list')
|
|
95
102
|
Bus.$off('tag-list')
|
|
96
103
|
Bus.$off('change-app')
|
|
97
104
|
},
|
|
105
|
+
initSystem(data){
|
|
106
|
+
if (data) {
|
|
107
|
+
this.systemInfo = data;
|
|
108
|
+
if (data.tabNum) {
|
|
109
|
+
this.tabNum = data.tabNum;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
},
|
|
98
113
|
initNav(data){
|
|
99
114
|
if (data.toString() === this.navList.toString()) {
|
|
100
115
|
return;
|
|
@@ -105,7 +120,11 @@ export default {
|
|
|
105
120
|
this.originMenuList = deepCopy(data);
|
|
106
121
|
},
|
|
107
122
|
initTags(data,current){
|
|
108
|
-
|
|
123
|
+
if (data.length > this.tabNum) {
|
|
124
|
+
let index = getDelTagIndex(data,current);
|
|
125
|
+
data.splice(index,1);
|
|
126
|
+
}
|
|
127
|
+
setTagNavListInLocalstorage(data, config.routerBase + '-tagNavList');
|
|
109
128
|
this.tagList = data;
|
|
110
129
|
if (current !== this.value) {
|
|
111
130
|
this.value = current;
|
|
@@ -186,7 +205,7 @@ export default {
|
|
|
186
205
|
},
|
|
187
206
|
handleClick(item) {
|
|
188
207
|
this.value = item.name
|
|
189
|
-
Bus.$emit('menu-click', item.name)
|
|
208
|
+
Bus.$emit('menu-click', item.name , item)
|
|
190
209
|
if (item.meta && item.meta.appId
|
|
191
210
|
&& item.meta.appId != this.appId
|
|
192
211
|
&& item.meta.appId != config.homeRouter.meta.appId) {
|
|
@@ -238,7 +257,7 @@ export default {
|
|
|
238
257
|
this.visible = true
|
|
239
258
|
const offsetLeft = this.$el.getBoundingClientRect().left
|
|
240
259
|
this.contextMenuLeft = e.clientX - offsetLeft + 10
|
|
241
|
-
this.contextMenuTop = e.clientY -
|
|
260
|
+
this.contextMenuTop = e.clientY - 54
|
|
242
261
|
},
|
|
243
262
|
closeMenu() {
|
|
244
263
|
this.visible = false
|
|
@@ -368,6 +387,7 @@ export default {
|
|
|
368
387
|
margin: 0;
|
|
369
388
|
padding: 5px 15px;
|
|
370
389
|
cursor: pointer;
|
|
390
|
+
line-height: 18px;
|
|
371
391
|
|
|
372
392
|
&:hover {
|
|
373
393
|
background: #eee;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<span>欢迎,{{ userInfo.userName }}</span>
|
|
5
5
|
<Icon type="ios-arrow-down" />
|
|
6
6
|
<DropdownMenu v-if="userInfo.dropList.length > 0" slot="list">
|
|
7
|
-
<DropdownItem v-for="item in userInfo.dropList" :name="item.name"> {{item.value}}</DropdownItem>
|
|
7
|
+
<DropdownItem v-for="item in userInfo.dropList" :name="item.name" :key="item.name"> {{item.value}}</DropdownItem>
|
|
8
8
|
</DropdownMenu>
|
|
9
9
|
</Dropdown>
|
|
10
10
|
</div>
|
package/src/index.vue
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<i-layout class="pro-layout">
|
|
2
|
+
<i-layout class="pro-layout" :class="layoutClass">
|
|
3
3
|
<i-header class="pro-layout-header">
|
|
4
|
-
<LamboProLayoutHeader></LamboProLayoutHeader>
|
|
4
|
+
<LamboProLayoutHeader :accept-app-id="acceptAppId" @clickLogo="handleClick"></LamboProLayoutHeader>
|
|
5
5
|
</i-header>
|
|
6
6
|
<i-layout>
|
|
7
7
|
<i-sider
|
|
8
8
|
class="pro-layout-sider"
|
|
9
9
|
hide-trigger
|
|
10
10
|
collapsible
|
|
11
|
-
:width="
|
|
11
|
+
:width="220"
|
|
12
12
|
:collapsed-width="64"
|
|
13
13
|
v-model="collapsed">
|
|
14
14
|
<LamboProLayoutSider ref="sider"></LamboProLayoutSider>
|
|
@@ -35,14 +35,25 @@ import LamboProLayoutTabs from './components/pro-layout-tabs'
|
|
|
35
35
|
import Bus from '@lambo-design/shared/utils/bus'
|
|
36
36
|
import config from "@lambo-design/shared/config/config";
|
|
37
37
|
import {
|
|
38
|
-
getTagNavListFromLocalstorage, tagExists,
|
|
38
|
+
getTagNavListFromLocalstorage, routeEqual, tagExists,
|
|
39
39
|
} from "@lambo-design/shared/utils/platform";
|
|
40
40
|
import {deepCopy} from "@lambo-design/shared/utils/assist";
|
|
41
41
|
export default {
|
|
42
42
|
props:{
|
|
43
|
+
acceptAppId: {
|
|
44
|
+
type: String,
|
|
45
|
+
default:''
|
|
46
|
+
},
|
|
43
47
|
systemInfo: {
|
|
44
48
|
type: Object,
|
|
45
|
-
default: () => {
|
|
49
|
+
default: () => {
|
|
50
|
+
return {
|
|
51
|
+
systemName: '后台管理系统',
|
|
52
|
+
systemLogo: '',
|
|
53
|
+
layoutSize: '',
|
|
54
|
+
tabNum: 8,
|
|
55
|
+
}
|
|
56
|
+
}
|
|
46
57
|
},
|
|
47
58
|
userInfo: {
|
|
48
59
|
type: Object,
|
|
@@ -86,6 +97,17 @@ export default {
|
|
|
86
97
|
menuList,
|
|
87
98
|
homeRouter
|
|
88
99
|
}
|
|
100
|
+
},
|
|
101
|
+
layoutClass(){
|
|
102
|
+
if (this.systemInfo && this.systemInfo.layoutSize) {
|
|
103
|
+
let layoutSize = this.systemInfo.layoutSize;
|
|
104
|
+
if (layoutSize == 'default') {
|
|
105
|
+
return '';
|
|
106
|
+
} else {
|
|
107
|
+
return 'small';
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return '';
|
|
89
111
|
}
|
|
90
112
|
},
|
|
91
113
|
watch: {
|
|
@@ -98,6 +120,9 @@ export default {
|
|
|
98
120
|
}
|
|
99
121
|
},
|
|
100
122
|
methods: {
|
|
123
|
+
handleClick(){
|
|
124
|
+
this.$emit('clickLogo')
|
|
125
|
+
},
|
|
101
126
|
initListener(){
|
|
102
127
|
Bus.$on('trigger-change',(data)=>{
|
|
103
128
|
this.triggerChange(data)
|
|
@@ -108,8 +133,8 @@ export default {
|
|
|
108
133
|
Bus.$on('user-action', (name)=> {
|
|
109
134
|
this.userAction(name)
|
|
110
135
|
})
|
|
111
|
-
Bus.$on('menu-click',(name)=>{
|
|
112
|
-
this.menuClick(name)
|
|
136
|
+
Bus.$on('menu-click',(name, item)=>{
|
|
137
|
+
this.menuClick(name, item)
|
|
113
138
|
})
|
|
114
139
|
Bus.$on('tag-list',(data,current)=>{
|
|
115
140
|
this.changeTabs(data,current)
|
|
@@ -123,15 +148,13 @@ export default {
|
|
|
123
148
|
Bus.$off('tag-list')
|
|
124
149
|
},
|
|
125
150
|
initEmit(){
|
|
126
|
-
|
|
127
|
-
Bus.$emit('system-name-change',this.systemInfo.systemName)
|
|
128
|
-
}
|
|
151
|
+
Bus.$emit('system-info',this.systemInfo)
|
|
129
152
|
Bus.$emit('user-info',this.userInfo)
|
|
130
153
|
Bus.$emit('nav-list',this.navList)
|
|
131
154
|
Bus.$emit('menu-list',this.menuList)
|
|
132
155
|
},
|
|
133
156
|
initTags(){
|
|
134
|
-
let tagList = getTagNavListFromLocalstorage();
|
|
157
|
+
let tagList = getTagNavListFromLocalstorage(config.routerBase + '-tagNavList');
|
|
135
158
|
if (tagList.length == 0) {
|
|
136
159
|
tagList.push(this.homeRouter);
|
|
137
160
|
}
|
|
@@ -147,7 +170,7 @@ export default {
|
|
|
147
170
|
},
|
|
148
171
|
changeApp(appId,appInfo) {
|
|
149
172
|
if (!appInfo) {
|
|
150
|
-
|
|
173
|
+
appInfo = this.navList.filter(item => item.appId == appId)[0];
|
|
151
174
|
}
|
|
152
175
|
this.appId = appId;
|
|
153
176
|
this.$emit('change-app',{appId,appInfo})
|
|
@@ -155,10 +178,15 @@ export default {
|
|
|
155
178
|
userAction(name){
|
|
156
179
|
this.$emit('user-action',name)
|
|
157
180
|
},
|
|
158
|
-
menuClick(name){
|
|
159
|
-
|
|
181
|
+
menuClick(name, item){
|
|
182
|
+
if (!item) {
|
|
183
|
+
let res = this.menuList.filter(item => item.name == name);
|
|
184
|
+
if (res && res.length > 0) {
|
|
185
|
+
item = res[0];
|
|
186
|
+
}
|
|
187
|
+
}
|
|
160
188
|
sessionStorage.setItem('activeName',name);
|
|
161
|
-
this.$emit('menu-click', name,
|
|
189
|
+
this.$emit('menu-click', name, item)
|
|
162
190
|
},
|
|
163
191
|
changeTabs(data,current){
|
|
164
192
|
this.$emit('change-tabs',data,current)
|
|
@@ -176,9 +204,17 @@ export default {
|
|
|
176
204
|
} else {
|
|
177
205
|
name = menu.name;
|
|
178
206
|
menuItem = deepCopy(menu);
|
|
179
|
-
let tagList = getTagNavListFromLocalstorage();
|
|
207
|
+
let tagList = getTagNavListFromLocalstorage(config.routerBase + '-tagNavList');
|
|
180
208
|
if (!tagExists(tagList,name)) {
|
|
181
209
|
tagList.push(menuItem);
|
|
210
|
+
} else {
|
|
211
|
+
let tag = tagList.filter(item => item.name == name)[0];
|
|
212
|
+
if (!routeEqual(tag,menuItem)) {
|
|
213
|
+
let res = tagList.filter(item => item.name !== name);
|
|
214
|
+
tag = Object.assign(tag, menu);
|
|
215
|
+
res.push(tag);
|
|
216
|
+
tagList = deepCopy(res);
|
|
217
|
+
}
|
|
182
218
|
}
|
|
183
219
|
Bus.$emit('tag-list', tagList, name)
|
|
184
220
|
}
|
|
@@ -196,7 +232,7 @@ export default {
|
|
|
196
232
|
}
|
|
197
233
|
</script>
|
|
198
234
|
|
|
199
|
-
<style
|
|
235
|
+
<style lang="less">
|
|
200
236
|
@import "@lambo-design/core/src/styles/default";
|
|
201
237
|
.pro-layout{
|
|
202
238
|
color: #ffffff;
|
|
@@ -208,20 +244,61 @@ export default {
|
|
|
208
244
|
}
|
|
209
245
|
.pro-layout-sider{
|
|
210
246
|
overflow: hidden;
|
|
211
|
-
|
|
212
|
-
height:
|
|
247
|
+
.ivu-layout-sider-children{
|
|
248
|
+
height: calc(100vh - 65px);
|
|
213
249
|
overflow-y: scroll;
|
|
214
250
|
margin-right: -18px;
|
|
215
251
|
}
|
|
216
252
|
}
|
|
217
253
|
.pro-layout-content{
|
|
218
254
|
.pro-layout-content-layout{
|
|
219
|
-
height: ~"calc(100vh -
|
|
255
|
+
height: ~"calc(100vh - 53px)";
|
|
220
256
|
.pro-layout-page{
|
|
221
257
|
overflow: hidden;
|
|
222
258
|
color: var(--text-color,@_text-color);
|
|
223
259
|
}
|
|
224
260
|
}
|
|
225
261
|
}
|
|
262
|
+
&.small {
|
|
263
|
+
.ivu-layout-header{
|
|
264
|
+
height: 50px;
|
|
265
|
+
line-height: 50px;
|
|
266
|
+
.pro-layout-header-wrapper{
|
|
267
|
+
height: 50px;
|
|
268
|
+
.trigger-box{
|
|
269
|
+
.sider-trigger-a{
|
|
270
|
+
margin-top: 5px;
|
|
271
|
+
width: 64px;
|
|
272
|
+
height: 50px;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
.logo-box{
|
|
276
|
+
.pro-layout-logo-wrapper{
|
|
277
|
+
.logo{
|
|
278
|
+
height: 45px;
|
|
279
|
+
margin-top: 14px;
|
|
280
|
+
}
|
|
281
|
+
.divider{
|
|
282
|
+
height: 26px;
|
|
283
|
+
margin: 12px;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
.nav-box{
|
|
288
|
+
.pro-layout-nav-wrapper{
|
|
289
|
+
.ivu-menu-horizontal{
|
|
290
|
+
height: 46px;
|
|
291
|
+
line-height: 46px;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
.pro-layout-sider{
|
|
298
|
+
.ivu-layout-sider-children{
|
|
299
|
+
height: calc(100vh - 50px);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
226
303
|
}
|
|
227
|
-
</style>
|
|
304
|
+
</style>
|
|
Binary file
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
.other-menu {
|
|
2
|
+
width: 100%;
|
|
3
|
+
border-top: 3px solid #000000;
|
|
4
|
+
position: absolute;
|
|
5
|
+
bottom: 0;
|
|
6
|
+
z-index: 1000;
|
|
7
|
+
background: #061629;
|
|
8
|
+
|
|
9
|
+
&.other-menu-collapsed {
|
|
10
|
+
.other-menu-item {
|
|
11
|
+
border-top: 2px solid #000000;
|
|
12
|
+
width: 100%;
|
|
13
|
+
|
|
14
|
+
&:hover {
|
|
15
|
+
color: #ffffff;
|
|
16
|
+
background: #061629;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.ivu-tooltip {
|
|
20
|
+
width: 100%;
|
|
21
|
+
|
|
22
|
+
.ivu-tooltip-rel {
|
|
23
|
+
width: 100%;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ivu-tooltip-popper .ivu-tooltip-content {
|
|
27
|
+
.ivu-tooltip-arrow {
|
|
28
|
+
border-right-color: #fff;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.ivu-tooltip-inner {
|
|
32
|
+
background: #fff;
|
|
33
|
+
color: #495060;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.other-menu-icon {
|
|
39
|
+
font-size: 20px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.other-menu-title {
|
|
43
|
+
display: none;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
.other-menu-item {
|
|
51
|
+
color: #F0F0F0;
|
|
52
|
+
text-align: center;
|
|
53
|
+
line-height: 50px;
|
|
54
|
+
height: 50px;
|
|
55
|
+
width: 100px;
|
|
56
|
+
display: inline-block;
|
|
57
|
+
border-right: 2px solid #000000;
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
border-radius: 3px;
|
|
60
|
+
|
|
61
|
+
&:hover {
|
|
62
|
+
color: #ffffff;
|
|
63
|
+
background: var(--primary-color,@_primary-color);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
.other-menu-drawer-wrap {
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
.ivu-drawer {
|
|
74
|
+
left: 256px;
|
|
75
|
+
height: calc(100% - 110px);
|
|
76
|
+
bottom: 0;
|
|
77
|
+
top: auto;
|
|
78
|
+
|
|
79
|
+
.other-menu-history {
|
|
80
|
+
|
|
81
|
+
.other-menu-history-item {
|
|
82
|
+
width: 100%;
|
|
83
|
+
height: 35px;
|
|
84
|
+
line-height: 35px;
|
|
85
|
+
position: relative;
|
|
86
|
+
|
|
87
|
+
.delete {
|
|
88
|
+
display: none;
|
|
89
|
+
position: absolute;
|
|
90
|
+
right: 15px;
|
|
91
|
+
top: 0px;
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&:hover {
|
|
96
|
+
.content {
|
|
97
|
+
cursor: pointer;
|
|
98
|
+
height: 38px;
|
|
99
|
+
font-weight: bold;
|
|
100
|
+
color: var(--primary-color,@_primary-color);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.delete {
|
|
104
|
+
display: inline;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.other-menu-collect {
|
|
111
|
+
.other-menu-collect-item {
|
|
112
|
+
display: inline-block;
|
|
113
|
+
margin: 8px;
|
|
114
|
+
position: relative;
|
|
115
|
+
|
|
116
|
+
.delete {
|
|
117
|
+
display: none;
|
|
118
|
+
position: absolute;
|
|
119
|
+
right: -5px;
|
|
120
|
+
top: -5px;
|
|
121
|
+
z-index: 100;
|
|
122
|
+
cursor: pointer;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&:hover {
|
|
126
|
+
.content {
|
|
127
|
+
cursor: pointer;
|
|
128
|
+
color: var(--primary-color,@_primary-color);
|
|
129
|
+
|
|
130
|
+
.ivu-tooltip {
|
|
131
|
+
.ivu-tooltip-rel {
|
|
132
|
+
.ivu-icon {
|
|
133
|
+
font-size: 43px;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.delete {
|
|
140
|
+
display: inline;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.other-menu-drawer-wrap-collapsed {
|
|
153
|
+
.ivu-drawer {
|
|
154
|
+
left: 65px;
|
|
155
|
+
height: calc(100% - 110px);
|
|
156
|
+
bottom: 0;
|
|
157
|
+
top: auto;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
File without changes
|