Refactoring code module 06_retirement

This commit is contained in:
STW_TTTY\stwtt 2024-09-18 15:18:57 +07:00
parent 1225254062
commit ea921b39b0
29 changed files with 730 additions and 823 deletions

View file

@ -2,9 +2,10 @@
import { onMounted, ref } from "vue";
import { useQuasar } from "quasar";
import { useRoute, useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { tokenParsed } from "@/plugins/auth";
/**Import type */
@ -51,7 +52,7 @@ const fullName = ref<string>("");
const status = ref<string>("");
// API
const getData = async () => {
async function getData() {
showLoader();
await http
.get(config.API.outByid(dataId))
@ -81,21 +82,21 @@ const getData = async () => {
.finally(() => {
hideLoader();
});
};
}
/**
* งก Cancle
*/
const clickCancel = async () => {
async function clickCancel() {
await getData();
edit.value = false;
myForm.value?.resetValidation();
};
}
/**
* งก Saveจาก API
*/
const onSubmit = async () => {
async function onSubmit() {
dialogMessage(
$q,
"ต้องการแก้ไขข้อมูลหรือไม่?",
@ -131,18 +132,18 @@ const onSubmit = async () => {
},
undefined
);
};
}
/**
* Function เพ Class เวลา Edit
* @param val เมอเปนEdit จะเปลยน Class
*/
const getClass = (val: boolean) => {
function getClass(val: boolean) {
return {
"full-width inputgreen cursor-pointer": val,
"full-width cursor-pointer": !val,
};
};
}
/** Hook */
onMounted(async () => {