hrms-mgt/src/modules/12_evaluatePersonal/views/MainPage.vue

160 lines
5.2 KiB
Vue
Raw Normal View History

2023-12-14 10:43:13 +07:00
<script setup lang="ts">
import { onMounted, ref } from "vue";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
2023-12-15 13:30:39 +07:00
import Table from "@/modules/12_evaluatePersonal/components/Table.vue";
2023-12-14 10:43:13 +07:00
import { useCounterMixin } from "@/stores/mixin";
2023-12-15 13:30:39 +07:00
import { useEvalutuonStore } from "@/modules/12_evaluatePersonal/store/Evaluate";
2023-12-14 10:43:13 +07:00
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
const $q = useQuasar(); // show dialog
const router = useRouter();
//search data table
const mixin = useCounterMixin();
const store = useEvalutuonStore();
2023-12-14 10:43:13 +07:00
const { showLoader, hideLoader, messageError } = mixin;
const initialPagination = ref<Pagination>({
rowsPerPage: 0,
});
2023-12-19 15:05:48 +07:00
function Detailpage(id:string) {
router.push(`/evaluate/detail/${id}`);
}
2023-12-14 10:43:13 +07:00
const page = ref<number>(1);
const pageSize = ref<number>(10);
2023-12-14 10:43:13 +07:00
const maxPage = ref<number>(1);
const filter = ref<string>("");
/**
* งขอมลจำลองไปย store
*/
onMounted(async () => {
store.fetchData([
{
2023-12-19 15:05:48 +07:00
id:'xxx1',
citizanId: "1230030004001",
fullName: "นางวัศยา ศรีสร้อย",
position: "ผู้อำนวยการสถาบัน",
level: "ปฏิบัติการ",
positionNumber: "สก.ก412",
agency: "กลุ่มงานกฎหมาย",
status: "WAIT_CHECK_DOC_V1",
},
{
2023-12-19 15:05:48 +07:00
id:'xxx2',
citizanId: "122222000401",
fullName: "นายสิริศักดิ์ พรมบุตร",
position: "นักบริหาร",
level: "ชำนาญการพิเศษ",
positionNumber: "สก.ก412",
agency: "กลุ่มงานกฎหมายอาคาร",
status: "WAIT_CHECK_DOC_V2",
},
{
2023-12-19 15:05:48 +07:00
id:'xxx3',
citizanId: "111111100401",
fullName: "นายเอกฉัท วีระโชติ ",
position: "นักบริหาร",
level: "อำนวยการ",
positionNumber: "สก.ก412",
agency: "กลุ่มงานการคลัง",
status: "DONE",
},
{
2023-12-19 15:05:48 +07:00
id:'xxx4',
citizanId: "122203000401",
fullName: "นางธนิดา มั่นคงประสิทธิ์",
position: "ผู้อำนวยการกอง",
level: "อาวุโส",
positionNumber: "สก.ก412",
agency: "กลุ่มกิจการสภา",
status: "WAIT_CHECK_DOC_V1",
},
{
2023-12-19 15:05:48 +07:00
id:'xxx5',
citizanId: "123003111401",
fullName: "นางณิชมน ลือขำ ",
position: "ผู้อำนวยการสถาบัน",
level: "ชำนาญงาน",
positionNumber: "สก.ก412",
agency: "กลุ่มกิจการสภา",
status: "WAIT_CHECK_DOC_V2",
},
{
2023-12-19 15:05:48 +07:00
id:'xxx6',
citizanId: "111111100401",
fullName: "นายเอกฉัท วีระโชติ ",
position: "นักบริหาร",
level: "อำนวยการ",
positionNumber: "สก.ก412",
agency: "กลุ่มงานการคลัง",
status: "ANNOUNCE_WEB",
},
{
2023-12-19 15:05:48 +07:00
id:'xxx7',
citizanId: "111111100401",
fullName: "นายเอกฉัท วีระโชติ ",
position: "นักบริหาร",
level: "อำนวยการ",
positionNumber: "สก.ก412",
agency: "กลุ่มงานการคลัง",
status: "PREPARE_DOC_V2",
},
{
2023-12-19 15:05:48 +07:00
id:'xxx8',
citizanId: "111111100401",
fullName: "นายเอกฉัท วีระโชติ ",
position: "นักบริหาร",
level: "อำนวยการ",
positionNumber: "สก.ก412",
agency: "กลุ่มงานการคลัง",
status: "CHECK_DOC_V2",
},
]);
});
2023-12-14 10:43:13 +07:00
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
รายการคำขอประเม
</div>
<q-card flat bordered class="col-12 q-mt-sm q-pt-sm q-pa-md">
<div>
<Table
style="max-height: 80vh"
:rows="store.rows"
:columns="store.columns"
:visible-columns="store.visibleColumns"
v-model:inputfilter="filter"
v-model:inputvisible="store.visibleColumns"
:pagination="initialPagination"
:nornmalData="true"
:paging="true"
:titleText="''"
:page="page"
:pageSize="pageSize"
:maxPage="maxPage"
>
<template #columns="props">
<q-tr :props="props" class="cursor-pointer">
2023-12-19 15:05:48 +07:00
<q-td v-for="col in props.cols" :key="col.name" :props="props" @click="Detailpage(props.row.id)">
2023-12-14 10:43:13 +07:00
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
<div v-else>
{{ col.value }}
</div>
</q-td>
</q-tr>
</template>
</Table>
</div>
</q-card>
</template>
<style></style>