page รอ API // ui เมนู

This commit is contained in:
STW_TTTY\stwtt 2024-03-29 18:05:19 +07:00
parent acdc6d19f7
commit 621f965151
8 changed files with 319 additions and 23 deletions

View file

@ -61,7 +61,7 @@
color="grey-6"
@click="goToUserRegistry()"
/>
<q-tooltip>ทะเบยนประวd</q-tooltip>
<q-tooltip>ทะเบยนประว</q-tooltip>
</q-btn>
</div>
<div class="q-pl-lg q-pt-sm q-gutter-xs textSub">

View file

@ -1,5 +1,5 @@
<template>
<q-table
<d-table
ref="table"
flat
:class="
@ -11,10 +11,21 @@
dense
virtual-scroll
:virtual-scroll-sticky-size-start="48"
:pagination-label="paginationLabel"
:pagination="initialPagination"
:rows-per-page-options="[0]"
:rows-per-page-options="[10, 25, 50, 100]"
v-model:pagination="pagination"
>
<template v-slot:pagination="scope">
<q-pagination
v-model="currentPage"
active-color="primary"
color="dark"
:max="Number(maxPage)"
size="sm"
boundary-links
direction-links
></q-pagination>
</template>
<template v-slot:top="props">
<div class="q-py-sm col-12 row">
<q-space />
@ -96,7 +107,7 @@
/>
</div>
</div>
<div class="items-center">
<div class="items-center full-width">
<q-slide-transition
v-show="searchPanel"
class="q-mb-sm"
@ -175,7 +186,7 @@
label="ชื่อ-นามสกุล"
@update:model-value="updateFullname"
/>
<datepicker
<!-- <datepicker
class="col-2"
menu-class-name="modalfix"
:model-value="retireYear"
@ -205,14 +216,6 @@
clearable
@clear="clearDate"
>
<!-- <template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template> -->
</q-input>
</template>
</datepicker>
@ -298,7 +301,7 @@
label="ตำแหน่งเลขที่"
@update:model-value="updatePosNo"
class="col-3"
/>
/> -->
<!-- <datepicker
class="col-2"
menu-class-name="modalfix"
@ -363,7 +366,7 @@
class="col-4"
/> -->
<q-toggle
<!-- <q-toggle
dense
:model-value="isShowRetire"
color="primary"
@ -380,6 +383,7 @@
>
ทดลองปฏหนาทราชการ
</q-toggle>
<q-space /> -->
<q-space />
<div>
<q-btn
@ -387,7 +391,7 @@
color="primary"
icon="mdi-magnify"
label="ค้นหา"
class="q-px-md"
class="q-px-md full-height"
@click="doSearch"
/>
</div>
@ -441,23 +445,36 @@
<template #body="props">
<slot v-bind="props" name="columns"></slot>
</template>
</q-table>
</d-table>
<PopupADdEmployee v-model:modal="modalEmployee" />
</template>
<script setup lang="ts">
import { ref, useAttrs } from "vue";
import { ref, useAttrs, reactive,watch } from "vue";
import type { Pagination } from "@/modules/04_registry/interface/index/Main";
import type { DataOption } from "@/modules/04_registry/components/profileType";
import PopupHistory from "./PopupHistory.vue";
import PopupADdEmployee from "@/components/DialogAddEmployee.vue";
const currentPage = ref<number>(1);
const maxPage = ref<number>(1);
const page = ref<number>(1);
const rowsPerPage = ref<number>(10);
const attrs = ref<any>(useAttrs());
const table = ref<any>(null);
const filterRef = ref<any>(null);
const searchPanel = ref<boolean>(true);
const initialPagination = ref<Pagination>({
rowsPerPage: 0,
/**
*pagination ของตาราง
*/
const pagination = ref({
descending: false,
page: page.value,
rowsPerPage: rowsPerPage.value,
});
const employeeClassOps = ref<DataOption[]>([
{ id: "officer", name: "ข้าราชการ กทม.สามัญ" },
// { id: "employee", name: "()" },
@ -625,6 +642,27 @@ const modalEmployee = ref<boolean>(false);
function ocClickAddEmployee() {
modalEmployee.value = !modalEmployee.value;
}
function getList(){
console.log('GETok')
}
watch(
() => currentPage.value,
() => {
rowsPerPage.value = pagination.value.rowsPerPage;
getList();
}
);
watch(
() => pagination.value.rowsPerPage,
() => {
rowsPerPage.value = pagination.value.rowsPerPage;
currentPage.value = 1;
getList();
}
);
</script>
<style lang="scss">
.icon-color {

View file

@ -1,5 +1,6 @@
import type { zipCodeOption } from "../../components/profileType";
interface Pagination {
page: number;
rowsPerPage: number;
}

View file

@ -190,7 +190,8 @@ const employeePosition = ref<string>("");
const employeeLevel = ref<string>("");
const posNo = ref<string>("");
const initialPagination = ref<Pagination>({
rowsPerPage: 0,
page: 1,
rowsPerPage: 10,
});
const expanded = ref<string[]>([]);
const selected = ref<string>("");

View file

@ -0,0 +1,121 @@
<script setup lang="ts">
import { onMounted, reactive, ref } from "vue";
import { useQuasar } from "quasar";
import type { FormFollowResult } from "@/modules/15_development/interface/request/Main";
import type { DataOption } from "@/modules/15_development/interface/index/Main";
import { useCounterMixin } from "@/stores/mixin";
const $q = useQuasar();
const { showLoader, hideLoader, dialogConfirm } = useCounterMixin();
const formData = reactive<FormFollowResult>({
metricType: "",
indicators: "",
target: "",
calculation: "",
});
const metricTypeOp = ref<DataOption[]>([
{
id: "id1",
name: "name1",
},
{
id: "id2",
name: "name2",
},
{
id: "id3",
name: "name3",
},
]);
const options = ref<any>([
"สำนักงานคณะกรรมการข้าราชการกรุงเทพมหานครกองบริหารทั้วไป",
"สำนักงานคณะกรรมการข้าราชการกรุงเทพมหานคร",
]);
function onSubmit() {
dialogConfirm($q, () => {});
}
onMounted(() => {
console.log("ข้อมูลเบื้องต้น");
});
</script>
<template>
<q-form greedy @submit.prevent @validation-success="onSubmit">
<div class="row q-pa-md q-col-gutter-sm">
<div class="col-12 col-sm-6 col-md-4">
<q-select
dense
outlined
label="ประเภทตัวชี้วัด"
v-model="formData.metricType"
:options="metricTypeOp"
option-label="name"
option-value="id"
:rules="[
(val:string) =>
!!val || `${'กรุณากรอกประเภทตัวชี้วัด'}`,
]"
/>
</div>
<div class="col-12 col-sm-6 col-md-4">
<q-input
dense
outlined
label="ตัวชี้วัด"
v-model="formData.indicators"
:rules="[
(val:string) =>
!!val || `${'กรุณากรอกตัวชี้วัด'}`,
]"
/>
</div>
<div class="col-12 col-sm-6 col-md-4">
<q-input
dense
outlined
label="เป้าหมาย"
v-model="formData.target"
:rules="[
(val:string) =>
!!val || `${'กรุณากรอกเป้าหมาย'}`,
]"
/>
</div>
<div class="col-12">
<q-input
outlined
dense
v-model="formData.calculation"
label="วิธีการคำนวณ/เครื่องมือ"
type="textarea"
:rules="[
(val:string) =>
!!val || `${'กรุณากรอกวิธีการคำนวณ/เครื่องมือ'}`,
]"
/>
</div>
</div>
<q-separator />
<div class="text-right q-pa-sm">
<q-btn
dense
unelevated
label="บันทึก"
id="onSubmit"
type="submit"
color="public"
class="q-px-md"
>
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</div>
</q-form>
</template>
<style scoped></style>

View file

@ -5,6 +5,8 @@ import { useRouter, useRoute } from "vue-router";
import BasicInfo from "@/modules/15_development/components/BasicInfo.vue";
import Target from "@/modules/15_development/components/Target.vue";
import ProjectDetail from "@/modules/15_development/components/ProjectDetail.vue";
import FollowResult from "@/modules/15_development/components/FollowResult.vue";
import Other from "@/modules/15_development/components/Other.vue";
const router = useRouter();
const route = useRoute();
@ -40,6 +42,8 @@ const tab = ref<string>("BasicInfo");
<q-tab name="BasicInfo" label="ข้อมูลเบื้องต้น" />
<q-tab name="Target" label="เป้าหมาย" />
<q-tab name="ProjectDetail" label="ลักษณะโครงการ" />
<q-tab name="FollowResult" label="การติดตามการประเมินผล" />
<q-tab name="Other" label="อื่นๆ" />
</q-tabs>
<q-separator />
<div class="q-pa-sm" style="padding: 0px">
@ -49,6 +53,8 @@ const tab = ref<string>("BasicInfo");
</q-tab-panel>
<q-tab-panel name="Target"> <Target /></q-tab-panel>
<q-tab-panel name="ProjectDetail"> <ProjectDetail /> </q-tab-panel>
<q-tab-panel name="FollowResult"> <FollowResult /> </q-tab-panel>
<q-tab-panel name="Other"> <Other /> </q-tab-panel>
</q-tab-panels>
</div>
</q-card>

View file

@ -0,0 +1,121 @@
<script setup lang="ts">
import { onMounted, reactive, ref } from "vue";
import { useQuasar } from "quasar";
import type { FormFollowResult } from "@/modules/15_development/interface/request/Main";
import type { DataOption } from "@/modules/15_development/interface/index/Main";
import { useCounterMixin } from "@/stores/mixin";
const $q = useQuasar();
const { showLoader, hideLoader, dialogConfirm } = useCounterMixin();
const formData = reactive<FormFollowResult>({
metricType: "",
indicators: "",
target: "",
calculation: "",
});
const metricTypeOp = ref<DataOption[]>([
{
id: "id1",
name: "name1",
},
{
id: "id2",
name: "name2",
},
{
id: "id3",
name: "name3",
},
]);
const options = ref<any>([
"สำนักงานคณะกรรมการข้าราชการกรุงเทพมหานครกองบริหารทั้วไป",
"สำนักงานคณะกรรมการข้าราชการกรุงเทพมหานคร",
]);
function onSubmit() {
dialogConfirm($q, () => {});
}
onMounted(() => {
console.log("ข้อมูลเบื้องต้น");
});
</script>
<template>
<q-form greedy @submit.prevent @validation-success="onSubmit">
<div class="row q-pa-md q-col-gutter-sm">
<div class="col-12 col-sm-6 col-md-4">
<q-select
dense
outlined
label="ประเภทตัวชี้วัด"
v-model="formData.metricType"
:options="metricTypeOp"
option-label="name"
option-value="id"
:rules="[
(val:string) =>
!!val || `${'กรุณากรอกประเภทตัวชี้วัด'}`,
]"
/>
</div>
<div class="col-12 col-sm-6 col-md-4">
<q-input
dense
outlined
label="ตัวชี้วัด"
v-model="formData.indicators"
:rules="[
(val:string) =>
!!val || `${'กรุณากรอกตัวชี้วัด'}`,
]"
/>
</div>
<div class="col-12 col-sm-6 col-md-4">
<q-input
dense
outlined
label="เป้าหมาย"
v-model="formData.target"
:rules="[
(val:string) =>
!!val || `${'กรุณากรอกเป้าหมาย'}`,
]"
/>
</div>
<div class="col-12">
<q-input
outlined
dense
v-model="formData.calculation"
label="วิธีการคำนวณ/เครื่องมือ"
type="textarea"
:rules="[
(val:string) =>
!!val || `${'กรุณากรอกวิธีการคำนวณ/เครื่องมือ'}`,
]"
/>
</div>
</div>
<q-separator />
<div class="text-right q-pa-sm">
<q-btn
dense
unelevated
label="บันทึก"
id="onSubmit"
type="submit"
color="public"
class="q-px-md"
>
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</div>
</q-form>
</template>
<style scoped></style>

View file

@ -26,9 +26,17 @@ interface FormGroupRelate {
amount: number | null;
}
interface FormFollowResult {
metricType:string
indicators:string
target:string
calculation:string
}
export type {
FormQueryProject,
FormBasicinfo,
FormGroupTarget,
FormGroupRelate,
FormFollowResult,
};