index.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <LayoutContainer class="mt-4">
  3. <v-expansion-panels focusable multiple :value="[0]">
  4. <!-- Description -->
  5. <UiExpansionPanel id="cycle" icon="fa-bars">
  6. <v-container fluid class="container">
  7. <v-row>
  8. <v-col cols="12" sm="12">
  9. <UiCollection
  10. :query="query()"
  11. :model="model"
  12. loaderType="image"
  13. >
  14. <template #list.item="{items}">
  15. <v-container fluid>
  16. <v-row dense>
  17. <v-col
  18. v-for="item in items"
  19. :key="item.id"
  20. cols="4"
  21. >
  22. <UiCard
  23. :id="item.id"
  24. :link="`/parameters/education/cycle/${item.id}`"
  25. :model="model"
  26. :can-delete="false"
  27. >
  28. <template #card.text>
  29. {{ item.label }}
  30. </template>
  31. </UiCard>
  32. </v-col>
  33. </v-row>
  34. </v-container>
  35. </template>
  36. </UiCollection>
  37. </v-col>
  38. </v-row>
  39. </v-container>
  40. </UiExpansionPanel>
  41. </v-expansion-panels>
  42. </LayoutContainer>
  43. </template>
  44. <script lang="ts">
  45. import {computed, ComputedRef, defineComponent} from '@nuxtjs/composition-api'
  46. import { repositoryHelper } from '~/services/store/repository'
  47. import {Query} from "@vuex-orm/core";
  48. import {Cycle} from "~/models/Education/Cycle";
  49. export default defineComponent({
  50. name: 'cycles',
  51. setup () {
  52. const repository = repositoryHelper.getRepository(Cycle)
  53. const query: ComputedRef<Query> = computed(() => repository.query().orderBy('order', 'asc'))
  54. return {
  55. query: () => query,
  56. model: Cycle
  57. }
  58. }
  59. })
  60. </script>