Compare commits
75 Commits
test
...
492859dae3
Author | SHA1 | Date | |
---|---|---|---|
492859dae3 | |||
18b59b5598 | |||
5fcdd7f06d | |||
1e149f7e41 | |||
aca3767a24 | |||
d51655f15e | |||
47dd32939f | |||
2e1891ab08 | |||
99d70cc8f7 | |||
9f1675e82d | |||
c2838be2ed | |||
b5c2941c0d | |||
d5c01d8d23 | |||
7118b0649a | |||
8f5346581e | |||
e43f2e30be | |||
397fd267e0 | |||
fe4b88350b | |||
537474e162 | |||
b5abdf3cf5 | |||
a2e457b5e8 | |||
05ddd417cd | |||
e70426af68 | |||
81b33e1322 | |||
588fcfbe90 | |||
ff2c126382 | |||
702daca29f | |||
8e9008a3c1 | |||
5c0c00aad4 | |||
e0949c6d73 | |||
0449bac8d5 | |||
d412c15c9d | |||
ed16a6ddad | |||
f06e2d41e0 | |||
7505269db3 | |||
15eeb6943d | |||
7e7ed46cea | |||
fd01786649 | |||
c48c1c2f09 | |||
9bcf3a3cdb | |||
4c5b987d98 | |||
f168403048 | |||
82ee1584e7 | |||
65cb918389 | |||
784baf9a2f | |||
7a85ac41cc | |||
9d4c9437cf | |||
68845aeae1 | |||
bbdca29337 | |||
c14c041daa | |||
a515a144eb | |||
54a6773905 | |||
d97087b4e9 | |||
ddb2449053 | |||
8aca07cdf7 | |||
0ba845d95a | |||
64b1fd5395 | |||
639bea70fa | |||
6a89ba059b | |||
ff83041585 | |||
e660be0bf4 | |||
62cdd57069 | |||
f8346ed5ef | |||
9656b9a9d1 | |||
97a58266bb | |||
8fc0cfa345 | |||
22f9c2287d | |||
9284f7d5c3 | |||
e6f27a4529 | |||
6a33d1c024 | |||
3b83789c15 | |||
55f0ab9af3 | |||
9b168a6112 | |||
c47937933e | |||
4744fe7d9a |
@@ -24,7 +24,7 @@ async function getCalculateCommunityPost(startDate, endDate, page, size) {
|
||||
}
|
||||
|
||||
async function getSettlementRatio(page) {
|
||||
return Vue.axios.get('/admin/calculate/ratio?page=' + (page - 1) + "&size=20");
|
||||
return Vue.axios.get('/admin/calculate/ratio?page=' + (page - 1) + "&size=20'");
|
||||
}
|
||||
|
||||
async function createCreatorSettlementRatio(creatorSettlementRatio) {
|
||||
@@ -57,21 +57,6 @@ async function getCalculateCommunityByCreator(startDate, endDate, page, size) {
|
||||
)
|
||||
}
|
||||
|
||||
async function updateCreatorSettlementRatio(creatorSettlementRatio) {
|
||||
const request = {
|
||||
memberId: creatorSettlementRatio.creator_id,
|
||||
subsidy: creatorSettlementRatio.subsidy,
|
||||
liveSettlementRatio: creatorSettlementRatio.liveSettlementRatio,
|
||||
contentSettlementRatio: creatorSettlementRatio.contentSettlementRatio,
|
||||
communitySettlementRatio: creatorSettlementRatio.communitySettlementRatio
|
||||
};
|
||||
return Vue.axios.post('/admin/calculate/ratio/update', request);
|
||||
}
|
||||
|
||||
async function deleteCreatorSettlementRatio(memberId) {
|
||||
return Vue.axios.post('/admin/calculate/ratio/delete/' + memberId);
|
||||
}
|
||||
|
||||
export {
|
||||
getCalculateLive,
|
||||
getCalculateContent,
|
||||
@@ -80,8 +65,6 @@ export {
|
||||
getCalculateCommunityPost,
|
||||
getSettlementRatio,
|
||||
createCreatorSettlementRatio,
|
||||
updateCreatorSettlementRatio,
|
||||
deleteCreatorSettlementRatio,
|
||||
getCalculateLiveByCreator,
|
||||
getCalculateContentByCreator,
|
||||
getCalculateCommunityByCreator
|
||||
|
@@ -7,20 +7,13 @@ async function getCharacterList(page = 1, size = 20) {
|
||||
})
|
||||
}
|
||||
|
||||
// 캐릭터 검색 (배너용 기존 함수)
|
||||
// 캐릭터 검색
|
||||
async function searchCharacters(searchTerm, page = 1, size = 20) {
|
||||
return Vue.axios.get('/admin/chat/banner/search-character', {
|
||||
params: { searchTerm, page: page - 1, size }
|
||||
})
|
||||
}
|
||||
|
||||
// 캐릭터 리스트 검색 (요구사항: /admin/chat/character/search)
|
||||
async function searchCharacterList(searchTerm, page = 1, size = 20) {
|
||||
return Vue.axios.get('/admin/chat/character/search', {
|
||||
params: { searchTerm, page: page - 1, size }
|
||||
})
|
||||
}
|
||||
|
||||
// 캐릭터 상세 조회
|
||||
async function getCharacter(id) {
|
||||
return Vue.axios.get(`/admin/chat/character/${id}`)
|
||||
@@ -264,7 +257,6 @@ async function getCharacterCalculateList({ startDateStr, endDateStr, sort = 'TOT
|
||||
export {
|
||||
getCharacterList,
|
||||
searchCharacters,
|
||||
searchCharacterList,
|
||||
getCharacter,
|
||||
createCharacter,
|
||||
updateCharacter,
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import Vue from 'vue';
|
||||
|
||||
// 공통: 값 그대로 전달 (빈 문자열 유지)
|
||||
// 공통: 빈 문자열 -> null
|
||||
function toNullIfBlank(value) {
|
||||
if (typeof value === 'string') {
|
||||
return value.trim() === '' ? null : value;
|
||||
@@ -25,12 +25,7 @@ export async function createOriginal(data) {
|
||||
category: toNullIfBlank(data.category),
|
||||
isAdult: !!data.isAdult,
|
||||
description: toNullIfBlank(data.description),
|
||||
originalLink: toNullIfBlank(data.originalLink), // 원천 원작 링크
|
||||
originalWork: toNullIfBlank(data.originalWork),
|
||||
writer: toNullIfBlank(data.writer),
|
||||
studio: toNullIfBlank(data.studio),
|
||||
originalLinks: Array.isArray(data.originalLinks) ? data.originalLinks : [],
|
||||
tags: Array.isArray(data.tags) ? data.tags : []
|
||||
originalLink: toNullIfBlank(data.originalLink)
|
||||
};
|
||||
formData.append('request', JSON.stringify(request));
|
||||
return Vue.axios.post('/admin/chat/original/register', formData, {
|
||||
@@ -44,7 +39,12 @@ export async function updateOriginal(data, image = null) {
|
||||
if (image) formData.append('image', image);
|
||||
const processed = {};
|
||||
Object.keys(data).forEach(key => {
|
||||
processed[key] = data[key];
|
||||
const value = data[key];
|
||||
if (typeof value === 'string' || value === '') {
|
||||
processed[key] = toNullIfBlank(value)
|
||||
} else {
|
||||
processed[key] = value
|
||||
}
|
||||
})
|
||||
formData.append('request', JSON.stringify(processed));
|
||||
return Vue.axios.put('/admin/chat/original/update', formData, {
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<br>
|
||||
|
||||
<v-container>
|
||||
<v-row align="center">
|
||||
<v-row>
|
||||
<v-col cols="4">
|
||||
<v-btn
|
||||
color="primary"
|
||||
@@ -19,29 +19,6 @@
|
||||
캐릭터 추가
|
||||
</v-btn>
|
||||
</v-col>
|
||||
<v-col
|
||||
cols="8"
|
||||
class="d-flex justify-end align-center"
|
||||
>
|
||||
<v-text-field
|
||||
v-model="searchTerm"
|
||||
label="검색어"
|
||||
placeholder="캐릭터명, 태그, mbti 검색"
|
||||
outlined
|
||||
dense
|
||||
hide-details
|
||||
style="max-width: 320px;"
|
||||
class="mr-2"
|
||||
@keyup.enter="onSearch"
|
||||
/>
|
||||
<v-btn
|
||||
:style="{ backgroundColor: '#3bb9f1', color: 'white' }"
|
||||
:disabled="is_loading"
|
||||
@click="onSearch"
|
||||
>
|
||||
검색
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col>
|
||||
@@ -267,7 +244,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getCharacterList, updateCharacter, searchCharacterList } from '@/api/character'
|
||||
import { getCharacterList, updateCharacter } from '@/api/character'
|
||||
|
||||
export default {
|
||||
name: "CharacterList",
|
||||
@@ -283,8 +260,7 @@ export default {
|
||||
page: 1,
|
||||
total_page: 0,
|
||||
characters: [],
|
||||
selected_character: {},
|
||||
searchTerm: ''
|
||||
selected_character: {}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -393,18 +369,10 @@ export default {
|
||||
await this.getCharacters()
|
||||
},
|
||||
|
||||
onSearch() {
|
||||
this.page = 1;
|
||||
this.getCharacters();
|
||||
},
|
||||
|
||||
async getCharacters() {
|
||||
this.is_loading = true
|
||||
try {
|
||||
const hasSearch = this.searchTerm && this.searchTerm.trim() !== '';
|
||||
const response = hasSearch
|
||||
? await searchCharacterList(this.searchTerm.trim(), this.page, 20)
|
||||
: await getCharacterList(this.page);
|
||||
const response = await getCharacterList(this.page);
|
||||
|
||||
if (response && response.status === 200) {
|
||||
if (response.data.success === true) {
|
||||
|
@@ -44,9 +44,8 @@
|
||||
</div>
|
||||
<div>카테고리(장르): {{ detail.category || '-' }}</div>
|
||||
<div>19금 여부: {{ detail.isAdult ? '예' : '아니오' }}</div>
|
||||
<div>원천 원작: {{ detail.originalWork || '-' }}</div>
|
||||
<div class="mt-1">
|
||||
원천 원작 링크:
|
||||
<div>
|
||||
원작 링크:
|
||||
<a
|
||||
v-if="detail.originalLink"
|
||||
:href="detail.originalLink"
|
||||
@@ -55,40 +54,6 @@
|
||||
>{{ detail.originalLink }}</a>
|
||||
<span v-else>-</span>
|
||||
</div>
|
||||
<div>글/그림: {{ detail.writer || '-' }}</div>
|
||||
<div>제작사: {{ detail.studio || '-' }}</div>
|
||||
<div class="mt-1">
|
||||
원작 링크:
|
||||
<template v-if="detail.originalLinks && detail.originalLinks.length">
|
||||
<div>
|
||||
<div
|
||||
v-for="(link, idx) in detail.originalLinks"
|
||||
:key="idx"
|
||||
>
|
||||
<a
|
||||
:href="link"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
>{{ link }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<span v-else>-</span>
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
태그:
|
||||
<template v-if="detail.tags && detail.tags.length">
|
||||
<v-chip
|
||||
v-for="(t, i) in detail.tags"
|
||||
:key="i"
|
||||
small
|
||||
class="mr-1 mb-1"
|
||||
>
|
||||
{{ t }}
|
||||
</v-chip>
|
||||
</template>
|
||||
<span v-else>-</span>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
작품 소개:
|
||||
</div>
|
||||
|
@@ -93,42 +93,15 @@
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<!-- 추가 메타 정보 (요구 순서: 글/그림, 제작사, 원천원작, 원천 원작 링크) -->
|
||||
<v-row>
|
||||
<v-col
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<v-text-field
|
||||
v-model="form.writer"
|
||||
label="글/그림"
|
||||
outlined
|
||||
dense
|
||||
/>
|
||||
</v-col>
|
||||
<v-col
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<v-text-field
|
||||
v-model="form.studio"
|
||||
label="제작사"
|
||||
outlined
|
||||
dense
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row>
|
||||
<v-col
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<v-text-field
|
||||
v-model="form.originalWork"
|
||||
label="원천 원작"
|
||||
outlined
|
||||
dense
|
||||
<v-switch
|
||||
v-model="form.isAdult"
|
||||
label="19금 여부"
|
||||
inset
|
||||
/>
|
||||
</v-col>
|
||||
<v-col
|
||||
@@ -137,7 +110,7 @@
|
||||
>
|
||||
<v-text-field
|
||||
v-model="form.originalLink"
|
||||
label="원천 원작 링크"
|
||||
label="원작 링크"
|
||||
outlined
|
||||
dense
|
||||
:rules="originalLinkRules"
|
||||
@@ -146,116 +119,6 @@
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row>
|
||||
<v-col
|
||||
cols="12"
|
||||
md="12"
|
||||
>
|
||||
<v-switch
|
||||
v-model="form.isAdult"
|
||||
label="19금 여부"
|
||||
inset
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<!-- 원작 링크(여러 개) 추가 -->
|
||||
<v-row>
|
||||
<v-col cols="12">
|
||||
<v-divider class="my-4" />
|
||||
<h3 class="mb-2">
|
||||
원작 링크
|
||||
</h3>
|
||||
<v-row>
|
||||
<v-col cols="11">
|
||||
<v-text-field
|
||||
v-model="newOriginalLink"
|
||||
label="원작 링크 추가"
|
||||
outlined
|
||||
dense
|
||||
@keyup.enter="addOriginalLink"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col cols="1">
|
||||
<v-btn
|
||||
color="primary"
|
||||
class="mt-1"
|
||||
block
|
||||
:disabled="!newOriginalLink || !newOriginalLink.trim()"
|
||||
@click="addOriginalLink"
|
||||
>
|
||||
추가
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-card
|
||||
outlined
|
||||
class="mt-2"
|
||||
>
|
||||
<v-list v-if="form.originalLinks && form.originalLinks.length > 0">
|
||||
<v-list-item
|
||||
v-for="(link, idx) in form.originalLinks"
|
||||
:key="idx"
|
||||
>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title class="text-truncate">
|
||||
{{ link }}
|
||||
</v-list-item-title>
|
||||
</v-list-item-content>
|
||||
<v-list-item-action>
|
||||
<v-btn
|
||||
small
|
||||
color="error"
|
||||
@click="removeOriginalLink(idx)"
|
||||
>
|
||||
삭제
|
||||
</v-btn>
|
||||
</v-list-item-action>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
<v-card-text
|
||||
v-else
|
||||
class="grey--text"
|
||||
>
|
||||
추가된 원작 링크가 없습니다.
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<!-- 태그 -->
|
||||
<v-row>
|
||||
<v-col cols="12">
|
||||
<v-divider class="my-4" />
|
||||
<h3 class="mb-2">
|
||||
태그
|
||||
</h3>
|
||||
<v-combobox
|
||||
v-model="form.tags"
|
||||
multiple
|
||||
chips
|
||||
small-chips
|
||||
deletable-chips
|
||||
outlined
|
||||
dense
|
||||
label="태그를 입력 후 엔터로 추가"
|
||||
@keydown.space.prevent="onTagSpace"
|
||||
>
|
||||
<template v-slot:selection="{ attrs, item, select, selected }">
|
||||
<v-chip
|
||||
v-bind="attrs"
|
||||
:input-value="selected"
|
||||
close
|
||||
@click="select"
|
||||
@click:close="removeTag(item)"
|
||||
>
|
||||
{{ item }}
|
||||
</v-chip>
|
||||
</template>
|
||||
</v-combobox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row>
|
||||
<v-col cols="12">
|
||||
<v-textarea
|
||||
@@ -296,7 +159,6 @@ export default {
|
||||
isEdit: false,
|
||||
isFormValid: false,
|
||||
previewImage: null,
|
||||
newOriginalLink: '',
|
||||
form: {
|
||||
id: null,
|
||||
image: null,
|
||||
@@ -306,18 +168,13 @@ export default {
|
||||
category: '',
|
||||
isAdult: false,
|
||||
description: '',
|
||||
originalLink: '', // 원천 원작 링크(파라미터명 유지)
|
||||
originalWork: '',
|
||||
writer: '',
|
||||
studio: '',
|
||||
originalLinks: [], // 추가 원작 링크들
|
||||
tags: []
|
||||
originalLink: ''
|
||||
},
|
||||
originalInitial: null,
|
||||
imageRules: [v => (this.isEdit ? true : (!!v || '이미지를 선택하세요'))],
|
||||
contentTypeRules: [v => (this.isEdit ? true : (!!(v && v.toString().trim()) || '콘텐츠 타입은 필수입니다'))],
|
||||
categoryRules: [v => (this.isEdit ? true : (!!(v && v.toString().trim()) || '카테고리는 필수입니다'))],
|
||||
originalLinkRules: [v => (this.isEdit ? true : (!!(v && v.toString().trim()) || '원천 원작 링크는 필수입니다'))],
|
||||
originalLinkRules: [v => (this.isEdit ? true : (!!(v && v.toString().trim()) || '원작 링크는 필수입니다'))],
|
||||
descriptionRules: [v => (this.isEdit ? true : (!!(v && v.toString().trim()) || '작품 소개는 필수입니다'))]
|
||||
}
|
||||
},
|
||||
@@ -327,11 +184,8 @@ export default {
|
||||
},
|
||||
hasNonImageChanges() {
|
||||
if (!this.isEdit || !this.originalInitial) return false;
|
||||
const fields = ['title', 'contentType', 'category', 'isAdult', 'description', 'originalLink', 'originalWork', 'writer', 'studio'];
|
||||
const basicChanged = fields.some(f => this.form[f] !== this.originalInitial[f]);
|
||||
const arraysChanged = !this.arraysEqual(this.form.originalLinks, this.originalInitial.originalLinks)
|
||||
|| !this.arraysEqual(this.form.tags, this.originalInitial.tags);
|
||||
return basicChanged || arraysChanged;
|
||||
const fields = ['title', 'contentType', 'category', 'isAdult', 'description', 'originalLink'];
|
||||
return fields.some(f => this.form[f] !== this.originalInitial[f]);
|
||||
},
|
||||
hasEditChanges() {
|
||||
return this.imageChanged || this.hasNonImageChanges;
|
||||
@@ -365,44 +219,6 @@ export default {
|
||||
notifyError(message) { this.$dialog.notify.error(message) },
|
||||
notifySuccess(message) { this.$dialog.notify.success(message) },
|
||||
goBack() { this.$router.push('/original-work') },
|
||||
arraysEqual(a, b) {
|
||||
const arrA = Array.isArray(a) ? a : [];
|
||||
const arrB = Array.isArray(b) ? b : [];
|
||||
if (arrA.length !== arrB.length) return false;
|
||||
for (let i = 0; i < arrA.length; i++) {
|
||||
if (arrA[i] !== arrB[i]) return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
addOriginalLink() {
|
||||
if (!this.newOriginalLink || !this.newOriginalLink.trim()) return;
|
||||
const val = this.newOriginalLink.trim();
|
||||
if (!this.form.originalLinks) this.form.originalLinks = [];
|
||||
if (!this.form.originalLinks.includes(val)) {
|
||||
this.form.originalLinks.push(val);
|
||||
}
|
||||
this.newOriginalLink = '';
|
||||
},
|
||||
removeOriginalLink(index) {
|
||||
if (!this.form.originalLinks) return;
|
||||
this.form.originalLinks.splice(index, 1);
|
||||
},
|
||||
onTagSpace() {
|
||||
// CharacterForm의 태그 방식과 유사: 마지막 항목을 공백 기준으로 확정
|
||||
if (!Array.isArray(this.form.tags)) this.form.tags = [];
|
||||
const last = this.form.tags[this.form.tags.length - 1];
|
||||
if (typeof last === 'string' && last.trim()) {
|
||||
let processed = last.trim().replace(/\s+/g, '');
|
||||
if (processed.length > 50) processed = processed.substring(0, 50);
|
||||
this.form.tags.splice(this.form.tags.length - 1, 1, processed);
|
||||
this.$nextTick(() => this.form.tags.push(''));
|
||||
}
|
||||
},
|
||||
removeTag(item) {
|
||||
if (!Array.isArray(this.form.tags)) return;
|
||||
const idx = this.form.tags.indexOf(item);
|
||||
if (idx >= 0) this.form.tags.splice(idx, 1);
|
||||
},
|
||||
async load(id) {
|
||||
try {
|
||||
const res = await getOriginal(id);
|
||||
@@ -417,12 +233,7 @@ export default {
|
||||
category: d.category || '',
|
||||
isAdult: !!d.isAdult,
|
||||
description: d.description || '',
|
||||
originalLink: d.originalLink || '',
|
||||
originalWork: d.originalWork || '',
|
||||
writer: d.writer || '',
|
||||
studio: d.studio || '',
|
||||
originalLinks: Array.isArray(d.originalLinks) ? d.originalLinks.slice() : [],
|
||||
tags: Array.isArray(d.tags) ? d.tags.slice() : []
|
||||
originalLink: d.originalLink || ''
|
||||
}
|
||||
this.originalInitial = {
|
||||
id: d.id,
|
||||
@@ -432,12 +243,7 @@ export default {
|
||||
category: d.category || '',
|
||||
isAdult: !!d.isAdult,
|
||||
description: d.description || '',
|
||||
originalLink: d.originalLink || '',
|
||||
originalWork: d.originalWork || '',
|
||||
writer: d.writer || '',
|
||||
studio: d.studio || '',
|
||||
originalLinks: Array.isArray(d.originalLinks) ? d.originalLinks.slice() : [],
|
||||
tags: Array.isArray(d.tags) ? d.tags.slice() : []
|
||||
originalLink: d.originalLink || ''
|
||||
}
|
||||
} else {
|
||||
this.notifyError('상세 조회 실패');
|
||||
@@ -455,7 +261,7 @@ export default {
|
||||
}
|
||||
|
||||
if (this.isEdit) {
|
||||
const fields = ['title', 'contentType', 'category', 'isAdult', 'description', 'originalLink', 'originalWork', 'writer', 'studio'];
|
||||
const fields = ['title', 'contentType', 'category', 'isAdult', 'description', 'originalLink'];
|
||||
const patch = { id: this.form.id };
|
||||
if (this.originalInitial) {
|
||||
fields.forEach(f => {
|
||||
@@ -463,12 +269,6 @@ export default {
|
||||
patch[f] = this.form[f];
|
||||
}
|
||||
});
|
||||
if (!this.arraysEqual(this.form.originalLinks, this.originalInitial.originalLinks)) {
|
||||
patch.originalLinks = this.form.originalLinks;
|
||||
}
|
||||
if (!this.arraysEqual(this.form.tags, this.originalInitial.tags)) {
|
||||
patch.tags = this.form.tags;
|
||||
}
|
||||
}
|
||||
const image = this.form.image || null;
|
||||
if (Object.keys(patch).length === 1 && !image) {
|
||||
|
@@ -53,24 +53,6 @@
|
||||
<template v-slot:item.communitySettlementRatio="{ item }">
|
||||
{{ item.communitySettlementRatio }}%
|
||||
</template>
|
||||
<template v-slot:item.actions="{ item }">
|
||||
<v-btn
|
||||
small
|
||||
color="primary"
|
||||
text
|
||||
@click="openEdit(item)"
|
||||
>
|
||||
수정
|
||||
</v-btn>
|
||||
<v-btn
|
||||
small
|
||||
color="red"
|
||||
text
|
||||
@click="confirmDelete(item)"
|
||||
>
|
||||
삭제
|
||||
</v-btn>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -91,20 +73,13 @@
|
||||
persistent
|
||||
>
|
||||
<v-card>
|
||||
<v-card-title>{{ is_edit ? '크리에이터 정산비율 수정' : '크리에이터 정산비율' }}</v-card-title>
|
||||
<v-card-text v-show="!is_edit">
|
||||
<v-card-title>크리에이터 정산비율</v-card-title>
|
||||
<v-card-text>
|
||||
<v-text-field
|
||||
v-model="creator_settlement_ratio.creator_id"
|
||||
label="크리에이터 번호"
|
||||
/>
|
||||
</v-card-text>
|
||||
<v-card-text v-show="is_edit">
|
||||
<v-text-field
|
||||
v-model="creator_settlement_ratio.nickname"
|
||||
disabled
|
||||
label="크리에이터 닉네임"
|
||||
/>
|
||||
</v-card-text>
|
||||
<v-card-text>
|
||||
<v-text-field
|
||||
v-model="creator_settlement_ratio.subsidy"
|
||||
@@ -143,7 +118,7 @@
|
||||
text
|
||||
@click="validate"
|
||||
>
|
||||
{{ is_edit ? '수정하기' : '등록하기' }}
|
||||
등록하기
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
@@ -167,8 +142,6 @@ export default {
|
||||
items: [],
|
||||
creator_settlement_ratio: {},
|
||||
show_write_dialog: false,
|
||||
is_edit: false,
|
||||
editing_item_id: null,
|
||||
headers: [
|
||||
{
|
||||
text: '닉네임',
|
||||
@@ -200,12 +173,6 @@ export default {
|
||||
sortable: false,
|
||||
value: 'communitySettlementRatio',
|
||||
},
|
||||
{
|
||||
text: '관리',
|
||||
align: 'center',
|
||||
sortable: false,
|
||||
value: 'actions',
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
@@ -224,16 +191,11 @@ export default {
|
||||
},
|
||||
|
||||
showWriteDialog() {
|
||||
this.is_edit = false
|
||||
this.editing_item_id = null
|
||||
this.creator_settlement_ratio = {}
|
||||
this.show_write_dialog = true
|
||||
},
|
||||
|
||||
cancel() {
|
||||
this.creator_settlement_ratio = {}
|
||||
this.is_edit = false
|
||||
this.editing_item_id = null
|
||||
this.show_write_dialog = false
|
||||
},
|
||||
|
||||
@@ -263,11 +225,7 @@ export default {
|
||||
return
|
||||
}
|
||||
|
||||
if (this.is_edit) {
|
||||
this.updateCreatorSettlementRatio();
|
||||
} else {
|
||||
this.createCreatorSettlementRatio();
|
||||
}
|
||||
this.createCreatorSettlementRatio();
|
||||
},
|
||||
|
||||
async createCreatorSettlementRatio() {
|
||||
@@ -295,71 +253,6 @@ export default {
|
||||
this.is_loading = false
|
||||
},
|
||||
|
||||
async updateCreatorSettlementRatio() {
|
||||
if (this.is_loading) return;
|
||||
this.is_loading = true
|
||||
try {
|
||||
// 수정은 생성과 동일한 파라미터를 전송 (memberId 기준)
|
||||
const payload = { ...this.creator_settlement_ratio }
|
||||
const res = await api.updateCreatorSettlementRatio(payload)
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
this.cancel()
|
||||
this.notifySuccess(res.data.message || '수정되었습니다.')
|
||||
this.items = []
|
||||
await this.getSettlementRatio()
|
||||
} else {
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
}
|
||||
} catch (e) {
|
||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
} finally {
|
||||
this.is_loading = false
|
||||
}
|
||||
},
|
||||
|
||||
openEdit(item) {
|
||||
this.is_edit = true
|
||||
this.editing_item_id = null
|
||||
this.creator_settlement_ratio = {
|
||||
creator_id: item.memberId,
|
||||
nickname: item.nickname,
|
||||
subsidy: item.subsidy,
|
||||
liveSettlementRatio: item.liveSettlementRatio,
|
||||
contentSettlementRatio: item.contentSettlementRatio,
|
||||
communitySettlementRatio: item.communitySettlementRatio,
|
||||
}
|
||||
this.show_write_dialog = true
|
||||
},
|
||||
|
||||
async confirmDelete(item) {
|
||||
try {
|
||||
const ok = await this.$dialog.confirm({ text: '삭제하시겠습니까?', title: '확인', actions: { false: '취소', true: '삭제' } })
|
||||
if (!ok) return
|
||||
} catch (e) {
|
||||
// 일부 구현체는 confirm이 boolean이 아닌 경우가 있음
|
||||
}
|
||||
this.deleteCreatorSettlementRatio(item)
|
||||
},
|
||||
|
||||
async deleteCreatorSettlementRatio(item) {
|
||||
if (this.is_loading) return;
|
||||
this.is_loading = true
|
||||
try {
|
||||
const memberId = item.memberId
|
||||
const res = await api.deleteCreatorSettlementRatio(memberId)
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
this.notifySuccess(res.data.message || '삭제되었습니다.')
|
||||
this.items = this.items.filter(x => (x.memberId) !== memberId)
|
||||
} else {
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
}
|
||||
} catch (e) {
|
||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
} finally {
|
||||
this.is_loading = false
|
||||
}
|
||||
},
|
||||
|
||||
async getSettlementRatio() {
|
||||
this.is_loading = true
|
||||
|
||||
@@ -386,6 +279,10 @@ export default {
|
||||
},
|
||||
|
||||
async next() {
|
||||
if (this.search_word.length < 2) {
|
||||
this.search_word = ''
|
||||
}
|
||||
|
||||
await this.getSettlementRatio()
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user