KPI => refactor code
This commit is contained in:
parent
61e06096bf
commit
e9ce66b6c1
5 changed files with 105 additions and 74 deletions
|
|
@ -46,12 +46,13 @@ const maxPage = defineModel<number>("maxPage", { required: true });
|
|||
const total = defineModel<number>("total", { required: true });
|
||||
const keyword = defineModel<string>("keyword", { required: true });
|
||||
const porps = defineProps({
|
||||
fetchData: { type: Function, required: true },
|
||||
fetchData: { type: Function, required: true }, // function เรีนกข้อมูลประกาศผล
|
||||
});
|
||||
|
||||
/**
|
||||
* Table
|
||||
*/
|
||||
const selected = ref<ResResults[]>([]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
|
|
@ -172,7 +173,12 @@ const pagination = ref({
|
|||
page: page.value,
|
||||
rowsPerPage: pageSize.value,
|
||||
});
|
||||
const selected = ref<ResResults[]>([]);
|
||||
|
||||
/**
|
||||
* ตัวแปร
|
||||
*/
|
||||
const year = ref<number | null>(new Date().getFullYear()); //ปีงบประมาณ
|
||||
const roundOp = ref<DataOption[]>([]); // รายการรอบการประเมิน
|
||||
|
||||
/**
|
||||
* function บันทึกการประกาศผล
|
||||
|
|
@ -202,8 +208,6 @@ function onAnnounce() {
|
|||
);
|
||||
}
|
||||
|
||||
const year = ref<number | null>(new Date().getFullYear());
|
||||
const roundOp = ref<DataOption[]>([]);
|
||||
/**
|
||||
* function fetch รอบการประเมิน
|
||||
*/
|
||||
|
|
@ -233,6 +237,7 @@ function fetchRoundOption() {
|
|||
} else {
|
||||
roundOp.value = [];
|
||||
store.formQuery.round = "";
|
||||
rows.value = [];
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -243,6 +248,9 @@ function fetchRoundOption() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function เปลี่ยนรอบการประเมิน และ เรียกข้อมูลรายการแผนพัฒนาการปฏิบัติราชการรายบุคคลย้อนหลัง
|
||||
*/
|
||||
function changRound() {
|
||||
store.formQuery.page = 1;
|
||||
porps.fetchData();
|
||||
|
|
@ -256,12 +264,6 @@ function onSearchData() {
|
|||
porps.fetchData();
|
||||
}
|
||||
|
||||
// function clearYear() {
|
||||
// year.value = null;
|
||||
// store.formQuery.round = "";
|
||||
// roundOp.value = [];
|
||||
// porps.fetchData();
|
||||
// }
|
||||
/**
|
||||
* ทำงานเมื่อมีการเปลี่ยนแถวต่อหน้า
|
||||
*/
|
||||
|
|
@ -270,6 +272,9 @@ watch(pagination, () => {
|
|||
pageSize.value = pagination.value.rowsPerPage;
|
||||
});
|
||||
|
||||
/**
|
||||
* ทำงานเมื่อมีการเปลี่ยนแถวต่อหน้า
|
||||
*/
|
||||
onMounted(() => {
|
||||
store.formQuery.round = "";
|
||||
fetchRoundOption();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue