@lambo-design/pro-layout 1.0.0-beta.294 → 1.0.0-beta.296

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.294",
3
+ "version": "1.0.0-beta.296",
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/core": "^4.7.1-beta.129",
14
- "@lambo-design/shared": "^1.0.0-beta.143"
13
+ "@lambo-design/shared": "^1.0.0-beta.144",
14
+ "@lambo-design/core": "^4.7.1-beta.129"
15
15
  },
16
16
  "scripts": {}
17
17
  }
@@ -1,185 +1,188 @@
1
- <template>
2
- <div class="menu-list" >
3
- <ul class="top-menu" :style="layoutSize === 'default' ? {height: '64px'} : {height: '50px'}" ref="topNav">
4
- <li class="top-menu-item" :class="{ 'active': activeName === item.appId }" v-for="(item,index) in topMenList" :key="item.appId" @click="selectApp(item.appId)">
5
- <div class="menu-item" :style="layoutSize === 'default' ? {paddingTop: '10px'} : {paddingTop: '2px'}" v-show="pointer <= index && index < pointer + topMenuNum && flag">
6
- <p class="menu-icon"><Icon :type="item.icon" :size="20"></Icon></p>
7
- <p class="menu-txt">{{ item.name }}</p>
8
- </div>
9
- </li>
10
- </ul>
11
- </div>
12
- </template>
13
-
14
- <script>
15
- import Bus from '@lambo-design/shared/utils/bus'
16
- import { deepCopy } from '@lambo-design/shared/utils/assist'
17
-
18
- export default {
19
- props: {
20
- acceptInt: {
21
- type: Number,
22
- default: 0
23
- },
24
- topMenListNum: {
25
- type: Number,
26
- default: 0
27
- }
28
- },
29
- data() {
30
- return {
31
- systemInfo:{},
32
- pointer:0,
33
- flag:true,
34
- arrowFlag: true,
35
- acceptAppId: '',
36
- navList: [],
37
- topMenList: [],
38
- topTqmMenList:[],
39
- otherList: [],
40
- activeName: '',
41
- topMenuNum: 7,
42
- lastTopMenuNum:-1,
43
- originMenuList: [],
44
- layoutSize:"default"
45
- }
46
- },
47
- methods: {
48
- initListener() {
49
- Bus.$on('system-info',(data) => {
50
- this.initSystemInfo(data);
51
- })
52
- Bus.$on('nav-list', (data) => {
53
- this.initNav(data)
54
- })
55
- Bus.$on('change-app', ({ appId, appInfo }) => {
56
- this.changeApp(appId, appInfo)
57
- })
58
- },
59
- destroyListener() {
60
- Bus.$off('system-info')
61
- Bus.$off('nav-list')
62
- Bus.$off('change-app')
63
- },
64
- initSystemInfo(data) {
65
- if (data) {
66
- this.layoutSize = data.layoutSize ? data.layoutSize : 'default';
67
- this.topMenuNum = data.topMenuNum ? data.topMenuNum : 4;
68
- this.acceptAppId = data.acceptAppId ? data.acceptAppId : '';
69
- if (!this.activeName) {
70
- this.activeName = this.acceptAppId
71
- }
72
- this.initNav(this.navList)
73
- }
74
- },
75
- initNav(data) {
76
- if (data.toString() === this.navList.toString() && this.topMenuNum === this.lastTopMenuNum) {
77
- return
78
- }
79
- this.navList = data
80
- this.lastTopMenuNum = this.topMenuNum
81
- if (data.length > this.topMenuNum) {
82
- let navList = deepCopy(data)
83
- this.topMenList = navList
84
- this.$emit('topMen-list', this.topMenList);
85
- this.$emit('topMen-num', this.topMenuNum);
86
- this.$emit('topMen-true', true);
87
- // this.topMenList = navList.splice(0, this.topMenuNum)
88
- // this.otherList = navList
89
- } else {
90
- this.topMenList = this.navList
91
- this.$emit('topMen-true', false);
92
- }
93
- if (this.topMenList.length > 0) {
94
- let appId = this.topMenList[0].appId
95
- for (let i = 0; i < this.topMenList.length; i++) {
96
- if (this.topMenList[i].selected == true) {
97
- appId = this.topMenList[i].appId
98
- }
99
- }
100
- if (this.activeName) {
101
- appId = this.activeName
102
- }
103
- this.selectApp(appId)
104
- }
105
- },
106
- selectApp(appId) {
107
- if (appId) {
108
- this.activeName = appId
109
- let res = this.navList.filter(app => app.appId == appId)
110
- Bus.$emit('change-app', { appId, appInfo: res[0] })
111
- }
112
- },
113
- changeApp(appId, appInfo){
114
- if (appId) {
115
- this.activeName = appId
116
- }
117
- }
118
- },
119
- watch: {
120
- acceptInt(val){
121
- this.pointer = val;
122
- }
123
- },
124
- created() {
125
- this.initListener()
126
- },
127
- beforeDestroy() {
128
- this.destroyListener()
129
- }
130
- }
131
- </script>
132
-
133
- <style scoped lang="less">
134
- @import '@lambo-design/core/src/styles/default.less';
135
- .menu-list {
136
- height: 100%;
137
- line-height: 24px;
138
- //color: #ffffff;
139
- cursor: pointer;
140
- font-size: 16px;
141
- margin-left: 53px;
142
- .top-menu {
143
- overflow: hidden;
144
- .top-menu-item {
145
- margin-left: 34px;
146
- position: relative;
147
- height: 100%;
148
- //color: #FFFFFF;
149
- list-style: none;
150
- float: left;
151
- &:hover {
152
- //background: transparent;
153
- .menu-item {
154
- //color: #fff;
155
- }
156
- }
157
- &.active {
158
- //background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0)) !important;
159
- //border-bottom: 2px solid var(--primary-color-tint-5, @_primary-color-tint-5);
160
- .menu-item {
161
- //color: #fff;
162
- }
163
- }
164
- .menu-item {
165
- display: flex;
166
- margin-top: 10px;
167
- padding-right: 10px;
168
- }
169
- .menu-icon {
170
- height: 20px;
171
- line-height: 20px;
172
- text-align: center;
173
- margin-right: 10px;
174
- margin-left: 10px;
175
- margin-top: 3px;
176
- }
177
- .menu-txt {
178
- text-align: center;
179
- font-size: 14px;
180
- line-height: 2;
181
- }
182
- }
183
- }
184
- }
185
- </style>
1
+ <template>
2
+ <div class="menu-list" >
3
+ <ul class="top-menu" :style="layoutSize === 'default' ? {height: '64px'} : {height: '50px'}" ref="topNav">
4
+ <li class="top-menu-item" v-show="pointer <= index && index < pointer + topMenuNum && flag" :class="{ 'active': activeName === item.appId }" v-for="(item,index) in topMenList" :key="item.appId" @click="selectApp(item.appId)">
5
+ <div class="menu-item" :style="layoutSize === 'default' ? {paddingTop: '10px'} : {paddingTop: '2px'}">
6
+ <p class="menu-icon"><Icon :type="item.icon" :size="20"></Icon></p>
7
+ <p class="menu-txt">{{ item.name }}</p>
8
+ </div>
9
+ </li>
10
+ </ul>
11
+ </div>
12
+ </template>
13
+
14
+ <script>
15
+ import Bus from '@lambo-design/shared/utils/bus'
16
+ import { deepCopy } from '@lambo-design/shared/utils/assist'
17
+
18
+ export default {
19
+ props: {
20
+ acceptInt: {
21
+ type: Number,
22
+ default: 0
23
+ },
24
+ topMenListNum: {
25
+ type: Number,
26
+ default: 0
27
+ }
28
+ },
29
+ data() {
30
+ return {
31
+ systemInfo:{},
32
+ pointer:0,
33
+ flag:true,
34
+ arrowFlag: true,
35
+ acceptAppId: '',
36
+ navList: [],
37
+ topMenList: [],
38
+ topTqmMenList:[],
39
+ otherList: [],
40
+ activeName: '',
41
+ topMenuNum: 7,
42
+ lastTopMenuNum:-1,
43
+ originMenuList: [],
44
+ layoutSize:"default"
45
+ }
46
+ },
47
+ methods: {
48
+ initListener() {
49
+ Bus.$on('system-info',(data) => {
50
+ this.initSystemInfo(data);
51
+ })
52
+ Bus.$on('nav-list', (data) => {
53
+ this.initNav(data)
54
+ })
55
+ Bus.$on('change-app', ({ appId, appInfo }) => {
56
+ this.changeApp(appId, appInfo)
57
+ })
58
+ },
59
+ destroyListener() {
60
+ Bus.$off('system-info')
61
+ Bus.$off('nav-list')
62
+ Bus.$off('change-app')
63
+ },
64
+ initSystemInfo(data) {
65
+ if (data) {
66
+ this.layoutSize = data.layoutSize ? data.layoutSize : 'default';
67
+ this.topMenuNum = data.topMenu ? data.topMenu : 4;
68
+ this.acceptAppId = data.acceptAppId ? data.acceptAppId : '';
69
+ if (!this.activeName) {
70
+ this.activeName = this.acceptAppId
71
+ }
72
+ this.initNav(this.navList)
73
+ }
74
+ },
75
+ initNav(data) {
76
+ if (data.toString() === this.navList.toString() && this.topMenuNum === this.lastTopMenuNum) {
77
+ return
78
+ }
79
+ this.navList = data
80
+ this.lastTopMenuNum = this.topMenuNum
81
+ if (data.length > this.topMenuNum) {
82
+ let navList = deepCopy(data)
83
+ this.topMenList = navList
84
+ this.$emit('topMen-list', this.topMenList);
85
+ this.$emit('topMen-num', this.topMenuNum);
86
+ this.$emit('topMen-true', true);
87
+ // this.topMenList = navList.splice(0, this.topMenuNum)
88
+ // this.otherList = navList
89
+ } else {
90
+ this.topMenList = this.navList
91
+ this.$emit('topMen-true', false);
92
+ }
93
+ if (this.topMenList.length > 0) {
94
+ let appId = this.topMenList[0].appId
95
+ for (let i = 0; i < this.topMenList.length; i++) {
96
+ if (this.topMenList[i].selected == true) {
97
+ appId = this.topMenList[i].appId
98
+ }
99
+ }
100
+ if (this.activeName) {
101
+ appId = this.activeName
102
+ }
103
+ this.selectApp(appId)
104
+ }
105
+ },
106
+ selectApp(appId) {
107
+ if (appId) {
108
+ this.activeName = appId
109
+ let res = this.navList.filter(app => app.appId == appId)
110
+ Bus.$emit('change-app', { appId, appInfo: res[0] })
111
+ }
112
+ },
113
+ changeApp(appId, appInfo){
114
+ if (appId) {
115
+ this.activeName = appId
116
+ }
117
+ }
118
+ },
119
+ watch: {
120
+ acceptInt(val){
121
+ this.pointer = val;
122
+ }
123
+ },
124
+ created() {
125
+ this.initListener()
126
+ },
127
+ beforeDestroy() {
128
+ this.destroyListener()
129
+ }
130
+ }
131
+ </script>
132
+
133
+ <style scoped lang="less">
134
+ @import '@lambo-design/core/src/styles/default.less';
135
+ .menu-list {
136
+ height: 100%;
137
+ line-height: 24px;
138
+ //color: #ffffff;
139
+ cursor: pointer;
140
+ font-size: 16px;
141
+ margin-left: 15px;
142
+ .top-menu {
143
+ overflow: hidden;
144
+ .top-menu-item {
145
+ margin-left: 34px;
146
+ position: relative;
147
+ height: 100%;
148
+ //color: #FFFFFF;
149
+ list-style: none;
150
+ float: left;
151
+ &:hover {
152
+ //background: transparent;
153
+ .menu-item {
154
+ //color: #fff;
155
+ }
156
+ }
157
+ &.active {
158
+ //background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0)) !important;
159
+ //border-bottom: 2px solid var(--primary-color-tint-5, @_primary-color-tint-5);
160
+ .menu-item {
161
+ //color: #fff;
162
+ width: 135px;
163
+ }
164
+ }
165
+ .menu-item {
166
+ display: flex;
167
+ margin-top: 10px;
168
+ padding-right: 10px;
169
+ width: 135px;
170
+
171
+ }
172
+ .menu-icon {
173
+ height: 20px;
174
+ line-height: 20px;
175
+ text-align: center;
176
+ margin-right: 10px;
177
+ margin-left: 10px;
178
+ margin-top: 3px;
179
+ }
180
+ .menu-txt {
181
+ text-align: center;
182
+ font-size: 14px;
183
+ line-height: 2;
184
+ }
185
+ }
186
+ }
187
+ }
188
+ </style>
@@ -141,18 +141,6 @@
141
141
  color: var(--layout-sider-submenu-hover-color ,@_layout-sider-submenu-hover-color);
