fix: hide disabled publishing departments
This commit is contained in:
parent
b90dbb5594
commit
650851b10d
@ -1092,6 +1092,8 @@ const isDepartmentActiveWithAncestors = (deptId?: number | null) => {
|
||||
if (!departmentList.value.length) return true
|
||||
|
||||
let currentDept = getDepartmentById(deptId)
|
||||
if (!currentDept) return false
|
||||
|
||||
while (currentDept) {
|
||||
if (currentDept.status !== undefined && currentDept.status !== 1) {
|
||||
return false
|
||||
@ -1102,7 +1104,12 @@ const isDepartmentActiveWithAncestors = (deptId?: number | null) => {
|
||||
if (!currentDept.parentId) {
|
||||
break
|
||||
}
|
||||
currentDept = getDepartmentById(currentDept.parentId)
|
||||
|
||||
const parentDept = getDepartmentById(currentDept.parentId)
|
||||
if (!parentDept) {
|
||||
return false
|
||||
}
|
||||
currentDept = parentDept
|
||||
}
|
||||
|
||||
return true
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user