@lambo-design/pro-layout 1.0.0-beta.36 → 1.0.0-beta.360

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.
Files changed (36) hide show
  1. package/package.json +11 -4
  2. package/src/components/pro-layout-header/index.vue +112 -0
  3. package/src/components/pro-layout-header/pro-layout-logo/index.vue +146 -0
  4. package/src/components/pro-layout-header/pro-layout-nav/components/pro-layout-nav-slide-menu.vue +195 -0
  5. package/src/components/pro-layout-header/pro-layout-nav/index-slide.vue +89 -0
  6. package/src/components/pro-layout-header/pro-layout-nav/index.vue +162 -0
  7. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-collect.vue +77 -0
  8. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-fullscreen.vue +142 -0
  9. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-icons.vue +79 -0
  10. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-intl.vue +79 -0
  11. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-notice.vue +131 -0
  12. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-search.vue +300 -0
  13. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-todo.vue +139 -0
  14. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-user.vue +62 -0
  15. package/src/components/pro-layout-header/pro-layout-tools/index.vue +28 -0
  16. package/src/components/{pro-layout-trigger.vue → pro-layout-header/pro-layout-trigger/index.vue} +27 -3
  17. package/src/components/{pro-layout-sider-collapsed-menu.vue → pro-layout-sider/components/pro-layout-sider-collapsed-menu.vue} +30 -11
  18. package/src/components/{pro-layout-sider-icon.vue → pro-layout-sider/components/pro-layout-sider-icon.vue} +2 -2
  19. package/src/components/pro-layout-sider/components/pro-layout-sider-menu-item.vue +137 -0
  20. package/src/components/pro-layout-sider/components/pro-layout-sider-other-menu.vue +137 -0
  21. package/src/components/pro-layout-sider/components/pro-layout-sider-search.vue +352 -0
  22. package/src/components/pro-layout-sider/index.vue +450 -0
  23. package/src/components/{pro-layout-tabs.vue → pro-layout-tabs/index.vue} +70 -4
  24. package/src/index.vue +168 -21
  25. package/src/styles/color.less +258 -0
  26. package/src/styles/images/xiaoxitongzhi.png +0 -0
  27. package/src/styles/other-menu.less +111 -0
  28. package/src/utils/menuItem.js +10 -0
  29. package/src/utils/sider.js +16 -1
  30. package/src/components/pro-layout-header.vue +0 -52
  31. package/src/components/pro-layout-logo.vue +0 -79
  32. package/src/components/pro-layout-nav.vue +0 -150
  33. package/src/components/pro-layout-sider-menu-item.vue +0 -37
  34. package/src/components/pro-layout-sider.vue +0 -240
  35. package/src/components/pro-layout-tools-user.vue +0 -84
  36. package/src/components/pro-layout-tools.vue +0 -21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambo-design/pro-layout",
3
- "version": "1.0.0-beta.36",
3
+ "version": "1.0.0-beta.360",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
@@ -10,8 +10,15 @@
10
10
  "registry": "https://registry.npmjs.org/"
11
11
  },
12
12
  "devDependencies": {
13
- "@lambo-design/shared": "^1.0.0-beta.26",
14
- "@lambo-design/core": "^4.7.1-beta.45"
13
+ "@lambo-design/core": "^4.7.1-beta.149",
14
+ "@lambo-design/shared": "^1.0.0-beta.237"
15
15
  },
16
- "scripts": {}
16
+ "scripts": {
17
+ "release-pro-layout": "pnpm release-beta && git push --follow-tags && pnpm re-publish",
18
+ "release-major": "standard-version --release-as major",
19
+ "release-minor": "standard-version --release-as minor",
20
+ "release-patch": "standard-version --release-as patch",
21
+ "release-beta": "standard-version --prerelease beta",
22
+ "re-publish": "pnpm publish --access public --no-git-checks"
23
+ }
17
24
  }
