no message

This commit is contained in:
setthawutttty 2023-12-19 16:35:27 +07:00
parent d8d824019f
commit 8788a08d18
6 changed files with 108 additions and 202 deletions

View file

@ -1,8 +1,12 @@
import env from "../index"; import env from "../index";
const evaluateDirectorMain = `${env.API_URI}/evaluate/director`; const evaluateDirectorMain = `${env.API_URI}/evaluation/director`;
const evaluateMeetingMain = `${env.API_URI}/evaluation/meeting`;
export default { export default {
evaluateDirectorMain: () => `${evaluateDirectorMain}`, evaluateDirectorMain: () => `${evaluateDirectorMain}`,
evaluateDirectorById: (id:string) => `${evaluateDirectorMain}/${id}`, evaluateDirectorById: (id:string) => `${evaluateDirectorMain}/${id}`,
evaluateMeetingMain: () => `${evaluateMeetingMain}`,
evaluateMeetingById: (id:string) => `${evaluateMeetingMain}/${id}`,
}; };

View file

@ -50,110 +50,26 @@ watch(
getList(); getList();
} }
); );
// currentPage.value,
// rowsPerPage.value,
// filterKeyword.value
function getList() { function getList() {
// showLoader(); showLoader();
// http http
// .get( .get(
// config.API.evaluateDirectorMain( config.API.evaluateDirectorMain())
// currentPage.value, .then((res) => {
// rowsPerPage.value, // maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value);
// filterKeyword.value const data = res.data.result
// ) dataStore.fetchData(data);
// ) })
// .then((res) => { .catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
// maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value);
// const data = res.data.result.data
// dataStore.fetchData(data);
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(() => {
// hideLoader();
// });
// {
// "Id": "0a185476-c764-42d7-a6f9-2c3824a401ed",
// "CreatedAt": "2023-12-19T02:40:59.898Z",
// "CreatedUserId": "59134ef9-9e62-41d0-aac5-339be727f2b0",
// "LastUpdatedAt": "2023-12-19T02:40:59.898Z",
// "LastUpdateUserId": "59134ef9-9e62-41d0-aac5-339be727f2b0",
// "CreatedFullName": " ",
// "LastUpdateFullName": " ",
// "Prefix": "",
// "FirstName": "",
// "LastName": "",
// "Phone": "0999998767",
// "Email": "email@gmail.com",
// "Position": "frontEnd"
// }
const data = [
{
Id: "xx1",
CreatedAt: "2023-12-19T02:40:59.898Z",
CreatedUserId: "cc1",
LastUpdatedAt: "2023-12-19T02:40:59.898Z",
LastUpdateUserId: "ll1",
CreatedFullName: "สาวิตรี ศรีสมัย",
LastUpdateFullName: "สาวิตรี ศรีสมัย",
Prefix: "นาย",
FirstName: "เทสดี",
LastName: "ลองแอด",
Phone: "0999998767",
Email: "email@gmail.com",
Position: "frontEnd",
},
{
Id: "xx2",
CreatedAt: "2023-12-19T02:40:59.898Z",
CreatedUserId: "cc2",
LastUpdatedAt: "2023-12-19T02:40:59.898Z",
LastUpdateUserId: "ll2",
CreatedFullName: "สาวิตรี ศรีสมัย",
LastUpdateFullName: "สาวิตรี ศรีสมัย",
Prefix: "นาย",
FirstName: "เทสดี",
LastName: "ลองแอด",
Phone: "0999998767",
Email: "email@gmail.com",
Position: "frontEnd",
},
{
Id: "xx3",
CreatedAt: "2023-12-19T02:40:59.898Z",
CreatedUserId: "cc3",
LastUpdatedAt: "2023-12-19T02:40:59.898Z",
LastUpdateUserId: "ll3",
CreatedFullName: "สาวิตรี ศรีสมัย",
LastUpdateFullName: "สาวิตรี ศรีสมัย",
Prefix: "นาย",
FirstName: "เทสดี",
LastName: "ลองแอด",
Phone: "0999998767",
Email: "email@gmail.com",
Position: "frontEnd",
},
{
Id: "xx4",
CreatedAt: "2023-12-19T02:40:59.898Z",
CreatedUserId: "cc5",
LastUpdatedAt: "2023-12-19T02:40:59.898Z",
LastUpdateUserId: "ll5",
CreatedFullName: "สาวิตรี ศรีสมัย",
LastUpdateFullName: "สาวิตรี ศรีสมัย",
Prefix: "นาย",
FirstName: "เทสดี",
LastName: "ลองแอด",
Phone: "0999998767",
Email: "email@gmail.com",
Position: "frontEnd",
},
];
dataStore.fetchData(data);
} }
/** /**

View file

@ -21,26 +21,27 @@ const router = useRouter();
} }
function addData(formData: FormDataPost) { function addData(formData: FormDataPost) {
showLoader(); console.log(formData)
http // showLoader();
.post(config.API.director(), { // http
personalId:formData.personalId ?? '', // .post(config.API.evaluateMeetingMain(), {
prefix: formData.prefix, // // personalId:formData.personalId ?? '',
firstName: formData.firstname, // Prefix: formData.prefix,
lastName: formData.lastname, // FirstName: formData.firstname,
position: formData.position, // LastName: formData.lastname,
email: formData.email, // Position: formData.position,
phone: formData.phone, // Email: formData.email,
}) // Phone: formData.phone,
.then((res) => { // })
success($q, "บันทึกข้อมูลสำเร็จ"); // .then((res) => {
}) // success($q, "");
.catch((e) => { // })
messageError($q, e); // .catch((e) => {
}) // messageError($q, e);
.finally(async () => { // })
router.push(`/discipline/meeting`); // .finally(async () => {
}); // router.push(`/discipline/meeting`);
// });
} }
</script> </script>
<template> <template>

View file

@ -51,66 +51,28 @@ watch(
} }
); );
async function getList() { async function getList() {
// showLoader(); showLoader();
// await http await http
// .get( .get(
// config.API.directorList( config.API.evaluateMeetingMain(
// currentPage.value, // currentPage.value,
// rowsPerPage.value, // rowsPerPage.value,
// filterKeyword.value // filterKeyword.value
// ) )
// ) )
// .then((res) => { .then((res) => {
// maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value); // maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value);
// const data = res.data.result.data const data = res.data.result
// dataStore.fetchData(data); dataStore.fetchData(data);
// }) })
// .catch((e) => { .catch((e) => {
// messageError($q, e); messageError($q, e);
// }) })
// .finally(() => { .finally(() => {
// hideLoader(); hideLoader();
// }); });
/** จำลองข้อมูล */
const data = [
{
id: "08dbf276-47d1-446b-8c0a-c109030dd457",
rounded:'1',
title:'ประชุม 1',
dateStart:new Date('2023-12-18T10:12:29.362007'),
dateEnd:new Date('2023-12-18T10:12:29.362007'),
},
{
id: "08dbf633-a4e4-49f6-8278-7105ce82e158",
rounded:'2',
title:'ประชุม 2',
dateStart:new Date('2023-12-18T10:12:29.362007'),
dateEnd:new Date('2023-12-18T10:12:29.362007'),
},
{
id: "08dbf67d-ebfa-4216-8bdb-4668351513b8",
rounded:'3',
title:'ประชุม 3',
dateStart:new Date('2023-12-18T10:12:29.362007'),
dateEnd:new Date('2023-12-18T10:12:29.362007'),
},
{
id: "08dbf6dd-7cff-4dd1-89d3-4fe0533ee186",
rounded:'4',
title:'ประชุม 4',
dateStart:new Date('2023-12-18T10:12:29.362007'),
dateEnd:new Date('2023-12-18T10:12:29.362007'),
},
{
id: "08dbfd41-0567-447f-8d3f-3254166c815d",
rounded:'5',
title:'ประชุม 5',
dateStart:new Date('2023-12-18T10:12:29.362007'),
dateEnd:new Date('2023-12-18T10:12:29.362007'),
},
];
dataStore.fetchData(data);
} }
/** /**

View file

@ -1,16 +1,31 @@
interface DataResponseList { interface DataResponseList {
id: string Id:string
rounded: string CreatedAt:string
title: string CreatedUserId:string
dateStart: Date LastUpdatedAt:string
dateEnd: Date LastUpdateUserId:string
CreatedFullName:string
LastUpdateFullName:string
Tittle:string
Round:string
Date:string
Result:string
Duration:string
} }
interface MainList { interface MainList {
id: string id:string
rounded: string createdAt:string
title: string createdUserId:string
date: string lastUpdatedAt:string
lastUpdateUserId:string
createdFullName:string
lastUpdateFullName:string
tittle:string
round:string
date:string
result:string
duration:string
} }
interface FormData { interface FormData {
@ -21,10 +36,10 @@ interface FormData {
file: FileOj[] file: FileOj[]
} }
interface FileOj{ interface FileOj {
id:string id: string
pathName:string pathName: string
fileName:string fileName: string
} }
interface FormRef { interface FormRef {

View file

@ -13,7 +13,7 @@ export const useEvaluateMeetingDataStore = defineStore(
//ค้นหา คอลัมน์ คอลัมน์ที่แสดง //ค้นหา คอลัมน์ คอลัมน์ที่แสดง
const visibleColumns = ref<string[]>([ const visibleColumns = ref<string[]>([
"no", "no",
"rounded", "round",
"title", "title",
"date", "date",
]); ]);
@ -30,11 +30,11 @@ export const useEvaluateMeetingDataStore = defineStore(
style: "font-size: 14px", style: "font-size: 14px",
}, },
{ {
name: "rounded", name: "round",
align: "left", align: "left",
label: "ครั้งที่", label: "ครั้งที่",
sortable: true, sortable: true,
field: "rounded", field: "round",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
@ -62,10 +62,18 @@ export const useEvaluateMeetingDataStore = defineStore(
const rows = ref<MainList[]>([]); const rows = ref<MainList[]>([]);
function fetchData(data: DataResponseList[]) { function fetchData(data: DataResponseList[]) {
const dataList: MainList[] = data.map((item: DataResponseList) => ({ const dataList: MainList[] = data.map((item: DataResponseList) => ({
id: item.id, id:item.Id,
rounded: item.rounded, createdAt:item.CreatedAt,
title: item.title, createdUserId:item.CreatedUserId,
date: `${date2Thai(item.dateStart as Date)} - ${date2Thai(item.dateEnd as Date)}` lastUpdatedAt:item.LastUpdatedAt,
lastUpdateUserId:item.LastUpdateUserId,
createdFullName:item.CreatedFullName,
lastUpdateFullName:item.LastUpdateFullName,
title:item.Tittle,
round:item.Round,
date:date2Thai(item.Date as Date),
result:item.Result,
duration:item.Duration,
})) }))
rows.value = dataList rows.value = dataList
} }