hrms-mgt/src/app.config.ts

473 lines
17 KiB
TypeScript
Raw Normal View History

2023-06-01 12:54:58 +07:00
/**ใช้รวมไฟล์ย่อยๆ ของ api แต่ละไฟล์ */
/** API Metadata */
import manageOrganization from "./api/manage/api.organization";
import managePerson from "./api/manage/api.person";
import managePosition from "./api/manage/api.position";
import managePositionEmployee from "./api/manage/api.positionEmployee";
import manageInsignia from "./api/manage/api.insignia";
import manageHoliday from "./api/manage/api.holiday";
/** API Tree List */
import organizationTreeList from "./api/02_organizational/api.treelist";
/** API Structure & Org Chart */
import organizationChart from "./api/02_organizational/api.chart";
/** API periodexam List */
import periodexam from "./api/recruiting/api.period-exam";
import disableexam from "./api/recruiting/api.disable";
/** API Recruit List */
import recruit from "./api/recruiting/api.recruit";
/** API Profile List */
import profile from "./api/registry/api.profile";
import registry from "./api/registry/api.registry";
2023-06-01 12:54:58 +07:00
/** API Report2 List */
import report2 from "./api/recruiting/api.report2";
/** API ระบบการบรรจุ แต่งตั้ง ย้าย โอน List */
import placement from "./api/05_placement/api.placement";
2023-08-04 10:40:04 +07:00
import probation from "./api/05_placement/api.probation";
2023-06-01 12:54:58 +07:00
/** API ระบบการพ้นจากราชการ List */
import retirement from "./api/06_retirement/api.retirement";
/** API ระบบงานเครื่องราชอิสริยาภรณ์ List */
import insignia from "./api/07_insignia/api.insignia";
/** API dashboard */
import message from "./api/00_dashboard/api.message";
/** API reports */
import reports from "./api/reports/api.report";
/** API ระบบลงเวลา */
import leave from "./api/09_leave/api.leave";
/** API วินัย */
import discipline from "./api/11_discipline/api.discipline";
2023-12-19 15:05:48 +07:00
/**API ประเมิน */
import evaluate from "./api/12_evaluatePersonal/api.evaluate";
/** API โครงสร้างอัตรากำลัง*/
import organization from "./api/02_organizational/api.organization";
2024-02-16 16:20:18 +07:00
import support from "./api/00_support/api.support";
/** API เงินเดือน/ค่าจ้าง*/
import salary from "./api/13_salary/api.salary";
/** API ระเมินผลการปฏิบัติราชการระดับบุคคล*/
import KPI from "./api/14_KPI/api.KPI";
/** API เงินเดือน/ค่าจ้าง*/
import development from "./api/15_development/api.development";
/** ออกคำสั่งใหม่ */
import command from "./api/18_command/api.command";
/** socket */
import socket from "./api/socket";
2024-03-19 16:45:49 +07:00
import file from "./api/file/api.file";
2023-06-01 12:54:58 +07:00
// environment variables
export const compettitivePanel = import.meta.env.VITE_COMPETITIVE_EXAM_PANEL;
export const qualifyDisableExamPanel = import.meta.env
.VITE_QUALIFY_DISABLE_EMAM_PANEL;
export const qualifyExamPanel = import.meta.env.VITE_QUALIFY_EXAM_PANEL;
const API = {
//Metadata
...manageOrganization,
...managePerson,
...managePosition,
...managePositionEmployee,
...manageInsignia,
...manageHoliday,
// โครงสร้างอัตรากำลัง
...organization,
2023-06-01 12:54:58 +07:00
//Tree List
...organizationTreeList,
...organizationChart,
//periodexam
...periodexam,
...disableexam,
// recruit
...recruit,
//profile
...profile,
...registry,
2023-06-01 12:54:58 +07:00
//report2
...report2,
...placement,
2023-08-04 10:40:04 +07:00
...probation,
2023-06-01 12:54:58 +07:00
...retirement,
...insignia,
//dashboard
...message,
//reports
...reports,
/**leave */
...leave,
/**discipline */
...discipline,
2023-12-19 15:05:48 +07:00
/**evaluate*/
...evaluate,
2024-02-16 16:20:18 +07:00
/** support */
...support,
...salary,
...KPI,
...development,
2024-03-19 16:45:49 +07:00
/** ออกคำสั่งใหม่ */
...command,
2024-03-19 16:45:49 +07:00
/*file*/
...file,
/*socket*/
...socket,
2023-06-01 12:54:58 +07:00
};
2024-12-20 16:13:18 +07:00
const path = import.meta.env.VITE_MANUAL_URL ?? "";
const generatePopupPath = (routeName: any) => {
if (routeName.includes("metadata")) {
2024-12-20 16:13:18 +07:00
return `${path}/chapter-2-admin-metadata`;
2025-06-26 11:35:25 +07:00
} else if (
routeName == "registryNew" ||
routeName == "registryNewByid" ||
routeName == "registryNewRequestEdit"
) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-2-1-admin-registry`;
} else if (
routeName == "registryEmployeeList" ||
2025-06-26 11:35:25 +07:00
routeName == "registryNewEmployeeByid" ||
routeName == "registryNewRequestEditEMP"
2025-06-23 10:05:41 +07:00
) {
return `${path}/chapter-2-2-admin-registry`;
2025-06-26 11:35:25 +07:00
} else if (
routeName == "registry-employee" ||
routeName == "registry-employeeId"
) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-2-3-admin-registry`;
2025-06-26 11:35:25 +07:00
} 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`;
2024-08-08 16:44:31 +07:00
} else if (routeName.includes("acting")) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-7-admin-acting`;
2024-08-08 16:44:31 +07:00
} else if (routeName.includes("positionEmployee")) {
2024-12-20 16:13:18 +07:00
return `${path}/chapter-5-admin-position-employee`;
2025-06-26 11:35:25 +07:00
} else if (
routeName == "retirement" ||
routeName == "retirementidDetail" ||
routeName == "retirementid"
) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-14-admin-retirement`;
2025-06-26 11:35:25 +07:00
} else if (
routeName == "resign" ||
routeName == "resignbyid" ||
routeName == "resignDetailreject" ||
routeName == "resignDetailbyid" ||
routeName == "resignReject"
) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-14-2-admin-retirement`;
2025-06-26 11:35:25 +07:00
} else if (
routeName == "resignEmployee" ||
routeName == "resignDetailbyidEMP" ||
routeName == "resignbyidEMP" ||
routeName == "resignDetailrejectEMP" ||
routeName == "resignRejectEMP"
) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-14-3-admin-retirement`;
2025-06-26 11:35:25 +07:00
} else if (
routeName == "exit-Interview" ||
routeName == "exit-Interview-details" ||
routeName == "exit-Interview-detailsOnly" ||
routeName == "ExitInterviewEditQuestion"
) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-14-4-admin-retirement`;
2025-06-26 11:35:25 +07:00
} else if (
routeName == "deceased" ||
routeName == "deceased-detail" ||
routeName == "deceased-detailByid"
) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-14-5-admin-retirement`;
2025-06-26 11:35:25 +07:00
} else if (
routeName == "dismiss-order" ||
routeName == "outDetail" ||
routeName == "outDetailOnly"
) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-14-6-admin-retirement`;
2025-06-26 11:35:25 +07:00
} else if (
routeName == "dismiss-order-emp" ||
routeName == "outDetailEmp" ||
routeName == "outDetailOnlyEmp"
) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-14-7-admin-retirement`;
} else if (routeName == "retireReport") {
return `${path}/chapter-14-8-admin-retirement`;
} else if (routeName.includes("disciplineComplaints")) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-17-admin-discipline-complaints`;
} else if (routeName.includes("disciplineInvestigatefacts")) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-17-2-admin-discipline-investigatefacts`;
} else if (routeName.includes("disciplineDisciplinary")) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-17-3-admin-discipline-disciplinary`;
2025-06-26 11:35:25 +07:00
} else if (
routeName == "disciplineResult" ||
routeName == "disciplineEditResult" ||
routeName == "disciplineResultDetail"
) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-17-4-admin-discipline-result`;
2025-06-26 11:35:25 +07:00
} else if (
routeName == "disciplineListSuspend" ||
routeName == "disciplineEditSuspend" ||
routeName == "disciplineDetailSuspend"
) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-17-5-admin-discipline-suspend`;
} else if (routeName.includes("appealComplain")) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-17-6-admin-discipline-appealcomplain`;
} else if (routeName.includes("disciplineDirector")) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-17-7-admin-discipline-director`;
} else if (routeName.includes("disciplineChannel")) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-17-7-2-admin-discipline-channel`;
} else if (routeName.includes("disciplineReport")) {
return `${path}/chapter-17-8-admin-discipline-report`;
} else if (routeName.includes("KPIIndicatorByPlan")) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-9-admin-indicator-plan`;
} else if (routeName.includes("KPIIndicatorByRole")) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-9-1-2-admin-indicator-role`;
} else if (routeName.includes("KPIAssignment")) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-9-1-3-admin-indicator-assignment`;
} else if (routeName.includes("KPICompetency")) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-9-2-admin-competency`;
} else if (routeName.includes("strategic")) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-9-3-admin-strategic`;
2025-06-26 11:35:25 +07:00
} else if (
routeName == "commandListPage" ||
routeName == "commandEditDetailPage" ||
routeName == "commandViewDetailPage"
) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-10-admin-order`;
2025-06-26 11:35:25 +07:00
} else if (
routeName == "competePeriod" ||
routeName == "competePeriodAdd" ||
routeName == "recruitingDetail" ||
routeName == "recruitingDetailEx" ||
routeName == "competePeriodEdit"
) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-11-3-admin-compete-period`;
2025-06-26 11:35:25 +07:00
} else if (
routeName == "qualifyPeriod" ||
routeName == "qualifyPeriodAdd" ||
routeName == "qualifyPeriodEditDetail" ||
routeName == "qualifyPeriodEdit"
) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-11-4-1-admin-qualify-period`;
2025-06-26 11:35:25 +07:00
} else if (
routeName == "disablePeriod" ||
routeName == "disablePeriodAdd" ||
routeName == "disablePeriodDetail" ||
routeName == "disablePeriodEdit"
) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-11-4-2-admin-disable-period`;
2025-06-26 11:35:25 +07:00
} else if (
routeName == "manage" ||
routeName == "manageDetaill" ||
routeName == "ExamForm"
) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-11-4-3-admin-qualify-manage`;
} else if (routeName == "qualifyPeriodStat") {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-11-4-4-admin-qualify-period-stat`;
} else if (routeName == "qualifyPeriodStatDisable") {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-11-4-5-admin-qualify-disable-stat`;
} else if (routeName.includes("competePeriodStat")) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-11-3-2-admin-compete-period-stat`;
} else if (routeName.includes("probation")) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-13-admin-probation`;
} else if (routeName.includes("insigniaProposals")) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-15-admin-insignia`;
} else if (routeName == "insigniaManage") {
return `${path}/chapter-15-2-admin-insignia`;
} else if (routeName == "insigniaManageEmp") {
return `${path}/chapter-15-3-admin-insignia`;
} else if (routeName == "insigniaRecord") {
return `${path}/chapter-15-4-admin-insignia`;
} else if (routeName == "insigniaRecordEmp") {
return `${path}/chapter-15-5-admin-insignia`;
} else if (routeName.includes("insigniaAllocate")) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-15-6-admin-insignia`;
} else if (routeName.includes("insigniaBorrow")) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-15-7-admin-insignia`;
} else if (routeName == "insigniaReclaim") {
return `${path}/chapter-15-8-admin-insignia`;
} else if (routeName.includes("insigniaReport")) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-15-9-admin-insignia`;
} else if (routeName.includes("roundTime")) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-16-admin-leave`;
} else if (routeName.includes("workList")) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-16-2-admin-leave`;
} else if (routeName.includes("changeRound")) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-16-3-admin-leave`;
} else if (routeName.includes("timestampSpecial")) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-16-4-admin-leave`;
} else if (routeName == "checkinReport") {
return `${path}/chapter-16-5-admin-leave`;
2025-06-26 11:35:25 +07:00
} else if (
routeName == "leave" ||
routeName == "leaveDetail" ||
routeName == "leaveRejectDetail"
) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-16-6-admin-leave`;
} else if (routeName == "leaveHistory") {
return `${path}/chapter-16-7-admin-leave`;
} else if (routeName == "leaveReport") {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-16-8-admin-leave`;
} else if (routeName == "positionTemp") {
return `${path}/chapter-6-admin-position-temp`;
} else if (routeName == "competeReport") {
return `${path}/chapter-11-3-3-admin-compete-report`;
2024-08-08 16:44:31 +07:00
} else if (
2025-06-26 11:35:25 +07:00
routeName == "developmentMain" ||
routeName == "developmentDetailPage" ||
routeName == "developmentDetail"
2024-08-08 16:44:31 +07:00
) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-21-admin-development`;
} else if (routeName.includes("developmentHistory")) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-21-2-admin-development-history`;
} else if (routeName.includes("developmentEmployeeHistory")) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-21-3-admin-development-employee-history`;
} else if (routeName.includes("developmentScholarship")) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-21-4-admin-development-scholarship`;
2025-06-26 11:35:25 +07:00
} else if (routeName == "evaluate" || routeName == "evaluateDetail") {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-18-admin-evaluate`;
2025-06-26 11:35:25 +07:00
} else if (
routeName == "evaluateDirector" ||
routeName == "evaluateDirectorAdd"
) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-18-2-admin-evaluate-director`;
2025-06-26 11:35:25 +07:00
} else if (
routeName == "evaluateMeeting" ||
routeName == "evaluateMeetingEdit" ||
routeName == "evaluateMeetingAdd"
) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-18-2-2-admin-evaluate-meeting`;
2025-06-26 11:35:25 +07:00
} else if (routeName == "salaryChart" || routeName == "salaryRate") {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-19-admin-salary`;
2025-06-26 11:35:25 +07:00
} else if (
routeName == "salaryEmployeeChart" ||
routeName == "salaryEmployeeRate"
) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-19-2-admin-salary-employee`;
} else if (routeName == "salaryRound") {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-19-3-admin-salary-round`;
} else if (routeName == "salaryLists") {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-19-4-admin-salary-lists`;
} else if (routeName == "salaryEmployeeLists") {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-19-5-admin-salary-employee-lists`;
} else if (routeName == "KPIRound") {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-20-admin-KPI-round`;
2025-06-26 11:35:25 +07:00
} else if (
routeName == "KPIList" ||
routeName == "KPIDetailPage" ||
routeName == "KPIDetail"
) {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-20-2-admin-KPI-list`;
} else if (routeName == "KPIResults") {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-20-3-admin-KPI-results`;
} else if (routeName == "KPIReport") {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-20-4-admin-KPI-report`;
2024-12-11 15:15:16 +07:00
} else if (routeName == "positionCondition") {
2025-06-23 10:05:41 +07:00
return `${path}/chapter-8-admin-position-condition`;
2025-06-26 11:35:25 +07:00
} else if (routeName == "transfer" || routeName == "transfer-id") {
return `${path}/chapter-12-2-admin-transfer`;
} else {
return manualConfig[routeName as keyof typeof manualConfig];
}
};
const manualConfig = {
dashboard: `${path}/`,
2025-06-23 10:05:41 +07:00
strategic: `${path}/chapter-9-admin-indicator-plan`,
KPIIndicatorByRoleAdd: `${path}/chapter-9-1-2-admin-indicator-role`,
KPIIndicatorByPlan: `${path}/chapter-9-admin-indicator-plan`,
"KPIIndicatorByPlan/Add": `${path}/chapter-9-admin-indicator-plan`,
KPIIndicatorByPlanByid: `${path}/chapter-9-admin-indicator-plan`,
KPIIndicatorByRoleByid: `${path}/chapter-9-admin-indicator-plan`,
KPICompetency: `${path}/chapter-9-2-admin-competency`,
KPIAssignment: `${path}/chapter-9-admin-indicator-plan`,
KPIAssignmentById: `${path}/chapter-9-admin-indicator-plan`,
KPIIndicatorByRole: `${path}/chapter-9-admin-indicator-plan`,
KPICompetencyAdd: `${path}/chapter-9-2-admin-competency`,
KPICompetencyByid: `${path}/chapter-9-2-admin-competency`,
organizationalNew: `${path}/chapter-4-admin-organization`,
2024-12-20 16:13:18 +07:00
organization: `${path}/chapter-6-admin-registry`,
registry: `${path}/chapter-6-admin-registry`,
registryDetail: `${path}/chapter-6-admin-registry`,
verified: `${path}/chapter-6-admin-registry`,
order: `${path}/chapter-8-admin-order`,
OrderDetail: `${path}/chapter-8-admin-order`,
OrderAdd: `${path}/chapter-8-admin-order`,
2025-06-23 10:05:41 +07:00
editorweb: `${path}/chapter-11-admin-recruit`,
placement: `${path}/chapter-12-admin-placement`,
2025-06-26 11:35:25 +07:00
placementDetail: `${path}/chapter-12-admin-placement`,
PlacementPersonalDetail: `${path}/chapter-12-admin-placement`,
2025-06-23 10:05:41 +07:00
receive: `${path}/chapter-12-3-admin-receive`,
2025-06-26 11:35:25 +07:00
receiveAdd: `${path}/chapter-12-3-admin-receive`,
receiveDetail: `${path}/chapter-12-3-admin-receive`,
2025-06-23 10:05:41 +07:00
"help-government": `${path}/chapter-12-4-admin-help-government`,
2025-06-26 11:35:25 +07:00
governmentbyId: `${path}/chapter-12-4-admin-help-government`,
2025-06-23 10:05:41 +07:00
repatriate: `${path}/chapter-12-5-admin-repatriate`,
2025-06-26 11:35:25 +07:00
repatriatebyId: `${path}/chapter-12-5-admin-repatriate`,
2025-06-23 10:05:41 +07:00
"appoint-promote": `${path}/chapter-12-6-admin-appoint-promote`,
2025-06-26 11:35:25 +07:00
"appoint-promote-detail": `${path}/chapter-12-6-admin-appoint-promote`,
2025-06-23 10:05:41 +07:00
"appoint-employee": `${path}/chapter-12-7-admin-appoint-employee`,
2025-06-26 11:35:25 +07:00
"appoint-employee-detail": `${path}/chapter-12-7-admin-appoint-employee`,
2025-06-23 10:05:41 +07:00
other: `${path}/chapter-12-8-admin-other`,
2025-06-26 11:35:25 +07:00
"other-detail": `${path}/chapter-12-8-admin-other`,
2025-06-23 10:05:41 +07:00
placementReport: `${path}/chapter-12-9-admin-placement-repoet`,
2024-12-20 16:13:18 +07:00
probation: `${path}/chapter-11-admin-probation`,
probationDetail: `${path}/chapter-11-admin-probation`,
probationForm: `${path}/chapter-11-admin-probation`,
"report-report": `${path}/chapter-13-admin-insignia`,
"report-report-01": `${path}/chapter-13-admin-insignia`,
appealComplain: `${path}/chapter-15-admin-discipline`,
// KPIRound: `${path}/chapter-18-admin-perf-evaluation`,
// "KPIList": `${path}/chapter-18-admin-perf-evaluation`,
// KPIDetail: `${path}/chapter-18-admin-perf-evaluation`,
// KPIReport: `${path}/chapter-18-admin-perf-evaluation`,
// KPIDetailnew: `${path}/chapter-18-admin-perf-evaluation`,
};
2023-06-01 12:54:58 +07:00
export default {
API: API,
compettitivePanel,
qualifyDisableExamPanel,
qualifyExamPanel,
manualConfig,
generatePopupPath,
2023-06-01 12:54:58 +07:00
};