index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <LayoutContainer class="mt-4">
  3. <v-expansion-panels focusable multiple :value="[0, 1]">
  4. <!-- Cycle -->
  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="queryCycle()"
  11. :model="modelCycle"
  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="modelCycle"
  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. <!-- EducationTiming -->
  42. <UiExpansionPanel id="educationTiming" icon="fa-calendar">
  43. <v-container fluid class="container">
  44. <v-row>
  45. <v-col cols="12" sm="12">
  46. <UiCollection
  47. :query="queryEducationTiming()"
  48. :model="modelEducationTiming"
  49. loaderType="image"
  50. newLink="/parameters/education/education_timing/new"
  51. >
  52. <template #list.item="{items}">
  53. <v-container fluid>
  54. <v-row dense>
  55. <v-col
  56. v-for="item in items"
  57. :key="item.id"
  58. cols="4"
  59. >
  60. <UiCard
  61. :id="item.id"
  62. :link="`/parameters/education/education_timing/${item.id}`"
  63. :model="modelEducationTiming"
  64. :can-delete="false"
  65. >
  66. <template #card.text>
  67. {{ item.timing }}
  68. </template>
  69. </UiCard>
  70. </v-col>
  71. </v-row>
  72. </v-container>
  73. </template>
  74. </UiCollection>
  75. </v-col>
  76. </v-row>
  77. </v-container>
  78. </UiExpansionPanel>
  79. </v-expansion-panels>
  80. </LayoutContainer>
  81. </template>
  82. <script lang="ts">
  83. import {computed, ComputedRef, defineComponent} from '@nuxtjs/composition-api'
  84. import { repositoryHelper } from '~/services/store/repository'
  85. import {Query} from "@vuex-orm/core";
  86. import {Cycle} from "~/models/Education/Cycle";
  87. import {EducationTiming} from "~/models/Education/EducationTiming";
  88. export default defineComponent({
  89. name: 'educationTimings',
  90. setup () {
  91. const repositoryCycle = repositoryHelper.getRepository(Cycle)
  92. const repositoryEducationTiming = repositoryHelper.getRepository(EducationTiming)
  93. const queryCycle: ComputedRef<Query> = computed(() => repositoryCycle.query().orderBy('order', 'asc'))
  94. const queryEducationTiming: ComputedRef<Query> = computed(() => repositoryEducationTiming.query())
  95. return {
  96. queryCycle: () => queryCycle,
  97. queryEducationTiming: () => queryEducationTiming,
  98. modelCycle: Cycle,
  99. modelEducationTiming: EducationTiming,
  100. }
  101. }
  102. })
  103. </script>