fix: 1、修复customize只保留最后一项点击空白处,再打开customize新增选项,上次禁用的项还存在的问题;2、表格某一列数据为空时,添加-避免界面展示空白

This commit is contained in:
刘洪洪
2023-06-25 15:49:54 +08:00
parent 468026b3fa
commit eb611bdac9
6 changed files with 22 additions and 21 deletions

View File

@@ -70,8 +70,7 @@ export default {
return {
custom: [],
dragIndex: -1,
selectList: [],
lastIndex: -1
selectList: []
}
},
created () {
@@ -95,19 +94,13 @@ export default {
this.selectList = this.custom.filter(item => item.show)
// 最少保留一个选项
if (this.selectList.length === 1) {
let index = -1
this.custom.find((item, i) => {
index = i
return item.prop === this.selectList[0].prop
})
this.lastIndex = index
this.custom[index].disabled = true
} else if (this.lastIndex > -1) {
const obj = this.custom.find(item => item.prop === this.selectList[0].prop)
obj.disabled = true
} else if (this.selectList.length > 1) {
this.custom.forEach(item => {
// 该方案仅用于原始table列表无禁用的情况目前无原始列表禁用的情况后续有原始列表禁用的情况再修改
item.disabled = false
})
this.lastIndex = -1
}
this.save()
},