route to manual

This commit is contained in:
setthawutttty 2025-06-26 11:35:25 +07:00
parent e07055a642
commit 07debe659b

View file

@ -151,34 +151,80 @@ const API = {
const path = import.meta.env.VITE_MANUAL_URL ?? "";
const generatePopupPath = (routeName: any) => {
console.log("🚀 ~ generatePopupPath ~ routeName:", routeName);
if (routeName.includes("metadata")) {
return `${path}/chapter-2-admin-metadata`;
} else if (routeName == "registryNew" || routeName == "registryNewByid") {
} else if (
routeName == "registryNew" ||
routeName == "registryNewByid" ||
routeName == "registryNewRequestEdit"
) {
return `${path}/chapter-2-1-admin-registry`;
} else if (
routeName == "registryEmployeeList" ||
routeName == "registryNewEmployeeByid"
routeName == "registryNewEmployeeByid" ||
routeName == "registryNewRequestEditEMP"
) {
return `${path}/chapter-2-2-admin-registry`;
} else if (routeName == "registry-employee") {
} else if (
routeName == "registry-employee" ||
routeName == "registry-employeeId"
) {
return `${path}/chapter-2-3-admin-registry`;
} else if (routeName == "registryRetireOfficer") {
return `${path}/chapter-3-admin-registry-retire-officer`;
} else if (routeName == "registryRetireEmployee") {
return `${path}/chapter-3-2-admin-registry-retire-employee`;
} else if (routeName.includes("acting")) {
return `${path}/chapter-7-admin-acting`;
} else if (routeName.includes("positionEmployee")) {
return `${path}/chapter-5-admin-position-employee`;
} else if (routeName == "retirement") {
} else if (
routeName == "retirement" ||
routeName == "retirementidDetail" ||
routeName == "retirementid"
) {
return `${path}/chapter-14-admin-retirement`;
} else if (routeName == "resign") {
} else if (
routeName == "resign" ||
routeName == "resignbyid" ||
routeName == "resignDetailreject" ||
routeName == "resignDetailbyid" ||
routeName == "resignReject"
) {
return `${path}/chapter-14-2-admin-retirement`;
} else if (routeName == "resignEmployee") {
} else if (
routeName == "resignEmployee" ||
routeName == "resignDetailbyidEMP" ||
routeName == "resignbyidEMP" ||
routeName == "resignDetailrejectEMP" ||
routeName == "resignRejectEMP"
) {
return `${path}/chapter-14-3-admin-retirement`;
} else if (routeName == "exit-Interview") {
} else if (
routeName == "exit-Interview" ||
routeName == "exit-Interview-details" ||
routeName == "exit-Interview-detailsOnly" ||
routeName == "ExitInterviewEditQuestion"
) {
return `${path}/chapter-14-4-admin-retirement`;
} else if (routeName == "deceased") {
} else if (
routeName == "deceased" ||
routeName == "deceased-detail" ||
routeName == "deceased-detailByid"
) {
return `${path}/chapter-14-5-admin-retirement`;
} else if (routeName == "dismiss-order") {
} else if (
routeName == "dismiss-order" ||
routeName == "outDetail" ||
routeName == "outDetailOnly"
) {
return `${path}/chapter-14-6-admin-retirement`;
} else if (routeName == "dismiss-order-emp") {
} else if (
routeName == "dismiss-order-emp" ||
routeName == "outDetailEmp" ||
routeName == "outDetailOnlyEmp"
) {
return `${path}/chapter-14-7-admin-retirement`;
} else if (routeName == "retireReport") {
return `${path}/chapter-14-8-admin-retirement`;
@ -188,9 +234,17 @@ const generatePopupPath = (routeName: any) => {
return `${path}/chapter-17-2-admin-discipline-investigatefacts`;
} else if (routeName.includes("disciplineDisciplinary")) {
return `${path}/chapter-17-3-admin-discipline-disciplinary`;
} else if (routeName.includes("disciplineResult")) {
} else if (
routeName == "disciplineResult" ||
routeName == "disciplineEditResult" ||
routeName == "disciplineResultDetail"
) {
return `${path}/chapter-17-4-admin-discipline-result`;
} else if (routeName.includes("disciplineListSuspend")) {
} else if (
routeName == "disciplineListSuspend" ||
routeName == "disciplineEditSuspend" ||
routeName == "disciplineDetailSuspend"
) {
return `${path}/chapter-17-5-admin-discipline-suspend`;
} else if (routeName.includes("appealComplain")) {
return `${path}/chapter-17-6-admin-discipline-appealcomplain`;
@ -210,15 +264,39 @@ const generatePopupPath = (routeName: any) => {
return `${path}/chapter-9-2-admin-competency`;
} else if (routeName.includes("strategic")) {
return `${path}/chapter-9-3-admin-strategic`;
} else if (routeName == "commandListPage") {
} else if (
routeName == "commandListPage" ||
routeName == "commandEditDetailPage" ||
routeName == "commandViewDetailPage"
) {
return `${path}/chapter-10-admin-order`;
} else if (routeName == "competePeriod") {
} else if (
routeName == "competePeriod" ||
routeName == "competePeriodAdd" ||
routeName == "recruitingDetail" ||
routeName == "recruitingDetailEx" ||
routeName == "competePeriodEdit"
) {
return `${path}/chapter-11-3-admin-compete-period`;
} else if (routeName == "qualifyPeriod") {
} else if (
routeName == "qualifyPeriod" ||
routeName == "qualifyPeriodAdd" ||
routeName == "qualifyPeriodEditDetail" ||
routeName == "qualifyPeriodEdit"
) {
return `${path}/chapter-11-4-1-admin-qualify-period`;
} else if (routeName == "disablePeriod") {
} else if (
routeName == "disablePeriod" ||
routeName == "disablePeriodAdd" ||
routeName == "disablePeriodDetail" ||
routeName == "disablePeriodEdit"
) {
return `${path}/chapter-11-4-2-admin-disable-period`;
} else if (routeName == "manage") {
} else if (
routeName == "manage" ||
routeName == "manageDetaill" ||
routeName == "ExamForm"
) {
return `${path}/chapter-11-4-3-admin-qualify-manage`;
} else if (routeName == "qualifyPeriodStat") {
return `${path}/chapter-11-4-4-admin-qualify-period-stat`;
@ -256,29 +334,25 @@ const generatePopupPath = (routeName: any) => {
return `${path}/chapter-16-4-admin-leave`;
} else if (routeName == "checkinReport") {
return `${path}/chapter-16-5-admin-leave`;
} else if (routeName == "leave") {
} else if (
routeName == "leave" ||
routeName == "leaveDetail" ||
routeName == "leaveRejectDetail"
) {
return `${path}/chapter-16-6-admin-leave`;
} else if (routeName == "leaveHistory") {
return `${path}/chapter-16-7-admin-leave`;
} else if (routeName == "leaveReport") {
return `${path}/chapter-16-8-admin-leave`;
} else if (routeName == "registryRetireOfficer") {
return `${path}/chapter-3-admin-registry-retire-officer`;
} else if (routeName == "registryRetireEmployee") {
return `${path}/chapter-3-2-admin-registry-retire-employee`;
} else if (routeName == "positionTemp") {
return `${path}/chapter-6-admin-position-temp`;
} else if (routeName == "competeReport") {
return `${path}/chapter-11-3-3-admin-compete-report`;
} else if (
routeName.includes("qualify") ||
routeName.includes("recruiting") ||
routeName.includes("compete") ||
routeName.includes("disable") ||
routeName.includes("manage")
routeName == "developmentMain" ||
routeName == "developmentDetailPage" ||
routeName == "developmentDetail"
) {
return `${path}/chapter-9-admin-recruit`;
} else if (routeName.includes("developmentMain")) {
return `${path}/chapter-21-admin-development`;
} else if (routeName.includes("developmentHistory")) {
return `${path}/chapter-21-2-admin-development-history`;
@ -286,15 +360,25 @@ const generatePopupPath = (routeName: any) => {
return `${path}/chapter-21-3-admin-development-employee-history`;
} else if (routeName.includes("developmentScholarship")) {
return `${path}/chapter-21-4-admin-development-scholarship`;
} else if (routeName == "evaluate") {
} else if (routeName == "evaluate" || routeName == "evaluateDetail") {
return `${path}/chapter-18-admin-evaluate`;
} else if (routeName == "evaluateDirector") {
} else if (
routeName == "evaluateDirector" ||
routeName == "evaluateDirectorAdd"
) {
return `${path}/chapter-18-2-admin-evaluate-director`;
} else if (routeName == "evaluateMeeting") {
} else if (
routeName == "evaluateMeeting" ||
routeName == "evaluateMeetingEdit" ||
routeName == "evaluateMeetingAdd"
) {
return `${path}/chapter-18-2-2-admin-evaluate-meeting`;
} else if (routeName == "salaryChart") {
} else if (routeName == "salaryChart" || routeName == "salaryRate") {
return `${path}/chapter-19-admin-salary`;
} else if (routeName == "salaryEmployeeChart") {
} else if (
routeName == "salaryEmployeeChart" ||
routeName == "salaryEmployeeRate"
) {
return `${path}/chapter-19-2-admin-salary-employee`;
} else if (routeName == "salaryRound") {
return `${path}/chapter-19-3-admin-salary-round`;
@ -304,7 +388,11 @@ const generatePopupPath = (routeName: any) => {
return `${path}/chapter-19-5-admin-salary-employee-lists`;
} else if (routeName == "KPIRound") {
return `${path}/chapter-20-admin-KPI-round`;
} else if (routeName == "KPIList") {
} else if (
routeName == "KPIList" ||
routeName == "KPIDetailPage" ||
routeName == "KPIDetail"
) {
return `${path}/chapter-20-2-admin-KPI-list`;
} else if (routeName == "KPIResults") {
return `${path}/chapter-20-3-admin-KPI-results`;
@ -312,6 +400,8 @@ const generatePopupPath = (routeName: any) => {
return `${path}/chapter-20-4-admin-KPI-report`;
} else if (routeName == "positionCondition") {
return `${path}/chapter-8-admin-position-condition`;
} else if (routeName == "transfer" || routeName == "transfer-id") {
return `${path}/chapter-12-2-admin-transfer`;
} else {
return manualConfig[routeName as keyof typeof manualConfig];
}
@ -342,13 +432,22 @@ const manualConfig = {
editorweb: `${path}/chapter-11-admin-recruit`,
placement: `${path}/chapter-12-admin-placement`,
transfer: `${path}/chapter-12-2-admin-transfer`,
placementDetail: `${path}/chapter-12-admin-placement`,
PlacementPersonalDetail: `${path}/chapter-12-admin-placement`,
receive: `${path}/chapter-12-3-admin-receive`,
receiveAdd: `${path}/chapter-12-3-admin-receive`,
receiveDetail: `${path}/chapter-12-3-admin-receive`,
"help-government": `${path}/chapter-12-4-admin-help-government`,
governmentbyId: `${path}/chapter-12-4-admin-help-government`,
repatriate: `${path}/chapter-12-5-admin-repatriate`,
repatriatebyId: `${path}/chapter-12-5-admin-repatriate`,
"appoint-promote": `${path}/chapter-12-6-admin-appoint-promote`,
"appoint-promote-detail": `${path}/chapter-12-6-admin-appoint-promote`,
"appoint-employee": `${path}/chapter-12-7-admin-appoint-employee`,
"appoint-employee-detail": `${path}/chapter-12-7-admin-appoint-employee`,
other: `${path}/chapter-12-8-admin-other`,
"other-detail": `${path}/chapter-12-8-admin-other`,
placementReport: `${path}/chapter-12-9-admin-placement-repoet`,
probation: `${path}/chapter-11-admin-probation`,
@ -356,14 +455,6 @@ const manualConfig = {
probationForm: `${path}/chapter-11-admin-probation`,
"report-report": `${path}/chapter-13-admin-insignia`,
"report-report-01": `${path}/chapter-13-admin-insignia`,
roundTime: `${path}/chapter-14-admin-leave`,
changeRound: `${path}/chapter-14-admin-leave`,
workList: `${path}/chapter-14-admin-leave`,
timestampSpecial: `${path}/chapter-14-admin-leave`,
leave: `${path}/chapter-14-admin-leave`,
leaveDetail: `${path}/chapter-14-admin-leave`,
leaveRejectDetail: `${path}/chapter-14-admin-leave`,
leaveReport: `${path}/chapter-14-admin-leave`,
appealComplain: `${path}/chapter-15-admin-discipline`,
// KPIRound: `${path}/chapter-18-admin-perf-evaluation`,
// "KPIList": `${path}/chapter-18-admin-perf-evaluation`,