|
@ -1,13 +1,16 @@ |
|
|
|
|
|
|
|
|
import { isAuthorized } from '$utils' |
|
|
import { isAuthorized } from '$utils' |
|
|
let hrUser = JSON.parse(sessionStorage.getItem('hrUser')) |
|
|
const userData = JSON.parse(sessionStorage.getItem('hrUser')); |
|
|
let admin = false |
|
|
export const headerItemsFun = () => { |
|
|
hrUser && hrUser.adminHr.forEach(e => { |
|
|
let hrUser = userData || JSON.parse(sessionStorage.getItem('hrUser')); |
|
|
|
|
|
if (hrUser) { |
|
|
|
|
|
let admin = false |
|
|
|
|
|
hrUser && hrUser.adminHr.forEach(e => { |
|
|
if (e.id == hrUser.id) { |
|
|
if (e.id == hrUser.id) { |
|
|
admin = true |
|
|
admin = true |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
let headerItems = [admin ? { |
|
|
let headerItems = [admin ? { |
|
|
itemKey: "authCenter", |
|
|
itemKey: "authCenter", |
|
|
text: "权限中心", |
|
|
text: "权限中心", |
|
|
items: [{ |
|
|
items: [{ |
|
@ -23,9 +26,9 @@ let headerItems = [admin ? { |
|
|
text: "表单维护", |
|
|
text: "表单维护", |
|
|
to: "/humanAffairs/authCenter/formMaintenance" |
|
|
to: "/humanAffairs/authCenter/formMaintenance" |
|
|
}] |
|
|
}] |
|
|
} : {}, |
|
|
} : {}, |
|
|
|
|
|
|
|
|
isAuthorized('BASICACTIONMANAGEMENT') || isAuthorized('EMPLOYEEASSESSMENT') || isAuthorized('MIDDLELEVELASSESSMENT') || isAuthorized('SENIORASSESSMENT') || isAuthorized('REWARDANDPUNISHMENTMANAGEMENT') ? { |
|
|
isAuthorized('BASICACTIONMANAGEMENT') || isAuthorized('EMPLOYEEASSESSMENT') || isAuthorized('MIDDLELEVELASSESSMENT') || isAuthorized('SENIORASSESSMENT') || isAuthorized('REWARDANDPUNISHMENTMANAGEMENT') ? { |
|
|
itemKey: "achievements", |
|
|
itemKey: "achievements", |
|
|
text: "绩效考核", |
|
|
text: "绩效考核", |
|
|
items: [ |
|
|
items: [ |
|
@ -59,8 +62,8 @@ isAuthorized('BASICACTIONMANAGEMENT') || isAuthorized('EMPLOYEEASSESSMENT') || i |
|
|
text: "奖惩信息", |
|
|
text: "奖惩信息", |
|
|
to: "/humanAffairs/achievements/penalties/penaltiesRecord" |
|
|
to: "/humanAffairs/achievements/penalties/penaltiesRecord" |
|
|
} : {}] |
|
|
} : {}] |
|
|
} : {}, |
|
|
} : {}, |
|
|
isAuthorized('TRAININGDOSSIER') || isAuthorized('TRAININGMANAGEMENT') ? { |
|
|
isAuthorized('TRAININGDOSSIER') || isAuthorized('TRAININGMANAGEMENT') ? { |
|
|
itemKey: "train", |
|
|
itemKey: "train", |
|
|
text: "培训", |
|
|
text: "培训", |
|
|
items: [ |
|
|
items: [ |
|
@ -76,8 +79,8 @@ isAuthorized('TRAININGDOSSIER') || isAuthorized('TRAININGMANAGEMENT') ? { |
|
|
text: "培训管理", |
|
|
text: "培训管理", |
|
|
to: isAuthorized('TRAININGMANAGEMENT') ? "/humanAffairs/train/trainingManagement/personalTrainRecord" : "/humanAffairs/train/trainingManagement/departmentTrainRecord" |
|
|
to: isAuthorized('TRAININGMANAGEMENT') ? "/humanAffairs/train/trainingManagement/personalTrainRecord" : "/humanAffairs/train/trainingManagement/departmentTrainRecord" |
|
|
} : {}] |
|
|
} : {}] |
|
|
} : {}, |
|
|
} : {}, |
|
|
isAuthorized('RECRUITMENTRECORDS') || isAuthorized('SALESSTATISTICS') ? { |
|
|
isAuthorized('RECRUITMENTRECORDS') || isAuthorized('SALESSTATISTICS') ? { |
|
|
itemKey: "recruit", |
|
|
itemKey: "recruit", |
|
|
text: "招聘", |
|
|
text: "招聘", |
|
|
items: [isAuthorized('RECRUITMENTRECORDS') ? { |
|
|
items: [isAuthorized('RECRUITMENTRECORDS') ? { |
|
@ -92,8 +95,8 @@ isAuthorized('RECRUITMENTRECORDS') || isAuthorized('SALESSTATISTICS') ? { |
|
|
text: "销售统计", |
|
|
text: "销售统计", |
|
|
to: "/humanAffairs/recruit/salesStatistics/personnelDistribution" |
|
|
to: "/humanAffairs/recruit/salesStatistics/personnelDistribution" |
|
|
} : {}] |
|
|
} : {}] |
|
|
} : {}, |
|
|
} : {}, |
|
|
isAuthorized('LEAVEMANAGEMENT') || isAuthorized('EMPLOYEECOMMUNICATION') ? { |
|
|
isAuthorized('LEAVEMANAGEMENT') || isAuthorized('EMPLOYEECOMMUNICATION') ? { |
|
|
itemKey: "employeeRelationship", |
|
|
itemKey: "employeeRelationship", |
|
|
text: "员工关系", |
|
|
text: "员工关系", |
|
|
items: [isAuthorized('LEAVEMANAGEMENT') ? { |
|
|
items: [isAuthorized('LEAVEMANAGEMENT') ? { |
|
@ -108,8 +111,8 @@ isAuthorized('LEAVEMANAGEMENT') || isAuthorized('EMPLOYEECOMMUNICATION') ? { |
|
|
text: "员工沟通", |
|
|
text: "员工沟通", |
|
|
to: "/humanAffairs/employeeRelationship/communication/employeeCommunication" |
|
|
to: "/humanAffairs/employeeRelationship/communication/employeeCommunication" |
|
|
} : {}] |
|
|
} : {}] |
|
|
} : {}, |
|
|
} : {}, |
|
|
isAuthorized('PERSONNELFILEMANAGEMENT') || isAuthorized('DEPARTMENTARCHIVESMANAGEMENT') ? { |
|
|
isAuthorized('PERSONNELFILEMANAGEMENT') || isAuthorized('DEPARTMENTARCHIVESMANAGEMENT') ? { |
|
|
itemKey: "archivesCenter", |
|
|
itemKey: "archivesCenter", |
|
|
text: "档案中心", |
|
|
text: "档案中心", |
|
|
items: [isAuthorized('PERSONNELFILEMANAGEMENT') ? { |
|
|
items: [isAuthorized('PERSONNELFILEMANAGEMENT') ? { |
|
@ -125,9 +128,9 @@ isAuthorized('PERSONNELFILEMANAGEMENT') || isAuthorized('DEPARTMENTARCHIVESMANAG |
|
|
text: "部门档案", |
|
|
text: "部门档案", |
|
|
to: "/humanAffairs/archivesCenter/deptArchives/department" |
|
|
to: "/humanAffairs/archivesCenter/deptArchives/department" |
|
|
} : {}] |
|
|
} : {}] |
|
|
} : {}] |
|
|
} : {}] |
|
|
|
|
|
|
|
|
headerItems.map(e => { |
|
|
headerItems.map(e => { |
|
|
if (e.items != undefined) { |
|
|
if (e.items != undefined) { |
|
|
e.items = e.items.filter(element => { |
|
|
e.items = e.items.filter(element => { |
|
|
if (Object.keys(element).length !== 0) { |
|
|
if (Object.keys(element).length !== 0) { |
|
@ -136,13 +139,12 @@ headerItems.map(e => { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
return e |
|
|
return e |
|
|
}) |
|
|
}) |
|
|
headerItems = headerItems.filter(element => { |
|
|
headerItems = headerItems.filter(element => { |
|
|
if (Object.keys(element).length !== 0) { |
|
|
if (Object.keys(element).length !== 0) { |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
return headerItems; |
|
|
export { |
|
|
} |
|
|
headerItems |
|
|
|
|
|
} |
|
|
} |