CardIconChart.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <q-card
  3. flat
  4. class="full-height q-pa-lg"
  5. :style="{
  6. minHeight: $q.screen.lt.sm ? '400px' : '600px',
  7. minWidth: $q.screen.lt.sm ? '200px' : '300px',
  8. }"
  9. >
  10. <div class="column no-wrap full-width">
  11. <div class="flex justify-between items-center no-wrap">
  12. <span class="text-h5">{{ title }}</span>
  13. <div class="flex no-wrap flex-center">
  14. <div class="round background">
  15. <q-icon class="q-pa-sm" :name="icon" size="24px" :color="color" />
  16. </div>
  17. <!-- <q-icon
  18. v-if="downloadImage !== null"
  19. name="mdi-dots-vertical"
  20. size="sm"
  21. style="width: 12px;margin-right: -12px"
  22. @click="downloadImage"
  23. /> -->
  24. </div>
  25. </div>
  26. </div>
  27. <div class="flex flex-grow flex-center" style="height: calc(100% - 30px)">
  28. <template v-if="hasChartSlot">
  29. <slot name="chart"></slot>
  30. </template>
  31. <template v-else>
  32. <div v-if="!loading" class="q-my-md row justify-center full-width">
  33. <div class="q-pa-md body2">
  34. {{ $t("http.errors.no_records_found") }}
  35. </div>
  36. </div>
  37. </template>
  38. </div>
  39. </q-card>
  40. </template>
  41. <script setup>
  42. import { useSlots } from "vue";
  43. const hasChartSlot = useSlots("chart");
  44. const { color, title, icon } = defineProps({
  45. color: {
  46. type: String,
  47. default: "primary",
  48. },
  49. title: {
  50. type: String,
  51. default: "Usuários",
  52. },
  53. icon: {
  54. type: String,
  55. default: "mdi-account",
  56. },
  57. });
  58. </script>
  59. <style lang="scss" scoped>
  60. @use "sass:map";
  61. @use "src/css/quasar.variables.scss";
  62. body.body--light {
  63. .background {
  64. background: rgba(map.get($colors, "primary"), 0.2) !important;
  65. }
  66. }
  67. body.body--dark {
  68. .background {
  69. background: rgba(map.get($colors-dark, "primary"), 0.2) !important;
  70. }
  71. }
  72. </style>