updated format code

This commit is contained in:
Warunee Tamkoo 2024-09-03 11:28:01 +07:00
parent b75d69ea08
commit b14bad2249
241 changed files with 14012 additions and 13811 deletions

View file

@ -294,7 +294,7 @@ function fetchData() {
function fetchTree() {
showLoader();
http
.get(config.API.devStrategy+`/edit`)
.get(config.API.devStrategy + `/edit`)
.then((res) => {
const data = res.data.result;
nodes.value = data;

View file

@ -505,7 +505,9 @@ onMounted(() => {
<template>
<!-- CARD เปาหมายตามแผน -->
<q-card bordered style="border: 1px solid #d6dee1">
<div class="col-xs-12 col-sm-12 text-weight-medium bg-grey-1 q-py-xs q-px-md">
<div
class="col-xs-12 col-sm-12 text-weight-medium bg-grey-1 q-py-xs q-px-md"
>
เปาหมายตามแผน
<q-btn
v-if="store.projectStatus !== 'FINISH' && !checkRoutePermission"

View file

@ -21,12 +21,7 @@ const props = defineProps({
const year = ref<string>("");
const $q = useQuasar();
const mixin = useCounterMixin();
const {
messageError,
dialogMessageNotify,
showLoader,
hideLoader,
} = mixin;
const { messageError, dialogMessageNotify, showLoader, hideLoader } = mixin;
const modal = defineModel<boolean>("modal", { required: true });

View file

@ -73,7 +73,9 @@ function fetchDataDetail() {
formMain.id = id.value;
formMain.citizenId = data.citizenId ? data.citizenId : null;
formMain.name = data.firstName
? `${data.prefix ? data.prefix:''}${data.firstName ? data.firstName:''} ${data.lastName ? data.lastName:''}`
? `${data.prefix ? data.prefix : ""}${
data.firstName ? data.firstName : ""
} ${data.lastName ? data.lastName : ""}`
: null;
formMain.prefix = data.prefix ? data.prefix : null;
formMain.firstName = data.firstName ? data.firstName : null;

View file

@ -1,14 +1,18 @@
<script setup lang="ts">
import { ref, watch, computed,reactive } from "vue";
import { ref, watch, computed, reactive } from "vue";
import Header from "@/components/DialogHeader.vue";
import type { DataOption,FormFilter,NewPagination } from "@/modules/15_development/interface/index/Main";
import type {
DataOption,
FormFilter,
NewPagination,
} from "@/modules/15_development/interface/index/Main";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar, type QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
const rows = ref<any[]>([])
const rows = ref<any[]>([]);
const props = defineProps({
upDate: { type: Function },
});
@ -35,12 +39,7 @@ const pagination = ref({
const $q = useQuasar();
const mixin = useCounterMixin();
const {
messageError,
dialogMessageNotify,
showLoader,
hideLoader,
} = mixin;
const { messageError, dialogMessageNotify, showLoader, hideLoader } = mixin;
const modal = defineModel<boolean>("modal", { required: true });
const selected = ref<any[]>([]);
@ -120,27 +119,25 @@ function onSubmit() {
if (selected.value?.length == 0) {
dialogMessageNotify($q, `กรุณาเลือก 1 รายการ`);
} else {
const data = selected.value[0];
const body = {
id:data.id,
name:data.name,
prefix:data.prefix,
rank:data.rank,
firstName:data.firstName,
lastName:data.lastName,
citizenId:data.citizenId,
level:data.level,
type:data.type,
posLevelId:data.posLevelId,
posTypeId:data.posTypeId,
position:data.position,
positionSide:data.positionSide,
posNo:data.posNo,
};
props.upDate?.(body)
closeDialog();
const data = selected.value[0];
const body = {
id: data.id,
name: data.name,
prefix: data.prefix,
rank: data.rank,
firstName: data.firstName,
lastName: data.lastName,
citizenId: data.citizenId,
level: data.level,
type: data.type,
posLevelId: data.posLevelId,
posTypeId: data.posTypeId,
position: data.position,
positionSide: data.positionSide,
posNo: data.posNo,
};
props.upDate?.(body);
closeDialog();
}
}
@ -149,7 +146,7 @@ function closeDialog() {
modal.value = false;
rows.value = [];
selected.value = [];
inputSearch.value = ''
inputSearch.value = "";
}
/** class */
@ -172,20 +169,22 @@ function searchFilter() {
const data = res.data.result.data;
maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize);
rows.value = data.map((item: any) => ({
id:item.id ? item.id:null,
prefix:item.prefix ? item.prefix:null,
rank:item.rank ? item.rank:null,
name:item.firstName ?`${item.prefix}${item.firstName} ${item.lastName}`:null,
firstName:item.firstName ? item.firstName:null,
lastName:item.lastName ? item.lastName:null,
citizenId:item.citizenId ? item.citizenId:null,
level:item.posLevel ? item.posLevel:null,
type:item.posType ? item.posType:null,
posTypeShortName:item.posTypeShortName ? item.posTypeShortName:null,
posLevelId:item.posLevelId ? item.posLevelId:null,
posTypeId:item.posTypeId ? item.posTypeId:null,
position:item.position ? item.position:null,
posNo:item.posNo ? item.posNo:null,
id: item.id ? item.id : null,
prefix: item.prefix ? item.prefix : null,
rank: item.rank ? item.rank : null,
name: item.firstName
? `${item.prefix}${item.firstName} ${item.lastName}`
: null,
firstName: item.firstName ? item.firstName : null,
lastName: item.lastName ? item.lastName : null,
citizenId: item.citizenId ? item.citizenId : null,
level: item.posLevel ? item.posLevel : null,
type: item.posType ? item.posType : null,
posTypeShortName: item.posTypeShortName ? item.posTypeShortName : null,
posLevelId: item.posLevelId ? item.posLevelId : null,
posTypeId: item.posTypeId ? item.posTypeId : null,
position: item.position ? item.position : null,
posNo: item.posNo ? item.posNo : null,
}));
})
.catch((e) => {
@ -196,17 +195,17 @@ function searchFilter() {
});
}
/** update
/** update
* @param val วเลขทการเปลยนค
*/
function updatePage(val:number){
*/
function updatePage(val: number) {
formFilter.page = val;
searchFilter();
}
/** update
/** update
* @param newPagination วเลขทการเปลยนค
*/
*/
function updatePageSize(newPagination: NewPagination) {
formFilter.page = 1;
formFilter.pageSize = newPagination.rowsPerPage;
@ -317,7 +316,12 @@ watch(
</q-td>
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div v-if="col.name == 'type'">
{{ col.value ? col.value : "-" }}{{ props.row.posTypeShortName ?`(${props.row.posTypeShortName})`:'' }}
{{ col.value ? col.value : "-"
}}{{
props.row.posTypeShortName
? `(${props.row.posTypeShortName})`
: ""
}}
</div>
<div v-else>
{{ col.value ? col.value : "-" }}

View file

@ -20,12 +20,7 @@ const props = defineProps({
const year = ref<string>("");
const $q = useQuasar();
const mixin = useCounterMixin();
const {
messageError,
dialogMessageNotify,
showLoader,
hideLoader,
} = mixin;
const { messageError, dialogMessageNotify, showLoader, hideLoader } = mixin;
const modal = defineModel<boolean>("modal", { required: true });
@ -101,21 +96,19 @@ function onSubmit() {
if (selected.value?.length == 0) {
dialogMessageNotify($q, `กรุณาเลือก 1 รายการ`);
} else {
const data = selected.value[0];
const body = {
id: data.id,
year: data.year,
project: data.project,
dateStart: data.dateStart,
dateEnd: data.dateEnd,
totalDate: data.totalDate,
addressAcademic: data.addressAcademic,
topicAcademic: data.topicAcademic,
};
props.upDate?.(body);
closeDialog();
const data = selected.value[0];
const body = {
id: data.id,
year: data.year,
project: data.project,
dateStart: data.dateStart,
dateEnd: data.dateEnd,
totalDate: data.totalDate,
addressAcademic: data.addressAcademic,
topicAcademic: data.topicAcademic,
};
props.upDate?.(body);
closeDialog();
}
}