分别是一二三级,二三级名称不一样,使用props需要二三级名称一样,后台修改太大,只能前端将三级名称改为二级
selecCourse(e) {
console.log(e)
collegeTaskgetUserList({ courseId: e }).then(res => {
this.departmentList = res.data.deptParentVOList
console.log(this.departmentList)
this.departmentList.map(i => {
JSON.parse(JSON.stringify(i.deptVOList).replace(/userVOList/g, 'deptVOList'))
i.deptVOList = JSON.parse(JSON.stringify(i.deptVOList).replace(/userVOList/g, 'deptVOList'))
})
console.log('dsfd ', this.departmentList)
})
},
"deptParentVOList": [
{
"type": 1,
"id": 1,
"name": "总经理室",
"deptVOList": [
{
"type": 2,
"id": 258,
"name": "文职部",
"userVOList": [
{
"type": 3,
"id": 44,
"name": "杨晓桐"
},
{
"type": 3,
"id": 236,
"name": "刘花"
},
]
}
]
}
|