| | |
| | | if (index === 1) { |
| | | |
| | | }else{ |
| | | this.parentList = this.addChildren(await this.getTypeThird(), await this.getTypeSecond()); |
| | | this.parentList = await this.getTypeThird() |
| | | // this.parentList = this.addChildren(await this.getTypeThird(), await this.getTypeSecond()); |
| | | } |
| | | }, |
| | | addChildren(parentArr, childArr) { |
| | | // console.log(parentArr.length,childArr); |
| | | parentArr.forEach(item => { |
| | | item.children = []; |
| | | childArr.forEach(child => { |
| | | if (item.id === child.parentId) { |
| | | item.children.push(child); |
| | | } |
| | | }) |
| | | }) |
| | | console.log(parentArr); |
| | | return parentArr; |
| | | }, |
| | | // addChildren(parentArr, childArr) { |
| | | // // console.log(parentArr.length,childArr); |
| | | // parentArr.forEach(item => { |
| | | // item.children = []; |
| | | // childArr.forEach(child => { |
| | | // if (item.id === child.parentId) { |
| | | // item.children.push(child); |
| | | // } |
| | | // }) |
| | | // }) |
| | | // console.log(parentArr); |
| | | // return parentArr; |
| | | // }, |
| | | handleCheck(data, checked) { |
| | | this.things.parentId = data.name; |
| | | console.log(this.selectOrg.orgsid); |
| | |
| | | if (indexs < 0 && this.selectOrg.orgsid.length === 1 && checked) { |
| | | this.$message({ |
| | | message: '只能选择一个区域!', |
| | | type: 'error', |
| | | type: 'warning', |
| | | showClose: true |
| | | }) |
| | | // 设置已选择的节点为false 很重要 |