@lambo-design/pro-layout 1.0.0-beta.114 → 1.0.0-beta.116
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 +1 -1
- package/src/components/pro-layout-nav.vue +1 -0
- package/src/components/pro-layout-other-menu.vue +19 -10
- package/src/components/pro-layout-sider-menu-item.vue +2 -0
- package/src/components/pro-layout-sider.vue +2 -11
- package/src/index.vue +1 -4
- package/src/styles/other-menu.less +6 -10
package/package.json
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
placement="left"
|
|
27
27
|
>
|
|
28
28
|
<div v-if="drawer.type=='history'" class="other-menu-history">
|
|
29
|
-
<div v-for="
|
|
29
|
+
<div v-for="item in list" class="other-menu-history-item">
|
|
30
30
|
<div class="content" @click="handleClick(item)">
|
|
31
31
|
<Icon :type="item.icon"></Icon>
|
|
32
32
|
<span> {{ item.label }}</span>
|
|
@@ -37,10 +37,11 @@
|
|
|
37
37
|
</div>
|
|
38
38
|
</div>
|
|
39
39
|
<div v-if="drawer.type=='collect'" class="other-menu-collect">
|
|
40
|
-
<div v-for="
|
|
41
|
-
<div class="content"
|
|
42
|
-
<
|
|
43
|
-
|
|
40
|
+
<div v-for="item in list" class="other-menu-collect-item" @click="handleClick(item)">
|
|
41
|
+
<div class="content">
|
|
42
|
+
<Tooltip :content="item.label" :delay="1000">
|
|
43
|
+
<Icon :size="40" :type="item.icon"></Icon>
|
|
44
|
+
</Tooltip>
|
|
44
45
|
</div>
|
|
45
46
|
<div class="delete">
|
|
46
47
|
<Icon type="ios-close" @click.native.stop="handleCollectDelete(item)"></Icon>
|
|
@@ -61,9 +62,14 @@ export default {
|
|
|
61
62
|
components: {},
|
|
62
63
|
props: {
|
|
63
64
|
collapsed: {
|
|
64
|
-
type: Boolean
|
|
65
|
-
default:false
|
|
65
|
+
type: Boolean
|
|
66
66
|
},
|
|
67
|
+
serverContext: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: function() { // 设置默认值
|
|
70
|
+
return config.upmsServerContext;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
67
73
|
},
|
|
68
74
|
data() {
|
|
69
75
|
return {
|
|
@@ -90,6 +96,7 @@ export default {
|
|
|
90
96
|
if (value == 'history') {
|
|
91
97
|
this.drawer.title = '历史菜单'
|
|
92
98
|
this.drawer.url = '/manage/upmsMenuHistory/list'
|
|
99
|
+
|
|
93
100
|
} else {
|
|
94
101
|
this.drawer.title = '收藏菜单'
|
|
95
102
|
this.drawer.url = '/manage/upmsMenuCollect/list'
|
|
@@ -100,11 +107,13 @@ export default {
|
|
|
100
107
|
},
|
|
101
108
|
getList() {
|
|
102
109
|
this.list = []
|
|
103
|
-
ajax.get(
|
|
110
|
+
ajax.get(this.serverContext + this.drawer.url).then(resp => {
|
|
104
111
|
if (resp.data.code == 1) {
|
|
105
112
|
this.list = resp.data.data
|
|
113
|
+
console.log("this.list:", this.list)
|
|
106
114
|
if (this.drawer.type == 'collect') {
|
|
107
115
|
this.$store.commit('setCollectMenuList', this.list)
|
|
116
|
+
console.log("this.list2:", this.list)
|
|
108
117
|
}
|
|
109
118
|
}
|
|
110
119
|
})
|
|
@@ -114,14 +123,14 @@ export default {
|
|
|
114
123
|
this.drawer.model = false
|
|
115
124
|
},
|
|
116
125
|
handleHistoryDelete(item) {
|
|
117
|
-
ajax.get(
|
|
126
|
+
ajax.get(this.serverContext + "/manage/upmsMenuHistory/delete/" + item.historyId).then(resp => {
|
|
118
127
|
if (resp.data.code == 1) {
|
|
119
128
|
this.getList()
|
|
120
129
|
}
|
|
121
130
|
})
|
|
122
131
|
},
|
|
123
132
|
handleCollectDelete(item) {
|
|
124
|
-
ajax.get(
|
|
133
|
+
ajax.get(this.serverContext + "/manage/upmsMenuCollect/delete/" + item.collectId).then(resp => {
|
|
125
134
|
if (resp.data.code == 1) {
|
|
126
135
|
this.getList()
|
|
127
136
|
}
|
|
@@ -49,6 +49,7 @@ export default {
|
|
|
49
49
|
fetchCollectedMenus() {
|
|
50
50
|
ajax.get(config.upmsServerContext + "/manage/upmsMenuCollect/list").then(resp => {
|
|
51
51
|
const collectedMenus = resp.data.data;
|
|
52
|
+
// console.log('collectedMenus', collectedMenus)
|
|
52
53
|
if (Array.isArray(collectedMenus)) {
|
|
53
54
|
collectedMenus.forEach(menu => {
|
|
54
55
|
// 使用 menu 的 name 属性作为键
|
|
@@ -61,6 +62,7 @@ export default {
|
|
|
61
62
|
}).catch(err => {
|
|
62
63
|
console.error("Error fetching collected menus:", err);
|
|
63
64
|
});
|
|
65
|
+
// console.log('isCollected', this.isCollected)
|
|
64
66
|
},
|
|
65
67
|
toggleCollect(item) {
|
|
66
68
|
const self = this;
|
|
@@ -28,8 +28,6 @@
|
|
|
28
28
|
</template>
|
|
29
29
|
</template>
|
|
30
30
|
</Menu>
|
|
31
|
-
<ProLayoutOtherMenu @on-select="selectHandle"></ProLayoutOtherMenu>
|
|
32
|
-
|
|
33
31
|
<div v-show="collapsed" :list="menuList" class="menu-collapsed">
|
|
34
32
|
<template v-for="item in menuList">
|
|
35
33
|
<ProLayoutSiderCollapsedMenu v-if="item.children && item.children.length > 1" :key="`drop-menu-${item.name}`"
|
|
@@ -53,7 +51,6 @@ import Bus from "@lambo-design/shared/utils/bus";
|
|
|
53
51
|
import {deepCopy} from "@lambo-design/shared/utils/assist";
|
|
54
52
|
import generatorMenuList from "@lambo-design/shared/utils/menu/index";
|
|
55
53
|
import sider from '../utils/sider'
|
|
56
|
-
import ProLayoutOtherMenu from "./pro-layout-other-menu";
|
|
57
54
|
import ProLayoutSiderMenuItem from './pro-layout-sider-menu-item'
|
|
58
55
|
import ProLayoutSiderCollapsedMenu from './pro-layout-sider-collapsed-menu'
|
|
59
56
|
import {
|
|
@@ -66,8 +63,7 @@ export default {
|
|
|
66
63
|
name: "pro-layout-sider",
|
|
67
64
|
components: {
|
|
68
65
|
ProLayoutSiderMenuItem,
|
|
69
|
-
ProLayoutSiderCollapsedMenu
|
|
70
|
-
ProLayoutOtherMenu
|
|
66
|
+
ProLayoutSiderCollapsedMenu
|
|
71
67
|
},
|
|
72
68
|
data(){
|
|
73
69
|
return {
|
|
@@ -122,6 +118,7 @@ export default {
|
|
|
122
118
|
initMenu(data){
|
|
123
119
|
if (data && data.length > 0) {
|
|
124
120
|
let item = data[0];
|
|
121
|
+
// console.log("item:",item)
|
|
125
122
|
if (item.appId && item.appId !== this.appId) {
|
|
126
123
|
return;
|
|
127
124
|
}
|
|
@@ -129,9 +126,6 @@ export default {
|
|
|
129
126
|
this.originMenuList = deepCopy(data);
|
|
130
127
|
this.changeMenu()
|
|
131
128
|
},
|
|
132
|
-
selectHandle(name){
|
|
133
|
-
this.$emit('on-select', name)
|
|
134
|
-
},
|
|
135
129
|
changeApp(appId,appInfo){
|
|
136
130
|
this.appId = appId;
|
|
137
131
|
this.changeMenu()
|
|
@@ -224,9 +218,6 @@ export default {
|
|
|
224
218
|
<style scoped lang="less">
|
|
225
219
|
@import "@lambo-design/core/src/styles/default";
|
|
226
220
|
.pro-layout-sider-wrapper{
|
|
227
|
-
/deep/.ivu-menu{
|
|
228
|
-
margin-bottom: 50px;
|
|
229
|
-
}
|
|
230
221
|
/deep/.ivu-menu-submenu{
|
|
231
222
|
.ivu-menu{
|
|
232
223
|
background: #1A1A1A;
|
package/src/index.vue
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
:width="220"
|
|
12
12
|
:collapsed-width="64"
|
|
13
13
|
v-model="collapsed">
|
|
14
|
-
<LamboProLayoutSider ref="sider"
|
|
14
|
+
<LamboProLayoutSider ref="sider"></LamboProLayoutSider>
|
|
15
15
|
</i-sider>
|
|
16
16
|
<i-content class="pro-layout-content">
|
|
17
17
|
<i-layout class="pro-layout-content-layout">
|
|
@@ -123,9 +123,6 @@ export default {
|
|
|
123
123
|
handleClick(){
|
|
124
124
|
this.$emit('clickLogo')
|
|
125
125
|
},
|
|
126
|
-
handleSelect(name){
|
|
127
|
-
this.$emit('on-select',name)
|
|
128
|
-
},
|
|
129
126
|
initListener(){
|
|
130
127
|
Bus.$on('trigger-change',(data)=>{
|
|
131
128
|
this.triggerChange(data)
|
|
@@ -50,12 +50,11 @@
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
.other-menu-item {
|
|
53
|
-
color:
|
|
54
|
-
//color: #F0F0F0;
|
|
53
|
+
color: #F0F0F0;
|
|
55
54
|
text-align: center;
|
|
56
55
|
line-height: 50px;
|
|
57
56
|
height: 50px;
|
|
58
|
-
width:
|
|
57
|
+
width: 100px;
|
|
59
58
|
display: inline-block;
|
|
60
59
|
border-right: 2px solid #000000;
|
|
61
60
|
cursor: pointer;
|
|
@@ -74,7 +73,7 @@
|
|
|
74
73
|
|
|
75
74
|
|
|
76
75
|
.ivu-drawer {
|
|
77
|
-
left:
|
|
76
|
+
left: 256px;
|
|
78
77
|
height: calc(100% - 110px);
|
|
79
78
|
bottom: 0;
|
|
80
79
|
top: auto;
|
|
@@ -112,13 +111,10 @@
|
|
|
112
111
|
|
|
113
112
|
.other-menu-collect {
|
|
114
113
|
.other-menu-collect-item {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
//position: relative;
|
|
118
|
-
width: 100%;
|
|
119
|
-
height: 35px;
|
|
120
|
-
line-height: 35px;
|
|
114
|
+
display: inline-block;
|
|
115
|
+
margin: 8px;
|
|
121
116
|
position: relative;
|
|
117
|
+
|
|
122
118
|
.delete {
|
|
123
119
|
display: none;
|
|
124
120
|
position: absolute;
|