fix table
This commit is contained in:
parent
d5f5c722d3
commit
e3a91f1c71
5 changed files with 13 additions and 10 deletions
|
|
@ -49,6 +49,7 @@ const orgLevel = defineModel<number>("orgLevel", { required: true });
|
|||
const treeId = defineModel<string>("treeId", { required: true });
|
||||
const reqMaster = defineModel<FilterMaster>("reqMaster", { required: true });
|
||||
const totalPage = defineModel<number>("totalPage", { required: true });
|
||||
const totalData = defineModel<number>("totalData", { required: true });
|
||||
const posMaster = defineModel<PosMaster2[]>("posMaster", { required: true });
|
||||
const props = defineProps({
|
||||
filterKeyword: { type: Function, require: true, default: () => {} },
|
||||
|
|
@ -634,6 +635,7 @@ watch(
|
|||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
ทั้งหมด {{ totalData }} รายการ
|
||||
<q-pagination
|
||||
v-model="reqMaster.page"
|
||||
active-color="primary"
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ const reqMaster = reactive<FilterMaster>({
|
|||
revisionId: "",
|
||||
});
|
||||
const totalPage = ref<number>(1); //จำนวนหน้า
|
||||
const totalData = ref<number>(1); //จำนวนหน้า
|
||||
const action1 = ref<boolean>(false);
|
||||
const posMaster = ref<PosMaster2[]>([]); //รายการตำแหน่ง
|
||||
const shortName = ref<string>(""); //ชื่อย่อย
|
||||
|
|
@ -100,6 +101,7 @@ function fetchDataTable(id: string, level: number, action: boolean) {
|
|||
.then(async (res) => {
|
||||
const dataMain: PosMaster[] = [];
|
||||
totalPage.value = Math.ceil(res.data.result.total / reqMaster.pageSize);
|
||||
totalData.value = res.data.result.total;
|
||||
res.data.result.data.forEach((e: PosMaster) => {
|
||||
const p = e.positions;
|
||||
if (p.length !== 0) {
|
||||
|
|
@ -294,6 +296,7 @@ onMounted(() => {
|
|||
v-model:pos-master="posMaster"
|
||||
v-model:req-master="reqMaster"
|
||||
v-model:total-page="totalPage"
|
||||
v-model:total-data="totalData"
|
||||
:short-name="shortName"
|
||||
:main-tree="mainTree"
|
||||
:fetch-data-table="fetchDataTable"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue