@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,150 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="pro-layout-nav-wrapper">
|
|
3
|
-
<Menu ref="topNav" mode="horizontal" theme="dark" :active-name="activeName" @on-select="selectApp">
|
|
4
|
-
<MenuItem :name="item.appId" v-for="item in topMenList" :key="item.appId">
|
|
5
|
-
{{item.name}}
|
|
6
|
-
<div class="line"></div>
|
|
7
|
-
</MenuItem>
|
|
8
|
-
<Submenu name="other" v-if="otherList.length > 0">
|
|
9
|
-
<template slot="title">
|
|
10
|
-
...
|
|
11
|
-
</template>
|
|
12
|
-
<MenuItem :name="item.appId" v-for="item in otherList" :key="item.appId">
|
|
13
|
-
{{item.name}}
|
|
14
|
-
</MenuItem>
|
|
15
|
-
</Submenu>
|
|
16
|
-
</Menu>
|
|
17
|
-
</div>
|
|
18
|
-
</template>
|
|
19
|
-
|
|
20
|
-
<script>
|
|
21
|
-
import Bus from "@lambo-design/shared/utils/bus";
|
|
22
|
-
import {deepCopy} from "@lambo-design/shared/utils/assist";
|
|
23
|
-
import config from "@lambo-design/shared/config/config";
|
|
24
|
-
|
|
25
|
-
export default {
|
|
26
|
-
name: "pro-layout-logo",
|
|
27
|
-
data(){
|
|
28
|
-
return {
|
|
29
|
-
navList : [],
|
|
30
|
-
topMenList : [],
|
|
31
|
-
otherList : [],
|
|
32
|
-
activeName : '',
|
|
33
|
-
topMenuNum : 4,
|
|
34
|
-
originMenuList: []
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
methods: {
|
|
38
|
-
initListener(){
|
|
39
|
-
Bus.$on('nav-list',(data)=>{
|
|
40
|
-
this.initNav(data)
|
|
41
|
-
});
|
|
42
|
-
Bus.$on('change-app', ({appId,appInfo})=> {
|
|
43
|
-
this.changeApp(appId,appInfo)
|
|
44
|
-
});
|
|
45
|
-
Bus.$on('menu-list',(data)=>{
|
|
46
|
-
this.initMenu(data)
|
|
47
|
-
});
|
|
48
|
-
},
|
|
49
|
-
destroyListener(){
|
|
50
|
-
Bus.$off('nav-list')
|
|
51
|
-
Bus.$off('menu-list')
|
|
52
|
-
Bus.$off('change-app')
|
|
53
|
-
},
|
|
54
|
-
initNav(data){
|
|
55
|
-
if (data.toString() === this.navList.toString()) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
this.navList = data;
|
|
59
|
-
if (data.length > this.topMenuNum) {
|
|
60
|
-
let navList = deepCopy(data);
|
|
61
|
-
this.topMenList = navList.splice(0,this.topMenuNum);
|
|
62
|
-
this.otherList = navList;
|
|
63
|
-
} else {
|
|
64
|
-
this.topMenList = this.navList
|
|
65
|
-
}
|
|
66
|
-
if (this.topMenList.length > 0){
|
|
67
|
-
let appId = this.topMenList[0].appId;
|
|
68
|
-
if (this.activeName) {
|
|
69
|
-
appId = this.activeName;
|
|
70
|
-
}
|
|
71
|
-
this.selectApp(appId);
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
initMenu(data){
|
|
75
|
-
this.originMenuList = deepCopy(data);
|
|
76
|
-
},
|
|
77
|
-
selectApp(appId){
|
|
78
|
-
this.activeName = appId;
|
|
79
|
-
let res = this.navList.filter(app => app.appId == appId);
|
|
80
|
-
Bus.$emit('change-app', {appId,appInfo:res[0]})
|
|
81
|
-
},
|
|
82
|
-
changeApp(appId,appInfo) {
|
|
83
|
-
this.activeName = appId;
|
|
84
|
-
this.$nextTick(() => {
|
|
85
|
-
this.$refs.topNav.updateActiveName()
|
|
86
|
-
})
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
watch: {
|
|
90
|
-
activeName(){
|
|
91
|
-
this.$nextTick(()=>{
|
|
92
|
-
this.$refs.topNav.updateActiveName();
|
|
93
|
-
})
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
created(){
|
|
97
|
-
this.initListener();
|
|
98
|
-
},
|
|
99
|
-
beforeDestroy(){
|
|
100
|
-
this.destroyListener();
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
</script>
|
|
104
|
-
|
|
105
|
-
<style scoped lang="less">
|
|
106
|
-
@import '@lambo-design/core/src/styles/default.less';
|
|
107
|
-
.pro-layout-nav-wrapper{
|
|
108
|
-
.ivu-menu{
|
|
109
|
-
.ivu-menu-item{
|
|
110
|
-
&:hover{
|
|
111
|
-
background: rgba(255,255,255,0.2);
|
|
112
|
-
.line{
|
|
113
|
-
border-bottom: 2px solid var(--primary-color,@_primary-color);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
&.ivu-menu-item-active,&.ivu-menu-item-selected{
|
|
117
|
-
background: rgba(255,255,255,0.2);
|
|
118
|
-
.line{
|
|
119
|
-
border-bottom: 2px solid var(--primary-color,@_primary-color);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
/deep/.ivu-menu-submenu{
|
|
124
|
-
.ivu-menu-submenu-title > i{
|
|
125
|
-
&.ivu-menu-submenu-title-icon{
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
.ivu-select-dropdown{
|
|
130
|
-
background: var(--menu-dark-title,@_menu-dark-title);
|
|
131
|
-
color: var(--heading-color-dark,@_heading-color-dark);
|
|
132
|
-
.ivu-menu-drop-list{
|
|
133
|
-
.ivu-menu-item{
|
|
134
|
-
color: var(--menu-dark-subsidiary-color,@_menu-dark-subsidiary-color);
|
|
135
|
-
&:hover{
|
|
136
|
-
background: rgba(255,255,255,0.2);
|
|
137
|
-
color: var(--heading-color-dark,@_heading-color-dark);
|
|
138
|
-
}
|
|
139
|
-
&.ivu-menu-item-active,&.ivu-menu-item-selected{
|
|
140
|
-
background: rgba(255,255,255,0.2);
|
|
141
|
-
color: var(--heading-color-dark,@_heading-color-dark);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
</style>
|
|
@@ -1,138 +0,0 @@
|
|
|
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/packages/utils/ajax'
|
|
57
|
-
import config from "@/config/config";
|
|
58
|
-
import CommonIcon from "_c/common-icon";
|
|
59
|
-
|
|
60
|
-
export default {
|
|
61
|
-
name: "other-menu",
|
|
62
|
-
components: {CommonIcon},
|
|
63
|
-
props: {
|
|
64
|
-
collapsed: {
|
|
65
|
-
type: Boolean
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
data() {
|
|
69
|
-
return {
|
|
70
|
-
drawer: {
|
|
71
|
-
model: false,
|
|
72
|
-
url: '',
|
|
73
|
-
title: '',
|
|
74
|
-
type: '',
|
|
75
|
-
},
|
|
76
|
-
list: []
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
computed: {
|
|
80
|
-
classes() {
|
|
81
|
-
let classes = ["other-menu"]
|
|
82
|
-
return this.collapsed ? ["other-menu-collapsed", ...classes] : [...classes]
|
|
83
|
-
},
|
|
84
|
-
drawerClasses() {
|
|
85
|
-
return this.collapsed ? "other-menu-drawer-wrap-collapsed" : "other-menu-drawer-wrap"
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
methods: {
|
|
89
|
-
onChange(value) {
|
|
90
|
-
if (value == 'history') {
|
|
91
|
-
this.drawer.title = '历史菜单'
|
|
92
|
-
this.drawer.url = '/manage/upmsMenuHistory/list'
|
|
93
|
-
|
|
94
|
-
} else {
|
|
95
|
-
this.drawer.title = '收藏菜单'
|
|
96
|
-
this.drawer.url = '/manage/upmsMenuCollect/list'
|
|
97
|
-
}
|
|
98
|
-
this.getList()
|
|
99
|
-
this.drawer.type = value
|
|
100
|
-
this.drawer.model = !this.drawer.model
|
|
101
|
-
},
|
|
102
|
-
getList() {
|
|
103
|
-
this.list = []
|
|
104
|
-
ajax.get(config.upmsServerContext + this.drawer.url).then(resp => {
|
|
105
|
-
if (resp.data.code == 1) {
|
|
106
|
-
this.list = resp.data.data
|
|
107
|
-
if (this.drawer.type == 'collect') {
|
|
108
|
-
this.$store.commit('setCollectMenuList', this.list)
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
})
|
|
112
|
-
},
|
|
113
|
-
handleClick(item) {
|
|
114
|
-
this.$emit('on-select', item.name)
|
|
115
|
-
this.drawer.model = false
|
|
116
|
-
},
|
|
117
|
-
handleHistoryDelete(item) {
|
|
118
|
-
ajax.get(config.upmsServerContext + "/manage/upmsMenuHistory/delete/" + item.historyId).then(resp => {
|
|
119
|
-
if (resp.data.code == 1) {
|
|
120
|
-
this.getList()
|
|
121
|
-
}
|
|
122
|
-
})
|
|
123
|
-
},
|
|
124
|
-
handleCollectDelete(item) {
|
|
125
|
-
ajax.get(config.upmsServerContext + "/manage/upmsMenuCollect/delete/" + item.collectId).then(resp => {
|
|
126
|
-
if (resp.data.code == 1) {
|
|
127
|
-
this.getList()
|
|
128
|
-
}
|
|
129
|
-
})
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
</script>
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
<style lang="less">
|
|
137
|
-
@import '../styles/other-menu.less';
|
|
138
|
-
</style>
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<Submenu v-show="isShow" :name="`${parentName}`">
|
|
3
|
-
<template slot="title">
|
|
4
|
-
<ProLayoutSiderIcon :icon-type="parentItem.meta.icon"></ProLayoutSiderIcon>
|
|
5
|
-
<span>{{ showTitle(parentItem) }}</span>
|
|
6
|
-
</template>
|
|
7
|
-
<template v-for="item in children">
|
|
8
|
-
<template v-if="item.children && item.children.length === 1">
|
|
9
|
-
<ProLayoutSiderMenuItem v-if="showChildren(item)" :key="`menu-${item.name}`"
|
|
10
|
-
:parent-item="item">
|
|
11
|
-
</ProLayoutSiderMenuItem>
|
|
12
|
-
<menu-item v-else :key="`menu-${item.children[0].name}`" :name="getNameOrHref(item, true)">
|
|
13
|
-
<ProLayoutSiderIcon :icon-type="item.meta.icon"></ProLayoutSiderIcon>
|
|
14
|
-
<span>{{ showTitle(item.children[0]) }}</span>
|
|
15
|
-
</menu-item>
|
|
16
|
-
</template>
|
|
17
|
-
<template v-else>
|
|
18
|
-
<ProLayoutSiderMenuItem v-if="showChildren(item)" :key="`menu-${item.name}`"
|
|
19
|
-
:parent-item="item">
|
|
20
|
-
</ProLayoutSiderMenuItem>
|
|
21
|
-
<menu-item v-else :key="`menu-${item.name}`" :name="getNameOrHref(item)">
|
|
22
|
-
<ProLayoutSiderIcon :icon-type="item.meta.icon"></ProLayoutSiderIcon>
|
|
23
|
-
<span>{{ showTitle(item) }}</span>
|
|
24
|
-
</menu-item>
|
|
25
|
-
</template>
|
|
26
|
-
</template>
|
|
27
|
-
</Submenu>
|
|
28
|
-
</template>
|
|
29
|
-
<script>
|
|
30
|
-
import sider from '../utils/sider'
|
|
31
|
-
import menuItem from '../utils/menuItem'
|
|
32
|
-
|
|
33
|
-
export default {
|
|
34
|
-
name: 'ProLayoutSiderMenuItem',
|
|
35
|
-
mixins: [sider, menuItem],
|
|
36
|
-
}
|
|
37
|
-
</script>
|
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="pro-layout-sider-wrapper">
|
|
3
|
-
<Menu v-show="!collapsed" ref="menu"
|
|
4
|
-
:accordion="accordion" :active-name="activeName"
|
|
5
|
-
:open-names="openedNames" theme="dark"
|
|
6
|
-
width="auto" @on-select="handleSelect">
|
|
7
|
-
<template v-for="item in menuList">
|
|
8
|
-
<template v-if="item.children && item.children.length === 1">
|
|
9
|
-
<ProLayoutSiderMenuItem v-if="showChildren(item)"
|
|
10
|
-
:key="`menu-${item.name}`"
|
|
11
|
-
:parent-item="item">
|
|
12
|
-
</ProLayoutSiderMenuItem>
|
|
13
|
-
<MenuItem v-else :key="`menu-${item.children[0].name}`"
|
|
14
|
-
:name="getNameOrHref(item, true)">
|
|
15
|
-
<ProLayoutSiderIcon :icon-type="item.meta.icon"></ProLayoutSiderIcon>
|
|
16
|
-
<span>{{ showTitle(item.children[0]) }}</span>
|
|
17
|
-
</MenuItem>
|
|
18
|
-
</template>
|
|
19
|
-
<template v-else>
|
|
20
|
-
<ProLayoutSiderMenuItem v-if="showChildren(item)" :key="`menu-${item.name}`"
|
|
21
|
-
:parent-item="item">
|
|
22
|
-
</ProLayoutSiderMenuItem>
|
|
23
|
-
<MenuItem v-else :key="`menu-${item.name}`"
|
|
24
|
-
:name="getNameOrHref(item)">
|
|
25
|
-
<ProLayoutSiderIcon :icon-type="item.meta.icon"></ProLayoutSiderIcon>
|
|
26
|
-
<span>{{ showTitle(item) }}</span>
|
|
27
|
-
</MenuItem>
|
|
28
|
-
</template>
|
|
29
|
-
</template>
|
|
30
|
-
</Menu>
|
|
31
|
-
<div v-show="collapsed" :list="menuList" class="menu-collapsed">
|
|
32
|
-
<template v-for="item in menuList">
|
|
33
|
-
<ProLayoutSiderCollapsedMenu v-if="item.children && item.children.length > 1" :key="`drop-menu-${item.name}`"
|
|
34
|
-
:parent-item="item" theme="dark" hide-title
|
|
35
|
-
@on-click="handleSelect">
|
|
36
|
-
</ProLayoutSiderCollapsedMenu>
|
|
37
|
-
<Tooltip v-else :key="`drop-menu-${item.name}`" :content="showTitle(item.children && item.children[0] ? item.children[0] : item)"
|
|
38
|
-
placement="right" transfer>
|
|
39
|
-
<a :style="{textAlign: 'center'}" class="drop-menu-a"
|
|
40
|
-
@click="handleSelect(getNameOrHref(item, true))">
|
|
41
|
-
<ProLayoutSiderIcon :icon-type="item.meta.icon" icon-size="26"></ProLayoutSiderIcon>
|
|
42
|
-
</a>
|
|
43
|
-
</Tooltip>
|
|
44
|
-
</template>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
</template>
|
|
48
|
-
|
|
49
|
-
<script>
|
|
50
|
-
import Bus from "@lambo-design/shared/utils/bus";
|
|
51
|
-
import {deepCopy} from "@lambo-design/shared/utils/assist";
|
|
52
|
-
import generatorMenuList from "@lambo-design/shared/utils/menu/index";
|
|
53
|
-
import sider from '../utils/sider'
|
|
54
|
-
import ProLayoutSiderMenuItem from './pro-layout-sider-menu-item'
|
|
55
|
-
import ProLayoutSiderCollapsedMenu from './pro-layout-sider-collapsed-menu'
|
|
56
|
-
import {
|
|
57
|
-
filterMenuName,
|
|
58
|
-
filterMenuUri, routeEqual,
|
|
59
|
-
tagExists
|
|
60
|
-
} from "@lambo-design/shared/utils/platform";
|
|
61
|
-
|
|
62
|
-
export default {
|
|
63
|
-
name: "pro-layout-sider",
|
|
64
|
-
components: {
|
|
65
|
-
ProLayoutSiderMenuItem,
|
|
66
|
-
ProLayoutSiderCollapsedMenu
|
|
67
|
-
},
|
|
68
|
-
data(){
|
|
69
|
-
return {
|
|
70
|
-
navList: [],
|
|
71
|
-
originMenuList:[],
|
|
72
|
-
menuList: [],
|
|
73
|
-
appId: '',
|
|
74
|
-
collapsed: false,
|
|
75
|
-
accordion: true,
|
|
76
|
-
activeName: '',
|
|
77
|
-
openedNames: [],
|
|
78
|
-
tagValue: '',
|
|
79
|
-
tagList: []
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
mixins:[sider],
|
|
83
|
-
methods: {
|
|
84
|
-
initListener(){
|
|
85
|
-
Bus.$on('nav-list',(data)=>{
|
|
86
|
-
this.initNav(data)
|
|
87
|
-
});
|
|
88
|
-
Bus.$on('menu-list',(data)=>{
|
|
89
|
-
this.initMenu(data)
|
|
90
|
-
});
|
|
91
|
-
Bus.$on('trigger-change',(data)=>{
|
|
92
|
-
this.triggerChange(data)
|
|
93
|
-
});
|
|
94
|
-
Bus.$on('change-app', ({appId,appInfo})=> {
|
|
95
|
-
this.changeApp(appId,appInfo)
|
|
96
|
-
})
|
|
97
|
-
Bus.$on('tag-list',(data,current)=>{
|
|
98
|
-
this.initTags(data,current)
|
|
99
|
-
});
|
|
100
|
-
Bus.$on('menu-click',(current)=>{
|
|
101
|
-
this.menuClick(current)
|
|
102
|
-
});
|
|
103
|
-
},
|
|
104
|
-
destroyListener(){
|
|
105
|
-
Bus.$off('nav-list')
|
|
106
|
-
Bus.$off('menu-list')
|
|
107
|
-
Bus.$off('trigger-change')
|
|
108
|
-
Bus.$off('change-app')
|
|
109
|
-
Bus.$off('tag-list')
|
|
110
|
-
Bus.$off('menu-click')
|
|
111
|
-
},
|
|
112
|
-
initNav(data){
|
|
113
|
-
if (data.toString() === this.navList.toString()) {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
this.navList = data;
|
|
117
|
-
},
|
|
118
|
-
initMenu(data){
|
|
119
|
-
if (data && data.length > 0) {
|
|
120
|
-
let item = data[0];
|
|
121
|
-
if (item.appId && item.appId !== this.appId) {
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
this.originMenuList = deepCopy(data);
|
|
126
|
-
this.changeMenu()
|
|
127
|
-
},
|
|
128
|
-
changeApp(appId,appInfo){
|
|
129
|
-
this.appId = appId;
|
|
130
|
-
this.changeMenu()
|
|
131
|
-
},
|
|
132
|
-
changeMenu(){
|
|
133
|
-
let treeMenuList = generatorMenuList(this.originMenuList,this.appId);
|
|
134
|
-
if (treeMenuList && treeMenuList.length > 0) {
|
|
135
|
-
this.menuList = treeMenuList;
|
|
136
|
-
} else {
|
|
137
|
-
this.menuList = [];
|
|
138
|
-
}
|
|
139
|
-
this.openedNames = this.getOpenedNamesByActiveName();
|
|
140
|
-
},
|
|
141
|
-
handleSelect(name){
|
|
142
|
-
let menu = null;
|
|
143
|
-
if (name.indexOf("isTurnByHref_") > -1) {
|
|
144
|
-
name = name.replace("isTurnByHref_","");
|
|
145
|
-
menu = filterMenuUri(this.menuList,name);
|
|
146
|
-
} else {
|
|
147
|
-
menu = filterMenuName(this.menuList,name);
|
|
148
|
-
}
|
|
149
|
-
let tagList = this.tagList;
|
|
150
|
-
if (menu && menu.name) {
|
|
151
|
-
if (!tagExists(tagList,menu.name)) {
|
|
152
|
-
tagList.push(menu);
|
|
153
|
-
}
|
|
154
|
-
Bus.$emit('tag-list', tagList, menu.name)
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
triggerChange(data){
|
|
158
|
-
this.collapsed = data;
|
|
159
|
-
},
|
|
160
|
-
initTags(data,name){
|
|
161
|
-
this.tagList = data;
|
|
162
|
-
this.value = name;
|
|
163
|
-
},
|
|
164
|
-
menuClick(current) {
|
|
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
|
-
}
|
|
179
|
-
},
|
|
180
|
-
getOpenedNamesByActiveName(){
|
|
181
|
-
let res = filterMenuName(this.menuList,this.activeName);
|
|
182
|
-
let openNames = []
|
|
183
|
-
if (res) {
|
|
184
|
-
const crumbs = res.meta.crumbs;
|
|
185
|
-
if (crumbs) {
|
|
186
|
-
crumbs.forEach(item => {
|
|
187
|
-
if (item.type === 1) {
|
|
188
|
-
openNames.push(item.name)
|
|
189
|
-
}
|
|
190
|
-
})
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
return openNames
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
watch:{
|
|
197
|
-
activeName(){
|
|
198
|
-
this.openedNames = this.getOpenedNamesByActiveName();
|
|
199
|
-
},
|
|
200
|
-
openedNames() {
|
|
201
|
-
this.$nextTick(() => {
|
|
202
|
-
this.$refs.menu.updateOpened()
|
|
203
|
-
this.$refs.menu.updateActiveName()
|
|
204
|
-
})
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
created(){
|
|
208
|
-
this.initListener();
|
|
209
|
-
},
|
|
210
|
-
beforeDestroy(){
|
|
211
|
-
this.destroyListener();
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
}
|
|
215
|
-
</script>
|
|
216
|
-
|
|
217
|
-
<style scoped lang="less">
|
|
218
|
-
@import "@lambo-design/core/src/styles/default";
|
|
219
|
-
.pro-layout-sider-wrapper{
|
|
220
|
-
/deep/.ivu-menu-submenu{
|
|
221
|
-
.ivu-menu{
|
|
222
|
-
background: #1A1A1A;
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
.menu-collapsed {
|
|
226
|
-
padding-top: 10px;
|
|
227
|
-
/deep/a.drop-menu-a{
|
|
228
|
-
display: inline-block;
|
|
229
|
-
padding: 6px 20px;
|
|
230
|
-
width: 100%;
|
|
231
|
-
text-align: center;
|
|
232
|
-
font-weight: normal;
|
|
233
|
-
color: var(--menu-dark-subsidiary-color, @_menu-dark-subsidiary-color);
|
|
234
|
-
&:hover{
|
|
235
|
-
color: var(--heading-color-dark, @_heading-color-dark);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
</style>
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="user-avatar-dropdown">
|
|
3
|
-
<Dropdown @on-click="handleClick">
|
|
4
|
-
<span>欢迎,{{ userInfo.userName }}</span>
|
|
5
|
-
<Icon type="ios-arrow-down" />
|
|
6
|
-
<DropdownMenu v-if="userInfo.dropList.length > 0" slot="list">
|
|
7
|
-
<DropdownItem v-for="item in userInfo.dropList" :name="item.name" :key="item.name"> {{item.value}}</DropdownItem>
|
|
8
|
-
</DropdownMenu>
|
|
9
|
-
</Dropdown>
|
|
10
|
-
</div>
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
|
-
<script>
|
|
14
|
-
import Bus from "@lambo-design/shared/utils/bus";
|
|
15
|
-
import {deepCopy} from "@lambo-design/shared/utils/assist";
|
|
16
|
-
|
|
17
|
-
export default {
|
|
18
|
-
name: 'pro-layout-tools-user',
|
|
19
|
-
data(){
|
|
20
|
-
return{
|
|
21
|
-
userInfo: {
|
|
22
|
-
userName: '管理员',
|
|
23
|
-
dropList: [
|
|
24
|
-
{name: 'changePwd', value: '修改密码'},
|
|
25
|
-
{name: 'logout', value: '退出登录'}
|
|
26
|
-
]
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
methods: {
|
|
31
|
-
initListener(){
|
|
32
|
-
Bus.$on('user-info',(data)=>{
|
|
33
|
-
this.handleUser(data)
|
|
34
|
-
});
|
|
35
|
-
},
|
|
36
|
-
destroyListener(){
|
|
37
|
-
Bus.$off('user-info')
|
|
38
|
-
},
|
|
39
|
-
handleUser(data){
|
|
40
|
-
this.userInfo = Object.assign(this.userInfo,data);
|
|
41
|
-
},
|
|
42
|
-
handleClick(name) {
|
|
43
|
-
Bus.$emit('user-action',name)
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
created(){
|
|
47
|
-
this.initListener();
|
|
48
|
-
},
|
|
49
|
-
beforeDestroy(){
|
|
50
|
-
this.destroyListener();
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
</script>
|
|
54
|
-
<style lang="less" scoped>
|
|
55
|
-
@import '@lambo-design/core/src/styles/default.less';
|
|
56
|
-
.user-avatar-dropdown {
|
|
57
|
-
cursor: pointer;
|
|
58
|
-
vertical-align: middle;
|
|
59
|
-
color: var(--menu-dark-subsidiary-color, @_menu-dark-subsidiary-color);
|
|
60
|
-
font-size: var(--font-size-base, @_font-size-base);
|
|
61
|
-
/deep/.ivu-dropdown-rel{
|
|
62
|
-
&:hover {
|
|
63
|
-
color: var(--heading-color-dark,@_heading-color-dark);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
/deep/.ivu-select-dropdown{
|
|
67
|
-
background: var(--menu-dark-title,@_menu-dark-title);
|
|
68
|
-
color: var(--heading-color-dark,@_heading-color-dark);
|
|
69
|
-
.ivu-dropdown-menu{
|
|
70
|
-
.ivu-dropdown-item{
|
|
71
|
-
color: var(--menu-dark-subsidiary-color,@_menu-dark-subsidiary-color);
|
|
72
|
-
&:hover{
|
|
73
|
-
background: rgba(255,255,255,0.2);
|
|
74
|
-
color: var(--heading-color-dark,@_heading-color-dark);
|
|
75
|
-
}
|
|
76
|
-
&.ivu-menu-item-active,&.ivu-menu-item-selected{
|
|
77
|
-
background: rgba(255,255,255,0.2);
|
|
78
|
-
color: var(--heading-color-dark,@_heading-color-dark);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
</style>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="pro-layout-tools-wrapper">
|
|
3
|
-
<LamboProLayoutToolsUser></LamboProLayoutToolsUser>
|
|
4
|
-
</div>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
import LamboProLayoutToolsUser from './pro-layout-tools-user'
|
|
9
|
-
export default {
|
|
10
|
-
name: "pro-layout-tools",
|
|
11
|
-
components: {
|
|
12
|
-
LamboProLayoutToolsUser
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<style scoped lang="less">
|
|
18
|
-
.pro-layout-tools-wrapper{
|
|
19
|
-
margin-right: 15px;
|
|
20
|
-
}
|
|
21
|
-
</style>
|