Refactor Code ระบบลา
This commit is contained in:
parent
75dfc3b004
commit
9498748c94
16 changed files with 202 additions and 349 deletions
|
|
@ -3,7 +3,6 @@ import { ref, reactive, watch, onMounted } from "vue";
|
|||
import { date, useQuasar } from "quasar";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
/** importType */
|
||||
import type {
|
||||
|
|
@ -15,6 +14,7 @@ import type {
|
|||
/** importStore */
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useChangeRoundDataStore } from "@/modules/09_leave/stores/ChangeRoundStore";
|
||||
|
||||
/** useStore */
|
||||
const dataStore = useChangeRoundDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
|
|
@ -27,9 +27,7 @@ const {
|
|||
success,
|
||||
} = mixin;
|
||||
|
||||
const route = useRoute();
|
||||
const $q = useQuasar();
|
||||
const roundOp = ref<any>([]);
|
||||
|
||||
/**Hook */
|
||||
onMounted(async () => {
|
||||
|
|
@ -78,7 +76,7 @@ const dataToday = ref<Date>(new Date());
|
|||
function onSubmit() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
() => {
|
||||
changeRound();
|
||||
props.closeDialog?.();
|
||||
},
|
||||
|
|
@ -107,6 +105,7 @@ async function changeRound() {
|
|||
});
|
||||
}
|
||||
|
||||
const roundOp = ref<any>([]);
|
||||
/**
|
||||
*ประวัติการเปลี่ยนรอบการปฏิบัติงาน"
|
||||
*
|
||||
|
|
@ -138,9 +137,8 @@ async function fetchDataOption() {
|
|||
}
|
||||
|
||||
// paging
|
||||
const page = ref<number>(1);
|
||||
const pageSize = ref<number>(10);
|
||||
const filter = ref<string>(""); //search data table
|
||||
|
||||
/**
|
||||
* ฟังก์ชั่น api เปลี่ยนหน้า
|
||||
* @param pageVal page
|
||||
|
|
@ -169,7 +167,6 @@ watch(
|
|||
}
|
||||
);
|
||||
const emit = defineEmits(["update:change-page"]);
|
||||
// Pagination - update rowsPerPage
|
||||
async function updatePagination(newPagination: any) {
|
||||
initialPagination.value = newPagination;
|
||||
currentPage.value = 1; // set current page เป็น 1 เสมอเมื่อเปลี่ยน per row
|
||||
|
|
@ -192,7 +189,7 @@ function close() {
|
|||
}
|
||||
watch(
|
||||
() => props.modal,
|
||||
async (newDetailData, oldDetailData) => {
|
||||
async () => {
|
||||
if (props.editCheck === "edit") {
|
||||
formData.round = "";
|
||||
formData.reson = "";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue