Browse Source

(*)头部权限

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

151
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: [
fatherKey: "achievements", isAuthorized('BASICACTIONMANAGEMENT') ? {
itemKey: "basicAction", fatherKey: "achievements",
text: "基本动作", itemKey: "basicAction",
to: "/humanAffairs/achievements/basicAction/weeklyManagement" text: "基本动作",
}, { to: isAuthorized('WEEKLYREPORTMANAGEMENT') ? "/humanAffairs/achievements/basicAction/weeklyManagement" : isAuthorized('SALESLOG') ? "/humanAffairs/achievements/basicAction/saleLog" : "/humanAffairs/achievements/basicAction/pmLog"
fatherKey: 'achievements', } : {},
itemKey: "employeeKPI", isAuthorized('EMPLOYEEASSESSMENT') ? {
text: "员工考核", fatherKey: 'achievements',
to: "/humanAffairs/achievements/employeeKPI/probationer" itemKey: "employeeKPI",
}, { text: "员工考核",
fatherKey: "achievements", to: isAuthorized('EMPLOYEEASSESSMENTDURINGPROBATIONARYPERIOD') ? "/humanAffairs/achievements/employeeKPI/probationer" : "/humanAffairs/achievements/employeeKPI/regular"
itemKey: "middleKPI", } : {},
text: "中层考核", isAuthorized('MIDDLELEVELASSESSMENT') ? {
to: "/humanAffairs/achievements/middleKPI/monthlyProcess" fatherKey: "achievements",
}, { itemKey: "middleKPI",
fatherKey: 'achievements', text: "中层考核",
itemKey: "highKPI", to: isAuthorized('MIDDLELEVELMONTHLYPROCESSASSESSMENT') ? "/humanAffairs/achievements/middleKPI/monthlyProcess" : "/humanAffairs/achievements/middleKPI/quarter"
text: "高管考核", } : {},
to: "/humanAffairs/achievements/highKPI/highMonthly" isAuthorized('SENIORASSESSMENT') ? {
}, { fatherKey: 'achievements',
fatherKey: 'achievements', itemKey: "highKPI",
itemKey: "penalties", text: "高管考核",
text: "奖惩信息", to: isAuthorized('MONTHLYPROCESSASSESSMENTFORSENIORMANAGEMENT') ? "/humanAffairs/achievements/highKPI/highMonthly" : "/humanAffairs/achievements/highKPI/Highquarter"
to: "/humanAffairs/achievements/penalties/penaltiesRecord" } : {},
}] isAuthorized('REWARDANDPUNISHMENTMANAGEMENT') ? {
}, { fatherKey: 'achievements',
itemKey: "penalties",
text: "奖惩信息",
to: "/humanAffairs/achievements/penalties/penaltiesRecord"
} : {}]
} : {},
isAuthorized('TRAININGDOSSIER') || isAuthorized('TRAININGMANAGEMENT') ? {
itemKey: "train", itemKey: "train",
text: "培训", text: "培训",
items: [{ items: [
fatherKey: "train", isAuthorized('TRAININGDOSSIER') ? {
itemKey: "trainFiles", fatherKey: "train",
text: "培训档案", itemKey: "trainFiles",
to: "/humanAffairs/train/trainFiles/resourceRepository" text: "培训档案",
}, { to: "/humanAffairs/train/trainFiles/resourceRepository"
fatherKey: "train", } : {},
itemKey: "trainingManagement", isAuthorized('TRAININGMANAGEMENT') ? {
text: "培训管理", fatherKey: "train",
to: "/humanAffairs/train/trainingManagement/personalTrainRecord" itemKey: "trainingManagement",
}] text: "培训管理",
}, { 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