Commit 96408668 authored by TTS Kieu Tuan Anh's avatar TTS Kieu Tuan Anh

format time

parent 5eb58808
...@@ -220,7 +220,14 @@ ...@@ -220,7 +220,14 @@
</v-card-actions> </v-card-actions>
</v-card> </v-card>
</v-dialog> </v-dialog>
<v-data-table :headers="headers" :items="categories" sort-by="calories" class="elevation-1"> <v-data-table
:headers="headers"
:items="categories"
sort-by="calories"
class="elevation-1"
group-by="parent_id"
show-group-by
>
<template #top> <template #top>
<v-toolbar flat> <v-toolbar flat>
<v-toolbar-title>Category Manage</v-toolbar-title> <v-toolbar-title>Category Manage</v-toolbar-title>
...@@ -283,10 +290,10 @@ ...@@ -283,10 +290,10 @@
</v-toolbar> </v-toolbar>
</template> </template>
<template #item.created_at="{ item }"> <template #item.created_at="{ item }">
<span>{{ formatDate(item.created_at)}}</span> <span>{{ formatDate(item.created_at) }}</span>
</template> </template>
<template #item.updated_at="{ item }"> <template #item.updated_at="{ item }">
<span>{{ formatDate(item.updated_at)}}</span> <span>{{ formatDate(item.updated_at) }}</span>
</template> </template>
<template #item.actions="{ item }"> <template #item.actions="{ item }">
<v-icon :id="item.id" small @click="dialog2 = true; editCategory(item)"> <v-icon :id="item.id" small @click="dialog2 = true; editCategory(item)">
...@@ -330,15 +337,15 @@ export default { ...@@ -330,15 +337,15 @@ export default {
{ {
text: 'ID', text: 'ID',
align: 'start', align: 'start',
value: 'id' value: 'id',
groupable: false
}, },
{ text: 'Name', value: 'name' }, { text: 'Name', value: 'name', sortable: false },
{ text: 'Odering', value: 'ordering' }, { text: 'Odering', value: 'ordering', groupable: false },
// { text: 'parent', value: 'parent_id', sortable: false }, { text: 'parent', value: 'parent_id', sortable: false, groupable: false },
{ text: 'Created', value: 'created_at' }, { text: 'Created', value: 'created_at', groupable: false },
{ text: 'Updated', value: 'updated_at' }, { text: 'Updated', value: 'updated_at', groupable: false },
{ text: 'Actions', value: 'actions', sortable: false }, { text: 'Actions', value: 'actions', sortable: false, groupable: false }
{ text: 'index', value: 'index', sortable: false }
], ],
categories: [], categories: [],
eID: '', eID: '',
...@@ -459,7 +466,7 @@ export default { ...@@ -459,7 +466,7 @@ export default {
fd.append('name', this.name) fd.append('name', this.name)
fd.append('ordering', this.ordering) fd.append('ordering', this.ordering)
fd.append('parent_id', this.parent_id) fd.append('parent_id', this.parent_id)
fd.append('images', this.image) fd.append('image', this.image)
this.$axios this.$axios
.post('/categories/', .post('/categories/',
fd, fd,
...@@ -539,7 +546,7 @@ export default { ...@@ -539,7 +546,7 @@ export default {
fd.append('name', this.eName) fd.append('name', this.eName)
fd.append('ordering', this.eOrdering) fd.append('ordering', this.eOrdering)
if (typeof this.eImage !== 'string') { if (typeof this.eImage !== 'string') {
fd.append('images', this.eImage) fd.append('image', this.eImage)
} }
try { try {
this.$axios this.$axios
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment