parent
c00abb103f
commit
17bc67b4d4
|
@ -35,6 +35,15 @@
|
||||||
{{ item.can }}
|
{{ item.can }}
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<template v-slot:item.isAdult="{ item }">
|
||||||
|
<h3 v-if="item.isAdult">
|
||||||
|
O
|
||||||
|
</h3>
|
||||||
|
<h3 v-else>
|
||||||
|
X
|
||||||
|
</h3>
|
||||||
|
</template>
|
||||||
|
|
||||||
<template v-slot:item.image="{ item }">
|
<template v-slot:item.image="{ item }">
|
||||||
<v-img
|
<v-img
|
||||||
:src="item.image"
|
:src="item.image"
|
||||||
|
@ -104,6 +113,20 @@
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
|
|
||||||
|
<v-card-text>
|
||||||
|
<v-row>
|
||||||
|
<v-col cols="4">
|
||||||
|
19금
|
||||||
|
</v-col>
|
||||||
|
<v-col cols="8">
|
||||||
|
<input
|
||||||
|
v-model="is_adult"
|
||||||
|
type="checkbox"
|
||||||
|
>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</v-card-text>
|
||||||
|
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<v-row align="center">
|
<v-row align="center">
|
||||||
<v-col cols="4">
|
<v-col cols="4">
|
||||||
|
@ -117,6 +140,7 @@
|
||||||
<v-file-input
|
<v-file-input
|
||||||
id="image"
|
id="image"
|
||||||
v-model="image"
|
v-model="image"
|
||||||
|
accept="image/*"
|
||||||
@change="imageAdd"
|
@change="imageAdd"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -166,7 +190,24 @@
|
||||||
캔
|
캔
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="8">
|
<v-col cols="8">
|
||||||
{{ selected_signature_can.can }} 캔
|
<v-text-field
|
||||||
|
v-model="can"
|
||||||
|
label="캔"
|
||||||
|
/>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</v-card-text>
|
||||||
|
|
||||||
|
<v-card-text>
|
||||||
|
<v-row>
|
||||||
|
<v-col cols="4">
|
||||||
|
19금
|
||||||
|
</v-col>
|
||||||
|
<v-col cols="8">
|
||||||
|
<input
|
||||||
|
v-model="is_adult"
|
||||||
|
type="checkbox"
|
||||||
|
>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
|
@ -184,6 +225,7 @@
|
||||||
<v-file-input
|
<v-file-input
|
||||||
id="image"
|
id="image"
|
||||||
v-model="image"
|
v-model="image"
|
||||||
|
accept="image/*"
|
||||||
@change="imageAdd"
|
@change="imageAdd"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -260,7 +302,6 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
is_loading: false,
|
is_loading: false,
|
||||||
is_modify: false,
|
|
||||||
show_write_dialog: false,
|
show_write_dialog: false,
|
||||||
show_modify_dialog: false,
|
show_modify_dialog: false,
|
||||||
show_delete_confirm_dialog: false,
|
show_delete_confirm_dialog: false,
|
||||||
|
@ -272,6 +313,7 @@ export default {
|
||||||
|
|
||||||
can: 0,
|
can: 0,
|
||||||
image: null,
|
image: null,
|
||||||
|
is_adult: false,
|
||||||
image_url: null,
|
image_url: null,
|
||||||
is_active: null,
|
is_active: null,
|
||||||
selected_signature_can: {},
|
selected_signature_can: {},
|
||||||
|
@ -283,6 +325,12 @@ export default {
|
||||||
sortable: false,
|
sortable: false,
|
||||||
value: 'can',
|
value: 'can',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
text: '19금',
|
||||||
|
align: 'center',
|
||||||
|
sortable: false,
|
||||||
|
value: 'isAdult',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: '이미지',
|
text: '이미지',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
@ -344,6 +392,7 @@ export default {
|
||||||
this.image = null
|
this.image = null
|
||||||
this.image_url = null
|
this.image_url = null
|
||||||
this.can = 0
|
this.can = 0
|
||||||
|
this.is_adult = false
|
||||||
this.is_active = null
|
this.is_active = null
|
||||||
this.selected_signature_can = {}
|
this.selected_signature_can = {}
|
||||||
},
|
},
|
||||||
|
@ -354,6 +403,8 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
showModifyDialog(item) {
|
showModifyDialog(item) {
|
||||||
|
this.can = item.can;
|
||||||
|
this.is_adult = item.isAdult
|
||||||
this.image_url = item.image
|
this.image_url = item.image
|
||||||
this.selected_signature_can = item
|
this.selected_signature_can = item
|
||||||
this.show_modify_dialog = true
|
this.show_modify_dialog = true
|
||||||
|
@ -392,6 +443,7 @@ export default {
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
formData.append("can", this.can)
|
formData.append("can", this.can)
|
||||||
formData.append("image", this.image)
|
formData.append("image", this.image)
|
||||||
|
formData.append("isAdult", this.is_adult)
|
||||||
|
|
||||||
const res = await api.createSignature(formData)
|
const res = await api.createSignature(formData)
|
||||||
if (res.status === 200 && res.data.success === true) {
|
if (res.status === 200 && res.data.success === true) {
|
||||||
|
@ -413,8 +465,12 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
async modifySignatureCan() {
|
async modifySignatureCan() {
|
||||||
if (this.image === null) {
|
if (
|
||||||
this.notifyError('수정사항이 없습니다.')
|
this.image === null &&
|
||||||
|
this.is_adult === this.selected_signature_can.isAdult &&
|
||||||
|
this.can === this.selected_signature_can.can
|
||||||
|
) {
|
||||||
|
this.notifyError('변경사항이 없습니다.')
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -425,7 +481,18 @@ export default {
|
||||||
try {
|
try {
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
formData.append("id", this.selected_signature_can.id)
|
formData.append("id", this.selected_signature_can.id)
|
||||||
|
|
||||||
|
if (this.image !== null) {
|
||||||
formData.append("image", this.image)
|
formData.append("image", this.image)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.is_adult !== this.selected_signature_can.isAdult) {
|
||||||
|
formData.append("isAdult", this.is_adult)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.can !== this.selected_signature_can.can) {
|
||||||
|
formData.append("can", this.can)
|
||||||
|
}
|
||||||
|
|
||||||
const res = await api.modifySignature(formData)
|
const res = await api.modifySignature(formData)
|
||||||
if (res.status === 200 && res.data.success === true) {
|
if (res.status === 200 && res.data.success === true) {
|
||||||
|
|
Loading…
Reference in New Issue