แก้ไข table หน้า รายการคำขอประเมิน

This commit is contained in:
AnandaTon 2023-12-20 13:50:54 +07:00
parent e8b98709bf
commit 4d5d2c92dd

View file

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { onMounted, ref, watch } from "vue"; import { onMounted, ref, watch, useAttrs } from "vue";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import http from "@/plugins/http"; import http from "@/plugins/http";
@ -16,7 +16,7 @@ const router = useRouter();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const store = useEvalutuonStore(); const store = useEvalutuonStore();
const { showLoader, hideLoader, messageError } = mixin; const { showLoader, hideLoader, messageError } = mixin;
const attrs = ref<any>(useAttrs());
const initialPagination = ref<Pagination>({ const initialPagination = ref<Pagination>({
rowsPerPage: 0, rowsPerPage: 0,
}); });
@ -93,23 +93,47 @@ onMounted(async () => {
</div> </div>
<q-card flat bordered class="col-12 q-mt-sm q-pt-sm q-pa-md"> <q-card flat bordered class="col-12 q-mt-sm q-pt-sm q-pa-md">
<div> <div>
<Table <d-table
style="max-height: 80vh" ref="table"
:rows="store.rows"
:columns="store.columns" :columns="store.columns"
:visible-columns="store.visibleColumns" :rows="store.rows"
v-model:inputfilter="filter" :filter="filter"
v-model:inputvisible="store.visibleColumns" row-key="interrogated"
:pagination="initialPagination" flat
:nornmalData="true" bordered
:paging="true" :paging="true"
:titleText="''" dense
:page="page" class="custom-header-table"
:pageSize="pageSize" v-bind="attrs"
:maxPage="maxPage" :visible-columns="store.visibleColumns"
v-model:pagination="pagination"
> >
<template #columns="props"> <template v-slot:header="props">
<q-tr :props="props">
<q-th auto-width></q-th>
<q-th
v-for="col in props.cols"
:key="col.name"
:props="props"
style="color: #000000; font-weight: 500"
>
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width></q-th>
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer"> <q-tr :props="props" class="cursor-pointer">
<q-td auto-width>
<q-icon
v-if="props.row.isDefault === true"
name="mdi-bookmark"
size="xs"
color="primary"
>
<q-tooltip>เวลา Default</q-tooltip>
</q-icon>
</q-td>
<q-td <q-td
v-for="col in props.cols" v-for="col in props.cols"
:key="col.name" :key="col.name"
@ -125,7 +149,7 @@ onMounted(async () => {
</q-td> </q-td>
</q-tr> </q-tr>
</template> </template>
</Table> </d-table>
</div> </div>
</q-card> </q-card>
</template> </template>