@lambo-design/pro-layout 1.0.0-beta.232 → 1.0.0-beta.233

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.232",
3
+ "version": "1.0.0-beta.233",
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.59",
14
- "@lambo-design/shared": "^1.0.0-beta.43"
13
+ "@lambo-design/shared": "^1.0.0-beta.43",
14
+ "@lambo-design/core": "^4.7.1-beta.59"
15
15
  },
16
16
  "scripts": {}
17
17
  }
@@ -6,7 +6,10 @@
6
6
  <div class="logo-box">
7
7
  <LamboProLogo></LamboProLogo>
8
8
  </div>
9
- <div class="nav-box">
9
+ <div v-if="systemInfo && systemInfo.navType && systemInfo.navType == 'slide'">
10
+ <LamboProNavSilde></LamboProNavSilde>
11
+ </div>
12
+ <div class="nav-box" v-else>
10
13
  <LamboProNav></LamboProNav>
11
14
  </div>
12
15
  <div class="tools-box">
@@ -19,6 +22,7 @@
19
22
  import LamboProTrigger from './pro-layout-trigger'
20
23
  import LamboProLogo from './pro-layout-logo'
21
24
  import LamboProNav from './pro-layout-nav'
25
+ import LamboProNavSilde from './pro-layout-nav-slide'
22
26
  import LamboProTools from './pro-layout-tools'
23
27
  import Bus from "@lambo-design/shared/utils/bus";
24
28
  import {deepCopy} from "@lambo-design/shared/utils/assist";
@@ -61,6 +65,7 @@ export default {
61
65
  LamboProTrigger,
62
66
  LamboProLogo,
63
67
  LamboProNav,
68
+ LamboProNavSilde,
64
69
  LamboProTools
65
70
  },
66
71
  computed:{
@@ -0,0 +1,89 @@
1
+ <template>
2
+ <div>
3
+ <div class="nav-box-slide">
4
+ <LamboProNavSlide :accept-int="pointer" @topMen-list="handleCustomEvent" @topMen-num="topMen" @topMen-true="topMenTrue"></LamboProNavSlide>
5
+ </div>
6
+ <!--slide按钮-->
7
+ <div class="tools-box-slide">
8
+ <div style="margin-right: 50px;">
9
+ <Icon
10
+ class="more-menu"
11
+ style="margin-right: 10px"
12
+ type="md-arrow-dropleft-circle"
13
+ v-if="arrowFlag"
14
+ @click="moveMenu('left')"
15
+ />
16
+ <Icon
17
+ type="md-arrow-dropright-circle"
18
+ class="more-menu"
19
+ v-if="arrowFlag"
20
+ @click="moveMenu('right')"
21
+ />
22
+ </div>
23
+ </div>
24
+ </div>
25
+ </template>
26
+
27
+ <script>
28
+ import LamboProNavSlide from './pro-layout-nav-slide.vue'
29
+ export default {
30
+ data(){
31
+ return {
32
+ pointer:0,
33
+ topList:[],
34
+ topNum:0,
35
+ arrowFlag: true,
36
+ }
37
+ },
38
+ components: {
39
+ LamboProNavSlide
40
+ },
41
+ methods:{
42
+ handleCustomEvent(data) {
43
+ // 接收子组件传递的数据
44
+ this.topList = data;
45
+ },
46
+ topMen(data){
47
+ this.topNum = data;
48
+ },
49
+ topMenTrue(data){
50
+ this.arrowFlag = data
51
+ },
52
+ moveMenu: function (direction) {
53
+ if (direction === "right") {
54
+ if (this.pointer + this.topNum === this.topList.length) {
55
+ return;
56
+ }
57
+ this.pointer++;
58
+ } else {
59
+ if (this.pointer === 0) {
60
+ return;
61
+ }
62
+ this.pointer--;
63
+ }
64
+ this.flag = false;
65
+ let self = this;
66
+ setTimeout(() => {
67
+ self.flag = true;
68
+ }, 0);
69
+ },
70
+
71
+ },
72
+ }
73
+ </script>
74
+
75
+ <style scoped lang="less">
76
+
77
+ .more-menu {
78
+ color: #d9eeec;
79
+ font-size: 22px;
80
+ cursor: pointer;
81
+ }
82
+
83
+ .nav-box-slide{
84
+ float: left;
85
+ }
86
+ .tools-box-slide{
87
+ float: right;
88
+ }
89
+ </style>
@@ -0,0 +1,251 @@
1
+ <template>
2
+ <div style="margin-left: 53px;">
3
+ <div class="menu-list" >
4
+ <ul class="top-menu" ref="topNav">
5
+ <li class="top-menu-item" :class="{ 'active': activeName === item.appId }" v-for="(item,index) in topMenList" :key="item.appId" @click="selectApp(item.appId)">
6
+ <div class="menu-item" v-show="pointer <= index && index < pointer + topMenuNum && flag">
7
+ <p class="menu-icon"><Icon :type="item.icon" :size="20"></Icon></p>
8
+ <p class="menu-txt">{{ item.name }}</p>
9
+ </div>
10
+ </li>
11
+ </ul>
12
+ </div>
13
+ </div>
14
+ </template>
15
+
16
+ <script>
17
+ import Bus from '@lambo-design/shared/utils/bus'
18
+ import { deepCopy } from '@lambo-design/shared/utils/assist'
19
+
20
+ export default {
21
+ name: 'pro-layout-tqm',
22
+ props: {
23
+ acceptAppId: {
24
+ type: String,
25
+ default: ''
26
+ },
27
+ acceptInt: {
28
+ type: Number,
29
+ default: 0
30
+ },
31
+ topMenListNum: {
32
+ type: Number,
33
+ default: 0
34
+ }
35
+ },
36
+ data() {
37
+ return {
38
+ pointer:0,
39
+ flag:true,
40
+ arrowFlag: true,
41
+
42
+ navList: [],
43
+ topMenList: [],
44
+ topTqmMenList:[],
45
+ otherList: [],
46
+ activeName: '',
47
+ topMenuNum: 7,
48
+ lastTopMenuNum:-1,
49
+ originMenuList: []
50
+ }
51
+ },
52
+ methods: {
53
+ initListener() {
54
+ Bus.$on('system-info',(data) => {
55
+ this.initSystemInfo(data);
56
+ })
57
+ Bus.$on('nav-list', (data) => {
58
+ this.initNav(data)
59
+ })
60
+ Bus.$on('change-app', ({ appId, appInfo }) => {
61
+ this.changeApp(appId, appInfo)
62
+ })
63
+ },
64
+ destroyListener() {
65
+ Bus.$off('system-info')
66
+ Bus.$off('nav-list')
67
+ Bus.$off('change-app')
68
+ },
69
+ initSystemInfo(data) {
70
+ if (data) {
71
+ this.topMenuNum = data.topMenu ? data.topMenu : 4;
72
+ this.acceptAppId = data.acceptAppId ? data.acceptAppId : '';
73
+ this.initNav(this.navList)
74
+ }
75
+ },
76
+ initNav(data) {
77
+ if (data.toString() === this.navList.toString() && this.topMenuNum === this.lastTopMenuNum) {
78
+ return
79
+ }
80
+ this.navList = data
81
+ this.lastTopMenuNum = this.topMenuNum
82
+ if (data.length > this.topMenuNum) {
83
+ let navList = deepCopy(data)
84
+ this.topMenList = navList
85
+ this.$emit('topMen-list', this.topMenList);
86
+ this.$emit('topMen-num', this.topMenuNum);
87
+ this.$emit('topMen-true', true);
88
+ // this.topMenList = navList.splice(0, this.topMenuNum)
89
+ // this.otherList = navList
90
+ } else {
91
+ this.topMenList = this.navList
92
+ this.$emit('topMen-true', false);
93
+ }
94
+ if (this.topMenList.length > 0) {
95
+ let appId = this.topMenList[0].appId
96
+ for (let i = 0; i < this.topMenList.length; i++) {
97
+ if (this.topMenList[i].selected == true) {
98
+ appId = this.topMenList[i].appId
99
+ }
100
+ }
101
+ if (this.activeName) {
102
+ appId = this.activeName
103
+ }
104
+ this.selectApp(appId)
105
+ }
106
+ },
107
+ selectApp(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
+ watch: {
114
+ activeName() {
115
+ this.$nextTick(() => {
116
+ this.$refs.topNav.updateActiveName()
117
+ })
118
+ },
119
+ acceptInt(val){
120
+ this.pointer = val;
121
+ },
122
+ acceptAppId(val) {
123
+ this.selectApp(val)
124
+ }
125
+ },
126
+ created() {
127
+ this.initListener()
128
+ },
129
+ beforeDestroy() {
130
+ this.destroyListener()
131
+ }
132
+ }
133
+ </script>
134
+
135
+ <style scoped lang="less">
136
+ @import '@lambo-design/core/src/styles/default.less';
137
+
138
+ .pro-layout-nav-wrapper {
139
+ .ivu-menu {
140
+ .ivu-menu-item {
141
+ &:hover {
142
+ background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 100%);
143
+
144
+ .line {
145
+ border-bottom: 3.35px solid var(--primary-color-tint-5, @_primary-color-tint-5);
146
+ position: absolute;
147
+ left: 0;
148
+ right: 0;
149
+ }
150
+ }
151
+
152
+ &.ivu-menu-item-active, &.ivu-menu-item-selected {
153
+ background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 100%);
154
+
155
+ .line {
156
+ border-bottom: 3.35px solid var(--primary-color-tint-5, @_primary-color-tint-5);
157
+ position: absolute;
158
+ left: 0;
159
+ right: 0;
160
+ //bottom: 0;
161
+ }
162
+ }
163
+ }
164
+
165
+ /deep/ .ivu-menu-submenu {
166
+ .ivu-menu-submenu-title > i {
167
+ &.ivu-menu-submenu-title-icon {
168
+
169
+ }
170
+ }
171
+
172
+ .ivu-select-dropdown {
173
+ background: var(--menu-dark-title, @_menu-dark-title);
174
+ color: var(--heading-color-dark, @_heading-color-dark);
175
+
176
+ .ivu-menu-drop-list {
177
+ .ivu-menu-item {
178
+ color: var(--menu-dark-subsidiary-color, @_menu-dark-subsidiary-color);
179
+
180
+ &:hover {
181
+ background: rgba(255, 255, 255, 0.2);
182
+ color: var(--heading-color-dark, @_heading-color-dark);
183
+ }
184
+
185
+ &.ivu-menu-item-active, &.ivu-menu-item-selected {
186
+ background: rgba(255, 255, 255, 0.2);
187
+ color: var(--heading-color-dark, @_heading-color-dark);
188
+ }
189
+ }
190
+ }
191
+ }
192
+ }
193
+ }
194
+ }
195
+
196
+ .menu-list {
197
+ height: 100%;
198
+ line-height: 24px;
199
+ color: #ffffff;
200
+ cursor: pointer;
201
+ font-size: 16px;
202
+ .top-menu {
203
+ overflow: hidden;
204
+ height: 100%;
205
+ .top-menu-item {
206
+ position: relative;
207
+ height: 100%;
208
+ color: #FFFFFF;
209
+ list-style: none;
210
+ float: left;
211
+ &:hover {
212
+ background: transparent;
213
+ .menu-item {
214
+ color: #fff;
215
+ }
216
+ }
217
+ &.active {
218
+ background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0)) !important;
219
+ border-bottom: 2px solid var(--primary-color-tint-5, @_primary-color-tint-5);
220
+ .menu-item {
221
+ color: #fff;
222
+ }
223
+ }
224
+ .menu-item {
225
+ padding: 2px 0px 0px 8px;
226
+ margin: 0px 30px;
227
+ }
228
+ .menu-icon {
229
+ height: 20px;
230
+ line-height: 20px;
231
+ text-align: center;
232
+ //position: absolute;
233
+ left: 14px;
234
+ }
235
+ .menu-txt {
236
+ text-align: center;
237
+ font-size: 14px;
238
+ line-height: 2;
239
+ }
240
+ }
241
+ }
242
+ }
243
+
244
+
245
+
246
+ .more-menu {
247
+ color: #d9eeec;
248
+ font-size: 22px;
249
+ cursor: pointer;
250
+ }
251
+ </style>