Merge branch 'nice_dev' into develop
This commit is contained in:
commit
40cbf40b6f
4 changed files with 70 additions and 31 deletions
|
|
@ -1,11 +1,13 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, reactive } from "vue";
|
import { ref, onMounted, reactive, watch } from "vue";
|
||||||
import { useQuasar, type QTableProps } from "quasar";
|
import { useQuasar, type QTableProps } from "quasar";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import genReportXLSX from "@/plugins/genreportxlsx";
|
import genReportXLSX from "@/plugins/genreportxlsx";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
|
|
||||||
|
import type { NewPagination } from "@/modules/15_development/interface/index/Main";
|
||||||
|
|
||||||
/** importStore*/
|
/** importStore*/
|
||||||
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
|
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
@ -21,6 +23,8 @@ const pagination = ref({
|
||||||
rowsPerPage: 10,
|
rowsPerPage: 10,
|
||||||
});
|
});
|
||||||
const maxPage = ref<number>(1);
|
const maxPage = ref<number>(1);
|
||||||
|
const totalList = ref<number>(0); //จำนวนข้อมูลรายการ
|
||||||
|
|
||||||
const formFilter = reactive({
|
const formFilter = reactive({
|
||||||
root: null,
|
root: null,
|
||||||
page: 1,
|
page: 1,
|
||||||
|
|
@ -147,8 +151,9 @@ function getData() {
|
||||||
http
|
http
|
||||||
.post(config.API.developmentHistoryList("employee"), formFilter)
|
.post(config.API.developmentHistoryList("employee"), formFilter)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log(res.data.result.data);
|
|
||||||
const data = res.data.result.data;
|
const data = res.data.result.data;
|
||||||
|
maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize);
|
||||||
|
totalList.value = res.data.result.total;
|
||||||
rows.value = data.map((item: any) => ({
|
rows.value = data.map((item: any) => ({
|
||||||
id: item.id ? item.id : null,
|
id: item.id ? item.id : null,
|
||||||
citizenId: item.citizenId ? item.citizenId : null,
|
citizenId: item.citizenId ? item.citizenId : null,
|
||||||
|
|
@ -171,6 +176,23 @@ function getData() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* function updatePagination
|
||||||
|
* @param newPagination ข้อมูล Pagination ใหม่
|
||||||
|
*/
|
||||||
|
function updatePagination(newPagination: NewPagination) {
|
||||||
|
formFilter.page = 1;
|
||||||
|
formFilter.pageSize = newPagination.rowsPerPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** callbackFunction ทำเมื่อมีการอัปเดท pageSize*/
|
||||||
|
watch(
|
||||||
|
() => formFilter.pageSize,
|
||||||
|
() => {
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchListOrg();
|
fetchListOrg();
|
||||||
});
|
});
|
||||||
|
|
@ -267,7 +289,7 @@ onMounted(() => {
|
||||||
outlined
|
outlined
|
||||||
debounce="300"
|
debounce="300"
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
@keydown.enter.prevent="getData()"
|
@keydown.enter.prevent="(formFilter.page = 1), getData()"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon v-if="formFilter.keyword == ''" name="search" />
|
<q-icon v-if="formFilter.keyword == ''" name="search" />
|
||||||
|
|
@ -316,8 +338,10 @@ onMounted(() => {
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
v-model:pagination="pagination"
|
v-model:pagination="pagination"
|
||||||
:rows-per-page-options="[10, 25, 50, 100]"
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
|
@update:pagination="updatePagination"
|
||||||
>
|
>
|
||||||
<template v-slot:pagination="scope">
|
<template v-slot:pagination="scope">
|
||||||
|
ทั้งหมด {{ totalList }} รายการ
|
||||||
<q-pagination
|
<q-pagination
|
||||||
v-model="formFilter.page"
|
v-model="formFilter.page"
|
||||||
active-color="primary"
|
active-color="primary"
|
||||||
|
|
@ -327,6 +351,7 @@ onMounted(() => {
|
||||||
size="sm"
|
size="sm"
|
||||||
boundary-links
|
boundary-links
|
||||||
direction-links
|
direction-links
|
||||||
|
@update:model-value="getData"
|
||||||
></q-pagination>
|
></q-pagination>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,14 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, reactive } from "vue";
|
import { ref, onMounted, reactive, watch } from "vue";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { useQuasar, type QTableProps } from "quasar";
|
import { useQuasar, type QTableProps } from "quasar";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import genReportXLSX from "@/plugins/genreportxlsx";
|
import genReportXLSX from "@/plugins/genreportxlsx";
|
||||||
|
|
||||||
|
/**importType*/
|
||||||
|
import type { NewPagination } from "@/modules/15_development/interface/index/Main";
|
||||||
|
|
||||||
/** importStore*/
|
/** importStore*/
|
||||||
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
|
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
@ -23,6 +26,7 @@ const formFilter = reactive({
|
||||||
year: new Date().getFullYear(),
|
year: new Date().getFullYear(),
|
||||||
});
|
});
|
||||||
const maxPage = ref<number>(1);
|
const maxPage = ref<number>(1);
|
||||||
|
const totalList = ref<number>(0); //จำนวนข้อมูลรายการ
|
||||||
|
|
||||||
/** use*/
|
/** use*/
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
@ -110,12 +114,14 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const agencyOp = ref<[]>([]);
|
const agencyOp = ref<[]>([]);
|
||||||
|
|
||||||
function fetchListOrg() {
|
function fetchListOrg() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.get(config.API.developmentHistoryListOrg("officer", formFilter.year))
|
.get(config.API.developmentHistoryListOrg("officer", formFilter.year))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
formFilter.root = null;
|
formFilter.root = null;
|
||||||
|
formFilter.page = 1;
|
||||||
rows.value = [];
|
rows.value = [];
|
||||||
agencyOp.value = res.data.result;
|
agencyOp.value = res.data.result;
|
||||||
getData();
|
getData();
|
||||||
|
|
@ -135,6 +141,8 @@ function getData() {
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log(res.data.result.data);
|
console.log(res.data.result.data);
|
||||||
const data = res.data.result.data;
|
const data = res.data.result.data;
|
||||||
|
maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize);
|
||||||
|
totalList.value = res.data.result.total;
|
||||||
rows.value = data.map((item: any) => ({
|
rows.value = data.map((item: any) => ({
|
||||||
id: item.id ? item.id : null,
|
id: item.id ? item.id : null,
|
||||||
citizenId: item.citizenId ? item.citizenId : null,
|
citizenId: item.citizenId ? item.citizenId : null,
|
||||||
|
|
@ -181,6 +189,23 @@ function onEdit(id: string) {
|
||||||
router.push(`/development/history/${id}`);
|
router.push(`/development/history/${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* function updatePagination
|
||||||
|
* @param newPagination ข้อมูล Pagination ใหม่
|
||||||
|
*/
|
||||||
|
function updatePagination(newPagination: NewPagination) {
|
||||||
|
formFilter.page = 1;
|
||||||
|
formFilter.pageSize = newPagination.rowsPerPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** callbackFunction ทำเมื่อมีการอัปเดท pageSize*/
|
||||||
|
watch(
|
||||||
|
() => formFilter.pageSize,
|
||||||
|
() => {
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchListOrg();
|
fetchListOrg();
|
||||||
});
|
});
|
||||||
|
|
@ -275,9 +300,8 @@ onMounted(() => {
|
||||||
v-model="formFilter.keyword"
|
v-model="formFilter.keyword"
|
||||||
ref="filterRef"
|
ref="filterRef"
|
||||||
outlined
|
outlined
|
||||||
debounce="300"
|
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
@keydown.enter.prevent="getData()"
|
@keydown.enter.prevent="(formFilter.page = 1), getData()"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon v-if="formFilter.keyword == ''" name="search" />
|
<q-icon v-if="formFilter.keyword == ''" name="search" />
|
||||||
|
|
@ -324,8 +348,10 @@ onMounted(() => {
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
v-model:pagination="pagination"
|
v-model:pagination="pagination"
|
||||||
:rows-per-page-options="[10, 25, 50, 100]"
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
|
@update:pagination="updatePagination"
|
||||||
>
|
>
|
||||||
<template v-slot:pagination="scope">
|
<template v-slot:pagination="scope">
|
||||||
|
ทั้งหมด {{ totalList }} รายการ
|
||||||
<q-pagination
|
<q-pagination
|
||||||
v-model="formFilter.page"
|
v-model="formFilter.page"
|
||||||
active-color="primary"
|
active-color="primary"
|
||||||
|
|
@ -335,6 +361,7 @@ onMounted(() => {
|
||||||
size="sm"
|
size="sm"
|
||||||
boundary-links
|
boundary-links
|
||||||
direction-links
|
direction-links
|
||||||
|
@update:model-value="getData"
|
||||||
></q-pagination>
|
></q-pagination>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,8 @@ const formQuery = reactive<FormQueryListProject>({
|
||||||
node: null,
|
node: null,
|
||||||
nodeId: null,
|
nodeId: null,
|
||||||
});
|
});
|
||||||
const totalList = ref<number>(1); //จำนวนข้อมูลรายการ
|
const totalList = ref<number>(0); //จำนวนข้อมูลรายการ
|
||||||
|
const totalPage = ref<number>(1);
|
||||||
|
|
||||||
/** funciton fetch รายการโครงการ*/
|
/** funciton fetch รายการโครงการ*/
|
||||||
function fetchListProject() {
|
function fetchListProject() {
|
||||||
|
|
@ -110,7 +111,8 @@ function fetchListProject() {
|
||||||
)
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result.data;
|
const data = res.data.result.data;
|
||||||
totalList.value = Math.ceil(res.data.result.total / formQuery.pageSize);
|
totalPage.value = Math.ceil(res.data.result.total / formQuery.pageSize);
|
||||||
|
totalList.value = res.data.result.total;
|
||||||
rows.value = data;
|
rows.value = data;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -499,11 +501,12 @@ onMounted(() => {
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:pagination="scope">
|
<template v-slot:pagination="scope">
|
||||||
|
ทั้งหมด {{ totalList }} รายการ
|
||||||
<q-pagination
|
<q-pagination
|
||||||
v-model="formQuery.page"
|
v-model="formQuery.page"
|
||||||
active-color="primary"
|
active-color="primary"
|
||||||
color="dark"
|
color="dark"
|
||||||
:max="Number(totalList)"
|
:max="Number(totalPage)"
|
||||||
size="sm"
|
size="sm"
|
||||||
boundary-links
|
boundary-links
|
||||||
direction-links
|
direction-links
|
||||||
|
|
|
||||||
|
|
@ -108,26 +108,6 @@ const scholarshipTypeOp = ref<DataOption[]>([
|
||||||
name: "ศึกษา ฝึกอบรม ประชุม ดูงาน และปฏิบัติการวิจัย ณ ต่างประเทศ",
|
name: "ศึกษา ฝึกอบรม ประชุม ดูงาน และปฏิบัติการวิจัย ณ ต่างประเทศ",
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const itemDownload = ref<ItemsDownload[]>([
|
|
||||||
{
|
|
||||||
label: "ดาวน์โหลด 1",
|
|
||||||
value: "",
|
|
||||||
icon: "mdi-file-pdf-box",
|
|
||||||
color: "green",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "ดาวน์โหลด 2",
|
|
||||||
value: "",
|
|
||||||
icon: "mdi-file-table",
|
|
||||||
color: "red",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "ดาวน์โหลด 3",
|
|
||||||
value: "",
|
|
||||||
icon: "mdi-file-word",
|
|
||||||
color: "blue",
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
const formQuery = reactive({
|
const formQuery = reactive({
|
||||||
page: 1,
|
page: 1,
|
||||||
|
|
@ -137,6 +117,7 @@ const formQuery = reactive({
|
||||||
keyword: "",
|
keyword: "",
|
||||||
});
|
});
|
||||||
const totalList = ref<number>(1); //จำนวนข้อมูลรายการ
|
const totalList = ref<number>(1); //จำนวนข้อมูลรายการ
|
||||||
|
const maxPage = ref<number>(1);
|
||||||
|
|
||||||
function fetchList() {
|
function fetchList() {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -147,7 +128,9 @@ function fetchList() {
|
||||||
)
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result.data;
|
const data = res.data.result.data;
|
||||||
totalList.value = Math.ceil(res.data.result.total / formQuery.pageSize);
|
maxPage.value = Math.ceil(res.data.result.total / formQuery.pageSize);
|
||||||
|
totalList.value = res.data.result.total;
|
||||||
|
|
||||||
rows.value = data;
|
rows.value = data;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -369,11 +352,12 @@ onMounted(() => {
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:pagination="scope">
|
<template v-slot:pagination="scope">
|
||||||
|
ทั้งหมด {{ totalList }} รายการ
|
||||||
<q-pagination
|
<q-pagination
|
||||||
v-model="formQuery.page"
|
v-model="formQuery.page"
|
||||||
active-color="primary"
|
active-color="primary"
|
||||||
color="dark"
|
color="dark"
|
||||||
:max="Number(totalList)"
|
:max="Number(maxPage)"
|
||||||
size="sm"
|
size="sm"
|
||||||
boundary-links
|
boundary-links
|
||||||
direction-links
|
direction-links
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue