@lambo-design/pro-layout 1.0.0-beta.27 → 1.0.0-beta.271

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.27",
3
+ "version": "1.0.0-beta.271",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
@@ -9,9 +9,9 @@
9
9
  "access": "public",
10
10
  "registry": "https://registry.npmjs.org/"
11
11
  },
12
- "dependencies": {
13
- "@lambo-design/core": "4.7.1-beta.37",
14
- "@lambo-design/shared": "1.0.0-beta.17"
12
+ "devDependencies": {
13
+ "@lambo-design/shared": "^1.0.0-beta.136",
14
+ "@lambo-design/core": "^4.7.1-beta.129"
15
15
  },
16
16
  "scripts": {}
17
17
  }
@@ -1,17 +1,20 @@
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>
8
8
  </div>
9
- <div class="nav-box">
9
+ <div class="nav-box" v-show="!systemInfo || !systemInfo.navType || systemInfo.navType == 'dropdown'">
10
10
  <LamboProNav></LamboProNav>
11
11
  </div>
12
12
  <div class="tools-box">
13
13
  <LamboProTools></LamboProTools>
14
14
  </div>
15
+ <div v-show="systemInfo && systemInfo.navType && systemInfo.navType == 'slide'">
16
+ <LamboProNavSildeBtn></LamboProNavSildeBtn>
17
+ </div>
15
18
  </div>
16
19
  </template>
17
20
 
@@ -19,14 +22,54 @@
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 LamboProNavSildeBtn from './pro-layout-nav-slide-btn'
22
26
  import LamboProTools from './pro-layout-tools'
27
+ import Bus from "@lambo-design/shared/utils/bus";
23
28
  export default {
24
29
  name: "pro-layout-header",
30
+ props:{
31
+ acceptAppId: {
32
+ type: String,
33
+ default:''
34
+ }
35
+ },
36
+ data(){
37
+ return {
38
+ systemInfo: {},
39
+ }
40
+ },
25
41
  components: {
26
42
  LamboProTrigger,
27
43
  LamboProLogo,
28
44
  LamboProNav,
45
+ LamboProNavSildeBtn,
29
46
  LamboProTools
47
+ },
48
+ computed:{
49
+ menuScalingStyle(){
50
+ return this.systemInfo.menuScaling === '1' ? '' : {marginLeft:'25px'}
51
+ }
52
+ },
53
+ methods:{
54
+ initListener(){
55
+ Bus.$on('system-info',(data)=>{
56
+ this.initSystem(data)
57
+ });
58
+ },
59
+ destroyListener(){
60
+ Bus.$off('system-info')
61
+ },
62
+ initSystem(data){
63
+ if (data) {
64
+ this.systemInfo = data;
65
+ }
66
+ }
67
+ },
68
+ created(){
69
+ this.initListener();
70
+ },
71
+ beforeDestroy(){
72
+ this.destroyListener();
30
73
  }
31
74
  }
32
75
  </script>
@@ -49,4 +92,4 @@ export default {
49
92
  float: right;
50
93
  }
51
94
  }
52
- </style>
95
+ </style>
@@ -1,30 +1,92 @@
1
1
  <template>
2
- <div class="pro-layout-logo-wrapper">
3
- <div class="logo" :style="logoStyle"></div>
4
- <div class="divider"></div>
5
- <div class="system-name">{{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" :style="logoStyle"></div>
6
+ </Col>
7
+ <Col>
8
+ <div class="divider" v-if="systemInfo.systemLogo"></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
 
9
17
  <script>
10
18
  import Bus from '@lambo-design/shared/utils/bus'
11
19
  export default {
20
+
12
21
  name: "pro-layout-logo",
22
+ props:{
23
+ routeName:String,
24
+ default:''
25
+ },
13
26
  data(){
14
27
  return {
15
28
  systemInfo: {},
16
- systemName: '后台管理系统'
29
+ systemName: '后台管理系统',
30
+ isHovered: false,
31
+ src:''
17
32
  }
18
33
  },
19
34
  computed:{
20
- logoStyle(){
35
+ logoStyle() {
36
+ let style = '';
21
37
  if (this.systemInfo && this.systemInfo.systemLogo) {
22
- return 'background: url("' + this.systemInfo.systemLogo + '") no-repeat;background-size: 100%;'
38
+ style += `background: url("${this.systemInfo.systemLogo}") no-repeat; background-size: 100%;background-position:center;`;
39
+ // 如果 systemInfo.logoWidth 存在且不为空,则添加到样式
40
+ if (this.systemInfo.logoWidth && this.systemInfo.logoWidth !== '') {
41
+ style += `width: ${this.systemInfo.logoWidth}px;`;
42
+ }
43
+ // 如果 systemInfo.logoTop 存在且不为空,则添加到样式
44
+ // if (this.systemInfo.logoTop && this.systemInfo.logoTop !== '') {
45
+ // style += `margin-top: ${this.systemInfo.logoTop}px;`;
46
+ // }
47
+ style += `text-align-last: justify;`
48
+ }
49
+ return style;
50
+ },
51
+
52
+
53
+ nameStyle() {
54
+ let style = '';
55
+ if (this.systemInfo && this.systemInfo.nameSize) {
56
+ const lines = this.systemInfo.nameSize; // 行数
57
+ const maxHeight = lineHeight * lines; // 计算最大高度
58
+
59
+ // 根据nameSize设置margin-top
60
+ // if (lines == 1) {
61
+ // style += `margin-top: 12px;`;
62
+ // } else if (lines == 2) {
63
+ // style += `margin-top: 5px; `;
64
+ // }
65
+
66
+ // 动态计算字体大小
67
+ const fontSize = Math.max(20 - (lines - 1) * 4, 15); // 字体大小递减
68
+ const lineHeight = fontSize + 5; // 固定行高
69
+ const width = (this.systemName.length / lines) * fontSize + 20;
70
+
71
+ // 组装样式字符串
72
+ style += `line-height: ${lineHeight}px;`;
73
+ style += `font-size: ${fontSize}px;`;
74
+ style += `max-height: ${maxHeight}px;`; // 设置最大高度限制行数
75
+ style += `width: ${width}px;`; // 设置宽度
76
+ style += `overflow: hidden;`; // 超出部分隐藏
77
+ style += `word-wrap: break-word;`; // 允许单词内换行
78
+ style += `white-space: normal;`; // 默认的换行方式
79
+ style += `text-align-last: justify;`;
80
+ style += `text-align: justify;`;
23
81
  }
24
- return '';
82
+ return style;
25
83
  }
84
+
26
85
  },
27
86
  methods: {
87
+ handleClick(){
88
+ Bus.$emit('click-logo')
89
+ },
28
90
  initListener(){
29
91
  Bus.$on('system-info',(data)=>{
30
92
  this.initSystem(data)
@@ -40,7 +102,8 @@ export default {
40
102
  this.systemName = data.systemName;
41
103
  }
42
104
  }
43
- }
105
+ },
106
+
44
107
  },
45
108
  created(){
46
109
  this.initListener();
@@ -52,28 +115,32 @@ export default {
52
115
  </script>
53
116
 
54
117
  <style scoped lang="less">
118
+ @import "@lambo-design/core/src/styles/default";
55
119
  .pro-layout-logo-wrapper{
56
120
  overflow: hidden;
121
+ cursor:pointer;
57
122
  .logo{
58
123
  width: 150px;
59
- height: 55px;
60
- background: url("../styles/images/logo.png") no-repeat;
124
+ height: 43px;
125
+ background: url("../styles/images/inspur.png") no-repeat;
61
126
  background-size: 100%;
62
- float: left;
63
- margin-top: 8px;
127
+ background-position: center; /* 图片在背景区域内居中显示 */
128
+ //float: left;
129
+ //margin-top: 20px;
64
130
  }
65
131
  .divider{
66
132
  height: 33px;
67
133
  width: 2px;
68
- border-right: 2px dashed fade(#ffffff,30%);
69
- float: left;
70
- margin: 15px;
134
+ border-right: 2px dashed fade(@_black,30%);
135
+ //float: left;
136
+ margin: 0 12px 0 14px;
71
137
  }
72
138
  .system-name{
73
- float: left;
139
+ //float: left;
74
140
  font-weight: bold;
75
141
  font-size: 20px;
76
142
  margin-right: 15px;
143
+
77
144
  }
78
145
  }
79
- </style>
146
+ </style>
@@ -0,0 +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>
@@ -0,0 +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>