@lambo-design/pro-layout 1.0.0-beta.216 → 1.0.0-beta.217

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.216",
3
+ "version": "1.0.0-beta.217",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="pro-layout-header-wrapper">
3
- <div class="trigger-box">
4
- <LamboProTrigger></LamboProTrigger>
3
+ <div class="trigger-box" :style="menuScalingStyle">
4
+ <LamboProTrigger v-if="systemInfo.menuScaling === '1'"></LamboProTrigger>
5
5
  </div>
6
6
  <div class="logo-box">
7
7
  <LamboProLogo></LamboProLogo>
@@ -63,6 +63,11 @@ export default {
63
63
  LamboProNav,
64
64
  LamboProTools
65
65
  },
66
+ computed:{
67
+ menuScalingStyle(){
68
+ return this.systemInfo.menuScaling === '1' ? '' : {marginLeft:'25px'}
69
+ }
70
+ },
66
71
  methods:{
67
72
  initListener(){
68
73
  Bus.$on('system-info',(data)=>{
@@ -97,6 +102,7 @@ export default {
97
102
  Bus.$off('menu-click')
98
103
  },
99
104
  initSystem(data){
105
+ console.log('data>>',data)
100
106
  if (data) {
101
107
  this.systemInfo = data;
102
108
  if (data.isShowSearch) {
@@ -138,6 +144,7 @@ export default {
138
144
  if (pid === 0) {
139
145
  // 如果 pid 为 0,表示是最外层菜单
140
146
  parentName = this.getNameOrHref(menu);
147
+ //console.log('parentName',parentName)
141
148
  this.openedNames = [parentName]; // 设置最外层父菜单为展开状态
142
149
  } else {
143
150
  // 如果 pid 不等于 0,查找并打开对应的最外层父菜单
@@ -13,11 +13,18 @@
13
13
  <div class="user-avatar-dropdown">
14
14
  <Dropdown @on-click="handleClick" :transfer="false">
15
15
  <span>欢迎,{{ userInfo.userName }}</span>
16
- <Icon type="ios-arrow-down"/>
16
+ <Icon v-if="userInfo.dropList.length > 0" type="ios-arrow-down"/>
17
17
  <DropdownMenu v-if="userInfo.dropList.length > 0" slot="list">
18
- <DropdownItem v-for="item in userInfo.dropList" :name="item.name" :key="item.name">
19
- &nbsp;{{ item.value }}
20
- </DropdownItem>
18
+ <!-- <DropdownItem v-for="item in userInfo.dropList" :name="item.name" :key="item.name">-->
19
+ <!-- &nbsp;{{ item.value }}-->
20
+ <!-- </DropdownItem> -->
21
+ <div v-for="(item,index) in userInfo.dropList" :key="index">
22
+ <DropdownItem v-if="item === 'theme'" name="theme"><span>切换主题</span></DropdownItem>
23
+ <DropdownItem v-if="item === 'personalCenter'" name="personalCenter"><span>个人中心</span></DropdownItem>
24
+ <DropdownItem v-if="item === 'noticeList'" name="noticeList"><span>通知公告</span></DropdownItem>
25
+ </div>
26
+ <!-- 最后添加退出登录项 -->
27
+ <DropdownItem v-if="userInfo.dropList.includes('logout')" name="logout"><span>退出登录</span></DropdownItem>
21
28
  </DropdownMenu>
22
29
  </Dropdown>
23
30
  </div>
@@ -45,10 +52,7 @@ export default {
45
52
  rightTopOptButtonList: ['collect','fullScreen'],
46
53
  userInfo: {
47
54
  userName: '管理员',
48
- dropList: [
49
- { name: 'changePwd', value: '修改密码' },
50
- { name: 'logout', value: '退出登录' }
51
- ],
55
+ dropList: ['theme', 'personalCenter', 'noticeList', 'logout'],
52
56
  }
53
57
  }
54
58
  },
package/src/index.vue CHANGED
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <i-layout class="pro-layout" :class="layoutClass">
3
- <i-header class="pro-layout-header">
3
+ <i-header class="pro-layout-header" :style="systemInfo.headBackground ? headBackgroundStyle : ''">
4
4
  <LamboProLayoutHeader></LamboProLayoutHeader>
5
5
  </i-header>
6
6
  <i-layout>
@@ -50,7 +50,9 @@ export default {
50
50
  acceptAppId: '',
51
51
  tabNum: 8,
52
52
  topMenu: 4,
53
- rightTopOptButtonList: []
53
+ rightTopOptButtonList: [],
54
+ menuScaling:'1',
55
+ headBackground:'',
54
56
  }
55
57
  }
56
58
  },
@@ -107,6 +109,12 @@ export default {
107
109
  homeRouter
108
110
  }
109
111
  },
112
+ headBackgroundStyle(){
113
+ return{
114
+ background: `url(${this.systemInfo.headBackground}) no-repeat`,
115
+ backgroundSize: 'cover',
116
+ }
117
+ },
110
118
  layoutClass(){
111
119
  if (this.systemInfo && this.systemInfo.layoutSize) {
112
120
  let layoutSize = this.systemInfo.layoutSize;