|
|
@ -459,20 +459,19 @@ export default { |
|
|
|
page: 1, |
|
|
|
pageSize: 1000 |
|
|
|
}) |
|
|
|
this.classList = res.data.list |
|
|
|
this.classList = this.filterList(res.data.list) |
|
|
|
}, |
|
|
|
|
|
|
|
//处理集合子集空数组为undefined,解决平台分类选择时可选到分类 |
|
|
|
this.classList.forEach(firstClass => { |
|
|
|
if (firstClass.childs.length === 0) { |
|
|
|
firstClass.childs = undefined |
|
|
|
}else { |
|
|
|
firstClass.childs.forEach(secondClass => { |
|
|
|
if (secondClass.childs.length === 0){ |
|
|
|
secondClass.childs = undefined |
|
|
|
} |
|
|
|
}) |
|
|
|
//处理集合子集空数组为undefined,解决平台分类选择时可选到子分类 |
|
|
|
filterList(data) { |
|
|
|
data.forEach(i => { |
|
|
|
if (i.childs.length) { |
|
|
|
this.filterList(i.childs) |
|
|
|
} else { |
|
|
|
i.childs = null |
|
|
|
} |
|
|
|
}) |
|
|
|
return data |
|
|
|
}, |
|
|
|
|
|
|
|
showClassSet(prod) { |
|
|
|