updated format code & eslint rule

This commit is contained in:
Warunee Tamkoo 2024-09-02 14:01:01 +07:00
parent 67c6810def
commit 8a31554f38
102 changed files with 6271 additions and 6164 deletions

View file

@ -24,7 +24,15 @@ const knowledge = ref<any[]>([]);
const commander = ref<any>("");
const chairman = ref<any>("");
const mixin = useCounterMixin();
const { date2Thai, dateToISO, hideLoader, messageError,dialogConfirm,showLoader ,success} = mixin;
const {
date2Thai,
dateToISO,
hideLoader,
messageError,
dialogConfirm,
showLoader,
success,
} = mixin;
const date_start = ref<Date>();
const group = ref<any | null>(null);
const group2 = ref<any | null>(null);
@ -619,7 +627,7 @@ function filterFnChairman(val: string, update: any) {
* pop up confirm
* @param id personal id
*/
function saveEdit(id: string) {
function saveEdit(id: string) {
dialogConfirm($q, async () => await dataEdit(id));
}
@ -627,39 +635,38 @@ function filterFnChairman(val: string, update: any) {
* เชคขอมลกอนบนท
* @param id personal id
*/
async function saveData(id: string) {
async function saveData(id: string) {
dialogConfirm($q, async () => await DataSave(id));
}
/**
* update edit
* @param id personal id
*/
async function dataEdit(id: string) {
async function dataEdit(id: string) {
// await myForm.value.validate().then((result: boolean) => {
// if (result) {
showLoader();
const data = putDataEdit(id);
http
.put(config.API.saveEditAssign(id), data)
.then(() => {})
.catch(() => {})
.finally(async () => {
editStatus.value = false;
getAssign();
hideLoader();
});
// } else {
// dialogMessageNotify($q, "");
// }
showLoader();
const data = putDataEdit(id);
http
.put(config.API.saveEditAssign(id), data)
.then(() => {})
.catch(() => {})
.finally(async () => {
editStatus.value = false;
getAssign();
hideLoader();
});
// } else {
// dialogMessageNotify($q, "");
// }
// });
}
/**
* @param id personal
*/
function putDataEdit(id: string) {
function putDataEdit(id: string) {
const GUID = profileId.value;
const assign_job = activityArray.value.map((item, index) => {
const activityDesc = activity_desc.value[index]?.trim();
@ -811,7 +818,7 @@ function filterFnChairman(val: string, update: any) {
/**
* @param id personal
*/
function putData(id: string) {
function putData(id: string) {
const GUID = profileId.value;
const assign_job = activityArray.value.map((item, index) => {
const activityDesc = activity_desc.value[index]?.trim();
@ -949,7 +956,7 @@ function filterFnChairman(val: string, update: any) {
* นท
* @param id personal id
*/
async function DataSave(id: string) {
async function DataSave(id: string) {
const data = putData(id);
await http
.post(config.API.saveFinish(id), data)
@ -969,7 +976,7 @@ function filterFnChairman(val: string, update: any) {
* download file
* @param type type file
*/
async function clickdownloadFile(type: string) {
async function clickdownloadFile(type: string) {
showLoader();
await http
.get(config.API.reportAssign(type, id.value), {
@ -994,7 +1001,7 @@ function filterFnChairman(val: string, update: any) {
* @param response ไฟล
* @param filename อไฟล
*/
function downloadFile(response: any, filename: string) {
function downloadFile(response: any, filename: string) {
const link = document.createElement("a");
var fileName = filename;
link.href = window.URL.createObjectURL(new Blob([response.data]));
@ -1005,7 +1012,7 @@ function filterFnChairman(val: string, update: any) {
}
onMounted(async () => {
await showLoader()
await showLoader();
await getUser();
await getAssignNew(profileId.value);
await getLaw(profileId.value);
@ -1016,7 +1023,7 @@ onMounted(async () => {
if (id.value !== undefined) {
await getAssign();
}
await hideLoader()
await hideLoader();
});
</script>
<template>
@ -1038,7 +1045,11 @@ onMounted(async () => {
<div>แบบมอบหมายงาน </div>
</div>
</div>
<q-form greedy @submit.prevent @validation-success="id !== undefined ? saveEdit(id) : saveData(profileId)">
<q-form
greedy
@submit.prevent
@validation-success="id !== undefined ? saveEdit(id) : saveData(profileId)"
>
<div
:class="
$q.screen.gt.xs
@ -1090,25 +1101,14 @@ onMounted(async () => {
</q-list>
</q-menu>
</q-btn>
<q-btn
flat
icon="edit"
dense
color="edit"
round
@click="edit"
<q-btn flat icon="edit" dense color="edit" round @click="edit">
<q-tooltip>แกไขขอม</q-tooltip></q-btn
>
<q-tooltip>แกไขขอม</q-tooltip></q-btn>
</div>
<div v-else>
<q-btn
flat
icon="mdi-undo"
dense
color="red"
round
@click="cancel"
><q-tooltip>ยกเล</q-tooltip></q-btn>
<q-btn flat icon="mdi-undo" dense color="red" round @click="cancel"
><q-tooltip>ยกเล</q-tooltip></q-btn
>
<q-btn
flat
icon="mdi-content-save-outline"
@ -1116,7 +1116,8 @@ onMounted(async () => {
color="public"
round
type="submit"
><q-tooltip>นทกขอม</q-tooltip></q-btn>
><q-tooltip>นทกขอม</q-tooltip></q-btn
>
</div>
</div>
@ -2810,7 +2811,11 @@ onMounted(async () => {
</div>
</div>
</div>
<div v-if="routeName == 'probationAdd'" class="full-width" align="right">
<div
v-if="routeName == 'probationAdd'"
class="full-width"
align="right"
>
<q-btn label="บันทึก" color="secondary" type="submit"
><q-tooltip>นทกขอม</q-tooltip></q-btn
>