@lambo-design/pro-layout 1.0.0-beta.185 → 1.0.0-beta.187
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 +17 -17
- package/src/components/pro-layout-nav.vue +95 -76
- package/src/components/pro-layout-sider.vue +3 -45
- package/src/index.vue +6 -0
- package/src/components/search-menu.vue +0 -477
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@lambo-design/pro-layout",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"@lambo-design/
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@lambo-design/pro-layout",
|
|
3
|
+
"version": "1.0.0-beta.187",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"author": "lambo",
|
|
7
|
+
"license": "ISC",
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public",
|
|
10
|
+
"registry": "https://registry.npmjs.org/"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"@lambo-design/core": "^4.7.1-beta.114",
|
|
14
|
+
"@lambo-design/shared": "^1.0.0-beta.101"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {}
|
|
17
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div class="pro-layout-nav-wrapper">
|
|
3
3
|
<Menu ref="topNav" mode="horizontal" theme="dark" :active-name="activeName" @on-select="selectApp">
|
|
4
4
|
<MenuItem :name="item.appId" v-for="item in topMenList" :key="item.appId">
|
|
5
|
-
{{item.name}}
|
|
5
|
+
{{ item.name }}
|
|
6
6
|
<div class="line"></div>
|
|
7
7
|
</MenuItem>
|
|
8
8
|
<Submenu name="other" v-if="otherList.length > 0">
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
...
|
|
11
11
|
</template>
|
|
12
12
|
<MenuItem :name="item.appId" v-for="item in otherList" :key="item.appId">
|
|
13
|
-
{{item.name}}
|
|
13
|
+
{{ item.name }}
|
|
14
14
|
</MenuItem>
|
|
15
15
|
</Submenu>
|
|
16
16
|
</Menu>
|
|
@@ -18,123 +18,138 @@
|
|
|
18
18
|
</template>
|
|
19
19
|
|
|
20
20
|
<script>
|
|
21
|
-
import Bus from
|
|
22
|
-
import {deepCopy} from
|
|
23
|
-
import config from
|
|
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
24
|
|
|
25
25
|
export default {
|
|
26
|
-
name:
|
|
27
|
-
props:{
|
|
26
|
+
name: 'pro-layout-',
|
|
27
|
+
props: {
|
|
28
28
|
acceptAppId: {
|
|
29
29
|
type: String,
|
|
30
30
|
default: ''
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
|
-
data(){
|
|
33
|
+
data() {
|
|
34
34
|
return {
|
|
35
|
-
navList
|
|
36
|
-
topMenList
|
|
37
|
-
otherList
|
|
38
|
-
activeName
|
|
39
|
-
topMenuNum
|
|
35
|
+
navList: [],
|
|
36
|
+
topMenList: [],
|
|
37
|
+
otherList: [],
|
|
38
|
+
activeName: '',
|
|
39
|
+
topMenuNum: 4,
|
|
40
|
+
lastTopMenuNum:-1,
|
|
40
41
|
originMenuList: []
|
|
41
42
|
}
|
|
42
43
|
},
|
|
43
44
|
methods: {
|
|
44
|
-
initListener(){
|
|
45
|
-
Bus.$on('
|
|
45
|
+
initListener() {
|
|
46
|
+
Bus.$on('top-menu-num', (data) => {
|
|
47
|
+
this.initTopMenuNum(data)
|
|
48
|
+
})
|
|
49
|
+
Bus.$on('nav-list', (data) => {
|
|
46
50
|
this.initNav(data)
|
|
47
|
-
})
|
|
48
|
-
Bus.$on('change-app', ({appId,appInfo})=> {
|
|
49
|
-
this.changeApp(appId,appInfo)
|
|
50
|
-
})
|
|
51
|
-
Bus.$on('menu-list',(data)=>{
|
|
51
|
+
})
|
|
52
|
+
Bus.$on('change-app', ({ appId, appInfo }) => {
|
|
53
|
+
this.changeApp(appId, appInfo)
|
|
54
|
+
})
|
|
55
|
+
Bus.$on('menu-list', (data) => {
|
|
52
56
|
this.initMenu(data)
|
|
53
|
-
})
|
|
57
|
+
})
|
|
58
|
+
|
|
54
59
|
},
|
|
55
|
-
destroyListener(){
|
|
60
|
+
destroyListener() {
|
|
56
61
|
Bus.$off('nav-list')
|
|
57
62
|
Bus.$off('menu-list')
|
|
58
63
|
Bus.$off('change-app')
|
|
64
|
+
Bus.$off('top-menu-num')
|
|
65
|
+
},
|
|
66
|
+
initTopMenuNum(data) {
|
|
67
|
+
this.topMenuNum = data
|
|
68
|
+
this.initNav(this.navList)
|
|
59
69
|
},
|
|
60
|
-
initNav(data){
|
|
61
|
-
if (data.toString() === this.navList.toString()) {
|
|
62
|
-
return
|
|
70
|
+
initNav(data) {
|
|
71
|
+
if (data.toString() === this.navList.toString() && this.topMenuNum === this.lastTopMenuNum) {
|
|
72
|
+
return
|
|
63
73
|
}
|
|
64
|
-
this.navList = data
|
|
74
|
+
this.navList = data
|
|
75
|
+
this.lastTopMenuNum = this.topMenuNum
|
|
65
76
|
if (data.length > this.topMenuNum) {
|
|
66
|
-
let navList = deepCopy(data)
|
|
67
|
-
this.topMenList = navList.splice(0,this.topMenuNum)
|
|
68
|
-
this.otherList = navList
|
|
77
|
+
let navList = deepCopy(data)
|
|
78
|
+
this.topMenList = navList.splice(0, this.topMenuNum)
|
|
79
|
+
this.otherList = navList
|
|
69
80
|
} else {
|
|
70
81
|
this.topMenList = this.navList
|
|
71
82
|
}
|
|
72
|
-
if (this.topMenList.length > 0){
|
|
73
|
-
let appId = this.topMenList[0].appId
|
|
83
|
+
if (this.topMenList.length > 0) {
|
|
84
|
+
let appId = this.topMenList[0].appId
|
|
74
85
|
for (let i = 0; i < this.topMenList.length; i++) {
|
|
75
|
-
if (this.topMenList[i].selected == true){
|
|
76
|
-
appId = this.topMenList[i].appId
|
|
86
|
+
if (this.topMenList[i].selected == true) {
|
|
87
|
+
appId = this.topMenList[i].appId
|
|
77
88
|
}
|
|
78
89
|
}
|
|
79
90
|
if (this.activeName) {
|
|
80
|
-
appId = this.activeName
|
|
91
|
+
appId = this.activeName
|
|
81
92
|
}
|
|
82
|
-
this.selectApp(appId)
|
|
93
|
+
this.selectApp(appId)
|
|
83
94
|
}
|
|
84
95
|
},
|
|
85
|
-
initMenu(data){
|
|
86
|
-
this.originMenuList = deepCopy(data)
|
|
96
|
+
initMenu(data) {
|
|
97
|
+
this.originMenuList = deepCopy(data)
|
|
87
98
|
//console.log('nav-list',this.originMenuList)
|
|
88
99
|
},
|
|
89
|
-
selectApp(appId){
|
|
90
|
-
this.activeName = appId
|
|
91
|
-
let res = this.navList.filter(app => app.appId == appId)
|
|
92
|
-
Bus.$emit('change-app', {appId,appInfo:res[0]})
|
|
100
|
+
selectApp(appId) {
|
|
101
|
+
this.activeName = appId
|
|
102
|
+
let res = this.navList.filter(app => app.appId == appId)
|
|
103
|
+
Bus.$emit('change-app', { appId, appInfo: res[0] })
|
|
93
104
|
},
|
|
94
|
-
changeApp(appId,appInfo) {
|
|
95
|
-
this.activeName = appId
|
|
105
|
+
changeApp(appId, appInfo) {
|
|
106
|
+
this.activeName = appId
|
|
96
107
|
this.$nextTick(() => {
|
|
97
108
|
this.$refs.topNav.updateActiveName()
|
|
98
109
|
})
|
|
99
110
|
}
|
|
100
111
|
},
|
|
101
112
|
watch: {
|
|
102
|
-
activeName(){
|
|
103
|
-
this.$nextTick(()=>{
|
|
104
|
-
this.$refs.topNav.updateActiveName()
|
|
113
|
+
activeName() {
|
|
114
|
+
this.$nextTick(() => {
|
|
115
|
+
this.$refs.topNav.updateActiveName()
|
|
105
116
|
})
|
|
106
117
|
},
|
|
107
118
|
acceptAppId(val) {
|
|
108
119
|
this.selectApp(val)
|
|
109
120
|
}
|
|
110
121
|
},
|
|
111
|
-
created(){
|
|
112
|
-
this.initListener()
|
|
122
|
+
created() {
|
|
123
|
+
this.initListener()
|
|
113
124
|
},
|
|
114
|
-
beforeDestroy(){
|
|
115
|
-
this.destroyListener()
|
|
125
|
+
beforeDestroy() {
|
|
126
|
+
this.destroyListener()
|
|
116
127
|
}
|
|
117
128
|
}
|
|
118
129
|
</script>
|
|
119
130
|
|
|
120
131
|
<style scoped lang="less">
|
|
121
132
|
@import '@lambo-design/core/src/styles/default.less';
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
.
|
|
128
|
-
|
|
133
|
+
|
|
134
|
+
.pro-layout-nav-wrapper {
|
|
135
|
+
.ivu-menu {
|
|
136
|
+
.ivu-menu-item {
|
|
137
|
+
&:hover {
|
|
138
|
+
background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 100%);
|
|
139
|
+
|
|
140
|
+
.line {
|
|
141
|
+
border-bottom: 3.35px solid var(--primary-color-tint-5, @_primary-color-tint-5);
|
|
129
142
|
position: absolute;
|
|
130
143
|
left: 0;
|
|
131
144
|
right: 0;
|
|
132
145
|
}
|
|
133
146
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
.
|
|
137
|
-
|
|
147
|
+
|
|
148
|
+
&.ivu-menu-item-active, &.ivu-menu-item-selected {
|
|
149
|
+
background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 100%);
|
|
150
|
+
|
|
151
|
+
.line {
|
|
152
|
+
border-bottom: 3.35px solid var(--primary-color-tint-5, @_primary-color-tint-5);
|
|
138
153
|
position: absolute;
|
|
139
154
|
left: 0;
|
|
140
155
|
right: 0;
|
|
@@ -142,26 +157,30 @@ export default {
|
|
|
142
157
|
}
|
|
143
158
|
}
|
|
144
159
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
160
|
+
|
|
161
|
+
/deep/ .ivu-menu-submenu {
|
|
162
|
+
.ivu-menu-submenu-title > i {
|
|
163
|
+
&.ivu-menu-submenu-title-icon {
|
|
148
164
|
|
|
149
165
|
}
|
|
150
166
|
}
|
|
151
167
|
|
|
152
|
-
.ivu-select-dropdown{
|
|
153
|
-
background: var(--menu-dark-title
|
|
154
|
-
color: var(--heading-color-dark
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
168
|
+
.ivu-select-dropdown {
|
|
169
|
+
background: var(--menu-dark-title, @_menu-dark-title);
|
|
170
|
+
color: var(--heading-color-dark, @_heading-color-dark);
|
|
171
|
+
|
|
172
|
+
.ivu-menu-drop-list {
|
|
173
|
+
.ivu-menu-item {
|
|
174
|
+
color: var(--menu-dark-subsidiary-color, @_menu-dark-subsidiary-color);
|
|
175
|
+
|
|
176
|
+
&:hover {
|
|
177
|
+
background: rgba(255, 255, 255, 0.2);
|
|
178
|
+
color: var(--heading-color-dark, @_heading-color-dark);
|
|
161
179
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
180
|
+
|
|
181
|
+
&.ivu-menu-item-active, &.ivu-menu-item-selected {
|
|
182
|
+
background: rgba(255, 255, 255, 0.2);
|
|
183
|
+
color: var(--heading-color-dark, @_heading-color-dark);
|
|
165
184
|
}
|
|
166
185
|
}
|
|
167
186
|
}
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
v-show="!collapsed"
|
|
39
39
|
style="margin-right: 35px; margin-left: 1px; padding-top: 1px"
|
|
40
40
|
:searchType="0"
|
|
41
|
-
@on-select="
|
|
41
|
+
@on-select="handleSelect"
|
|
42
42
|
></FastSearch>
|
|
43
43
|
<div v-show="collapsed" :list="menuList" class="menu-collapsed" >
|
|
44
44
|
<template v-for="item in menuList">
|
|
@@ -219,51 +219,11 @@ export default {
|
|
|
219
219
|
this.activeName = menu.name; // 设置当前菜单为激活状态
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
|
-
// this.$emit('on-select', name,uri,pid)
|
|
223
222
|
},
|
|
224
|
-
|
|
225
|
-
handleSelect1(name, uri, pid) {
|
|
226
|
-
let menu = null;
|
|
227
|
-
|
|
228
|
-
if (name.indexOf("isTurnByHref_") > -1) {
|
|
229
|
-
name = name.replace("isTurnByHref_","");
|
|
230
|
-
menu = filterMenuUri(this.menuList,name);
|
|
231
|
-
} else {
|
|
232
|
-
menu = filterMenuName(this.menuList,name);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
// 处理菜单的展开逻辑,与 uri 是否为空无关
|
|
236
|
-
if (menu && menu.meta && Array.isArray(menu.meta.crumbs)) {
|
|
237
|
-
let parentMenu = menu.meta.crumbs[0];
|
|
238
|
-
this.$set(this, 'selectedTopParent', parentMenu.name);
|
|
239
|
-
} else {
|
|
240
|
-
this.$set(this, 'selectedTopParent', menu.name);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
// 如果 uri 为空,则不进行路由跳转和打开新标签的操作
|
|
244
|
-
if (!uri) {
|
|
245
|
-
// 根据 pid 判断是展开父菜单还是同时展开父菜单和当前菜单
|
|
246
|
-
if (pid === 0) {
|
|
247
|
-
// 如果 pid 为 0,表示是最外层菜单
|
|
248
|
-
this.openedNames = [this.getNameOrHref(menu)]; // 设置最外层菜单为展开状态
|
|
249
|
-
} else {
|
|
250
|
-
// 如果 pid 不等于 0,查找并打开对应的最外层父菜单
|
|
251
|
-
this.openedNames = [this.getTopParent(menu)]; // 设置最外层父菜单为展开状态
|
|
252
|
-
this.activeName = menu.name; // 设置当前菜单为激活状态
|
|
253
|
-
}
|
|
254
|
-
} else {
|
|
255
|
-
// 如果 uri 不为空,则可能需要进行路由跳转和打开新标签的操作
|
|
256
|
-
// 这里的逻辑取决于你的路由跳转和标签页打开的实现,需要你根据实际情况进行调整
|
|
257
|
-
this.openedNames = [this.getTopParent(menu)]; // 设置最外层父菜单为展开状态
|
|
258
|
-
this.activeName = menu.name; // 设置当前菜单为激活状态
|
|
259
|
-
this.$router.push(uri);
|
|
260
|
-
|
|
261
|
-
}
|
|
262
|
-
},
|
|
263
|
-
|
|
264
|
-
|
|
265
223
|
getTopParent(menu) {
|
|
224
|
+
// console.log('getTopParent')
|
|
266
225
|
return menu.parent ? this.getTopParent(menu.parent) : menu.name;
|
|
226
|
+
// console.log('menu.parent',menu.name)
|
|
267
227
|
},
|
|
268
228
|
activeIconBackground(item) {
|
|
269
229
|
// console.log('activeBack')
|
|
@@ -293,8 +253,6 @@ export default {
|
|
|
293
253
|
this.activeName = current;
|
|
294
254
|
}
|
|
295
255
|
},
|
|
296
|
-
|
|
297
|
-
|
|
298
256
|
getOpenedNamesByActiveName(){
|
|
299
257
|
let res = filterMenuName(this.menuList,this.activeName);
|
|
300
258
|
let openNames = []
|
package/src/index.vue
CHANGED
|
@@ -44,6 +44,10 @@ export default {
|
|
|
44
44
|
type: String,
|
|
45
45
|
default:''
|
|
46
46
|
},
|
|
47
|
+
topMenuNum: {
|
|
48
|
+
type: Number,
|
|
49
|
+
default: 4
|
|
50
|
+
},
|
|
47
51
|
systemInfo: {
|
|
48
52
|
type: Object,
|
|
49
53
|
default: () => {
|
|
@@ -146,6 +150,7 @@ export default {
|
|
|
146
150
|
Bus.$on('tag-list',(data,current)=>{
|
|
147
151
|
this.changeTabs(data,current)
|
|
148
152
|
});
|
|
153
|
+
|
|
149
154
|
},
|
|
150
155
|
destroyListener(){
|
|
151
156
|
Bus.$off('trigger-change')
|
|
@@ -159,6 +164,7 @@ export default {
|
|
|
159
164
|
Bus.$emit('system-info',this.systemInfo)
|
|
160
165
|
Bus.$emit('user-info',this.userInfo)
|
|
161
166
|
Bus.$emit('nav-list',this.navList)
|
|
167
|
+
Bus.$emit('top-menu-num',this.topMenuNum)
|
|
162
168
|
this.menuList.map(item => {
|
|
163
169
|
// 如果 uri 不以 '/' 开头,添加 '/'
|
|
164
170
|
if (item.uri&&!item.uri.startsWith('/')) {
|
|
@@ -1,477 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="search-fast-con">
|
|
3
|
-
<div class="search-fast-con-top" >
|
|
4
|
-
<div class="topInput" id="modalTopInput" @click="handleTopClick">
|
|
5
|
-
<Input v-if="searchType === 1" v-model="searchTopText" clearable placeholder="搜索菜单" font-size="8px" ref="topInput"
|
|
6
|
-
:border="false" @on-change="handleTopInput" @on-blur="handleTopBlur">
|
|
7
|
-
<template #prefix>
|
|
8
|
-
<Icon type="ios-search" size="23"/>
|
|
9
|
-
</template>
|
|
10
|
-
</Input>
|
|
11
|
-
</div>
|
|
12
|
-
<Modal
|
|
13
|
-
v-model="searchTopModal" class="search-fast-con-modal" footer-hide :closable="false" :mask="false" scrollable id="TopModalId"
|
|
14
|
-
:styles="{top: '55px',width: '350px'}">
|
|
15
|
-
<div class="sideCloseIcon" @click="handleCloseTopModal" style="text-align: right;margin-right: -6px;margin-top: -2px;padding-bottom: 3px">
|
|
16
|
-
<Icon type="ios-close-circle" size="18" />
|
|
17
|
-
</div>
|
|
18
|
-
<div class="modal-block1">
|
|
19
|
-
<div class="modal-title">
|
|
20
|
-
<Icon type="ios-apps-outline" size="19" color="red"/>
|
|
21
|
-
<span style="margin-left: 3px;font-size: 18px">菜单</span>
|
|
22
|
-
</div>
|
|
23
|
-
<div v-if="spinShowTop1">
|
|
24
|
-
<Spin size="large" v-if="spinShowTop1" :show="spinShowTop1">
|
|
25
|
-
<Icon type="ios-loading" size=18 class="demo-spin-icon-load"></Icon>
|
|
26
|
-
<div>加载中</div>
|
|
27
|
-
</Spin>
|
|
28
|
-
</div>
|
|
29
|
-
<div v-else class="modal-content">
|
|
30
|
-
<div v-for="(item,index) in menuData1" :key="index" >
|
|
31
|
-
<div class="menu-side-style1" @click="handleSelect1(item)" @mouseenter="handleMouseEnter(index)" @mouseleave="handleMouseLeave(index)">
|
|
32
|
-
<div :style="getScrollingStyle(item.label)" class="text" :class="{ 'scrolling': isHovered[index] && shouldScroll(item.label) }">
|
|
33
|
-
<Icon :type="item.icon" />
|
|
34
|
-
<span style="margin-left: 3px">{{ item.label }}</span>
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
<div v-if="menuData1.length === 0">
|
|
39
|
-
<span style="display: flex;justify-content: center;align-items: center;color: black">暂无数据</span>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
</Modal>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
</template>
|
|
47
|
-
<script>
|
|
48
|
-
|
|
49
|
-
import SearchMenu from "./search-list";
|
|
50
|
-
import SearchList from "./search-list";
|
|
51
|
-
import Bus from "@lambo-design/shared/utils/bus";
|
|
52
|
-
import {deepCopy} from "@lambo-design/shared/utils/assist";
|
|
53
|
-
import config from "@lambo-design/shared/config/config";
|
|
54
|
-
import { mapActions } from 'vuex'
|
|
55
|
-
import { debounce } from 'lodash';
|
|
56
|
-
//import {getSessionStorage} from '@/libs/platformUtil';
|
|
57
|
-
export default {
|
|
58
|
-
name: "Searchmenu",
|
|
59
|
-
components: {SearchList, SearchMenu},
|
|
60
|
-
props: {
|
|
61
|
-
searchType: '',
|
|
62
|
-
menuList: {
|
|
63
|
-
type: Array,
|
|
64
|
-
default: () => []
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
data () {
|
|
68
|
-
return {
|
|
69
|
-
searchText:'',
|
|
70
|
-
appId:'',
|
|
71
|
-
searchTopText:'',
|
|
72
|
-
showTopInput:false,
|
|
73
|
-
option: [],
|
|
74
|
-
menuData:[],
|
|
75
|
-
menuData1:[],
|
|
76
|
-
noticeData:[],
|
|
77
|
-
isHovered: [],
|
|
78
|
-
select:'',
|
|
79
|
-
searchTopModal:false,
|
|
80
|
-
searchSideModal:false,
|
|
81
|
-
showSearchIcon:true,
|
|
82
|
-
maxWidth: 190,
|
|
83
|
-
spinShow:false,
|
|
84
|
-
spinShowTop1:false,
|
|
85
|
-
spinShowTop2:false,
|
|
86
|
-
originMenuList: [],
|
|
87
|
-
originMenuList1: []
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
// mounted() {
|
|
91
|
-
// window.addEventListener("click", this.handleOutsideClick);
|
|
92
|
-
// },
|
|
93
|
-
// beforeDestroy() {
|
|
94
|
-
// window.removeEventListener("click", this.handleOutsideClick);
|
|
95
|
-
// },
|
|
96
|
-
methods:{
|
|
97
|
-
initListener(){
|
|
98
|
-
// Bus.$on('menu-list',(data)=>{
|
|
99
|
-
this.initMenu(this.menuList)
|
|
100
|
-
// });
|
|
101
|
-
},
|
|
102
|
-
destroyListener(){
|
|
103
|
-
Bus.$off('menu-list')
|
|
104
|
-
},
|
|
105
|
-
initMenu(data){
|
|
106
|
-
this.originMenuList = deepCopy(data);
|
|
107
|
-
this.originMenuList1 = this.originMenuList.filter(function(menuItem) {
|
|
108
|
-
return menuItem.type === 1|| menuItem.type === 2 && menuItem.uri !=='';
|
|
109
|
-
});
|
|
110
|
-
this.menuData1=this.originMenuList1;
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
handleSelect(item){
|
|
114
|
-
console.log('search-handleSelect',item.name)
|
|
115
|
-
console.log('search-handleSelect',item.uri)
|
|
116
|
-
console.log('search-handleSelect',item.pid)
|
|
117
|
-
this.$emit('on-select', item.name,item.uri,item.pid)
|
|
118
|
-
this.searchSideModal = false
|
|
119
|
-
},
|
|
120
|
-
handleSelect1(item){
|
|
121
|
-
this.$emit('on-select', item.name,item.uri,item.pid)
|
|
122
|
-
this.searchTopModal = false
|
|
123
|
-
this.showTopInput = false
|
|
124
|
-
this.showSearchIcon = true
|
|
125
|
-
},
|
|
126
|
-
handleNoticeSelect(e,f){
|
|
127
|
-
let self = this
|
|
128
|
-
self.$router.replace({
|
|
129
|
-
name: '消息通知预览',
|
|
130
|
-
query: {noticeId: e, confirmed: f,homeFlag:true}
|
|
131
|
-
})
|
|
132
|
-
self.searchTopModal = false
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
handleTopInput() {
|
|
136
|
-
let self = this;
|
|
137
|
-
self.searchTopModal = true
|
|
138
|
-
// 使用 filter 方法找到所有匹配的菜单项
|
|
139
|
-
const regex = new RegExp(this.searchTopText, "i");
|
|
140
|
-
self.menuData1 = self.originMenuList1.filter(menuItem => {
|
|
141
|
-
return menuItem.label.match(regex);
|
|
142
|
-
});
|
|
143
|
-
//console.log('menuData:', self.menuData);
|
|
144
|
-
},
|
|
145
|
-
handleSideClick(){
|
|
146
|
-
let self= this
|
|
147
|
-
// console.log('searchText:'+self.searchText)
|
|
148
|
-
if(self.searchText){
|
|
149
|
-
self.searchSideModal = true
|
|
150
|
-
}
|
|
151
|
-
self.handleInput()
|
|
152
|
-
//self.handleSelect(self.menuData[0])
|
|
153
|
-
},
|
|
154
|
-
handleIconClick(){
|
|
155
|
-
let self = this
|
|
156
|
-
self.showTopInput = true
|
|
157
|
-
self.showSearchIcon = false
|
|
158
|
-
self.searchTopModal = false
|
|
159
|
-
},
|
|
160
|
-
handleTopClick(){
|
|
161
|
-
let self= this
|
|
162
|
-
if(self.searchTopText){
|
|
163
|
-
self.searchTopModal = true
|
|
164
|
-
}
|
|
165
|
-
self.handleTopInput()
|
|
166
|
-
self.showTopInput=true
|
|
167
|
-
//self.handleSelect(self.menuData[0])
|
|
168
|
-
},
|
|
169
|
-
handleTopBlur(){
|
|
170
|
-
let self = this
|
|
171
|
-
self.searchTopModal = false
|
|
172
|
-
self.showTopInput = true;
|
|
173
|
-
self.showSearchIcon = true
|
|
174
|
-
|
|
175
|
-
},
|
|
176
|
-
handleMouseEnter(index) {
|
|
177
|
-
this.$set(this.isHovered, index, true); // 将当前菜单项设置为被悬停状态
|
|
178
|
-
},
|
|
179
|
-
handleMouseLeave(index) {
|
|
180
|
-
this.$set(this.isHovered, index, false); // 将当前菜单项设置为非悬停状态
|
|
181
|
-
},
|
|
182
|
-
shouldScroll(text) {
|
|
183
|
-
const span = document.createElement("span");
|
|
184
|
-
span.style.fontSize = "15px"; // 根据实际情况设置字体大小
|
|
185
|
-
span.textContent = text;
|
|
186
|
-
document.body.appendChild(span);
|
|
187
|
-
const shouldScroll = span.offsetWidth > this.maxWidth;
|
|
188
|
-
document.body.removeChild(span);
|
|
189
|
-
return shouldScroll;
|
|
190
|
-
},
|
|
191
|
-
getScrollingStyle(text) {
|
|
192
|
-
const span = document.createElement("span");
|
|
193
|
-
span.style.fontSize = "15px"; // 根据实际情况设置字体大小
|
|
194
|
-
span.textContent = text;
|
|
195
|
-
document.body.appendChild(span);
|
|
196
|
-
let scrollDistance = span.offsetWidth - this.maxWidth;
|
|
197
|
-
document.body.removeChild(span);
|
|
198
|
-
if (scrollDistance > 0) {
|
|
199
|
-
scrollDistance += 15
|
|
200
|
-
return {
|
|
201
|
-
"--scroll-distance": `-${scrollDistance}px`,
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
else{
|
|
205
|
-
return{
|
|
206
|
-
"--scroll-duration": `0s`,
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
},
|
|
210
|
-
handleCloseModal(){
|
|
211
|
-
let self = this
|
|
212
|
-
this.searchSideModal = false
|
|
213
|
-
},
|
|
214
|
-
handleCloseTopModal(){
|
|
215
|
-
let self = this
|
|
216
|
-
this.searchTopModal = false
|
|
217
|
-
}
|
|
218
|
-
},
|
|
219
|
-
created(){
|
|
220
|
-
this.initListener();
|
|
221
|
-
},
|
|
222
|
-
beforeDestroy(){
|
|
223
|
-
this.destroyListener();
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
</script>
|
|
227
|
-
|
|
228
|
-
<style lang="less" >
|
|
229
|
-
@import "@lambo-design/shared/config/themes/blue/blue.less";
|
|
230
|
-
@import "@lambo-design/shared/config/themes/default/default.less";
|
|
231
|
-
@import "@lambo-design/shared/config/themes/gold/gold.less";
|
|
232
|
-
@import "@lambo-design/shared/config/themes/atrovirens/atrovirens.less";
|
|
233
|
-
@import "@lambo-design/shared/config/themes/eap/eap.less";
|
|
234
|
-
@import "@lambo-design/shared/config/themes/lime/lime.less";
|
|
235
|
-
@import "@lambo-design/shared/config/themes/orange/orange.less";
|
|
236
|
-
@import "@lambo-design/shared/config/themes/red/red.less";
|
|
237
|
-
.search-fast-con-top .ivu-tooltip-rel {
|
|
238
|
-
float: left;
|
|
239
|
-
height: 64px;
|
|
240
|
-
line-height: 56px;
|
|
241
|
-
margin-top: 3px;
|
|
242
|
-
margin-right: -1000px;
|
|
243
|
-
i {
|
|
244
|
-
cursor: pointer;
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
.ivu-tooltip-popper[x-placement^="bottom"]{
|
|
248
|
-
margin-top: -1000px;
|
|
249
|
-
}
|
|
250
|
-
.search-fast-con-modal .ivu-modal{
|
|
251
|
-
margin-right: 500px;
|
|
252
|
-
}
|
|
253
|
-
.search-fast-con-side-modal .ivu-modal{
|
|
254
|
-
padding-top: 1px;
|
|
255
|
-
margin-left: 0px;
|
|
256
|
-
margin-top: 1px;
|
|
257
|
-
}
|
|
258
|
-
.search-fast-con-side-modal .ivu-modal-content{
|
|
259
|
-
background-color: var(--menu-dark-active-bg ,@menu-dark-active-bg );
|
|
260
|
-
width: 218px;
|
|
261
|
-
margin-top: -18px;
|
|
262
|
-
height: 270px;
|
|
263
|
-
}
|
|
264
|
-
.search-fast-con-modal .ivu-modal-content{
|
|
265
|
-
width: 290px;
|
|
266
|
-
height: 200px;
|
|
267
|
-
margin-right: 1px;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
.modal-title{
|
|
271
|
-
font-family: Microsoft YaHei;
|
|
272
|
-
font-weight: 400;
|
|
273
|
-
color: #333333;
|
|
274
|
-
font-size: 17px;
|
|
275
|
-
}
|
|
276
|
-
//.line{
|
|
277
|
-
// border-top: 1px solid lightgray;
|
|
278
|
-
// margin:10px
|
|
279
|
-
//}
|
|
280
|
-
.more-content{
|
|
281
|
-
margin-left: 140px;
|
|
282
|
-
margin-top: 15px;
|
|
283
|
-
a{font-size:14px;color:#999;font-family: Microsoft YaHei-Regular, Microsoft YaHei;}
|
|
284
|
-
}
|
|
285
|
-
.search-fast-con-side{
|
|
286
|
-
width: 97%;
|
|
287
|
-
position: absolute;
|
|
288
|
-
top: 0px;
|
|
289
|
-
z-index: 2000;
|
|
290
|
-
//background: #22262f;
|
|
291
|
-
}
|
|
292
|
-
.search-fast-con-side .ivu-input{
|
|
293
|
-
font-size: 13px;
|
|
294
|
-
margin-top: -4px;
|
|
295
|
-
width: 228.5px;
|
|
296
|
-
height: 40px;
|
|
297
|
-
font-family: Microsoft YaHei;
|
|
298
|
-
font-weight: 400;
|
|
299
|
-
border: none;
|
|
300
|
-
background-color: var(--legend-color ,@legend-color);//修改这里
|
|
301
|
-
text-align:left; /* 确保文本默认左对齐 */
|
|
302
|
-
color: var(--head-bg ,@head-bg );
|
|
303
|
-
padding-right: 90px;
|
|
304
|
-
padding-left: 50px;
|
|
305
|
-
}
|
|
306
|
-
.search-fast-con-side-modal .ivu-modal-body .modal1-content {
|
|
307
|
-
padding-top: 6px;
|
|
308
|
-
padding-left: 10px;
|
|
309
|
-
height: 270px;
|
|
310
|
-
width: 211px;
|
|
311
|
-
margin-left: -13px;
|
|
312
|
-
overflow-x: hidden;
|
|
313
|
-
overflow-y: auto;
|
|
314
|
-
background-color: var(--menu-dark-active-bg ,@menu-dark-active-bg );
|
|
315
|
-
}
|
|
316
|
-
.search-fast-con-modal .ivu-modal-body{
|
|
317
|
-
height: 280px;
|
|
318
|
-
padding: 16px;
|
|
319
|
-
font-size: var(--font-size-base, 14px);
|
|
320
|
-
line-height: 1.5;
|
|
321
|
-
margin-top: -2px;
|
|
322
|
-
background-color: white;
|
|
323
|
-
}
|
|
324
|
-
search-fast-con-modal .ivu-modal-body .modal-content {
|
|
325
|
-
padding-top: 6px;
|
|
326
|
-
height: 270px;
|
|
327
|
-
width: 200px;
|
|
328
|
-
overflow-x: hidden;
|
|
329
|
-
overflow-y: auto;
|
|
330
|
-
background-color: white;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
search-fast-con-side-modal .ivu-modal-body{
|
|
335
|
-
height: 250px;
|
|
336
|
-
padding: 16px;
|
|
337
|
-
font-size: var(--font-size-base, 14px);
|
|
338
|
-
line-height: 1.5;
|
|
339
|
-
margin-top: -2px;
|
|
340
|
-
//background-color: white;
|
|
341
|
-
|
|
342
|
-
}
|
|
343
|
-
.search-fast-con-side .ivu-icon-ios-search:before {
|
|
344
|
-
margin-right: -33px; /* 向右移动10像素 */
|
|
345
|
-
//color: rgba(42, 97 ,200);
|
|
346
|
-
color: var(--head-bg ,@head-bg );
|
|
347
|
-
line-height: 1.6
|
|
348
|
-
}
|
|
349
|
-
.search-fast-con-top .ivu-icon-ios-search-outline:before {
|
|
350
|
-
//margin-right: -1000px;
|
|
351
|
-
color: rgba(255, 255, 255,0.7);
|
|
352
|
-
position: fixed; /* 使用fixed定位 */
|
|
353
|
-
right: 180px; /* 设置距离浏览器窗口右侧边缘的距离 */
|
|
354
|
-
margin-right: 0;
|
|
355
|
-
top:15px;
|
|
356
|
-
}
|
|
357
|
-
.search-fast-con-top .ivu-icon-ios-search:before {
|
|
358
|
-
color: rgba(255, 255, 255,0.7);
|
|
359
|
-
}
|
|
360
|
-
.search-fast-con-side .ivu-input::placeholder{
|
|
361
|
-
font-size: 13px;
|
|
362
|
-
font-family: Microsoft YaHei;
|
|
363
|
-
font-weight: 400;
|
|
364
|
-
// color: rgba(42, 97 ,200)!important;
|
|
365
|
-
color: var(--head-bg ,@head-bg ) !important;;
|
|
366
|
-
|
|
367
|
-
}
|
|
368
|
-
.search-fast-con-top .ivu-input {
|
|
369
|
-
font-size: 15px;
|
|
370
|
-
font-family: Microsoft YaHei;
|
|
371
|
-
font-weight: 400;
|
|
372
|
-
color: rgba(255, 255, 255,0.7);
|
|
373
|
-
border: none;
|
|
374
|
-
background-color: transparent;
|
|
375
|
-
}
|
|
376
|
-
.search-fast-con-top .ivu-input::placeholder{
|
|
377
|
-
font-size: 15px;
|
|
378
|
-
font-family: Microsoft YaHei;
|
|
379
|
-
font-weight: 400;
|
|
380
|
-
color: rgba(255, 255, 255,0.7)!important;
|
|
381
|
-
}
|
|
382
|
-
//.modal1-content {
|
|
383
|
-
// overflow-x: hidden;
|
|
384
|
-
// overflow-y: auto;
|
|
385
|
-
// height: 270px;
|
|
386
|
-
//}
|
|
387
|
-
.modal-content {
|
|
388
|
-
overflow-x: hidden;
|
|
389
|
-
overflow-y: auto;
|
|
390
|
-
height: 210px;
|
|
391
|
-
background-color: white;
|
|
392
|
-
width: 273px;
|
|
393
|
-
}
|
|
394
|
-
.menu-side-style{
|
|
395
|
-
font-size: 15px;
|
|
396
|
-
font-family: Microsoft YaHei;
|
|
397
|
-
font-weight: 400;
|
|
398
|
-
width: 200px;
|
|
399
|
-
color:#EBEBEB;
|
|
400
|
-
margin-top: 8px;
|
|
401
|
-
white-space: nowrap;
|
|
402
|
-
text-overflow: ellipsis;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
.menu-side-style1{
|
|
406
|
-
font-size: 16px;
|
|
407
|
-
font-family: Microsoft YaHei;
|
|
408
|
-
font-weight: 400;
|
|
409
|
-
width: 200px;
|
|
410
|
-
color:black;
|
|
411
|
-
margin-top: 10px;
|
|
412
|
-
white-space: nowrap;
|
|
413
|
-
text-overflow: ellipsis;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
.menu-side-style:hover {
|
|
417
|
-
overflow: visible;
|
|
418
|
-
cursor: pointer;
|
|
419
|
-
color: red;
|
|
420
|
-
}
|
|
421
|
-
.menu-side-style1:hover {
|
|
422
|
-
overflow: visible;
|
|
423
|
-
cursor: pointer;
|
|
424
|
-
color: red;
|
|
425
|
-
}
|
|
426
|
-
.sideInput{
|
|
427
|
-
width: 221px;
|
|
428
|
-
transform: translateX(-13px);
|
|
429
|
-
}
|
|
430
|
-
.topInput{
|
|
431
|
-
float: right;
|
|
432
|
-
position: relative;
|
|
433
|
-
z-index: 1000;
|
|
434
|
-
width: 1000px;
|
|
435
|
-
margin-top: 80px;
|
|
436
|
-
margin-left: 4000px;
|
|
437
|
-
margin-bottom: 30px;
|
|
438
|
-
}
|
|
439
|
-
.slide-enter-active,
|
|
440
|
-
.slide-leave-active{
|
|
441
|
-
transition: transform 0.5s;
|
|
442
|
-
}
|
|
443
|
-
.slide-enter{
|
|
444
|
-
transform: translateX(100%);
|
|
445
|
-
}
|
|
446
|
-
.slide-leave-to{
|
|
447
|
-
transform: translateX(175px);
|
|
448
|
-
}
|
|
449
|
-
.text {
|
|
450
|
-
display: inline-block;
|
|
451
|
-
}
|
|
452
|
-
.text.scrolling {
|
|
453
|
-
animation: scrollText linear infinite;
|
|
454
|
-
animation-duration: 2s; /* 调整滚动速度和持续时间 */
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
@keyframes scrollText {
|
|
458
|
-
0% {
|
|
459
|
-
transform: translateX(0);
|
|
460
|
-
}
|
|
461
|
-
100% {
|
|
462
|
-
transform: translateX(var(--scroll-distance, 0)); /* 调整滚动的距离 */
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
.menu-side-style:hover .text {
|
|
467
|
-
animation-play-state: running;
|
|
468
|
-
}
|
|
469
|
-
.demo-spin-icon-load{
|
|
470
|
-
animation: ani-demo-spin 1s linear infinite;
|
|
471
|
-
}
|
|
472
|
-
@keyframes ani-demo-spin {
|
|
473
|
-
from { transform: rotate(0deg);}
|
|
474
|
-
50% { transform: rotate(180deg);}
|
|
475
|
-
to { transform: rotate(360deg);}
|
|
476
|
-
}
|
|
477
|
-
</style>
|