Commit e55bc6c7 by ZhengJie

[缺陷修复](v2.5): 修复用户管理/角色管理/部门管理弹窗中三级部门不显示不显示的问题

parent 4e566ea6
......@@ -166,12 +166,19 @@ export default {
},
getSupDepts(id) {
crudDept.getDeptSuperior(id).then(res => {
this.depts = res.content.map(function(obj) {
if (obj.hasChildren && !obj.children) {
obj.children = null
}
return obj
})
const date = res.content
this.buildDepts(date)
this.depts = date
})
},
buildDepts(depts) {
depts.forEach(data => {
if (data.children) {
this.buildDepts(data.children)
}
if (data.hasChildren && !data.children) {
data.children = null
}
})
},
getDepts() {
......
......@@ -296,12 +296,19 @@ export default {
ids.push(dept.id)
})
getDeptSuperior(ids).then(res => {
this.depts = res.content.map(function(obj) {
if (obj.hasChildren && !obj.children) {
obj.children = null
}
return obj
})
const date = res.content
this.buildDepts(date)
this.depts = date
})
},
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) {
getDeptSuperior(deptId).then(res => {
this.depts = res.content.map(function(obj) {
if (obj.hasChildren && !obj.children) {
obj.children = null
}
return obj
})
const date = res.content
this.buildDepts(date)
this.depts = date
})
},
buildDepts(depts) {
depts.forEach(data => {
if (data.children) {
this.buildDepts(data.children)
}
if (data.hasChildren && !data.children) {
data.children = null
}
})
},
// 获取弹窗内部门数据
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment