ปิด api ที่ยังไม่ได่ใช้

This commit is contained in:
Kittapath 2023-03-19 00:59:27 +07:00
parent 6ab1a862d6
commit a61dfb8789
6 changed files with 109 additions and 96 deletions

View file

@ -1,22 +1,23 @@
import { createApp, defineAsyncComponent } from 'vue' import { createApp, defineAsyncComponent } from 'vue'
import { createPinia } from 'pinia'
import { Dialog, Notify, Quasar } from 'quasar'
import App from './App.vue' import App from './App.vue'
import router from './router' import router from './router'
import { Dialog, Notify, Quasar } from 'quasar'
import quasarUserOptions from './quasar-user-options' import quasarUserOptions from './quasar-user-options'
import '@vuepic/vue-datepicker/dist/main.css'
import 'quasar/src/css/index.sass' import 'quasar/src/css/index.sass'
import th from 'quasar/lang/th' import th from 'quasar/lang/th'
import '@vuepic/vue-datepicker/dist/main.css'
import http from './plugins/http'
import { createPinia } from 'pinia'
// import './assets/main.css' // import './assets/main.css'
const app = createApp(App) const app = createApp(App)
const pinia = createPinia() const pinia = createPinia()
app.use(pinia)
app.use(router) app.use(router)
app.use(pinia)
app.use( app.use(
Quasar, Quasar,
@ -52,4 +53,6 @@ app.component(
defineAsyncComponent(() => import('./plugins/FullLoader.vue')) defineAsyncComponent(() => import('./plugins/FullLoader.vue'))
) )
app.config.globalProperties.$http = http
app.mount('#app') app.mount('#app')

View file

@ -333,20 +333,20 @@ onMounted(async () => {
const fetchQualification = async () => { const fetchQualification = async () => {
// loader.value = true; // loader.value = true;
await http // await http
.get(config.API.educationQualification) // .get(config.API.educationQualification)
.then((res) => { // .then((res) => {
const data = res.data.result // const data = res.data.result
let option: DataOption[] = [] // let option: DataOption[] = []
data.map((r: any) => { // data.map((r: any) => {
option.push({ id: r.id.toString(), name: r.name.toString() }) // option.push({ id: r.id.toString(), name: r.name.toString() })
}) // })
qualificationOptions.value = option // qualificationOptions.value = option
}) // })
.catch((e: any) => {}) // .catch((e: any) => {})
.finally(() => { // .finally(() => {
// loader.value = false; // // loader.value = false;
}) // })
} }
const fetchData = async () => {} const fetchData = async () => {}

View file

@ -342,72 +342,72 @@ const selectSubDistrict = (e: string, name: string) => {
} }
const fetchProvince = async () => { const fetchProvince = async () => {
// loader.value = true; // // loader.value = true;
await http // await http
.get(config.API.province) // .get(config.API.province)
.then((res) => { // .then((res) => {
const data = res.data.result // const data = res.data.result
let option: DataOption[] = [] // let option: DataOption[] = []
// console.log(data); // // console.log(data);
data.map((r: any) => { // data.map((r: any) => {
option.push({ id: r.id.toString(), name: r.name.toString() }) // option.push({ id: r.id.toString(), name: r.name.toString() })
}) // })
provinceOptions.value = option // provinceOptions.value = option
}) // })
.catch((e: any) => {}) // .catch((e: any) => {})
.finally(() => { // .finally(() => {
// loader.value = false; // // loader.value = false;
}) // })
} }
const fetchDistrict = async (id: string, position: string) => { const fetchDistrict = async (id: string, position: string) => {
// loader.value = true; // // loader.value = true;
await http // await http
.get(config.API.listDistrict(id)) // .get(config.API.listDistrict(id))
.then((res) => { // .then((res) => {
const data = res.data.result // const data = res.data.result
let option: DataOption[] = [] // let option: DataOption[] = []
// console.log(data); // // console.log(data);
data.map((r: any) => { // data.map((r: any) => {
option.push({ id: r.id.toString(), name: r.name.toString() }) // option.push({ id: r.id.toString(), name: r.name.toString() })
}) // })
if (position == '1') { // if (position == '1') {
districtOptions.value = option // districtOptions.value = option
} else { // } else {
districtCOptions.value = option // districtCOptions.value = option
} // }
}) // })
.catch((e: any) => {}) // .catch((e: any) => {})
.finally(() => { // .finally(() => {
// loader.value = false; // // loader.value = false;
}) // })
} }
const fetchSubDistrict = async (id: string, position: string) => { const fetchSubDistrict = async (id: string, position: string) => {
// loader.value = true; // // loader.value = true;
await http // await http
.get(config.API.listSubDistrict(id)) // .get(config.API.listSubDistrict(id))
.then((res) => { // .then((res) => {
const data = res.data.result // const data = res.data.result
let option: zipCodeOption[] = [] // let option: zipCodeOption[] = []
// console.log(res); // // console.log(res);
data.map((r: any) => { // data.map((r: any) => {
option.push({ // option.push({
id: r.id.toString(), // id: r.id.toString(),
name: r.name.toString(), // name: r.name.toString(),
zipCode: r.zipCode.toString() // zipCode: r.zipCode.toString()
}) // })
}) // })
if (position == '1') { // if (position == '1') {
subdistrictOptions.value = option // subdistrictOptions.value = option
} else { // } else {
subdistrictCOptions.value = option // subdistrictCOptions.value = option
} // }
}) // })
.catch((e: any) => {}) // .catch((e: any) => {})
.finally(() => { // .finally(() => {
// loader.value = false; // // loader.value = false;
}) // })
} }
const cancelData = () => {} const cancelData = () => {}

View file

@ -415,22 +415,22 @@ const changeBtn = async () => {
} }
const fetchProvince = async () => { const fetchProvince = async () => {
// loader.value = true; // // loader.value = true;
await http // await http
.get(config.API.province) // .get(config.API.province)
.then((res) => { // .then((res) => {
const data = res.data.result // const data = res.data.result
let option: DataOption[] = [] // let option: DataOption[] = []
// console.log(data); // // console.log(data);
data.map((r: any) => { // data.map((r: any) => {
option.push({ id: r.id.toString(), name: r.name.toString() }) // option.push({ id: r.id.toString(), name: r.name.toString() })
}) // })
provinceOptions.value = option // provinceOptions.value = option
}) // })
.catch((e: any) => {}) // .catch((e: any) => {})
.finally(() => { // .finally(() => {
// loader.value = false; // // loader.value = false;
}) // })
} }
const savePic = () => { const savePic = () => {

View file

@ -0,0 +1,10 @@
import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
export const useMetaStore = defineStore('meta', () => {
const meta = ref<string>('')
return {
meta
}
})

View file

@ -64,7 +64,7 @@ const doLogout = () => {
<!-- แบบเก design แรก --> <!-- แบบเก design แรก -->
<!-- <q-layout view="lHh Lpr lff"> --> <!-- <q-layout view="lHh Lpr lff"> -->
<!-- ปรบใหบหน รายละเอยดรายการสอบทงหมด --> <!-- ปรบใหบหน รายละเอยดรายการสอบทงหมด -->
<q-layout view="lHh LpR lff" @scroll="onScroll"> <q-layout view="lHh LpR lff">
<!-- header --> <!-- header -->
<q-header flat class="bg-grey-2 text-dark" height-hint="7"> <q-header flat class="bg-grey-2 text-dark" height-hint="7">
<q-toolbar style="padding: 0 2%"> <q-toolbar style="padding: 0 2%">