limit api search user + add loadding
All checks were successful
frontend-action / build-image (push) Successful in 45s

This commit is contained in:
2024-05-18 01:13:03 +07:00
parent 1477cfbd28
commit 0eb8e42086
5 changed files with 79 additions and 45 deletions

View File

@@ -3,12 +3,12 @@
<Header /> <Header />
<Section2Green /> <Section2Green />
<!-- <Section3Base /> --> <!-- <Section3Base /> -->
<Section4White/> <Section4White />
<Section5Green/> <Section5Green />
<Section6Base/> <Section6Base />
<Section7GreenTab/> <Section7GreenTab />
<Section8Base/> <Section8Base />
<FooterPage/> <FooterPage />
</div> </div>
</template> </template>
<script> <script>
@@ -25,7 +25,8 @@ import Section8Base from "./Section8Base.vue";
import FooterPage from "./FooterPage.vue"; import FooterPage from "./FooterPage.vue";
export default { export default {
computed: { computed: {
...mapGetters(["getUsername"]),}, ...mapGetters(["getUsername"]),
},
components: { components: {
Header, Header,
Section2Green, Section2Green,
@@ -35,9 +36,7 @@ export default {
Section6Base, Section6Base,
Section7GreenTab, Section7GreenTab,
Section8Base, Section8Base,
FooterPage FooterPage,
}, },
mounted() { mounted() {
// if(this.getUsername){ // if(this.getUsername){
@@ -56,15 +55,19 @@ export default {
// }); // });
// this.$store.commit("setCheckLogin", true); // this.$store.commit("setCheckLogin", true);
// } // }
}, },
}; };
</script> </script>
<style > <style>
.bg-main { .bg-main {
background: #f6ebd5; background: #f6ebd5;
min-height: 100vh; min-height: 100vh;
height:auto; height: auto;
overflow-x: hidden;
}
@media only screen and (min-width: 0px) and (max-width: 700px) {
.bg-main {
overflow-x: hidden;
}
} }
</style> </style>

View File

@@ -1,20 +1,21 @@
<template> <template>
<div style="position: relative" class="text-normal bg-curve my-auto" > <div style="position: relative" class="text-normal bg-curve my-auto">
<div <div
style="width: 90%" style="width: 90%"
class="text-center text-white py-10 mx-auto my-auto" class="text-center text-white py-10 mx-auto my-auto"
v-if=" v-if="
getUsername == '' || getUsername == null || getUsername == undefined getUsername == '' || getUsername == null || getUsername == undefined
" "
> >
<div class="text-subtitle mx-10 text-center box-order mx-auto my-5 d-none" style="color:#ffffff;"> <div
ขั้นตอนที่ class="text-subtitle mx-10 text-center box-order mx-auto my-5 d-none"
<v-avatar color="#f4c03f" class="text-subtitle">2</v-avatar> style="color: #ffffff"
</div> >
<div class="text-title my-3">มาลองสร้างตัวตนสมัคร สว.</div> ขั้นตอนที่
<div class="mb-8"> <v-avatar color="#f4c03f" class="text-subtitle">2</v-avatar>
ลงทะเบียนแสดงตัวตน แสดงความคิดเห็น สมัคร สว.
</div> </div>
<div class="text-title my-3">มาลองสร้างตัวตนสมัคร สว.</div>
<div class="mb-8">ลงทะเบียนแสดงตัวตน แสดงความคิดเห็น สมัคร สว.</div>
<v-btn <v-btn
elevated elevated
@@ -33,11 +34,14 @@
<span class="text-normal"> ลงทะเบียนผู้สมัคร</span> <span class="text-normal"> ลงทะเบียนผู้สมัคร</span>
</v-btn> </v-btn>
</div> </div>
<div class="text-center text-white py-10 pb-20 mx-auto" v-if="getUsername" style="width: 90%"> <div
class="text-center text-white py-10 pb-20 mx-auto"
v-if="getUsername"
style="width: 90%"
>
<div class="text-title my-3">ค้นหาผู้แสดงตนเป็นผู้สมัคร สว.</div> <div class="text-title my-3">ค้นหาผู้แสดงตนเป็นผู้สมัคร สว.</div>
<div class="mb-8"> <div class="mb-8">
ค้นหาผู้แสดงตนเป็นผู้สมัคร สว. ใน จังหวัด/เขต ค้นหาผู้แสดงตนเป็นผู้สมัคร สว. ใน จังหวัด/อำเภอ ที่ตัวเองเป็นผู้แสดงตน
ที่ตัวเองเป็นผู้แสดงตน
</div> </div>
<v-btn <v-btn
elevated elevated
@@ -73,7 +77,7 @@ export default {
height: auto; height: auto;
background-position: center bottom; background-position: center bottom;
background-color: white; background-color: white;
background-size: cover; background-size: cover;
/* background: #2b2b26 0% 0% no-repeat padding-box; */ /* background: #2b2b26 0% 0% no-repeat padding-box; */
} }
.bg-green-black { .bg-green-black {

View File

@@ -47,7 +47,7 @@
<v-row> <v-row>
<v-col> <v-col>
<div class="box-group"> <div class="box-group">
<div>กลมท</div> <div class="t-md">กลมท</div>
<div <div
class="font-weight-bold" class="font-weight-bold"
style="font-size: xxx-large" style="font-size: xxx-large"
@@ -58,7 +58,7 @@
</v-col> </v-col>
<v-col> <v-col>
<div class="box-group"> <div class="box-group">
<div>หมายเลขผสมคร</div> <div class="t-md">หมายเลขผสมคร</div>
<div style="font-size: xxx-large"> <div style="font-size: xxx-large">
<div class="font-weight-bold" v-if="item.registerno"> <div class="font-weight-bold" v-if="item.registerno">
{{ item.registerno }} {{ item.registerno }}
@@ -426,3 +426,10 @@ export default {
} }
} }
</style> </style>
<style scoped>
@media only screen and (min-width: 900px) and (max-width: 1290px) {
.t-md {
font-size: 18px;
}
}
</style>

View File

@@ -13,13 +13,13 @@
> >
<div class="text-subtitle text-left mb-md-3"> <div class="text-subtitle text-left mb-md-3">
<v-row align="center"> <v-row align="center">
<v-col cols="auto" class="pa-0 pl-2 pt-2"> <v-avatar color="#3d763d" class="text-normal" size="50" <v-col cols="auto" class="pa-0 pl-2 pt-2">
>{{ group.id }} <v-avatar color="#3d763d" class="text-normal" size="50"
</v-avatar></v-col> >{{ group.id }}
<v-col > {{ group.name }}</v-col> </v-avatar></v-col
>
<v-col> {{ group.name }}</v-col>
</v-row> </v-row>
</div> </div>
<!-- {{ result }} --> <!-- {{ result }} -->
<v-container> <v-container>
@@ -238,6 +238,8 @@ export default {
}; };
}, },
mounted() { mounted() {
this.$emit("valueSent", true);
// this.load2 = true;
let data = {}; let data = {};
if (this.province && this.province.id) { if (this.province && this.province.id) {
data.province = this.province.id; data.province = this.province.id;
@@ -248,6 +250,7 @@ export default {
if (this.group) { if (this.group) {
data.group = this.group.id; data.group = this.group.id;
} }
data.limit = 5;
if (data) { if (data) {
client.user.getAllUser client.user.getAllUser
.query(data) .query(data)
@@ -293,7 +296,8 @@ export default {
if (rs.length == 0) { if (rs.length == 0) {
this.show = true; this.show = true;
} }
this.$emit("valueSent", false);
// this.load2 = false;
// this.districtItems = rs; // this.districtItems = rs;
}) })
.catch((error) => { .catch((error) => {
@@ -378,6 +382,7 @@ div.v-window__container
width: -webkit-fill-available; width: -webkit-fill-available;
/* width: fit-content; */ /* width: fit-content; */
} }
@media only screen and (min-width: 0px) and (max-width: 700px) { @media only screen and (min-width: 0px) and (max-width: 700px) {
div.v-window__container div.v-window__container
> div.v-window-item.v-window-item--active.v-carousel-item > div.v-window-item.v-window-item--active.v-carousel-item
@@ -400,7 +405,7 @@ div.v-window__container
} }
div.font-weight-bold.my-2.text-md-left > div.text-sub2.text-left.mt-5 { div.font-weight-bold.my-2.text-md-left > div.text-sub2.text-left.mt-5 {
margin-top: 0px !important; margin-top: 0px !important;
line-height: 21px; line-height: 24px;
} }
div.v-window__container div.v-window__container
> div.v-window-item.v-window-item--active.v-carousel-item > div.v-window-item.v-window-item--active.v-carousel-item
@@ -432,7 +437,7 @@ div.v-window__container
border-radius: 10px; border-radius: 10px;
width: -webkit-fill-available; width: -webkit-fill-available;
/* width: fit-content; */ /* width: fit-content; */
min-width: 100%; /* min-width: 90%; */
padding: 5px 0px; padding: 5px 0px;
height: 85px; height: 85px;
line-height: 37px; line-height: 37px;

View File

@@ -95,6 +95,7 @@
</v-col> </v-col>
</v-row> </v-row>
<v-btn <v-btn
v-if="province"
color="#e23972" color="#e23972"
class="mt-8" class="mt-8"
elevated elevated
@@ -103,7 +104,7 @@
searchUserApi(0, ''); searchUserApi(0, '');
showGroup = false; showGroup = false;
" "
:loading="load" :loading="load || load2"
width="300" width="300"
height="52px" height="52px"
> >
@@ -111,13 +112,14 @@
</v-btn> </v-btn>
<!-- @click="searchUserApi(0, 'all')" --> <!-- @click="searchUserApi(0, 'all')" -->
<v-btn <v-btn
v-if="province"
color="#4c884c" color="#4c884c"
class="mx-5 mt-8" class="mx-5 mt-8"
elevated elevated
size="large" size="large"
width="300" width="300"
@click="showGroup = true" @click="showGroup = true"
:loading="load" :loading="load || load2"
height="52px" height="52px"
> >
<span class="text-sub">นหาทกกลมอาช</span> <span class="text-sub">นหาทกกลมอาช</span>
@@ -148,19 +150,25 @@
</div> </div>
<!-- <v-container class="my-0 py-0"> --> <!-- <v-container class="my-0 py-0"> -->
<div> <div>
<!-- v-if="showGroup" --> <v-progress-linear
v-if="showGroup && load2"
class="px-7 mt-5"
style="width: 90%"
color="green"
:indeterminate="load2"
></v-progress-linear>
<v-checkbox <v-checkbox
v-if="showGroup" v-if="showGroup"
v-model="checkbox1" v-model="checkbox1"
label="ดูเฉพาะกลุ่มอาชีพที่มีข้อมูล" label="ดูเฉพาะกลุ่มอาชีพที่มีข้อมูล"
size="large" size="large"
class="px-7 mt-5 check-card text-subtitle" class="px-7 mt-5 check-card text-subtitle"
color="#3d763d" color="#3d763d"
hide-details hide-details
></v-checkbox> ></v-checkbox>
</div> </div>
<!-- </v-container> --> <!-- </v-container> -->
<div v-for="(group, i) in apiGroup" :key="i"> <div v-for="(group, i) in apiGroup" :key="i">
<CardUserGroup <CardUserGroup
:check="checkbox1" :check="checkbox1"
@@ -168,6 +176,7 @@
:province="province" :province="province"
:district="district" :district="district"
v-if="showGroup" v-if="showGroup"
@value-sent="handleValueSent"
/> />
</div> </div>
</div> </div>
@@ -187,6 +196,7 @@ export default {
}, },
data() { data() {
return { return {
load2: false,
checkbox1: true, checkbox1: true,
showGroup: false, showGroup: false,
apiGroup: [], apiGroup: [],
@@ -207,6 +217,11 @@ export default {
}; };
}, },
methods: { methods: {
handleValueSent(value) {
this.load2 = value;
console.log("Received value from child:", value);
// ทำงานกับค่าที่ได้รับ
},
searchUser(offset) { searchUser(offset) {
this.show = false; this.show = false;
this.load = true; this.load = true;