@@ -0,0 +1,112 @@
1
+ <template>
2
+ <div class="pro-layout-header-wrapper">
3
+ <div class="trigger-box" :style="menuScalingStyle">
4
+ <slot name="pro-layout-trigger">
5
+ <LamboProTrigger v-if="systemInfo.menuScaling === '1'" :menu-scaling-status="systemInfo.menuScalingStatus" :hide-menu-logo="hideMenuLogo"></LamboProTrigger>
6
+ </slot>
7
+ </div>
8
+ <div class="logo-box">
9
+ <slot name="pro-layout-logo">
10
+ <LamboProLogo></LamboProLogo>
11
+ </slot>
12
+ </div>
13
+ <div class="nav-box" v-show="!systemInfo || !systemInfo.navType || systemInfo.navType == 'dropdown'">
14
+ <slot name="pro-layout-nav">
15
+ <LamboProNav></LamboProNav>
16
+ </slot>
17
+ </div>
18
+ <div class="tools-box">
19
+ <LamboProTools>
20
+ <template slot = "pro-layout-icons">
21
+ <slot name="pro-layout-icons"></slot>
22
+ </template>
23
+ <template slot = "pro-layout-user">
24
+ <slot name="pro-layout-user"></slot>
25
+ </template>
26
+ </LamboProTools>
27
+ </div>
28
+ <div v-show="systemInfo && systemInfo.navType && systemInfo.navType == 'slide'">
29
+ <LamboProNavSilde></LamboProNavSilde>
30
+ </div>
31
+ </div>
32
+ </template>
33
+
34
+ <script>
35
+ import LamboProTrigger from './pro-layout-trigger'
36
+ import LamboProLogo from './pro-layout-logo'
37
+ import LamboProNav from './pro-layout-nav'
38
+ import LamboProNavSilde from './pro-layout-nav/index-slide'
39
+ import LamboProTools from './pro-layout-tools'
40
+ import Bus from "@lambo-design/shared/utils/bus";
41
+ export default {
42
+ name: "pro-layout-header",
43
+ props:{
44
+ acceptAppId: {
45
+ type: String,
46
+ default:''
47
+ },
48
+ hideMenuLogo: {
49
+ type: Boolean,
50
+ default:true
51
+ }
52
+ },
53
+ data(){
54
+ return {
55
+ systemInfo: {},
56
+ }
57
+ },
58
+ components: {
59
+ LamboProTrigger,
60
+ LamboProLogo,
61
+ LamboProNav,
62
+ LamboProNavSilde,
63
+ LamboProTools
64
+ },
65
+ computed:{
66
+ menuScalingStyle(){
67
+ return this.systemInfo.menuScaling === '1' ? '' : {marginLeft:'25px'}
68
+ }
69
+ },
70
+ methods:{
71
+ initListener(){
72
+ Bus.$on('system-info',(data)=>{
73
+ this.initSystem(data)
74
+ });
75
+ },
76
+ destroyListener(){
77
+ Bus.$off('system-info')
78
+ },
79
+ initSystem(data){
80
+ if (data) {
81
+ this.systemInfo = data;
82
+ }
83
+ }
84
+ },
85
+ created(){
86
+ this.initListener();
87
+ },
88
+ beforeDestroy(){
89
+ this.destroyListener();
90
+ }
91
+ }
92
+ </script>
93
+
94
+ <style scoped lang="less">
95
+ .pro-layout-header-wrapper{
96
+ width: auto;
97
+ height: 64px;
98
+ .trigger-box{
99
+ float: left;
100
+ height: inherit;
101
+ }
102
+ .logo-box{
103
+ float: left;
104
+ }
105
+ .nav-box{
106
+ float: left;
107
+ }
108
+ .tools-box{
109
+ float: right;
110
+ }
111
+ }
112
+ </style>
@@ -0,0 +1,146 @@
1
+ <template>
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>
14
+ </div>
15
+ </template>
16
+
17
+ <script>
18
+ import Bus from '@lambo-design/shared/utils/bus'
19
+ export default {
20
+
21
+ name: "pro-layout-logo",
22
+ props:{
23
+ routeName:String,
24
+ default:''
25
+ },
26
+ data(){
27
+ return {
28
+ systemInfo: {},
29
+ systemName: '后台管理系统',
30
+ isHovered: false,
31
+ src:''
32
+ }
33
+ },
34
+ computed:{
35
+ logoStyle() {
36
+ let style = '';
37
+ if (this.systemInfo && this.systemInfo.systemLogo) {
38
+ style += `background: url("${this.systemInfo.systemLogo}") no-repeat; background-size: 100% 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;`;
81
+ }
82
+ return style;
83
+ }
84
+
85
+ },
86
+ methods: {
87
+ handleClick(){
88
+ Bus.$emit('click-logo')
89
+ },
90
+ initListener(){
91
+ Bus.$on('system-info',(data)=>{
92
+ this.initSystem(data)
93
+ });
94
+ },
95
+ destroyListener(){
96
+ Bus.$off('system-info')
97
+ },
98
+ initSystem(data){
99
+ if (data) {
100
+ this.systemInfo = data;
101
+ if (data.systemName) {
102
+ this.systemName = data.systemName;
103
+ }
104
+ }
105
+ },
106
+
107
+ },
108
+ created(){
109
+ this.initListener();
110
+ },
111
+ beforeDestroy(){
112
+ this.destroyListener();
113
+ }
114
+ }
115
+ </script>
116
+
117
+ <style scoped lang="less">
118
+ @import "@lambo-design/core/src/styles/default";
119
+ .pro-layout-logo-wrapper{
120
+ overflow: hidden;
121
+ cursor:pointer;
122
+ .logo{
123
+ width: 210px;
124
+ height: 40px;
125
+ background: url("../../../styles/images/inspur.png") no-repeat;
126
+ background-size: 100% 100%;
127
+ background-position: center; /* 图片在背景区域内居中显示 */
128
+ //float: left;
129
+ //margin-top: 20px;
130
+ }
131
+ .divider{
132
+ height: 33px;
133
+ width: 2px;
134
+ border-right: 2px dashed fade(@_black,30%);
135
+ //float: left;
136
+ margin: 0 12px 0 14px;
137
+ }
138
+ .system-name{
139
+ //float: left;
140
+ font-weight: bold;
141
+ font-size: 20px;
142
+ margin-right: 15px;
143
+
144
+ }
145
+ }
146
+ </style>
@@ -0,0 +1,195 @@
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" v-show="systemInfo.navLogo==='1'"><Icon :type="item.icon" :size="20"></Icon></p>
7
+ <p class="menu-txt" :title="item.name">{{ 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.systemInfo = data
67
+ this.layoutSize = data.layoutSize ? data.layoutSize : 'default';
68
+ this.topMenuNum = data.topMenu ? data.topMenu : 4;
69
+ this.acceptAppId = data.acceptAppId ? data.acceptAppId : '';
70
+ if (!this.activeName) {
71
+ this.activeName = this.acceptAppId
72
+ }
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
+ if (appId) {
109
+ this.activeName = appId
110
+ let res = this.navList.filter(app => app.appId == appId)
111
+ Bus.$emit('change-app', { appId, appInfo: res[0] })
112
+ }
113
+ },
114
+ changeApp(appId, appInfo){
115
+ if (appId) {
116
+ this.activeName = appId
117
+ }
118
+ }
119
+ },
120
+ watch: {
121
+ acceptInt(val){
122
+ this.pointer = val;
123
+ }
124
+ },
125
+ created() {
126
+ this.initListener()
127
+ },
128
+ beforeDestroy() {
129
+ this.destroyListener()
130
+ }
131
+ }
132
+ </script>
133
+
134
+ <style scoped lang="less">
135
+ @import '@lambo-design/core/src/styles/default.less';
136
+ .menu-list {
137
+ height: 100%;
138
+ line-height: 24px;
139
+ //color: #ffffff;
140
+ cursor: pointer;
141
+ font-size: 16px;
142
+ margin-left: 15px;
143
+ .top-menu {
144
+ overflow: hidden;
145
+ .top-menu-item {
146
+ padding-left: 15px;
147
+ padding-right: 15px;
148
+ position: relative;
149
+ height: 100%;
150
+ //color: #FFFFFF;
151
+ list-style: none;
152
+ float: left;
153
+ &:hover {
154
+ //background: transparent;
155
+ .menu-item {
156
+ //color: #fff;
157
+ }
158
+ }
159
+ &.active {
160
+ //background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0)) !important;
161
+ //border-bottom: 2px solid var(--primary-color-tint-5, @_primary-color-tint-5);
162
+ .menu-item {
163
+ //color: #fff;
164
+ //width: 135px;
165
+ }
166
+ }
167
+ .menu-item {
168
+ display: flex;
169
+ margin-top: 10px;
170
+ text-align: center;
171
+ //padding-right: 10px;
172
+ //width: 135px;
173
+
174
+ }
175
+ .menu-icon {
176
+ height: 20px;
177
+ line-height: 20px;
178
+ text-align: center;
179
+ margin-right: 10px;
180
+ //margin-left: 10px;
181
+ margin-top: 3px;
182
+ }
183
+ .menu-txt {
184
+ text-align: center;
185
+ font-size: 14px;
186
+ line-height: 2;
187
+ //width: 135px;
188
+ white-space: nowrap;
189
+ overflow: hidden;
190
+ text-overflow: ellipsis;
191
+ }
192
+ }
193
+ }
194
+ }
195
+ </style>
@@ -0,0 +1,89 @@
1
+ <template>
2
+ <div class="pro-layout-nav-slide-wrapper">
3
+ <div class="nav-box-slide">
4
+ <LamboProNavSlideMenu :accept-int="pointer" @topMen-list="handleCustomEvent" @topMen-num="topMen" @topMen-true="topMenTrue"></LamboProNavSlideMenu>
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 LamboProNavSlideMenu from './components/pro-layout-nav-slide-menu'
29
+ export default {
30
+ data(){
31
+ return {
32
+ pointer:0,
33
+ topList:[],
34
+ topNum:0,
35
+ arrowFlag: true,
36
+ }
37
+ },
38
+ components: {
39
+ LamboProNavSlideMenu
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>