|
@@ -298,9 +298,21 @@ export default {
|
|
|
operateAuthInterface.getClassificationBySource({Source: this.default_tab}).then(res => {
|
|
|
if(res.Ret == 200){
|
|
|
this.classificationList = res.Data.List || []
|
|
|
+ //如果是三级分类,去掉最后一级分类的child
|
|
|
+ if([3,4,5].includes(this.default_tab)){
|
|
|
+ this.filterNodes(this.classificationList)
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ filterNodes(arr) {
|
|
|
+ arr.length && arr.forEach(item => {
|
|
|
+ item.Child && item.Child.length && this.filterNodes(item.Child)
|
|
|
+ if(item.Child && !item.Child.length) {
|
|
|
+ delete item.Child
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
changeTab({key}) {
|
|
|
this.default_tab = key;
|