@lambo-design/pro-layout 1.0.0-beta.20 → 1.0.0-beta.22

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.20",
3
+ "version": "1.0.0-beta.22",
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
  "dependencies": {
13
- "@lambo-design/core": "4.7.1-beta.35",
14
- "@lambo-design/shared": "1.0.0-beta.15"
13
+ "@lambo-design/shared": "1.0.0-beta.17",
14
+ "@lambo-design/core": "4.7.1-beta.37"
15
15
  },
16
16
  "scripts": {}
17
17
  }
@@ -162,7 +162,21 @@ export default {
162
162
  this.value = name;
163
163
  },
164
164
  menuClick(current) {
165
- this.activeName = current;
165
+ let item = this.originMenuList.filter(menu => menu.name === current);
166
+ console.log("item=",item)
167
+ if (item && item.length > 0){
168
+ let type = item.type;
169
+ if (type == 2) {
170
+ this.activeName = current;
171
+ } else {
172
+ let pItem = this.originMenuList.filter(menu => menu.permissionId === item.pid);
173
+ if (pItem && pItem.length > 0){
174
+ this.activeName = pItem.name;
175
+ }
176
+ }
177
+ } else {
178
+ this.activeName = current;
179
+ }
166
180
  },
167
181
  getOpenedNamesByActiveName(){
168
182
  let res = filterMenuName(this.menuList,this.activeName);
@@ -44,6 +44,7 @@
44
44
  <script>
45
45
  import {
46
46
  getPreviousTagIndex,
47
+ getDelTagIndex,
47
48
  setTagNavListInLocalstorage,
48
49
  showTitle
49
50
  } from '@lambo-design/shared/utils/platform'
@@ -56,6 +57,8 @@ export default {
56
57
  name: 'pro-layout-tabs',
57
58
  data() {
58
59
  return {
60
+ systemInfo: {},
61
+ tabNum : 8,
59
62
  appId: '',
60
63
  appInfo: {},
61
64
  navList: [],
@@ -76,6 +79,9 @@ export default {
76
79
  },
77
80
  methods: {
78
81
  initListener(){
82
+ Bus.$on('system-info',(data)=>{
83
+ this.initSystem(data)
84
+ });
79
85
  Bus.$on('nav-list',(data)=>{
80
86
  this.initNav(data)
81
87
  });
@@ -90,11 +96,20 @@ export default {
90
96
  })
91
97
  },
92
98
  destroyListener(){
99
+ Bus.$off('system-info')
93
100
  Bus.$off('nav-list')
94
101
  Bus.$off('menu-list')
95
102
  Bus.$off('tag-list')
96
103
  Bus.$off('change-app')
97
104
  },
105
+ initSystem(data){
106
+ if (data) {
107
+ this.systemInfo = data;
108
+ if (data.tabNum) {
109
+ this.tabNum = data.tabNum;
110
+ }
111
+ }
112
+ },
98
113
  initNav(data){
99
114
  if (data.toString() === this.navList.toString()) {
100
115
  return;
@@ -105,6 +120,10 @@ export default {
105
120
  this.originMenuList = deepCopy(data);
106
121
  },
107
122
  initTags(data,current){
123
+ if (data.length > this.tabNum) {
124
+ let index = getDelTagIndex(data,current);
125
+ data.splice(index,1);
126
+ }
108
127
  setTagNavListInLocalstorage(data, config.routerBase + '-tagNavList');
109
128
  this.tagList = data;
110
129
  if (current !== this.value) {
package/src/index.vue CHANGED
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <i-layout class="pro-layout">
2
+ <i-layout class="pro-layout" :class="layoutClass">
3
3
  <i-header class="pro-layout-header">
4
4
  <LamboProLayoutHeader></LamboProLayoutHeader>
5
5
  </i-header>
@@ -8,7 +8,7 @@
8
8
  class="pro-layout-sider"
9
9
  hide-trigger
10
10
  collapsible
11
- :width="256"
11
+ :width="220"
12
12
  :collapsed-width="64"
13
13
  v-model="collapsed">
14
14
  <LamboProLayoutSider ref="sider"></LamboProLayoutSider>
@@ -42,7 +42,14 @@ export default {
42
42
  props:{
43
43
  systemInfo: {
44
44
  type: Object,
45
- default: () => {}
45
+ default: () => {
46
+ return {
47
+ systemName: '后台管理系统',
48
+ systemLogo: '',
49
+ layoutSize: '',
50
+ tabNum: 8,
51
+ }
52
+ }
46
53
  },
47
54
  userInfo: {
48
55
  type: Object,
@@ -86,6 +93,17 @@ export default {
86
93
  menuList,
87
94
  homeRouter
88
95
  }
96
+ },
97
+ layoutClass(){
98
+ if (this.systemInfo && this.systemInfo.layoutSize) {
99
+ let layoutSize = this.systemInfo.layoutSize;
100
+ if (layoutSize == 'default') {
101
+ return '';
102
+ } else {
103
+ return 'small';
104
+ }
105
+ }
106
+ return '';
89
107
  }
90
108
  },
91
109
  watch: {
@@ -207,7 +225,7 @@ export default {
207
225
  }
208
226
  </script>
209
227
 
210
- <style scoped lang="less">
228
+ <style lang="less">
211
229
  @import "@lambo-design/core/src/styles/default";
212
230
  .pro-layout{
213
231
  color: #ffffff;
@@ -234,5 +252,40 @@ export default {
234
252
  }
235
253
  }
236
254
  }
255
+ &.small {
256
+ .ivu-layout-header{
257
+ height: 50px;
258
+ line-height: 50px;
259
+ .pro-layout-header-wrapper{
260
+ height: 50px;
261
+ .trigger-box{
262
+ .sider-trigger-a{
263
+ margin-top: 5px;
264
+ }
265
+ }
266
+ .logo-box{
267
+ .pro-layout-logo-wrapper{
268
+ .logo{
269
+ height: 45px;
270
+ margin-top: 5px;
271
+ }
272
+ .divider{
273
+ height: 26px;
274
+ margin: 12px;
275
+ }
276
+ }
277
+ }
278
+ .nav-box{
279
+ .pro-layout-nav-wrapper{
280
+ .ivu-menu-horizontal{
281
+ height: 46px;
282
+ line-height: 46px;
283
+ }
284
+ }
285
+ }
286
+ }
287
+ }
288
+
289
+ }
237
290
  }
238
291
  </style>