diff --git a/src/modules/01_exam/components/Form/Profile/Information.vue b/src/modules/01_exam/components/Form/Profile/Information.vue index 01c7a4f..1495c13 100644 --- a/src/modules/01_exam/components/Form/Profile/Information.vue +++ b/src/modules/01_exam/components/Form/Profile/Information.vue @@ -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() + +const prefixOptions = ref([]) const edit = ref(false) const informaData = ref(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 } diff --git a/src/plugins/keycloak.ts b/src/plugins/keycloak.ts index 7aeee92..2525d50 100644 --- a/src/plugins/keycloak.ts +++ b/src/plugins/keycloak.ts @@ -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)