@lambo-design/pro-layout 1.0.0-beta.29 → 1.0.0-beta.290

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 +4 -4
  2. package/src/components/pro-layout-header/index.vue +95 -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 +185 -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 +159 -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 +74 -0
  10. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-notice.vue +131 -0
  11. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-search.vue +169 -0
  12. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-todo.vue +119 -0
  13. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-user.vue +62 -0
  14. package/src/components/{pro-layout-tools.vue → pro-layout-header/pro-layout-tools/index.vue} +5 -2
  15. package/src/components/{pro-layout-trigger.vue → pro-layout-header/pro-layout-trigger/index.vue} +2 -3
  16. package/src/components/{pro-layout-sider-collapsed-menu.vue → pro-layout-sider/components/pro-layout-sider-collapsed-menu.vue} +29 -11
  17. package/src/components/{pro-layout-sider-icon.vue → pro-layout-sider/components/pro-layout-sider-icon.vue} +2 -2
  18. package/src/components/pro-layout-sider/components/pro-layout-sider-menu-item.vue +104 -0
  19. package/src/components/pro-layout-sider/components/pro-layout-sider-other-menu.vue +137 -0
  20. package/src/components/pro-layout-sider/components/pro-layout-sider-search.vue +302 -0
  21. package/src/components/pro-layout-sider/index.vue +363 -0
  22. package/src/components/{pro-layout-tabs.vue → pro-layout-tabs/index.vue} +2 -2
  23. package/src/index.vue +112 -17
  24. package/src/styles/color.less +257 -0
  25. package/src/styles/images/inspur.png +0 -0
  26. package/src/styles/images/xiaoxitongzhi.png +0 -0
  27. package/src/styles/other-menu.less +89 -0
  28. package/src/utils/menuItem.js +6 -0
  29. package/src/utils/sider.js +1 -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/styles/images/{logo.png → tobacco.png} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambo-design/pro-layout",
3
- "version": "1.0.0-beta.29",
3
+ "version": "1.0.0-beta.290",
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.39",
14
- "@lambo-design/shared": "^1.0.0-beta.18"
12
+ "devDependencies": {
13
+ "@lambo-design/core": "^4.7.1-beta.129",
14
+ "@lambo-design/shared": "^1.0.0-beta.136"
15
15
  },
16
16
  "scripts": {}
17
17
  }
