updated & fixing

This commit is contained in:
Warunee Tamkoo 2024-06-26 14:35:19 +07:00
parent a39a34b15f
commit 62af9f6a35
24 changed files with 392 additions and 352 deletions

View file

@ -1,7 +1,7 @@
<script setup lang="ts">
import DialogHeader from "@/components/DialogHeader.vue";
import type { QTableProps } from "quasar";
import { ref,watch } from "vue";
import { ref, watch } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import { useRouter, useRoute } from "vue-router";
@ -25,7 +25,7 @@ const {
const route = useRoute();
const router = useRouter();
const id = ref<string>(route.params.id as string)
const id = ref<string>(route.params.id as string);
const modal = defineModel<boolean>("modal", { required: true });
const filterKeyword = ref<string>("");
const rows = ref<any[]>([]);
@ -56,7 +56,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "posMasterNoOld",
align: "left",
label: "เลขที่ตำแหน่ง",
label: "ตำแหน่งเลขที่",
sortable: true,
field: "posMasterNoOld",
headerStyle: "font-size: 14px",
@ -77,7 +77,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "positionLevel",
align: "left",
label: "ประเภทตำแหน่ง",
label: "ตำแหน่งประเภท",
sortable: true,
field: "positionLevel",
headerStyle: "font-size: 14px",
@ -192,24 +192,29 @@ function close() {
modal.value = false;
}
function getData(){
showLoader()
http
.get(config.API.placementKeycloak+`/${store.dataProfile.profileId}`)
.then((res)=>{
const data = res.data.result
rows.value = data
}).catch((e)=>{
messageError($q,e)
}).finally(()=>{
hideLoader()
function getData() {
showLoader();
http
.get(config.API.placementKeycloak + `/${store.dataProfile.profileId}`)
.then((res) => {
const data = res.data.result;
rows.value = data;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
watch(()=>modal.value,(n)=>{
if(n == true){
getData()
watch(
() => modal.value,
(n) => {
if (n == true) {
getData();
}
})
}
);
</script>
<template>
<q-dialog persistent v-model="modal">