Исправлена сборка объекта на бэке
This commit is contained in:
1 parent
241966bb89
commit
8885fa0949
2 files changed
+16
-14
No files matched your search
@@ -9,19 +9,21 @@
|
||||
<!-- {{ safetyData }} -->
|
||||
<v-row class="bg-red">
|
||||
<v-col>
|
||||
<v-card class="bg-orange" v-for="item in safetyData" :key="item.id">
|
||||
<v-card v-for="item in safetyData" :key="item.id">
|
||||
<v-card-title>{{ item.name }}</v-card-title>
|
||||
<v-card-actions v-for="category in item.categories" :key="category.id">
|
||||
<v-card-actions v-for="category in item.categories" :key="item.id + category.id" >
|
||||
<v-btn>{{ category.name }}</v-btn>
|
||||
<v-btn :icon="showMore[category.id] ? 'mdi-chevron-up' : 'mdi-chevron-down'" @click="showMore[category.id] = !showMore[category.id]"></v-btn>
|
||||
<v-btn
|
||||
:icon="showMore[item.id + category.id] ? 'mdi-chevron-up' : 'mdi-chevron-down'"
|
||||
@click="showMore[item.id + category.id] = !showMore[item.id + category.id]">
|
||||
</v-btn>
|
||||
<v-expand-transition>
|
||||
<div v-show="showMore[category.id]">
|
||||
<!-- <v-divider></v-divider> -->
|
||||
<v-card-actions v-for="file in category.files" :key="file.id">
|
||||
<v-card-text>{{ file.name }}</v-card-text>
|
||||
<v-btn icon="mdi-eye" color="grey"></v-btn>
|
||||
<v-btn icon='mdi-cloud-download' color="grey"></v-btn>
|
||||
</v-card-actions>
|
||||
<div v-show="showMore[item.id + category.id]">
|
||||
<v-card-actions v-for="file in category.files" :key="file.id">
|
||||
<v-card-text>{{ file.name }}</v-card-text>
|
||||
<v-btn icon="mdi-eye" color="grey"></v-btn>
|
||||
<v-btn icon='mdi-cloud-download' color="grey"></v-btn>
|
||||
</v-card-actions>
|
||||
</div>
|
||||
</v-expand-transition>
|
||||
</v-card-actions>
|
||||
@@ -45,8 +47,7 @@ onBeforeMount(() => {
|
||||
axiosApiInstance.get(`api/safety/files/`).then(result => {
|
||||
safetyData.value = result.data
|
||||
})
|
||||
|
||||
console.log(safetyData.value);
|
||||
console.log(safetyData);
|
||||
});
|
||||
|
||||
|
||||
@@ -57,4 +58,5 @@ showMore.value = safetyData.value.reduce((acc, value) => {
|
||||
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
<style>
|
||||
</style>
|
||||
+1
-1
@@ -10,7 +10,7 @@ from .models import *
|
||||
class SafetyFileAPIView(APIView):
|
||||
def get(self, request):
|
||||
|
||||
all_file = SafetyFile.objects.all()
|
||||
all_file = SafetyFile.objects.order_by('chapter_id', 'category_id').all()
|
||||
serializer_for_file = SafetyFileSerializer(instance=all_file, many=True)
|
||||
|
||||
data = []
|
||||
|
||||
Reference in new issue
Block a user