@@ -0,0 +1,95 @@
1
+ <template>
2
+ <div class="pro-layout-header-wrapper">
3
+ <div class="trigger-box" :style="menuScalingStyle">
4
+ <LamboProTrigger v-if="systemInfo.menuScaling === '1'"></LamboProTrigger>
5
+ </div>
6
+ <div class="logo-box">
7
+ <LamboProLogo></LamboProLogo>
8
+ </div>
9
+ <div class="nav-box" v-show="!systemInfo || !systemInfo.navType || systemInfo.navType == 'dropdown'">
10
+ <LamboProNav></LamboProNav>
11
+ </div>
12
+ <div class="tools-box">
13
+ <LamboProTools></LamboProTools>
14
+ </div>
15
+ <div v-show="systemInfo && systemInfo.navType && systemInfo.navType == 'slide'">
16
+ <LamboProNavSilde></LamboProNavSilde>
17
+ </div>
18
+ </div>
19
+ </template>
20
+
21
+ <script>
22
+ import LamboProTrigger from './pro-layout-trigger'
23
+ import LamboProLogo from './pro-layout-logo'
24
+ import LamboProNav from './pro-layout-nav'
25
+ import LamboProNavSilde from './pro-layout-nav/index-slide'
26
+ import LamboProTools from './pro-layout-tools'
27
+ import Bus from "@lambo-design/shared/utils/bus";
28
+ export default {
29
+ name: "pro-layout-header",
30
+ props:{
31
+ acceptAppId: {
32
+ type: String,
33
+ default:''
34
+ }
35
+ },
36
+ data(){
37
+ return {
38
+ systemInfo: {},
39
+ }
40
+ },
41
+ components: {
42
+ LamboProTrigger,
43
+ LamboProLogo,
44
+ LamboProNav,
45
+ LamboProNavSilde,
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();
73
+ }
74
+ }
75
+ </script>
76
+
77
+ <style scoped lang="less">
78
+ .pro-layout-header-wrapper{
79
+ width: auto;
80
+ height: 64px;
81
+ .trigger-box{
82
+ float: left;
83
+ height: inherit;
84
+ }
85
+ .logo-box{
86
+ float: left;
87
+ }
88
+ .nav-box{
89
+ float: left;
90
+ }
91
+ .tools-box{
92
+ float: right;
93
+ }
94
+ }
95
+ </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%;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: 150px;
124
+ height: 43px;
125
+ background: url("../../../styles/images/inspur.png") no-repeat;
126
+ background-size: 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,185 @@
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>
@@ -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>
@@ -0,0 +1,159 @@
1
+ <template>
2
+ <div class="pro-layout-nav-wrapper">
3
+ <Menu ref="topNav" mode="horizontal" theme="dark" :active-name="activeName" @on-select="selectApp">
4
+ <MenuItem :name="item.appId" v-for="item in topMenList" :key="item.appId">
5
+ {{ item.name }}
6
+ <div class="line"></div>
7
+ </MenuItem>
8
+ <Submenu name="other" v-if="otherList.length > 0">
9
+ <template slot="title">
10
+ ...
11
+ </template>
12
+ <MenuItem :name="item.appId" v-for="item in otherList" :key="item.appId">
13
+ {{ item.name }}
14
+ </MenuItem>
15
+ </Submenu>
16
+ </Menu>
17
+ </div>
18
+ </template>
19
+
20
+ <script>
21
+ import Bus from '@lambo-design/shared/utils/bus'
22
+ import { deepCopy } from '@lambo-design/shared/utils/assist'
23
+
24
+ export default {
25
+ name: 'pro-layout-nav',
26
+ props: {
27
+
28
+ },
29
+ data() {
30
+ return {
31
+ navList: [],
32
+ topMenList: [],
33
+ otherList: [],
34
+ activeName: '',
35
+ topMenuNum: 4,
36
+ lastTopMenuNum:-1,
37
+ acceptAppId: '',
38
+ originMenuList: []
39
+ }
40
+ },
41
+ methods: {
42
+ initListener() {
43
+ Bus.$on('system-info',(data) => {
44
+ this.initSystemInfo(data);
45
+ })
46
+ Bus.$on('nav-list', (data) => {
47
+ this.initNav(data)
48
+ })
49
+ Bus.$on('change-app', ({ appId, appInfo }) => {
50
+ this.changeApp(appId, appInfo)
51
+ })
52
+ Bus.$on('menu-list', (data) => {
53
+ this.initMenu(data)
54
+ })
55
+
56
+ },
57
+ destroyListener() {
58
+ Bus.$off('system-info')
59
+ Bus.$off('nav-list')
60
+ Bus.$off('menu-list')
61
+ Bus.$off('change-app')
62
+ },
63
+ initSystemInfo(data) {
64
+ if (data) {
65
+ this.topMenuNum = data.topMenu ? data.topMenu : 4;
66
+ this.acceptAppId = data.acceptAppId ? data.acceptAppId : '';
67
+ if (!this.activeName) {
68
+ this.activeName = this.acceptAppId;
69
+ }
70
+ this.initNav(this.navList)
71
+ }
72
+ },
73
+ initNav(data) {
74
+ if (data.toString() === this.navList.toString() && this.topMenuNum === this.lastTopMenuNum) {
75
+ return
76
+ }
77
+ this.navList = data
78
+ this.lastTopMenuNum = this.topMenuNum
79
+ if (data.length > this.topMenuNum) {
80
+ let navList = deepCopy(data)
81
+ this.topMenList = navList.splice(0, this.topMenuNum)
82
+ this.otherList = navList
83
+ } else {
84
+ this.topMenList = this.navList
85
+ this.otherList = []
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
+ initMenu(data) {
101
+ this.originMenuList = deepCopy(data)
102
+ },
103
+ selectApp(appId) {
104
+ if (appId) {
105
+ let res = this.navList.filter(app => app.appId == appId)
106
+ if (res && res.length > 0) {
107
+ Bus.$emit('change-app', { appId, appInfo: res[0] })
108
+ }
109
+ }
110
+ },
111
+ changeApp(appId, appInfo) {
112
+ if (appId) {
113
+ this.activeName = appId
114
+ this.$nextTick(() => {
115
+ this.$refs.topNav.updateActiveName()
116
+ })
117
+ }
118
+ }
119
+ },
120
+ watch: {
121
+ activeName() {
122
+ this.$nextTick(() => {
123
+ this.$refs.topNav.updateActiveName()
124
+ })
125
+ }
126
+ },
127
+ created() {
128
+ this.initListener()
129
+ },
130
+ beforeDestroy() {
131
+ this.destroyListener()
132
+ }
133
+ }
134
+ </script>
135
+
136
+ <style scoped lang="less">
137
+ @import '@lambo-design/core/src/styles/default.less';
138
+ .pro-layout-nav-wrapper {
139
+ .ivu-menu {
140
+ .ivu-menu-item {
141
+ &:hover {
142
+ .line {
143
+ position: absolute;
144
+ left: 0;
145
+ right: 0;
146
+ }
147
+ }
148
+ &.ivu-menu-item-active, &.ivu-menu-item-selected {
149
+ .line {
150
+ position: absolute;
151
+ left: 0;
152
+ right: 0;
153
+ }
154
+ }
155
+ }
156
+ }
157
+ }
158
+
159
+ </style>