|
@@ -374,23 +374,26 @@ export default {
|
|
|
},
|
|
|
treeselect(){
|
|
|
treeselect().then( data => {
|
|
|
- // let list = [];
|
|
|
- // for(let i=0;i<data.data[0].children.length;i++){
|
|
|
- // let obj = {
|
|
|
- // id:data.data[0].children[i].id,
|
|
|
- // label:data.data[0].children[i].label,
|
|
|
- // }
|
|
|
- // list.push(obj);
|
|
|
- // for(let o=0;o<data.data[0].children[i].children.length;o++){
|
|
|
- // let obj = {
|
|
|
- // id:data.data[0].children[i].children[o].id,
|
|
|
- // label:data.data[0].children[i].children[o].label,
|
|
|
- // }
|
|
|
- // list.push(obj);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // this.inspectionUnitArrayData = list;
|
|
|
- this.inspectionUnitArrayData = this.toArray(data.data);
|
|
|
+ let list = [];
|
|
|
+ for(let i=0;i<data.data[0].children.length;i++){
|
|
|
+ let obj = {
|
|
|
+ id:data.data[0].children[i].id,
|
|
|
+ label:data.data[0].children[i].label,
|
|
|
+ }
|
|
|
+ if(data.data[0].children[i].children){
|
|
|
+ for(let o=0;o<data.data[0].children[i].children.length;o++){
|
|
|
+ let objOne = {
|
|
|
+ id:data.data[0].children[i].children[o].id,
|
|
|
+ label:data.data[0].children[i].children[o].label,
|
|
|
+ }
|
|
|
+ list.push(objOne);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ list.push(obj);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.inspectionUnitArrayData = list;
|
|
|
+ // this.inspectionUnitArrayData = this.toArray(data.data);
|
|
|
});
|
|
|
},
|
|
|
toArray(data){
|