@lambo-design/pro-layout 1.0.0-beta.45 → 1.0.0-beta.451
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 +11 -4
- package/src/components/pro-layout-header/index.vue +220 -0
- package/src/components/pro-layout-header/pro-layout-logo/index.vue +206 -0
- package/src/components/pro-layout-header/pro-layout-nav/components/pro-layout-nav-slide-menu.vue +399 -0
- package/src/components/pro-layout-header/pro-layout-nav/index-slide.vue +226 -0
- package/src/components/pro-layout-header/pro-layout-nav/index.vue +565 -0
- package/src/components/pro-layout-header/pro-layout-slogan/index.vue +40 -0
- package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-collect.vue +79 -0
- package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-document.vue +116 -0
- package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-fullscreen.vue +144 -0
- package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-icons.vue +99 -0
- package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-intl.vue +110 -0
- package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-notice.vue +133 -0
- package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-search.vue +305 -0
- package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-todo.vue +145 -0
- package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-user.vue +64 -0
- package/src/components/pro-layout-header/pro-layout-tools/index.vue +38 -0
- package/src/components/pro-layout-header/pro-layout-trigger/index.vue +84 -0
- package/src/components/{pro-layout-sider-collapsed-menu.vue → pro-layout-sider/components/pro-layout-sider-collapsed-menu.vue} +30 -11
- package/src/components/{pro-layout-sider-icon.vue → pro-layout-sider/components/pro-layout-sider-icon.vue} +2 -2
- package/src/components/pro-layout-sider/components/pro-layout-sider-menu-item.vue +137 -0
- package/src/components/pro-layout-sider/components/pro-layout-sider-other-menu.vue +140 -0
- package/src/components/pro-layout-sider/components/pro-layout-sider-search.vue +345 -0
- package/src/components/pro-layout-sider/index.vue +477 -0
- package/src/components/{pro-layout-tabs.vue → pro-layout-tabs/index.vue} +118 -23
- package/src/index.vue +306 -40
- package/src/styles/color.less +267 -0
- package/src/styles/images/xiaoxitongzhi.png +0 -0
- package/src/styles/other-menu.less +63 -111
- package/src/utils/menuItem.js +10 -0
- package/src/utils/sider.js +16 -1
- package/src/components/pro-layout-header.vue +0 -52
- package/src/components/pro-layout-logo.vue +0 -79
- package/src/components/pro-layout-nav.vue +0 -150
- package/src/components/pro-layout-other-menu.vue +0 -138
- package/src/components/pro-layout-sider-menu-item.vue +0 -37
- package/src/components/pro-layout-sider.vue +0 -240
- package/src/components/pro-layout-tools-user.vue +0 -84
- package/src/components/pro-layout-tools.vue +0 -21
- package/src/components/pro-layout-trigger.vue +0 -48
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="pro-layout-tabs-wrapper">
|
|
2
|
+
<div class="pro-layout-tabs-wrapper" :class="tabsHeight != 46 ? 'custom-tabs' : ''">
|
|
3
3
|
<div class="close-con">
|
|
4
4
|
<Dropdown transfer @on-click="handleTagsOption">
|
|
5
5
|
<Icon :size="24" type="ios-close-circle-outline" class="btn-close"/>
|
|
6
6
|
<DropdownMenu slot="list">
|
|
7
|
-
<DropdownItem name="close-all"
|
|
8
|
-
<DropdownItem name="close-others"
|
|
7
|
+
<DropdownItem name="close-all">{{ t('pro-layout.tabs.close-all') }}</DropdownItem>
|
|
8
|
+
<DropdownItem name="close-others">{{ t('pro-layout.tabs.close-others') }}</DropdownItem>
|
|
9
9
|
</DropdownMenu>
|
|
10
10
|
</Dropdown>
|
|
11
11
|
</div>
|
|
@@ -46,15 +46,19 @@ import {
|
|
|
46
46
|
getPreviousTagIndex,
|
|
47
47
|
getDelTagIndex,
|
|
48
48
|
setTagNavListInLocalstorage,
|
|
49
|
-
|
|
49
|
+
setTagNavListInSessionstorage,
|
|
50
|
+
showTitle, getRootPermission
|
|
50
51
|
} from '@lambo-design/shared/utils/platform'
|
|
51
52
|
import beforeClose from '@lambo-design/shared/utils/menu/before-close'
|
|
52
53
|
import Bus from "@lambo-design/shared/utils/bus";
|
|
53
54
|
import config from "@lambo-design/shared/config/config";
|
|
54
55
|
import {deepCopy} from "@lambo-design/shared/utils/assist";
|
|
56
|
+
import {getThemeVarByKey} from "@lambo-design/shared/utils/theme";
|
|
57
|
+
import Locale from "@lambo-design/core/src/mixins/locale";
|
|
55
58
|
|
|
56
59
|
export default {
|
|
57
60
|
name: 'pro-layout-tabs',
|
|
61
|
+
mixins: [Locale],
|
|
58
62
|
data() {
|
|
59
63
|
return {
|
|
60
64
|
systemInfo: {},
|
|
@@ -72,9 +76,16 @@ export default {
|
|
|
72
76
|
contextMenuTop: 0,
|
|
73
77
|
visible: false,
|
|
74
78
|
menuList: {
|
|
75
|
-
others: '
|
|
76
|
-
all: '
|
|
77
|
-
}
|
|
79
|
+
others: this.t('pro-layout.tabs.close-others'),
|
|
80
|
+
all: this.t('pro-layout.tabs.close-all')
|
|
81
|
+
},
|
|
82
|
+
tabsHeight: 46
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
props: {
|
|
86
|
+
notSingleApp: {
|
|
87
|
+
type: Boolean,
|
|
88
|
+
default: true
|
|
78
89
|
}
|
|
79
90
|
},
|
|
80
91
|
methods: {
|
|
@@ -124,7 +135,8 @@ export default {
|
|
|
124
135
|
let index = getDelTagIndex(data,current);
|
|
125
136
|
data.splice(index,1);
|
|
126
137
|
}
|
|
127
|
-
setTagNavListInLocalstorage(data, config.routerBase + '-tagNavList');
|
|
138
|
+
// setTagNavListInLocalstorage(data, config.routerBase + '-tagNavList');
|
|
139
|
+
setTagNavListInSessionstorage(data, config.routerBase + '-tagNavList');
|
|
128
140
|
this.tagList = data;
|
|
129
141
|
if (current !== this.value) {
|
|
130
142
|
this.value = current;
|
|
@@ -138,8 +150,31 @@ export default {
|
|
|
138
150
|
}, 200)
|
|
139
151
|
},
|
|
140
152
|
changeApp(appId,appInfo){
|
|
153
|
+
let oldAppId = this.appId
|
|
154
|
+
let oldAppInfo = this.appInfo
|
|
141
155
|
this.appId = appId;
|
|
142
156
|
this.appInfo = appInfo;
|
|
157
|
+
if(oldAppId !== appId && oldAppInfo && this.appInfo){
|
|
158
|
+
let oldAppConfig = {}
|
|
159
|
+
if(oldAppInfo.extendProps){
|
|
160
|
+
oldAppConfig = oldAppInfo.extendProps
|
|
161
|
+
}
|
|
162
|
+
if(oldAppInfo.setting){
|
|
163
|
+
oldAppConfig = JSON.parse(oldAppInfo.setting)
|
|
164
|
+
}
|
|
165
|
+
let newAppConfig = {}
|
|
166
|
+
if(this.appInfo.extendProps){
|
|
167
|
+
newAppConfig = this.appInfo.extendProps
|
|
168
|
+
}
|
|
169
|
+
if(this.appInfo.setting){
|
|
170
|
+
newAppConfig = JSON.parse(this.appInfo.setting)
|
|
171
|
+
}
|
|
172
|
+
if(oldAppConfig && oldAppConfig.hasOwnProperty('is_hide_left_menu')
|
|
173
|
+
&& oldAppConfig.is_hide_left_menu === '1' && oldAppConfig.homePagePath){
|
|
174
|
+
let removeTag = this.tagList.filter(item => item.meta.appId === oldAppInfo.appId)
|
|
175
|
+
this.handleClose(removeTag[0],true)
|
|
176
|
+
}
|
|
177
|
+
}
|
|
143
178
|
},
|
|
144
179
|
emitTags(data,current){
|
|
145
180
|
Bus.$emit('tag-list',data,current);
|
|
@@ -183,20 +218,22 @@ export default {
|
|
|
183
218
|
}, 100)
|
|
184
219
|
}
|
|
185
220
|
},
|
|
186
|
-
handleClose(current) {
|
|
221
|
+
handleClose(current,isHomePage) {
|
|
187
222
|
if (current.meta && current.meta.beforeCloseName && current.meta.beforeCloseName in beforeClose) {
|
|
188
223
|
new Promise(beforeClose[current.meta.beforeCloseName]).then(close => {
|
|
189
224
|
if (close) {
|
|
190
|
-
this.close(current)
|
|
225
|
+
this.close(current,isHomePage)
|
|
191
226
|
}
|
|
192
227
|
})
|
|
193
228
|
} else {
|
|
194
|
-
this.close(current)
|
|
229
|
+
this.close(current,isHomePage)
|
|
195
230
|
}
|
|
196
231
|
},
|
|
197
|
-
close(route) {
|
|
232
|
+
close(route,isHomePage) {
|
|
198
233
|
let value = this.value;
|
|
199
|
-
if (
|
|
234
|
+
if (isHomePage) {
|
|
235
|
+
value = config.homeRouter.name;
|
|
236
|
+
} else if (route.name == this.value) {
|
|
200
237
|
let preTagIndex = getPreviousTagIndex(this.tagList, this.value)
|
|
201
238
|
value = this.tagList[preTagIndex].name;
|
|
202
239
|
}
|
|
@@ -204,18 +241,33 @@ export default {
|
|
|
204
241
|
this.emitTags(res, value);
|
|
205
242
|
},
|
|
206
243
|
handleClick(item) {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
244
|
+
if (item.meta && item.meta.appId && item.meta.appId != config.homeRouter.meta.appId) {
|
|
245
|
+
let appIdInner = item.meta.appId;
|
|
246
|
+
if (!this.notSingleApp) {
|
|
247
|
+
// 如果是单应用模式,根据permissionId找到最上层目录(即导航栏中的应用)的permissionId
|
|
248
|
+
const permissionList = this.$store.getters.getOriginalPermissionList;
|
|
249
|
+
if (permissionList && permissionList.length > 0) {
|
|
250
|
+
const permission = {
|
|
251
|
+
pid: item.pid,
|
|
252
|
+
appId: item.meta ? item.meta.appId : item.appId
|
|
253
|
+
}
|
|
254
|
+
const rootPermission = getRootPermission(permissionList, permission);
|
|
255
|
+
if (rootPermission && rootPermission.permissionId) {
|
|
256
|
+
appIdInner = rootPermission.permissionId
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
if (appIdInner != this.appId) {
|
|
261
|
+
let appInfo = this.navList.filter(app => app.appId === appIdInner);
|
|
262
|
+
if (appInfo && appInfo.length > 0) {
|
|
263
|
+
Bus.$emit('change-app', {appId: appInfo[0].appId, appInfo: appInfo[0]})
|
|
264
|
+
} else {
|
|
265
|
+
Bus.$emit('change-app', {appId: appIdInner, appInfo: null})
|
|
266
|
+
}
|
|
217
267
|
}
|
|
218
268
|
}
|
|
269
|
+
this.value = item.name
|
|
270
|
+
Bus.$emit('menu-click', item.name , item);
|
|
219
271
|
},
|
|
220
272
|
showTitleInside(item) {
|
|
221
273
|
return showTitle(item, this)
|
|
@@ -261,6 +313,13 @@ export default {
|
|
|
261
313
|
},
|
|
262
314
|
closeMenu() {
|
|
263
315
|
this.visible = false
|
|
316
|
+
},
|
|
317
|
+
loadingCustomStyle(){
|
|
318
|
+
let themeKey = localStorage.getItem("theme") ? localStorage.getItem("theme") : "default"
|
|
319
|
+
let tabsHeight = getThemeVarByKey(themeKey,'--layout-tabs-height');
|
|
320
|
+
if (tabsHeight) {
|
|
321
|
+
this.tabsHeight = tabsHeight;
|
|
322
|
+
}
|
|
264
323
|
}
|
|
265
324
|
},
|
|
266
325
|
watch: {
|
|
@@ -276,6 +335,7 @@ export default {
|
|
|
276
335
|
setTimeout(() => {
|
|
277
336
|
this.getTagElementByRoute(this.value)
|
|
278
337
|
}, 200)
|
|
338
|
+
this.loadingCustomStyle();
|
|
279
339
|
},
|
|
280
340
|
created(){
|
|
281
341
|
this.initListener();
|
|
@@ -400,5 +460,40 @@ export default {
|
|
|
400
460
|
background-color: var(--primary-color,@_primary-color)
|
|
401
461
|
}
|
|
402
462
|
}
|
|
463
|
+
&.custom-tabs{
|
|
464
|
+
height: 36px;
|
|
465
|
+
line-height: 30px;
|
|
466
|
+
.close-con{
|
|
467
|
+
.btn-close{
|
|
468
|
+
margin-top: 5px;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
.btn-con{
|
|
472
|
+
padding: 5px 0px;
|
|
473
|
+
}
|
|
474
|
+
.scroll-outer{
|
|
475
|
+
left: 8px;
|
|
476
|
+
right: 51px;
|
|
477
|
+
.scroll-body{
|
|
478
|
+
/deep/.ivu-tag-dot{
|
|
479
|
+
height: 28px;
|
|
480
|
+
line-height: 28px;
|
|
481
|
+
padding: 0 8px;
|
|
482
|
+
.ivu-tag-dot-inner{
|
|
483
|
+
width: 10px;
|
|
484
|
+
height: 10px;
|
|
485
|
+
margin-right: 2px;
|
|
486
|
+
top: 1px;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
/deep/.ivu-tag{
|
|
490
|
+
.ivu-icon-ios-close{
|
|
491
|
+
margin-left: 0px !important;
|
|
492
|
+
top: 0px;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
}
|
|
403
498
|
}
|
|
404
499
|
</style>
|