KPI => refactor code
This commit is contained in:
parent
61e06096bf
commit
e9ce66b6c1
5 changed files with 105 additions and 74 deletions
|
|
@ -144,6 +144,12 @@ const pagination = ref({
|
|||
rowsPerPage: pageSize.value,
|
||||
});
|
||||
|
||||
/**
|
||||
* ตัวแปร
|
||||
*/
|
||||
const year = ref<number | null>(new Date().getFullYear()); //ปีงบประมาณ
|
||||
const roundOp = ref<DataOption[]>([]); // รายการรอบการประเมิน
|
||||
|
||||
/**
|
||||
* function fetch รายการแผนพัฒนาการปฏิบัติราชการรายบุคคลย้อนหลัง
|
||||
*/
|
||||
|
|
@ -158,8 +164,6 @@ function fetcDataList() {
|
|||
})
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
console.log(data);
|
||||
|
||||
rows.value = data.data;
|
||||
total.value = data.total;
|
||||
maxPage.value = Math.ceil(total.value / pageSize.value);
|
||||
|
|
@ -172,8 +176,6 @@ function fetcDataList() {
|
|||
});
|
||||
}
|
||||
|
||||
const year = ref<number | null>(new Date().getFullYear());
|
||||
const roundOp = ref<DataOption[]>([]);
|
||||
/**
|
||||
* function fetch รอบการประเมิน
|
||||
*/
|
||||
|
|
@ -205,6 +207,7 @@ function fetchRoundOption() {
|
|||
} else {
|
||||
roundOp.value = [];
|
||||
store.formQuery.round = "";
|
||||
rows.value = [];
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -215,6 +218,9 @@ function fetchRoundOption() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function เปลี่ยนรอบการประเมิน และ เรียกข้อมูลรายการแผนพัฒนาการปฏิบัติราชการรายบุคคลย้อนหลัง
|
||||
*/
|
||||
function changRound() {
|
||||
store.formQuery.page = 1;
|
||||
fetcDataList();
|
||||
|
|
@ -228,12 +234,6 @@ function onSearchData() {
|
|||
fetcDataList();
|
||||
}
|
||||
|
||||
function clearYear() {
|
||||
year.value = null;
|
||||
store.formQuery.round = "";
|
||||
roundOp.value = [];
|
||||
fetcDataList();
|
||||
}
|
||||
/**
|
||||
* ทำงานเมื่อมีการเปลี่ยนแถวต่อหน้า
|
||||
*/
|
||||
|
|
@ -251,6 +251,9 @@ function onClickView(id: string) {
|
|||
devId.value = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* HookLifecycle
|
||||
*/
|
||||
onMounted(() => {
|
||||
store.formQuery.round = "";
|
||||
fetchRoundOption();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue