ต่อ Api prefix /educationLevel
This commit is contained in:
parent
579f56dbcd
commit
c289ed17ad
4 changed files with 134 additions and 14 deletions
|
|
@ -67,14 +67,14 @@
|
|||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="qualificationId"
|
||||
v-model="educationLevel"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกวุฒิที่ได้รับ'}`]"
|
||||
:label="`${'วุฒิที่ได้รับ'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="qualificationOptions"
|
||||
:options="educationLevelOptions"
|
||||
option-value="id"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -220,9 +220,10 @@ const store = useExamDataStore()
|
|||
const { examData, changeExamColumns } = store
|
||||
const loader = ref<boolean>(false)
|
||||
const id = ref<string>()
|
||||
const educationLevel = ref<string>()
|
||||
const qualification = ref<string>()
|
||||
const qualificationId = ref<string>()
|
||||
const qualificationOptions = ref<DataOption[]>([])
|
||||
const educationLevelOptions = ref<DataOption[]>([])
|
||||
const major = ref<string>()
|
||||
const scores = ref<number | null>()
|
||||
const name = ref<string>()
|
||||
|
|
@ -333,8 +334,27 @@ watch(edit, (count: boolean, prevCount: boolean) => {
|
|||
onMounted(async () => {
|
||||
// await fetchData()
|
||||
// await fetchQualification()
|
||||
fetcheducationLevel()
|
||||
})
|
||||
|
||||
const fetcheducationLevel = async () => {
|
||||
// loader.value = true;
|
||||
await http
|
||||
.get(config.API.educationLevel)
|
||||
.then((res) => {
|
||||
const data = res.data.result
|
||||
let option: DataOption[] = []
|
||||
data.map((r: DataOption) => {
|
||||
option.push({ id: r.id.toString(), name: r.name.toString() })
|
||||
})
|
||||
educationLevelOptions.value = option
|
||||
})
|
||||
.catch((e) => {})
|
||||
.finally(() => {
|
||||
// loader.value = false;
|
||||
})
|
||||
}
|
||||
|
||||
const fetchQualification = async () => {
|
||||
// loader.value = true;
|
||||
// await http
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue