@lambo-design/pro-layout 1.0.0-beta.246 → 1.0.0-beta.248

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.246",
3
+ "version": "1.0.0-beta.248",
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/shared": "^1.0.0-beta.43",
14
- "@lambo-design/core": "^4.7.1-beta.59"
13
+ "@lambo-design/shared": "^1.0.0-beta.125",
14
+ "@lambo-design/core": "^4.7.1-beta.124"
15
15
  },
16
16
  "scripts": {}
17
17
  }
@@ -1,8 +1,16 @@
1
1
  <template>
2
- <div class="pro-layout-logo-wrapper" @click="handleClick">
3
- <div class="logo" v-if="systemInfo.systemLogo !='hide'" :style="logoStyle"></div>
4
- <div class="divider" v-if="systemInfo.systemLogo !='hide'"></div>
5
- <div class="system-name" :style="nameStyle">{{systemName}}</div>
2
+ <div @click="handleClick">
3
+ <Row class="pro-layout-logo-wrapper" :style="systemInfo.layoutSize === 'default' ? {height:'64px'} :{height:'50px'} " type="flex" align="middle">
4
+ <Col>
5
+ <div class="logo" v-if="systemInfo.systemLogo !='hide'" :style="logoStyle"></div>
6
+ </Col>
7
+ <Col>
8
+ <div class="divider" v-if="systemInfo.systemLogo !='hide'"></div>
9
+ </Col>
10
+ <Col>
11
+ <div class="system-name" :style="nameStyle">{{systemName}}</div>
12
+ </Col>
13
+ </Row>
6
14
  </div>
7
15
  </template>
8
16
 
@@ -33,29 +41,14 @@ export default {
33
41
  style += `width: ${this.systemInfo.logoWidth}px;`;
34
42
  }
35
43
  // 如果 systemInfo.logoTop 存在且不为空,则添加到样式
36
- if (this.systemInfo.logoTop && this.systemInfo.logoTop !== '') {
37
- style += `margin-top: ${this.systemInfo.logoTop}px;`;
38
- }
44
+ // if (this.systemInfo.logoTop && this.systemInfo.logoTop !== '') {
45
+ // style += `margin-top: ${this.systemInfo.logoTop}px;`;
46
+ // }
39
47
  style += `text-align-last: justify;`
40
48
  }
41
49
  return style;
42
50
  },
43
51
 
44
- // nameStyle() {
45
- // const fontSize = 20; // 固定的字体大小是 20px
46
- // const lineHeight = 50; // 固定的行高是 50px
47
- // const nameSize = this.systemInfo.nameSize || 1; // 默认行数为1,如果未指定则使用1
48
- // // 计算总高度
49
- // const height = lineHeight * nameSize; // 确保至少有一行高度,即使nameSize小于1
50
- // return {
51
- // 'font-size': `${fontSize}px`, // 应用固定的字体大小
52
- // 'line-height': `${lineHeight}px`, // 应用固定的行高
53
- // 'height': `${height}px`, // 应用计算出的总高度
54
- // 'overflow': 'hidden', // 确保多余的文本被裁剪
55
- // 'white-space': 'pre-wrap', // 允许换行
56
- // 'word-break': 'break-all'
57
- // };
58
- // }
59
52
 
