From 4103b787741eb1b8d41e16f63020e318ed327942 Mon Sep 17 00:00:00 2001 From: waruneeta Date: Fri, 16 Feb 2024 14:50:02 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B9=80=E0=B8=A1?= =?UTF-8?q?=E0=B8=B4=E0=B8=99=E0=B8=9A=E0=B8=B8=E0=B8=84=E0=B8=84=E0=B8=A5?= =?UTF-8?q?=E0=B8=95=E0=B8=A3=E0=B8=A7=E0=B8=88=E0=B8=AA=E0=B8=AD=E0=B8=9A?= =?UTF-8?q?=E0=B8=95=E0=B8=B3=E0=B9=81=E0=B8=AB=E0=B8=99=E0=B9=88=E0=B8=87?= =?UTF-8?q?=E0=B8=81=E0=B9=88=E0=B8=AD=E0=B8=99=E0=B8=A2=E0=B8=B7=E0=B9=88?= =?UTF-8?q?=E0=B8=99=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B9=80=E0=B8=A1=E0=B8=B4?= =?UTF-8?q?=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/org/api.org.ts | 7 ++ src/app.config.ts | 2 + src/modules/06_evaluate/interface/evalute.ts | 6 +- .../06_evaluate/views/EvaluateMain.vue | 65 ++++++++++++++++--- 4 files changed, 69 insertions(+), 11 deletions(-) create mode 100644 src/api/org/api.org.ts diff --git a/src/api/org/api.org.ts b/src/api/org/api.org.ts new file mode 100644 index 0000000..b0151c2 --- /dev/null +++ b/src/api/org/api.org.ts @@ -0,0 +1,7 @@ +import env from "../index"; + +const org = `${env.API_URI}/org`; + +export default { + profilePosition: () => `${org}/profile/keycloak/position`, +}; diff --git a/src/app.config.ts b/src/app.config.ts index 66075b5..20be1e7 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -8,6 +8,7 @@ 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"; const API = { ...testtest, @@ -17,6 +18,7 @@ const API = { ...evaluate, ...appeal, ...support, + ...org, }; export default { diff --git a/src/modules/06_evaluate/interface/evalute.ts b/src/modules/06_evaluate/interface/evalute.ts index 1d3e17d..459459a 100644 --- a/src/modules/06_evaluate/interface/evalute.ts +++ b/src/modules/06_evaluate/interface/evalute.ts @@ -91,9 +91,11 @@ interface CertificatesForm { interface ListMenu { val: string; label: string; + level: number; + type: number; } -interface FormRef{ +interface FormRef { subject: object | null; author: object | null; commanderFullname: object | null; @@ -111,5 +113,5 @@ export type { EducationForm, CertificatesForm, ListMenu, - FormRef + FormRef, }; diff --git a/src/modules/06_evaluate/views/EvaluateMain.vue b/src/modules/06_evaluate/views/EvaluateMain.vue index 87b4b1e..50b8520 100644 --- a/src/modules/06_evaluate/views/EvaluateMain.vue +++ b/src/modules/06_evaluate/views/EvaluateMain.vue @@ -32,10 +32,20 @@ const listMenu = ref([ { val: "EXPERT", label: "ประเมินชำนาญการ", + type: 2, + level: 2, }, { val: "SPECIAL_EXPERT", label: "ประเมินชำนาญการพิเศษ", + type: 2, + level: 3, + }, + { + val: "PROFESSIONAL", + label: "ประเมินเชี่ยวชาญ", + type: 2, + level: 4, }, ]); @@ -48,8 +58,8 @@ function onclickAddEvaluate(data: ListMenu) { menu.value = data; } -function openExpert(){ -router.push('/evaluate/expert') +function openExpert() { + router.push("/evaluate/expert"); } /** ตัวแปร Paging*/ @@ -68,9 +78,10 @@ async function fetchEvaluteList() { }; await http .put(config.API.evaluationList(), body) - .then((res) => { + .then(async (res) => { maxPage.value = Math.ceil(res.data.result.total / pageSize.value); store.fetchEvaluateList(res.data.result.data); + await getProfileCheck(); }) .catch((err) => { messageError($q, err); @@ -80,6 +91,34 @@ async function fetchEvaluteList() { }); } +/** function เรียกรายการประเมิน*/ +const statusSubmit = ref(true); +async function getProfileCheck() { + await http + .get(config.API.profilePosition()) + .then(async (res: any) => { + const data = res.data.result; + // data.posTypeRank = await 2; + // data.posLevelRank = await 4; + // console.log("posTypeRank===>",data.posTypeRank); + // console.log("posLevelRank===>",data.posLevelRank); + + if ( + data.posTypeRank != 2 || + (data.posTypeRank == 2 && data.posLevelRank >= 4) + ) { + statusSubmit.value = false; + } else { + listMenu.value = await listMenu.value.filter( + (x: ListMenu) => x.level > data.posLevelRank + ); + } + }) + .catch((err) => { + messageError($q, err); + }); +} + /** * function updatePaging * @param newPagination ข้อมูลใหม่ของ Paging @@ -160,6 +199,7 @@ watch( } ); +