DashboardPage.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <div class="dashboard-page bg-page">
  3. <template v-if="loading">
  4. <div class="row items-center justify-center full-width bg-surface" style="height: 80vh">
  5. <q-spinner-dots color="primary" />
  6. </div>
  7. </template>
  8. <template v-else>
  9. <DashboardHeaderBar :data="headerBar" />
  10. <DashboardSummaryInfos :data="summaryInfos" />
  11. <DashboardScrollAreaSchedules />
  12. <DashboardNextSchedules :data="nextSchedules" />
  13. <DashboardLastDoneSchedules :data="lastDoneSchedules" />
  14. <DashboardFavoriteProviders :data="favoriteProviders" />
  15. <DashboardProvidersClose :data="providersClose" />
  16. </template>
  17. </div>
  18. </template>
  19. <script setup>
  20. import DashboardHeaderBar from 'src/components/dashboard/DashboardHeaderBar.vue';
  21. import DashboardSummaryInfos from 'src/components/dashboard/DashboardSummaryInfos.vue';
  22. import DashboardScrollAreaSchedules from 'src/components/dashboard/DashboardScrollAreaSchedules.vue';
  23. import DashboardNextSchedules from 'src/components/dashboard/DashboardNextSchedules.vue';
  24. import DashboardLastDoneSchedules from 'src/components/dashboard/DashboardLastDoneSchedules.vue';
  25. import DashboardFavoriteProviders from 'src/components/dashboard/DashboardFavoriteProviders.vue';
  26. import DashboardProvidersClose from 'src/components/dashboard/DashboardProvidersClose.vue';
  27. import { onMounted, ref } from 'vue';
  28. import { dadosDashboard } from 'src/api/dashboard';
  29. const headerBar = ref(null);
  30. const summaryInfos = ref(null);
  31. const nextSchedules = ref(null);
  32. const lastDoneSchedules = ref(null);
  33. const favoriteProviders = ref(null);
  34. const providersClose = ref(null);
  35. const loading = ref(true);
  36. onMounted( async () => {
  37. const response = await dadosDashboard();
  38. if(response) {
  39. headerBar.value = response.headerBar;
  40. summaryInfos.value = response.summaryInfos;
  41. nextSchedules.value = response.nextSchedules;
  42. lastDoneSchedules.value = response.lastDoneSchedules;
  43. favoriteProviders.value = response.favoriteProviders;
  44. providersClose.value = response.providersClose;
  45. }
  46. loading.value = false;
  47. });
  48. </script>
  49. <style scoped>
  50. .dashboard-page {
  51. width: 100%;
  52. min-height: 100%;
  53. box-sizing: border-box;
  54. }
  55. </style>