142
142
  }
143
143
  }
144
- .ivu-menu-item{
145
- background: var(--layout-sider-menuitem-background,@_layout-sider-menuitem-background)!important;
146
- color: var(--layout-sider-menuitem-color ,@_layout-sider-menuitem-color);
147
- &.ivu-menu-item-active,&.ivu-menu-item-selected{
148
- background: var(--layout-sider-menuitem-active-background,@_layout-sider-menuitem-active-background)!important;
149
- color: var(--layout-sider-menuitem-active-color,@_layout-sider-menuitem-active-color);
150
- }
151
- &:hover{
152
- background: var(--layout-sider-menuitem-hover-background,@_layout-sider-menuitem-hover-background)!important;
153
- color: var(--layout-sider-menuitem-hover-color,@_layout-sider-menuitem-hover-color);
154
- }
155
- }
156
144
  &.ivu-menu-opened{
157
145
  background: var(--layout-sider-submenu-active-background,@_layout-sider-submenu-active-background)!important;
158
146
  color: var(--layout-sider-submenu-active-color ,@_layout-sider-submenu-active-color);
@@ -166,6 +154,18 @@
166
154
  }
167
155
  }
168
156
  }
157
+ .ivu-menu-item{
158
+ background: var(--layout-sider-menuitem-background,@_layout-sider-menuitem-background)!important;
159
+ color: var(--layout-sider-menuitem-color ,@_layout-sider-menuitem-color);
160
+ &.ivu-menu-item-active,&.ivu-menu-item-selected{
161
+ background: var(--layout-sider-menuitem-active-background,@_layout-sider-menuitem-active-background)!important;
162
+ color: var(--layout-sider-menuitem-active-color,@_layout-sider-menuitem-active-color);
163
+ }
164
+ &:hover{
165
+ background: var(--layout-sider-menuitem-hover-background,@_layout-sider-menuitem-hover-background)!important;
166
+ color: var(--layout-sider-menuitem-hover-color,@_layout-sider-menuitem-hover-color);
167
+ }
168
+ }
169
169
  }
170
170
  .menu-collapsed{
171
171
  a.drop-menu-a{