ปรับวินัย

This commit is contained in:
Warunee Tamkoo 2023-11-24 16:52:10 +07:00
parent 7b56868c1f
commit 3482ec0ae4
18 changed files with 1222 additions and 70 deletions

View file

@ -1,134 +0,0 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
/** importType */
import type { QTableProps } from "quasar";
/** importStroe */
import { useOrderStore } from "@/modules/11_discipline/store/OrderStore";
const OrderStore = useOrderStore();
/** รับ props มาจากหน้าหลัก */
const props = defineProps({
filterTable: {
type: String,
default: "",
},
});
/** ข้อมูลที่เเสดงใน คอลัม */
const columns = ref<QTableProps["columns"]>([
{
name: "subject",
align: "left",
label: "เรื่อง",
sortable: true,
field: "subject",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "ordernumber",
align: "left",
label: "เลขที่คำสั่ง",
sortable: true,
field: "ordernumber",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "dateOrder",
align: "left",
label: "สั่ง ณ วันที่/วันที่คำสั่งมีผล",
sortable: true,
field: "dateOrder",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "orderby",
align: "left",
label: "คำสั่งโดย",
sortable: true,
field: "orderby",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "signer",
align: "left",
label: "ผู้ลงนาม",
sortable: true,
field: "signer",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "statusorder",
align: "left",
label: "สถานะของคำสั่ง",
sortable: true,
field: "statusorder",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
/** หัวตาราง */
const visibleColumns = ref<string[]>([
"subject",
"ordernumber",
"dateOrder",
"orderby",
"signer",
"statusorder",
]);
/** โหลดข้อมูลเมื่อเข้าหน้านี้ */
onMounted(() => {
OrderStore.columns = columns.value;
OrderStore.visibleColumns = visibleColumns.value;
});
/** pagination */
const pagination = ref({
descending: true,
page: 1,
rowsPerPage: 10,
});
</script>
<template>
<d-table
for="table"
ref="table"
:columns="columns"
:rows="OrderStore.rows"
:filter="props.filterTable"
row-key="subject"
flat
bordered
dense
class="custom-header-table"
:visible-columns="OrderStore.visibleColumns"
v-model:pagination="pagination"
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer" style="height: 40px">
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div>
{{ col.value }}
</div>
</q-td>
</q-tr>
</template>
</d-table>
</template>
<style scoped></style>