@lambo-design/pro-layout 1.0.0-beta.21 → 1.0.0-beta.210
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 +4 -4
- package/src/components/pro-layout-header.vue +222 -1
- package/src/components/pro-layout-logo.vue +84 -12
- package/src/components/pro-layout-nav.vue +117 -74
- package/src/components/pro-layout-other-menu.vue +137 -0
- package/src/components/pro-layout-sider-collapsed-menu.vue +4 -3
- package/src/components/pro-layout-sider-menu-item.vue +54 -6
- package/src/components/pro-layout-sider-search.vue +271 -0
- package/src/components/pro-layout-sider.vue +122 -25
- package/src/components/pro-layout-tools-user.vue +203 -41
- package/src/components/pro-layout-trigger.vue +1 -1
- package/src/index.vue +72 -12
- package/src/styles/images/inspur.png +0 -0
- package/src/styles/other-menu.less +168 -0
- package/src/utils/menuItem.js +6 -0
- /package/src/styles/images/{logo.png → tobacco.png} +0 -0
package/src/index.vue
CHANGED
|
@@ -35,7 +35,7 @@ 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, routeEqual, tagExists,
|
|
38
|
+
getTagNavListFromLocalstorage, isOpenBlank, routeEqual, tagExists,
|
|
39
39
|
} from "@lambo-design/shared/utils/platform";
|
|
40
40
|
import {deepCopy} from "@lambo-design/shared/utils/assist";
|
|
41
41
|
export default {
|
|
@@ -47,7 +47,10 @@ export default {
|
|
|
47
47
|
systemName: '后台管理系统',
|
|
48
48
|
systemLogo: '',
|
|
49
49
|
layoutSize: '',
|
|
50
|
+
acceptAppId: '',
|
|
50
51
|
tabNum: 8,
|
|
52
|
+
topMenu: 4,
|
|
53
|
+
rightTopOptButtonList: []
|
|
51
54
|
}
|
|
52
55
|
}
|
|
53
56
|
},
|
|
@@ -63,6 +66,14 @@ export default {
|
|
|
63
66
|
type: Array,
|
|
64
67
|
default: () => []
|
|
65
68
|
},
|
|
69
|
+
historyMenuList: {
|
|
70
|
+
type: Array,
|
|
71
|
+
default: () => []
|
|
72
|
+
},
|
|
73
|
+
collectMenuList: {
|
|
74
|
+
type: Array,
|
|
75
|
+
default: () => []
|
|
76
|
+
},
|
|
66
77
|
homeRouter: {
|
|
67
78
|
type: Object,
|
|
68
79
|
default: () => {
|
|
@@ -85,12 +96,14 @@ export default {
|
|
|
85
96
|
},
|
|
86
97
|
computed: {
|
|
87
98
|
allData(){
|
|
88
|
-
const { systemInfo, userInfo, navList, menuList, homeRouter} = this;
|
|
99
|
+
const { systemInfo, userInfo, navList, menuList, historyMenuList, collectMenuList, homeRouter} = this;
|
|
89
100
|
return {
|
|
90
101
|
systemInfo,
|
|
91
102
|
userInfo,
|
|
92
103
|
navList,
|
|
93
104
|
menuList,
|
|
105
|
+
historyMenuList,
|
|
106
|
+
collectMenuList,
|
|
94
107
|
homeRouter
|
|
95
108
|
}
|
|
96
109
|
},
|
|
@@ -132,6 +145,18 @@ export default {
|
|
|
132
145
|
Bus.$on('tag-list',(data,current)=>{
|
|
133
146
|
this.changeTabs(data,current)
|
|
134
147
|
});
|
|
148
|
+
Bus.$on('delete-history-menu',(data) => {
|
|
149
|
+
this.deleteHistoryMenu(data)
|
|
150
|
+
})
|
|
151
|
+
Bus.$on('delete-collect-menu',(data) => {
|
|
152
|
+
this.deleteCollectMenu(data)
|
|
153
|
+
})
|
|
154
|
+
Bus.$on('toggle-collect-menu',(actionType,data) => {
|
|
155
|
+
this.toggleCollectMenu(actionType,data)
|
|
156
|
+
})
|
|
157
|
+
Bus.$on('click-logo',()=>{
|
|
158
|
+
this.clickLogo();
|
|
159
|
+
})
|
|
135
160
|
},
|
|
136
161
|
destroyListener(){
|
|
137
162
|
Bus.$off('trigger-change')
|
|
@@ -139,12 +164,25 @@ export default {
|
|
|
139
164
|
Bus.$off('user-action')
|
|
140
165
|
Bus.$off('menu-click')
|
|
141
166
|
Bus.$off('tag-list')
|
|
167
|
+
Bus.$off('delete-history-menu')
|
|
168
|
+
Bus.$off('delete-collect-menu')
|
|
169
|
+
Bus.$off('toggle-collect-menu')
|
|
170
|
+
Bus.$off('click-logo')
|
|
142
171
|
},
|
|
143
172
|
initEmit(){
|
|
173
|
+
//在这里改this.menuList
|
|
144
174
|
Bus.$emit('system-info',this.systemInfo)
|
|
145
175
|
Bus.$emit('user-info',this.userInfo)
|
|
146
176
|
Bus.$emit('nav-list',this.navList)
|
|
147
|
-
|
|
177
|
+
this.menuList.map(item => {
|
|
178
|
+
// 如果 uri 不以 '/' 开头,添加 '/'
|
|
179
|
+
if (item.uri&&!item.uri.startsWith('/')&&!item.uri.startsWith('http')) {
|
|
180
|
+
item.uri = '/' + item.uri;
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
Bus.$emit('menu-list',this.menuList);
|
|
184
|
+
Bus.$emit('history-menu-list',this.historyMenuList);
|
|
185
|
+
Bus.$emit('collect-menu-list',this.collectMenuList);
|
|
148
186
|
},
|
|
149
187
|
initTags(){
|
|
150
188
|
let tagList = getTagNavListFromLocalstorage(config.routerBase + '-tagNavList');
|
|
@@ -173,15 +211,18 @@ export default {
|
|
|
173
211
|
},
|
|
174
212
|
menuClick(name, item){
|
|
175
213
|
if (!item) {
|
|
176
|
-
let res = this.menuList.filter(item => item.name == name);
|
|
214
|
+
let res = this.menuList.filter(item => item.name == name );
|
|
177
215
|
if (res && res.length > 0) {
|
|
178
216
|
item = res[0];
|
|
179
217
|
}
|
|
180
218
|
}
|
|
181
|
-
|
|
219
|
+
if (!isOpenBlank(item)) {
|
|
220
|
+
sessionStorage.setItem('activeName',name);
|
|
221
|
+
}
|
|
182
222
|
this.$emit('menu-click', name, item)
|
|
183
223
|
},
|
|
184
224
|
changeTabs(data,current){
|
|
225
|
+
// data = data.filter(item => item.name === current);
|
|
185
226
|
this.$emit('change-tabs',data,current)
|
|
186
227
|
},
|
|
187
228
|
openMenuInTabs(menu){
|
|
@@ -202,15 +243,28 @@ export default {
|
|
|
202
243
|
tagList.push(menuItem);
|
|
203
244
|
} else {
|
|
204
245
|
let tag = tagList.filter(item => item.name == name)[0];
|
|
205
|
-
if (!routeEqual(tag,menuItem)) {
|
|
246
|
+
if (!routeEqual(tag,menuItem) && 'home' != name) {
|
|
206
247
|
let res = tagList.filter(item => item.name !== name);
|
|
207
248
|
tag = Object.assign(tag, menu);
|
|
208
249
|
res.push(tag);
|
|
209
250
|
tagList = deepCopy(res);
|
|
210
251
|
}
|
|
211
252
|
}
|
|
253
|
+
|
|
212
254
|
Bus.$emit('tag-list', tagList, name)
|
|
213
255
|
}
|
|
256
|
+
},
|
|
257
|
+
deleteHistoryMenu(data){
|
|
258
|
+
this.$emit('delete-history-menu',data);
|
|
259
|
+
},
|
|
260
|
+
deleteCollectMenu(data){
|
|
261
|
+
this.$emit('delete-collect-menu',data);
|
|
262
|
+
},
|
|
263
|
+
toggleCollectMenu(actionType,data){
|
|
264
|
+
this.$emit('toggle-collect-menu',actionType,data);
|
|
265
|
+
},
|
|
266
|
+
clickLogo(){
|
|
267
|
+
this.$emit('click-logo')
|
|
214
268
|
}
|
|
215
269
|
},
|
|
216
270
|
mounted(){
|
|
@@ -237,15 +291,15 @@ export default {
|
|
|
237
291
|
}
|
|
238
292
|
.pro-layout-sider{
|
|
239
293
|
overflow: hidden;
|
|
240
|
-
|
|
241
|
-
height:
|
|
294
|
+
.ivu-layout-sider-children{
|
|
295
|
+
height: calc(100vh - 65px);
|
|
242
296
|
overflow-y: scroll;
|
|
243
297
|
margin-right: -18px;
|
|
244
298
|
}
|
|
245
299
|
}
|
|
246
300
|
.pro-layout-content{
|
|
247
301
|
.pro-layout-content-layout{
|
|
248
|
-
height: ~"calc(100vh -
|
|
302
|
+
height: ~"calc(100vh - 53px)";
|
|
249
303
|
.pro-layout-page{
|
|
250
304
|
overflow: hidden;
|
|
251
305
|
color: var(--text-color,@_text-color);
|
|
@@ -261,13 +315,15 @@ export default {
|
|
|
261
315
|
.trigger-box{
|
|
262
316
|
.sider-trigger-a{
|
|
263
317
|
margin-top: 5px;
|
|
318
|
+
width: 64px;
|
|
319
|
+
height: 50px;
|
|
264
320
|
}
|
|
265
321
|
}
|
|
266
322
|
.logo-box{
|
|
267
323
|
.pro-layout-logo-wrapper{
|
|
268
324
|
.logo{
|
|
269
325
|
height: 45px;
|
|
270
|
-
margin-top:
|
|
326
|
+
margin-top: 14px;
|
|
271
327
|
}
|
|
272
328
|
.divider{
|
|
273
329
|
height: 26px;
|
|
@@ -285,7 +341,11 @@ export default {
|
|
|
285
341
|
}
|
|
286
342
|
}
|
|
287
343
|
}
|
|
288
|
-
|
|
344
|
+
.pro-layout-sider{
|
|
345
|
+
.ivu-layout-sider-children{
|
|
346
|
+
height: calc(100vh - 50px);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
289
349
|
}
|
|
290
350
|
}
|
|
291
|
-
</style>
|
|
351
|
+
</style>
|
|
Binary file
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
@import "@lambo-design/core/src/styles/default.less";
|
|
2
|
+
.other-menu {
|
|
3
|
+
width: 99%;
|
|
4
|
+
// border-top: 3px solid @_layout-sider-background;
|
|
5
|
+
position: absolute;
|
|
6
|
+
bottom: 0;
|
|
7
|
+
z-index: 1000;
|
|
8
|
+
background: var(--menu-dark-active-bg ,@_menu-dark-active-bg);
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
&.other-menu-collapsed {
|
|
13
|
+
.other-menu-item {
|
|
14
|
+
border-top: 2px solid #000000;
|
|
15
|
+
width: 100%;
|
|
16
|
+
|
|
17
|
+
&:hover {
|
|
18
|
+
color: #ffffff;
|
|
19
|
+
// background: #061629;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.ivu-tooltip {
|
|
23
|
+
width: 100%;
|
|
24
|
+
|
|
25
|
+
.ivu-tooltip-rel {
|
|
26
|
+
width: 100%;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.ivu-tooltip-popper .ivu-tooltip-content {
|
|
30
|
+
.ivu-tooltip-arrow {
|
|
31
|
+
border-right-color: #fff;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.ivu-tooltip-inner {
|
|
35
|
+
background: #fff;
|
|
36
|
+
color: #495060;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.other-menu-icon {
|
|
42
|
+
font-size: 20px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.other-menu-title {
|
|
46
|
+
display: none;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
.other-menu-item {
|
|
54
|
+
color: var(--menu-dark-subsidiary-color, @_menu-dark-subsidiary-color);
|
|
55
|
+
text-align: center;
|
|
56
|
+
line-height: 50px;
|
|
57
|
+
height: 48.6px;
|
|
58
|
+
width: 49.5%;
|
|
59
|
+
display: inline-block;
|
|
60
|
+
border: 1px solid #000000;
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
|
|
63
|
+
&:hover {
|
|
64
|
+
color: #ffffff;
|
|
65
|
+
background: var(--primary-color,@_primary-color);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
.other-menu-drawer-wrap {
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
.ivu-drawer {
|
|
76
|
+
left: 220px;
|
|
77
|
+
height: calc(100% - 110px);
|
|
78
|
+
bottom: 0;
|
|
79
|
+
top: auto;
|
|
80
|
+
overflow: hidden;
|
|
81
|
+
.other-menu-history {
|
|
82
|
+
|
|
83
|
+
.other-menu-history-item {
|
|
84
|
+
width: 100%;
|
|
85
|
+
height: 35px;
|
|
86
|
+
line-height: 35px;
|
|
87
|
+
position: relative;
|
|
88
|
+
|
|
89
|
+
.delete {
|
|
90
|
+
display: none;
|
|
91
|
+
position: absolute;
|
|
92
|
+
right: 0px;
|
|
93
|
+
top: 0px;
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
font-size: large;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&:hover {
|
|
99
|
+
.content {
|
|
100
|
+
cursor: pointer;
|
|
101
|
+
height: 38px;
|
|
102
|
+
font-weight: bold;
|
|
103
|
+
color: var(--primary-color,@_primary-color);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.delete {
|
|
107
|
+
display: inline;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.other-menu-collect {
|
|
114
|
+
.other-menu-collect-item {
|
|
115
|
+
//display: inline-block;
|
|
116
|
+
//margin: 8px;
|
|
117
|
+
//position: relative;
|
|
118
|
+
width: 100%;
|
|
119
|
+
height: 35px;
|
|
120
|
+
line-height: 35px;
|
|
121
|
+
position: relative;
|
|
122
|
+
.delete {
|
|
123
|
+
display: none;
|
|
124
|
+
position: absolute;
|
|
125
|
+
right: 0px;
|
|
126
|
+
top: 0px;
|
|
127
|
+
z-index: 100;
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
font-size: large;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&:hover {
|
|
133
|
+
.content {
|
|
134
|
+
cursor: pointer;
|
|
135
|
+
color: var(--primary-color,@_primary-color);
|
|
136
|
+
|
|
137
|
+
.ivu-tooltip {
|
|
138
|
+
.ivu-tooltip-rel {
|
|
139
|
+
.ivu-icon {
|
|
140
|
+
font-size: 43px;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.delete {
|
|
147
|
+
display: inline;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
overflow: hidden;
|
|
151
|
+
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.other-menu-drawer-wrap-collapsed {
|
|
161
|
+
.ivu-drawer {
|
|
162
|
+
left: 65px;
|
|
163
|
+
height: calc(100% - 110px);
|
|
164
|
+
bottom: 0;
|
|
165
|
+
top: auto;
|
|
166
|
+
|
|
167
|
+
}
|
|
168
|
+
}
|
package/src/utils/menuItem.js
CHANGED
|
File without changes
|