This commit is contained in:
zhutianqi
2021-07-08 19:09:20 +08:00
parent eaab0d5016
commit 7b9e8bc02b
3 changed files with 50 additions and 21 deletions
@@ -50,11 +50,14 @@ export default {
methods: {
// 右侧列表元素变化时触发
handleChange (newTargetKeys, direction, moveKeys) {
if (direction === 'left') {
if (newTargetKeys.length > 9) {
this.$message.warning('个人展示模块最多仅能展示9个')
}
if (direction === 'left') {
this.oldData.forEach( item => {
moveKeys.forEach( items => {
if (items === item.id) {
item.state = 1
item.state = 0
}
})
})
@@ -62,7 +65,7 @@ export default {
this.oldData.forEach( item => {
moveKeys.forEach( items => {
if (items === item.id) {
item.state = 0
item.state = 1
}
})
})
@@ -71,8 +74,8 @@ export default {
this.numData = []
},
selectedChange (sourceSelectedKeys, targetSelectedKeys) {
this.numData = sourceSelectedKeys
this.sourceSelectedKeys = targetSelectedKeys
this.numData = sourceSelectedKeys
this.sourceSelectedKeys = targetSelectedKeys
},
savePersonal () {
if (this.targetKeys.length === 0) {
@@ -81,6 +84,9 @@ export default {
type: 'warning'
})
return
} else if (this.targetKeys.length > 9) {
this.$message.warning('个人展示模块最多仅能展示9个')
return
}
this.$http.postData('sarPersonalCenter/sar-user-personal-menu/update',
{
@@ -107,7 +113,7 @@ export default {
res.data.records.map((item) => {
if (item.menuName === '首页') {
this.selected.push(item)
} else if (item.state == 0) {
} else if (item.state == 1) {
this.selected.push(item)
}
})