@lambo-design/pro-layout 1.0.0-beta.44 → 1.0.0-beta.441
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 +398 -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 +564 -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 +82 -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 +109 -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} +115 -22
- package/src/index.vue +302 -38
- 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
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="pro-layout-tools-quick-search">
|
|
3
|
+
<Tooltip :content="t('pro-layout.header.search-menu')" placement="bottom">
|
|
4
|
+
<Icon v-show="showSearchIcon" @click="handleIconClick" type="ios-search-outline" size="16" style="cursor: pointer" id="searchIcon"/>
|
|
5
|
+
</Tooltip>
|
|
6
|
+
<transition name="slide">
|
|
7
|
+
<div class="topInput" id="modalTopInput" v-show="showTopInput" @click="handleTopInput">
|
|
8
|
+
<Input v-model="searchTopText" clearable :placeholder="t('pro-layout.header.search-menu')" ref="topInput"
|
|
9
|
+
:border="false" style="width: 200px;" @on-clear="handleTopInput"
|
|
10
|
+
@on-change="handleTopInput" @on-blur="handleTopBlur">
|
|
11
|
+
<template #prefix>
|
|
12
|
+
<Icon type="ios-search" size="23"/>
|
|
13
|
+
</template>
|
|
14
|
+
</Input>
|
|
15
|
+
</div>
|
|
16
|
+
</transition>
|
|
17
|
+
<Modal v-model="searchTopModal" class="quick-search-fast-con-modal" footer-hide :closable="false" :mask="false" id="topModalId"
|
|
18
|
+
:styles="{top: '55px',width: '420px',float:'right'}">
|
|
19
|
+
<div v-if="spinShowTop">
|
|
20
|
+
<Spin size="large" v-if="spinShowTop" :show="spinShowTop">
|
|
21
|
+
<Icon type="ios-loading" size=18 class="demo-spin-icon-load"></Icon>
|
|
22
|
+
<div>{{ t('pro-layout.header.search-loading') }}</div>
|
|
23
|
+
</Spin>
|
|
24
|
+
</div>
|
|
25
|
+
<div v-else class="modal-content">
|
|
26
|
+
<Tabs value="menu" :animated="false" @on-click="tabLabel" style="width:100%;height:100%">
|
|
27
|
+
<TabPane :label="t('pro-layout.header.search-type-menu')" name="menu">
|
|
28
|
+
<div v-if="tab==='menu'">
|
|
29
|
+
<div v-for="(item,index) in menuData" :key="index">
|
|
30
|
+
<div class="menu-style" @click="handleMenuClick(item)">
|
|
31
|
+
<Icon :type="item.icon"/>
|
|
32
|
+
<span class="label-style">{{ item.label }}</span>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</TabPane>
|
|
37
|
+
<TabPane :label="t('pro-layout.header.search-type-notice')" name="notice">
|
|
38
|
+
<div v-if="tab==='notice'">
|
|
39
|
+
<div v-for="(item,index) in noticeData" :key="index">
|
|
40
|
+
<div class="menu-style" @click="handleNoticeClick(item)">
|
|
41
|
+
<Icon :type="item.icon"/>
|
|
42
|
+
<span class="label-style">{{ item.noticeTitle }}</span>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</TabPane>
|
|
47
|
+
<TabPane :label="t('pro-layout.header.search-type-message')" name="message">
|
|
48
|
+
<div v-if="tab==='message'">
|
|
49
|
+
<div v-for="(item,index) in messageData" :key="index">
|
|
50
|
+
<div class="menu-style" @click="handleMessageClick(item)">
|
|
51
|
+
<Icon :type="item.icon"/>
|
|
52
|
+
<span class="label-style">{{ item.noticeTitle }}</span>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</TabPane>
|
|
57
|
+
</Tabs>
|
|
58
|
+
|
|
59
|
+
<Row type="flex" align="middle" justify="center" class="more" >
|
|
60
|
+
<Col><a @click="searchMore">{{ t('pro-layout.header.search-more') }}</a></Col>
|
|
61
|
+
</Row>
|
|
62
|
+
<div v-if="menuData.length === 0">
|
|
63
|
+
<span class="no-result">{{ t('pro-layout.header.search-no-data') }}</span>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</Modal>
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<script>
|
|
71
|
+
import Bus from '@lambo-design/shared/utils/bus'
|
|
72
|
+
import {arraysEqual, getAllElements, getSessionStorage} from '@lambo-design/shared/utils/platform'
|
|
73
|
+
import { mapActions } from 'vuex'
|
|
74
|
+
import generatorMenuList from "@lambo-design/shared/utils/menu";
|
|
75
|
+
import Locale from "@lambo-design/core/src/mixins/locale";
|
|
76
|
+
|
|
77
|
+
export default {
|
|
78
|
+
name: 'pro-layout-tools-quick-search',
|
|
79
|
+
mixins: [Locale],
|
|
80
|
+
data() {
|
|
81
|
+
return {
|
|
82
|
+
menuList: [],
|
|
83
|
+
showSearchIcon:true,
|
|
84
|
+
searchTopModal:false,
|
|
85
|
+
searchTopText:'',
|
|
86
|
+
showTopInput:false,
|
|
87
|
+
spinShowTop:false,
|
|
88
|
+
menuData:[],
|
|
89
|
+
tab:'menu',
|
|
90
|
+
noticeData:[],
|
|
91
|
+
messageData:[],
|
|
92
|
+
perSearchMap:new Map(),
|
|
93
|
+
originalAllMenuList:[]
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
watch:{
|
|
97
|
+
searchTopText(keyword){
|
|
98
|
+
if (this.tab === 'notice'){
|
|
99
|
+
this.perSearchMap.set('notice',keyword)
|
|
100
|
+
Bus.$emit('change-search-keyword',keyword,this.tab)
|
|
101
|
+
}else if (this.tab === 'message'){
|
|
102
|
+
Bus.$emit('change-search-keyword',keyword,this.tab)
|
|
103
|
+
this.perSearchMap.set('message',keyword)
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
tab(val){
|
|
107
|
+
if (val === 'notice' && this.perSearchMap.get('notice') !== this.searchTopText){
|
|
108
|
+
this.perSearchMap.set('notice',this.searchTopText)
|
|
109
|
+
Bus.$emit('change-search-tab',this.searchTopText,val)
|
|
110
|
+
}else if (val === 'message' && this.perSearchMap.get('message') !== this.searchTopText){
|
|
111
|
+
Bus.$emit('change-search-tab',this.searchTopText,val)
|
|
112
|
+
this.perSearchMap.set('message',this.searchTopText)
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
methods: {
|
|
117
|
+
...mapActions([
|
|
118
|
+
'getNoticeListData'
|
|
119
|
+
]),
|
|
120
|
+
initListener() {
|
|
121
|
+
Bus.$on('other-datas',(data)=>{
|
|
122
|
+
this.initNoticeAndMessage(data)
|
|
123
|
+
});
|
|
124
|
+
Bus.$on('origin-all-menu-list',(data)=>{
|
|
125
|
+
this.initCanSearchMenu(data)
|
|
126
|
+
})
|
|
127
|
+
},
|
|
128
|
+
destroyListener() {
|
|
129
|
+
Bus.$off('other-datas')
|
|
130
|
+
Bus.$off('origin-all-menu-list')
|
|
131
|
+
},
|
|
132
|
+
initNoticeAndMessage(data){
|
|
133
|
+
if (data){
|
|
134
|
+
if(data.noticeList && data.noticeList.length > 0){
|
|
135
|
+
this.noticeData = data.noticeList
|
|
136
|
+
}
|
|
137
|
+
if (data.messageList && data.messageList.length > 0){
|
|
138
|
+
this.messageData = data.messageList
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
initCanSearchMenu(data){
|
|
143
|
+
if (arraysEqual(this.originalAllMenuList, data)) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
let appList = getSessionStorage('appList')
|
|
147
|
+
let appIds = '';
|
|
148
|
+
let appIdList = [];
|
|
149
|
+
if (appList && appList.length > 0) {
|
|
150
|
+
for(let app of appList) {
|
|
151
|
+
appIdList.push(app.appId);
|
|
152
|
+
}
|
|
153
|
+
appIds = appIdList.join(",");
|
|
154
|
+
}
|
|
155
|
+
let treeMenuList = generatorMenuList(data,appIds,'menu');
|
|
156
|
+
let result = []
|
|
157
|
+
getAllElements(treeMenuList,result)
|
|
158
|
+
this.originalAllMenuList = data;
|
|
159
|
+
this.menuList = data.filter(menuItem => menuItem.type == '2' && menuItem.permissionId && result.includes(menuItem.permissionId))
|
|
160
|
+
},
|
|
161
|
+
filterMenu(){
|
|
162
|
+
if (this.searchTopText){
|
|
163
|
+
const regex = new RegExp(this.searchTopText, "i");
|
|
164
|
+
this.menuData = this.menuList.filter(menuItem => {
|
|
165
|
+
return menuItem.label.match(regex) && menuItem.type === 2;
|
|
166
|
+
});
|
|
167
|
+
return
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
async handleTopInput(){
|
|
171
|
+
this.searchTopModal = true
|
|
172
|
+
this.spinShowTop = true
|
|
173
|
+
if (this.tab === 'menu'){
|
|
174
|
+
this.filterMenu()
|
|
175
|
+
}
|
|
176
|
+
this.spinShowTop = false
|
|
177
|
+
},
|
|
178
|
+
handleTopBlur(){
|
|
179
|
+
this.searchTopModal = false
|
|
180
|
+
this.showTopInput = false
|
|
181
|
+
this.showSearchIcon = true
|
|
182
|
+
},
|
|
183
|
+
handleIconClick(){
|
|
184
|
+
this.showTopInput = true
|
|
185
|
+
this.showSearchIcon = false
|
|
186
|
+
this.searchTopModal = true
|
|
187
|
+
},
|
|
188
|
+
handleOutsideClick(event) {
|
|
189
|
+
if(document.getElementById("topModalId") && !document.getElementById("topModalId").contains(event.target)
|
|
190
|
+
&& document.getElementById("modalTopInput") && !document.getElementById("modalTopInput").contains(event.target)
|
|
191
|
+
&& document.getElementById("searchIcon") && !document.getElementById("searchIcon").contains(event.target)){
|
|
192
|
+
let clearButton = event.target.closest(".ivu-icon-ios-close-circle");
|
|
193
|
+
if (event.target.parentNode) {
|
|
194
|
+
if(clearButton){
|
|
195
|
+
this.searchTopModal = true;
|
|
196
|
+
this.showTopInput = true;
|
|
197
|
+
this.showSearchIcon = false;
|
|
198
|
+
} else {
|
|
199
|
+
setTimeout(() => {
|
|
200
|
+
this.searchTopModal = false;
|
|
201
|
+
this.showTopInput = false;
|
|
202
|
+
this.showSearchIcon = true
|
|
203
|
+
}, 525);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
handleMenuClick(item){
|
|
209
|
+
Bus.$emit('select-menu',item.name,item)
|
|
210
|
+
},
|
|
211
|
+
handleNoticeClick(item){
|
|
212
|
+
Bus.$emit('other-operate','select-notice',item.noticeId)
|
|
213
|
+
},
|
|
214
|
+
handleMessageClick(item){
|
|
215
|
+
Bus.$emit('other-operate','select-message',item.noticeId)
|
|
216
|
+
},
|
|
217
|
+
searchMore(){
|
|
218
|
+
this.searchTopModal = false
|
|
219
|
+
this.showTopInput = false
|
|
220
|
+
this.showSearchIcon = true
|
|
221
|
+
Bus.$emit('other-operate','search-more',this.searchTopText)
|
|
222
|
+
},
|
|
223
|
+
async tabLabel(e){
|
|
224
|
+
this.tab = e
|
|
225
|
+
if (e === 'menu') {
|
|
226
|
+
this.filterMenu()
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
created() {
|
|
231
|
+
this.initListener()
|
|
232
|
+
},
|
|
233
|
+
mounted() {
|
|
234
|
+
window.addEventListener("click", this.handleOutsideClick);
|
|
235
|
+
},
|
|
236
|
+
beforeDestroy() {
|
|
237
|
+
this.destroyListener()
|
|
238
|
+
window.removeEventListener("click", this.handleOutsideClick);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
</script>
|
|
242
|
+
<style lang="less" scoped>
|
|
243
|
+
.pro-layout-tools-quick-search{
|
|
244
|
+
.topInput{
|
|
245
|
+
float: right;
|
|
246
|
+
position: relative;
|
|
247
|
+
z-index: 1000;
|
|
248
|
+
margin-top: 0px;
|
|
249
|
+
margin-left: 10px;
|
|
250
|
+
}
|
|
251
|
+
.slide-enter-active,
|
|
252
|
+
.slide-leave-active{
|
|
253
|
+
transition: transform 0.5s;
|
|
254
|
+
}
|
|
255
|
+
.slide-enter{
|
|
256
|
+
transform: translateX(100%);
|
|
257
|
+
}
|
|
258
|
+
.slide-leave-to{
|
|
259
|
+
transform: translateX(175px);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
</style>
|
|
263
|
+
<style lang="less">
|
|
264
|
+
@import '@lambo-design/core/src/styles/default.less';
|
|
265
|
+
.quick-search-fast-con-modal {
|
|
266
|
+
.ivu-modal-body{
|
|
267
|
+
position: relative;
|
|
268
|
+
padding: 16px 16px 40px 16px;
|
|
269
|
+
font-size: var(--font-size-base, 14px);
|
|
270
|
+
line-height: 1.5;
|
|
271
|
+
}
|
|
272
|
+
.modal-content {
|
|
273
|
+
height: 300px;
|
|
274
|
+
overflow-x: hidden;
|
|
275
|
+
overflow-y: auto;
|
|
276
|
+
-ms-overflow-style: none; /* Internet Explorer 10+ */
|
|
277
|
+
scrollbar-width: none; /* Firefox */
|
|
278
|
+
&::-webkit-scrollbar {
|
|
279
|
+
display: none; /* Chrome, Safari 和 Opera */
|
|
280
|
+
}
|
|
281
|
+
.menu-style {
|
|
282
|
+
margin : 5px;
|
|
283
|
+
font-size : 16px;
|
|
284
|
+
display : inline-block;
|
|
285
|
+
cursor : pointer;
|
|
286
|
+
&:hover{
|
|
287
|
+
color: var(--primary-color,@_primary-color);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
.label-style {
|
|
291
|
+
height : 13px;
|
|
292
|
+
font-size : 14px;
|
|
293
|
+
font-weight : 500;
|
|
294
|
+
margin-left : 5px;
|
|
295
|
+
line-height : 18px;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
.more{
|
|
300
|
+
position: absolute;
|
|
301
|
+
bottom: 0;
|
|
302
|
+
width: 100%;
|
|
303
|
+
padding: 10px 0;
|
|
304
|
+
}
|
|
305
|
+
</style>
|
package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-todo.vue
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="pro-layout-tools-quick-todo">
|
|
3
|
+
<Dropdown >
|
|
4
|
+
<Badge :count="todoDatas.length" class-name="badge-count">
|
|
5
|
+
<Icon type="ios-alarm-outline" size="18" style="cursor: pointer"/>
|
|
6
|
+
</Badge>
|
|
7
|
+
<template #list>
|
|
8
|
+
<DropdownMenu slot="list" class="todo-dropdown-menu">
|
|
9
|
+
<DropdownItem v-for="(item, index) in displayedTodos" :key="index" class="dropdown-item" @click.native="getDetail(item)" >
|
|
10
|
+
<div class="item-title" :title="item.procName">
|
|
11
|
+
{{ item.procName }}
|
|
12
|
+
</div>
|
|
13
|
+
<div class="item-time">
|
|
14
|
+
{{ formatTimestamp(item.createTime,'YYYY-MM-DD HH:mm:ss') }}
|
|
15
|
+
</div>
|
|
16
|
+
<div class="item-des">
|
|
17
|
+
{{ item.busKeyDes }}
|
|
18
|
+
</div>
|
|
19
|
+
</DropdownItem>
|
|
20
|
+
<div class="dropdown-footer" :class="[todoDatas.length == 0 ? 'no-line' : '']">
|
|
21
|
+
<Button type="text" v-if="todoDatas.length > 0" @click="getMore" >{{ t('pro-layout.header.todo-more') }}</Button>
|
|
22
|
+
<div class="no-data" v-if="todoDatas.length == 0" >{{ t('pro-layout.header.todo-no-data') }}</div>
|
|
23
|
+
</div>
|
|
24
|
+
</DropdownMenu>
|
|
25
|
+
</template>
|
|
26
|
+
</Dropdown>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script>
|
|
31
|
+
import Bus from '@lambo-design/shared/utils/bus';
|
|
32
|
+
import {deepCopy} from '@lambo-design/shared/utils/assist';
|
|
33
|
+
import {formatTimestamp} from '@lambo-design/shared/utils/date'
|
|
34
|
+
import Locale from "@lambo-design/core/src/mixins/locale";
|
|
35
|
+
|
|
36
|
+
export default {
|
|
37
|
+
name: "pro-layout-tools-quick-todo",
|
|
38
|
+
mixins: [Locale],
|
|
39
|
+
data() {
|
|
40
|
+
return {
|
|
41
|
+
formatTimestamp: formatTimestamp,
|
|
42
|
+
todoDatas:[],
|
|
43
|
+
displayedTodos:[]
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
methods: {
|
|
47
|
+
initListener() {
|
|
48
|
+
Bus.$on('other-datas',(data) => {
|
|
49
|
+
this.initTodoList(data);
|
|
50
|
+
})
|
|
51
|
+
},
|
|
52
|
+
destroyListener() {
|
|
53
|
+
Bus.$off('other-datas')
|
|
54
|
+
},
|
|
55
|
+
initTodoList(data) {
|
|
56
|
+
if (data && data.todoDatas) {
|
|
57
|
+
this.todoDatas = deepCopy(data.todoDatas);
|
|
58
|
+
this.displayedTodos = this.todoDatas.slice(0, 10);
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
getDetail(item){
|
|
62
|
+
Bus.$emit('other-operate','todo-detail',item)
|
|
63
|
+
},
|
|
64
|
+
getMore() {
|
|
65
|
+
Bus.$emit('other-operate','todo-more')
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
created() {
|
|
69
|
+
this.initListener()
|
|
70
|
+
},
|
|
71
|
+
beforeDestroy() {
|
|
72
|
+
this.destroyListener()
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
</script>
|
|
76
|
+
|
|
77
|
+
<style lang="less">
|
|
78
|
+
@import "@lambo-design/core/src/styles/default";
|
|
79
|
+
.pro-layout-tools-quick-todo{
|
|
80
|
+
.badge-count{
|
|
81
|
+
top:12px;
|
|
82
|
+
height: 10px;
|
|
83
|
+
line-height: 8px;
|
|
84
|
+
min-width: 8px;
|
|
85
|
+
padding: 0;
|
|
86
|
+
font-size: 8px;
|
|
87
|
+
width: 10px;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
.todo-dropdown-menu {
|
|
91
|
+
max-height: 300px;
|
|
92
|
+
width: 300px;
|
|
93
|
+
overflow-y: auto;
|
|
94
|
+
&::-webkit-scrollbar {
|
|
95
|
+
width: 0;
|
|
96
|
+
height: 0;
|
|
97
|
+
}
|
|
98
|
+
.dropdown-item {
|
|
99
|
+
overflow: hidden;
|
|
100
|
+
padding: 8px;
|
|
101
|
+
display: flex;
|
|
102
|
+
flex-wrap: wrap;
|
|
103
|
+
align-items: flex-start;
|
|
104
|
+
.item-title{
|
|
105
|
+
font-family: "黑体", Arial, sans-serif;
|
|
106
|
+
margin-left: 5px;
|
|
107
|
+
flex: 1 0 auto;
|
|
108
|
+
width: 100%;
|
|
109
|
+
margin-right: auto;
|
|
110
|
+
white-space:nowrap;
|
|
111
|
+
overflow:hidden;
|
|
112
|
+
text-overflow: ellipsis;
|
|
113
|
+
}
|
|
114
|
+
.item-time{
|
|
115
|
+
font-family: "黑体", Arial, sans-serif;
|
|
116
|
+
font-weight: normal;
|
|
117
|
+
flex: 0 0 auto;
|
|
118
|
+
margin-top: 3px;
|
|
119
|
+
margin-left: auto;
|
|
120
|
+
color: #808695;
|
|
121
|
+
}
|
|
122
|
+
.item-des{
|
|
123
|
+
flex: 1 0 80%;
|
|
124
|
+
height: auto;
|
|
125
|
+
margin: 3px 20px 0;
|
|
126
|
+
font-size: 12px;
|
|
127
|
+
color: #808695;
|
|
128
|
+
white-space: normal;
|
|
129
|
+
word-wrap: break-word;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
.dropdown-footer{
|
|
133
|
+
line-height: 24px;
|
|
134
|
+
border-top: 1px solid var(--layout-sider-line-color,@_layout-sider-line-color);
|
|
135
|
+
padding: 8px;
|
|
136
|
+
text-align: center;
|
|
137
|
+
&.no-line{
|
|
138
|
+
border: 0;
|
|
139
|
+
}
|
|
140
|
+
.no-data{
|
|
141
|
+
text-align: center;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
</style>
|
package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-user.vue
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="user-avatar-dropdown">
|
|
3
|
+
<Dropdown @on-click="handleClick" :transfer="false">
|
|
4
|
+
<span>{{ t('pro-layout.header.user-welcome') }},{{ userInfo.userName }}</span>
|
|
5
|
+
<Icon v-if="userInfo.dropList.length > 0" type="ios-arrow-down"/>
|
|
6
|
+
<DropdownMenu v-if="userInfo.dropList.length > 0" slot="list">
|
|
7
|
+
<DropdownItem v-if="userInfo.dropList.includes('theme')" name="theme"><span>{{ t('pro-layout.header.user-change-theme') }}</span></DropdownItem>
|
|
8
|
+
<DropdownItem v-if="userInfo.dropList.includes('showTheme')" name="showTheme"><span>{{ t('pro-layout.header.user-custom-theme') }}</span></DropdownItem>
|
|
9
|
+
<DropdownItem v-if="userInfo.dropList.includes('personalCenter')" name="personalCenter"><span>{{ t('pro-layout.header.user-person-center') }}</span></DropdownItem>
|
|
10
|
+
<DropdownItem v-if="userInfo.dropList.includes('noticeList')" name="noticeList"><span>{{ t('pro-layout.header.user-notice') }}</span></DropdownItem>
|
|
11
|
+
<DropdownItem v-if="userInfo.dropList.includes('logout')" name="logout"><span>{{ t('pro-layout.header.user-logout') }}</span></DropdownItem>
|
|
12
|
+
</DropdownMenu>
|
|
13
|
+
</Dropdown>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
import Bus from '@lambo-design/shared/utils/bus'
|
|
19
|
+
import Locale from "@lambo-design/core/src/mixins/locale";
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
name: 'pro-layout-tools-user',
|
|
23
|
+
mixins: [Locale],
|
|
24
|
+
data() {
|
|
25
|
+
return {
|
|
26
|
+
userInfo: {
|
|
27
|
+
userName: this.t('pro-layout.header.user-default-name'),
|
|
28
|
+
dropList: ['theme', 'personalCenter', 'noticeList', 'logout'],
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
methods: {
|
|
33
|
+
initListener() {
|
|
34
|
+
Bus.$on('user-info', (data) => {
|
|
35
|
+
this.handleUser(data)
|
|
36
|
+
})
|
|
37
|
+
},
|
|
38
|
+
destroyListener() {
|
|
39
|
+
Bus.$off('user-info')
|
|
40
|
+
},
|
|
41
|
+
handleUser(data) {
|
|
42
|
+
this.userInfo = Object.assign(this.userInfo, data)
|
|
43
|
+
},
|
|
44
|
+
handleClick(name) {
|
|
45
|
+
Bus.$emit('user-action', name)
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
created() {
|
|
49
|
+
this.initListener()
|
|
50
|
+
},
|
|
51
|
+
beforeDestroy() {
|
|
52
|
+
this.destroyListener()
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
</script>
|
|
56
|
+
<style lang="less" scoped>
|
|
57
|
+
@import '@lambo-design/core/src/styles/default.less';
|
|
58
|
+
.user-avatar-dropdown {
|
|
59
|
+
float: left;
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
vertical-align: middle;
|
|
62
|
+
font-size: var(--font-size-base, @_font-size-base);
|
|
63
|
+
}
|
|
64
|
+
</style>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="pro-layout-tools-wrapper">
|
|
3
|
+
<slot name="pro-layout-icons">
|
|
4
|
+
<LamboProLayoutToolsQuickIcons v-show="showToolsQuickIcons">
|
|
5
|
+
<template slot="pro-layout-custom-icons">
|
|
6
|
+
<slot name="pro-layout-custom-icons"></slot>
|
|
7
|
+
</template>
|
|
8
|
+
</LamboProLayoutToolsQuickIcons>
|
|
9
|
+
</slot>
|
|
10
|
+
<slot name="pro-layout-user">
|
|
11
|
+
<LamboProLayoutToolsUser></LamboProLayoutToolsUser>
|
|
12
|
+
</slot>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
import LamboProLayoutToolsQuickIcons from './components/pro-layout-tools-quick-icons'
|
|
18
|
+
import LamboProLayoutToolsUser from './components/pro-layout-tools-user'
|
|
19
|
+
export default {
|
|
20
|
+
name: "pro-layout-tools",
|
|
21
|
+
components: {
|
|
22
|
+
LamboProLayoutToolsQuickIcons,
|
|
23
|
+
LamboProLayoutToolsUser
|
|
24
|
+
},
|
|
25
|
+
props: {
|
|
26
|
+
showToolsQuickIcons: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: true
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
}
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<style scoped lang="less">
|
|
35
|
+
.pro-layout-tools-wrapper{
|
|
36
|
+
margin-right: 15px;
|
|
37
|
+
}
|
|
38
|
+
</style>
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<a @click="handleChange" type="text" :class="['sider-trigger-a', collapsed ? 'collapsed' : '']">
|
|
3
|
+
<Icon type="md-menu" size="26" v-show="hideMenuLogo" />
|
|
4
|
+
</a>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import Bus from '@lambo-design/shared/utils/bus'
|
|
9
|
+
export default {
|
|
10
|
+
name: "pro-layout-trigger",
|
|
11
|
+
props:{
|
|
12
|
+
hideMenuLogo: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default:true
|
|
15
|
+
},
|
|
16
|
+
menuScalingStatus: {
|
|
17
|
+
type: String,
|
|
18
|
+
default:'1'
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
data(){
|
|
22
|
+
return {
|
|
23
|
+
collapsed: false
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
created(){
|
|
27
|
+
this.initCollapsed();
|
|
28
|
+
this.initListener();
|
|
29
|
+
},
|
|
30
|
+
beforeDestroy(){
|
|
31
|
+
this.destroyListener();
|
|
32
|
+
},
|
|
33
|
+
watch: {
|
|
34
|
+
menuScalingStatus(val) {
|
|
35
|
+
this.initCollapsed();
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
methods: {
|
|
39
|
+
initListener(){
|
|
40
|
+
Bus.$on('trigger-change-icon',(data)=>{
|
|
41
|
+
this.collapsed = data
|
|
42
|
+
Bus.$emit('trigger-change', data)
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
destroyListener(){
|
|
46
|
+
Bus.$off('trigger-change-icon')
|
|
47
|
+
},
|
|
48
|
+
handleChange(){
|
|
49
|
+
this.collapsed = !this.collapsed
|
|
50
|
+
Bus.$emit('trigger-change', this.collapsed)
|
|
51
|
+
},
|
|
52
|
+
initCollapsed(){
|
|
53
|
+
if(this.menuScalingStatus==='0'){
|
|
54
|
+
this.collapsed=true
|
|
55
|
+
}
|
|
56
|
+
Bus.$emit('trigger-change', this.collapsed)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<style scoped lang="less">
|
|
63
|
+
.trans{
|
|
64
|
+
transition: transform .2s ease;
|
|
65
|
+
}
|
|
66
|
+
@size: 64px;
|
|
67
|
+
.sider-trigger-a{
|
|
68
|
+
float: left;
|
|
69
|
+
padding: 6px;
|
|
70
|
+
width: @size;
|
|
71
|
+
height: @size;
|
|
72
|
+
display: inline-block;
|
|
73
|
+
text-align: center;
|
|
74
|
+
margin-top: 12px;
|
|
75
|
+
i{
|
|
76
|
+
.trans;
|
|
77
|
+
vertical-align: top;
|
|
78
|
+
}
|
|
79
|
+
&.collapsed i{
|
|
80
|
+
transform: rotateZ(90deg);
|
|
81
|
+
.trans;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
</style>
|