82 lines
2.5 KiB
TypeScript
82 lines
2.5 KiB
TypeScript
/**ใช้รวมไฟล์ย่อยๆ ของ api แต่ละไฟล์ */
|
|
|
|
/** API Metadata */
|
|
import testtest from "./api/test/api.test";
|
|
import retirementResign from "./api/leave/api.leave";
|
|
import placementTransfer from "./api/transfer/api.transfer";
|
|
import appeal from "./api/appeal/api.appeal";
|
|
import message from "./api/api.message";
|
|
import evaluate from "./api/evaluate/api.evaluate";
|
|
import support from "./api/support/api.support";
|
|
import org from "./api/org/api.org";
|
|
import scholarship from "./api/scholarship/api.scholarship";
|
|
import kpi from "./api/KPI/api.kpis";
|
|
import probation from "./api/probation/api.probation";
|
|
import development from "./api/api.development";
|
|
|
|
const API = {
|
|
...testtest,
|
|
...retirementResign,
|
|
...placementTransfer,
|
|
...message,
|
|
...evaluate,
|
|
...appeal,
|
|
...support,
|
|
...org,
|
|
...scholarship,
|
|
...kpi,
|
|
...probation,
|
|
...development,
|
|
};
|
|
|
|
const path =
|
|
import.meta.env.VITE_MANUAL_URL ??
|
|
"https://bma-ehr-manual.frappet.synology.me";
|
|
|
|
const generatePopupPath = (routeName: any) => {
|
|
if (routeName.includes("registry")) {
|
|
return `${path}/manual/chapter-2-user-registry`;
|
|
}
|
|
if (routeName.includes("leave")) {
|
|
return `${path}/manual/chapter-4-user-leave`;
|
|
}
|
|
if (routeName.includes("evaluate")) {
|
|
return `${path}/manual/chapter-3-user-evaluate`;
|
|
}
|
|
if (routeName.includes("portfolio")) {
|
|
return `${path}/manual/chapter-5-user-portfolio`;
|
|
}
|
|
if (routeName.includes("transfer")) {
|
|
return `${path}/manual/chapter-6-user-transfer`;
|
|
}
|
|
if (routeName.includes("appealComplain")) {
|
|
return `${path}/manual/chapter-7-user-appeal-complain`;
|
|
}
|
|
if (routeName.includes("KPI")) {
|
|
return `${path}/manual/chapter-9-user-KPI-evaluator`;
|
|
}
|
|
if (routeName.includes("scholarship")) {
|
|
return `${path}/manual/chapter-10-user-scholarship`;
|
|
}
|
|
if (routeName.includes("Retire")) {
|
|
return `${path}/manual/chapter-11-user-retire`;
|
|
} else {
|
|
return manualConfig[routeName as keyof typeof manualConfig];
|
|
}
|
|
};
|
|
|
|
const manualConfig = {
|
|
dashboard: `${path}/manual/chapter-1-user-organization-chart`,
|
|
leave: `${path}/manual/chapter-4-user-leave`,
|
|
organizationChart: `${path}/manual/chapter-1-user-organization-chart`,
|
|
registryMain: `${path}/manual/chapter-2-user-registry`,
|
|
addPortfolio: `${path}/manual/chapter-5-user-portfolio`,
|
|
addTransfer: `${path}/manual/chapter-6-user-transfer`,
|
|
KPIMain: `${path}/manual/chapter-8-user-KPI`,
|
|
KPIMainEvaluator: `${path}/manual/chapter-9-user-KPI-evaluator`,
|
|
};
|
|
|
|
export default {
|
|
API: API,
|
|
generatePopupPath,
|
|
};
|