mock data
This commit is contained in:
parent
d6077712e5
commit
2508b6c4ab
3 changed files with 111 additions and 118 deletions
|
|
@ -579,14 +579,15 @@ const fetchData = async (load: boolean = false) => {
|
|||
const result = await getInsignia(false, load);
|
||||
version.value = result.version; //ตัวแปรที่บอกว่าข้อมูลเผยแพร่ไปหรือยัง published=เผยแพร่แล้ว draft=ยังไม่เผยแพร่
|
||||
idVersion.value = result.idversion; //เลข id ใน mongodb
|
||||
|
||||
updateData.value = false;
|
||||
rows.value = result.data;
|
||||
rows.value.sort(
|
||||
(
|
||||
firstItem: RequestItemsHistoryObject,
|
||||
secondItem: RequestItemsHistoryObject
|
||||
) => firstItem.level - secondItem.level
|
||||
);
|
||||
updateData.value = false;
|
||||
rows.value = result.data;
|
||||
const data = rows.value;
|
||||
let option: DataOption[] = [];
|
||||
data.map((r: RequestItemsHistoryObject) => {
|
||||
|
|
|
|||
|
|
@ -504,7 +504,7 @@ const OriginalDataFetch = async () => {
|
|||
// ดูรายการหน้าต่อไป
|
||||
const redirectToPage = (id?: number) => {
|
||||
// router.push({ name: 'placementDetail'});
|
||||
router.push(`/placement/order/detail`);
|
||||
// router.push(`/placement/order/detail`);
|
||||
};
|
||||
|
||||
const clickDelete = (id: string) => {
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@
|
|||
v-model:selected="selected"
|
||||
class="custom-header-table"
|
||||
:pagination-label="paginationLabel"
|
||||
v-model:pagination="pagination"
|
||||
>
|
||||
<template v-slot:header-selection="scope">
|
||||
<q-checkbox keep-color color="primary" v-model="scope.selected" />
|
||||
|
|
@ -81,9 +82,42 @@
|
|||
</template>
|
||||
<template v-slot:body-cell="props">
|
||||
<q-td :props="props">
|
||||
<div v-if="props.cols.name == 'no'">
|
||||
<div v-if="props.col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="props.col.name == 'educate'">
|
||||
<q-select
|
||||
:class="getClass(true)"
|
||||
hide-bottom-space
|
||||
multiple
|
||||
:outlined="true"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!true"
|
||||
:borderless="!true"
|
||||
v-model="props.value"
|
||||
:rules="[(val:any) => !!val || `${'กรุณาเลือกเลือกวุฒิการศึกษา'}`,(val:any) => val.length > 0 || `${'กรุณาเลือกเลือกวุฒิการศึกษา'}`]"
|
||||
:label="`${'เลือกวุฒิการศึกษา'}`"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="[]"
|
||||
option-value="id"
|
||||
input-debounce="0"
|
||||
color="primary"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="cast_for_education" color="primary" />
|
||||
</template>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-black">
|
||||
ไม่พบข้อมูลที่ค้นหา
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
<div v-else @click="click(props)">
|
||||
{{ props.value }}
|
||||
</div>
|
||||
|
|
@ -134,156 +168,107 @@ const $q = useQuasar();
|
|||
|
||||
const filterRef = ref<QInput>();
|
||||
const filter = ref<string>("");
|
||||
const visibleColumns = ref<String[]>([
|
||||
"name",
|
||||
"calories",
|
||||
"fat",
|
||||
"carbs",
|
||||
"protein",
|
||||
"sodium",
|
||||
"calcium",
|
||||
"iron",
|
||||
]);
|
||||
const visibleColumns = ref<String[]>(["no", "idcard", "name", "educate"]);
|
||||
const columns = [
|
||||
{ name: "no", align: "left", label: "ลำดับ", field: "no", sortable: true },
|
||||
{
|
||||
name: "desc",
|
||||
required: true,
|
||||
label: "Dessert (100g serving)",
|
||||
name: "idcard",
|
||||
align: "left",
|
||||
field: (row) => row.name,
|
||||
format: (val) => `${val}`,
|
||||
label: "เลขประจำตัวประชาชน",
|
||||
field: "idcard",
|
||||
sortable: true,
|
||||
},
|
||||
{
|
||||
name: "calories",
|
||||
align: "center",
|
||||
label: "Calories",
|
||||
field: "calories",
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "ชื่อ-สกุล",
|
||||
field: "name",
|
||||
sortable: true,
|
||||
},
|
||||
{ name: "fat", label: "Fat (g)", field: "fat", sortable: true },
|
||||
{ name: "carbs", label: "Carbs (g)", field: "carbs" },
|
||||
{ name: "protein", label: "Protein (g)", field: "protein" },
|
||||
{ name: "sodium", label: "Sodium (mg)", field: "sodium" },
|
||||
{
|
||||
name: "calcium",
|
||||
label: "Calcium (%)",
|
||||
field: "calcium",
|
||||
name: "educate",
|
||||
align: "left",
|
||||
label: "วุฒิการศึกษาในการออกคำสั่ง",
|
||||
field: "educate",
|
||||
sortable: true,
|
||||
sort: (a, b) => parseInt(a, 10) - parseInt(b, 10),
|
||||
},
|
||||
{
|
||||
name: "iron",
|
||||
label: "Iron (%)",
|
||||
field: "iron",
|
||||
sortable: true,
|
||||
sort: (a, b) => parseInt(a, 10) - parseInt(b, 10),
|
||||
},
|
||||
];
|
||||
|
||||
const rows = [
|
||||
{
|
||||
name: "Frozen Yogurt",
|
||||
calories: 159,
|
||||
fat: 6.0,
|
||||
carbs: 24,
|
||||
protein: 4.0,
|
||||
sodium: 87,
|
||||
calcium: "14%",
|
||||
iron: "1%",
|
||||
no: "0ac56905-1a74-4606-a120-233340adde95",
|
||||
name: "นางนัทธ์ เหล่าสกุล",
|
||||
idcard: "9158455632145",
|
||||
educate: "",
|
||||
},
|
||||
{
|
||||
name: "Ice cream sandwich",
|
||||
calories: 237,
|
||||
fat: 9.0,
|
||||
carbs: 37,
|
||||
protein: 4.3,
|
||||
sodium: 129,
|
||||
calcium: "8%",
|
||||
iron: "1%",
|
||||
no: "0de607a0-b094-4a6d-9e30-979343ab5e53",
|
||||
name: "นางขรรค์ จันทรสมบัติ",
|
||||
idcard: "8558455632126",
|
||||
educate: "",
|
||||
},
|
||||
{
|
||||
name: "Eclair",
|
||||
calories: 262,
|
||||
fat: 16.0,
|
||||
carbs: 23,
|
||||
protein: 6.0,
|
||||
sodium: 337,
|
||||
calcium: "6%",
|
||||
iron: "7%",
|
||||
no: "93ca7366-2a35-4f94-a331-9c23c9ea78d3",
|
||||
name: "นางโอภาส จรัสวงศ์",
|
||||
idcard: "8158455635425",
|
||||
educate: "",
|
||||
},
|
||||
{
|
||||
name: "Cupcake",
|
||||
calories: 305,
|
||||
fat: 3.7,
|
||||
carbs: 67,
|
||||
protein: 4.3,
|
||||
sodium: 413,
|
||||
calcium: "3%",
|
||||
iron: "8%",
|
||||
no: "d3777c19-2bd0-42df-90ce-c3eeeee55ac6",
|
||||
name: "นางธิญา หงษ์ทอง",
|
||||
idcard: "4558455632145",
|
||||
educate: "",
|
||||
},
|
||||
{
|
||||
name: "Gingerbread",
|
||||
calories: 356,
|
||||
fat: 16.0,
|
||||
carbs: 49,
|
||||
protein: 3.9,
|
||||
sodium: 327,
|
||||
calcium: "7%",
|
||||
iron: "16%",
|
||||
no: "1ccead6f-a851-4291-b3ab-a20757ecddbd",
|
||||
name: "นางธนวิทย์ พิกุลเทพ",
|
||||
idcard: "5542455632145",
|
||||
educate: "",
|
||||
},
|
||||
{
|
||||
name: "Jelly bean",
|
||||
calories: 375,
|
||||
fat: 0.0,
|
||||
carbs: 94,
|
||||
protein: 0.0,
|
||||
sodium: 50,
|
||||
calcium: "0%",
|
||||
iron: "0%",
|
||||
no: "1ccead6f-a851-4291-b3ab-a20757ecddbd",
|
||||
name: "นางหนึ่ง สตาภิรมย์",
|
||||
idcard: "7448455632145",
|
||||
educate: "",
|
||||
},
|
||||
{
|
||||
name: "Lollipop",
|
||||
calories: 392,
|
||||
fat: 0.2,
|
||||
carbs: 98,
|
||||
protein: 0,
|
||||
sodium: 38,
|
||||
calcium: "0%",
|
||||
iron: "2%",
|
||||
no: "1ccead6f-a851-4291-b3ab-a20757ecddbd",
|
||||
name: "นางสัจพร คมคาย",
|
||||
idcard: "1236455632145",
|
||||
educate: "",
|
||||
},
|
||||
{
|
||||
name: "Honeycomb",
|
||||
calories: 408,
|
||||
fat: 3.2,
|
||||
carbs: 87,
|
||||
protein: 6.5,
|
||||
sodium: 562,
|
||||
calcium: "0%",
|
||||
iron: "45%",
|
||||
no: "1ccead6f-a851-4291-b3ab-a20757ecddbd",
|
||||
name: "นางตุลยากร ปรีดาศิริกุล",
|
||||
idcard: "1523455632145",
|
||||
educate: "",
|
||||
},
|
||||
{
|
||||
name: "Donut",
|
||||
calories: 452,
|
||||
fat: 25.0,
|
||||
carbs: 51,
|
||||
protein: 4.9,
|
||||
sodium: 326,
|
||||
calcium: "2%",
|
||||
iron: "22%",
|
||||
no: "1ccead6f-a851-4291-b3ab-a20757ecddbd",
|
||||
name: "นางบัลลังค์ จิรวาณิชย์",
|
||||
idcard: "1258455632145",
|
||||
educate: "",
|
||||
},
|
||||
{
|
||||
name: "KitKat",
|
||||
calories: 518,
|
||||
fat: 26.0,
|
||||
carbs: 65,
|
||||
protein: 7,
|
||||
sodium: 54,
|
||||
calcium: "12%",
|
||||
iron: "6%",
|
||||
no: "1ccead6f-a851-4291-b3ab-a20757ecddbd",
|
||||
name: "นางคมคาย เรืองรังสรรค์",
|
||||
idcard: "8548455632145",
|
||||
educate: "",
|
||||
},
|
||||
{
|
||||
no: "1ccead6f-a851-4291-b3ab-a20757ecddbd",
|
||||
name: "นางพรทิพา คมคาย",
|
||||
idcard: "6598455632145",
|
||||
educate: "",
|
||||
},
|
||||
];
|
||||
const selected = ref([]);
|
||||
const pagination = ref({
|
||||
sortBy: "desc",
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
const click = (e: any) => {
|
||||
console.log(e);
|
||||
|
|
@ -305,6 +290,13 @@ const resetFilter = () => {
|
|||
filter.value = "";
|
||||
filterRef.value!.focus();
|
||||
};
|
||||
|
||||
const getClass = (val: boolean) => {
|
||||
return {
|
||||
"full-width inputgreen cursor-pointer": val,
|
||||
"full-width cursor-pointer": !val,
|
||||
};
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.icon-color {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue