Merge branch 'master' of https://github.com/davila-erdianita/vuetify3 into ahdan-punya

This commit is contained in:
ahdan15
2024-12-18 10:06:04 +07:00
5 changed files with 121 additions and 1 deletions

View File

@@ -54,12 +54,18 @@
to="/satu_rssa/logapi" to="/satu_rssa/logapi"
></v-list-item> ></v-list-item>
<v-list-item
v-bind="props"
title="Jadwal Dokter"
to="/satu_rssa/jadwal_dokter"
></v-list-item>
<v-list-item <v-list-item
v-bind="props" v-bind="props"
title="Kunjungan Pasien" title="Kunjungan Pasien"
to="/satu_rssa/kunjungan_pasien" to="/satu_rssa/kunjungan_pasien"
></v-list-item> ></v-list-item>
</v-list-group> </v-list-group>
</v-list> </v-list>

View File

@@ -27,6 +27,11 @@ export default defineNuxtConfig({
download:false, download:false,
useStylesheet:true, useStylesheet:true,
}, },
runtimeConfig:{
public:{
API_URL: process.env.API_URL
},
},
compatibilityDate: "2024-09-09", compatibilityDate: "2024-09-09",
}); });

View File

@@ -0,0 +1,75 @@
<template>
<div>
<v-app>
<v-main>
<v-container>
<v-row>
<v-col><h3>Jadwal Dokter</h3></v-col>
</v-row>
<v-card title="" flat class="mx-auto my-8 pt-3" elevation="3" min-width="300">
<div class="d-inline-flex ml-5 mb-3">
<v-text-field v-model="search" label="Search" prepend-inner-icon="mdi-magnify" variant="outlined" hide-details single-line class="rounded elevation-1" width="500px"></v-text-field>
</div>
<v-data-table class="elevation-1 px-5" :headers="headers" :items="JadwalDokter" F :search="search" hide-default-header>
<template v-slot:body="{items}">
<!-- <thead>-->
<tr>
<th>Hari</th>
<th>Waktu</th>
<th>Spesialis</th>
<th>Subspesialis</th>
<th>Namalengkap</th>
</tr>
<!-- </thead> -->
<!-- <tbody> -->
<tr v-for="(item,index) in items" :key="index">
<td v-if="index===0||item.hari !== items[index-1].hari">{{ item.hari }}</td>
<td v-else></td>
<!-- <td>{{ item.hari }}</td> -->
<td>{{ item.waktu }}</td>
<td v-if="index===0||item.spesialis !== items[index-1].spesialis">{{ item.spesialis }}</td>
<td v-else></td>
<!-- <td>{{ item.spesialis }}</td> -->
<td v-if="index===0||item.subspesialis !== items[index-1].subspesialis">{{ item.subspesialis }}</td>
<td v-else></td>
<!-- <td>{{ item.subspesialis }}</td> -->
<td>{{ item.namalengkap }}</td>
</tr>
<!-- </tbody> -->
</template>
</v-data-table>
</v-card>
</v-container>
</v-main>
</v-app>
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue';
import { storeToRefs } from 'pinia';
const {JadwalDokter} = storeToRefs(useJadwalDokter());
const {loadJadwalDokter} = useJadwalDokter();
const dataJadwalDokter = ref([]);
const search = ref("");
const headers = [
{
align:'start',
key:'name',
sortable:false,
},
{key:'hari', title:'hari'},
{key:'waktu', title:'waktu'},
{key:'spesialis', title:'spesialis'},
{key:'subspesialis', title:'subspesialis'},
{key:'namalengkap', title:'namalengkap'},
]
onMounted(()=> {
loadJadwalDokter();
// console.log(JadwalDokter)
// console.log(hari)
})
</script>

View File

@@ -0,0 +1,18 @@
import axios from "axios";
export default defineEventHandler(async (event) => {
const url = useRuntimeConfig().public.API_URL+"/jadwaldokter/detail";
// console.log("data"+url)
try {
const response = await axios.get(url)
// const response = await axios.get("http://10.10.150.129:8082/api/jadwaldokter/detail")
return response.data
} catch (error) {
console.error("Error:", error);
throw createError({
statusCode: 500,
statusMessage: "Failed to fetch data from satu RSSA API",
});
}
})

View File

@@ -209,6 +209,22 @@ export const useDataKunjunganPasien = defineStore("DataKunjunganPasien", () => {
}; };
}); });
export const useJadwalDokter = defineStore("JadwalDokter", () => {
const JadwalDokter = ref<any[]>([]);
const loadJadwalDokter = async() => {
try {
JadwalDokter.value = await $fetch("/api/satu_rssa/jadwal_dokter")
} catch (error) {
console.error("Failed to load jadwal dokter:", error);
}
}
return{
JadwalDokter,
loadJadwalDokter,
}
})
//Path:stores/users.ts //Path:stores/users.ts
if (import.meta.hot) { if (import.meta.hot) {
// import.meta.hot.accept(acceptHMRUpdate(useUsersStore, import.meta.hot)) // import.meta.hot.accept(acceptHMRUpdate(useUsersStore, import.meta.hot))