เพิ่ม maxPage
This commit is contained in:
parent
8403cd82bc
commit
d7ec0127b9
1 changed files with 4 additions and 3 deletions
|
|
@ -95,7 +95,7 @@ const rows = ref<TableRows[]>([]);
|
|||
const keyword = ref<string>("");
|
||||
const page = ref<number>(1);
|
||||
const rowsPerPage = ref<number>(5);
|
||||
const maxPage = ref<number>(7 / 3);
|
||||
const maxPage = ref<number>(1);
|
||||
|
||||
/** เรียกข้อมูลรายการลงเวลาปฏิบัติงาน (รายการลงเวลา) */
|
||||
async function fetchListLogRecord() {
|
||||
|
|
@ -109,8 +109,8 @@ async function fetchListLogRecord() {
|
|||
}&pageSize=${rowsPerPage.value}&keyword=${keyword.value}`
|
||||
)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
let datalist: TableRows[] = res.data.result.map((e: DataResLog) => ({
|
||||
maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value);
|
||||
let datalist: TableRows[] = res.data.result.data.map((e: DataResLog) => ({
|
||||
id: e.id,
|
||||
fullName: e.fullName,
|
||||
checkDate: e.checkDate && date2Thai(e.checkDate),
|
||||
|
|
@ -127,6 +127,7 @@ async function fetchListLogRecord() {
|
|||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
rows.value = [];
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue