Refactoring code module 02_organization

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-09-11 17:00:27 +07:00
parent 63b9aafbaf
commit 0f5d772e53
24 changed files with 805 additions and 1033 deletions

View file

@ -1,8 +1,11 @@
<script setup lang="ts">
import { ref, watch } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useOrganizational } from "@/modules/02_organization/store/organizational";
/**
* import Type
@ -15,16 +18,10 @@ import type { HistoryPos } from "@/modules/02_organization/interface/response/or
*/
import Header from "@/components/DialogHeader.vue";
/**
* import Store
*/
import { useCounterMixin } from "@/stores/mixin";
import { useOrganizational } from "@/modules/02_organization/store/organizational";
/** Use*/
const $q = useQuasar();
const store = useOrganizational();
const { showLoader, hideLoader, messageError, date2Thai } = useCounterMixin();
const $q = useQuasar();
/**
* props
@ -39,7 +36,7 @@ const props = defineProps({
/**
* อม Table
*/
const rows = ref<HistoryPos[]>([]);
const rows = ref<HistoryPos[]>([]); //
const columns = ref<QTableProps["columns"]>([
{
name: "no",
@ -156,7 +153,7 @@ function fetchHistoryPos(id: string) {
http
.get(config.API.orgPosHistory(id))
.then((res) => {
const data: HistoryPos[] = res.data.result;
const data = res.data.result;
rows.value = data;
})
.catch((err) => {
@ -168,7 +165,7 @@ function fetchHistoryPos(id: string) {
}
/**
* callback function ทำงานเม modal === true
* การเปลยนแปลง modal เมอเป true จะเรยกเรยกขอมลประวตำแหน
*/
watch(
() => modal.value,