Merge branch 'develop' of https://github.com/Frappet/bma-ehr-frontend into develop

This commit is contained in:
AnandaTon 2023-12-19 16:52:36 +07:00
commit 01d964d3f0
5 changed files with 73 additions and 187 deletions

View file

@ -51,66 +51,28 @@ watch(
}
);
async function getList() {
// showLoader();
// await http
// .get(
// config.API.directorList(
// currentPage.value,
// rowsPerPage.value,
// filterKeyword.value
// )
// )
// .then((res) => {
// 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();
// });
showLoader();
await http
.get(
config.API.meeting(
// currentPage.value,
// rowsPerPage.value,
// filterKeyword.value
)
)
.then((res) => {
// maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value);
const data = res.data.result
dataStore.fetchData(data);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
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);
}
/**
@ -126,19 +88,18 @@ function clickDelete(id: string) {
* @param id type
*/
async function deleteData(id: string) {
alert('ลบ')
// showLoader();
// await http
// .delete(config.API.directorbyId(id))
// .then((res) => {
// success($q, "");
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(async () => {
// await getList();
// });
showLoader();
await http
.delete(config.API.meetingById(id))
.then((res) => {
success($q, "ลบข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await getList();
});
}
/**