This commit is contained in:
STW_TTTY\stwtt 2024-06-28 11:28:40 +07:00
parent 243f500d4a
commit 4f973738a3
15 changed files with 1896 additions and 733 deletions

View file

@ -1,13 +1,15 @@
<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";
import http from "@/plugins/http";
import config from "@/app.config";
import { useKpiDataStore } from "@/modules/14_KPI/store";
const store = useKpiDataStore();
const $q = useQuasar();
const mixin = useCounterMixin();
const {
@ -23,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[]>([]);
@ -75,7 +77,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "positionLevel",
align: "left",
label: "ประเภทตำแหน่ง",
label: "ตำแหน่งประเภท",
sortable: true,
field: "positionLevel",
headerStyle: "font-size: 14px",
@ -190,24 +192,29 @@ function close() {
modal.value = false;
}
function getData(){
showLoader()
http
.get(config.API.placementKeycloak+`/${id.value}`)
.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">