อัตรากำลังลูกจ้างประจำ ฯ => refactor code

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-07-25 15:00:26 +07:00
parent 7e2350eef8
commit 81e0a82b0e
18 changed files with 377 additions and 188 deletions

View file

@ -1,20 +1,42 @@
<script setup lang="ts">
import { ref, computed, watch } from "vue";
import { ref, watch } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
/**
* importType
*/
import type { QTableProps } from "quasar";
import type { HistoryPos } from "@/modules/16_positionEmployee/interface/response/organizational";
/**
* importCompoonents
*/
import Header from "@/components/DialogHeader.vue";
/**
* import*Store
*/
import { useCounterMixin } from "@/stores/mixin";
import { usePositionEmp } from "@/modules/16_positionEmployee/store/organizational";
/**
* use
*/
const store = usePositionEmp();
const { showLoader, hideLoader, messageError, date2Thai } = useCounterMixin();
const $q = useQuasar();
/**
* props
*/
const modal = defineModel<boolean>("modal", { required: true });
const props = defineProps({
rowId: {
type: String,
},
});
const columns = ref<QTableProps["columns"]>([
{
@ -73,15 +95,13 @@ const columns = ref<QTableProps["columns"]>([
]);
const rows = ref<any[]>([]);
const props = defineProps({
rowId: {
type: String,
},
});
async function fetchHistoryPos(id: string) {
/**
* function เรยกขอมลประวตำแหน
* @param id
*/
function fetchHistoryPos(id: string) {
showLoader();
await http
http
.get(config.API.orgPosHistory(id))
.then((res) => {
const data: HistoryPos[] = res.data.result;
@ -102,6 +122,9 @@ async function fetchHistoryPos(id: string) {
});
}
/**
* callback function ทำงานเม modal === true
*/
watch(
() => modal.value,
() => {