[缺陷修复](v2.5): 修复用户管理/角色管理/部门管理弹窗中三级部门不显示不显示的问题
This commit is contained in:
@@ -166,12 +166,19 @@ export default {
|
|||||||
},
|
},
|
||||||
getSupDepts(id) {
|
getSupDepts(id) {
|
||||||
crudDept.getDeptSuperior(id).then(res => {
|
crudDept.getDeptSuperior(id).then(res => {
|
||||||
this.depts = res.content.map(function(obj) {
|
const date = res.content
|
||||||
if (obj.hasChildren && !obj.children) {
|
this.buildDepts(date)
|
||||||
obj.children = null
|
this.depts = date
|
||||||
}
|
})
|
||||||
return obj
|
},
|
||||||
})
|
buildDepts(depts) {
|
||||||
|
depts.forEach(data => {
|
||||||
|
if (data.children) {
|
||||||
|
this.buildDepts(data.children)
|
||||||
|
}
|
||||||
|
if (data.hasChildren && !data.children) {
|
||||||
|
data.children = null
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getDepts() {
|
getDepts() {
|
||||||
|
|||||||
@@ -296,12 +296,19 @@ export default {
|
|||||||
ids.push(dept.id)
|
ids.push(dept.id)
|
||||||
})
|
})
|
||||||
getDeptSuperior(ids).then(res => {
|
getDeptSuperior(ids).then(res => {
|
||||||
this.depts = res.content.map(function(obj) {
|
const date = res.content
|
||||||
if (obj.hasChildren && !obj.children) {
|
this.buildDepts(date)
|
||||||
obj.children = null
|
this.depts = date
|
||||||
}
|
})
|
||||||
return obj
|
},
|
||||||
})
|
buildDepts(depts) {
|
||||||
|
depts.forEach(data => {
|
||||||
|
if (data.children) {
|
||||||
|
this.buildDepts(data.children)
|
||||||
|
}
|
||||||
|
if (data.hasChildren && !data.children) {
|
||||||
|
data.children = null
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取弹窗内部门数据
|
// 获取弹窗内部门数据
|
||||||
|
|||||||
@@ -409,12 +409,19 @@ export default {
|
|||||||
},
|
},
|
||||||
getSupDepts(deptId) {
|
getSupDepts(deptId) {
|
||||||
getDeptSuperior(deptId).then(res => {
|
getDeptSuperior(deptId).then(res => {
|
||||||
this.depts = res.content.map(function(obj) {
|
const date = res.content
|
||||||
if (obj.hasChildren && !obj.children) {
|
this.buildDepts(date)
|
||||||
obj.children = null
|
this.depts = date
|
||||||
}
|
})
|
||||||
return obj
|
},
|
||||||
})
|
buildDepts(depts) {
|
||||||
|
depts.forEach(data => {
|
||||||
|
if (data.children) {
|
||||||
|
this.buildDepts(data.children)
|
||||||
|
}
|
||||||
|
if (data.hasChildren && !data.children) {
|
||||||
|
data.children = null
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取弹窗内部门数据
|
// 获取弹窗内部门数据
|
||||||
|
|||||||
Reference in New Issue
Block a user