Refactoring code module 02_organization
This commit is contained in:
parent
63b9aafbaf
commit
0f5d772e53
24 changed files with 805 additions and 1033 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue