update edit / login / responsive
All checks were successful
frontend-action / build-image (push) Successful in 57s

This commit is contained in:
2024-04-23 18:57:44 +07:00
parent b1e2d326a5
commit e5683c7f2b
26 changed files with 1884 additions and 88 deletions

3
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"nuxt.isNuxtApp": false
}

View File

@@ -5,7 +5,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>logo.png">
<title> <title>
<%= htmlWebpackPlugin.options.title %> <%= htmlWebpackPlugin.options.title %>
</title> </title>

BIN
public/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@@ -1,7 +1,7 @@
<template> <template>
<v-app> <v-app>
<v-main class="bg-main"> <v-main class="bg-main">
<div class="d-block w-100 text-right pa-3"> <div class="d-block w-100 text-right pa-3 mb-5">
<span class="img-logo"> <span class="img-logo">
<router-link to="/"> <router-link to="/">
<span class="float-left"> <span class="float-left">
@@ -11,15 +11,21 @@
width="80" width="80"
></v-img></span></router-link ></v-img></span></router-link
></span> ></span>
<!-- {{ getUsernameFromLocalStorage }} -->
<span <span
><v-btn ><v-btn
icon="mdi-home-variant-outline" icon="mdi-home-variant-outline"
variant="text" variant="text"
href="/" href="/"
></v-btn ></v-btn
><v-btn icon="mdi-account-outline" variant="text"></v-btn> ><v-btn variant="text" v-if="getUsername" to="/profile">
<v-btn variant="text"> Sign In </v-btn> <v-icon icon="mdi-account-outline" ></v-icon>{{ getUsername }}</v-btn
<v-btn elevated color="#F4C03F"> Get Started </v-btn></span >
<v-btn variant="text" v-if="getUsername" @click="logout" class="mr-2"><v-icon icon="mdi-logout"></v-icon> Logout </v-btn>
<v-btn variant="text" class="mr-2" v-else to="/login" > <v-icon icon="mdi-login"></v-icon> Log In </v-btn>
<v-btn elevated color="#F4C03F" to="/check" href="#started" > Get Started </v-btn></span
> >
</div> </div>
<router-view /> <router-view />
@@ -31,17 +37,40 @@
import { client } from "./utils/trpc"; import { client } from "./utils/trpc";
client.info.getAllZones.query({}).then(console.log); client.info.getAllZones.query({}).then(console.log);
// import MainVote from "./components/MainVote.vue"; // import MainVote from "./components/MainVote.vue";
import { mapGetters } from "vuex";
export default { export default {
name: "App", name: "App",
computed: {
...mapGetters(["getUsername"]),
},
components: { components: {
// MainVote, // MainVote,
}, },
data: () => ({ data: () => ({
// username: "",
}), }),
methods: {
logout() {
localStorage.clear();
// location.reload();
this.$store.commit("setUsername", "");
this.$router.push("/");
},
},
mounted() {
// this.$emitter.on("loginUser", (val) => {
// console.log("user", val);
// if (val) {
// this.username = localStorage.getItem("username");
// }
// });
this.username = localStorage.getItem("username");
if(this.getUsername==""){
this.$store.commit("setUsername", this.username);
}
},
}; };
</script> </script>
<style> <style>
@@ -90,23 +119,23 @@ export default {
display: none; display: none;
} }
.text-title { .text-title {
font-size: 28px; font-size: 25px;
font-weight: 500; font-weight: 500;
/* font: normal normal medium 47px/77px IBM Plex Sans Thai; */ /* font: normal normal medium 47px/77px IBM Plex Sans Thai; */
} }
.text-normal { .text-normal {
font-size: 25px; font-size: 22px;
} }
.text-subtitle { .text-subtitle {
font-size: 22px; font-size: 22px;
font-weight: 600; font-weight: 600;
} }
.text-sub { .text-sub {
font-size: 23px; font-size: 21px;
font-weight: 400; font-weight: 400;
} }
.text-sub2 { .text-sub2 {
font-size: 20px; font-size: 19px;
/* font-weight: 500; */ /* font-weight: 500; */
} }
.text-sub3 { .text-sub3 {

BIN
src/assets/Group 195.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
src/assets/Group 196.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
src/assets/Group 197.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
src/assets/Group 198.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
src/assets/Group 199.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -32,7 +32,7 @@
</div> </div>
<div style="position: relative" class="bg-curve" id="started"> <div style="position: relative" class="bg-curve" id="started">
<v-row style="height: 100%" align="center" class="text-center"> <v-row style="height: 100%" align="center" class="text-center">
<v-col cols="12" md="4"> <v-col cols="12" md="">
<div style="position: relative"> <div style="position: relative">
<v-btn <v-btn
elevated elevated
@@ -54,7 +54,7 @@
</v-btn> </v-btn>
</div> </div>
</v-col> </v-col>
<v-col cols="12" md="4" class="mt-0 mt-md-10 mt-lg-10"> <v-col cols="12" md="" class="mt-0 mt-md-10 mt-lg-10" v-if="getUsername==''||getUsername==null||getUsername==undefined">
<v-btn <v-btn
elevated elevated
color="#DD6C31" color="#DD6C31"
@@ -72,7 +72,8 @@
แสดงตนเปนผสมคร แสดงตนเปนผสมคร
</v-btn> </v-btn>
</v-col> </v-col>
<v-col cols="12" md="4"> <!-- {{ getUsername }} -->
<v-col cols="12" md="" v-if="getUsername">
<v-btn <v-btn
elevated elevated
color="#DD6C31" color="#DD6C31"
@@ -96,7 +97,13 @@
</div> </div>
</template> </template>
<script> <script>
export default {}; import { mapGetters } from "vuex";
export default {
computed: {
...mapGetters(["getUsername"]),
},
};
</script> </script>
<style> <style>
.text-normal .v-btn--size-large { .text-normal .v-btn--size-large {

View File

@@ -3,27 +3,27 @@
<div class="text-center text-white py-5"> <div class="text-center text-white py-5">
<div class="text-title my-3">มาศกษากอนจะเป สว.</div> <div class="text-title my-3">มาศกษากอนจะเป สว.</div>
<v-row> <v-row>
<v-col class="border-green"> <v-col class="border-green" cols="12" md="">
<v-icon icon="mdi-circle" color="#B2C573"></v-icon> <v-icon icon="mdi-circle" color="#B2C573"></v-icon>
<div>ใครสมครสว.ไดาง</div> <div>ใครสมครสว.ไดาง</div>
</v-col> </v-col>
<v-col class="border-green"> <v-col class="border-green" cols="12" md="">
<v-icon icon="mdi-circle" color="#B2C573"></v-icon> <v-icon icon="mdi-circle" color="#B2C573"></v-icon>
<div>หนาทของสว.</div> <div>หนาทของสว.</div>
</v-col> </v-col>
<v-col> <v-col cols="12" md="">
<v-icon icon="mdi-circle" color="#B2C573"></v-icon> <v-icon icon="mdi-circle" color="#B2C573"></v-icon>
<div>กระบวนการเลอก สมาชกวสภา</div> <div>กระบวนการเลอก สมาชกวสภา</div>
</v-col> </v-col>
</v-row> </v-row>
<v-row> <v-row>
<v-col> <v-col cols="12" md="">
<v-icon icon="mdi-circle" color="#B2C573"></v-icon> <v-icon icon="mdi-circle" color="#B2C573"></v-icon>
<div>นตอนการเลอกสว.</div> <div>นตอนการเลอกสว.</div>
</v-col> </v-col>
<v-col> <v-col cols="12" md="">
<v-icon icon="mdi-circle" color="#B2C573"></v-icon> <v-icon icon="mdi-circle" color="#B2C573"></v-icon>
<div>กลมอาช สมครรบเลอกสว.</div> <div>กลมอาช สมครรบเลอกสว.</div>
@@ -46,5 +46,10 @@ export default {};
.border-green{ .border-green{
border-right: 5px solid #b2c573; border-right: 5px solid #b2c573;
} }
@media only screen and (min-width: 0px) and (max-width: 700px) {
.bg-green-curve {
min-height: 700px;
}
}
</style> </style>

View File

@@ -7,7 +7,7 @@
โดยมณสมบงน โดยมณสมบงน
</div> </div>
<div>เชคคณสมบนเลย !</div> <div>เชคคณสมบนเลย !</div>
<v-btn elevated color="#DD6C31" class="text-normal mt-4" stacked height="80"> <v-btn elevated color="#DD6C31" class="text-normal mt-4" stacked height="80" to="/check">
ตรวจสอบคณสมบการเป สว. ตรวจสอบคณสมบการเป สว.
</v-btn> </v-btn>
</div> </div>

View File

@@ -1,7 +1,7 @@
<template> <template>
<div style="position: relative" class="bg-green-full text-normal py-7"> <div style="position: relative" class="bg-green-full text-normal py-2">
<div id="scroll-container"> <div id="scroll-container">
<div id="scroll-text" class="text-sub"> <div id="scroll-text" class="text-sub d-none">
<v-icon icon="mdi-circle" size="20"></v-icon> <v-icon icon="mdi-circle" size="20"></v-icon>
กลมบรหารราชการแผนดนและความมนคง กลมบรหารราชการแผนดนและความมนคง
<v-icon icon="mdi-circle" size="20"></v-icon> <v-icon icon="mdi-circle" size="20"></v-icon>

View File

@@ -38,16 +38,28 @@
{{ item.text }} {{ item.text }}
</div> </div>
</v-card-item> </v-card-item>
</v-card>
<v-btn <v-btn
@click="count++" @click="count++"
style="top: -55px" class=" pa-4 mb-5 mr-5 btn-phone"
class="float-right"
icon="mdi-skip-next" icon="mdi-skip-next"
rounded="circle" rounded="circle"
size="lg" size="xl"
color="#4c884c" color="#4c884c"
></v-btn> ></v-btn>
</v-card>
<!-- <v-btn
@click="count++"
style="top:-100px; right: 25px;"
class="float-right pa-4 mb-5 mr-5 "
icon="mdi-skip-next"
rounded="circle"
size="xl"
color="#4c884c"
></v-btn> -->
</v-col> </v-col>
</v-row> </v-row>
</div> </div>

View File

@@ -12,7 +12,7 @@
<br /> <br />
<div class="text-sub ma-auto" style="width: 90%"> <div class="text-sub ma-auto" style="width: 90%">
อยากลงสมครสว. แตไมแนใจวาเราสามารถสมครไดหรอไม อยากลงสมครสว. แตไมแนใจวาเราสามารถสมครไดหรอไม
เราสามารถมารวมกนเชณสมบ เชเราามารถสมครกลมไหน เขตอำเภอไหนบาง เราสามารถตรวจสอบณสมบ เชาสามารถสมครกลมไหน เขตอำเภอไหนบาง
ในการลงสมคร สว. ! ในการลงสมคร สว. !
</div> </div>
<v-btn <v-btn
@@ -31,9 +31,10 @@
class="mx-auto" class="mx-auto"
src="@/assets/Group 51.png" src="@/assets/Group 51.png"
width="230" width="230"
></v-img> ></v-img>
<v-btn variant="text" append color="#3ba8c8" size="lg" <v-btn variant="text" append color="#168fb3" size="lg" to="/detail"
><div class="text-wrap text-sub3" style="width: 100%; margin: auto"> ><div class="text-wrap text-sub" style="width: 100%; margin: auto">
ตรวจเชคคณสมบ-กษณะตองหามของผจะสมคร สว. ตรวจเชคคณสมบ-กษณะตองหามของผจะสมคร สว.
</div></v-btn </div></v-btn
> >

View File

@@ -8,7 +8,7 @@
<v-btn <v-btn
@click="model++" @click="model++"
style="z-index: 999" style="z-index: 999"
class="float-right btn-r" class="float-right btn-r btn-desk"
rounded="circle" rounded="circle"
size="lg" size="lg"
color="white" color="white"
@@ -20,14 +20,14 @@
v-if="model > 0" v-if="model > 0"
@click="model--" @click="model--"
style="z-index: 999" style="z-index: 999"
class="float-right btn-l" class="float-right btn-l btn-desk"
rounded="circle" rounded="circle"
size="lg" size="lg"
color="white" color="white"
><v-icon icon="mdi-menu-left" size="70" color="#F4C03F"></v-icon ><v-icon icon="mdi-menu-left" size="70" color="#F4C03F"></v-icon
></v-btn> ></v-btn>
<!-- hide-delimiters --> <!-- hide-delimiters -->
<v-carousel <v-carousel
style="height: auto; min-height: 100vh" style="height: auto; min-height: 100vh"
progress="#f4c03f" progress="#f4c03f"
@@ -131,11 +131,41 @@
</div> </div>
</div> </div>
</div> </div>
<div class="text-center my-10 next-phone">
<v-btn
v-if="model > 0"
@click="model--"
style="z-index: 999"
rounded="circle"
size="lg"
color="white"
class="mr-5"
><v-icon
icon="mdi-menu-left"
size="70"
color="#F4C03F"
></v-icon
></v-btn>
<v-btn
@click="model++"
style="z-index: 999"
rounded="circle"
size="lg"
color="white"
v-if="model < 17"
><v-icon
icon="mdi-menu-right"
size="70"
color="#F4C03F"
></v-icon
></v-btn>
<!-- v-if="model > 0" -->
</div>
</div> </div>
</v-container> </v-container>
<div <div
v-if="model > 16 && checkNull.length==17" v-if="model > 16 && checkNull.length == 17"
class="text-sub text-white py-8 d-block" class="text-sub text-white py-8 d-block"
> >
<v-icon icon="mdi-alert-circle-outline"></v-icon> <v-icon icon="mdi-alert-circle-outline"></v-icon>
@@ -181,14 +211,25 @@
<div class="text-center mt-5"> <div class="text-center mt-5">
<v-btn <v-btn
elevated elevated
color="#DD6C31" color="#1B76BA"
class="mt-4" class="mt-4 mr-2"
stacked stacked
height="60" height="60"
to="/" to="/"
> >
<span class="text-sub">เสรจส</span> <span class="text-sub">เสรจส</span>
</v-btn> </v-btn>
<v-btn
elevated
color="#DD6C31"
stacked
height="60"
to="/forms"
class="mt-4 mr-2"
v-if="getUsername == ''"
>
<span class="text-sub">แสดงตนเปนผสมคร</span>
</v-btn>
</div> </div>
</v-container> </v-container>
</div> </div>
@@ -232,6 +273,7 @@
</template> </template>
<script> <script>
import { mapGetters } from "vuex";
export default { export default {
watch: { watch: {
model() { model() {
@@ -239,6 +281,7 @@ export default {
}, },
}, },
computed: { computed: {
...mapGetters(["getUsername"]),
checkNull() { checkNull() {
let slides = this.slides; let slides = this.slides;
let data = slides.filter((x) => x.check === null); let data = slides.filter((x) => x.check === null);
@@ -393,7 +436,7 @@ export default {
vmodel: null, vmodel: null,
}, },
{ {
txt: "คุณเคยได้รับโทษจำคุก และพ้นโทษมายังไม่ถึง 10 ปีถ้าเป็นกรณีต่อไปนี้ ให้ตอบว่า “ไม่เคย”", txt: "คุณเคยได้รับโทษจำคุก และพ้นโทษมายังไม่ถึง 10 ปีถ้าเป็นกรณีต่อไปนี้ ให้ตอบว่า “ไม่ใช่”",
subtxt: subtxt:
"คดีนั้นรอลงอาญา / พ้นโทษมายังไม่ถึง 10 ปี แต่เป็นคดีความผิดจากการกระทำโดยประมาท / พ้นโทษมายังไม่ถึง 10 ปี แต่เป็นคดีความผิดลหุโทษ (ความผิดที่กฎหมายกำหนดโทษจำคุกไม่เกินหนึ่งเดือน ปรับไม่เกิน 10,000 บาท)", "คดีนั้นรอลงอาญา / พ้นโทษมายังไม่ถึง 10 ปี แต่เป็นคดีความผิดจากการกระทำโดยประมาท / พ้นโทษมายังไม่ถึง 10 ปี แต่เป็นคดีความผิดลหุโทษ (ความผิดที่กฎหมายกำหนดโทษจำคุกไม่เกินหนึ่งเดือน ปรับไม่เกิน 10,000 บาท)",
color: "#4C884C", color: "#4C884C",
@@ -429,6 +472,12 @@ export default {
</script> </script>
<style> <style>
.btn-desk {
display: block;
}
.next-phone {
display: none;
}
.parent-container { .parent-container {
position: relative; /* ตั้งค่าเพื่อให้ .btn-r สามารถตั้งอยู่ส่วนมากในพื้นที่นี้ */ position: relative; /* ตั้งค่าเพื่อให้ .btn-r สามารถตั้งอยู่ส่วนมากในพื้นที่นี้ */
display: flex; /* ให้พาเนลหลักของพื้นที่ตรงกลางแนวตั้ง */ display: flex; /* ให้พาเนลหลักของพื้นที่ตรงกลางแนวตั้ง */
@@ -461,16 +510,22 @@ export default {
margin: auto; margin: auto;
} }
@media only screen and (min-width: 0px) and (max-width: 700px) { @media only screen and (min-width: 0px) and (max-width: 700px) {
.btn-desk {
display: none;
}
.next-phone {
display: block;
}
.btn-r { .btn-r {
background-color: transparent !important; background-color: transparent !important;
} }
.btn-l { .btn-l {
background-color: transparent !important; background-color: transparent !important;
position: absolute; position: absolute;
left: 0px; left: 0px;
margin: 15px; margin: 15px;
margin: 15px; margin: 15px;
} }
} }
</style> </style>

View File

@@ -0,0 +1,33 @@
<template lang="">
<div>
<div class="hearder-form-edit text-center pb-6 mt-2">
<v-img
class="mx-auto"
:aspect-ratio="1"
src="@/assets/logo-title.png"
width="200"
></v-img>
<div class="text-title txt-black">
อมลสวนต
</div>
<v-icon icon="mdi-circle" color="white" class="mt-2"></v-icon>
</div>
<FormSteper/>
</div>
</template>
<script>
import FormSteper from './FormSteperEdit.vue';
export default {
components:{
FormSteper
}
};
</script>
<style>
.hearder-form-edit {
background-color: #B2C573;
width: 100%;
height: auto;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -34,7 +34,7 @@
<!-- {{ form1 }} --> <!-- {{ form1 }} -->
<v-form fast-fail @submit.prevent v-model="form1"> <v-form fast-fail @submit.prevent v-model="form1">
<v-row class="px-2"> <v-row class="px-2">
<v-col class="py-3" cols="12" md="12"> <v-col class="py-3" cols="12" md="6">
<v-text-field <v-text-field
label="ชื่อ / Name" label="ชื่อ / Name"
variant="solo" variant="solo"
@@ -71,6 +71,7 @@
variant="solo" variant="solo"
type="number" type="number"
min="40" min="40"
:rules="rules.age"
v-model.number="payload.age" v-model.number="payload.age"
></v-text-field> ></v-text-field>
</v-col> </v-col>
@@ -99,7 +100,7 @@
></v-text-field> ></v-text-field>
</v-col> </v-col>
<v-col class="d-none"> <v-col class="">
<v-card <v-card
color="#4C884C" color="#4C884C"
class="pa-5 text-center h-100" class="pa-5 text-center h-100"
@@ -123,7 +124,8 @@
prepend-icon="" prepend-icon=""
variant="solo-filled" variant="solo-filled"
class="mt-5" class="mt-5"
@change="Preview_image" :rules="rules.files"
@change="onFileChanged($event)"
v-model="image" v-model="image"
></v-file-input> ></v-file-input>
</v-card> </v-card>
@@ -387,6 +389,25 @@
bg-color="#F2EBD1" bg-color="#F2EBD1"
v-model="payload.vision" v-model="payload.vision"
></v-textarea> ></v-textarea>
<div class="btn-next">
<v-btn @click="e1--" variant="text" class="float-left"
>Previous</v-btn
>
<!-- <v-spacer></v-spacer> -->
<v-btn
@click="e1++"
:disabled="
!(checkOpt1.count == checkOpt1.checkcount) ||
payload.vision == null
"
variant="tonal"
class="float-right"
>next</v-btn
>
</div>
<!-- {{ checkOpt1 }} -->
</v-card> </v-card>
</v-col> </v-col>
</v-row> </v-row>
@@ -427,6 +448,7 @@
label="โทรศัพท์" label="โทรศัพท์"
v-model="payload.public_phone" v-model="payload.public_phone"
:rules="rules.tel" :rules="rules.tel"
class="d-none"
></v-text-field ></v-text-field
></v-col> ></v-col>
</v-row> </v-row>
@@ -522,9 +544,9 @@
</div> </div>
</v-stepper-window-item> </v-stepper-window-item>
</v-stepper-window> </v-stepper-window>
<!-- v-show="e1 == 3 || el == 4" -->
<v-stepper-actions <v-stepper-actions
v-show="e1 == 3 || el == 4" v-show="e1 == 4"
:disabled="disabled" :disabled="disabled"
@click:next="next" @click:next="next"
@click:prev="prev" @click:prev="prev"
@@ -537,7 +559,9 @@
<script> <script>
// import Provinces from "./provinces.json"; // import Provinces from "./provinces.json";
// import Districts from "./districts.json"; // import Districts from "./districts.json";
import { client } from "@/utils/trpc"; import { client } from "@/utils/trpc";
import { createFormData } from "@/utils/fileUpload";
import validateThaiID from "thai-id-validator"; import validateThaiID from "thai-id-validator";
// client.info.getAllGroups.query({}).then(console.log); // client.info.getAllGroups.query({}).then(console.log);
export default { export default {
@@ -563,13 +587,14 @@ export default {
? "next" ? "next"
: undefined; : undefined;
}, },
// isIdCardValid() { checkOpt1() {
// return this.$refs.form.validate(); let dataOption = [...this.option1, ...this.option2];
// }, const filteredItems = dataOption.filter(
// // ถ้าเลขบัตรประชาชนไม่ถูกต้องให้ปุ่ม Next ถูก disable (item) => item.choice !== null && item.choice !== undefined
// isNextDisabled() { );
// return !this.isIdCardValid;
// } return { count: dataOption.length, checkcount: filteredItems.length };
},
}, },
data() { data() {
@@ -580,6 +605,12 @@ export default {
form3: false, form3: false,
form4: false, form4: false,
rules: { rules: {
files: [
(files) =>
!files ||
!files.some((file) => file.size > 3_097_152) ||
"Avatar size should be less than 3 MB!",
],
// ^[a-zA-Z0-9?><;,{}[\]\-_+=!@#$%\^&*|']*$ // ^[a-zA-Z0-9?><;,{}[\]\-_+=!@#$%\^&*|']*$
space: (v) => /^[^ ]+$/.test(v) || "must not contain spaces.", space: (v) => /^[^ ]+$/.test(v) || "must not contain spaces.",
username: (v) => username: (v) =>
@@ -621,6 +652,7 @@ export default {
(parseInt(v) == v && v.length == 13 && validateThaiID(v)) || (parseInt(v) == v && v.length == 13 && validateThaiID(v)) ||
"Invalid ID card number", "Invalid ID card number",
], ],
age: [(v) => parseInt(v) >= 40 || "Age must be over 40"],
email: [ email: [
(value) => { (value) => {
const pattern = const pattern =
@@ -660,6 +692,7 @@ export default {
url: null, url: null,
image: null, image: null,
file: null,
province: null, province: null,
district: null, district: null,
districtItems: [], districtItems: [],
@@ -730,6 +763,40 @@ export default {
}; };
}, },
methods: { methods: {
onFileChanged(event) {
const file = event.target.files[0];
this.file = file;
if (this.file && this.file !== null) {
const reader = new FileReader();
reader.onload = (event) => {
console.log(event.target.result);
this.url = event.target.result;
};
reader.readAsDataURL(this.file);
console.log();
} else {
this.url = null;
}
},
async uploadImage() {
if (!this.file) {
return;
}
let request = await client.user.requestChangeImage.mutate({
imageName: this.file.name,
contentType: this.file.type,
});
let formData = createFormData(request, this.file);
await fetch(request.postURL, {
method: "POST",
body: formData,
}).then(() => {
client.user.confirmChangeImage.mutate();
alert("บันทึกข้อมูลสำเร็จ");
});
console.log("done");
},
submit() { submit() {
let dataOption = [...this.option1, ...this.option2]; let dataOption = [...this.option1, ...this.option2];
const filterOpt = dataOption.map((item) => { const filterOpt = dataOption.map((item) => {
@@ -745,10 +812,10 @@ export default {
// console.log("opppp", filterOpt, filterOpt2); // console.log("opppp", filterOpt, filterOpt2);
// let payload = { // let payload = {
// firstName: "ธรรมนูญ", // firstName: "ธรรมนูญ2",
// lastName: "สังขวรรณ", // lastName: "สังขวรรณ",
// title: "", // title: "",
// cid: "1189900247580", // cid: "3180600024176",
// age: 60, // age: 60,
// phone: "0819444825", // phone: "0819444825",
// public_phone: "0819444885", // public_phone: "0819444885",
@@ -778,12 +845,47 @@ export default {
.mutate(this.payload) .mutate(this.payload)
.then((data) => { .then((data) => {
console.log("data", data); console.log("data", data);
alert("บันทึกข้อมูลสำเร็จ");
this.$router.push("/upload"); localStorage.setItem("token", data.token);
if (this.file) {
this.uploadImage();
} else {
alert("บันทึกข้อมูลสำเร็จ");
}
this.getUser();
// this.$router.push("/upload");
// this.provinceItems = data; // this.provinceItems = data;
}) })
.catch((error) => { .catch((error) => {
alert("ไม่สามารถอัปโหลดข้อมูลได้"); alert("ไม่สามารถบันทึกข้อมูลได้: " + error.message);
console.error("เกิดข้อผิดพลาดในการโหลดข้อมูล:", error);
});
},
login(payload) {
client.user.login
.mutate(payload)
.then((data) => {
console.log("data", data);
localStorage.setItem("token", data.token);
this.$router.push("/");
})
.catch((error) => {
alert("ไม่สามารถบันทึกข้อมูลได้: " + error.message);
console.error("เกิดข้อผิดพลาดในการโหลดข้อมูล:", error);
});
},
getUser() {
client.user.getSelf
.mutate({})
.then((data) => {
this.login({ cid: data.cid, phone: data.phone });
localStorage.setItem("username", data.firstName);
this.$store.commit("setUsername", data.firstName);
// this.$store.dispatch('setLocalStorageValue',data.firstName)
})
.catch((error) => {
alert("ไม่สามารถโหลดข้อมูลได้");
console.error("เกิดข้อผิดพลาดในการโหลดข้อมูล:", error); console.error("เกิดข้อผิดพลาดในการโหลดข้อมูล:", error);
}); });
}, },
@@ -802,12 +904,6 @@ export default {
} }
}, },
filterData() { filterData() {
// กรองข้อมูลอันที่สองโดยใช้ข้อมูลจากอันแรก
// if (this.province && this.province.provinceCode) {
// this.districtItems = [...Districts].filter(
// (item) => item.provinceCode === this.province.provinceCode
// );
// }
this.payload.zone = null; this.payload.zone = null;
client.info.getAllZones client.info.getAllZones
.query({ provice_id: this.payload.province }) .query({ provice_id: this.payload.province })

View File

@@ -10,7 +10,7 @@
<div class="text-title txt-black">นหาผสมครสว.</div> <div class="text-title txt-black">นหาผสมครสว.</div>
<v-container> <v-container>
<v-row> <v-row>
<v-col cols="12" md="3"> <v-col cols="12" md="4">
<v-autocomplete <v-autocomplete
clearable clearable
label="จังหวัด" label="จังหวัด"
@@ -24,7 +24,7 @@
hide-details hide-details
></v-autocomplete ></v-autocomplete
></v-col> ></v-col>
<v-col cols="12" md="3"> <v-col cols="12" md="4">
<v-autocomplete <v-autocomplete
clearable clearable
label="อำเภอ / เขต" label="อำเภอ / เขต"
@@ -38,7 +38,7 @@
:disabled="province == null" :disabled="province == null"
></v-autocomplete ></v-autocomplete
></v-col> ></v-col>
<v-col cols="12" md="3"> <v-col cols="12" md="4">
<v-autocomplete <v-autocomplete
clearable clearable
label="กลุ่มอาชีพ" label="กลุ่มอาชีพ"
@@ -51,20 +51,20 @@
v-model="group" v-model="group"
></v-autocomplete> ></v-autocomplete>
</v-col> </v-col>
<v-col cols="12" md="3"> <!-- <v-col cols="12" md="3">
<v-text-field <v-text-field
label="ชื่อ" label="ชื่อ"
variant="solo" variant="solo"
hide-details hide-details
></v-text-field> ></v-text-field>
</v-col> </v-col> -->
</v-row> </v-row>
<v-btn <v-btn
color="#DD6C31" color="#DD6C31"
class="mt-8" class="mt-8"
elevated elevated
size="large" size="large"
@click="searchUser(0)" @click="searchUserApi(0)"
:loading="load" :loading="load"
> >
<span class="text-sub">นหา</span> <span class="text-sub">นหา</span>
@@ -79,12 +79,15 @@
> >
<v-icon icon="mdi-alert-circle"></v-icon> ไมพบขอม <v-icon icon="mdi-alert-circle"></v-icon> ไมพบขอม
</div> </div>
<!-- {{ count }}
{{ Number(result.length)/ 2 }} -->
<div class="text-center"> <div class="text-center">
<v-pagination <v-pagination
v-model="page" v-model="page"
:length="result.length / 10" :length="Math.ceil(count/ 10)"
rounded="circle" rounded="circle"
@click="searchUser((this.page - 1) * 10)" @click="searchUser((this.page - 1) * 2)"
></v-pagination> ></v-pagination>
</div> </div>
</div> </div>
@@ -113,6 +116,7 @@ export default {
items: [], items: [],
group: null, group: null,
offset: 0, offset: 0,
count:0,
}; };
}, },
methods: { methods: {
@@ -125,10 +129,13 @@ export default {
// this.offset = (this.page - 1) * 10; // this.offset = (this.page - 1) * 10;
let data = { let data = {
offset: offset, offset: offset,
limit: 10, limit: 10,
// group: this.group, // group: this.group,
// zone: this.district, // zone: this.district,
}; };
if (this.province) {
data.province = this.province;
}
if (this.group) { if (this.group) {
data.group = this.group; data.group = this.group;
} }
@@ -160,6 +167,59 @@ export default {
console.error("เกิดข้อผิดพลาดในการโหลดข้อมูล:", error); console.error("เกิดข้อผิดพลาดในการโหลดข้อมูล:", error);
}); });
}, },
searchUserApi(offset) {
this.show = false;
this.load = true;
if (offset == 0) {
this.page = 1;
}
// this.offset = (this.page - 1) * 10;
let data = {
offset: offset,
limit: 10,
// group: this.group,
// zone: this.district,
};
if (this.province) {
data.province = this.province;
}
if (this.group) {
data.group = this.group;
}
if (this.district) {
data.zone = this.district;
}
console.log(data);
client.user.getAllUserCount
.query(data)
.then((rs) => {
this.count = rs;
})
.catch((error) => {
alert("ไม่สามารถโหลดข้อมูลได้");
console.error("เกิดข้อผิดพลาดในการโหลดข้อมูล:", error);
});
client.user.getAllUser
.query(data)
.then((rs) => {
this.result = rs;
console.log(rs);
this.load = false;
if (rs.length == 0) {
this.show = true;
}
// this.districtItems = rs;
})
.catch((error) => {
this.load = false;
alert("ไม่สามารถโหลดข้อมูลได้");
console.error("เกิดข้อผิดพลาดในการโหลดข้อมูล:", error);
});
},
filterData() { filterData() {
// กรองข้อมูลอันที่สองโดยใช้ข้อมูลจากอันแรก // กรองข้อมูลอันที่สองโดยใช้ข้อมูลจากอันแรก
this.district = null; this.district = null;

View File

@@ -1,4 +1,4 @@
export const CONFIG = { export const CONFIG = {
// api_url: "http://178.128.18.156:3000", // api_url: "http://178.128.18.156:3000",
api_url: process.env.VUE_APP_API_URL || "http://localhost:3000", api_url: process.env.VUE_APP_API_URL || "http://localhost:3000",
}; };

View File

@@ -5,12 +5,20 @@ import QuestionList from "@/views/QuestionList.vue";
import RegisterForm from "@/views/RegisterForm.vue"; import RegisterForm from "@/views/RegisterForm.vue";
import SearchUser from "@/views/SearchUser.vue"; import SearchUser from "@/views/SearchUser.vue";
import UploadImage from "@/views/UploadImage.vue"; import UploadImage from "@/views/UploadImage.vue";
import LoginForm from "@/views/LoginForm.vue";
import ProfileUser from "@/views/ProfileUser.vue";
import CheckDetail from "@/views/CheckDetail.vue";
const routes = [ const routes = [
{ {
path: "/", path: "/",
name: "HomePage", name: "HomePage",
component: HomePage, component: HomePage,
}, },
{
path: "/login",
name: "LoginForm",
component: LoginForm,
},
{ {
path: "/check", path: "/check",
component: CheckSurvey, component: CheckSurvey,
@@ -31,6 +39,14 @@ const routes = [
path: "/upload", path: "/upload",
component: UploadImage, component: UploadImage,
}, },
{
path: "/profile",
component: ProfileUser,
},
{
path: "/detail",
component: CheckDetail,
},
]; ];
const router = createRouter({ const router = createRouter({

View File

@@ -1,11 +1,27 @@
import { createStore } from "vuex"; import { createStore } from "vuex";
export default createStore({ export default createStore({
state: {}, state: {
getters: {}, username:""
mutations: {},
actions: {
}, },
getters: {
getUsername: (state) => {
return state.username
},
},
mutations: {
setUsername: (state, payload) => {
state.username = payload;
},
},
actions: {
setLocalStorageValue(data) {
localStorage.setItem("username", data);
},
// getLocalStorageValue() {
// const username = localStorage.getItem("username");
// // ทำสิ่งที่คุณต้องการกับค่าที่ได้จาก Local Storage
// },
},
modules: {}, modules: {},
}); });

259
src/views/CheckDetail.vue Normal file
View File

@@ -0,0 +1,259 @@
<template>
<div class="bg-yellow-page mt-5">
<v-container>
<div class="text-title text-center mt-10">
ตวรจเชคคณสมบ-กษณะตองหาม ของผจะสมคร สว.<br />
<!-- <v-icon icon="mdi-circle" color="white" class="mt-2"></v-icon> -->
</div>
<div class="text-center mb-10">
<v-icon icon="mdi-circle" color="white" class="mt-2"></v-icon>
</div>
<br />
<v-row>
<v-col cols="12" md="">
<v-img
:aspect-ratio="1"
src="../assets/Group 195.png"
height="100%"
class="img-checkdetail"
></v-img>
</v-col>
<v-col class="text-sub2 bline" cols="12" md="">
<div class="text-subtitle">
<v-icon icon="mdi-check-circle-outline" color="#4C884C"></v-icon>
ณสมบของสมาชกวสภา
</div>
<div class="text-sub">
สมาชกวสภาตองไมกใฝหรอยอมตนอยภายใตของพรรคการเมองใดๆ
โดยมณสมบงน
</div>
<div class="d-flex align-center">
<v-img
:aspect-ratio="1"
src="../assets/Group 196.png"
width="50"
inline
class="mr-3"
></v-img>
ญชาตไทยโดยการเก
</div>
<div class="d-flex align-center">
<v-img
:aspect-ratio="1"
src="../assets/Group 197.png"
width="50"
inline
class="mr-3"
></v-img
>อายไมำกว 40 ในวนสมครรบเลอก
</div>
<div class="d-flex align-start">
<v-img
:aspect-ratio="1"
src="../assets/Group 198.png"
width="50"
inline
class="mr-3"
></v-img>
ความร ความเชยวชาญ และประสบการณ หรอทำงานในดาน
สมครไมอยกวาสบป ยกเว สมครในกลมสตร งอาย
คนพการ
</div>
<div class="d-flex align-start">
<v-img
:aspect-ratio="1"
src="../assets/Group 199.png"
width="50"
inline
class="mr-3"
></v-img>
สมครตองมกษณะอยางใดอยางหน งตอไปนวย<br />()
เปนบคคลซงเกดในอำเภอทสมครรบเลอก <br />()
ออยในทะเบยนบานในอำเภอทสมครรบเลอกมาแลวเปนเวลา
ดตอกนไมอยกว สองปบถงวนสมครรบเลอก <br />()
ทำงานอยในอำเภอทสมครรบเลอกมาแลวเปนเวลาตดตอก
ไมอยกวาสองป บถงวนสมครรบเลอก <br />()
เคยทำงานหรอเคยมออยในทะเบยนบานอยในอำเภอทสมคร บเลอก
แลวแตกรณ เปนเวลาตดตอกนไมอยกวาสองป <br />()
เคยศกษาในสถานศกษาทงอยในอำเภอทสมครรบเลอกเป
เวลาตดตอกนไมอยกว สองปการศกษา
</div>
</v-col>
</v-row>
<v-row class="my-10">
<v-col cols="12" md="" class="border-blue text-sub2 bline pa-5">
<div class="text-subtitle">
<v-icon icon="mdi-close-circle-outline" color="#DD3131"></v-icon>
กษณะตองหามของสมาชกวสภา
</div>
<div>
<v-icon icon=" mdi-menu-right" size="47" color="#1B76BA"></v-icon>
ดยาเสพตดใหโทษ
</div>
<div>
<v-icon icon=" mdi-menu-right" size="47" color="#1B76BA"></v-icon>
เปนบคคลลมละลายหรอเคยเปนบคคลลมละลายทจร
</div>
<div>
<v-icon icon=" mdi-menu-right" size="47" color="#1B76BA"></v-icon>
เปนเจาของหรอผอหนในกจการหนงสอพมพหรอสอมวลชนใด
</div>
<div>
<v-icon icon=" mdi-menu-right" size="47" color="#1B76BA"></v-icon>
เปนภกษ สามเณร กพรต หรอนกบวช
</div>
<div>
<v-icon icon=" mdi-menu-right" size="47" color="#1B76BA"></v-icon>
อยในระหวางถกเพกถอนสทธเลอกตงไมาคดนจะถงทดแลวหรอไม
</div>
<div>
<v-icon icon=" mdi-menu-right" size="47" color="#1B76BA"></v-icon>
กลจรตหรอจตฟนเฟอนไมสมประกอบ
</div>
<div>
<v-icon icon=" mdi-menu-right" size="47" color="#1B76BA"></v-icon>
อยระหวางถกระงบการใชทธสมครรบเลอกตงเปนการชวคราวหร
กเพกถอนสทธสมครรบเลอกต
</div>
<div>
<v-icon icon=" mdi-menu-right" size="47" color="#1B76BA"></v-icon>
องคำพพากษาใหจำคกและถกคมขงอยโดยหมายของศาล
</div>
<div>
<v-icon icon=" mdi-menu-right" size="47" color="#1B76BA"></v-icon>
เคยไดบโทษจำคกโดยไดนโทษมายงไมงสบปบถงวนเลอกในระด
อำเภอ เวนแต ในความผดอนไดกระทำโดยประมาทหรอความผดลหโทษ
</div>
<div>
<v-icon icon=" mdi-menu-right" size="47" color="#1B76BA"></v-icon>
เคยถกสงใหนจากราชการ หนวยงานของร หรอรฐวสาหกจเพราะ
จรตตอหนาท หรอถอวากระทำการทจรตหรอประพฤตชอบใน วงราชการ
</div>
<div>
<v-icon icon=" mdi-menu-right" size="47" color="#1B76BA"></v-icon>
เคยตองคำพพากษาหรอคำสงของศาลอนถงทดใหทรพยนตกเป
ของแผนดนเพราะรำรวยผดปกต หรอเคยตองคำพพากษาอนถงท
ใหลงโทษจำคกเพราะกระทำความผดตามกฎหมายวาดวยการปองก
และปราบปรามการทจร
</div>
<div>
<v-icon icon=" mdi-menu-right" size="47" color="#1B76BA"></v-icon>
เคยตองคำพพากษาอนถงทดวากระทำการอนเปนการทจรตในการเลอกต
</div>
<div>
<v-icon icon=" mdi-menu-right" size="47" color="#1B76BA"></v-icon>
เคยเปนสมาชกวสภาตามรฐธรรมนญน
</div>
<div>
<v-icon icon=" mdi-menu-right" size="47" color="#1B76BA"></v-icon>
เคยตองคำพพากษาอนถงทดวากระทำความผดตอตำแหนงหนาท
ราชการหร อตำแหนงหนาทในการยธรรม หรอกระทำความผ
ตามกฎหมายวาดวยความผดของพนกงานในองคการ หรอหนวยงาน ของร
หรอความผดเกยวกบทรพยกระทำโดยทจรตตามประมวล กฎหมายอาญา
ความผดตามกฎหมายวาดวยการกมเงนทเป การฉอโกงประชาชน
กฎหมายวาดวยยาเสพต ในความผดฐานเปนผผล นำเข งออก
หรอผ กฎหมายวาดวยการพนนในความผดฐานเปนเจาม หรอเจาสำน
กฎหมายวาดวยการปองกนและปราบปรามการคามนษย
หรอกฎหมายวาดวยการปองก และปราบปรามการฟอกเงนในความผ
ฐานฟอกเง
</div>
</v-col>
<v-col class="text-sub2 bline pa-5" cols="12" md="">
<div>
<v-icon icon=" mdi-menu-right" size="47" color="#1B76BA"></v-icon>
อยในระหวางตองหามมใหดำรงตำแหนงทางการเมอง
</div>
<div>
<v-icon icon=" mdi-menu-right" size="47" color="#1B76BA"></v-icon>
เปนพนกงานหรอลกจางของหนวยราชการ หนวยงานของร หรอรฐวสาหก
หรอเปนเจาหนาทนของร
</div>
<div>
<v-icon icon=" mdi-menu-right" size="47" color="#1B76BA"></v-icon>
เปนตลาการศาลรฐธรรมน หรอผดำรงตำแหนงในองคกรอสระ
</div>
<div>
<v-icon icon=" mdi-menu-right" size="47" color="#1B76BA"></v-icon>
เคยพนจากตำแหนงเพราะศาลรฐธรรมนญวจฉยวามการเสนอ การแปรญตต
หร การกระทำดวยประการใด ผลใหสมาช สภาผแทนราษฎร
สมาชกวสภา หรอกรรมาธการ วนไม
โดยทางตรงหรอทางออมในการใชงบประมาณรายจาย
</div>
<div>
<v-icon icon=" mdi-menu-right" size="47" color="#1B76BA"></v-icon>
เคยพนจากตำแหนงเพราะศาลฎกาหรอศาลฎกาแผนกคดอาญา
ของผดำรงตำแหนงทางการเมองมคำพพากษาวาเปนผ
พฤตการณำรวยผดปกต หรอกระทำความผดฐานทจรตตอหนาท
หรอจงใจปฏหนาทหรอใชอำนาจขดตอบทบญญแห
ฐธรรมนญหรอกฎหมาย หรอฝาฝนหรอไมปฏ ตามมาตรฐาน
ทางจรยธรรมอยางรายแรง
</div>
<div>
<v-icon icon=" mdi-menu-right" size="47" color="#1B76BA"></v-icon>
เปนขาราชการ
</div>
<div>
<v-icon icon=" mdi-menu-right" size="47" color="#1B76BA"></v-icon>
เปนหรอเคยเปนสมาชกสภาผแทนราษฎร เวนแต ไดนจากการ
เปนสมาชกสภาผแทนราษฎร มาแลวไมอยกวาหาปบถ
นสมครรบเลอก
</div>
<div>
<v-icon icon=" mdi-menu-right" size="47" color="#1B76BA"></v-icon>
เปนสมาชกพรรคการเมอง
</div>
<div>
<v-icon icon=" mdi-menu-right" size="47" color="#1B76BA"></v-icon>
เปนหรอเคยเปนผดำรงตำแหนงใดในพรรคการเมอง เวนแต
ไดนจากการดำรงตำแหนงในพรรคการเมองมาแลวไมอยกว
าปบถงวนสมครรบเลอก
</div>
<div>
<v-icon icon=" mdi-menu-right" size="47" color="#1B76BA"></v-icon>
เปนหรอเคยเปนรฐมนตร เวนแต ไดนจากการเปนรฐมนตรมา
แลวไมอยกวาหาปบถงวนสมครรบเลอก
</div>
<div>
<v-icon icon=" mdi-menu-right" size="47" color="#1B76BA"></v-icon>
เปนหรอเคยเปนสมาชกสภาทองถนหรอบรหารทองถ เวนแต
ไดนจากการเปนสมาชกสภาทองถนหรอผบรหารทองถนมาแล
ไมอยกวาหาปบถงวนสมครรบเลอก
</div>
<div>
<v-icon icon=" mdi-menu-right" size="47" color="#1B76BA"></v-icon>
เปนบพการ สมรส หรอบตรของผดำรงตาแหนงสมาชกสภา แทนราษฎร
สมาชกวสภา าราชการการเมองสมาชกสภาทองถ
หรอผบรหารทองถ สมครรบเลอกเปนสมาชกวสภาในคราว
เดยวก หรอผดำรงตำแหนงใดในศาลรฐธรรมนญหรอองคกรอสระ
</div>
</v-col>
</v-row>
</v-container>
</div>
</template>
<script>
export default {};
</script>
<style>
.bline div {
margin: 15px 0px;
}
.bg-yellow-page {
background: #f7d278;
}
.border-blue {
border-right: 5px solid #1b76ba;
}
@media only screen and (min-width: 0px) and (max-width: 700px) {
.border-blue {
border-right: 0px solid #1b76ba;
}
.img-checkdetail {
/* height: 250px !important; */
}
}
</style>

134
src/views/LoginForm.vue Normal file
View File

@@ -0,0 +1,134 @@
<template>
<div>
<v-img
class="mx-auto"
:aspect-ratio="1"
src="@/assets/logo-title.png"
width="250"
></v-img>
<v-card
class="mx-auto pa-12 pb-8"
elevation="8"
max-width="600"
rounded="lg"
>
<v-form fast-fail @submit.prevent v-model="form1">
<div class="text-subtitle-1 text-medium-emphasis">ID card number</div>
<v-text-field
density="compact"
placeholder="เลขประจำตัว 13 หลัก"
prepend-inner-icon="mdi-card-account-details"
variant="outlined"
color="#4c884c"
v-model="payload.cid"
:rules="rules.id"
></v-text-field>
<!--
<div class="text-subtitle-1 text-medium-emphasis d-flex align-center justify-space-between">
Password
<a
class="text-caption text-decoration-none text-blue"
href="#"
rel="noopener noreferrer"
target="_blank"
>
Forgot login password?</a>
</div> -->
<v-text-field
:append-inner-icon="visible ? 'mdi-eye-off' : 'mdi-eye'"
:type="visible ? 'text' : 'password'"
density="compact"
placeholder="เบอร์โทรศัพท์"
prepend-inner-icon="mdi-lock-outline"
variant="outlined"
@click:append-inner="visible = !visible"
v-model="payload.phone"
:rules="rules.tel"
color="#4c884c"
></v-text-field>
<!-- <v-card
class="mb-12"
color="surface-variant"
variant="tonal"
>
<v-card-text class="text-medium-emphasis text-caption">
Warning:
</v-card-text>
</v-card> -->
<v-btn
class="mb-8"
size="large"
variant="tonal"
block
@click="login"
color="#4c884c"
:disabled="!form1"
>
Log In
</v-btn>
</v-form>
</v-card>
</div>
</template>
<script>
import { client } from "@/utils/trpc";
export default {
data: () => ({
form1: false,
visible: false,
payload: { cid: "", phone: "" },
rules: {
tel: [
(v) =>
// (parseInt(v) == v && v.length == 10) || 'เบอร์โทรไม่ถูกต้อง',
/^([0-9]{10})$/.test(v) || "Invalid phone number",
],
id: [
(v) => (parseInt(v) == v && v.length == 13) || "Invalid ID card number",
],
},
}),
methods: {
getUser() {
client.user.getSelf
.mutate({})
.then((data) => {
localStorage.setItem("username", data.firstName);
this.$store.commit("setUsername", data.firstName);
// this.$emitter.emit("loginUser", data.firstName );
this.$router.push("/");
// location.reload();
// this.$store.dispatch('setLocalStorageValue',data.firstName)
})
.catch((error) => {
alert("ไม่สามารถโหลดข้อมูลได้");
console.error("เกิดข้อผิดพลาดในการโหลดข้อมูล:", error);
});
},
login() {
client.user.login
.mutate(this.payload)
.then((data) => {
console.log("data", data);
localStorage.setItem("token", data.token);
// this.uploadImage();
this.getUser();
// this.provinceItems = data;
})
.catch((error) => {
alert("ไม่สามารถบันทึกข้อมูลได้: " + error.message);
console.error("เกิดข้อผิดพลาดในการโหลดข้อมูล:", error);
});
},
},
};
</script>

13
src/views/ProfileUser.vue Normal file
View File

@@ -0,0 +1,13 @@
<template lang="">
<div>
<FormMain />
</div>
</template>
<script>
import FormMain from "../components/edit/FormMainEdit.vue";
export default {
components: { FormMain },
};
</script>
<style lang=""></style>