เพิ่ม api คำนำหน้า

This commit is contained in:
AnandaTon 2023-03-21 16:31:45 +07:00
parent ae7b52e875
commit 54bd567401
2 changed files with 28 additions and 6 deletions

View file

@ -25,7 +25,7 @@
:outlined="edit"
dense
lazy-rules
v-model="informaData.prefixId"
v-model="prefix"
emit-value
map-options
option-label="name"
@ -339,6 +339,9 @@ import type { file } from '@babel/types'
const mixin = useCounterMixin()
const { date2Thai, calAge } = mixin
const prefix = ref<string>()
const prefixOptions = ref<DataOption[]>([])
const edit = ref<boolean>(false)
const informaData = ref<Information>(defaultInformation)
@ -390,6 +393,7 @@ const emit = defineEmits(['update:statusEdit'])
onMounted(() => {
// fetchProvince()
fetchprefix()
})
const saveData = async () => {
@ -431,7 +435,23 @@ const fetchProvince = async () => {
// // loader.value = false;
// })
}
const fetchprefix = async () => {
// loader.value = true;
await http
.get(config.API.prefix)
.then((res) => {
const data = res.data.result
let option: DataOption[] = []
data.map((r: DataOption) => {
option.push({ id: r.id.toString(), name: r.name.toString() })
})
prefixOptions.value = option
})
.catch((e) => {})
.finally(() => {
// loader.value = false;
})
}
const savePic = () => {
disabledPic.value = false
}

View file

@ -8,11 +8,13 @@ import Keycloak from 'keycloak-js'
const initOptions = {
// url: "https://keycloak.frappet.synology.me/auth/",
// realm: "bma-ehr",
// clientId: "bma-ehr-vue3",
// realm: "bma-ehr",
// clientId: "bma-ehr-vue3",
url: 'https://identity.frappet.com/',
realm: 'exam_test',
clientId: 'exam_vue3'
// realm: 'exam_test',
// clientId: 'exam_vue3'
realm: 'bma-ehr',
clientId: 'bma-ehr-vue3'
} //option keycloak ที่จะ connect
const keycloak = Keycloak(initOptions)