Browse Source

(*)头部权限

master
ww664853070 2 years ago
parent
commit
44b1aa7c3d
  1. 105
      web/client/src/layout/components/header/contant.js

105
web/client/src/layout/components/header/contant.js

@ -1,4 +1,13 @@
const headerItems = [{
import { isAuthorized } from '$utils'
let hrUser = JSON.parse(sessionStorage.getItem('hrUser'))
let admin = false
hrUser && hrUser.adminHr.forEach(e => {
if (e.id == hrUser.id) {
admin = true
}
})
let headerItems = [admin ? {
itemKey: "authCenter", itemKey: "authCenter",
text: "权限中心", text: "权限中心",
items: [{ items: [{
@ -14,93 +23,125 @@ const headerItems = [{
text: "表单维护", text: "表单维护",
to: "/humanAffairs/authCenter/formMaintenance" to: "/humanAffairs/authCenter/formMaintenance"
}] }]
}, { } : {},
isAuthorized('BASICACTIONMANAGEMENT') || isAuthorized('EMPLOYEEASSESSMENT') || isAuthorized('MIDDLELEVELASSESSMENT') || isAuthorized('SENIORASSESSMENT') || isAuthorized('REWARDANDPUNISHMENTMANAGEMENT') ? {
itemKey: "achievements", itemKey: "achievements",
text: "绩效考核", text: "绩效考核",
items: [{ items: [
isAuthorized('BASICACTIONMANAGEMENT') ? {
fatherKey: "achievements", fatherKey: "achievements",
itemKey: "basicAction", itemKey: "basicAction",
text: "基本动作", text: "基本动作",
to: "/humanAffairs/achievements/basicAction/weeklyManagement" to: isAuthorized('WEEKLYREPORTMANAGEMENT') ? "/humanAffairs/achievements/basicAction/weeklyManagement" : isAuthorized('SALESLOG') ? "/humanAffairs/achievements/basicAction/saleLog" : "/humanAffairs/achievements/basicAction/pmLog"
}, { } : {},
isAuthorized('EMPLOYEEASSESSMENT') ? {
fatherKey: 'achievements', fatherKey: 'achievements',
itemKey: "employeeKPI", itemKey: "employeeKPI",
text: "员工考核", text: "员工考核",
to: "/humanAffairs/achievements/employeeKPI/probationer" to: isAuthorized('EMPLOYEEASSESSMENTDURINGPROBATIONARYPERIOD') ? "/humanAffairs/achievements/employeeKPI/probationer" : "/humanAffairs/achievements/employeeKPI/regular"
}, { } : {},
isAuthorized('MIDDLELEVELASSESSMENT') ? {
fatherKey: "achievements", fatherKey: "achievements",
itemKey: "middleKPI", itemKey: "middleKPI",
text: "中层考核", text: "中层考核",
to: "/humanAffairs/achievements/middleKPI/monthlyProcess" to: isAuthorized('MIDDLELEVELMONTHLYPROCESSASSESSMENT') ? "/humanAffairs/achievements/middleKPI/monthlyProcess" : "/humanAffairs/achievements/middleKPI/quarter"
}, { } : {},
isAuthorized('SENIORASSESSMENT') ? {
fatherKey: 'achievements', fatherKey: 'achievements',
itemKey: "highKPI", itemKey: "highKPI",
text: "高管考核", text: "高管考核",
to: "/humanAffairs/achievements/highKPI/highMonthly" to: isAuthorized('MONTHLYPROCESSASSESSMENTFORSENIORMANAGEMENT') ? "/humanAffairs/achievements/highKPI/highMonthly" : "/humanAffairs/achievements/highKPI/Highquarter"
}, { } : {},
isAuthorized('REWARDANDPUNISHMENTMANAGEMENT') ? {
fatherKey: 'achievements', fatherKey: 'achievements',
itemKey: "penalties", itemKey: "penalties",
text: "奖惩信息", text: "奖惩信息",
to: "/humanAffairs/achievements/penalties/penaltiesRecord" to: "/humanAffairs/achievements/penalties/penaltiesRecord"
}] } : {}]
}, { } : {},
isAuthorized('TRAININGDOSSIER') || isAuthorized('TRAININGMANAGEMENT') ? {
itemKey: "train", itemKey: "train",
text: "培训", text: "培训",
items: [{ items: [
isAuthorized('TRAININGDOSSIER') ? {
fatherKey: "train", fatherKey: "train",
itemKey: "trainFiles", itemKey: "trainFiles",
text: "培训档案", text: "培训档案",
to: "/humanAffairs/train/trainFiles/resourceRepository" to: "/humanAffairs/train/trainFiles/resourceRepository"
}, { } : {},
isAuthorized('TRAININGMANAGEMENT') ? {
fatherKey: "train", fatherKey: "train",
itemKey: "trainingManagement", itemKey: "trainingManagement",
text: "培训管理", text: "培训管理",
to: "/humanAffairs/train/trainingManagement/personalTrainRecord" to: isAuthorized('TRAININGMANAGEMENT') ? "/humanAffairs/train/trainingManagement/personalTrainRecord" : "/humanAffairs/train/trainingManagement/departmentTrainRecord"
}] } : {}]
}, { } : {},
isAuthorized('RECRUITMENTRECORDS') || isAuthorized('SALESSTATISTICS') ? {
itemKey: "recruit", itemKey: "recruit",
text: "招聘", text: "招聘",
items: [{ items: [isAuthorized('RECRUITMENTRECORDS') ? {
fatherKey: "recruit", fatherKey: "recruit",
itemKey: "recruitRecord", itemKey: "recruitRecord",
text: "招聘记录", text: "招聘记录",
to: "/humanAffairs/recruit/recruitRecord/appointmentRecords" to: "/humanAffairs/recruit/recruitRecord/appointmentRecords"
}, { } : {},
isAuthorized('SALESSTATISTICS') ? {
fatherKey: "recruit", fatherKey: "recruit",
itemKey: "salesStatistics", itemKey: "salesStatistics",
text: "销售统计", text: "销售统计",
to: "/humanAffairs/recruit/salesStatistics/personnelDistribution" to: "/humanAffairs/recruit/salesStatistics/personnelDistribution"
}] } : {}]
}, { } : {},
isAuthorized('LEAVEMANAGEMENT') || isAuthorized('EMPLOYEECOMMUNICATION') ? {
itemKey: "employeeRelationship", itemKey: "employeeRelationship",
text: "员工关系", text: "员工关系",
items: [{ items: [isAuthorized('LEAVEMANAGEMENT') ? {
fatherKey: "employeeRelationship", fatherKey: "employeeRelationship",
itemKey: "leaveManagement", itemKey: "leaveManagement",
text: "假勤管理", text: "假勤管理",
to: "/humanAffairs/employeeRelationship/leaveManagement/attendanceStatistics" to: isAuthorized('ATTENDANCESTATISTICS') ? "/humanAffairs/employeeRelationship/leaveManagement/attendanceStatistics" : isAuthorized('LEAVESTATISTICS') ? "/humanAffairs/employeeRelationship/leaveManagement/leaveStatistics" : "/humanAffairs/employeeRelationship/leaveManagement/overtimeStatistics"
}, { } : {},
isAuthorized('EMPLOYEECOMMUNICATION') ? {
fatherKey: "employeeRelationship", fatherKey: "employeeRelationship",
itemKey: "communication", itemKey: "communication",
text: "员工沟通", text: "员工沟通",
to: "/humanAffairs/employeeRelationship/communication/employeeCommunication" to: "/humanAffairs/employeeRelationship/communication/employeeCommunication"
}] } : {}]
}, { } : {},
isAuthorized('PERSONNELFILEMANAGEMENT') || isAuthorized('DEPARTMENTARCHIVESMANAGEMENT') ? {
itemKey: "archivesCenter", itemKey: "archivesCenter",
text: "档案中心", text: "档案中心",
items: [{ items: [isAuthorized('PERSONNELFILEMANAGEMENT') ? {
fatherKey: "archivesCenter", fatherKey: "archivesCenter",
openKey: "personnelArchives", openKey: "personnelArchives",
itemKey: "personnelFiles", itemKey: "personnelFiles",
text: "人员档案", text: "人员档案",
to: "/humanAffairs/archivesCenter/personnelArchives/personnelFiles" to: isAuthorized('PERSONNELFILES') ? "/humanAffairs/archivesCenter/personnelArchives/personnelFiles" : isAuthorized('EMPLOYEEINFORMATION') ? "/humanAffairs/archivesCenter/personnelArchives/employeeInformation" : "/humanAffairs/archivesCenter/personnelArchives/positionRating"
}, { } : {},
isAuthorized('DEPARTMENTARCHIVESMANAGEMENT') ? {
fatherKey: 'archivesCenter', fatherKey: 'archivesCenter',
itemKey: "deptArchives", itemKey: "deptArchives",
text: "部门档案", text: "部门档案",
to: "/humanAffairs/archivesCenter/deptArchives/department" to: "/humanAffairs/archivesCenter/deptArchives/department"
}] } : {}]
}] } : {}]
headerItems.map(e => {
if (e.items != undefined) {
e.items = e.items.filter(element => {
if (Object.keys(element).length !== 0) {
return true;
}
})
}
return e
})
headerItems = headerItems.filter(element => {
if (Object.keys(element).length !== 0) {
return true;
}
})
export { export {
headerItems headerItems

Loading…
Cancel
Save