【修改】修改bug
This commit is contained in:
@@ -461,9 +461,22 @@ export default {
|
||||
getTreeLabel(){
|
||||
this.$api.report.labelList().then(res => {
|
||||
this.treeData=res.data
|
||||
this.cascaderOptions=res.data
|
||||
this.cascaderOptions=this.getTreeData(res.data)
|
||||
})
|
||||
},
|
||||
//用递归方式去除children
|
||||
getTreeData(data) {
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
if (data[i].children.length < 1) {
|
||||
// children若为空数组,则将children设为undefined
|
||||
data[i].children = undefined;
|
||||
} else {
|
||||
// children若不为空数组,则继续 递归调用 本方法
|
||||
this.getTreeData(data[i].children);
|
||||
}
|
||||
}
|
||||
return data;
|
||||
},
|
||||
//标签搜索
|
||||
filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
@@ -1244,7 +1257,7 @@ export default {
|
||||
|
||||
.el-input__inner,
|
||||
.el-textarea__inner {
|
||||
font-size: 14px;
|
||||
font-size: 15px;
|
||||
font-weight: 400;
|
||||
color: #434343;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user