@lambo-design/pro-layout 1.0.0-beta.331 → 1.0.0-beta.332
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lambo-design/pro-layout",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.332",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "lambo",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"registry": "https://registry.npmjs.org/"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@lambo-design/
|
|
14
|
-
"@lambo-design/
|
|
13
|
+
"@lambo-design/shared": "^1.0.0-beta.177",
|
|
14
|
+
"@lambo-design/core": "^4.7.1-beta.136"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"release-pro-layout": "pnpm release-beta && git push --follow-tags && pnpm re-publish",
|
|
@@ -23,12 +23,39 @@
|
|
|
23
23
|
</Spin>
|
|
24
24
|
</div>
|
|
25
25
|
<div v-else class="modal-content">
|
|
26
|
-
<
|
|
27
|
-
<
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
<Tabs value="menu" :animated="false" @on-click="tabLabel" style="width:100%;height:100%">
|
|
27
|
+
<TabPane label="菜单" 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="公告" 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="消息" name="message">
|
|
48
|
+
<div v-if="tab==='message'">
|
|
49
|
+
<div v-for="(item,index) in noticeData" :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
|
+
|
|
32
59
|
<Row type="flex" align="middle" justify="center" class="more" >
|
|
33
60
|
<Col><a @click="searchMore">更多</a></Col>
|
|
34
61
|
</Row>
|
|
@@ -44,6 +71,7 @@
|
|
|
44
71
|
import Bus from '@lambo-design/shared/utils/bus'
|
|
45
72
|
import { deepCopy } from '@lambo-design/shared/utils/assist'
|
|
46
73
|
import {getSessionStorage} from '@lambo-design/shared/utils/platform'
|
|
74
|
+
import { mapActions } from 'vuex'
|
|
47
75
|
|
|
48
76
|
export default {
|
|
49
77
|
name: 'pro-layout-tools-quick-search',
|
|
@@ -55,10 +83,17 @@ export default {
|
|
|
55
83
|
searchTopText:'',
|
|
56
84
|
showTopInput:false,
|
|
57
85
|
spinShowTop:false,
|
|
58
|
-
menuData:[]
|
|
86
|
+
menuData:[],
|
|
87
|
+
tab:'menu',
|
|
88
|
+
noticeData:[]
|
|
59
89
|
}
|
|
60
90
|
},
|
|
91
|
+
watch:{
|
|
92
|
+
},
|
|
61
93
|
methods: {
|
|
94
|
+
...mapActions([
|
|
95
|
+
'getNoticeListData'
|
|
96
|
+
]),
|
|
62
97
|
initListener() {
|
|
63
98
|
Bus.$on('menu-list', (data) => {
|
|
64
99
|
this.initMenu(data);
|
|
@@ -71,6 +106,13 @@ export default {
|
|
|
71
106
|
let self = this
|
|
72
107
|
var appList = getSessionStorage('appList')
|
|
73
108
|
var menuList = getSessionStorage('ibp-permission') ? getSessionStorage('ibp-permission') :getSessionStorage('ibp-sc-permission')
|
|
109
|
+
if (this.searchTopText){
|
|
110
|
+
const regex = new RegExp(this.searchTopText, "i");
|
|
111
|
+
this.menuData = this.menuList.filter(menuItem => {
|
|
112
|
+
return menuItem.label.match(regex) && menuItem.type === 2;
|
|
113
|
+
});
|
|
114
|
+
return
|
|
115
|
+
}
|
|
74
116
|
self.menuData = menuList.filter(item => {
|
|
75
117
|
let app = appList.find(app => app.appId === item.appId)
|
|
76
118
|
//判断每个菜单的名字是否包含搜索内容 && 菜单类型是否为2 && 菜单的appId是否在appList中
|
|
@@ -80,15 +122,30 @@ export default {
|
|
|
80
122
|
return false
|
|
81
123
|
})
|
|
82
124
|
self.menuList = self.menuData
|
|
125
|
+
|
|
83
126
|
},
|
|
84
|
-
handleTopInput(){
|
|
127
|
+
async handleTopInput(){
|
|
85
128
|
this.searchTopModal = true
|
|
86
129
|
this.spinShowTop = true
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
130
|
+
this.noticeData = []
|
|
131
|
+
if (this.tab === 'menu'){
|
|
132
|
+
// 使用 filter 方法找到所有匹配的菜单项
|
|
133
|
+
const regex = new RegExp(this.searchTopText, "i");
|
|
134
|
+
this.menuData = this.menuList.filter(menuItem => {
|
|
135
|
+
return menuItem.label.match(regex) && menuItem.type === 2;
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
else if (this.tab ==='notice'){
|
|
139
|
+
this.noticeData = await this.getNoticeListData({
|
|
140
|
+
noticeType:'10',
|
|
141
|
+
noticeTitle:this.searchTopText
|
|
142
|
+
})
|
|
143
|
+
}else if (this.tab ==='message'){
|
|
144
|
+
this.noticeData = await this.getNoticeListData({
|
|
145
|
+
noticeType:'20',
|
|
146
|
+
noticeTitle:this.searchTopText
|
|
147
|
+
})
|
|
148
|
+
}
|
|
92
149
|
this.spinShowTop = false
|
|
93
150
|
},
|
|
94
151
|
handleTopBlur(){
|
|
@@ -122,12 +179,34 @@ export default {
|
|
|
122
179
|
handleMenuClick(item){
|
|
123
180
|
Bus.$emit('select-menu',item.name,item)
|
|
124
181
|
},
|
|
182
|
+
handleNoticeClick(item){
|
|
183
|
+
Bus.$emit('other-operate','select-notice',item.noticeId)
|
|
184
|
+
},
|
|
185
|
+
handleMessageClick(item){
|
|
186
|
+
Bus.$emit('other-operate','select-message',item.noticeId)
|
|
187
|
+
},
|
|
125
188
|
searchMore(){
|
|
126
189
|
this.searchTopModal = false
|
|
127
190
|
this.showTopInput = false
|
|
128
191
|
this.showSearchIcon = true
|
|
129
192
|
Bus.$emit('other-operate','search-more',this.searchTopText)
|
|
130
|
-
}
|
|
193
|
+
},
|
|
194
|
+
async tabLabel(e){
|
|
195
|
+
this.tab = e
|
|
196
|
+
if (e === 'menu') {
|
|
197
|
+
this.initMenu(null)
|
|
198
|
+
} else if (e === 'notice') {
|
|
199
|
+
this.noticeData = await this.getNoticeListData({
|
|
200
|
+
noticeType:'10',
|
|
201
|
+
noticeTitle:this.searchTopText
|
|
202
|
+
})
|
|
203
|
+
} else if (e === 'message') {
|
|
204
|
+
this.noticeData = await this.getNoticeListData({
|
|
205
|
+
noticeType:'20',
|
|
206
|
+
noticeTitle:this.searchTopText
|
|
207
|
+
})
|
|
208
|
+
}
|
|
209
|
+
},
|
|
131
210
|
},
|
|
132
211
|
created() {
|
|
133
212
|
this.initListener()
|