60
53
  nameStyle() {
61
54
  let style = '';
@@ -64,11 +57,11 @@ export default {
64
57
  const maxHeight = lineHeight * lines; // 计算最大高度
65
58
 
66
59
  // 根据nameSize设置margin-top
67
- if (lines == 1) {
68
- style += `margin-top: 12px;`;
69
- } else if (lines == 2) {
70
- style += `margin-top: 5px; `;
71
- }
60
+ // if (lines == 1) {
61
+ // style += `margin-top: 12px;`;
62
+ // } else if (lines == 2) {
63
+ // style += `margin-top: 5px; `;
64
+ // }
72
65
 
73
66
  // 动态计算字体大小
74
67
  const fontSize = Math.max(20 - (lines - 1) * 4, 15); // 字体大小递减
@@ -128,21 +121,22 @@ export default {
128
121
  cursor:pointer;
129
122
  .logo{
130
123
  width: 150px;
131
- height: 55px;
124
+ height: 43px;
132
125
  background: url("../styles/images/inspur.png") no-repeat;
133
126
  background-size: 100%;
134
- float: left;
135
- margin-top: 20px;
127
+ background-position: center; /* 图片在背景区域内居中显示 */
128
+ //float: left;
129
+ //margin-top: 20px;
136
130
  }
137
131
  .divider{
138
132
  height: 33px;
139
133
  width: 2px;
140
134
  border-right: 2px dashed fade(@_black,30%);
141
- float: left;
142
- margin: 15px;
135
+ //float: left;
136
+ margin: 0 12px 0 14px;
143
137
  }
144
138
  .system-name{
145
- float: left;
139
+ //float: left;
146
140
  font-weight: bold;
147
141
  font-size: 20px;
148
142
  margin-right: 15px;
@@ -1,89 +1,89 @@
1
- <template>
2
- <div class="pro-layout-nav-slide-wrapper">
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>
1
+ <template>
2
+ <div class="pro-layout-nav-slide-wrapper">
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>
@@ -1,176 +1,176 @@
1
- <template>
2
- <div class="menu-list" >
3
- <ul class="top-menu" 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" 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
- pointer:0,
32
- flag:true,
33
- arrowFlag: true,
34
- acceptAppId: '',
35
- navList: [],
36
- topMenList: [],
37
- topTqmMenList:[],
38
- otherList: [],
39
- activeName: '',
40
- topMenuNum: 7,
41
- lastTopMenuNum:-1,
42
- originMenuList: []
43
- }
44
- },
45
- methods: {
46
- initListener() {
47
- Bus.$on('system-info',(data) => {
48
- this.initSystemInfo(data);
49
- })
50
- Bus.$on('nav-list', (data) => {
51
- this.initNav(data)
52
- })
53
- Bus.$on('change-app', ({ appId, appInfo }) => {
54
- this.changeApp(appId, appInfo)
55
- })
56
- },
57
- destroyListener() {
58
- Bus.$off('system-info')
59
- Bus.$off('nav-list')
60
- Bus.$off('change-app')
61
- },
62
- initSystemInfo(data) {
63
- if (data) {
64
- this.topMenuNum = data.topMenu ? data.topMenu : 4;
65
- this.acceptAppId = data.acceptAppId ? data.acceptAppId : '';
66
- this.initNav(this.navList)
67
- }
68
- },
69
- initNav(data) {
70
- if (data.toString() === this.navList.toString() && this.topMenuNum === this.lastTopMenuNum) {
71
- return
72
- }
73
- this.navList = data
74
- this.lastTopMenuNum = this.topMenuNum
75
- if (data.length > this.topMenuNum) {
76
- let navList = deepCopy(data)
77
- this.topMenList = navList
78
- this.$emit('topMen-list', this.topMenList);
79
- this.$emit('topMen-num', this.topMenuNum);
80
- this.$emit('topMen-true', true);
81
- // this.topMenList = navList.splice(0, this.topMenuNum)
82
- // this.otherList = navList
83
- } else {
84
- this.topMenList = this.navList
85
- this.$emit('topMen-true', false);
86
- }
87
- if (this.topMenList.length > 0) {
88
- let appId = this.topMenList[0].appId
89
- for (let i = 0; i < this.topMenList.length; i++) {
90
- if (this.topMenList[i].selected == true) {
91
- appId = this.topMenList[i].appId
92
- }
93
- }
94
- if (this.activeName) {
95
- appId = this.activeName
96
- }
97
- this.selectApp(appId)
98
- }
99
- },
100
- changeApp(appId, appInfo){
101
- this.activeName = appId
102
- },
103
- selectApp(appId) {
104
- this.activeName = appId
105
- let res = this.navList.filter(app => app.appId == appId)
106
- Bus.$emit('change-app', { appId, appInfo: res[0] })
107
- },
108
- },
109
- watch: {
110
- acceptInt(val){
111
- this.pointer = val;
112
- },
113
- acceptAppId(val) {
114
- this.selectApp(val)
115
- }
116
- },
117
- created() {
118
- this.initListener()
119
- },
120
- beforeDestroy() {
121
- this.destroyListener()
122
- }
123
- }
124
- </script>
125
-
126
- <style scoped lang="less">
127
- @import '@lambo-design/core/src/styles/default.less';
128
- .menu-list {
129
- height: 100%;
130
- line-height: 24px;
131
- //color: #ffffff;
132
- cursor: pointer;
133
- font-size: 16px;
134
- margin-left: 53px;
135
- .top-menu {
136
- overflow: hidden;
137
- height: 100%;
138
- .top-menu-item {
139
- position: relative;
140
- height: 100%;
141
- //color: #FFFFFF;
142
- list-style: none;
143
- float: left;
144
- &:hover {
145
- //background: transparent;
146
- .menu-item {
147
- //color: #fff;
148
- }
149
- }
150
- &.active {
151
- //background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0)) !important;
152
- //border-bottom: 2px solid var(--primary-color-tint-5, @_primary-color-tint-5);
153
- .menu-item {
154
- //color: #fff;
155
- }
156
- }
157
- .menu-item {
158
- padding: 2px 0px 0px 8px;
159
- margin: 0px 30px;
160
- }
161
- .menu-icon {
162
- height: 20px;
163
- line-height: 20px;
164
- text-align: center;
165
- //position: absolute;
166
- left: 14px;
167
- }
168
- .menu-txt {
169
- text-align: center;
170
- font-size: 14px;
171
- line-height: 2;
172
- }
173
- }
174
- }
175
- }
176
- </style>
1
+ <template>
2
+ <div class="menu-list" >
3
+ <ul class="top-menu" 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" 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
+ pointer:0,
32
+ flag:true,
33
+ arrowFlag: true,
34
+ acceptAppId: '',
35
+ navList: [],
36
+ topMenList: [],
37
+ topTqmMenList:[],
38
+ otherList: [],
39
+ activeName: '',
40
+ topMenuNum: 7,
41
+ lastTopMenuNum:-1,
42
+ originMenuList: []
43
+ }
44
+ },
45
+ methods: {
46
+ initListener() {
47
+ Bus.$on('system-info',(data) => {
48
+ this.initSystemInfo(data);
49
+ })
50
+ Bus.$on('nav-list', (data) => {
51
+ this.initNav(data)
52
+ })
53
+ Bus.$on('change-app', ({ appId, appInfo }) => {
54
+ this.changeApp(appId, appInfo)
55
+ })
56
+ },
57
+ destroyListener() {
58
+ Bus.$off('system-info')
59
+ Bus.$off('nav-list')
60
+ Bus.$off('change-app')
61
+ },
62
+ initSystemInfo(data) {
63
+ if (data) {
64
+ this.topMenuNum = data.topMenu ? data.topMenu : 4;
65
+ this.acceptAppId = data.acceptAppId ? data.acceptAppId : '';
66
+ this.initNav(this.navList)
67
+ }
68
+ },
69
+ initNav(data) {
70
+ if (data.toString() === this.navList.toString() && this.topMenuNum === this.lastTopMenuNum) {
71
+ return
72
+ }
73
+ this.navList = data
74
+ this.lastTopMenuNum = this.topMenuNum
75
+ if (data.length > this.topMenuNum) {
76
+ let navList = deepCopy(data)
77
+ this.topMenList = navList
78
+ this.$emit('topMen-list', this.topMenList);
79
+ this.$emit('topMen-num', this.topMenuNum);
80
+ this.$emit('topMen-true', true);
81
+ // this.topMenList = navList.splice(0, this.topMenuNum)
82
+ // this.otherList = navList
83
+ } else {
84
+ this.topMenList = this.navList
85
+ this.$emit('topMen-true', false);
86
+ }
87
+ if (this.topMenList.length > 0) {
88
+ let appId = this.topMenList[0].appId
89
+ for (let i = 0; i < this.topMenList.length; i++) {
90
+ if (this.topMenList[i].selected == true) {
91
+ appId = this.topMenList[i].appId
92
+ }
93
+ }
94
+ if (this.activeName) {
95
+ appId = this.activeName
96
+ }
97
+ this.selectApp(appId)
98
+ }
99
+ },
100
+ changeApp(appId, appInfo){
101
+ this.activeName = appId
102
+ },
103
+ selectApp(appId) {
104
+ this.activeName = appId
105
+ let res = this.navList.filter(app => app.appId == appId)
106
+ Bus.$emit('change-app', { appId, appInfo: res[0] })
107
+ },
108
+ },
109
+ watch: {
110
+ acceptInt(val){
111
+ this.pointer = val;
112
+ },
113
+ acceptAppId(val) {
114
+ this.selectApp(val)
115
+ }
116
+ },
117
+ created() {
118
+ this.initListener()
119
+ },
120
+ beforeDestroy() {
121
+ this.destroyListener()
122
+ }
123
+ }
124
+ </script>
125
+
126
+ <style scoped lang="less">
127
+ @import '@lambo-design/core/src/styles/default.less';
128
+ .menu-list {
129
+ height: 100%;
130
+ line-height: 24px;
131
+ //color: #ffffff;
132
+ cursor: pointer;
133
+ font-size: 16px;
134
+ margin-left: 53px;
135
+ .top-menu {
136
+ overflow: hidden;
137
+ height: 100%;
138
+ .top-menu-item {
139
+ position: relative;
140
+ height: 100%;
141
+ //color: #FFFFFF;
142
+ list-style: none;
143
+ float: left;
144
+ &:hover {
145
+ //background: transparent;
146
+ .menu-item {
147
+ //color: #fff;
148
+ }
149
+ }
150
+ &.active {
151
+ //background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0)) !important;
152
+ //border-bottom: 2px solid var(--primary-color-tint-5, @_primary-color-tint-5);
153
+ .menu-item {
154
+ //color: #fff;
155
+ }
156
+ }
157
+ .menu-item {
158
+ padding: 2px 0px 0px 8px;
159
+ margin: 0px 30px;
160
+ }
161
+ .menu-icon {
162
+ height: 20px;
163
+ line-height: 20px;
164
+ text-align: center;
165
+ //position: absolute;
166
+ left: 14px;
167
+ }
168
+ .menu-txt {
169
+ text-align: center;
170
+ font-size: 14px;
171
+ line-height: 2;
172
+ }
173
+ }
174
+ }
175
+ }
176
+ </style>
package/src/index.vue CHANGED
@@ -331,7 +331,7 @@ export default {
331
331
  .pro-layout-logo-wrapper{
332
332
  .logo{
333
333
  height: 45px;
334
- margin-top: 14px;
334
+ //margin-top: 14px;
335
335
  }
336
336
  .divider{
337
337
  height: 26px;