From 7668b4f002736ca3cf98f5eeac5e86c64a72b764 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Thu, 7 Dec 2023 10:52:37 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20code=20?= =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=8A=E0=B8=B7=E0=B9=88=E0=B8=AD?= =?UTF-8?q?=E0=B8=9C=E0=B8=B9=E0=B9=89=E0=B8=96=E0=B8=B9=E0=B8=81=E0=B8=9E?= =?UTF-8?q?=E0=B8=B1=E0=B8=81=E0=B8=A3=E0=B8=B2=E0=B8=8A=E0=B8=81=E0=B8=B2?= =?UTF-8?q?=E0=B8=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/7_ListSuspend/DetailPage.vue | 36 ++++---- .../7_ListSuspend/DialogSendToCommand.vue | 54 ++++++----- .../components/7_ListSuspend/ListsPage.vue | 89 ++++++++++--------- .../components/DialogDirector.vue | 43 ++++----- .../components/DirectorTable.vue | 23 ----- .../components/PopupSendToNext.vue | 47 ++++------ 6 files changed, 125 insertions(+), 167 deletions(-) diff --git a/src/modules/11_discipline/components/7_ListSuspend/DetailPage.vue b/src/modules/11_discipline/components/7_ListSuspend/DetailPage.vue index 8cf2217ad..3cabb4530 100644 --- a/src/modules/11_discipline/components/7_ListSuspend/DetailPage.vue +++ b/src/modules/11_discipline/components/7_ListSuspend/DetailPage.vue @@ -35,13 +35,6 @@ const { const myForm = ref(null); const roleAdmin = ref(false); const edit = ref(false); -const organizationPositionOld = ref(""); -const positionTypeOld = ref(""); -const positionLevelOld = ref(""); -const posNo = ref(""); -const organization = ref(""); -const date = ref(null); -const reason = ref(""); const data = reactive({ id: "", @@ -67,16 +60,8 @@ const data = reactive({ disciplinaryCaseFault: "", }); -/** Hook */ -onMounted(async () => { - if (keycloak.tokenParsed != null) { - roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1"); - } - await getData(); -}); - -//นำข้อมูลจาก API มาแสดง -const getData = async () => { +/**นำข้อมูลจาก API มาแสดง */ +async function getData(){ showLoader(); await http .get(config.API.suspendById(dataId)) @@ -117,7 +102,7 @@ const getData = async () => { /** * ฟังก์ชั่น Cancle */ -const clickCancel = async () => { + async function clickCancel(){ await getData(); edit.value = false; }; @@ -125,7 +110,7 @@ const clickCancel = async () => { /** * ฟังก์ชั่น Save */ -const conditionSave = async () => { + async function conditionSave(){ if (myForm.value !== null) { myForm.value.validate().then((success) => { if (success) { @@ -147,7 +132,7 @@ const conditionSave = async () => { /** * ฟังก์ชั่น Saveจาก API */ -const saveData = async () => { + async function saveData(){ const body = { organization: data.organization, position: data.position, @@ -178,12 +163,21 @@ const saveData = async () => { * Function เพิ่ม Class เวลา Edit * @param val เมื่อเป็นEdit จะเปลี่ยน Class */ -const getClass = (val: boolean) => { +function getClass(val: boolean){ return { "full-width inputgreen cursor-pointer": val, "full-width cursor-pointer": !val, }; }; + + +/** Hook */ +onMounted(async () => { + if (keycloak.tokenParsed != null) { + roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1"); + } + await getData(); +}); + { selection="multiple" v-model:selected="selected" > -