시그니처 관리

- 캔 수정, 19금 설정 추가
This commit is contained in:
Yu Sung 2024-03-13 19:19:01 +09:00
parent 995e4e6e7d
commit 9d85b737d8
1 changed files with 71 additions and 3 deletions

View File

@ -46,6 +46,15 @@
{{ item.can }}
</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 }">
<v-img
:src="item.image"
@ -131,6 +140,20 @@
</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-row>
</v-card-text>
<v-card-text>
<v-row align="center">
<v-col cols="4">
@ -144,6 +167,7 @@
<v-file-input
id="image"
v-model="image"
accept="image/*"
@change="imageAdd"
/>
</div>
@ -193,7 +217,24 @@
</v-col>
<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-row>
</v-card-text>
@ -211,6 +252,7 @@
<v-file-input
id="image"
v-model="image"
accept="image/*"
@change="imageAdd"
/>
</div>
@ -298,6 +340,7 @@ export default {
can: 0,
image: null,
is_adult: false,
image_url: null,
creator_id: null,
is_active: null,
@ -322,6 +365,12 @@ export default {
sortable: false,
value: 'can',
},
{
text: '19금',
align: 'center',
sortable: false,
value: 'isAdult',
},
{
text: '이미지',
align: 'center',
@ -366,6 +415,8 @@ export default {
},
showModifyDialog(item) {
this.can = item.can;
this.is_adult = item.isAdult
this.image_url = item.image;
this.selected_signature_can = item
this.show_modify_dialog = true
@ -396,6 +447,7 @@ export default {
this.image_url = null
this.can = 0
this.is_active = null
this.is_adult = false
this.selected_signature_can = {}
},
@ -432,6 +484,7 @@ export default {
const formData = new FormData()
formData.append("can", this.can)
formData.append("image", this.image)
formData.append("isAdult", this.is_adult)
formData.append("creator_id", this.creator_id)
const res = await api.createSignature(formData)
@ -454,7 +507,11 @@ export default {
},
async modifySignatureCan() {
if (this.image === null) {
if (
this.image === null &&
this.is_adult === this.selected_signature_can.isAdult &&
this.can === this.selected_signature_can.can
) {
this.notifyError('수정사항이 없습니다.')
return;
}
@ -466,7 +523,18 @@ export default {
try {
const formData = new FormData()
formData.append("id", this.selected_signature_can.id)
formData.append("image", this.image)
if (this.image !== null) {
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)
if (res.status === 200 && res.data.success === true) {