Commit 41585dec authored by TTS Kieu Tuan Anh's avatar TTS Kieu Tuan Anh

rs category

parent 189df397
......@@ -17,6 +17,7 @@
</v-card-title>
<v-card-text>
<v-container>
<v-form ref="formEdit">
<v-row>
<v-col cols="12">
<v-text-field
......@@ -70,6 +71,8 @@
item-value="id"
selected-color="primary"
selection-type="independent"
@update:open="onOpen"
@input="selectCategory"
/>
</v-card-text>
</v-card>
......@@ -99,6 +102,7 @@
/>
</v-col>
</v-row>
</v-form>
</v-container>
<small>*indicates required field</small>
</v-card-text>
......@@ -212,7 +216,7 @@
item-value="id"
selected-color="primary"
selection-type="independent"
:rule="singleRules"
:rules="singleRules"
/>
</v-card-text>
</v-card>
......@@ -448,8 +452,7 @@ export default {
],
nameRules: [
v => !!v || 'Name is required',
v =>
(v && v.length <= 255) || 'Name must be less than 255 characters'
v => (v && v.length <= 255) || 'Name must be less than 255 characters'
],
requiredRules: [v => !!v || 'This field is required'],
numberRules: [
......@@ -478,6 +481,20 @@ export default {
},
dialogDelete (val) {
val || this.closeDelete()
},
eParentId: function () {
if (this.eParentId.length > 1) {
this.$toast.error('please chose 1 -___-!', {
duration: 3000
})
}
},
parent_id: function () {
if (this.parent_id.length > 1) {
this.$toast.error('please chose 1 -___-!', {
duration: 3000
})
}
}
},
created () {
......@@ -573,9 +590,7 @@ export default {
this.$axios
.post('/categories/', fd, {
headers: {
Authorization: `Bearer ${this.$auth.$storage.getUniversal(
'token'
)}`
Authorization: `Bearer ${this.$auth.$storage.getUniversal('token')}`
}
})
.then((response) => {
......@@ -691,6 +706,21 @@ export default {
},
clearFile () {
this.file = null
},
onOpen (e) {
if (!this.__initial) {
this.__initial = true
return
}
// this.eParentId.length = 0
console.log('toggle arrow clicked', e)
},
selectCategory (e) {
console.log(e[0])
console.log(this.eParentId)
// this.eParentId.length = 0
// this.eParentId.push(e[0])
}
}
}
......
......@@ -128,8 +128,6 @@
<v-row>
<v-col
cols="12"
sm="6"
md="4"
>
<v-text-field
v-model="eName"
......@@ -178,10 +176,17 @@
</v-col>
<v-col v-if="files" cols="12">
<v-col v-for="(image, index) in files" :key="index" cols="12">
<v-img :src="image" contain />
<v-img :src="image" contain height="100px" width="150px" display:flex/>
</v-col>
</v-col>
<v-col v-for="(imageEdit, index) in eImages" :key="index" cols="12" text-align=" left" style="display:flex" >
<v-img
contain
height="100px"
width="150px"
:src="imageEdit"
/>
</v-col>
<!-- <v-img v-if="typeof eImages === 'string'" :src="eImages" /> -->
<v-col cols="12">
<v-btn
class="mx-2"
......@@ -345,8 +350,6 @@
<v-row>
<v-col
cols="12"
sm="6"
md="4"
>
<v-text-field
v-model="name"
......@@ -835,6 +838,7 @@ export default {
this.eStock = item.stock
this.eDescription = item.description
this.eVariants = item.variants
this.eImages = item.images
this.editedIndex = this.products.indexOf(item)
console.log(item.variants)
this.dialog3 = true
......@@ -955,3 +959,9 @@ export default {
}
}
</script>
<style>
img {
width: 100px;
height: 150px;
}
</style>
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