Compare commits

..

74 Commits

Author SHA1 Message Date
18b59b5598 Merge pull request 'test' (#75) from test into main
Reviewed-on: #75
2025-09-14 09:04:57 +00:00
5fcdd7f06d Merge pull request '캐릭터 챗봇' (#74) from test into main
Reviewed-on: #74
2025-09-10 06:26:02 +00:00
1e149f7e41 Merge pull request '쿠폰생성 - 쿠폰타입(포인트, 캔) 선택 추가' (#73) from test into main
Reviewed-on: #73
2025-06-10 11:01:52 +00:00
aca3767a24 Merge pull request 'test' (#72) from test into main
Reviewed-on: #72
2025-05-20 07:21:28 +00:00
d51655f15e Merge pull request '포인트 정책 등록/수정 페이지 추가' (#71) from test into main
Reviewed-on: #71
2025-04-24 03:28:52 +00:00
47dd32939f Merge pull request '일별 전체 회원 수 - 이메일, 구글, 카카오 회원 수 추가' (#70) from test into main
Reviewed-on: #70
2025-04-10 02:35:33 +00:00
2e1891ab08 Merge pull request '회원리스트 - 로그인 타입 필드 추가' (#69) from test into main
Reviewed-on: #69
2025-04-09 10:44:30 +00:00
99d70cc8f7 Merge pull request '이벤트 배너 수정 - 링크 지우기 추가' (#68) from test into main
Reviewed-on: #68
2025-04-07 14:48:10 +00:00
9f1675e82d Merge pull request '광고통계 - 로그인 수를 가장 오른쪽으로 이동' (#67) from test into main
Reviewed-on: #67
2025-04-02 02:11:35 +00:00
c2838be2ed Merge pull request '일별 전체 회원 수 통계' (#66) from test into main
Reviewed-on: #66
2025-03-31 03:54:56 +00:00
b5c2941c0d Merge pull request '앱 실행 수 추가' (#65) from test into main
Reviewed-on: #65
2025-03-28 05:58:43 +00:00
d5c01d8d23 Merge pull request '광고통계 - 빠른검색 (날짜 지정) 추가' (#64) from test into main
Reviewed-on: #64
2025-03-17 04:58:02 +00:00
7118b0649a Merge pull request '비밀번호 재설정 기능 추가' (#63) from test into main
Reviewed-on: #63
2025-03-17 03:09:41 +00:00
8f5346581e Merge pull request '일별 전체 회원 수 페이지 추가' (#62) from test into main
Reviewed-on: #62
2025-03-14 16:08:06 +00:00
e43f2e30be Merge pull request '충전 이벤트, 이벤트 배너 - 기간 설정에 시간 추가' (#61) from test into main
Reviewed-on: #61
2025-03-14 03:34:42 +00:00
397fd267e0 Merge pull request 'test' (#60) from test into main
Reviewed-on: #60
2025-03-11 08:07:48 +00:00
fe4b88350b Merge pull request '광고 통계 페이지' (#59) from test into main
Reviewed-on: #59
2025-03-05 13:53:32 +00:00
537474e162 Merge pull request '마케팅 - 매체 파트너 코드 페이지 추가' (#58) from test into main
Reviewed-on: #58
2025-03-05 09:54:31 +00:00
b5abdf3cf5 Merge pull request 'test' (#57) from test into main
Reviewed-on: #57
2025-02-18 15:12:52 +00:00
a2e457b5e8 Merge pull request 'test' (#56) from test into main
Reviewed-on: #56
2025-02-09 13:25:35 +00:00
05ddd417cd Merge pull request '콘텐츠 배너 등록/수정' (#54) from test into main
Reviewed-on: #54
2025-01-17 16:46:45 +00:00
e70426af68 Merge pull request 'test' (#53) from test into main
Reviewed-on: #53
2025-01-17 06:00:59 +00:00
81b33e1322 Merge pull request '오디션 지원 취소기능 적용' (#52) from test into main
Reviewed-on: #52
2025-01-08 06:34:54 +00:00
588fcfbe90 Merge pull request '오디션 지원자 연락처 표시' (#51) from test into main
Reviewed-on: #51
2025-01-07 20:10:23 +00:00
ff2c126382 Merge pull request '오디션 메뉴 추가' (#50) from test into main
Reviewed-on: #50
2025-01-07 17:20:32 +00:00
702daca29f Merge pull request '소다라이브 -> 보이스온' (#49) from test into main
Reviewed-on: #49
2024-11-21 12:59:05 +00:00
8e9008a3c1 Merge pull request '이벤트 기간 추가' (#48) from test into main
Reviewed-on: #48
2024-10-31 03:17:44 +00:00
5c0c00aad4 Merge pull request '크리에이터 리스트 - 프로필 이미지 다운로드 버튼 추가' (#47) from test into main
Reviewed-on: #47
2024-10-24 03:07:00 +00:00
e0949c6d73 Merge pull request 'test' (#46) from test into main
Reviewed-on: #46
2024-10-16 04:18:55 +00:00
0449bac8d5 Merge pull request '전체 개수 추가' (#45) from test into main
Reviewed-on: #45
2024-10-15 04:18:01 +00:00
d412c15c9d Merge pull request '시리즈 리스트 - 작품 개수 추가' (#44) from test into main
Reviewed-on: #44
2024-10-14 15:43:15 +00:00
ed16a6ddad Merge pull request '시리즈 리스트 페이지 추가' (#43) from test into main
Reviewed-on: #43
2024-10-14 10:14:19 +00:00
f06e2d41e0 Merge pull request '전체 크리에이터 수 추가' (#42) from test into main
Reviewed-on: #42
2024-09-26 11:38:53 +00:00
7505269db3 Merge pull request '크리에이터별 정산 - 페이징 추가' (#41) from test into main
Reviewed-on: #41
2024-08-01 05:16:04 +00:00
15eeb6943d Merge pull request '크리에이터 기준 라이브, 콘텐츠, 커뮤니티 합계 정산 페이지 추가' (#40) from test into main
Reviewed-on: #40
2024-07-08 14:41:28 +00:00
7e7ed46cea Merge pull request '크리에이터 기준 라이브, 콘텐츠, 커뮤니티 합계 정산 페이지 추가' (#39) from test into main
Reviewed-on: #39
2024-07-08 14:37:08 +00:00
fd01786649 Merge pull request 'test' (#38) from test into main
Reviewed-on: #38
2024-07-08 14:22:01 +00:00
c48c1c2f09 Merge pull request '크리에이터 정산비율 등록페이지 추가' (#37) from test into main
Reviewed-on: #37
2024-06-11 08:11:57 +00:00
9bcf3a3cdb Merge pull request '커뮤니티 정산' (#36) from test into main
Reviewed-on: #36
2024-06-06 14:59:58 +00:00
4c5b987d98 Merge pull request 'test' (#35) from test into main
Reviewed-on: #35
2024-06-03 22:24:23 +00:00
f168403048 Merge pull request '라이브 리스트 - 현재참여인원 추가' (#34) from test into main
Reviewed-on: #34
2024-05-28 18:16:18 +00:00
82ee1584e7 Merge pull request '커뮤니티 정산 페이지 추가' (#33) from test into main
Reviewed-on: #33
2024-05-28 16:13:16 +00:00
65cb918389 Merge pull request '시그니처 관리 - 재생 시간 등록/수정 기능 추가' (#32) from test into main
Reviewed-on: #32
2024-05-02 07:17:34 +00:00
784baf9a2f Merge pull request '시리즈 장르 - 등록/삭제 페이지 추가' (#31) from test into main
Reviewed-on: #31
2024-04-26 19:06:32 +00:00
7a85ac41cc Merge pull request '관리자 - 캔 충전현황' (#30) from test into main
Reviewed-on: #30
2024-04-01 11:34:15 +00:00
9d4c9437cf Merge pull request '관리자 - 캔 충전현황' (#29) from test into main
Reviewed-on: #29
2024-04-01 11:27:14 +00:00
68845aeae1 Merge pull request '콘텐츠 리스트 한정판 표시' (#28) from test into main
Reviewed-on: #28
2024-03-29 05:00:01 +00:00
bbdca29337 Merge pull request '콘텐츠 리스트' (#27) from test into main
Reviewed-on: #27
2024-03-28 06:43:25 +00:00
c14c041daa Merge pull request 'test' (#26) from test into main
Reviewed-on: #26
2024-03-19 07:50:16 +00:00
a515a144eb Merge pull request 'test' (#25) from test into main
Reviewed-on: #25
2024-03-13 11:42:23 +00:00
54a6773905 Merge pull request 'test' (#24) from test into main
Reviewed-on: #24
2024-03-12 07:54:10 +00:00
d97087b4e9 Merge pull request '시그니처 캔 등록 페이지 추가' (#23) from test into main
Reviewed-on: #23
2024-03-08 13:59:51 +00:00
ddb2449053 Merge pull request '파비콘 변경' (#22) from test into main
Reviewed-on: #22
2024-02-17 14:56:25 +00:00
8aca07cdf7 Merge pull request '콘텐츠 수정' (#21) from test into main
Reviewed-on: #21
2024-02-08 18:25:50 +00:00
0ba845d95a Merge pull request '콘텐츠 리스트 - 오픈예정일 추가' (#20) from test into main
Reviewed-on: #20
2024-01-11 09:27:25 +00:00
64b1fd5395 Merge pull request '수정 기능 추가' (#19) from test into main
Reviewed-on: #19
2024-01-03 15:25:28 +00:00
639bea70fa Merge pull request '쿠폰 관리 페이지 추가' (#18) from test into main
Reviewed-on: #18
2024-01-03 10:33:23 +00:00
6a89ba059b Merge pull request '푸시 발송 대상 지정 UI 추가' (#17) from test into main
Reviewed-on: #17
2023-11-24 07:01:10 +00:00
ff83041585 Merge pull request '연령제한 표시 추가' (#16) from test into main
Reviewed-on: #16
2023-11-21 16:25:21 +00:00
e660be0bf4 Merge pull request '일자별 콘텐츠 후원 페이지 - 유/무료 구분 추가' (#15) from test into main
Reviewed-on: #15
2023-11-14 13:36:49 +00:00
62cdd57069 Merge pull request '일자별 콘텐츠 후원 페이지 - 유/무료 구분 추가' (#14) from test into main
Reviewed-on: #14
2023-11-14 13:34:37 +00:00
f8346ed5ef Merge pull request '일자별 콘텐츠 후원 페이지 - 유/무료 구분 추가' (#13) from test into main
Reviewed-on: #13
2023-11-14 13:19:50 +00:00
9656b9a9d1 Merge pull request '일자별 콘텐츠 후원 페이지 추가' (#12) from test into main
Reviewed-on: #12
2023-11-14 08:57:15 +00:00
97a58266bb Merge pull request 'orderType 추가, 판매수 -> 누적 판매수 로 변경' (#11) from test into main
Reviewed-on: #11
2023-11-13 14:52:38 +00:00
8fc0cfa345 Merge pull request '콘텐츠별 누적 현황 페이지 - 총 콘텐츠 개수 표시' (#10) from test into main
Reviewed-on: #10
2023-11-13 14:08:26 +00:00
22f9c2287d Merge pull request '콘텐츠별 누적 현황 페이지 추가' (#9) from test into main
Reviewed-on: #9
2023-11-13 13:46:19 +00:00
9284f7d5c3 Merge pull request '콘텐츠 정산 - 엑셀 다운로드 추가' (#8) from test into main
Reviewed-on: #8
2023-11-13 08:46:43 +00:00
e6f27a4529 Merge pull request '콘텐츠 정산 - 헤더 순서 변경' (#7) from test into main
Reviewed-on: #7
2023-11-10 13:56:50 +00:00
6a33d1c024 Merge pull request '콘텐츠 정산 페이지 추가' (#6) from test into main
Reviewed-on: #6
2023-11-10 10:51:32 +00:00
3b83789c15 Merge pull request 'test' (#5) from test into main
Reviewed-on: #5
2023-10-06 15:09:02 +00:00
55f0ab9af3 Merge pull request '크리에이터 라이브 정산 - 인원 추가, 코인 -> 캔' (#4) from test into main
Reviewed-on: #4
2023-10-03 12:15:25 +00:00
9b168a6112 Merge pull request '크리에이터 라이브 정산 페이지 추가' (#3) from test into main
Reviewed-on: #3
2023-10-03 09:25:39 +00:00
c47937933e Merge pull request 'test' (#2) from test into main
Reviewed-on: #2
2023-08-25 07:50:32 +00:00
4744fe7d9a Merge pull request '채널공유 - 파이어베이스 링크, 도메인, 프로젝트명 변경' (#1) from test into main
Reviewed-on: #1
2023-08-22 03:39:44 +00:00
50 changed files with 759 additions and 7531 deletions

11
package-lock.json generated
View File

@@ -9,7 +9,6 @@
"version": "0.1.0",
"dependencies": {
"core-js": "^3.6.5",
"cropperjs": "^1.5.13",
"file-saver": "^2.0.5",
"lodash": "^4.17.21",
"vue": "^2.6.11",
@@ -4908,11 +4907,6 @@
"sha.js": "^2.4.8"
}
},
"node_modules/cropperjs": {
"version": "1.5.13",
"resolved": "https://registry.npmjs.org/cropperjs/-/cropperjs-1.5.13.tgz",
"integrity": "sha512-by7jKAo73y5/Do0K6sxdTKHgndY0NMjG2bEdgeJxycbcmHuCiMXqw8sxy5C5Y5WTOTcDGmbT7Sr5CgKOXR06OA=="
},
"node_modules/cross-spawn": {
"version": "6.0.5",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
@@ -19714,11 +19708,6 @@
"sha.js": "^2.4.8"
}
},
"cropperjs": {
"version": "1.5.13",
"resolved": "https://registry.npmjs.org/cropperjs/-/cropperjs-1.5.13.tgz",
"integrity": "sha512-by7jKAo73y5/Do0K6sxdTKHgndY0NMjG2bEdgeJxycbcmHuCiMXqw8sxy5C5Y5WTOTcDGmbT7Sr5CgKOXR06OA=="
},
"cross-spawn": {
"version": "6.0.5",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",

View File

@@ -11,7 +11,6 @@
},
"dependencies": {
"core-js": "^3.6.5",
"cropperjs": "^1.5.13",
"file-saver": "^2.0.5",
"lodash": "^4.17.21",
"vue": "^2.6.11",

View File

@@ -1,145 +0,0 @@
import Vue from 'vue'
// 공통: 페이지 파라미터 변환(1-based UI → 0-based Spring Pageable)
function toZeroBased(page) {
const p = Number(page || 1)
return Math.max(0, p - 1)
}
// 에이전트 리스트 조회
// 서버 스펙에 페이지네이션이 없다면 단순 GET으로 사용
// 추후 필요 시 params(page,size) 확장 가능
async function getAgentList() {
return Vue.axios.get('/admin/partner/agent/list')
}
// 에이전트 정산 비율 목록 조회
async function getAgentSettlementRatioList() {
return Vue.axios.get('/admin/partner/agent/ratio')
}
// 에이전트 정산 비율 등록
// payload: { memberId: number, settlementRatio: number, effectiveFrom: string(yyyy-MM-ddTHH:mm:ss) }
async function createAgentSettlementRatio(payload) {
return Vue.axios.post('/admin/partner/agent/ratio', payload)
}
// 에이전트 정산 비율 수정
// payload: { memberId: number, settlementRatio: number, effectiveFrom: string(yyyy-MM-ddTHH:mm:ss) }
async function updateAgentSettlementRatio(payload) {
return Vue.axios.post('/admin/partner/agent/ratio/update', payload)
}
// 에이전트 닉네임 검색
// 반환: [{ id, nickname }]
async function searchAgentByNickname(query) {
try {
const res = await Vue.axios.get('/admin/partner/agent/search-by-nickname', {
params: { nickname: query, search_word: query }
})
if (res && Array.isArray(res.data)) return res.data
if (res && res.data && Array.isArray(res.data.data)) return res.data.data
return []
} catch (e) {
return []
}
}
// 에이전트 소속 크리에이터 목록 조회
// GET /admin/partner/agent/{agentId}/creator/list
// params: { page, size }
async function getAgentAssignedCreatorList(agentId, page = 1, size = 20) {
// Spring Pageable은 일반적으로 0-based page index를 사용
const zeroBasedPage = Math.max(0, Number(page || 1) - 1)
return Vue.axios.get(`/admin/partner/agent/${agentId}/creator/list`, {
params: { page: zeroBasedPage, size }
})
}
// 추가 가능한 크리에이터 검색
// GET /admin/partner/agent/creator/search?search_word=...
async function searchAdminAgentAssignableCreators(search_word) {
return Vue.axios.get('/admin/partner/agent/creator/search', {
params: { search_word }
})
}
// 에이전트에 크리에이터 소속 시키기
// POST /admin/partner/agent/assignment
// payload: { agentId, creatorId, assignedAt } // assignedAt: LocalDateTime string (yyyy-MM-ddTHH:mm:ss)
async function assignAgentCreator(payload) {
return Vue.axios.post('/admin/partner/agent/assignment', payload)
}
// 크리에이터 소속 해제
// POST /admin/partner/agent/assignment/remove
// payload: { creatorId, unassignedAt } // unassignedAt: LocalDateTime string
async function removeAgentCreator(payload) {
return Vue.axios.post('/admin/partner/agent/assignment/remove', payload)
}
// =========================
// 정산 상세 - 에이전트별(크리에이터 기준 집계)
// 공통 Request: startDateStr, endDateStr, Spring Pageable(page,size,sort)
// 공통 Response: ApiResponse<GetAgentSettlementByCreatorResponse>
// { success, message, data: { totalCount, total:{...}, items:[...] } }
function buildSettlementParams({ startDateStr, endDateStr, page = 1, size = 20, sort }) {
const params = {
startDateStr,
endDateStr,
page: toZeroBased(page),
size
}
if (sort) params.sort = sort
return params
}
async function getAgentLiveSettlementByCreator(agentId, { startDateStr, endDateStr, page = 1, size = 20, sort } = {}) {
return Vue.axios.get(`/admin/partner/agent/${agentId}/calculate/live-by-creator`, {
params: buildSettlementParams({ startDateStr, endDateStr, page, size, sort })
})
}
async function getAgentContentSettlementByCreator(agentId, { startDateStr, endDateStr, page = 1, size = 20, sort } = {}) {
return Vue.axios.get(`/admin/partner/agent/${agentId}/calculate/content-by-creator`, {
params: buildSettlementParams({ startDateStr, endDateStr, page, size, sort })
})
}
async function getAgentCommunitySettlementByCreator(agentId, { startDateStr, endDateStr, page = 1, size = 20, sort } = {}) {
return Vue.axios.get(`/admin/partner/agent/${agentId}/calculate/community-by-creator`, {
params: buildSettlementParams({ startDateStr, endDateStr, page, size, sort })
})
}
async function getAgentContentDonationSettlementByCreator(agentId, { startDateStr, endDateStr, page = 1, size = 20, sort } = {}) {
return Vue.axios.get(`/admin/partner/agent/${agentId}/calculate/content-donation-by-creator`, {
params: buildSettlementParams({ startDateStr, endDateStr, page, size, sort })
})
}
async function getAgentChannelDonationSettlementByCreator(agentId, { startDateStr, endDateStr, page = 1, size = 20, sort } = {}) {
return Vue.axios.get(`/admin/partner/agent/${agentId}/calculate/channel-donation-by-creator`, {
params: buildSettlementParams({ startDateStr, endDateStr, page, size, sort })
})
}
export {
getAgentList,
getAgentSettlementRatioList,
createAgentSettlementRatio,
updateAgentSettlementRatio,
searchAgentByNickname,
// 에이전트 상세 - 소속 크리에이터 관리
getAgentAssignedCreatorList,
searchAdminAgentAssignableCreators,
assignAgentCreator,
removeAgentCreator,
// 에이전트 정산 상세 (크리에이터 기준)
getAgentLiveSettlementByCreator,
getAgentContentSettlementByCreator,
getAgentCommunitySettlementByCreator,
getAgentContentDonationSettlementByCreator,
getAgentChannelDonationSettlementByCreator,
}

View File

@@ -15,12 +15,8 @@ async function searchAudioContent(searchWord, page) {
)
}
async function modifyAudioContent(formData) {
return Vue.axios.put("/admin/audio-content", formData, {
headers: {
"Content-Type": "multipart/form-data"
}
})
async function modifyAudioContent(request) {
return Vue.axios.put("/admin/audio-content", request)
}
async function getBannerList(tabId) {

View File

@@ -1,75 +1,27 @@
import Vue from "vue";
import Vue from 'vue';
async function getAudioContentSeriesList(page) {
return Vue.axios.get("/admin/audio-content/series?page=" + (page - 1) + "&size=10");
}
async function getAudioContentSeriesGenreList() {
return Vue.axios.get("/admin/audio-content/series/genre");
return Vue.axios.get('/admin/audio-content/series/genre');
}
async function createAudioContentSeriesGenre(genre, is_adult) {
return Vue.axios.post("/admin/audio-content/series/genre", { genre: genre, isAdult: is_adult });
return Vue.axios.post('/admin/audio-content/series/genre', {genre: genre, isAdult: is_adult})
}
async function updateAudioContentSeriesGenre(request) {
return Vue.axios.put("/admin/audio-content/series/genre", request);
return Vue.axios.put('/admin/audio-content/series/genre', request)
}
async function updateAudioContentSeriesGenreOrders(ids) {
return Vue.axios.put("/admin/audio-content/series/genre/orders", { ids: ids });
return Vue.axios.put('/admin/audio-content/series/genre/orders', {ids: ids})
}
async function searchSeriesList(searchWord) {
return Vue.axios.get("/admin/audio-content/series/search?search_word=" + searchWord);
}
// 시리즈 수정
async function updateAudioContentSeries(request) {
return Vue.axios.put("/admin/audio-content/series", request);
}
// ========================
// 시리즈 배너 API
// ========================
// 배너 리스트 조회
async function getSeriesBannerList(page = 1, size = 20) {
return Vue.axios.get("/admin/audio-content/series/banner/list", {
params: { page: page - 1, size }
});
}
// 배너 등록
async function createSeriesBanner(bannerData) {
const formData = new FormData();
if (bannerData.image) formData.append("image", bannerData.image);
const requestData = { seriesId: bannerData.seriesId, lang: bannerData.lang };
formData.append("request", JSON.stringify(requestData));
return Vue.axios.post("/admin/audio-content/series/banner/register", formData, {
headers: { "Content-Type": "multipart/form-data" }
});
}
// 배너 수정
async function updateSeriesBanner(bannerData) {
const formData = new FormData();
if (bannerData.image) formData.append("image", bannerData.image);
const requestData = { seriesId: bannerData.seriesId, bannerId: bannerData.bannerId };
formData.append("request", JSON.stringify(requestData));
return Vue.axios.put("/admin/audio-content/series/banner/update", formData, {
headers: { "Content-Type": "multipart/form-data" }
});
}
// 배너 삭제
async function deleteSeriesBanner(bannerId) {
// 백엔드 사양이 불명확하여 쿼리 파라미터로 전송
return Vue.axios.delete("/admin/audio-content/series/banner/" + bannerId);
}
// 배너 순서 변경
async function updateSeriesBannerOrder(ids) {
return Vue.axios.put("/admin/audio-content/series/banner/orders", { ids });
return Vue.axios.get("/admin/audio-content/series/search?search_word=" + searchWord)
}
export {
@@ -78,12 +30,5 @@ export {
createAudioContentSeriesGenre,
updateAudioContentSeriesGenre,
updateAudioContentSeriesGenreOrders,
searchSeriesList,
updateAudioContentSeries,
// series banner
getSeriesBannerList,
createSeriesBanner,
updateSeriesBanner,
deleteSeriesBanner,
updateSeriesBannerOrder
};
searchSeriesList
}

View File

@@ -1,19 +1,19 @@
import Vue from 'vue';
async function getCalculateLive(startDate, endDate, page, size) {
return Vue.axios.get('/admin/calculate/live?startDateStr=' + startDate + '&endDateStr=' + endDate + '&page=' + (page - 1) + '&size=' + size);
async function getCalculateLive(startDate, endDate) {
return Vue.axios.get('/admin/calculate/live?startDateStr=' + startDate + '&endDateStr=' + endDate);
}
async function getCalculateContent(startDate, endDate, page, size) {
return Vue.axios.get('/admin/calculate/content-list?startDateStr=' + startDate + '&endDateStr=' + endDate + '&page=' + (page - 1) + '&size=' + size);
async function getCalculateContent(startDate, endDate) {
return Vue.axios.get('/admin/calculate/content-list?startDateStr=' + startDate + '&endDateStr=' + endDate);
}
async function getCumulativeSalesByContent(page, size) {
return Vue.axios.get('/admin/calculate/cumulative-sales-by-content?page=' + (page - 1) + "&size=" + size);
}
async function getCalculateContentDonation(startDate, endDate, page, size) {
return Vue.axios.get('/admin/calculate/content-donation-list?startDateStr=' + startDate + '&endDateStr=' + endDate + '&page=' + (page - 1) + '&size=' + size);
async function getCalculateContentDonation(startDate, endDate) {
return Vue.axios.get('/admin/calculate/content-donation-list?startDateStr=' + startDate + '&endDateStr=' + endDate);
}
async function getCalculateCommunityPost(startDate, endDate, page, size) {
@@ -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,96 +57,6 @@ async function getCalculateCommunityByCreator(startDate, endDate, page, size) {
)
}
async function getCalculateChannelDonationByCreator(startDate, endDate, page, size) {
return Vue.axios.get('/admin/calculate/channel-donation-by-creator?startDateStr=' +
startDate + '&endDateStr=' + endDate + '&page=' + (page - 1) + '&size=' + size
)
}
async function getCalculateChannelDonationByDate(startDate, endDate, page, size) {
return Vue.axios.get('/admin/calculate/channel-donation-by-date?startDateStr=' +
startDate + '&endDateStr=' + endDate + '&page=' + (page - 1) + '&size=' + size
)
}
async function downloadCalculateChannelDonationByCreatorExcel(startDate, endDate) {
return Vue.axios.get('/admin/calculate/channel-donation-by-creator/excel?startDateStr=' + startDate + '&endDateStr=' + endDate, {
responseType: 'blob'
});
}
async function downloadCalculateLiveExcel(startDate, endDate) {
return Vue.axios.get('/admin/calculate/live/excel?startDateStr=' + startDate + '&endDateStr=' + endDate, {
responseType: 'blob'
});
}
async function downloadCalculateContentExcel(startDate, endDate) {
return Vue.axios.get('/admin/calculate/content-list/excel?startDateStr=' + startDate + '&endDateStr=' + endDate, {
responseType: 'blob'
});
}
async function downloadCalculateContentDonationExcel(startDate, endDate) {
return Vue.axios.get('/admin/calculate/content-donation-list/excel?startDateStr=' + startDate + '&endDateStr=' + endDate, {
responseType: 'blob'
});
}
async function downloadCalculateCommunityPostExcel(startDate, endDate) {
return Vue.axios.get('/admin/calculate/community-post/excel?startDateStr=' + startDate + '&endDateStr=' + endDate, {
responseType: 'blob'
});
}
async function downloadCalculateLiveByCreatorExcel(startDate, endDate) {
return Vue.axios.get('/admin/calculate/live-by-creator/excel?startDateStr=' + startDate + '&endDateStr=' + endDate, {
responseType: 'blob'
});
}
async function downloadCalculateContentByCreatorExcel(startDate, endDate) {
return Vue.axios.get('/admin/calculate/content-by-creator/excel?startDateStr=' + startDate + '&endDateStr=' + endDate, {
responseType: 'blob'
});
}
async function downloadCalculateCommunityByCreatorExcel(startDate, endDate) {
return Vue.axios.get('/admin/calculate/community-by-creator/excel?startDateStr=' + startDate + '&endDateStr=' + endDate, {
responseType: 'blob'
});
}
async function downloadCalculateChannelDonationByDateExcel(startDate, endDate) {
return Vue.axios.get('/admin/calculate/channel-donation-by-date/excel?startDateStr=' + startDate + '&endDateStr=' + endDate, {
responseType: 'blob'
});
}
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);
}
async function refundLive(roomId, canUsageStr) {
const request = {
roomId: roomId,
canUsageStr: canUsageStr
};
return Vue.axios.post('/admin/calculate/live/refund', request);
}
export {
getCalculateLive,
getCalculateContent,
@@ -155,21 +65,7 @@ export {
getCalculateCommunityPost,
getSettlementRatio,
createCreatorSettlementRatio,
updateCreatorSettlementRatio,
deleteCreatorSettlementRatio,
refundLive,
getCalculateLiveByCreator,
getCalculateContentByCreator,
getCalculateCommunityByCreator,
getCalculateChannelDonationByCreator,
getCalculateChannelDonationByDate,
downloadCalculateChannelDonationByCreatorExcel,
downloadCalculateLiveExcel,
downloadCalculateContentExcel,
downloadCalculateContentDonationExcel,
downloadCalculateCommunityPostExcel,
downloadCalculateLiveByCreatorExcel,
downloadCalculateContentByCreatorExcel,
downloadCalculateCommunityByCreatorExcel,
downloadCalculateChannelDonationByDateExcel
getCalculateCommunityByCreator
}

View File

@@ -5,16 +5,16 @@ async function deleteCan(id) {
}
async function getCans() {
return Vue.axios.get('/admin/can');
return Vue.axios.get('/can');
}
async function insertCan(can, rewardCan, price, currency) {
const request = {can: can, rewardCan: rewardCan, price: price, currency}
async function insertCan(can, rewardCan, price) {
const request = {can: can, rewardCan: rewardCan, price: price}
return Vue.axios.post('/admin/can', request);
}
async function paymentCan(can, method, memberIds) {
const request = {memberIds: memberIds, method: method, can: can}
async function paymentCan(can, method, member_id) {
const request = {memberId: member_id, method: method, can: can}
return Vue.axios.post('/admin/can/charge', request)
}

View File

@@ -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}`)
@@ -49,12 +42,12 @@ async function createCharacter(characterData) {
age: toNullIfBlank(characterData.age),
gender: toNullIfBlank(characterData.gender),
mbti: toNullIfBlank(characterData.mbti),
characterType: toNullIfBlank(characterData.characterType),
originalWorkId: characterData.originalWorkId || null,
characterType: toNullIfBlank(characterData.type),
originalTitle: toNullIfBlank(characterData.originalTitle),
originalLink: toNullIfBlank(characterData.originalLink),
speechPattern: toNullIfBlank(characterData.speechPattern),
speechStyle: toNullIfBlank(characterData.speechStyle),
appearance: toNullIfBlank(characterData.appearance),
region: characterData.region || null,
tags: characterData.tags || [],
hobbies: characterData.hobbies || [],
values: characterData.values || [],
@@ -115,10 +108,9 @@ async function createCharacterBanner(bannerData) {
// 이미지 FormData에 추가
if (bannerData.image) formData.append('image', bannerData.image)
// 캐릭터 ID와 언어 코드를 JSON 문자열로 변환하여 request 필드에 추가
// 캐릭터 ID를 JSON 문자열로 변환하여 request 필드에 추가
const requestData = {
characterId: bannerData.characterId,
lang: bannerData.lang
characterId: bannerData.characterId
}
formData.append('request', JSON.stringify(requestData))
@@ -266,7 +258,6 @@ async function getCharacterCalculateList({ startDateStr, endDateStr, sort = 'TOT
export {
getCharacterList,
searchCharacters,
searchCharacterList,
getCharacter,
createCharacter,
updateCharacter,

View File

@@ -4,15 +4,8 @@ async function getChargeStatus(startDate, endDate) {
return Vue.axios.get('/admin/charge/status?startDateStr=' + startDate + '&endDateStr=' + endDate);
}
async function getChargeStatusDetail(startDate, paymentGateway, currency) {
return Vue.axios.get('/admin/charge/status/detail?startDateStr=' + startDate
+ '&paymentGateway=' + paymentGateway
+ '&currency=' + currency
);
async function getChargeStatusDetail(startDate, paymentGateway) {
return Vue.axios.get('/admin/charge/status/detail?startDateStr=' + startDate + '&paymentGateway=' + paymentGateway);
}
async function refundCharge(chargeId) {
return Vue.axios.post('/admin/charge/refund', { chargeId });
}
export { getChargeStatus, getChargeStatusDetail, refundCharge }
export { getChargeStatus, getChargeStatusDetail }

View File

@@ -1,7 +1,7 @@
import Vue from 'vue';
async function login(email, password) {
return Vue.axios.post('/admin/member/login', {
return Vue.axios.post('/member/login', {
email,
password,
isAdmin: true,
@@ -52,37 +52,6 @@ async function resetPassword(id) {
return Vue.axios.post("/admin/member/password/reset", request)
}
async function blockMember(memberId, reason) {
const request = {memberId, reason}
return Vue.axios.post("/admin/member/block", request)
}
/**
* 닉네임으로 회원 검색 API
* - 서버 구현 차이를 흡수하기 위해 nickname, search_word 두 파라미터 모두 전송
* - 응답은 다음 두 형태를 모두 허용하고 배열로 정규화하여 반환
* 1) [{ id, nickname }, ...]
* 2) { data: [{ id, nickname }, ...] }
* @param {string} query
* @returns {Promise<Array<{id:number,nickname:string}>>}
*/
async function searchMembersByNickname(query) {
try {
const res = await Vue.axios.get('/admin/member/search-by-nickname', {
params: { search_word: query }
})
if (res && Array.isArray(res.data)) {
return res.data
}
if (res && res.data && Array.isArray(res.data.data)) {
return res.data.data
}
return []
} catch (e) {
return []
}
}
export {
login,
getMemberList,
@@ -91,7 +60,5 @@ export {
searchCreator,
updateMember,
getCreatorAllList,
resetPassword,
blockMember,
searchMembersByNickname
resetPassword
}

View File

@@ -1,87 +0,0 @@
import Vue from 'vue';
// 공통: 값 그대로 전달 (빈 문자열 유지)
function toNullIfBlank(value) {
if (typeof value === 'string') {
return value.trim() === '' ? null : value;
}
return value === '' ? null : value;
}
// 원작 리스트
export async function getOriginalList(page = 1, size = 20) {
return Vue.axios.get('/admin/chat/original/list', {
params: { page: page - 1, size }
})
}
// 원작 등록
export async function createOriginal(data) {
const formData = new FormData();
if (data.image) formData.append('image', data.image);
const request = {
title: toNullIfBlank(data.title),
contentType: toNullIfBlank(data.contentType),
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 : []
};
formData.append('request', JSON.stringify(request));
return Vue.axios.post('/admin/chat/original/register', formData, {
headers: { 'Content-Type': 'multipart/form-data' }
})
}
// 원작 수정
export async function updateOriginal(data, image = null) {
const formData = new FormData();
if (image) formData.append('image', image);
const processed = {};
Object.keys(data).forEach(key => {
processed[key] = data[key];
})
formData.append('request', JSON.stringify(processed));
return Vue.axios.put('/admin/chat/original/update', formData, {
headers: { 'Content-Type': 'multipart/form-data' }
})
}
// 원작 삭제
export async function deleteOriginal(id) {
return Vue.axios.delete(`/admin/chat/original/${id}`)
}
// 원작 상세
export async function getOriginal(id) {
return Vue.axios.get(`/admin/chat/original/${id}`)
}
// 원작 속 캐릭터 조회
export async function getOriginalCharacters(id, page = 1, size = 20) {
return Vue.axios.get(`/admin/chat/original/${id}/characters`, {
params: { page: page - 1, size }
})
}
// 원작 검색
export async function searchOriginals(searchTerm) {
return Vue.axios.get('/admin/chat/original/search', {
params: { searchTerm }
})
}
// 원작에 캐릭터 연결
export async function assignCharactersToOriginal(id, characterIds = []) {
return Vue.axios.post(`/admin/chat/original/${id}/assign-characters`, { characterIds })
}
// 원작에서 캐릭터 연결 해제
export async function unassignCharactersFromOriginal(id, characterIds = []) {
return Vue.axios.post(`/admin/chat/original/${id}/unassign-characters`, { characterIds })
}

View File

@@ -1,37 +0,0 @@
import Vue from 'vue';
// 소지 유저 조회
async function getOwners() {
return Vue.axios.get('/admin/calculate/original-series/owners');
}
// 정산 내역 조회 (page는 1부터 시작하는 UI 기준, 서버에는 0부터 전달)
async function getSettlementDetails({ startDate, endDate, creatorId, page = 1, size = 10 }) {
const params = new URLSearchParams();
// 서버 파라미터 스펙 변경: start_date, end_date, creator_id
if (startDate) params.append('start_date', startDate);
if (endDate) params.append('end_date', endDate);
if (creatorId != null) params.append("creator_id", creatorId);
params.append('page', Math.max(0, (page || 1) - 1));
params.append('size', size || 10);
return Vue.axios.get(`/admin/calculate/original-series/settlement-details?${params.toString()}`);
}
// 엑셀 다운로드 (xlsx 바이너리)
async function downloadSettlementExcel({ startDate, endDate }) {
const params = new URLSearchParams();
// 서버 파라미터 스펙 변경: start_date, end_date
if (startDate) params.append('start_date', startDate);
if (endDate) params.append('end_date', endDate);
return Vue.axios.get(`/admin/calculate/original-series/settlement-details/excel?${params.toString()}` , {
responseType: 'blob'
});
}
export {
getOwners,
getSettlementDetails,
downloadSettlementExcel,
};

View File

@@ -94,35 +94,8 @@ export default {
this.isLoading = true
try {
let res = await api.getMenus();
if (res.status === 200 && res.data.success === true) {
// 기본 메뉴 설정 (API 결과가 비어있을 수 있음)
this.items = Array.isArray(res.data.data) ? res.data.data : []
// 현재 사용자 역할 확인
const role = (this.$store && this.$store.state && this.$store.state.accountStore && this.$store.state.accountStore.role)
|| localStorage.role
// ADMIN 권한 전용 추가 메뉴들
if (role === 'ADMIN') {
// '시리즈 관리' 메뉴에 '배너 등록' 하위 메뉴 추가
try {
const seriesMenu = this.items.find(m => m && m.title === '시리즈 관리')
if (seriesMenu) {
if (!Array.isArray(seriesMenu.items)) {
seriesMenu.items = seriesMenu.items ? [].concat(seriesMenu.items) : []
}
const exists = seriesMenu.items.some(ci => ci && ci.route === '/content/series/banner')
if (!exists) {
seriesMenu.items.push({
title: '배너 등록',
route: '/content/series/banner',
items: null
})
}
}
} catch (e) {
// ignore
}
if (res.status === 200 && res.data.success === true && res.data.data.length > 0) {
this.items = res.data.data
// 캐릭터 챗봇 메뉴 추가
this.items.push({
@@ -149,81 +122,8 @@ export default {
route: '/character/calculate',
items: null
},
{
title: '원작',
route: '/original-work',
items: null
},
]
})
// 에이전트 관리 메뉴를 '크리에이터 관리' 바로 아래에 추가
try {
const insertAfterTitle = '크리에이터 관리'
const agentMenu = {
title: '에이전트 관리',
route: null,
items: [
{ title: '에이전트 리스트', route: '/agent/list', items: null },
{ title: '에이전트 정산 비율', route: '/agent/settlement-ratio', items: null },
]
}
const idx = this.items.findIndex(m => m && m.title === insertAfterTitle)
if (idx >= 0) {
this.items.splice(idx + 1, 0, agentMenu)
} else {
// 기준 메뉴가 없으면 하단에 추가
this.items.push(agentMenu)
}
} catch (e) {
// ignore
}
// 정산현황 메뉴에 '채널 후원 정산' 및 '오리지널 시리즈 정산' 추가
try {
const calculateMenu = this.items.find(m => m && m.title === '정산현황')
if (calculateMenu) {
if (!Array.isArray(calculateMenu.items)) {
calculateMenu.items = calculateMenu.items ? [].concat(calculateMenu.items) : []
}
const exists = calculateMenu.items.some(ci => ci && ci.route === '/calculate/channel-donation')
if (!exists) {
calculateMenu.items.push({
title: '채널 후원 정산',
route: '/calculate/channel-donation',
items: null
})
}
const existsOriginal = calculateMenu.items.some(ci => ci && ci.route === '/calculate/original-series')
if (!existsOriginal) {
calculateMenu.items.push({
title: '오리지널 시리즈 정산',
route: '/calculate/original-series',
items: null
})
}
}
} catch (e) {
// ignore
}
}
// 조회한 메뉴가 비어 있고, 콘텐츠 매니저라면 기본 메뉴 추가
if (this.items.length === 0 && role === 'CONTENT_MANAGER') {
this.items.push({
title: '콘텐츠 리스트',
route: '/content/list',
items: null
})
}
// 그래도 비어있다면 이전 동작과 동일하게 처리
if (this.items.length === 0) {
this.notifyError("알 수 없는 오류가 발생했습니다. 다시 로그인 해주세요!")
this.logout();
}
} else {
this.notifyError("알 수 없는 오류가 발생했습니다. 다시 로그인 해주세요!")
this.logout();

View File

@@ -50,58 +50,6 @@ const routes = [
name: 'CreatorReview',
component: () => import(/* webpackChunkName: "counselor" */ '../views/Creator/CreatorSettlementRatio.vue')
},
// Agent Management
{
path: '/calculate/original-series',
name: 'OriginalSeriesSettlement',
component: () => import(/* webpackChunkName: "calculate" */ '../views/Calculate/OriginalSeriesSettlement.vue')
},
{
path: '/agent/list',
name: 'AgentList',
component: () => import(/* webpackChunkName: "agent" */ '../views/Agent/AgentList.vue')
},
{
path: '/agent/:agentId/settlement/live',
name: 'AgentSettlementLive',
props: true,
component: () => import(/* webpackChunkName: "agent" */ '../views/Agent/AgentLiveSettlement.vue')
},
{
path: '/agent/:agentId/settlement/content',
name: 'AgentSettlementContent',
props: true,
component: () => import(/* webpackChunkName: "agent" */ '../views/Agent/AgentContentSettlement.vue')
},
{
path: '/agent/:agentId/settlement/community',
name: 'AgentSettlementCommunity',
props: true,
component: () => import(/* webpackChunkName: "agent" */ '../views/Agent/AgentCommunitySettlement.vue')
},
{
path: '/agent/:agentId/settlement/content-donation',
name: 'AgentSettlementContentDonation',
props: true,
component: () => import(/* webpackChunkName: "agent" */ '../views/Agent/AgentContentDonationSettlement.vue')
},
{
path: '/agent/:agentId/settlement/channel-donation',
name: 'AgentSettlementChannelDonation',
props: true,
component: () => import(/* webpackChunkName: "agent" */ '../views/Agent/AgentChannelDonationSettlement.vue')
},
{
path: '/agent/settlement-ratio',
name: 'AgentSettlementRatio',
component: () => import(/* webpackChunkName: "agent" */ '../views/Agent/AgentSettlementRatio.vue')
},
{
path: '/agent/:agentId',
name: 'AgentDetail',
props: true,
component: () => import(/* webpackChunkName: "agent" */ '../views/Agent/AgentDetail.vue')
},
{
path: '/live/tags',
name: 'LiveTags',
@@ -172,11 +120,6 @@ const routes = [
name: 'ContentSeriesRecommendFree',
component: () => import(/* webpackChunkName: "series" */ '../views/Series/ContentSeriesRecommendFree.vue')
},
{
path: '/content/series/banner',
name: 'ContentSeriesBanner',
component: () => import(/* webpackChunkName: "series" */ '../views/Series/ContentSeriesBanner.vue')
},
{
path: '/promotion/event',
name: 'EventView',
@@ -262,16 +205,6 @@ const routes = [
name: 'CalculateCommunityByCreator',
component: () => import(/* webpackChunkName: "calculate" */ '../views/Calculate/CalculateCommunityByCreator.vue')
},
{
path: '/calculate/channel-donation',
name: 'CalculateChannelDonation',
component: () => import(/* webpackChunkName: "calculate" */ '../views/Calculate/CalculateChannelDonation.vue')
},
{
path: '/calculate/channel-donation-by-creator',
name: 'CalculateChannelDonationByCreator',
component: () => import(/* webpackChunkName: "calculate" */ '../views/Calculate/CalculateChannelDonationByCreator.vue')
},
{
path: '/notice',
name: 'NoticeView',
@@ -362,21 +295,6 @@ const routes = [
name: 'CharacterCalculate',
component: () => import(/* webpackChunkName: "character" */ '../views/Chat/CharacterCalculateList.vue')
},
{
path: '/original-work',
name: 'OriginalList',
component: () => import(/* webpackChunkName: "original" */ '../views/Chat/OriginalList.vue')
},
{
path: '/original-work/form',
name: 'OriginalForm',
component: () => import(/* webpackChunkName: "original" */ '../views/Chat/OriginalForm.vue')
},
{
path: '/original-work/detail',
name: 'OriginalDetail',
component: () => import(/* webpackChunkName: "original" */ '../views/Chat/OriginalDetail.vue')
},
]
},
{

View File

@@ -12,13 +12,17 @@ enhanceAccessToken();
const accountStore = {
namespaced: true,
state: {
userId: '',
nickname: '',
accessToken: '',
role: '',
profileImage: '',
},
getters: {
isAuthenticated(state) {
state.userId = state.userId || localStorage.userId
state.nickname = state.nickname || localStorage.nickname
state.profileImage = state.profileImage || localStorage.profileImage
state.accessToken = state.accessToken || localStorage.accessToken
state.role = state.role || localStorage.role
return state.accessToken !== undefined &&
state.accessToken !== null &&
@@ -27,19 +31,27 @@ const accountStore = {
}
},
mutations: {
LOGIN(state, {token, role}) {
LOGIN(state, {userId, nickname, token, profileImage}) {
state.userId = userId
localStorage.userId = userId
state.nickname = nickname
localStorage.nickname = nickname
state.profileImage = profileImage
localStorage.profileImage = profileImage
state.accessToken = token
localStorage.accessToken = token
state.role = role
localStorage.role = role
Vue.axios.defaults.headers.common['Authorization'] = `Bearer ${token}`;
},
LOGOUT(state) {
state.userId = ''
state.nickname = ''
state.profileImage = ''
state.accessToken = ''
state.role = ''
localStorage.clear()
if (location.pathname === '/') {

View File

@@ -1,254 +0,0 @@
<template>
<div>
<v-toolbar dark>
<v-btn
icon
@click="$router.back()"
>
<v-icon>mdi-arrow-left</v-icon>
</v-btn>
<v-toolbar-title>{{ displayNickname }} 정산 상세 - 채널 후원</v-toolbar-title>
<v-spacer />
</v-toolbar>
<v-container>
<!-- 필터 영역 -->
<v-row
class="mt-2 mb-2"
align="center"
justify="end"
>
<v-col
cols="12"
md="3"
>
<v-menu
v-model="menuStart"
:close-on-content-click="false"
transition="scale-transition"
offset-y
min-width="auto"
>
<template v-slot:activator="{ on, attrs }">
<v-text-field
v-bind="attrs"
label="시작일"
readonly
dense
:value="startDateStr"
v-on="on"
/>
</template>
<v-date-picker
v-model="startDateStr"
scrollable
@input="menuStart = false"
/>
</v-menu>
</v-col>
<v-col
cols="12"
md="3"
>
<v-menu
v-model="menuEnd"
:close-on-content-click="false"
transition="scale-transition"
offset-y
min-width="auto"
>
<template v-slot:activator="{ on, attrs }">
<v-text-field
v-bind="attrs"
label="종료일"
readonly
dense
:value="endDateStr"
v-on="on"
/>
</template>
<v-date-picker
v-model="endDateStr"
scrollable
@input="menuEnd = false"
/>
</v-menu>
</v-col>
<v-col
cols="12"
md="2"
>
<v-btn
color="primary"
:loading="isLoading"
@click="onSearch"
>
조회
</v-btn>
</v-col>
</v-row>
<!-- 테이블 영역 -->
<v-data-table
:headers="headers"
:items="items"
:loading="isLoading"
:items-per-page="pageSize"
class="elevation-1"
disable-pagination
hide-default-footer
>
<!-- 최상단 합계 -->
<template v-slot:body.prepend>
<tr>
<td class="text-center">
합계
</td>
<td class="text-center">
{{ numberFormat(total.count) }}
</td>
<td class="text-center">
{{ numberFormat(total.totalCan) }}
</td>
<td class="text-center">
{{ currencyKRW(total.krw) }}
</td>
<td class="text-center">
{{ currencyKRW(total.fee) }}
</td>
<td class="text-center">
{{ currencyKRW(total.settlementAmount) }}
</td>
<td class="text-center">
{{ currencyKRW(total.tax) }}
</td>
<td class="text-center">
{{ currencyKRW(total.depositAmount) }}
</td>
<td class="text-center">
{{ currencyKRW(total.agentSettlementAmount) }}
</td>
</tr>
</template>
<template v-slot:item.count="{ item }">
{{ numberFormat(item.count) }}
</template>
<template v-slot:item.totalCan="{ item }">
{{ numberFormat(item.totalCan) }}
</template>
<template v-slot:item.krw="{ item }">
{{ currencyKRW(item.krw) }}
</template>
<template v-slot:item.fee="{ item }">
{{ currencyKRW(item.fee) }}
</template>
<template v-slot:item.settlementAmount="{ item }">
{{ currencyKRW(item.settlementAmount) }}
</template>
<template v-slot:item.tax="{ item }">
{{ currencyKRW(item.tax) }}
</template>
<template v-slot:item.depositAmount="{ item }">
{{ currencyKRW(item.depositAmount) }}
</template>
<template v-slot:item.agentSettlementAmount="{ item }">
{{ currencyKRW(item.agentSettlementAmount) }}
</template>
</v-data-table>
<!-- 페이지네이션 -->
<div class="d-flex justify-center mt-2">
<v-pagination
v-model="page"
:length="totalPages"
:total-visible="7"
@input="onPageChange"
/>
</div>
</v-container>
</div>
</template>
<script>
import { getAgentChannelDonationSettlementByCreator } from '@/api/agent'
export default {
name: 'AgentChannelDonationSettlement',
props: { agentId: { type: [String, Number], required: true } },
data() {
const today = new Date()
const yyyy = today.getFullYear()
const mm = String(today.getMonth() + 1).padStart(2, '0')
const dd = String(today.getDate()).padStart(2, '0')
const firstDay = `${yyyy}-${mm}-01`
const endDay = `${yyyy}-${mm}-${dd}`
return {
startDateStr: firstDay,
endDateStr: endDay,
menuStart: false,
menuEnd: false,
page: 1,
pageSize: 20,
isLoading: false,
totalCount: 0,
totalPages: 1,
total: { count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0 },
items: [],
headers: [
{ text: '닉네임', value: 'creatorNickname', align: 'center' },
{ text: '건수', value: 'count', align: 'center', width: 100 },
{ text: '총 CAN', value: 'totalCan', align: 'center', width: 120 },
{ text: '원화', value: 'krw', align: 'center', width: 140 },
{ text: '수수료', value: 'fee', align: 'center', width: 120 },
{ text: '정산금액', value: 'settlementAmount', align: 'center', width: 140 },
{ text: '세금', value: 'tax', align: 'center', width: 120 },
{ text: '입금액', value: 'depositAmount', align: 'center', width: 140 },
{ text: '에이전트 정산', value: 'agentSettlementAmount', align: 'center', width: 160 },
]
}
},
computed: {
displayNickname() {
const q = (this.$route && this.$route.query) || {}
return q.nickname || '에이전트'
}
},
mounted() { this.fetchList() },
methods: {
numberFormat(n) { return new Intl.NumberFormat('ko-KR').format(Number(n || 0)) },
currencyKRW(n) { return new Intl.NumberFormat('ko-KR', { style: 'currency', currency: 'KRW', maximumFractionDigits: 0 }).format(Number(n || 0)) },
onSearch() { this.page = 1; this.fetchList() },
onPageChange() { this.fetchList() },
async fetchList() {
this.isLoading = true
try {
const res = await getAgentChannelDonationSettlementByCreator(this.agentId, {
startDateStr: this.startDateStr,
endDateStr: this.endDateStr,
page: this.page,
size: this.pageSize,
})
let payload = res && res.data ? res.data : null
if (payload && payload.data && (!payload.items && !payload.totalCount)) payload = payload.data
const data = payload || { totalCount: 0, total: {}, items: [] }
this.totalCount = Number(data.totalCount || 0)
this.totalPages = Math.max(1, Math.ceil(this.totalCount / this.pageSize))
const defTotal = { count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0 }
this.total = Object.assign({}, defTotal, data.total || {})
this.items = Array.isArray(data.items) ? data.items : []
} catch (e) {
this.totalCount = 0
this.totalPages = 1
this.total = { count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0 }
this.items = []
} finally {
this.isLoading = false
}
}
}
}
</script>
<style scoped>
</style>

View File

@@ -1,254 +0,0 @@
<template>
<div>
<v-toolbar dark>
<v-btn
icon
@click="$router.back()"
>
<v-icon>mdi-arrow-left</v-icon>
</v-btn>
<v-toolbar-title>{{ displayNickname }} 정산 상세 - 커뮤니티</v-toolbar-title>
<v-spacer />
</v-toolbar>
<v-container>
<!-- 필터 영역 -->
<v-row
class="mt-2 mb-2"
align="center"
justify="end"
>
<v-col
cols="12"
md="3"
>
<v-menu
v-model="menuStart"
:close-on-content-click="false"
transition="scale-transition"
offset-y
min-width="auto"
>
<template v-slot:activator="{ on, attrs }">
<v-text-field
v-bind="attrs"
label="시작일"
readonly
dense
:value="startDateStr"
v-on="on"
/>
</template>
<v-date-picker
v-model="startDateStr"
scrollable
@input="menuStart = false"
/>
</v-menu>
</v-col>
<v-col
cols="12"
md="3"
>
<v-menu
v-model="menuEnd"
:close-on-content-click="false"
transition="scale-transition"
offset-y
min-width="auto"
>
<template v-slot:activator="{ on, attrs }">
<v-text-field
v-bind="attrs"
label="종료일"
readonly
dense
:value="endDateStr"
v-on="on"
/>
</template>
<v-date-picker
v-model="endDateStr"
scrollable
@input="menuEnd = false"
/>
</v-menu>
</v-col>
<v-col
cols="12"
md="2"
>
<v-btn
color="primary"
:loading="isLoading"
@click="onSearch"
>
조회
</v-btn>
</v-col>
</v-row>
<!-- 테이블 영역 -->
<v-data-table
:headers="headers"
:items="items"
:loading="isLoading"
:items-per-page="pageSize"
class="elevation-1"
disable-pagination
hide-default-footer
>
<!-- 최상단 합계 -->
<template v-slot:body.prepend>
<tr>
<td class="text-center">
합계
</td>
<td class="text-center">
{{ numberFormat(total.count) }}
</td>
<td class="text-center">
{{ numberFormat(total.totalCan) }}
</td>
<td class="text-center">
{{ currencyKRW(total.krw) }}
</td>
<td class="text-center">
{{ currencyKRW(total.fee) }}
</td>
<td class="text-center">
{{ currencyKRW(total.settlementAmount) }}
</td>
<td class="text-center">
{{ currencyKRW(total.tax) }}
</td>
<td class="text-center">
{{ currencyKRW(total.depositAmount) }}
</td>
<td class="text-center">
{{ currencyKRW(total.agentSettlementAmount) }}
</td>
</tr>
</template>
<template v-slot:item.count="{ item }">
{{ numberFormat(item.count) }}
</template>
<template v-slot:item.totalCan="{ item }">
{{ numberFormat(item.totalCan) }}
</template>
<template v-slot:item.krw="{ item }">
{{ currencyKRW(item.krw) }}
</template>
<template v-slot:item.fee="{ item }">
{{ currencyKRW(item.fee) }}
</template>
<template v-slot:item.settlementAmount="{ item }">
{{ currencyKRW(item.settlementAmount) }}
</template>
<template v-slot:item.tax="{ item }">
{{ currencyKRW(item.tax) }}
</template>
<template v-slot:item.depositAmount="{ item }">
{{ currencyKRW(item.depositAmount) }}
</template>
<template v-slot:item.agentSettlementAmount="{ item }">
{{ currencyKRW(item.agentSettlementAmount) }}
</template>
</v-data-table>
<!-- 페이지네이션 -->
<div class="d-flex justify-center mt-2">
<v-pagination
v-model="page"
:length="totalPages"
:total-visible="7"
@input="onPageChange"
/>
</div>
</v-container>
</div>
</template>
<script>
import { getAgentCommunitySettlementByCreator } from '@/api/agent'
export default {
name: 'AgentCommunitySettlement',
props: { agentId: { type: [String, Number], required: true } },
data() {
const today = new Date()
const yyyy = today.getFullYear()
const mm = String(today.getMonth() + 1).padStart(2, '0')
const dd = String(today.getDate()).padStart(2, '0')
const firstDay = `${yyyy}-${mm}-01`
const endDay = `${yyyy}-${mm}-${dd}`
return {
startDateStr: firstDay,
endDateStr: endDay,
menuStart: false,
menuEnd: false,
page: 1,
pageSize: 20,
isLoading: false,
totalCount: 0,
totalPages: 1,
total: { count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0 },
items: [],
headers: [
{ text: '닉네임', value: 'creatorNickname', align: 'center' },
{ text: '건수', value: 'count', align: 'center', width: 100 },
{ text: '총 CAN', value: 'totalCan', align: 'center', width: 120 },
{ text: '원화', value: 'krw', align: 'center', width: 140 },
{ text: '수수료', value: 'fee', align: 'center', width: 120 },
{ text: '정산금액', value: 'settlementAmount', align: 'center', width: 140 },
{ text: '세금', value: 'tax', align: 'center', width: 120 },
{ text: '입금액', value: 'depositAmount', align: 'center', width: 140 },
{ text: '에이전트 정산', value: 'agentSettlementAmount', align: 'center', width: 160 },
]
}
},
computed: {
displayNickname() {
const q = (this.$route && this.$route.query) || {}
return q.nickname || '에이전트'
}
},
mounted() { this.fetchList() },
methods: {
numberFormat(n) { return new Intl.NumberFormat('ko-KR').format(Number(n || 0)) },
currencyKRW(n) { return new Intl.NumberFormat('ko-KR', { style: 'currency', currency: 'KRW', maximumFractionDigits: 0 }).format(Number(n || 0)) },
onSearch() { this.page = 1; this.fetchList() },
onPageChange() { this.fetchList() },
async fetchList() {
this.isLoading = true
try {
const res = await getAgentCommunitySettlementByCreator(this.agentId, {
startDateStr: this.startDateStr,
endDateStr: this.endDateStr,
page: this.page,
size: this.pageSize,
})
let payload = res && res.data ? res.data : null
if (payload && payload.data && (!payload.items && !payload.totalCount)) payload = payload.data
const data = payload || { totalCount: 0, total: {}, items: [] }
this.totalCount = Number(data.totalCount || 0)
this.totalPages = Math.max(1, Math.ceil(this.totalCount / this.pageSize))
const defTotal = { count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0 }
this.total = Object.assign({}, defTotal, data.total || {})
this.items = Array.isArray(data.items) ? data.items : []
} catch (e) {
this.totalCount = 0
this.totalPages = 1
this.total = { count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0 }
this.items = []
} finally {
this.isLoading = false
}
}
}
}
</script>
<style scoped>
</style>

View File

@@ -1,254 +0,0 @@
<template>
<div>
<v-toolbar dark>
<v-btn
icon
@click="$router.back()"
>
<v-icon>mdi-arrow-left</v-icon>
</v-btn>
<v-toolbar-title>{{ displayNickname }} 정산 상세 - 콘텐츠 후원</v-toolbar-title>
<v-spacer />
</v-toolbar>
<v-container>
<!-- 필터 영역 -->
<v-row
class="mt-2 mb-2"
align="center"
justify="end"
>
<v-col
cols="12"
md="3"
>
<v-menu
v-model="menuStart"
:close-on-content-click="false"
transition="scale-transition"
offset-y
min-width="auto"
>
<template v-slot:activator="{ on, attrs }">
<v-text-field
v-bind="attrs"
label="시작일"
readonly
dense
:value="startDateStr"
v-on="on"
/>
</template>
<v-date-picker
v-model="startDateStr"
scrollable
@input="menuStart = false"
/>
</v-menu>
</v-col>
<v-col
cols="12"
md="3"
>
<v-menu
v-model="menuEnd"
:close-on-content-click="false"
transition="scale-transition"
offset-y
min-width="auto"
>
<template v-slot:activator="{ on, attrs }">
<v-text-field
v-bind="attrs"
label="종료일"
readonly
dense
:value="endDateStr"
v-on="on"
/>
</template>
<v-date-picker
v-model="endDateStr"
scrollable
@input="menuEnd = false"
/>
</v-menu>
</v-col>
<v-col
cols="12"
md="2"
>
<v-btn
color="primary"
:loading="isLoading"
@click="onSearch"
>
조회
</v-btn>
</v-col>
</v-row>
<!-- 테이블 영역 -->
<v-data-table
:headers="headers"
:items="items"
:loading="isLoading"
:items-per-page="pageSize"
class="elevation-1"
disable-pagination
hide-default-footer
>
<!-- 최상단 합계 -->
<template v-slot:body.prepend>
<tr>
<td class="text-center">
합계
</td>
<td class="text-center">
{{ numberFormat(total.count) }}
</td>
<td class="text-center">
{{ numberFormat(total.totalCan) }}
</td>
<td class="text-center">
{{ currencyKRW(total.krw) }}
</td>
<td class="text-center">
{{ currencyKRW(total.fee) }}
</td>
<td class="text-center">
{{ currencyKRW(total.settlementAmount) }}
</td>
<td class="text-center">
{{ currencyKRW(total.tax) }}
</td>
<td class="text-center">
{{ currencyKRW(total.depositAmount) }}
</td>
<td class="text-center">
{{ currencyKRW(total.agentSettlementAmount) }}
</td>
</tr>
</template>
<template v-slot:item.count="{ item }">
{{ numberFormat(item.count) }}
</template>
<template v-slot:item.totalCan="{ item }">
{{ numberFormat(item.totalCan) }}
</template>
<template v-slot:item.krw="{ item }">
{{ currencyKRW(item.krw) }}
</template>
<template v-slot:item.fee="{ item }">
{{ currencyKRW(item.fee) }}
</template>
<template v-slot:item.settlementAmount="{ item }">
{{ currencyKRW(item.settlementAmount) }}
</template>
<template v-slot:item.tax="{ item }">
{{ currencyKRW(item.tax) }}
</template>
<template v-slot:item.depositAmount="{ item }">
{{ currencyKRW(item.depositAmount) }}
</template>
<template v-slot:item.agentSettlementAmount="{ item }">
{{ currencyKRW(item.agentSettlementAmount) }}
</template>
</v-data-table>
<!-- 페이지네이션 -->
<div class="d-flex justify-center mt-2">
<v-pagination
v-model="page"
:length="totalPages"
:total-visible="7"
@input="onPageChange"
/>
</div>
</v-container>
</div>
</template>
<script>
import { getAgentContentDonationSettlementByCreator } from '@/api/agent'
export default {
name: 'AgentContentDonationSettlement',
props: { agentId: { type: [String, Number], required: true } },
data() {
const today = new Date()
const yyyy = today.getFullYear()
const mm = String(today.getMonth() + 1).padStart(2, '0')
const dd = String(today.getDate()).padStart(2, '0')
const firstDay = `${yyyy}-${mm}-01`
const endDay = `${yyyy}-${mm}-${dd}`
return {
startDateStr: firstDay,
endDateStr: endDay,
menuStart: false,
menuEnd: false,
page: 1,
pageSize: 20,
isLoading: false,
totalCount: 0,
totalPages: 1,
total: { count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0 },
items: [],
headers: [
{ text: '닉네임', value: 'creatorNickname', align: 'center' },
{ text: '건수', value: 'count', align: 'center', width: 100 },
{ text: '총 CAN', value: 'totalCan', align: 'center', width: 120 },
{ text: '원화', value: 'krw', align: 'center', width: 140 },
{ text: '수수료', value: 'fee', align: 'center', width: 120 },
{ text: '정산금액', value: 'settlementAmount', align: 'center', width: 140 },
{ text: '세금', value: 'tax', align: 'center', width: 120 },
{ text: '입금액', value: 'depositAmount', align: 'center', width: 140 },
{ text: '에이전트 정산', value: 'agentSettlementAmount', align: 'center', width: 160 },
]
}
},
computed: {
displayNickname() {
const q = (this.$route && this.$route.query) || {}
return q.nickname || '에이전트'
}
},
mounted() { this.fetchList() },
methods: {
numberFormat(n) { return new Intl.NumberFormat('ko-KR').format(Number(n || 0)) },
currencyKRW(n) { return new Intl.NumberFormat('ko-KR', { style: 'currency', currency: 'KRW', maximumFractionDigits: 0 }).format(Number(n || 0)) },
onSearch() { this.page = 1; this.fetchList() },
onPageChange() { this.fetchList() },
async fetchList() {
this.isLoading = true
try {
const res = await getAgentContentDonationSettlementByCreator(this.agentId, {
startDateStr: this.startDateStr,
endDateStr: this.endDateStr,
page: this.page,
size: this.pageSize,
})
let payload = res && res.data ? res.data : null
if (payload && payload.data && (!payload.items && !payload.totalCount)) payload = payload.data
const data = payload || { totalCount: 0, total: {}, items: [] }
this.totalCount = Number(data.totalCount || 0)
this.totalPages = Math.max(1, Math.ceil(this.totalCount / this.pageSize))
const defTotal = { count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0 }
this.total = Object.assign({}, defTotal, data.total || {})
this.items = Array.isArray(data.items) ? data.items : []
} catch (e) {
this.totalCount = 0
this.totalPages = 1
this.total = { count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0 }
this.items = []
} finally {
this.isLoading = false
}
}
}
}
</script>
<style scoped>
</style>

View File

@@ -1,254 +0,0 @@
<template>
<div>
<v-toolbar dark>
<v-btn
icon
@click="$router.back()"
>
<v-icon>mdi-arrow-left</v-icon>
</v-btn>
<v-toolbar-title>{{ displayNickname }} 정산 상세 - 콘텐츠</v-toolbar-title>
<v-spacer />
</v-toolbar>
<v-container>
<!-- 필터 영역 -->
<v-row
class="mt-2 mb-2"
align="center"
justify="end"
>
<v-col
cols="12"
md="3"
>
<v-menu
v-model="menuStart"
:close-on-content-click="false"
transition="scale-transition"
offset-y
min-width="auto"
>
<template v-slot:activator="{ on, attrs }">
<v-text-field
v-bind="attrs"
label="시작일"
readonly
dense
:value="startDateStr"
v-on="on"
/>
</template>
<v-date-picker
v-model="startDateStr"
scrollable
@input="menuStart = false"
/>
</v-menu>
</v-col>
<v-col
cols="12"
md="3"
>
<v-menu
v-model="menuEnd"
:close-on-content-click="false"
transition="scale-transition"
offset-y
min-width="auto"
>
<template v-slot:activator="{ on, attrs }">
<v-text-field
v-bind="attrs"
label="종료일"
readonly
dense
:value="endDateStr"
v-on="on"
/>
</template>
<v-date-picker
v-model="endDateStr"
scrollable
@input="menuEnd = false"
/>
</v-menu>
</v-col>
<v-col
cols="12"
md="2"
>
<v-btn
color="primary"
:loading="isLoading"
@click="onSearch"
>
조회
</v-btn>
</v-col>
</v-row>
<!-- 테이블 영역 -->
<v-data-table
:headers="headers"
:items="items"
:loading="isLoading"
:items-per-page="pageSize"
class="elevation-1"
disable-pagination
hide-default-footer
>
<!-- 최상단 합계 -->
<template v-slot:body.prepend>
<tr>
<td class="text-center">
합계
</td>
<td class="text-center">
{{ numberFormat(total.count) }}
</td>
<td class="text-center">
{{ numberFormat(total.totalCan) }}
</td>
<td class="text-center">
{{ currencyKRW(total.krw) }}
</td>
<td class="text-center">
{{ currencyKRW(total.fee) }}
</td>
<td class="text-center">
{{ currencyKRW(total.settlementAmount) }}
</td>
<td class="text-center">
{{ currencyKRW(total.tax) }}
</td>
<td class="text-center">
{{ currencyKRW(total.depositAmount) }}
</td>
<td class="text-center">
{{ currencyKRW(total.agentSettlementAmount) }}
</td>
</tr>
</template>
<template v-slot:item.count="{ item }">
{{ numberFormat(item.count) }}
</template>
<template v-slot:item.totalCan="{ item }">
{{ numberFormat(item.totalCan) }}
</template>
<template v-slot:item.krw="{ item }">
{{ currencyKRW(item.krw) }}
</template>
<template v-slot:item.fee="{ item }">
{{ currencyKRW(item.fee) }}
</template>
<template v-slot:item.settlementAmount="{ item }">
{{ currencyKRW(item.settlementAmount) }}
</template>
<template v-slot:item.tax="{ item }">
{{ currencyKRW(item.tax) }}
</template>
<template v-slot:item.depositAmount="{ item }">
{{ currencyKRW(item.depositAmount) }}
</template>
<template v-slot:item.agentSettlementAmount="{ item }">
{{ currencyKRW(item.agentSettlementAmount) }}
</template>
</v-data-table>
<!-- 페이지네이션 -->
<div class="d-flex justify-center mt-2">
<v-pagination
v-model="page"
:length="totalPages"
:total-visible="7"
@input="onPageChange"
/>
</div>
</v-container>
</div>
</template>
<script>
import { getAgentContentSettlementByCreator } from '@/api/agent'
export default {
name: 'AgentContentSettlement',
props: { agentId: { type: [String, Number], required: true } },
data() {
const today = new Date()
const yyyy = today.getFullYear()
const mm = String(today.getMonth() + 1).padStart(2, '0')
const dd = String(today.getDate()).padStart(2, '0')
const firstDay = `${yyyy}-${mm}-01`
const endDay = `${yyyy}-${mm}-${dd}`
return {
startDateStr: firstDay,
endDateStr: endDay,
menuStart: false,
menuEnd: false,
page: 1,
pageSize: 20,
isLoading: false,
totalCount: 0,
totalPages: 1,
total: { count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0 },
items: [],
headers: [
{ text: '닉네임', value: 'creatorNickname', align: 'center' },
{ text: '건수', value: 'count', align: 'center', width: 100 },
{ text: '총 CAN', value: 'totalCan', align: 'center', width: 120 },
{ text: '원화', value: 'krw', align: 'center', width: 140 },
{ text: '수수료', value: 'fee', align: 'center', width: 120 },
{ text: '정산금액', value: 'settlementAmount', align: 'center', width: 140 },
{ text: '세금', value: 'tax', align: 'center', width: 120 },
{ text: '입금액', value: 'depositAmount', align: 'center', width: 140 },
{ text: '에이전트 정산', value: 'agentSettlementAmount', align: 'center', width: 160 },
]
}
},
computed: {
displayNickname() {
const q = (this.$route && this.$route.query) || {}
return q.nickname || '에이전트'
}
},
mounted() { this.fetchList() },
methods: {
numberFormat(n) { return new Intl.NumberFormat('ko-KR').format(Number(n || 0)) },
currencyKRW(n) { return new Intl.NumberFormat('ko-KR', { style: 'currency', currency: 'KRW', maximumFractionDigits: 0 }).format(Number(n || 0)) },
onSearch() { this.page = 1; this.fetchList() },
onPageChange() { this.fetchList() },
async fetchList() {
this.isLoading = true
try {
const res = await getAgentContentSettlementByCreator(this.agentId, {
startDateStr: this.startDateStr,
endDateStr: this.endDateStr,
page: this.page,
size: this.pageSize,
})
let payload = res && res.data ? res.data : null
if (payload && payload.data && (!payload.items && !payload.totalCount)) payload = payload.data
const data = payload || { totalCount: 0, total: {}, items: [] }
this.totalCount = Number(data.totalCount || 0)
this.totalPages = Math.max(1, Math.ceil(this.totalCount / this.pageSize))
const defTotal = { count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0 }
this.total = Object.assign({}, defTotal, data.total || {})
this.items = Array.isArray(data.items) ? data.items : []
} catch (e) {
this.totalCount = 0
this.totalPages = 1
this.total = { count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0 }
this.items = []
} finally {
this.isLoading = false
}
}
}
}
</script>
<style scoped>
</style>

View File

@@ -1,515 +0,0 @@
<template>
<div>
<v-toolbar dark>
<v-btn
icon
@click="$router.back()"
>
<v-icon>mdi-arrow-left</v-icon>
</v-btn>
<v-toolbar-title>{{ (agentNickname || '-') + ' 소속 크리에이터' }}</v-toolbar-title>
<v-spacer />
<v-btn
color="#3bb9f1"
dark
:loading="assignDialog.loading"
@click="openAssignDialog"
>
소속 추가
</v-btn>
</v-toolbar>
<br>
<v-container>
<!-- 소속 크리에이터 목록 -->
<v-row>
<v-col>
<v-simple-table class="elevation-10">
<template>
<thead>
<tr>
<th class="text-center">
닉네임
</th>
<th class="text-center">
소속일
</th>
<th class="text-center">
관리
</th>
</tr>
</thead>
<tbody>
<tr v-if="is_loading">
<td
colspan="3"
class="text-center"
>
불러오는 ...
</td>
</tr>
<tr v-else-if="items.length === 0">
<td
colspan="3"
class="text-center"
>
소속된 크리에이터가 없습니다.
</td>
</tr>
<tr
v-for="row in items"
:key="row.creatorId"
>
<td class="text-center">
{{ row.creatorNickname }}
</td>
<td class="text-center">
{{ formatDateTime(row.assignedAt) }}
</td>
<td class="text-center">
<v-btn
text
small
color="error"
@click="openUnassignDialog(row)"
>
소속 해제
</v-btn>
</td>
</tr>
</tbody>
</template>
</v-simple-table>
</v-col>
</v-row>
<v-row
v-if="total_page > 1"
class="text-center"
>
<v-col>
<v-pagination
v-model="page"
:length="total_page"
circle
@input="fetchList"
/>
</v-col>
</v-row>
</v-container>
<!-- 소속 추가 다이얼로그 -->
<v-dialog
v-model="assignDialog.visible"
max-width="600px"
>
<v-card>
<v-card-title>크리에이터 소속 추가</v-card-title>
<v-card-text>
<v-autocomplete
v-model="assignDialog.selectedCreatorId"
:items="assignDialog.searchItems"
:loading="assignDialog.searchLoading"
:search-input.sync="assignDialog.searchQuery"
hide-no-data
hide-selected
clearable
label="크리에이터 검색"
item-text="creatorNickname"
item-value="creatorId"
@update:search-input="onSearchCreators"
/>
<v-menu
ref="menuAssignedDate"
v-model="assignDialog.menu"
:close-on-content-click="false"
transition="scale-transition"
offset-y
min-width="auto"
>
<template v-slot:activator="{ on, attrs }">
<v-text-field
v-model="assignDialog.assignedDate"
label="소속 날짜(자정으로 처리)"
readonly
dense
v-bind="attrs"
clearable
v-on="on"
/>
</template>
<v-date-picker
v-model="assignDialog.assignedDate"
locale="ko-kr"
@input="$refs.menuAssignedDate.save(assignDialog.assignedDate)"
/>
</v-menu>
</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn
text
@click="closeAssignDialog"
>
취소
</v-btn>
<v-btn
color="primary"
:disabled="!canAssign"
:loading="assignDialog.loading"
@click="onAssign"
>
추가
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<!-- 소속 해제 다이얼로그 -->
<v-dialog
v-model="unassignDialog.visible"
max-width="600px"
>
<v-card>
<v-card-title>소속 해제</v-card-title>
<v-card-text>
<div class="mb-3">
크리에이터: <strong>{{ unassignDialog.target && unassignDialog.target.creatorNickname || '-' }}</strong>
</div>
<v-menu
ref="menuUnassignDate"
v-model="unassignDialog.menuDate"
:close-on-content-click="false"
transition="scale-transition"
offset-y
min-width="auto"
>
<template v-slot:activator="{ on, attrs }">
<v-text-field
v-model="unassignDialog.date"
label="해제 날짜"
readonly
dense
v-bind="attrs"
clearable
v-on="on"
/>
</template>
<v-date-picker
v-model="unassignDialog.date"
locale="ko-kr"
@input="$refs.menuUnassignDate.save(unassignDialog.date)"
/>
</v-menu>
<v-menu
ref="menuUnassignTime"
v-model="unassignDialog.menuTime"
:close-on-content-click="false"
transition="scale-transition"
offset-y
min-width="290px"
>
<template v-slot:activator="{ on, attrs }">
<v-text-field
v-model="unassignDialog.time"
label="해제 시간(시:분)"
readonly
dense
v-bind="attrs"
clearable
v-on="on"
/>
</template>
<v-time-picker
v-if="unassignDialog.menuTime"
v-model="unassignDialog.time"
format="24hr"
full-width
@click:minute="$refs.menuUnassignTime.save(unassignDialog.time)"
/>
</v-menu>
</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn
text
@click="closeUnassignDialog"
>
취소
</v-btn>
<v-btn
color="error"
:disabled="!canUnassign"
:loading="unassignDialog.loading"
@click="onUnassign"
>
해제
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</div>
</template>
<script>
import {
getAgentAssignedCreatorList,
searchAdminAgentAssignableCreators,
assignAgentCreator,
removeAgentCreator
} from '@/api/agent'
export default {
name: 'AgentDetail',
props: {
agentId: {
type: [String, Number],
required: true
}
},
data() {
return {
agentNickname: this.$route && this.$route.query ? this.$route.query.nickname : '',
is_loading: false,
items: [],
totalCount: 0,
page: 1,
page_size: 20,
assignDialog: {
visible: false,
loading: false,
selectedCreatorId: null,
assignedDate: this.todayStr(),
menu: false,
searchQuery: '',
searchItems: [],
searchLoading: false,
// 디바운스 타이머 보관
searchDebounceTimer: null,
},
unassignDialog: {
visible: false,
loading: false,
target: null,
date: this.todayStr(),
time: this.nowTimeHHmm(),
menuDate: false,
menuTime: false,
},
}
},
computed: {
total_page() {
return Math.max(1, Math.ceil((this.totalCount || 0) / this.page_size))
},
canAssign() {
return !!(this.assignDialog.selectedCreatorId && this.assignDialog.assignedDate)
},
canUnassign() {
return !!(this.unassignDialog.target && this.unassignDialog.date && this.unassignDialog.time)
}
},
created() {
this.fetchList(1)
},
beforeDestroy() {
// 검색 디바운스 타이머 정리
if (this.assignDialog && this.assignDialog.searchDebounceTimer) {
clearTimeout(this.assignDialog.searchDebounceTimer)
this.assignDialog.searchDebounceTimer = null
}
},
methods: {
notifyError(message) {
// vuetify-dialog 플러그인을 통해 오류 노출
if (this.$dialog && this.$dialog.notify && this.$dialog.notify.error) {
this.$dialog.notify.error(message)
}
},
getErrorMessage(e) {
const fallback = '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.'
try {
if (!e) return fallback
// axios 형태의 에러 응답을 우선 사용
const msg = (e.response && e.response.data && (e.response.data.message || e.response.data.error || e.response.data.msg))
|| e.message
return msg || fallback
} catch (_) {
return fallback
}
},
async fetchList(page = this.page) {
if (this.is_loading) return
this.is_loading = true
try {
this.page = page
const res = await getAgentAssignedCreatorList(this.agentId, Math.max(1, this.page), this.page_size)
if (res && res.status === 200 && res.data && res.data.success === true) {
const data = (res.data && res.data.data) || { totalCount: 0, items: [] }
this.totalCount = data.totalCount || 0
this.items = Array.isArray(data.items) ? data.items : []
} else {
const msg = res && res.data && (res.data.message || res.data.error || res.data.msg)
this.notifyError(msg || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
}
} catch (e) {
this.totalCount = 0
this.items = []
this.notifyError(this.getErrorMessage(e))
} finally {
this.is_loading = false
}
},
openAssignDialog() {
this.assignDialog.visible = true
this.assignDialog.selectedCreatorId = null
this.assignDialog.assignedDate = this.todayStr()
this.assignDialog.searchQuery = ''
this.assignDialog.searchItems = []
},
closeAssignDialog() {
this.assignDialog.visible = false
// 다이얼로그 닫힐 때 디바운스 및 로딩 상태 초기화
if (this.assignDialog.searchDebounceTimer) {
clearTimeout(this.assignDialog.searchDebounceTimer)
this.assignDialog.searchDebounceTimer = null
}
this.assignDialog.searchLoading = false
},
onSearchCreators(q) {
const query = (q || '').trim()
this.assignDialog.searchQuery = query
// 기존 타이머가 있으면 취소
if (this.assignDialog.searchDebounceTimer) {
clearTimeout(this.assignDialog.searchDebounceTimer)
this.assignDialog.searchDebounceTimer = null
}
if (!query) {
// 검색어 없으면 결과/로딩 초기화
this.assignDialog.searchItems = []
this.assignDialog.searchLoading = false
return
}
// 디바운스: 300ms 이후 최신 검색어로 요청
this.assignDialog.searchDebounceTimer = setTimeout(async () => {
// 요청 직전 로딩 시작
this.assignDialog.searchLoading = true
const currentQuery = this.assignDialog.searchQuery
try {
const res = await searchAdminAgentAssignableCreators(currentQuery)
// 사용자가 그 사이에 검색어를 바꿨다면 이 응답은 무시
if (this.assignDialog.searchQuery !== currentQuery) return
if (res && res.status === 200 && res.data && res.data.success === true) {
const data = (res.data && res.data.data) || { totalCount: 0, items: [] }
this.assignDialog.searchItems = Array.isArray(data.items) ? data.items : []
} else {
this.assignDialog.searchItems = []
const msg = res && res.data && (res.data.message || res.data.error || res.data.msg)
this.notifyError(msg || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
}
} catch (e) {
// 에러 시에도 최신 검색어와 일치할 때만 처리
if (this.assignDialog.searchQuery === currentQuery) {
this.assignDialog.searchItems = []
this.notifyError(this.getErrorMessage(e))
}
} finally {
// 최신 검색어와 일치할 때만 로딩 해제
if (this.assignDialog.searchQuery === currentQuery) {
this.assignDialog.searchLoading = false
}
}
}, 300)
},
async onAssign() {
if (!this.canAssign) return
this.assignDialog.loading = true
try {
const assignedAt = `${this.assignDialog.assignedDate}T00:00:00`
const res = await assignAgentCreator({
agentId: Number(this.agentId),
creatorId: Number(this.assignDialog.selectedCreatorId),
assignedAt,
})
if (res && res.status === 200 && res.data && res.data.success === true) {
this.closeAssignDialog()
this.fetchList(1)
} else {
const msg = res && res.data && (res.data.message || res.data.error || res.data.msg)
this.notifyError(msg || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
}
} catch (e) {
this.notifyError(this.getErrorMessage(e))
} finally {
this.assignDialog.loading = false
}
},
openUnassignDialog(row) {
this.unassignDialog.visible = true
this.unassignDialog.loading = false
this.unassignDialog.target = row
this.unassignDialog.date = this.todayStr()
this.unassignDialog.time = this.nowTimeHHmm()
},
closeUnassignDialog() {
this.unassignDialog.visible = false
},
async onUnassign() {
if (!this.canUnassign) return
this.unassignDialog.loading = true
try {
const time = this.unassignDialog.time || '00:00'
const unassignedAt = `${this.unassignDialog.date}T${time}:00`
const res = await removeAgentCreator({
creatorId: Number(this.unassignDialog.target.creatorId),
unassignedAt,
})
if (res && res.status === 200 && res.data && res.data.success === true) {
this.closeUnassignDialog()
this.fetchList(this.page)
} else {
const msg = res && res.data && (res.data.message || res.data.error || res.data.msg)
this.notifyError(msg || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
}
} catch (e) {
this.notifyError(this.getErrorMessage(e))
} finally {
this.unassignDialog.loading = false
}
},
formatDateTime(s) {
if (!s) return '-'
try {
// s는 LocalDateTime 문자열(예: 2026-01-01T00:00:00)
const [d, t] = String(s).split('T')
const hhmm = (t || '').slice(0,5)
return `${d} ${hhmm}`
} catch (e) {
return s
}
},
todayStr() {
const d = new Date()
const mm = String(d.getMonth() + 1).padStart(2, '0')
const dd = String(d.getDate()).padStart(2, '0')
return `${d.getFullYear()}-${mm}-${dd}`
},
nowTimeHHmm() {
const d = new Date()
const hh = String(d.getHours()).padStart(2, '0')
const mm = String(d.getMinutes()).padStart(2, '0')
return `${hh}:${mm}`
}
}
}
</script>

View File

@@ -1,242 +0,0 @@
<template>
<div>
<v-toolbar dark>
<v-spacer />
<v-toolbar-title>에이전트 리스트</v-toolbar-title>
<v-spacer />
</v-toolbar>
<br>
<v-container>
<v-row>
<v-col
cols="6"
class="text-left"
>
<strong>{{ settlementMonthLabel }}</strong>
</v-col>
<v-col
cols="6"
class="text-right"
>
에이전트 : <strong>{{ totalCount | numberFormat }}</strong>
</v-col>
</v-row>
<v-row>
<v-col>
<v-simple-table class="elevation-10">
<template>
<thead>
<tr>
<th class="text-center">
에이전트 닉네임
</th>
<th class="text-center">
소속 크리에이터
</th>
<th class="text-center">
라이브
</th>
<th class="text-center">
콘텐츠
</th>
<th class="text-center">
커뮤니티
</th>
<th class="text-center">
콘텐츠 후원
</th>
<th class="text-center">
채널 후원
</th>
<th class="text-center">
합계
</th>
</tr>
</thead>
<tbody>
<tr
v-for="item in agentList"
:key="item.agentId"
>
<td
class="link"
@click="goAgentDetail(item)"
>
{{ item.agentNickname }}
</td>
<td class="text-center">
{{ item.assignedCreatorCount | numberFormat }}
</td>
<td
class="text-center clickable"
@click="goSettlement(item, 'live')"
>
{{ formatCurrency(item.liveAgentSettlementAmount) }}
</td>
<td
class="text-center clickable"
@click="goSettlement(item, 'content')"
>
{{ formatCurrency(item.contentAgentSettlementAmount) }}
</td>
<td
class="text-center clickable"
@click="goSettlement(item, 'community')"
>
{{ formatCurrency(item.communityAgentSettlementAmount) }}
</td>
<td
class="text-center clickable"
@click="goSettlement(item, 'content-donation')"
>
{{ formatCurrency(item.contentDonationAgentSettlementAmount) }}
</td>
<td
class="text-center clickable"
@click="goSettlement(item, 'channel-donation')"
>
{{ formatCurrency(item.channelDonationAgentSettlementAmount) }}
</td>
<td class="text-center">
{{ formatCurrency(totalAmount(item)) }}
</td>
</tr>
</tbody>
</template>
</v-simple-table>
</v-col>
</v-row>
<!-- 페이지네이션은 서버 지원 활성화
<v-row class="text-center">
<v-col>
<v-pagination
v-model="page"
:length="total_page"
circle
@input="fetchList"
/>
</v-col>
</v-row>
-->
</v-container>
</div>
</template>
<script>
import { getAgentList } from '@/api/agent'
export default {
name: 'AgentList',
filters: {
numberFormat(v) {
if (v === null || v === undefined) return '-'
try {
return new Intl.NumberFormat('ko-KR').format(v)
} catch (e) {
return v
}
}
},
data() {
return {
agentList: [],
totalCount: 0,
// 페이지네이션(필요 시)
page: 1,
total_page: 1,
page_size: 20,
is_loading: false,
}
},
computed: {
settlementMonthLabel() {
const now = new Date()
const month = now.getMonth() + 1 // 1~12
return `${month}월 정산 내역`
}
},
created() {
this.fetchList()
},
methods: {
async fetchList() {
if (this.is_loading) return
this.is_loading = true
try {
const res = await getAgentList(/* this.page, this.page_size */)
// 일부 API는 { data: { totalCount, items } } 형태로 한 번 더 래핑됨을 대비
let payload = (res && res.data) ? res.data : null
if (payload && payload.data && (!payload.items && !payload.totalCount)) {
payload = payload.data
}
const data = payload || { totalCount: 0, items: [] }
this.totalCount = data.totalCount || 0
this.agentList = Array.isArray(data.items) ? data.items : []
// 서버가 페이지네이션 정보를 주면 설정하도록 남김
this.total_page = Math.max(1, Math.ceil(this.totalCount / this.page_size))
} catch (e) {
this.totalCount = 0
this.agentList = []
} finally {
this.is_loading = false
}
},
formatCurrency(n) {
const num = Number(n || 0)
return new Intl.NumberFormat('ko-KR', { style: 'currency', currency: 'KRW', maximumFractionDigits: 0 }).format(num)
},
totalAmount(item) {
const {
liveAgentSettlementAmount = 0,
contentAgentSettlementAmount = 0,
communityAgentSettlementAmount = 0,
contentDonationAgentSettlementAmount = 0,
channelDonationAgentSettlementAmount = 0,
} = item || {}
return (
(liveAgentSettlementAmount || 0) +
(contentAgentSettlementAmount || 0) +
(communityAgentSettlementAmount || 0) +
(contentDonationAgentSettlementAmount || 0) +
(channelDonationAgentSettlementAmount || 0)
)
},
goAgentDetail(item) {
this.$router.push({ name: 'AgentDetail', params: { agentId: item.agentId }, query: { nickname: item.agentNickname } })
},
goSettlement(item, type) {
const id = item.agentId
const nameMap = {
'live': 'AgentSettlementLive',
'content': 'AgentSettlementContent',
'community': 'AgentSettlementCommunity',
'content-donation': 'AgentSettlementContentDonation',
'channel-donation': 'AgentSettlementChannelDonation',
}
const name = nameMap[type]
if (!name) return
this.$router.push({ name, params: { agentId: id }, query: { nickname: item.agentNickname } })
}
}
}
</script>
<style scoped>
.link {
color: #3f51b5;
cursor: pointer;
text-decoration: underline;
}
.clickable {
cursor: pointer;
}
/* 테이블 셀 가운데 정렬 */
table th,
table td {
text-align: center !important;
}
</style>

View File

@@ -1,290 +0,0 @@
<template>
<div>
<v-toolbar dark>
<v-btn
icon
@click="$router.back()"
>
<v-icon>mdi-arrow-left</v-icon>
</v-btn>
<v-toolbar-title>{{ displayNickname }} 정산 상세 - 라이브</v-toolbar-title>
<v-spacer />
</v-toolbar>
<v-container>
<!-- 필터 영역 -->
<v-row
class="mt-2 mb-2"
align="center"
justify="end"
>
<v-col
cols="12"
md="3"
>
<v-menu
v-model="menuStart"
:close-on-content-click="false"
transition="scale-transition"
offset-y
min-width="auto"
>
<template v-slot:activator="{ on, attrs }">
<v-text-field
v-bind="attrs"
label="시작일"
readonly
dense
:value="startDateStr"
v-on="on"
/>
</template>
<v-date-picker
v-model="startDateStr"
scrollable
@input="menuStart = false"
/>
</v-menu>
</v-col>
<v-col
cols="12"
md="3"
>
<v-menu
v-model="menuEnd"
:close-on-content-click="false"
transition="scale-transition"
offset-y
min-width="auto"
>
<template v-slot:activator="{ on, attrs }">
<v-text-field
v-bind="attrs"
label="종료일"
readonly
dense
:value="endDateStr"
v-on="on"
/>
</template>
<v-date-picker
v-model="endDateStr"
scrollable
@input="menuEnd = false"
/>
</v-menu>
</v-col>
<v-col
cols="12"
md="2"
>
<v-btn
color="primary"
:loading="isLoading"
@click="onSearch"
>
조회
</v-btn>
</v-col>
</v-row>
<!-- 테이블 영역 -->
<v-data-table
:headers="headers"
:items="items"
:loading="isLoading"
:items-per-page="pageSize"
class="elevation-1"
disable-pagination
hide-default-footer
>
<!-- 최상단 합계 -->
<template v-slot:body.prepend>
<tr>
<td class="text-center">
합계
</td>
<td class="text-center">
{{ numberFormat(total.count) }}
</td>
<td class="text-center">
{{ numberFormat(total.totalCan) }}
</td>
<td class="text-center">
{{ currencyKRW(total.krw) }}
</td>
<td class="text-center">
{{ currencyKRW(total.fee) }}
</td>
<td class="text-center">
{{ currencyKRW(total.settlementAmount) }}
</td>
<td class="text-center">
{{ currencyKRW(total.tax) }}
</td>
<td class="text-center">
{{ currencyKRW(total.depositAmount) }}
</td>
<td class="text-center">
{{ currencyKRW(total.agentSettlementAmount) }}
</td>
</tr>
</template>
<template v-slot:item.count="{ item }">
{{ numberFormat(item.count) }}
</template>
<template v-slot:item.totalCan="{ item }">
{{ numberFormat(item.totalCan) }}
</template>
<template v-slot:item.krw="{ item }">
{{ currencyKRW(item.krw) }}
</template>
<template v-slot:item.fee="{ item }">
{{ currencyKRW(item.fee) }}
</template>
<template v-slot:item.settlementAmount="{ item }">
{{ currencyKRW(item.settlementAmount) }}
</template>
<template v-slot:item.tax="{ item }">
{{ currencyKRW(item.tax) }}
</template>
<template v-slot:item.depositAmount="{ item }">
{{ currencyKRW(item.depositAmount) }}
</template>
<template v-slot:item.agentSettlementAmount="{ item }">
{{ currencyKRW(item.agentSettlementAmount) }}
</template>
</v-data-table>
<!-- 페이지네이션 -->
<div class="d-flex justify-center mt-2">
<v-pagination
v-model="page"
:length="totalPages"
:total-visible="7"
@input="onPageChange"
/>
</div>
</v-container>
</div>
</template>
<script>
import { getAgentLiveSettlementByCreator } from '@/api/agent'
export default {
name: 'AgentLiveSettlement',
props: {
agentId: { type: [String, Number], required: true }
},
data() {
const today = new Date()
const yyyy = today.getFullYear()
const mm = String(today.getMonth() + 1).padStart(2, '0')
const dd = String(today.getDate()).padStart(2, '0')
const firstDay = `${yyyy}-${mm}-01`
const endDay = `${yyyy}-${mm}-${dd}`
return {
// 필터
startDateStr: firstDay,
endDateStr: endDay,
menuStart: false,
menuEnd: false,
page: 1,
pageSize: 20,
// 데이터
isLoading: false,
totalCount: 0,
totalPages: 1,
total: {
count: 0,
totalCan: 0,
krw: 0,
fee: 0,
settlementAmount: 0,
tax: 0,
depositAmount: 0,
agentSettlementAmount: 0
},
items: [],
headers: [
{ text: '닉네임', value: 'creatorNickname', align: 'center' },
{ text: '건수', value: 'count', align: 'center', width: 100 },
{ text: '총 CAN', value: 'totalCan', align: 'center', width: 120 },
{ text: '원화', value: 'krw', align: 'center', width: 140 },
{ text: '수수료', value: 'fee', align: 'center', width: 120 },
{ text: '정산금액', value: 'settlementAmount', align: 'center', width: 140 },
{ text: '세금', value: 'tax', align: 'center', width: 120 },
{ text: '입금액', value: 'depositAmount', align: 'center', width: 140 },
{ text: '에이전트 정산', value: 'agentSettlementAmount', align: 'center', width: 160 },
]
}
},
computed: {
displayNickname() {
const q = (this.$route && this.$route.query) || {}
return q.nickname || '에이전트'
}
},
mounted() {
this.fetchList()
},
methods: {
numberFormat(n) {
const v = Number(n || 0)
return new Intl.NumberFormat('ko-KR').format(v)
},
currencyKRW(n) {
const v = Number(n || 0)
return new Intl.NumberFormat('ko-KR', { style: 'currency', currency: 'KRW', maximumFractionDigits: 0 }).format(v)
},
onSearch() {
this.page = 1
this.fetchList()
},
onPageChange() {
this.fetchList()
},
async fetchList() {
this.isLoading = true
try {
const res = await getAgentLiveSettlementByCreator(this.agentId, {
startDateStr: this.startDateStr,
endDateStr: this.endDateStr,
// UI는 1-based, API 유틸이 0-based로 변환함
page: this.page,
size: this.pageSize,
})
// 일부 API가 { data: {...} } 래핑일 수 있으므로 방어적으로 파싱
let payload = res && res.data ? res.data : null
if (payload && payload.data && (!payload.items && !payload.totalCount)) {
payload = payload.data
}
const data = payload || { totalCount: 0, total: {}, items: [] }
this.totalCount = Number(data.totalCount || 0)
this.totalPages = Math.max(1, Math.ceil(this.totalCount / this.pageSize))
const defTotal = {
count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0
}
this.total = Object.assign({}, defTotal, data.total || {})
this.items = Array.isArray(data.items) ? data.items : []
} catch (e) {
this.totalCount = 0
this.totalPages = 1
this.total = { count: 0, totalCan: 0, krw: 0, fee: 0, settlementAmount: 0, tax: 0, depositAmount: 0, agentSettlementAmount: 0 }
this.items = []
} finally {
this.isLoading = false
}
}
}
}
</script>
<style scoped>
</style>

View File

@@ -1,339 +0,0 @@
<template>
<div>
<v-toolbar dark>
<v-spacer />
<v-toolbar-title>에이전트 정산 비율</v-toolbar-title>
<v-spacer />
<v-btn
color="primary"
dark
@click="onClickCreate"
>
에이전트 비율 추가
</v-btn>
</v-toolbar>
<br>
<v-container>
<v-row>
<v-col
cols="12"
class="text-right"
>
에이전트 : <strong>{{ totalCount | numberFormat }}</strong>
</v-col>
</v-row>
<v-row>
<v-col>
<v-simple-table class="elevation-10">
<template>
<thead>
<tr>
<th class="text-center">
에이전트 닉네임
</th>
<th class="text-center">
정산 비율(%)
</th>
<th class="text-center">
관리
</th>
</tr>
</thead>
<tbody>
<tr
v-for="item in items"
:key="item.memberId"
>
<td class="text-center">
{{ item.nickname }}
</td>
<td class="text-center">
{{ (item.current && item.current.settlementRatio != null) ? item.current.settlementRatio : '-' }}
</td>
<td class="text-center">
<v-btn
small
outlined
color="primary"
@click="onClickEdit(item)"
>
수정
</v-btn>
</td>
</tr>
<tr v-if="!loading && (!items || items.length===0)">
<td
colspan="3"
class="text-center grey--text"
>
데이터가 없습니다.
</td>
</tr>
</tbody>
</template>
</v-simple-table>
</v-col>
</v-row>
</v-container>
<!-- 등록/수정 팝업 -->
<v-dialog
v-model="dialog"
max-width="560px"
persistent
>
<v-card>
<v-card-title class="headline">
{{ isEdit ? '에이전트 비율 수정' : '에이전트 비율 등록' }}
</v-card-title>
<v-card-text>
<v-form
ref="form"
v-model="formValid"
>
<!-- 에이전트 선택/표시 -->
<div v-if="!isEdit">
<v-autocomplete
v-model="selectedAgent"
:items="agentSearchItems"
:loading="agentSearchLoading"
:search-input.sync="agentSearchQuery"
hide-selected
hide-no-data
label="에이전트 닉네임 검색"
item-text="nickname"
item-value="id"
return-object
clearable
:rules="[v=>!!v || '에이전트를 선택하세요.']"
@update:search-input="onSearchAgent"
/>
</div>
<div v-else>
<v-text-field
v-model="form.nickname"
label="에이전트"
disabled
/>
</div>
<v-text-field
v-model.number="form.settlementRatio"
label="정산 비율(%)"
type="number"
min="0"
max="100"
:rules="ratioRules"
required
/>
<v-text-field
v-model="form.effectiveFrom"
label="적용 시작 날짜"
type="date"
:rules="[v=>!!v || '적용 시작 날짜를 선택하세요.']"
required
/>
</v-form>
</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn
text
:disabled="submitting"
@click="closeDialog"
>
취소
</v-btn>
<v-btn
color="primary"
dark
:loading="submitting"
:disabled="!formValid || submitting"
@click="onSubmit"
>
등록
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</div>
</template>
<script>
import {
getAgentSettlementRatioList,
createAgentSettlementRatio,
updateAgentSettlementRatio,
searchAgentByNickname
} from '@/api/agent'
export default {
name: 'AgentSettlementRatio',
filters: {
numberFormat(v) {
if (v === null || v === undefined) return '-'
try {
return new Intl.NumberFormat('ko-KR').format(v)
} catch (e) {
return v
}
}
},
data() {
return {
loading: false,
items: [],
totalCount: 0,
dialog: false,
isEdit: false,
submitting: false,
formValid: false,
form: {
memberId: null,
nickname: '',
settlementRatio: null,
effectiveFrom: ''
},
ratioRules: [
v => (v !== null && v !== '' && !isNaN(v)) || '숫자를 입력하세요.',
v => (v >= 0 && v <= 100) || '0~100 사이 값이어야 합니다.'
],
// 에이전트 검색
selectedAgent: null,
agentSearchQuery: '',
agentSearchItems: [],
agentSearchLoading: false,
}
},
created() {
this.fetchList()
},
methods: {
async fetchList() {
if (this.loading) return
this.loading = true
try {
const res = await getAgentSettlementRatioList()
let payload = (res && res.data) ? res.data : null
if (payload && payload.data && (!payload.items && !payload.totalCount)) {
payload = payload.data
}
const data = payload || { totalCount: 0, items: [] }
this.totalCount = data.totalCount || 0
this.items = Array.isArray(data.items) ? data.items : []
} catch (e) {
this.totalCount = 0
this.items = []
} finally {
this.loading = false
}
},
onClickCreate() {
this.isEdit = false
this.resetForm()
this.dialog = true
},
onClickEdit(item) {
this.isEdit = true
this.resetForm()
this.form.memberId = item.memberId
this.form.nickname = item.nickname
this.form.settlementRatio = item && item.current ? item.current.settlementRatio : null
this.form.effectiveFrom = this.defaultDateTimeLocal()
this.dialog = true
},
closeDialog() {
if (this.submitting) return
this.dialog = false
},
resetForm() {
this.submitting = false
this.formValid = false
this.form = {
memberId: null,
nickname: '',
settlementRatio: null,
effectiveFrom: this.defaultDateTimeLocal()
}
this.selectedAgent = null
this.agentSearchQuery = ''
this.agentSearchItems = []
if (this.$refs.form && this.$refs.form.resetValidation) this.$refs.form.resetValidation()
},
defaultDateTimeLocal() {
// 날짜만 선택하도록 기본값은 오늘 날짜 (YYYY-MM-DD)
const d = new Date()
const pad = n => n.toString().padStart(2, '0')
const yyyy = d.getFullYear()
const MM = pad(d.getMonth() + 1)
const dd = pad(d.getDate())
return `${yyyy}-${MM}-${dd}`
},
toLocalDateTimeString(v) {
// 입력 타입이 date이므로 "YYYY-MM-DD"를 받아 "YYYY-MM-DDT00:00:00"로 변환
// 과거 호환: datetime-local("YYYY-MM-DDTHH:mm")가 들어오면 초를 붙여 반환
if (!v) return null
if (v.length === 10) return `${v}T00:00:00`
if (v.length === 16) return `${v}:00`
// 이미 초까지 포함된 형태면 그대로 사용
if (/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/.test(v)) {
return v.length === 16 ? `${v}:00` : v
}
return `${v}T00:00:00`
},
async onSubmit() {
if (this.submitting) return
const ok = await this.$refs.form.validate?.()
if (!ok) return
try {
this.submitting = true
const payload = {
memberId: this.isEdit ? this.form.memberId : (this.selectedAgent && this.selectedAgent.id),
settlementRatio: Number(this.form.settlementRatio),
effectiveFrom: this.toLocalDateTimeString(this.form.effectiveFrom)
}
if (!payload.memberId) {
this.submitting = false
return
}
if (this.isEdit) {
await updateAgentSettlementRatio(payload)
} else {
await createAgentSettlementRatio(payload)
}
this.dialog = false
await this.fetchList()
} catch (e) {
// 실패 시에도 버튼 로딩 해제
} finally {
this.submitting = false
}
},
async onSearchAgent(q) {
if (!q) {
this.agentSearchItems = []
return
}
this.agentSearchLoading = true
try {
const list = await searchAgentByNickname(q)
this.agentSearchItems = Array.isArray(list) ? list : []
} catch (e) {
this.agentSearchItems = []
} finally {
this.agentSearchLoading = false
}
}
}
}
</script>
<style scoped>
.clickable { cursor: pointer; }
.link { color: #1976d2; cursor: pointer; text-decoration: underline; }
</style>

View File

@@ -1,267 +0,0 @@
<template>
<div>
<v-toolbar dark>
<v-spacer />
<v-toolbar-title>채널 후원 정산</v-toolbar-title>
<v-spacer />
</v-toolbar>
<br>
<v-container>
<v-row>
<v-col cols="2">
<datetime
v-model="start_date"
class="datepicker"
format="YYYY-MM-DD"
/>
</v-col>
<v-col cols="1">
~
</v-col>
<v-col cols="2">
<datetime
v-model="end_date"
class="datepicker"
format="YYYY-MM-DD"
/>
</v-col>
<v-col cols="1" />
<v-col cols="2">
<v-btn
block
color="#3bb9f1"
dark
depressed
@click="getCalculateChannelDonationByDate"
>
조회
</v-btn>
</v-col>
<v-spacer />
<v-col cols="2">
<v-btn
block
color="#3bb9f1"
dark
depressed
@click="downloadExcel"
>
엑셀 다운로드
</v-btn>
</v-col>
</v-row>
<v-row>
<v-col>
<v-data-table
:headers="headers"
:items="items"
:loading="is_loading"
:items-per-page="-1"
class="elevation-1"
hide-default-footer
>
<template slot="body.prepend">
<tr v-if="total">
<td colspan="2">
합계
</td>
<td class="text-center">
{{ total.count.toLocaleString() }}
</td>
<td class="text-center">
{{ total.totalCan.toLocaleString() }}
</td>
<td class="text-center">
{{ total.krw.toLocaleString() }}
</td>
<td class="text-center">
{{ total.fee.toLocaleString() }}
</td>
<td class="text-center">
{{ total.settlementAmount.toLocaleString() }}
</td>
<td class="text-center">
{{ total.withholdingTax.toLocaleString() }}
</td>
<td class="text-center">
{{ total.depositAmount.toLocaleString() }}
</td>
</tr>
</template>
<template v-slot:item.date="{ item }">
{{ item.date }}
</template>
<template v-slot:item.creator="{ item }">
{{ item.creator }}
</template>
<template v-slot:item.count="{ item }">
{{ item.count.toLocaleString() }}
</template>
<template v-slot:item.totalCan="{ item }">
{{ item.totalCan.toLocaleString() }}
</template>
<template v-slot:item.krw="{ item }">
{{ item.krw.toLocaleString() }}
</template>
<template v-slot:item.fee="{ item }">
{{ item.fee.toLocaleString() }}
</template>
<template v-slot:item.settlementAmount="{ item }">
{{ item.settlementAmount.toLocaleString() }}
</template>
<template v-slot:item.withholdingTax="{ item }">
{{ item.withholdingTax.toLocaleString() }}
</template>
<template v-slot:item.depositAmount="{ item }">
{{ item.depositAmount.toLocaleString() }}
</template>
</v-data-table>
</v-col>
</v-row>
<v-row>
<v-col>
<v-pagination
v-model="page"
:length="total_page"
:total-visible="7"
@input="next"
/>
</v-col>
</v-row>
</v-container>
</div>
</template>
<script>
import * as api from '@/api/calculate'
import datetime from 'vuejs-datetimepicker'
export default {
name: 'CalculateChannelDonation',
components: {
datetime
},
data() {
return {
start_date: '',
end_date: '',
is_loading: false,
items: [],
total: null,
page: 1,
page_size: 20,
total_page: 1,
headers: [
{ text: '날짜', align: 'center', sortable: false, value: 'date' },
{ text: '크리에이터', align: 'center', sortable: false, value: 'creator' },
{ text: '건수', align: 'center', sortable: false, value: 'count' },
{ text: '캔', align: 'center', sortable: false, value: 'totalCan' },
{ text: '원화', align: 'center', sortable: false, value: 'krw' },
{ text: '수수료(6.6%)', align: 'center', sortable: false, value: 'fee' },
{ text: '정산금액', align: 'center', sortable: false, value: 'settlementAmount' },
{ text: '원천세(3.3%)', align: 'center', sortable: false, value: 'withholdingTax' },
{ text: '입금액', align: 'center', sortable: false, value: 'depositAmount' }
]
}
},
async created() {
const date = new Date()
const firstDate = new Date(date.getFullYear(), date.getMonth(), 1)
const lastDate = new Date(date.getFullYear(), date.getMonth() + 1, 0)
this.start_date = this.formatDate(firstDate)
this.end_date = this.formatDate(lastDate)
await this.getCalculateChannelDonationByDate()
},
methods: {
formatDate(date) {
const year = date.getFullYear()
const month = ('0' + (date.getMonth() + 1)).slice(-2)
const day = ('0' + date.getDate()).slice(-2)
return `${year}-${month}-${day}`
},
notifyError(message) {
this.$dialog.notify.error(message)
},
async next() {
await this.getCalculateChannelDonationByDate()
},
async getCalculateChannelDonationByDate() {
this.is_loading = true
try {
const res = await api.getCalculateChannelDonationByDate(
this.start_date.substring(0, 10),
this.end_date.substring(0, 10),
this.page,
this.page_size
)
if (res.status === 200 && res.data.success === true) {
const data = res.data.data
this.items = data.items
this.total = data.total
this.total_page = Math.ceil(data.totalCount / this.page_size) || 1
} else {
this.notifyError(res.data.message || '데이터를 불러오는 중 오류가 발생했습니다.')
}
} catch (e) {
this.notifyError('서버와의 통신 중 오류가 발생했습니다.')
} finally {
this.is_loading = false
}
},
async downloadExcel() {
try {
const res = await api.downloadCalculateChannelDonationByDateExcel(
this.start_date.substring(0, 10),
this.end_date.substring(0, 10)
)
const url = window.URL.createObjectURL(new Blob([res.data]))
const link = document.createElement('a')
link.href = url
link.setAttribute('download', '채널후원정산.xlsx')
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
} catch (e) {
this.notifyError('엑셀 다운로드 중 오류가 발생했습니다.')
}
}
}
}
</script>
<style scoped>
.datepicker {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
}
</style>

View File

@@ -1,262 +0,0 @@
<template>
<div>
<v-toolbar dark>
<v-spacer />
<v-toolbar-title>크리에이터별 채널 후원 정산</v-toolbar-title>
<v-spacer />
</v-toolbar>
<br>
<v-container>
<v-row>
<v-col cols="2">
<datetime
v-model="start_date"
class="datepicker"
format="YYYY-MM-DD"
/>
</v-col>
<v-col cols="1">
~
</v-col>
<v-col cols="2">
<datetime
v-model="end_date"
class="datepicker"
format="YYYY-MM-DD"
/>
</v-col>
<v-col cols="1" />
<v-col cols="2">
<v-btn
block
color="#3bb9f1"
dark
depressed
@click="getCalculateChannelDonationByCreator"
>
조회
</v-btn>
</v-col>
<v-spacer />
<v-col cols="2">
<v-btn
block
color="#3bb9f1"
dark
depressed
@click="downloadExcel"
>
엑셀 다운로드
</v-btn>
</v-col>
</v-row>
<v-row>
<v-col>
<v-data-table
:headers="headers"
:items="items"
:loading="is_loading"
:items-per-page="-1"
class="elevation-1"
hide-default-footer
>
<template slot="body.prepend">
<tr v-if="total">
<td>
합계
</td>
<td class="text-center">
{{ total.count.toLocaleString() }}
</td>
<td class="text-center">
{{ total.totalCan.toLocaleString() }}
</td>
<td class="text-center">
{{ total.krw.toLocaleString() }}
</td>
<td class="text-center">
{{ total.fee.toLocaleString() }}
</td>
<td class="text-center">
{{ total.settlementAmount.toLocaleString() }}
</td>
<td class="text-center">
{{ total.withholdingTax.toLocaleString() }}
</td>
<td class="text-center">
{{ total.depositAmount.toLocaleString() }}
</td>
</tr>
</template>
<template v-slot:item.creator="{ item }">
{{ item.creator }}
</template>
<template v-slot:item.count="{ item }">
{{ item.count.toLocaleString() }}
</template>
<template v-slot:item.totalCan="{ item }">
{{ item.totalCan.toLocaleString() }}
</template>
<template v-slot:item.krw="{ item }">
{{ item.krw.toLocaleString() }}
</template>
<template v-slot:item.fee="{ item }">
{{ item.fee.toLocaleString() }}
</template>
<template v-slot:item.settlementAmount="{ item }">
{{ item.settlementAmount.toLocaleString() }}
</template>
<template v-slot:item.withholdingTax="{ item }">
{{ item.withholdingTax.toLocaleString() }}
</template>
<template v-slot:item.depositAmount="{ item }">
{{ item.depositAmount.toLocaleString() }}
</template>
</v-data-table>
</v-col>
</v-row>
<v-row>
<v-col>
<v-pagination
v-model="page"
:length="total_page"
:total-visible="7"
@input="next"
/>
</v-col>
</v-row>
</v-container>
</div>
</template>
<script>
import * as api from '@/api/calculate'
import datetime from 'vuejs-datetimepicker'
export default {
name: 'CalculateChannelDonationByCreator',
components: {
datetime
},
data() {
return {
start_date: '',
end_date: '',
is_loading: false,
items: [],
total: null,
page: 1,
page_size: 20,
total_page: 1,
headers: [
{ text: '크리에이터', align: 'center', sortable: false, value: 'creator' },
{ text: '건수', align: 'center', sortable: false, value: 'count' },
{ text: '캔', align: 'center', sortable: false, value: 'totalCan' },
{ text: '원화', align: 'center', sortable: false, value: 'krw' },
{ text: '수수료(6.6%)', align: 'center', sortable: false, value: 'fee' },
{ text: '정산금액', align: 'center', sortable: false, value: 'settlementAmount' },
{ text: '원천세(3.3%)', align: 'center', sortable: false, value: 'withholdingTax' },
{ text: '입금액', align: 'center', sortable: false, value: 'depositAmount' }
]
}
},
async created() {
const date = new Date()
const firstDate = new Date(date.getFullYear(), date.getMonth(), 1)
const lastDate = new Date(date.getFullYear(), date.getMonth() + 1, 0)
this.start_date = this.formatDate(firstDate)
this.end_date = this.formatDate(lastDate)
await this.getCalculateChannelDonationByCreator()
},
methods: {
formatDate(date) {
const year = date.getFullYear()
const month = ('0' + (date.getMonth() + 1)).slice(-2)
const day = ('0' + date.getDate()).slice(-2)
return `${year}-${month}-${day}`
},
notifyError(message) {
this.$dialog.notify.error(message)
},
async next() {
await this.getCalculateChannelDonationByCreator()
},
async getCalculateChannelDonationByCreator() {
this.is_loading = true
try {
const res = await api.getCalculateChannelDonationByCreator(
this.start_date.substring(0, 10),
this.end_date.substring(0, 10),
this.page,
this.page_size
)
if (res.status === 200 && res.data.success === true) {
const data = res.data.data
this.items = data.items
this.total = data.total
this.total_page = Math.ceil(data.totalCount / this.page_size) || 1
} else {
this.notifyError(res.data.message || '데이터를 불러오는 중 오류가 발생했습니다.')
}
} catch (e) {
this.notifyError('서버와의 통신 중 오류가 발생했습니다.')
} finally {
this.is_loading = false
}
},
async downloadExcel() {
try {
const res = await api.downloadCalculateChannelDonationByCreatorExcel(
this.start_date.substring(0, 10),
this.end_date.substring(0, 10)
)
const url = window.URL.createObjectURL(new Blob([res.data]))
const link = document.createElement('a')
link.href = url
link.setAttribute('download', '크리에이터별_채널후원정산.xlsx')
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
} catch (e) {
this.notifyError('엑셀 다운로드 중 오류가 발생했습니다.')
}
}
}
}
</script>
<style scoped>
.datepicker {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
}
</style>

View File

@@ -47,15 +47,22 @@
<v-spacer />
<v-col cols="2">
<vue-excel-xlsx
:data="items"
:columns="columns"
:file-name="'정산'"
:file-type="'xlsx'"
:sheet-name="'정산'"
>
<v-btn
block
color="#3bb9f1"
dark
depressed
@click="downloadExcel"
>
엑셀 다운로드
</v-btn>
</vue-excel-xlsx>
</v-col>
</v-row>
@@ -149,6 +156,40 @@ export default {
page_size: 20,
total_page: 0,
items: [],
columns: [
{
label: "이메일",
field: "email",
},
{
label: "크리에이터",
field: "nickname",
},
{
label: "합계(캔)",
field: "totalCan",
},
{
label: "원화",
field: "totalKrw",
},
{
label: "결제수수료(6.6%)",
field: "paymentFee",
},
{
label: "정산금액",
field: "settlementAmount",
},
{
label: "원천세(3.3%)",
field: "tax",
},
{
label: "입금액",
field: "depositAmount",
},
],
headers: [
{
text: '이메일',
@@ -268,21 +309,6 @@ export default {
} finally {
this.is_loading = false
}
},
async downloadExcel() {
try {
const res = await api.downloadCalculateCommunityByCreatorExcel(this.start_date, this.end_date)
const url = window.URL.createObjectURL(new Blob([res.data]))
const link = document.createElement('a')
link.href = url
link.setAttribute('download', '크리에이터별_커뮤니티정산.xlsx')
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
} catch (e) {
this.notifyError('엑셀 다운로드 중 오류가 발생했습니다.')
}
}
}
}

View File

@@ -35,7 +35,7 @@
<v-col cols="2">
<v-btn
block
color="#3bb9f1"
color="#9970ff"
dark
depressed
@click="getCalculateCommunityPost"
@@ -47,15 +47,22 @@
<v-spacer />
<v-col cols="2">
<vue-excel-xlsx
:data="items"
:columns="columns"
:file-name="'커뮤니티-정산'"
:file-type="'xlsx'"
:sheet-name="'커뮤니티-정산'"
>
<v-btn
block
color="#3bb9f1"
color="#9970ff"
dark
depressed
@click="downloadExcel"
>
엑셀 다운로드
</v-btn>
</vue-excel-xlsx>
</v-col>
</v-row>
<v-row>
@@ -129,6 +136,52 @@ export default {
page_size: 20,
total_page: 0,
items: [],
columns: [
{
label: '날짜',
field: 'date',
},
{
label: '크리에이터',
field: 'nickname',
},
{
label: '내용(앞 10글자)',
field: 'title'
},
{
label: '판매금액(캔)',
field: 'can',
},
{
label: '구매유저수',
field: 'numberOfPurchase',
},
{
label: '합계(캔)',
field: 'totalCan',
},
{
label: '원화',
field: 'totalKrw',
},
{
label: '수수료\n(6.6%)',
field: 'paymentFee',
},
{
label: '정산금액',
field: 'settlementAmount',
},
{
label: '원천세\n(3.3%)',
field: 'tax',
},
{
label: '입금액',
field: 'depositAmount',
}
],
headers: [
{
text: '날짜',
@@ -256,21 +309,6 @@ export default {
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
this.is_loading = false
}
},
async downloadExcel() {
try {
const res = await api.downloadCalculateCommunityPostExcel(this.start_date, this.end_date)
const url = window.URL.createObjectURL(new Blob([res.data]))
const link = document.createElement('a')
link.href = url
link.setAttribute('download', '커뮤니티-정산.xlsx')
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
} catch (e) {
this.notifyError('엑셀 다운로드 중 오류가 발생했습니다.')
}
}
}
}

View File

@@ -35,7 +35,7 @@
<v-col cols="2">
<v-btn
block
color="#3bb9f1"
color="#9970ff"
dark
depressed
@click="getCalculateContent"
@@ -48,15 +48,22 @@
<v-spacer />
<v-col cols="2">
<vue-excel-xlsx
:data="items"
:columns="columns"
:file-name="'정산'"
:file-type="'xlsx'"
:sheet-name="'정산'"
>
<v-btn
block
color="#3bb9f1"
color="#9970ff"
dark
depressed
@click="downloadExcel"
>
엑셀 다운로드
</v-btn>
</vue-excel-xlsx>
</v-col>
</v-row>
<v-row>
@@ -119,16 +126,6 @@
</v-data-table>
</v-col>
</v-row>
<v-row class="text-center">
<v-col>
<v-pagination
v-model="page"
:length="total_page"
circle
@input="next"
/>
</v-col>
</v-row>
</v-container>
</div>
</template>
@@ -146,10 +143,61 @@ export default {
is_loading: false,
start_date: null,
end_date: null,
page: 1,
page_size: 20,
total_page: 0,
items: [],
columns: [
{
label: '판매일',
field: 'saleDate',
},
{
label: '크리에이터',
field: 'nickname',
},
{
label: '제목',
field: 'title',
},
{
label: '구분',
field: 'orderType',
},
{
label: '판매금액(캔)',
field: 'orderPrice',
},
{
label: '판매수',
field: 'numberOfPeople',
},
{
label: '합계(캔)',
field: 'totalCan',
},
{
label: '원화',
field: 'totalKrw',
},
{
label: '수수료\n(6.6%)',
field: 'paymentFee',
},
{
label: '정산금액',
field: 'settlementAmount',
},
{
label: '원천세\n(3.3%)',
field: 'tax',
},
{
label: '입금액',
field: 'depositAmount',
},
{
label: '등록일',
field: 'registrationDate',
},
],
headers: [
{
text: '판매일',
@@ -273,10 +321,9 @@ export default {
this.is_loading = true
try {
const res = await api.getCalculateContent(this.start_date, this.end_date, this.page, this.page_size)
const res = await api.getCalculateContent(this.start_date, this.end_date)
if (res.status === 200 && res.data.success === true) {
this.items = res.data.data.items
this.total_page = Math.ceil(res.data.data.totalCount / this.page_size)
this.items = res.data.data
} else {
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
}
@@ -286,25 +333,6 @@ export default {
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
this.is_loading = false
}
},
next() {
this.getCalculateContent()
},
async downloadExcel() {
try {
const res = await api.downloadCalculateContentExcel(this.start_date, this.end_date)
const url = window.URL.createObjectURL(new Blob([res.data]))
const link = document.createElement('a')
link.href = url
link.setAttribute('download', '콘텐츠정산.xlsx')
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
} catch (e) {
this.notifyError('엑셀 다운로드 중 오류가 발생했습니다.')
}
}
}
}

View File

@@ -47,15 +47,22 @@
<v-spacer />
<v-col cols="2">
<vue-excel-xlsx
:data="items"
:columns="columns"
:file-name="'정산'"
:file-type="'xlsx'"
:sheet-name="'정산'"
>
<v-btn
block
color="#3bb9f1"
dark
depressed
@click="downloadExcel"
>
엑셀 다운로드
</v-btn>
</vue-excel-xlsx>
</v-col>
</v-row>
@@ -149,6 +156,40 @@ export default {
page_size: 20,
total_page: 0,
items: [],
columns: [
{
label: "이메일",
field: "email",
},
{
label: "크리에이터",
field: "nickname",
},
{
label: "합계(캔)",
field: "totalCan",
},
{
label: "원화",
field: "totalKrw",
},
{
label: "결제수수료(6.6%)",
field: "paymentFee",
},
{
label: "정산금액",
field: "settlementAmount",
},
{
label: "원천세(3.3%)",
field: "tax",
},
{
label: "입금액",
field: "depositAmount",
},
],
headers: [
{
text: '이메일',
@@ -268,21 +309,6 @@ export default {
} finally {
this.is_loading = false
}
},
async downloadExcel() {
try {
const res = await api.downloadCalculateContentByCreatorExcel(this.start_date, this.end_date)
const url = window.URL.createObjectURL(new Blob([res.data]))
const link = document.createElement('a')
link.href = url
link.setAttribute('download', '크리에이터별_콘텐츠정산.xlsx')
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
} catch (e) {
this.notifyError('엑셀 다운로드 중 오류가 발생했습니다.')
}
}
}
}

View File

@@ -35,7 +35,7 @@
<v-col cols="2">
<v-btn
block
color="#3bb9f1"
color="#9970ff"
dark
depressed
@click="getCalculateContentDonation"
@@ -48,15 +48,22 @@
<v-spacer />
<v-col cols="2">
<vue-excel-xlsx
:data="items"
:columns="columns"
:file-name="'정산'"
:file-type="'xlsx'"
:sheet-name="'정산'"
>
<v-btn
block
color="#3bb9f1"
color="#9970ff"
dark
depressed
@click="downloadExcel"
>
엑셀 다운로드
</v-btn>
</vue-excel-xlsx>
</v-col>
</v-row>
<v-row>
@@ -111,16 +118,6 @@
</v-data-table>
</v-col>
</v-row>
<v-row class="text-center">
<v-col>
<v-pagination
v-model="page"
:length="total_page"
circle
@input="next"
/>
</v-col>
</v-row>
</v-container>
</div>
</template>
@@ -138,10 +135,57 @@ export default {
is_loading: false,
start_date: null,
end_date: null,
page: 1,
page_size: 20,
total_page: 0,
items: [],
columns: [
{
label: '후원날짜',
field: 'donationDate',
},
{
label: '크리에이터',
field: 'nickname',
},
{
label: '콘텐츠 제목',
field: 'title',
},
{
label: '구분',
field: 'paidOrFree',
},
{
label: '후원수',
field: 'numberOfDonation',
},
{
label: '합계(캔)',
field: 'totalCan',
},
{
label: '원화',
field: 'totalKrw',
},
{
label: '수수료\n(6.6%)',
field: 'paymentFee',
},
{
label: '정산금액',
field: 'settlementAmount',
},
{
label: '원천세\n(3.3%)',
field: 'tax',
},
{
label: '입금액',
field: 'depositAmount',
},
{
label: '콘텐츠 등록일',
field: 'registrationDate',
},
],
headers: [
{
text: '후원날짜',
@@ -259,10 +303,9 @@ export default {
this.is_loading = true
try {
const res = await api.getCalculateContentDonation(this.start_date, this.end_date, this.page, this.page_size)
const res = await api.getCalculateContentDonation(this.start_date, this.end_date)
if (res.status === 200 && res.data.success === true) {
this.items = res.data.data.items
this.total_page = Math.ceil(res.data.data.totalCount / this.page_size)
this.items = res.data.data
} else {
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
}
@@ -272,25 +315,6 @@ export default {
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
this.is_loading = false
}
},
next() {
this.getCalculateContentDonation()
},
async downloadExcel() {
try {
const res = await api.downloadCalculateContentDonationExcel(this.start_date, this.end_date)
const url = window.URL.createObjectURL(new Blob([res.data]))
const link = document.createElement('a')
link.href = url
link.setAttribute('download', '콘텐츠후원정산.xlsx')
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
} catch (e) {
this.notifyError('엑셀 다운로드 중 오류가 발생했습니다.')
}
}
}
}

View File

@@ -35,7 +35,7 @@
<v-col cols="2">
<v-btn
block
color="#3bb9f1"
color="#9970ff"
dark
depressed
@click="getCalculateLive"
@@ -47,15 +47,22 @@
<v-spacer />
<v-col cols="2">
<vue-excel-xlsx
:data="items"
:columns="columns"
:file-name="'정산'"
:file-type="'xlsx'"
:sheet-name="'정산'"
>
<v-btn
block
color="#3bb9f1"
color="#9970ff"
dark
depressed
@click="downloadExcel"
>
엑셀 다운로드
</v-btn>
</vue-excel-xlsx>
</v-col>
</v-row>
@@ -69,6 +76,10 @@
class="elevation-1"
hide-default-footer
>
<template v-slot:item.email="{ item }">
{{ item.email }}
</template>
<template v-slot:item.nickname="{ item }">
{{ item.nickname }}
</template>
@@ -112,29 +123,9 @@
<template v-slot:item.depositAmount="{ item }">
{{ item.depositAmount.toLocaleString() }}
</template>
<template v-slot:item.actions="{ item }">
<v-btn
small
color="error"
@click="refund(item)"
>
환불
</v-btn>
</template>
</v-data-table>
</v-col>
</v-row>
<v-row class="text-center">
<v-col>
<v-pagination
v-model="page"
:length="total_page"
circle
@input="next"
/>
</v-col>
</v-row>
</v-container>
</div>
</template>
@@ -152,11 +143,68 @@ export default {
is_loading: false,
start_date: null,
end_date: null,
page: 1,
page_size: 20,
total_page: 0,
items: [],
columns: [
{
label: "이메일",
field: "email",
},
{
label: "크리에이터",
field: "nickname",
},
{
label: "날짜",
field: "date",
},
{
label: "제목",
field: "title",
},
{
label: "구분",
field: "canUsageStr",
},
{
label: "입장캔",
field: "entranceFee",
},
{
label: "인원",
field: "numberOfPeople",
},
{
label: "합계(캔)",
field: "totalAmount",
},
{
label: "원화",
field: "totalKrw",
},
{
label: "결제수수료(6.6%)",
field: "paymentFee",
},
{
label: "정산금액",
field: "settlementAmount",
},
{
label: "원천세(3.3%)",
field: "tax",
},
{
label: "입금액",
field: "depositAmount",
},
],
headers: [
{
text: '이메일',
align: 'center',
sortable: false,
value: 'email',
},
{
text: '크리에이터',
align: 'center',
@@ -227,12 +275,6 @@ export default {
align: 'center',
sortable: false,
value: 'depositAmount',
},
{
text: '관리',
align: 'center',
sortable: false,
value: 'actions',
}
],
}
@@ -273,10 +315,9 @@ export default {
this.is_loading = true
try {
const res = await api.getCalculateLive(this.start_date, this.end_date, this.page, this.page_size)
const res = await api.getCalculateLive(this.start_date, this.end_date)
if (res.status === 200 && res.data.success === true) {
this.items = res.data.data.items
this.total_page = Math.ceil(res.data.data.totalCount / this.page_size)
this.items = res.data.data
} else {
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
}
@@ -286,41 +327,6 @@ export default {
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
this.is_loading = false
}
},
next() {
this.getCalculateLive()
},
async refund(item) {
if (confirm('정말로 환불하시겠습니까?')) {
try {
const res = await api.refundLive(item.roomId, item.canUsageStr)
if (res.status === 200 && res.data.success === true) {
this.notifySuccess('환불 처리가 완료되었습니다.')
await this.getCalculateLive()
} else {
this.notifyError(res.data.message || '환불 처리 중 오류가 발생했습니다.')
}
} catch (e) {
this.notifyError('환불 처리 중 오류가 발생했습니다.')
}
}
},
async downloadExcel() {
try {
const res = await api.downloadCalculateLiveExcel(this.start_date, this.end_date)
const url = window.URL.createObjectURL(new Blob([res.data]))
const link = document.createElement('a')
link.href = url
link.setAttribute('download', '라이브정산.xlsx')
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
} catch (e) {
this.notifyError('엑셀 다운로드 중 오류가 발생했습니다.')
}
}
}
}

View File

@@ -47,15 +47,22 @@
<v-spacer />
<v-col cols="2">
<vue-excel-xlsx
:data="items"
:columns="columns"
:file-name="'정산'"
:file-type="'xlsx'"
:sheet-name="'정산'"
>
<v-btn
block
color="#3bb9f1"
dark
depressed
@click="downloadExcel"
>
엑셀 다운로드
</v-btn>
</vue-excel-xlsx>
</v-col>
</v-row>
@@ -149,6 +156,40 @@ export default {
page_size: 20,
total_page: 0,
items: [],
columns: [
{
label: "이메일",
field: "email",
},
{
label: "크리에이터",
field: "nickname",
},
{
label: "합계(캔)",
field: "totalCan",
},
{
label: "원화",
field: "totalKrw",
},
{
label: "결제수수료(6.6%)",
field: "paymentFee",
},
{
label: "정산금액",
field: "settlementAmount",
},
{
label: "원천세(3.3%)",
field: "tax",
},
{
label: "입금액",
field: "depositAmount",
},
],
headers: [
{
text: '이메일',
@@ -268,21 +309,6 @@ export default {
} finally {
this.is_loading = false
}
},
async downloadExcel() {
try {
const res = await api.downloadCalculateLiveByCreatorExcel(this.start_date, this.end_date)
const url = window.URL.createObjectURL(new Blob([res.data]))
const link = document.createElement('a')
link.href = url
link.setAttribute('download', '크리에이터별_라이브정산.xlsx')
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
} catch (e) {
this.notifyError('엑셀 다운로드 중 오류가 발생했습니다.')
}
}
}
}

View File

@@ -1,340 +0,0 @@
<template>
<div>
<v-toolbar dark>
<v-btn
icon
@click="$router.back()"
>
<v-icon>mdi-arrow-left</v-icon>
</v-btn>
<v-toolbar-title>오리지널 시리즈 정산</v-toolbar-title>
<v-spacer />
<v-btn
color="primary"
:loading="excelLoading"
@click="onDownloadExcel"
>
엑셀 다운로드
</v-btn>
</v-toolbar>
<v-container>
<!-- 필터 영역 -->
<v-row
class="mt-2 mb-2"
align="center"
justify="end"
>
<v-col
cols="12"
md="3"
>
<v-autocomplete
v-model="selectedCreatorId"
:items="ownerOptions"
:loading="ownersLoading"
item-text="nickname"
item-value="creatorId"
label="멤버 선택"
dense
clearable
hide-details
/>
</v-col>
<v-col
cols="12"
md="3"
>
<v-menu
v-model="menuStart"
:close-on-content-click="false"
transition="scale-transition"
offset-y
min-width="auto"
>
<template v-slot:activator="{ on, attrs }">
<v-text-field
v-bind="attrs"
label="시작일"
readonly
dense
:value="startDateStr"
v-on="on"
/>
</template>
<v-date-picker
v-model="startDateStr"
scrollable
@input="menuStart = false"
/>
</v-menu>
</v-col>
<v-col
cols="12"
md="3"
>
<v-menu
v-model="menuEnd"
:close-on-content-click="false"
transition="scale-transition"
offset-y
min-width="auto"
>
<template v-slot:activator="{ on, attrs }">
<v-text-field
v-bind="attrs"
label="종료일"
readonly
dense
:value="endDateStr"
v-on="on"
/>
</template>
<v-date-picker
v-model="endDateStr"
scrollable
@input="menuEnd = false"
/>
</v-menu>
</v-col>
<v-col
cols="12"
md="2"
>
<v-btn
color="primary"
:loading="isLoading"
@click="onSearch"
>
조회
</v-btn>
</v-col>
</v-row>
<!-- 테이블 영역 -->
<v-data-table
:headers="headers"
:items="items"
:loading="isLoading"
:items-per-page="pageSize"
class="elevation-1"
disable-pagination
hide-default-footer
>
<template v-slot:no-data>
<div class="text-center grey--text pa-6">
데이터가 없습니다.
</div>
</template>
<template v-slot:item.price="{ item }">
<span>{{ numberFormat(item.price) }}</span>
</template>
<template v-slot:item.totalCan="{ item }">
<span>{{ numberFormat(item.totalCan) }}</span>
</template>
<template v-slot:item.totalPoint="{ item }">
<span>{{ numberFormat(item.totalPoint) }}</span>
</template>
</v-data-table>
<v-row
class="mt-4"
justify="center"
>
<v-pagination
v-model="page"
:length="totalPages"
:total-visible="7"
@input="fetchList"
/>
</v-row>
</v-container>
</div>
</template>
<script>
import {
getOwners,
getSettlementDetails,
downloadSettlementExcel,
} from "@/api/original_series_settlement";
export default {
name: "OriginalSeriesSettlement",
data() {
return {
// 필터 상태
ownersLoading: false,
ownerOptions: [],
selectedCreatorId: null,
startDateStr: "",
endDateStr: "",
menuStart: false,
menuEnd: false,
// 목록 상태
isLoading: false,
items: [],
totalCount: 0,
page: 1,
pageSize: 20,
excelLoading: false,
headers: [
{ text: "시리즈 제목", value: "seriesTitle", align: "center" },
{ text: "콘텐츠 제목", value: "contentTitle", align: "center" },
{ text: "가격", value: "price", align: "center" },
{ text: "구분", value: "orderType", align: "center" },
{ text: "판매 수", value: "salesCount", align: "center" },
{ text: "합계(캔)", value: "totalCan", align: "center" },
{ text: "합계(포인트)", value: "totalPoint", align: "center" },
],
};
},
computed: {
totalPages() {
return Math.max(1, Math.ceil(this.totalCount / this.pageSize));
},
},
created() {
this.initDefaultDates();
this.loadOwners();
},
methods: {
numberFormat(v) {
if (v === null || v === undefined) return "-";
try {
return Number(v).toLocaleString();
} catch (e) {
return String(v);
}
},
notifyError(message) {
this.$dialog.notify.error(message);
},
notifySuccess(message) {
this.$dialog.notify.success(message);
},
// 이번 달 1일 ~ 오늘
initDefaultDates() {
const now = new Date();
const y = now.getFullYear();
const m = now.getMonth();
const first = new Date(y, m, 1);
const pad = (n) => (n < 10 ? "0" + n : "" + n);
this.startDateStr = `${first.getFullYear()}-${pad(
first.getMonth() + 1
)}-${pad(first.getDate())}`;
this.endDateStr = `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(
now.getDate()
)}`;
},
async loadOwners() {
this.ownersLoading = true;
try {
const res = await getOwners();
if (res.status === 200 && res.data && res.data.success) {
const list = Array.isArray(res.data.data) ? res.data.data : [];
this.ownerOptions = list;
// 가장 조회된 값 순서로 온다고 가정, 첫 번째를 기본 선택
if (list.length > 0) {
this.selectedCreatorId = list[0].creatorId;
}
// 초기 조회 (이번 달 범위, 기본 멤버)
this.page = 1;
await this.fetchList();
} else {
this.notifyError(
res.data && res.data.message
? res.data.message
: "소지 유저 조회 실패"
);
}
} catch (e) {
this.notifyError("소지 유저 조회 중 오류가 발생했습니다.");
} finally {
this.ownersLoading = false;
}
},
async onSearch() {
this.page = 1;
await this.fetchList();
},
async fetchList() {
if (!this.selectedCreatorId) {
this.items = [];
this.totalCount = 0;
return;
}
this.isLoading = true;
try {
const res = await getSettlementDetails({
startDate: this.startDateStr,
endDate: this.endDateStr,
creatorId: this.selectedCreatorId,
page: this.page,
size: this.pageSize,
});
if (res.status === 200 && res.data) {
if (res.data.success) {
const data = res.data.data || { totalCount: 0, items: [] };
this.totalCount = data.totalCount || 0;
this.items = Array.isArray(data.items) ? data.items : [];
} else {
this.notifyError(res.data.message || "정산 내역 조회 실패");
}
} else {
this.notifyError("정산 내역 조회 실패");
}
} catch (e) {
this.notifyError("정산 내역 조회 중 오류가 발생했습니다.");
} finally {
this.isLoading = false;
}
},
async onDownloadExcel() {
this.excelLoading = true;
try {
const res = await downloadSettlementExcel({
startDate: this.startDateStr,
endDate: this.endDateStr,
});
const blob = new Blob([res.data], {
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
});
const url = window.URL.createObjectURL(blob);
const link = document.createElement("a");
link.href = url;
link.setAttribute("download", "오리지널_시리즈_정산.xlsx");
document.body.appendChild(link);
link.click();
link.parentNode.removeChild(link);
window.URL.revokeObjectURL(url);
this.notifySuccess("엑셀 다운로드가 시작되었습니다.");
} catch (e) {
this.notifyError("엑셀 다운로드 중 오류가 발생했습니다.");
} finally {
this.excelLoading = false;
}
},
},
};
</script>
<style scoped>
/* 테이블 헤더/바디 모두 가운데 정렬 */
.v-data-table table thead th,
.v-data-table table tbody td {
text-align: center !important;
}
</style>

View File

@@ -8,29 +8,11 @@
<br>
<v-container>
<v-autocomplete
v-model="selectedMembers"
:items="displaySearchItems"
:loading="searchLoading"
:search-input.sync="searchQuery"
label="닉네임으로 사용자 검색 (여러 명 선택 가능)"
item-text="nickname"
item-value="id"
return-object
multiple
small-chips
clearable
outlined
cache-items
:value-comparator="compareMember"
@update:search-input="onSearch"
/>
<v-text-field
v-model="manualInput"
label="회원번호 직접 입력 (여러 개 입력 가능, 콤마/공백 구분)"
v-model="account_id"
label="회원번호"
outlined
clearable
required
/>
<v-text-field
@@ -52,7 +34,7 @@
<v-col>
<v-btn
block
color="#3bb9f1"
color="#9970ff"
dark
depressed
@click="confirm"
@@ -70,7 +52,7 @@
<v-card>
<v-card-title> 지급 확인</v-card-title>
<v-card-text>
지급 대상: {{ confirmTargets.join(', ') }}
회원번호: {{ account_id }}
</v-card-text>
<v-card-text>
기록내용: {{ method }}
@@ -106,7 +88,6 @@
<script>
import * as api from '@/api/can'
import { searchMembersByNickname } from '@/api/member'
export default {
name: "CanCharge",
@@ -115,60 +96,12 @@ export default {
return {
show_confirm: false,
is_loading: false,
// 기존 account_id -> member_id로 명칭 변경 및 다중 입력 구조로 변경
selectedMembers: [], // 검색으로 선택된 사용자 {id, nickname} 객체 배열
searchItems: [],
searchLoading: false,
searchQuery: '',
searchDebounceTimer: null,
lastSearchToken: 0,
manualInput: '', // 수동 입력: 회원번호 여러 개 (콤마/공백 구분)
account_id: '',
method: '',
can: ''
}
},
computed: {
// 확인 다이얼로그에 표시할 대상 이름들
confirmTargets() {
const names = []
// 검색으로 선택된 사용자 닉네임
if (this.selectedMembers && this.selectedMembers.length > 0) {
names.push(...this.selectedMembers.map(m => m.nickname))
}
// 수동 입력 회원번호는 번호 그대로 표기
const manualIds = this.parseManualIds()
if (manualIds.length > 0) {
names.push(...manualIds.map(String))
}
return names
},
// 검색 결과 목록에 현재 선택된 사용자들을 항상 포함시켜
// 선택 chip이 사라지지 않도록 보장
displaySearchItems() {
const map = new Map()
;(this.selectedMembers || []).forEach(m => {
if (m && (m.id !== undefined && m.id !== null)) {
map.set(String(m.id), m)
}
})
;(this.searchItems || []).forEach(m => {
if (m && (m.id !== undefined && m.id !== null)) {
const key = String(m.id)
if (!map.has(key)) map.set(key, m)
}
})
return Array.from(map.values())
}
},
beforeDestroy() {
if (this.searchDebounceTimer) {
clearTimeout(this.searchDebounceTimer)
this.searchDebounceTimer = null
}
},
methods: {
notifyError(message) {
this.$dialog.notify.error(message)
@@ -178,91 +111,19 @@ export default {
this.$dialog.notify.success(message)
},
// v-autocomplete의 선택 비교를 id 기준으로 수행
compareMember(a, b) {
if (a === b) return true
if (!a || !b) return false
const aid = typeof a === 'object' ? a.id : a
const bid = typeof b === 'object' ? b.id : b
if (aid === undefined || bid === undefined || aid === null || bid === null) return false
return String(aid) === String(bid)
},
onSearch(val) {
this.searchQuery = val
// 입력이 없으면 즉시 초기화하고 이전 타이머/로딩을 정리
if (!val || val.trim().length === 0) {
if (this.searchDebounceTimer) {
clearTimeout(this.searchDebounceTimer)
this.searchDebounceTimer = null
}
this.searchLoading = false
this.searchItems = []
return
}
// 디바운스: 입력 멈춘 뒤에만 호출
if (this.searchDebounceTimer) {
clearTimeout(this.searchDebounceTimer)
this.searchDebounceTimer = null
}
this.searchDebounceTimer = setTimeout(async () => {
if (val.trim().length >= 2) {
const token = ++this.lastSearchToken
this.searchLoading = true
try {
const items = await searchMembersByNickname(val)
// 가장 최근 쿼리에 대한 응답만 반영
if (token === this.lastSearchToken) {
this.searchItems = items
}
} catch (e) {
if (token === this.lastSearchToken) {
this.searchItems = []
}
} finally {
if (token === this.lastSearchToken) {
this.searchLoading = false
}
}
}
}, 300)
},
parseManualIds() {
if (!this.manualInput) return []
return this.manualInput
.split(/[\s,]+/)
.map(s => s.trim())
.filter(s => s.length > 0 && /^\d+$/.test(s))
.map(s => Number(s))
},
buildMemberIds() {
const idsFromSearch = (this.selectedMembers || []).map(m => Number(m.id)).filter(id => !isNaN(id))
const idsFromManual = this.parseManualIds()
// 중복 제거
const set = new Set([...idsFromSearch, ...idsFromManual])
return Array.from(set)
},
confirm() {
// 유효성 검증
if (this.account_id.trim() === '' || isNaN(this.account_id)) {
return this.notifyError('캔을 지급할 회원의 회원번호를 입력하세요.')
}
if (this.method.trim() === '') {
return this.notifyError('기록할 내용을 입력하세요')
}
if (this.can === '' || isNaN(this.can)) {
if (isNaN(this.can)) {
return this.notifyError('캔은 숫자만 넣을 수 있습니다.')
}
const memberIds = this.buildMemberIds()
if (memberIds.length === 0) {
return this.notifyError('캔을 지급할 대상을 추가하세요. (닉네임 검색 선택 또는 회원번호 입력)')
}
if (!this.is_loading) {
this.show_confirm = true
}
@@ -279,15 +140,10 @@ export default {
try {
this.show_confirm = false
const memberIds = this.buildMemberIds()
const res = await api.paymentCan(Number(this.can), this.method, memberIds)
const res = await api.paymentCan(Number(this.can), this.method, this.account_id)
if (res.status === 200 && res.data.success === true) {
this.notifySuccess('캔이 지급되었습니다.')
// 상태 초기화
this.selectedMembers = []
this.searchItems = []
this.searchQuery = ''
this.manualInput = ''
this.account_id = ''
this.method = ''
this.can = ''
this.is_loading = false

View File

@@ -21,7 +21,7 @@
<v-col>
<v-btn
block
color="#3bb9f1"
color="#9970ff"
dark
depressed
v-bind="attrs"
@@ -36,20 +36,19 @@
<v-data-table
:headers="headers"
:items="cans"
:items-per-page="-1"
class="elevation-1"
hide-default-footer
>
<template v-slot:item.priceStr="{ item }">
{{ formatMoney(item.priceStr, item.currency) }}
<template v-slot:item.price="{ item }">
{{ item.price.toLocaleString('en-US') }}
</template>
<template v-slot:item.can="{ item }">
{{ formatNumber(item.can) }}
{{ item.can.toLocaleString('en-US') }}
</template>
<template v-slot:item.rewardCan="{ item }">
{{ formatNumber(item.rewardCan) }}
{{ item.rewardCan.toLocaleString('en-US') }}
</template>
<template v-slot:item.management="{ item }">
@@ -71,13 +70,7 @@
<v-card-text>
<v-text-field
v-model="price"
label="가격"
required
/>
<v-select
v-model="currency"
:items="currencies"
label="화폐 단위"
label="원화"
required
/>
</v-card-text>
@@ -132,18 +125,12 @@ export default {
price: null,
can: null,
reward_can: null,
currency: 'KRW',
currencies: [
{ text: 'KRW (한국 원)', value: 'KRW' },
{ text: 'USD (미국 달러)', value: 'USD' },
{ text: 'JPY (일본 엔)', value: 'JPY' }
],
headers: [
{
text: '가격(VAT포함)',
text: '원화(VAT포함)',
align: 'center',
sortable: false,
value: 'priceStr',
value: 'price',
},
{
text: '충전캔',
@@ -186,26 +173,9 @@ export default {
this.can = null
this.price = null
this.reward_can = null
this.currency = 'KRW'
this.selected_can = null
},
formatMoney(priceStr, currencyCode, locale = navigator.language) {
const price = Number(priceStr);
const formatted = new Intl.NumberFormat(locale, {
style: 'currency',
currency: currencyCode
}).format(price);
return formatted.replace(/([^\d\s])(\d)/, '$1 $2');
},
formatNumber(num) {
return new Intl.NumberFormat(navigator.language, {
style: 'decimal'
}).format(num);
},
async getCans() {
this.isLoading = true
try {
@@ -234,14 +204,13 @@ export default {
async submit() {
this.isLoading = true
const res = await api.insertCan(this.can, this.reward_can, this.price, this.currency)
const res = await api.insertCan(this.can, this.reward_can, this.price)
if (res.status === 200 && res.data.success === true) {
this.show_dialog = false
this.can = null
this.price = null
this.reward_can = null
this.currency = 'KRW'
this.selected_can = null
this.notifySuccess(res.data.message || '등록되었습니다.')

View File

@@ -62,7 +62,7 @@
</template>
<template v-slot:item.chargeAmount="{ item }">
{{ formatMoney(item.chargeAmount, item.currency) }}
{{ item.chargeAmount.toLocaleString() }}
</template>
<template v-slot:item.locale="{ item }">
@@ -94,6 +94,10 @@
class="elevation-1"
hide-default-footer
>
<template v-slot:item.accountId="{ item }">
{{ item.accountId }}
</template>
<template v-slot:item.nickname="{ item }">
{{ item.nickname }}
</template>
@@ -103,22 +107,12 @@
</template>
<template v-slot:item.amount="{ item }">
{{ formatMoney(item.amount, item.locale) }}
{{ item.amount.toLocaleString() }}
</template>
<template v-slot:item.datetime="{ item }">
{{ item.datetime }}
</template>
<template v-slot:item.refund="{ item }">
<v-btn
color="error"
small
@click="confirmRefund(item)"
>
환불
</v-btn>
</template>
</v-data-table>
<v-card-actions v-show="!is_loading">
<v-spacer />
@@ -152,9 +146,14 @@ export default {
end_date: null,
items: [],
detail_items: null,
selected_date_item: null,
show_popup_dialog: false,
detail_headers: [
{
text: 'no',
align: 'center',
sortable: false,
value: 'accountId',
},
{
text: '닉네임',
align: 'center',
@@ -185,12 +184,6 @@ export default {
sortable: false,
value: 'datetime',
},
{
text: '환불',
align: 'center',
sortable: false,
value: 'refund',
},
],
headers: [
{
@@ -211,12 +204,6 @@ export default {
sortable: false,
value: 'chargeCount',
},
{
text: '화폐단위',
align: 'center',
sortable: false,
value: 'currency',
},
{
text: 'PG',
sortable: false,
@@ -261,15 +248,6 @@ export default {
this.show_popup_dialog = false
},
formatMoney(price, currencyCode, locale = navigator.language) {
const formatted = new Intl.NumberFormat(locale, {
style: 'currency',
currency: currencyCode
}).format(price);
return formatted.replace(/([^\d\s])(\d)/, '$1 $2');
},
async getChargeStatus() {
this.is_loading = true
@@ -291,10 +269,9 @@ export default {
async getChargeStatusDetail(value) {
if (value.date !== '합계') {
this.is_loading = true
this.selected_date_item = value
try {
const res = await api.getChargeStatusDetail(value.date, value.pg, value.currency)
const res = await api.getChargeStatusDetail(value.date, value.pg)
if (res.status === 200 && res.data.success === true) {
this.detail_items = res.data.data
this.show_popup_dialog = true
@@ -308,45 +285,6 @@ export default {
this.is_loading = false
}
}
},
async confirmRefund(item) {
let canText = `${item.chargeCan}`
if (item.rewardCan > 0) {
canText += ` + ${item.rewardCan}`
}
const confirm = await this.$dialog.confirm({
title: '환불 확인',
text: `${item.nickname}님의 ${canText}을 환불하시겠습니까?`,
actions: {
false: '취소',
true: '환불'
}
})
if (confirm) {
await this.refundCharge(item.chargeId)
}
},
async refundCharge(chargeId) {
this.is_loading = true
try {
const res = await api.refundCharge(chargeId)
if (res.status === 200 && res.data.success === true) {
this.notifySuccess('환불이 완료되었습니다.')
await this.getChargeStatusDetail(this.selected_date_item)
await this.getChargeStatus()
} else {
this.notifyError(res.data.message || '환불 처리 중 오류가 발생했습니다.')
}
} catch (e) {
this.notifyError('환불 처리 중 오류가 발생했습니다.')
} finally {
this.is_loading = false
}
}
}
}

View File

@@ -60,7 +60,7 @@
max-width="300"
>
<v-img
:src="banner.imagePath"
:src="banner.imageUrl"
height="200"
contain
/>
@@ -184,18 +184,6 @@
</v-alert>
</v-col>
</v-row>
<v-row v-if="!isEdit">
<v-col cols="12">
<v-select
v-model="bannerForm.lang"
:items="languageOptions"
label="언어 선택"
item-text="text"
item-value="value"
outlined
/>
</v-col>
</v-row>
<v-row v-if="selectedCharacter">
<v-col cols="12">
<v-alert
@@ -314,14 +302,8 @@ export default {
image: null,
imageUrl: '',
characterId: null,
bannerId: null,
lang: 'ko'
bannerId: null
},
languageOptions: [
{ text: '한국어', value: 'ko' },
{ text: '일본어', value: 'ja' },
{ text: '영어', value: 'en' }
],
imageRules: [
v => !!v || this.isEdit || '이미지를 선택하세요'
]
@@ -330,7 +312,7 @@ export default {
computed: {
isFormValid() {
return (this.bannerForm.image || (this.isEdit && this.bannerForm.imageUrl)) && this.selectedCharacter && this.bannerForm.lang;
return (this.bannerForm.image || (this.isEdit && this.bannerForm.imageUrl)) && this.selectedCharacter;
}
},
@@ -411,8 +393,7 @@ export default {
image: null,
imageUrl: '',
characterId: null,
bannerId: null,
lang: 'ko'
bannerId: null
};
this.previewImage = null;
this.searchKeyword = '';
@@ -433,8 +414,7 @@ export default {
image: null,
imageUrl: banner.imageUrl,
characterId: banner.characterId,
bannerId: banner.id,
lang: banner.lang || banner.language || null
bannerId: banner.id
};
this.previewImage = null;
this.searchKeyword = '';
@@ -450,8 +430,7 @@ export default {
image: null,
imageUrl: '',
characterId: null,
bannerId: null,
lang: 'ko'
bannerId: null
};
this.previewImage = null;
this.searchKeyword = '';
@@ -522,8 +501,7 @@ export default {
// 배너 추가
const response = await createCharacterBanner({
image: this.bannerForm.image,
characterId: this.selectedCharacter.id,
lang: this.bannerForm.lang
characterId: this.selectedCharacter.id
});
if (response && response.status === 200 && response.data && response.data.success === true) {
this.notifySuccess('배너가 추가되었습니다.');

View File

@@ -109,11 +109,11 @@
</v-col>
</v-row>
<!-- 성별 & 리전 -->
<!-- 성별 -->
<v-row>
<v-col
cols="12"
md="4"
md="6"
>
<v-select
v-model="character.gender"
@@ -124,35 +124,10 @@
/>
</v-col>
<v-col
cols="12"
md="4"
>
<v-select
v-if="!isEdit"
v-model="character.region"
:items="regionOptions"
item-text="text"
item-value="value"
label="리전"
outlined
dense
/>
<v-text-field
v-else
:value="regionDisplayText"
label="리전"
readonly
outlined
dense
background-color="grey lighten-4"
/>
</v-col>
<!-- 나이 -->
<v-col
cols="12"
md="4"
md="6"
>
<v-text-field
v-model="character.age"
@@ -231,64 +206,29 @@
</v-col>
</v-row>
<!-- 원작 선택 -->
<!-- 원작 정보 -->
<v-row>
<v-col cols="12">
<v-autocomplete
v-model="selectedOriginalId"
:items="originalOptions"
:loading="originalLoading"
:search-input.sync="originalSearchTerm"
item-text="title"
item-value="id"
label="원작 검색 후 선택"
hide-no-data
hide-selected
clearable
<v-col
cols="12"
md="6"
>
<v-text-field
v-model="character.originalTitle"
label="원작명"
outlined
dense
@change="onOriginalChange"
>
<template v-slot:item="{ item, on, attrs }">
<v-list-item
v-bind="attrs"
v-on="on"
>
<v-list-item-avatar>
<v-img :src="item.imageUrl" />
</v-list-item-avatar>
<v-list-item-content>
<v-list-item-title v-text="item.title" />
<v-list-item-subtitle v-text="item.category" />
</v-list-item-content>
</v-list-item>
</template>
</v-autocomplete>
/>
</v-col>
</v-row>
<v-row v-if="selectedOriginal">
<v-col cols="12">
<div class="d-flex align-center">
<v-avatar
size="60"
class="mr-3"
<v-col
cols="12"
md="6"
>
<v-img :src="selectedOriginal.imageUrl" />
</v-avatar>
<div>
<div class="subtitle-1">
{{ selectedOriginal.title }}
</div>
</div>
<v-spacer />
<v-btn
small
text
@click="clearSelectedOriginal"
>
해제
</v-btn>
</div>
<v-text-field
v-model="character.originalLink"
label="원작링크"
outlined
dense
/>
</v-col>
</v-row>
@@ -353,11 +293,10 @@
<v-col cols="12">
<v-textarea
v-model="character.systemPrompt"
label="시스템 프롬프트 (최대 2000자)"
label="시스템 프롬프트"
outlined
auto-grow
rows="4"
counter="2000"
:class="{ 'required-asterisk': !isEdit }"
:rules="systemPromptRules"
/>
@@ -1079,7 +1018,6 @@
<script>
import {getCharacter, createCharacter, updateCharacter} from '@/api/character';
import { searchOriginals } from '@/api/original';
export default {
name: "CharacterForm",
@@ -1117,13 +1055,6 @@ export default {
personalities: [],
backgrounds: [],
originalCharacter: null, // 원본 캐릭터 데이터 저장용
// 원작 선택 상태
selectedOriginalId: null,
selectedOriginal: null,
originalOptions: [],
originalSearchTerm: '',
originalLoading: false,
originalDebounce: null,
character: {
id: null,
name: '',
@@ -1135,14 +1066,12 @@ export default {
age: '',
mbti: '',
characterType: '',
originalWorkId: null,
originalTitle: '',
originalLink: '',
speechPattern: '',
speechStyle: '',
appearance: '',
systemPrompt: '',
region: 'KR',
tags: [],
memories: [],
relationships: [],
@@ -1177,14 +1106,9 @@ export default {
'ISTJ', 'ISFJ', 'ESTJ', 'ESFJ',
'ISTP', 'ISFP', 'ESTP', 'ESFP'
],
regionOptions: [
{ text: '한국', value: 'KR' },
{ text: '일본', value: 'JP' }
],
typeOptions: ['Clone', 'Character'],
systemPromptRules: [
v => (this.isEdit ? true : (!!v && v.trim().length > 0) || '시스템 프롬프트를 입력하세요'),
v => (!!v && v.length <= 2000) || '최대 2000자까지 입력 가능합니다'
v => (this.isEdit ? true : (!!v && v.trim().length > 0) || '시스템 프롬프트를 입력하세요')
],
// 인물 관계 옵션 및 검증 규칙
relationshipTypeOptions: ['가족', '친구', '동료', '연인', '기타'],
@@ -1229,10 +1153,6 @@ export default {
const hasNonIdField = Object.keys(changed || {}).some(k => k !== 'id');
const imageChanged = !!this.character.image; // 새 이미지 선택 여부
return !(hasNonIdField || imageChanged);
},
regionDisplayText() {
const option = this.regionOptions.find(opt => opt.value === this.character.region);
return option ? option.text : this.character.region;
}
},
@@ -1245,14 +1165,6 @@ export default {
this.previewImage = null;
}
}
},
originalSearchTerm(val) {
if (this.originalDebounce) clearTimeout(this.originalDebounce);
if (!val || !val.trim()) {
this.originalOptions = [];
return;
}
this.originalDebounce = setTimeout(this.searchOriginalWorks, 300);
}
},
@@ -1273,55 +1185,6 @@ export default {
this.$dialog.notify.success(message);
},
async searchOriginalWorks() {
try {
this.originalLoading = true;
const term = (this.originalSearchTerm || '').trim();
if (!term) {
this.originalOptions = [];
return;
}
const res = await searchOriginals(term);
if (res && res.status === 200 && res.data && res.data.success === true) {
const data = res.data.data;
const items = (data && data.content) ? data.content : (Array.isArray(data) ? data : []);
this.originalOptions = items || [];
} else {
this.originalOptions = [];
}
} catch (e) {
this.originalOptions = [];
} finally {
this.originalLoading = false;
}
},
onOriginalChange(val) {
if (!val) {
this.selectedOriginal = null;
this.selectedOriginalId = null;
this.character.originalWorkId = null;
return;
}
const id = Number(val);
const found = (this.originalOptions || []).find(o => Number(o.id) === id);
if (found) {
this.selectedOriginal = { id: Number(found.id), title: found.title, imageUrl: found.imageUrl };
} else if (this.selectedOriginal && Number(this.selectedOriginal.id) === id) {
// keep current selectedOriginal
} else {
this.selectedOriginal = { id };
}
this.selectedOriginalId = id;
this.character.originalWorkId = id;
},
clearSelectedOriginal() {
this.selectedOriginal = null;
this.selectedOriginalId = null;
this.character.originalWorkId = null;
},
goBack() {
this.$router.push('/character');
},
@@ -1603,14 +1466,10 @@ export default {
// 로드된 캐릭터 데이터에서 null을 빈 문자열로 변환 (UI 표시용)
normalizeCharacterData(data) {
const result = { ...data };
// 기본값 보정
if (result.originalWorkId == null) result.originalWorkId = null;
// 리전 정보가 없는 경우 기본값 KR 설정
if (!result.region) result.region = 'KR';
const simpleFields = [
'name', 'systemPrompt', 'description', 'age', 'gender', 'mbti',
'characterType', 'speechPattern', 'speechStyle', 'appearance', 'imageUrl', 'region'
'characterType', 'originalTitle', 'originalLink', 'speechPattern',
'speechStyle', 'appearance', 'imageUrl'
];
simpleFields.forEach(f => {
if (result[f] == null) result[f] = '';
@@ -1630,11 +1489,11 @@ export default {
gender: this.character.gender,
mbti: this.character.mbti,
characterType: this.character.characterType,
originalWorkId: this.character.originalWorkId,
originalTitle: this.character.originalTitle,
originalLink: this.character.originalLink,
speechPattern: this.character.speechPattern,
speechStyle: this.character.speechStyle,
appearance: this.character.appearance,
region: this.character.region,
tags: this.character.tags || [],
hobbies: this.character.hobbies || [],
values: this.character.values || [],
@@ -1654,8 +1513,8 @@ export default {
// 기본 필드 비교
const simpleFields = [
'name', 'description', 'age', 'gender', 'mbti', 'characterType', 'originalWorkId',
'speechPattern', 'speechStyle', 'isActive', 'region'
'name', 'description', 'age', 'gender', 'mbti', 'characterType', 'originalTitle', 'originalLink',
'speechPattern', 'speechStyle', 'isActive'
];
simpleFields.forEach(field => {
@@ -1704,15 +1563,6 @@ export default {
}
});
// 특수 규칙: 기존에 원작이 연결되어 있었고, 해제(선택 제거)한 경우 서버 규약에 따라 0으로 전송
if (this.isEdit && ('originalWorkId' in changedFields)) {
const prev = this.originalCharacter && this.originalCharacter.originalWorkId;
const curr = changedFields.originalWorkId;
if ((curr === null || curr === undefined || curr === '') && (prev !== null && prev !== undefined && Number(prev) > 0)) {
changedFields.originalWorkId = 0;
}
}
return changedFields;
},
@@ -1736,18 +1586,6 @@ export default {
image: null // 파일 입력은 초기화
};
// 원작 선택 UI 반영
if (this.character.originalWork) {
const d = this.character.originalWork;
this.selectedOriginal = d ? { id: Number(d.id), title: d.title, imageUrl: d.imageUrl } : null;
this.selectedOriginalId = d ? Number(d.id) : null;
this.character.originalWorkId = d ? Number(d.id) : null;
this.originalCharacter.originalWorkId = d ? Number(d.id) : null;
} else {
this.selectedOriginal = null;
this.selectedOriginalId = null;
}
// 태그, 메모리, 인물관계, 취미, 가치관, 목표, 성격 특성, 세계관 설정
this.tags = data.tags || [];
this.memories = data.memories || [];
@@ -1790,11 +1628,6 @@ export default {
this.character.personalities = [...this.personalities];
this.character.backgrounds = [...this.backgrounds];
// 선택된 원작 기준으로 originalWorkId 최종 반영
if (this.selectedOriginalId !== null) {
this.character.originalWorkId = this.selectedOriginalId;
}
let response;
if (this.isEdit) {
@@ -1917,7 +1750,8 @@ export default {
gender: str(data.gender),
mbti: str(data.mbti),
characterType: str(data.characterType),
originalWorkId: data.originalWorkId == null ? null : Number(data.originalWorkId),
originalTitle: str(data.originalTitle),
originalLink: str(data.originalLink),
speechPattern: str(data.speechPattern),
speechStyle: str(data.speechStyle),
appearance: str(data.appearance)

View File

@@ -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>
@@ -79,9 +56,6 @@
<th class="text-center">
태그
</th>
<th class="text-center">
리전
</th>
<th class="text-center">
등록일
</th>
@@ -153,7 +127,6 @@
</div>
<span v-else>-</span>
</td>
<td>{{ getRegionText(item.region) }}</td>
<td>{{ item.createdAt }}</td>
<td>{{ item.updatedAt || '-' }}</td>
<td>
@@ -271,7 +244,7 @@
</template>
<script>
import { getCharacterList, updateCharacter, searchCharacterList } from '@/api/character'
import { getCharacterList, updateCharacter } from '@/api/character'
export default {
name: "CharacterList",
@@ -287,12 +260,7 @@ export default {
page: 1,
total_page: 0,
characters: [],
selected_character: {},
searchTerm: '',
regionOptions: [
{ text: '한국', value: 'KR' },
{ text: '일본', value: 'JP' }
]
selected_character: {}
}
},
@@ -309,11 +277,6 @@ export default {
this.$dialog.notify.success(message)
},
getRegionText(region) {
if (!region) return '-';
const option = this.regionOptions.find(opt => opt.value === region);
return option ? option.text : region;
},
showDetailDialog(item, type) {
this.selected_character = item;
@@ -406,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) {

View File

@@ -1,356 +0,0 @@
<template>
<div>
<v-toolbar dark>
<v-btn
icon
@click="goBack"
>
<v-icon>mdi-arrow-left</v-icon>
</v-btn>
<v-spacer />
<v-toolbar-title>원작 상세</v-toolbar-title>
<v-spacer />
<v-btn
color="primary"
@click="openAssignDialog"
>
캐릭터 연결
</v-btn>
</v-toolbar>
<v-container>
<v-card
v-if="detail"
class="pa-4"
>
<v-row>
<v-col
cols="12"
md="4"
>
<v-img
:src="detail.imageUrl"
contain
height="240"
/>
</v-col>
<v-col
cols="12"
md="8"
>
<h2>{{ detail.title }}</h2>
<div class="mt-2">
콘텐츠 타입: {{ detail.contentType || '-' }}
</div>
<div>카테고리(장르): {{ detail.category || '-' }}</div>
<div>19 여부: {{ detail.isAdult ? '예' : '아니오' }}</div>
<div>원천 원작: {{ detail.originalWork || '-' }}</div>
<div class="mt-1">
원천 원작 링크:
<a
v-if="detail.originalLink"
:href="detail.originalLink"
target="_blank"
rel="noopener"
>{{ 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>
<div style="white-space:pre-wrap;">
{{ detail.description || '-' }}
</div>
</v-col>
</v-row>
</v-card>
<v-card class="pa-4 mt-6">
<div class="d-flex align-center mb-4">
<h3>연결된 캐릭터</h3>
<v-spacer />
</div>
<v-row>
<v-col
v-for="c in characters"
:key="c.id"
cols="12"
sm="6"
md="4"
lg="3"
>
<v-card>
<v-img
:src="c.imagePath"
height="180"
contain
/>
<v-card-title class="text-no-wrap">
{{ c.name }}
</v-card-title>
<v-card-actions>
<v-spacer />
<v-btn
small
color="error"
@click="unassign([c.id])"
>
해제
</v-btn>
<v-spacer />
</v-card-actions>
</v-card>
</v-col>
</v-row>
<v-row v-if="isLoadingCharacters">
<v-col class="text-center">
<v-progress-circular
indeterminate
color="primary"
/>
</v-col>
</v-row>
</v-card>
</v-container>
<v-dialog
v-model="assignDialog"
max-width="800"
>
<v-card>
<v-card-title>캐릭터 연결</v-card-title>
<v-card-text>
<v-text-field
v-model="searchKeyword"
label="캐릭터 검색"
outlined
dense
@input="onSearchInput"
/>
<v-data-table
v-model="selectedToAssign"
:headers="headers"
:items="searchResults"
:loading="searchLoading"
item-key="id"
show-select
:items-per-page="5"
>
<template v-slot:item.imageUrl="{ item }">
<v-img
:src="item.imagePath"
max-width="60"
max-height="60"
class="rounded-circle"
/>
</template>
</v-data-table>
</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn
text
@click="assignDialog = false"
>
취소
</v-btn>
<v-btn
color="primary"
:disabled="selectedToAssign.length===0"
@click="assign"
>
연결
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</div>
</template>
<script>
import { getOriginal, getOriginalCharacters, assignCharactersToOriginal, unassignCharactersFromOriginal } from '@/api/original'
import { searchCharacters } from '@/api/character'
export default {
name: 'OriginalDetail',
data() {
return {
id: null,
detail: null,
characters: [],
page: 1,
hasMore: true,
isLoadingCharacters: false,
assignDialog: false,
searchKeyword: '',
searchLoading: false,
searchResults: [],
selectedToAssign: [],
headers: [
{ text: '이미지', value: 'imageUrl', sortable: false },
{ text: '이름', value: 'name' },
{ text: 'ID', value: 'id' }
],
debounceTimer: null
}
},
created() {
this.id = this.$route.query.id
if (!this.id) {
this.$dialog.notify.error('잘못된 접근입니다.');
this.$router.push('/original-work');
return;
}
this.loadDetail();
this.loadCharacters();
window.addEventListener('scroll', this.onScroll);
},
beforeDestroy() {
window.removeEventListener('scroll', this.onScroll);
},
methods: {
notifyError(message) { this.$dialog.notify.error(message) },
notifySuccess(message) { this.$dialog.notify.success(message) },
goBack() { this.$router.push('/original-work') },
async loadDetail() {
try {
const res = await getOriginal(this.id);
if (res.status === 200 && res.data.success === true) {
this.detail = res.data.data;
} else {
this.notifyError('상세 조회 실패');
}
} catch (e) {
this.notifyError('상세 조회 실패');
}
},
async loadCharacters() {
if (this.isLoadingCharacters || !this.hasMore) return;
this.isLoadingCharacters = true;
try {
const res = await getOriginalCharacters(this.id, this.page);
if (res.status === 200 && res.data.success === true) {
const content = res.data.data?.content || [];
this.characters = this.characters.concat(content);
this.hasMore = content.length > 0;
this.page++;
} else {
this.notifyError('캐릭터 목록 조회 실패');
}
} catch (e) {
this.notifyError('캐릭터 목록 조회 실패');
} finally {
this.isLoadingCharacters = false;
}
},
onScroll() {
const scrollPosition = window.innerHeight + window.scrollY;
const documentHeight = document.documentElement.offsetHeight;
if (scrollPosition >= documentHeight - 200 && !this.isLoadingCharacters && this.hasMore) {
this.loadCharacters();
}
},
openAssignDialog() {
this.assignDialog = true;
this.searchKeyword = '';
this.searchResults = [];
this.selectedToAssign = [];
},
onSearchInput() {
if (this.debounceTimer) clearTimeout(this.debounceTimer);
this.debounceTimer = setTimeout(this.search, 300);
},
async search() {
if (!this.searchKeyword || !this.searchKeyword.trim()) {
this.searchResults = [];
return;
}
this.searchLoading = true;
try {
const res = await searchCharacters(this.searchKeyword.trim(), 1, 20);
if (res.status === 200 && res.data.success === true) {
this.searchResults = res.data.data?.content || [];
} else {
this.notifyError('검색 실패');
}
} catch (e) {
this.notifyError('검색 실패');
} finally {
this.searchLoading = false;
}
},
async assign() {
if (this.selectedToAssign.length === 0) return;
try {
const ids = this.selectedToAssign.map(x => x.id);
const res = await assignCharactersToOriginal(this.id, ids);
if (res.status === 200 && res.data.success === true) {
this.notifySuccess('연결되었습니다.');
this.assignDialog = false;
// 목록 초기화 후 재조회
this.characters = [];
this.page = 1;
this.hasMore = true;
this.loadCharacters();
} else {
this.notifyError('연결 실패');
}
} catch (e) {
this.notifyError('연결 실패');
}
},
async unassign(ids) {
if (!ids || ids.length === 0) return;
try {
const res = await unassignCharactersFromOriginal(this.id, ids);
if (res.status === 200 && res.data.success === true) {
this.notifySuccess('해제되었습니다.');
this.characters = this.characters.filter(c => !ids.includes(c.id));
} else {
this.notifyError('해제 실패');
}
} catch (e) {
this.notifyError('해제 실패');
}
}
}
}
</script>
<style scoped>
.text-no-wrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
</style>

View File

@@ -1,505 +0,0 @@
<template>
<div>
<v-toolbar dark>
<v-btn
icon
@click="goBack"
>
<v-icon>mdi-arrow-left</v-icon>
</v-btn>
<v-spacer />
<v-toolbar-title>{{ isEdit ? '원작 수정' : '원작 등록' }}</v-toolbar-title>
<v-spacer />
</v-toolbar>
<v-container>
<v-card class="pa-4">
<v-form
ref="form"
v-model="isFormValid"
>
<v-card-text>
<v-row>
<v-col
cols="12"
md="6"
>
<v-file-input
v-model="form.image"
label="이미지"
accept="image/*"
prepend-icon="mdi-camera"
outlined
dense
:class="{ 'required-asterisk': !isEdit }"
:rules="imageRules"
/>
</v-col>
<v-col
v-if="previewImage || form.imageUrl"
cols="12"
md="6"
>
<div class="text-center">
<v-avatar size="150">
<v-img
:src="previewImage || form.imageUrl"
contain
/>
</v-avatar>
</div>
</v-col>
</v-row>
<v-row>
<v-col cols="12">
<v-text-field
v-model="form.title"
label="제목"
outlined
dense
:rules="[v=>!!v||'제목은 필수입니다']"
class="required-asterisk"
/>
</v-col>
</v-row>
<v-row>
<v-col
cols="12"
md="6"
>
<v-text-field
v-model="form.contentType"
label="콘텐츠 타입"
outlined
dense
:rules="contentTypeRules"
:class="{ 'required-asterisk': !isEdit }"
/>
</v-col>
<v-col
cols="12"
md="6"
>
<v-text-field
v-model="form.category"
label="카테고리(장르)"
outlined
dense
:rules="categoryRules"
:class="{ 'required-asterisk': !isEdit }"
/>
</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-col>
<v-col
cols="12"
md="6"
>
<v-text-field
v-model="form.originalLink"
label="원천 원작 링크"
outlined
dense
:rules="originalLinkRules"
:class="{ 'required-asterisk': !isEdit }"
/>
</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
v-model="form.description"
label="작품 소개"
outlined
rows="4"
:rules="descriptionRules"
:class="{ 'required-asterisk': !isEdit }"
/>
</v-col>
</v-row>
</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn
color="primary"
:disabled="!canSubmit"
@click="onSubmit"
>
{{ isEdit ? '수정' : '등록' }}
</v-btn>
</v-card-actions>
</v-form>
</v-card>
</v-container>
</div>
</template>
<script>
import { createOriginal, updateOriginal, getOriginal } from '@/api/original'
export default {
name: 'OriginalForm',
data() {
return {
isEdit: false,
isFormValid: false,
previewImage: null,
newOriginalLink: '',
form: {
id: null,
image: null,
imageUrl: null,
title: '',
contentType: '',
category: '',
isAdult: false,
description: '',
originalLink: '', // 원천 원작 링크(파라미터명 유지)
originalWork: '',
writer: '',
studio: '',
originalLinks: [], // 추가 원작 링크들
tags: []
},
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()) || '원천 원작 링크는 필수입니다'))],
descriptionRules: [v => (this.isEdit ? true : (!!(v && v.toString().trim()) || '작품 소개는 필수입니다'))]
}
},
computed: {
imageChanged() {
return !!this.form.image;
},
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;
},
hasEditChanges() {
return this.imageChanged || this.hasNonImageChanges;
},
canSubmit() {
if (this.isEdit) return this.hasEditChanges && !!(this.form.title && this.form.title.toString().trim());
const required = [this.form.image, this.form.title, this.form.contentType, this.form.category, this.form.originalLink, this.form.description];
return required.every(v => !!(v && (v.toString ? v.toString().trim() : v)));
}
},
watch: {
'form.image': {
handler(newImage) {
if (newImage) {
const reader = new FileReader();
reader.onload = (e) => { this.previewImage = e.target.result }
reader.readAsDataURL(newImage)
} else {
this.previewImage = null
}
}
}
},
created() {
if (this.$route.query.id) {
this.isEdit = true;
this.load(this.$route.query.id);
}
},
methods: {
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);
if (res.status === 200 && res.data.success === true) {
const d = res.data.data;
this.form = {
id: d.id,
image: null,
imageUrl: d.imageUrl,
title: d.title || '',
contentType: d.contentType || '',
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() : []
}
this.originalInitial = {
id: d.id,
imageUrl: d.imageUrl,
title: d.title || '',
contentType: d.contentType || '',
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() : []
}
} else {
this.notifyError('상세 조회 실패');
}
} catch (e) {
this.notifyError('상세 조회 실패');
}
},
async onSubmit() {
try {
const isValid = this.$refs.form ? this.$refs.form.validate() : true;
if (!isValid) {
this.notifyError(this.isEdit ? '입력을 확인해주세요.' : '필수 항목을 모두 입력해주세요.');
return;
}
if (this.isEdit) {
const fields = ['title', 'contentType', 'category', 'isAdult', 'description', 'originalLink', 'originalWork', 'writer', 'studio'];
const patch = { id: this.form.id };
if (this.originalInitial) {
fields.forEach(f => {
if (this.form[f] !== this.originalInitial[f]) {
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) {
this.notifyError('변경된 내용이 없습니다.');
return;
}
const res = await updateOriginal(patch, image);
if (res.status === 200 && res.data.success === true) {
this.notifySuccess('수정되었습니다.');
this.$router.push('/original-work');
} else {
this.notifyError('수정 실패');
}
} else {
const res = await createOriginal(this.form);
if (res.status === 200 && res.data.success === true) {
this.notifySuccess('등록되었습니다.');
this.$router.push('/original-work');
} else {
this.notifyError('등록 실패');
}
}
} catch (e) {
this.notifyError(this.isEdit ? '수정 실패' : '등록 실패');
}
}
}
}
</script>
<style scoped>
.required-asterisk >>> .v-label::after { content: ' *'; color: #ff5252; }
</style>

View File

@@ -1,205 +0,0 @@
<template>
<div>
<v-toolbar dark>
<v-spacer />
<v-toolbar-title>원작 리스트</v-toolbar-title>
<v-spacer />
<v-btn
color="primary"
dark
@click="goToCreate"
>
원작 등록
</v-btn>
</v-toolbar>
<v-container>
<v-row v-if="isLoading && originals.length === 0">
<v-col class="text-center">
<v-progress-circular
indeterminate
color="primary"
size="64"
/>
</v-col>
</v-row>
<v-row>
<v-col
v-for="item in originals"
:key="item.id"
cols="12"
sm="6"
md="4"
lg="3"
>
<v-card
class="mx-auto"
max-width="344"
style="cursor:pointer;"
@click="openDetail(item)"
>
<v-img
:src="item.imageUrl"
height="200"
contain
/>
<v-card-title class="text-no-wrap">
{{ item.title }}
</v-card-title>
<v-card-actions>
<v-spacer />
<v-btn
small
color="primary"
@click.stop="editOriginal(item)"
>
수정
</v-btn>
<v-btn
small
color="error"
@click.stop="confirmDelete(item)"
>
삭제
</v-btn>
<v-spacer />
</v-card-actions>
</v-card>
</v-col>
</v-row>
<v-row v-if="!isLoading && originals.length === 0">
<v-col class="text-center">
데이터가 없습니다.
</v-col>
</v-row>
<v-row v-if="isLoading && originals.length > 0">
<v-col class="text-center">
<v-progress-circular
indeterminate
color="primary"
/>
</v-col>
</v-row>
</v-container>
<v-dialog
v-model="deleteDialog"
max-width="400"
>
<v-card>
<v-card-title class="headline">
삭제 확인
</v-card-title>
<v-card-text>정말 삭제하시겠습니까?</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn
text
@click="deleteDialog = false"
>
취소
</v-btn>
<v-btn
color="error"
text
@click="deleteItem"
>
삭제
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</div>
</template>
<script>
import { getOriginalList, deleteOriginal } from '@/api/original'
export default {
name: 'OriginalList',
data() {
return {
isLoading: false,
originals: [],
page: 1,
hasMore: true,
deleteDialog: false,
selected: null
}
},
mounted() {
this.loadMore();
window.addEventListener('scroll', this.handleScroll);
},
beforeDestroy() {
window.removeEventListener('scroll', this.handleScroll);
},
methods: {
notifyError(message) { this.$dialog.notify.error(message) },
notifySuccess(message) { this.$dialog.notify.success(message) },
async loadMore() {
if (this.isLoading || !this.hasMore) return;
this.isLoading = true;
try {
const res = await getOriginalList(this.page);
if (res.status === 200 && res.data.success === true) {
const content = res.data.data?.content || [];
this.originals = this.originals.concat(content);
this.hasMore = content.length > 0;
this.page++;
} else {
this.notifyError('원작 목록 조회 실패');
}
} catch (e) {
this.notifyError('원작 목록 조회 실패');
} finally {
this.isLoading = false;
}
},
handleScroll() {
const scrollPosition = window.innerHeight + window.scrollY;
const documentHeight = document.documentElement.offsetHeight;
if (scrollPosition >= documentHeight - 200 && !this.isLoading && this.hasMore) {
this.loadMore();
}
},
goToCreate() {
this.$router.push('/original-work/form');
},
editOriginal(item) {
this.$router.push({ path: '/original-work/form', query: { id: item.id } });
},
openDetail(item) {
this.$router.push({ path: '/original-work/detail', query: { id: item.id } });
},
confirmDelete(item) {
this.selected = item;
this.deleteDialog = true;
},
async deleteItem() {
if (!this.selected) return;
try {
const res = await deleteOriginal(this.selected.id);
if (res.status === 200 && res.data.success === true) {
this.notifySuccess('삭제되었습니다.');
this.originals = this.originals.filter(x => x.id !== this.selected.id);
} else {
this.notifyError('삭제 실패');
}
} catch (e) {
this.notifyError('삭제 실패');
} finally {
this.deleteDialog = false;
this.selected = null;
}
}
}
}
</script>
<style scoped>
.text-no-wrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
</style>

View File

@@ -36,7 +36,7 @@
>
<v-btn
slot="append"
color="#3bb9f1"
color="#9970ff"
dark
@click="search"
>
@@ -75,9 +75,6 @@
<th class="text-center">
가격
</th>
<th class="text-center">
정산요율
</th>
<th class="text-center">
한정판
</th>
@@ -96,10 +93,7 @@
<th class="text-center">
오픈 예정일
</th>
<th
v-if="isAdmin"
class="text-center"
>
<th class="text-center">
관리
</th>
</tr>
@@ -131,13 +125,7 @@
:lines="3"
/>
</td>
<td
style="
max-width: 200px !important;
word-break: break-all;
height: auto;
"
>
<td style="max-width: 200px !important; word-break:break-all; height: auto;">
<vue-show-more-text
:text="item.detail"
:lines="3"
@@ -145,13 +133,7 @@
</td>
<td>{{ item.creatorNickname }}</td>
<td>{{ item.theme }}</td>
<td
style="
max-width: 100px !important;
word-break: break-all;
height: auto;
"
>
<td style="max-width: 100px !important; word-break:break-all; height: auto;">
<vue-show-more-text
:text="item.tags"
:lines="3"
@@ -163,36 +145,15 @@
<td v-else>
무료
</td>
<td>
<!-- settlementRatio가 null 또는 빈값이면 빈칸으로 표시 -->
<span v-if="item.settlementRatio !== null && item.settlementRatio !== undefined && String(item.settlementRatio).trim() !== ''">
{{ item.settlementRatio }}
</span>
</td>
<td
v-if="
item.totalContentCount > 0 &&
item.remainingContentCount > 0
"
style="
min-width: 100px !important;
word-break: break-all;
height: auto;
"
v-if="item.totalContentCount > 0 && item.remainingContentCount > 0"
style="min-width: 100px !important; word-break:break-all; height: auto;"
>
{{ item.totalContentCount - item.remainingContentCount }} /
{{ item.totalContentCount }}
{{ item.totalContentCount - item.remainingContentCount }} / {{ item.totalContentCount }}
</td>
<td
v-else-if="
item.totalContentCount > 0 &&
item.remainingContentCount <= 0
"
style="
min-width: 100px !important;
word-break: break-all;
height: auto;
"
v-else-if="item.totalContentCount > 0 && item.remainingContentCount <= 0"
style="min-width: 100px !important; word-break:break-all; height: auto;"
>
Sold Out
</td>
@@ -217,7 +178,7 @@
</td>
<td>{{ item.date }}</td>
<td>{{ item.releaseDate }}</td>
<td v-if="isAdmin">
<td>
<v-row>
<v-col>
<v-btn
@@ -272,60 +233,9 @@
persistent
>
<v-card>
<v-card-title> 콘텐츠 수정 </v-card-title>
<v-card-text>
<v-row align="center">
<v-col cols="4">
커버 이미지
</v-col>
<v-col cols="8">
<v-img
v-if="image_preview"
:src="image_preview"
max-width="200"
aspect-ratio="1"
contain
class="mb-2"
/>
<v-file-input
v-model="cover_image_file"
label="커버 이미지 선택"
accept="image/*"
prepend-icon="mdi-camera"
outlined
dense
@change="onFileChange"
/>
</v-col>
</v-row>
</v-card-text>
<v-card-text v-if="show_cropper">
<v-row>
<v-col cols="12">
<div style="max-height: 400px">
<img
ref="cropper_image"
:src="cropper_src"
style="max-width: 100%"
>
</div>
<v-btn
color="primary"
class="mt-2"
@click="cropImage"
>
크롭 적용
</v-btn>
<v-btn
color="grey"
class="mt-2 ml-2"
@click="cancelCrop"
>
취소
</v-btn>
</v-col>
</v-row>
</v-card-text>
<v-card-title>
콘텐츠 수정
</v-card-title>
<v-card-text>
<v-row align="center">
<v-col cols="4">
@@ -367,36 +277,6 @@
</v-col>
</v-row>
</v-card-text>
<v-card-text v-if="selected_audio_content.price > 0">
<v-row align="center">
<v-col cols="4">
정산요율
</v-col>
<v-col cols="8">
<v-text-field
v-model="audio_content.settlement_ratio"
label="정산요율"
placeholder="예: 30"
type="number"
hide-details="auto"
:disabled="audio_content.is_settlement_ratio_deleted"
/>
</v-col>
</v-row>
</v-card-text>
<v-card-text v-if="selected_audio_content.price > 0">
<v-row>
<v-col cols="4">
정산요율 삭제
</v-col>
<v-col cols="8">
<input
v-model="audio_content.is_settlement_ratio_deleted"
type="checkbox"
>
</v-col>
</v-row>
</v-card-text>
<v-card-text>
<v-row>
<v-col cols="4">
@@ -493,18 +373,16 @@
</template>
<script>
import * as api from "@/api/audio_content";
import * as api from '@/api/audio_content'
import * as dynamicLink from "@/api/firebase_dynamic_link";
import Cropper from "cropperjs";
import "cropperjs/dist/cropper.css";
import VuetifyAudio from "vuetify-audio";
import VueShowMoreText from "vue-show-more-text";
import VuetifyAudio from 'vuetify-audio'
import VueShowMoreText from 'vue-show-more-text'
export default {
name: "AudioContentList",
components: { VuetifyAudio, VueShowMoreText },
components: {VuetifyAudio, VueShowMoreText},
data() {
return {
@@ -513,155 +391,60 @@ export default {
show_delete_confirm_dialog: false,
page: 1,
total_page: 0,
status: "OPEN",
search_word: "",
status: 'OPEN',
search_word: '',
audio_content: {},
audio_contents: [],
themeList: [],
selected_audio_content: {},
utm_source: "",
utm_medium: "",
utm_campaign: "",
cover_image_file: null,
image_preview: null,
cropper: null,
show_cropper: false,
cropper_src: null,
};
},
computed: {
isAdmin() {
const role = (this.$store && this.$store.state && this.$store.state.accountStore && this.$store.state.accountStore.role)
|| (typeof localStorage !== 'undefined' ? localStorage.role : '');
return role === 'ADMIN';
},
utm_source: '',
utm_medium: '',
utm_campaign: '',
}
},
async created() {
this.audio_content = {
id: null,
title: "",
detail: "",
theme_id: null,
is_adult: false,
is_comment_available: false,
is_default_cover_image: false,
is_settlement_ratio_deleted: false,
settlement_ratio: "",
};
// ADMIN 권한일 때만 테마 리스트 조회
if (this.isAdmin) {
await this.getAudioContentThemeList();
}
await this.getAudioContent();
await this.getAudioContent()
},
methods: {
notifyError(message) {
this.$dialog.notify.error(message);
this.$dialog.notify.error(message)
},
notifySuccess(message) {
this.$dialog.notify.success(message);
this.$dialog.notify.success(message)
},
deleteConfirm(item) {
this.selected_audio_content = item;
this.show_delete_confirm_dialog = true;
this.selected_audio_content = item
this.show_delete_confirm_dialog = true
},
deleteCancel() {
this.selected_audio_content = {};
this.show_delete_confirm_dialog = false;
this.selected_audio_content = {}
this.show_delete_confirm_dialog = false
},
showModifyDialog(item) {
this.selected_audio_content = item;
this.selected_audio_content = item
this.audio_content.id = item.audioContentId;
this.audio_content.title = item.title;
this.audio_content.detail = item.detail;
this.audio_content.theme_id = item.themeId;
this.audio_content.is_adult = item.isAdult;
this.audio_content.is_comment_available = item.isCommentAvailable;
this.audio_content.is_default_cover_image = false;
this.audio_content.is_settlement_ratio_deleted = false;
this.audio_content.settlement_ratio =
item.settlementRatio !== null && item.settlementRatio !== undefined
? String(item.settlementRatio)
: "";
this.image_preview = item.coverImageUrl;
this.cover_image_file = null;
this.show_modify_dialog = true;
},
onFileChange(file) {
if (!file) {
this.image_preview = this.selected_audio_content.coverImageUrl;
this.show_cropper = false;
return;
}
const reader = new FileReader();
reader.onload = (e) => {
this.cropper_src = e.target.result;
this.show_cropper = true;
this.$nextTick(() => {
if (this.cropper) {
this.cropper.destroy();
}
this.cropper = new Cropper(this.$refs.cropper_image, {
aspectRatio: 1,
viewMode: 1,
});
});
};
reader.readAsDataURL(file);
},
cropImage() {
const canvas = this.cropper.getCroppedCanvas({
width: 500,
height: 500,
});
this.image_preview = canvas.toDataURL();
canvas.toBlob((blob) => {
this.cover_image_file = new File([blob], "cover_image.png", {
type: "image/png",
});
});
this.show_cropper = false;
},
cancelCrop() {
this.show_cropper = false;
this.cover_image_file = null;
this.image_preview = this.selected_audio_content.coverImageUrl;
this.audio_content.id = item.audioContentId
this.audio_content.title = item.title
this.audio_content.detail = item.detail
this.audio_content.theme_id = item.themeId
this.audio_content.is_adult = item.isAdult
this.audio_content.is_comment_available = item.isCommentAvailable
this.audio_content.is_default_cover_image = false
this.show_modify_dialog = true
},
cancel() {
this.selected_audio_content = {};
this.audio_content = {
id: null,
title: "",
detail: "",
theme_id: null,
is_adult: false,
is_comment_available: false,
is_default_cover_image: false,
is_settlement_ratio_deleted: false,
settlement_ratio: "",
};
this.image_preview = null;
this.cover_image_file = null;
this.show_cropper = false;
if (this.cropper) {
this.cropper.destroy();
this.cropper = null;
}
this.show_modify_dialog = false;
this.show_delete_confirm_dialog = false;
this.selected_audio_content = {}
this.audio_content = {}
this.show_modify_dialog = false
this.show_delete_confirm_dialog = false
},
async modify() {
@@ -670,8 +453,8 @@ export default {
this.audio_content.title === undefined ||
this.audio_content.title.trim().length <= 0
) {
this.notifyError("제목을 입력하세요");
return;
this.notifyError("제목을 입력하세요")
return
}
if (
@@ -679,244 +462,194 @@ export default {
this.audio_content.detail === undefined ||
this.audio_content.detail.trim().length <= 0
) {
this.notifyError("내용을 입력하세요");
return;
this.notifyError("내용을 입력하세요")
return
}
if (this.is_loading) return;
this.is_loading = true;
this.isLoading = true
try {
const request = {
id: this.audio_content.id,
isDefaultCoverImage: this.audio_content.is_default_cover_image,
};
// 유료 콘텐츠인 경우에만 정산요율 관련 플래그/값 전송 고려
const isPaid = this.selected_audio_content && this.selected_audio_content.price > 0;
if (isPaid) {
request.isSettlementRatioDeleted = this.audio_content.is_settlement_ratio_deleted;
isDefaultCoverImage: this.audio_content.is_default_cover_image
}
if (
this.audio_content.title !== this.selected_audio_content.title &&
this.selected_audio_content.title !== this.audio_content.title &&
this.audio_content.title.trim().length > 0
) {
request.title = this.audio_content.title;
}
if (this.audio_content.detail !== this.selected_audio_content.detail) {
request.detail = this.audio_content.detail;
request.title = this.audio_content.title
}
if (
this.audio_content.theme_id !== this.selected_audio_content.themeId
this.selected_audio_content.detail !== this.audio_content.detail &&
this.audio_content.detail.trim().length > 0
) {
request.themeId = this.audio_content.theme_id;
}
if (
this.audio_content.is_adult !== this.selected_audio_content.isAdult
) {
request.isAdult = this.audio_content.is_adult;
}
if (
this.audio_content.is_comment_available !==
this.selected_audio_content.isCommentAvailable
) {
request.isCommentAvailable = this.audio_content.is_comment_available;
request.detail = this.audio_content.detail
}
// settlementRatio 처리 (null/빈문자 케이스 포함)
const originalRatio =
this.selected_audio_content.settlementRatio !== null &&
this.selected_audio_content.settlementRatio !== undefined
? String(this.selected_audio_content.settlementRatio)
: "";
const newRatio =
this.audio_content.settlement_ratio !== null &&
this.audio_content.settlement_ratio !== undefined
? String(this.audio_content.settlement_ratio)
: "";
if (isPaid && !this.audio_content.is_settlement_ratio_deleted && newRatio !== originalRatio) {
request.settlementRatio = newRatio;
if (this.selected_audio_content.themeId !== this.audio_content.theme_id) {
request.themeId = this.audio_content.theme_id
}
const formData = new FormData();
formData.append("request", JSON.stringify(request));
if (this.cover_image_file) {
formData.append("coverImage", this.cover_image_file);
if (this.selected_audio_content.isAdult !== this.audio_content.is_adult) {
request.isAdult = this.audio_content.is_adult
}
const res = await api.modifyAudioContent(formData);
if (this.selected_audio_content.isCommentAvailable !== this.audio_content.is_comment_available) {
request.isCommentAvailable = this.audio_content.is_comment_available
}
const res = await api.modifyAudioContent(request)
if (res.status === 200 && res.data.success === true) {
this.cancel();
this.notifySuccess("수정되었습니다.");
this.cancel()
this.notifySuccess('수정되었습니다.')
this.audio_contents = [];
await this.getAudioContent();
this.audio_contents = []
await this.getAudioContent()
} else {
this.notifyError(
res.data.message ||
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
);
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
}
} catch (e) {
this.notifyError("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.");
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
} finally {
this.is_loading = false;
this.is_loading = false
}
},
async deleteAudioContent() {
if (this.is_loading) return;
this.is_loading = true;
this.is_loading = true
try {
let request = {
id: this.selected_audio_content.audioContentId,
isActive: false,
};
let request = {id: this.selected_audio_content.audioContentId, isActive: false}
const formData = new FormData();
formData.append("request", JSON.stringify(request));
const res = await api.modifyAudioContent(formData);
const res = await api.modifyAudioContent(request)
if (res.status === 200 && res.data.success === true) {
this.cancel();
this.notifySuccess("삭제되었습니다.");
this.cancel()
this.notifySuccess('삭제되었습니다.')
this.audio_contents = [];
await this.getAudioContent();
this.audio_contents = []
await this.getAudioContent()
} else {
this.notifyError(
res.data.message ||
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
);
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
}
} catch (e) {
this.notifyError("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.");
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
} finally {
this.is_loading = false;
this.is_loading = false
}
},
async next() {
if (this.search_word.length < 2) {
this.search_word = "";
await this.getAudioContent();
this.search_word = ''
await this.getAudioContent()
} else {
await this.searchAudioContent();
await this.searchAudioContent()
}
},
async getAudioContentThemeList() {
this.is_loading = true;
this.is_loading = true
try {
const res = await api.getAudioContentThemeList();
const res = await api.getAudioContentThemeList()
if (res.status === 200 && res.data.success === true) {
this.themeList = res.data.data.map((item) => {
return { title: item.theme, value: item.id };
});
return {title: item.theme, value: item.id}
})
} else {
this.notifyError(
res.data.message ||
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
);
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
}
this.is_loading = false;
this.is_loading = false
} catch (e) {
this.notifyError("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.");
this.is_loading = false;
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
this.is_loading = false
}
},
async getAudioContent() {
this.is_loading = true;
this.is_loading = true
try {
const res = await api.getAudioContentList(this.status, this.page);
const res = await api.getAudioContentList(this.status, this.page)
if (res.status === 200 && res.data.success === true) {
const data = res.data.data;
const data = res.data.data
const total_page = Math.ceil(data.totalCount / 10);
this.audio_contents = data.items;
const total_page = Math.ceil(data.totalCount / 10)
this.audio_contents = data.items
if (total_page <= 0) this.total_page = 1;
else this.total_page = total_page;
if (total_page <= 0)
this.total_page = 1
else
this.total_page = total_page
} else {
this.notifyError(
res.data.message ||
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
);
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
}
this.is_loading = false;
this.is_loading = false
} catch (e) {
this.notifyError("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.");
this.is_loading = false;
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
this.is_loading = false
}
},
async search() {
this.page = 1;
await this.searchAudioContent();
this.page = 1
await this.searchAudioContent()
},
async searchAudioContent() {
if (this.search_word.length === 0) {
await this.getAudioContent();
await this.getAudioContent()
} else if (this.search_word.length < 2) {
this.notifyError("검색어를 2글자 이상 입력하세요.");
this.notifyError('검색어를 2글자 이상 입력하세요.')
} else {
this.is_loading = true;
this.is_loading = true
try {
const res = await api.searchAudioContent(this.search_word, this.page);
const res = await api.searchAudioContent(this.search_word, this.page)
if (res.status === 200 && res.data.success === true) {
const data = res.data.data;
const data = res.data.data
const total_page = Math.ceil(data.totalCount / 10);
this.audio_contents = data.items;
const total_page = Math.ceil(data.totalCount / 10)
this.audio_contents = data.items
if (total_page <= 0) this.total_page = 1;
else this.total_page = total_page;
if (total_page <= 0)
this.total_page = 1
else
this.total_page = total_page
} else {
this.notifyError(
res.data.message ||
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
);
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
}
this.is_loading = false;
this.is_loading = false
} catch (e) {
this.notifyError(
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
);
this.is_loading = false;
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
this.is_loading = false
}
}
},
async shareAudioContent(item) {
this.is_loading = true;
this.is_loading = true
try {
const linkData = await dynamicLink.shareAudioContent(
item,
this.utm_source,
this.utm_medium,
this.utm_campaign
);
const linkData = await dynamicLink.shareAudioContent(item, this.utm_source, this.utm_medium, this.utm_campaign);
if (linkData.status === 200) {
await navigator.clipboard.writeText(linkData.data.shortLink);
this.notifySuccess("링크가 복사되었습니다.");
await navigator.clipboard.writeText(linkData.data.shortLink)
this.notifySuccess("링크가 복사되었습니다.")
} else {
this.notifyError("링크를 생성하지 못했습니다.");
this.notifyError("링크를 생성하지 못했습니다.")
}
} finally {
this.is_loading = false;
this.is_loading = false
}
},
},
};
}
}
</script>
<style scoped></style>
<style scoped>
</style>

View File

@@ -109,23 +109,6 @@
</v-col>
</v-row>
</v-card-text>
<!-- 언어 선택: 등록 시에만 노출 (수정 비노출) -->
<v-card-text v-if="!is_modify">
<v-row align="center">
<v-col cols="4">
언어
</v-col>
<v-col cols="8">
<v-select
v-model="banner.lang"
:items="langItems"
item-text="text"
item-value="value"
label="언어 선택"
/>
</v-col>
</v-row>
</v-card-text>
<v-card-text>
<v-row align="center">
<v-col cols="4">
@@ -344,7 +327,7 @@ export default {
show_write_dialog: false,
show_delete_confirm_dialog: false,
selected_banner: {},
banner: {type: 'CREATOR', tab_id: 1, lang: 'ko'},
banner: {type: 'CREATOR', tab_id: 1},
banners: [],
events: [],
creators: [],
@@ -352,12 +335,7 @@ export default {
search_query_creator: '',
search_query_series: '',
tabs: [],
selected_tab_id: 1,
langItems: [
{ text: '한국어', value: 'ko' },
{ text: '일본어', value: 'ja' },
{ text: '영어', value: 'en' }
]
selected_tab_id: 1
}
},
@@ -401,7 +379,7 @@ export default {
this.is_selecting = false
this.show_write_dialog = false
this.show_delete_confirm_dialog = false
this.banner = {type: 'CREATOR', tab_id: 1, lang: 'ko'}
this.banner = {type: 'CREATOR', tab_id: 1}
this.selected_banner = {}
this.search_query_creator = ''
this.search_query_series = ''
@@ -454,10 +432,6 @@ export default {
this.banner.link = banner.link
this.banner.is_adult = banner.isAdult
this.banner.tab_id = banner.tabId
// 수정 시 언어는 변경 불가하므로 UI를 표시하지 않음. 필요 시 내부 유지만 함 (기본값 또는 서버 값 사용)
if (banner.lang) {
this.banner.lang = banner.lang
}
setTimeout(() => {
this.is_selecting = false; // 선택 상태 해제
@@ -523,8 +497,7 @@ export default {
let request = {
type: this.banner.type,
isAdult: this.banner.is_adult,
lang: this.banner.lang || 'ko'
isAdult: this.banner.is_adult
}
if (this.banner.type === 'CREATOR') {

View File

@@ -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();
}
},
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()
},
},

View File

@@ -153,22 +153,6 @@
</v-col>
</v-row>
</v-card-text>
<v-card-text v-if="selected_recommend_live === null">
<v-row align="center">
<v-col cols="4">
언어
</v-col>
<v-col cols="8">
<v-select
v-model="lang"
:items="languageOptions"
item-text="label"
item-value="value"
label="언어 선택"
/>
</v-col>
</v-row>
</v-card-text>
<v-card-text>
<v-row align="center">
<v-col cols="4">
@@ -250,12 +234,6 @@ export default {
start_date: null,
end_date: null,
is_adult: false,
lang: 'ko',
languageOptions: [
{ label: '한국어', value: 'ko' },
{ label: '일본어', value: 'ja' },
{ label: '영어', value: 'en' },
],
headers: [
{
text: '이미지',
@@ -380,7 +358,6 @@ export default {
formData.append("start_date", this.start_date)
formData.append("end_date", this.end_date)
formData.append("is_adult", this.is_adult)
formData.append("lang", this.lang)
const res = await api.createRecommendCreatorBanner(formData);
if (res.status === 200 && res.data.success === true) {
@@ -406,8 +383,7 @@ export default {
this.image === null ||
this.creator_id === null ||
this.start_date === null ||
this.end_date === null ||
this.lang === null
this.end_date === null
) {
this.notifyError('내용을 입력하세요')
} else {
@@ -422,9 +398,6 @@ export default {
this.creator_id = null
this.start_date = null
this.end_date = null
this.is_adult = false
this.lang = 'ko'
this.selected_recommend_live = null
},
notifyError(message) {
@@ -498,8 +471,6 @@ export default {
}
},
showWriteDialog() {
this.selected_recommend_live = null
this.lang = 'ko'
this.show_write_dialog = true
},
}

View File

@@ -19,7 +19,7 @@
>
<v-btn
slot="append"
color="#3bb9f1"
color="#9970ff"
dark
@click="search"
>
@@ -171,7 +171,7 @@
<v-card-text>
<v-row align="center">
<v-col cols="4">
권한
사용 여부
</v-col>
<v-col cols="8">
<v-radio-group
@@ -183,32 +183,16 @@
value="CREATOR"
label="크리에이터"
/>
<v-radio
value="AGENT"
label="에이전트"
/>
<v-radio
value="USER"
label="일반회원"
/>
<v-radio
value="CONTENT_MANAGER"
label="콘텐츠 관리자"
/>
<v-spacer />
</v-radio-group>
</v-col>
</v-row>
</v-card-text>
<v-card-actions v-show="!is_loading">
<v-btn
color="error"
text
@click="showBlockReasonDialog"
>
차단
</v-btn>
<v-spacer />
<v-btn
color="blue darken-1"
text
@@ -216,6 +200,7 @@
>
비밀번호 재설정
</v-btn>
<v-spacer />
<v-btn
color="blue darken-1"
text
@@ -267,74 +252,6 @@
</v-card>
</v-dialog>
</v-row>
<v-row>
<v-dialog
v-model="show_block_reason_dialog"
max-width="500px"
persistent
>
<v-card>
<v-card-title>차단(탈퇴) 사유 입력</v-card-title>
<v-card-text>
<v-textarea
v-model="block_reason"
label="사유를 입력해주세요"
outlined
hide-details
/>
</v-card-text>
<v-card-actions v-show="!is_loading">
<v-spacer />
<v-btn
color="error"
text
@click="confirmBlock"
>
차단
</v-btn>
<v-btn
color="blue darken-1"
text
@click="cancelBlock"
>
취소
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-row>
<v-row>
<v-dialog
v-model="show_confirm_block_dialog"
max-width="500px"
persistent
>
<v-card>
<v-card-title class="text-h6">
'{{ nickname }}' 계정과 본인인증 정보, 같은 본인인증 정보를 사용하는 모든 계정을 차단합니다.
</v-card-title>
<v-card-actions v-show="!is_loading">
<v-spacer />
<v-btn
color="error"
text
@click="blockMember"
>
차단
</v-btn>
<v-btn
color="blue darken-1"
text
@click="cancelBlock"
>
취소
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-row>
</div>
</template>
@@ -357,9 +274,6 @@ export default {
user_type: null,
show_popup_dialog: false,
show_confirm_reset_password_dialog: false,
show_block_reason_dialog: false,
show_confirm_block_dialog: false,
block_reason: '',
}
},
@@ -453,10 +367,6 @@ export default {
this.user_type = 'USER'
} else if (member.userType === '크리에이터') {
this.user_type = 'CREATOR'
} else if (member.userType === '에이전트') {
this.user_type = 'AGENT'
} else if (member.userType === '콘텐츠 관리자') {
this.user_type = 'CONTENT_MANAGER'
}
this.email = member.email
@@ -472,51 +382,6 @@ export default {
this.user_type = null
this.show_popup_dialog = false
this.show_confirm_reset_password_dialog = false
this.show_block_reason_dialog = false
this.show_confirm_block_dialog = false
this.block_reason = ''
},
showBlockReasonDialog() {
this.show_popup_dialog = false
this.show_block_reason_dialog = true
},
cancelBlock() {
this.show_block_reason_dialog = false
this.show_confirm_block_dialog = false
this.block_reason = ''
this.show_popup_dialog = true
},
confirmBlock() {
if (this.block_reason.length === 0) {
this.notifyError('차단 사유를 입력해주세요.')
return
}
this.show_block_reason_dialog = false
this.show_confirm_block_dialog = true
},
async blockMember() {
this.is_loading = true
try {
const res = await api.blockMember(this.member.id, this.block_reason)
if (res.status === 200 && res.data.success === true) {
this.notifySuccess('차단되었습니다.')
this.cancel()
this.page = 1
await this.getMemberList()
} else {
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
}
this.is_loading = false
} catch (e) {
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
this.is_loading = false
}
},
async modify() {
@@ -524,9 +389,7 @@ export default {
if (
(this.user_type === 'CREATOR' && this.member.userType === '크리에이터') ||
(this.user_type === 'USER' && this.member.userType === '일반회원') ||
(this.user_type === 'AGENT' && this.member.userType === '에이전트') ||
(this.user_type === 'CONTENT_MANAGER' && this.member.userType === '콘텐츠 관리자')
(this.user_type === 'USER' && this.member.userType === '일반회원')
) {
this.notifyError("변경사항이 없습니다.")
} else {

View File

@@ -73,12 +73,6 @@
<td>
{{ total_sign_up_google_count }}
</td>
<td>
{{ total_sign_up_apple_count }}
</td>
<td>
{{ total_sign_up_line_count }}
</td>
<td>
{{ total_auth_count }}
</td>
@@ -111,14 +105,6 @@
{{ item.signUpGoogleCount.toLocaleString() }}
</template>
<template v-slot:item.signUpAppleCount="{ item }">
{{ item.signUpAppleCount.toLocaleString() }}
</template>
<template v-slot:item.signUpLineCount="{ item }">
{{ item.signUpLineCount.toLocaleString() }}
</template>
<template v-slot:item.authCount="{ item }">
{{ item.authCount.toLocaleString() }}
</template>
@@ -165,8 +151,6 @@ export default {
total_sign_up_email_count: 0,
total_sign_up_kakao_count: 0,
total_sign_up_google_count: 0,
total_sign_up_apple_count: 0,
total_sign_up_line_count: 0,
total_sign_out_count: 0,
total_payment_member_count: 0,
page: 1,
@@ -203,18 +187,6 @@ export default {
sortable: false,
value: 'signUpGoogleCount',
},
{
text: '애플 가입 수',
align: 'center',
sortable: false,
value: 'signUpAppleCount',
},
{
text: '라인 가입 수',
align: 'center',
sortable: false,
value: 'signUpLineCount',
},
{
text: '본인인증 수',
align: 'center',
@@ -281,8 +253,6 @@ export default {
this.total_sign_up_email_count = data.totalSignUpEmailCount
this.total_sign_up_kakao_count = data.totalSignUpKakaoCount
this.total_sign_up_google_count = data.totalSignUpGoogleCount
this.total_sign_up_apple_count = data.totalSignUpAppleCount
this.total_sign_up_line_count = data.totalSignUpLineCount
this.total_sign_out_count = data.totalSignOutCount
this.total_payment_member_count = data.totalPaymentMemberCount
this.items = data.items

View File

@@ -1,558 +0,0 @@
<template>
<div>
<v-toolbar dark>
<v-btn
icon
@click="goBack"
>
<v-icon>mdi-arrow-left</v-icon>
</v-btn>
<v-spacer />
<v-toolbar-title>시리즈 배너 관리</v-toolbar-title>
<v-spacer />
</v-toolbar>
<v-container>
<v-row>
<v-col cols="4">
<v-btn
color="primary"
dark
@click="showAddDialog"
>
배너 추가
</v-btn>
</v-col>
<v-spacer />
</v-row>
<!-- 로딩 표시 -->
<v-row v-if="isLoading && banners.length === 0">
<v-col class="text-center">
<v-progress-circular
indeterminate
color="primary"
size="64"
/>
</v-col>
</v-row>
<!-- 배너 그리드 -->
<v-row>
<draggable
v-model="banners"
class="row"
style="width: 100%"
:options="{ animation: 150 }"
@end="onDragEnd"
>
<v-col
v-for="banner in banners"
:key="banner.id"
cols="12"
sm="6"
md="4"
lg="3"
class="banner-item"
>
<v-card
class="mx-auto"
max-width="300"
>
<v-img
:src="banner.imagePath || banner.imageUrl"
height="200"
contain
/>
<v-card-text class="text-center">
<div>{{ resolveSeriesTitle(banner) }}</div>
<v-chip
v-if="banner.lang"
x-small
label
class="mt-1"
>
{{ banner.lang === 'ko' ? '한국어' : banner.lang === 'ja' ? '일본어' : '영어' }}
</v-chip>
</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn
small
color="primary"
@click="showEditDialog(banner)"
>
수정
</v-btn>
<v-btn
small
color="error"
@click="confirmDelete(banner)"
>
삭제
</v-btn>
<v-spacer />
</v-card-actions>
</v-card>
</v-col>
</draggable>
</v-row>
<!-- 데이터가 없을 표시 -->
<v-row v-if="!isLoading && banners.length === 0">
<v-col class="text-center">
<p>등록된 배너가 없습니다.</p>
</v-col>
</v-row>
<!-- 무한 스크롤 로딩 -->
<v-row v-if="isLoading && banners.length > 0">
<v-col class="text-center">
<v-progress-circular
indeterminate
color="primary"
/>
</v-col>
</v-row>
</v-container>
<!-- 배너 추가/수정 다이얼로그 -->
<v-dialog
v-model="showDialog"
max-width="600px"
persistent
>
<v-card>
<v-card-title>
<span class="headline">{{ isEdit ? '배너 수정' : '배너 추가' }}</span>
</v-card-title>
<v-card-text>
<v-container>
<v-row>
<v-col cols="12">
<v-file-input
v-model="bannerForm.image"
label="배너 이미지"
accept="image/*"
prepend-icon="mdi-camera"
show-size
truncate-length="15"
:rules="imageRules"
outlined
/>
</v-col>
</v-row>
<v-row v-if="previewImage || (isEdit && bannerForm.imageUrl)">
<v-col
cols="12"
class="text-center"
>
<v-img
:src="previewImage || bannerForm.imageUrl"
max-height="200"
contain
/>
</v-col>
</v-row>
<v-row v-if="!isEdit">
<v-col cols="12">
<v-select
v-model="bannerForm.lang"
:items="languages"
label="언어 선택"
outlined
:rules="[v => !!v || '언어를 선택하세요']"
/>
</v-col>
</v-row>
<v-row>
<v-col cols="12">
<v-text-field
v-model="searchKeyword"
label="시리즈 검색"
outlined
@keyup.enter="searchSeries"
/>
</v-col>
</v-row>
<v-row v-if="searchResults.length > 0">
<v-col cols="12">
<v-list>
<v-list-item
v-for="series in searchResults"
:key="series.id"
@click="selectSeries(series)"
>
<v-list-item-avatar>
<v-img :src="series.imageUrl" />
</v-list-item-avatar>
<v-list-item-content>
<v-list-item-title>{{ series.title || series.name }}</v-list-item-title>
</v-list-item-content>
</v-list-item>
</v-list>
</v-col>
</v-row>
<v-row v-if="searchPerformed && searchResults.length === 0">
<v-col cols="12">
<v-alert
type="info"
outlined
>
검색결과가 없습니다.
</v-alert>
</v-col>
</v-row>
<v-row v-if="selectedSeries">
<v-col cols="12">
<v-alert
type="info"
outlined
>
<v-row align="center">
<v-col cols="auto">
<v-avatar size="50">
<v-img :src="selectedSeries.imageUrl" />
</v-avatar>
</v-col>
<v-col>
<div class="font-weight-medium">
선택된 시리즈: {{ selectedSeries.title || selectedSeries.name }}
</div>
</v-col>
</v-row>
</v-alert>
</v-col>
</v-row>
</v-container>
</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn
color="blue darken-1"
text
@click="closeDialog"
>
취소
</v-btn>
<v-btn
color="blue darken-1"
text
:disabled="!isFormValid || isSubmitting"
@click="saveBanner"
>
{{ isSubmitting ? '저장중...' : (isEdit ? '수정' : '추가') }}
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<!-- 삭제 확인 다이얼로그 -->
<v-dialog
v-model="showDeleteDialog"
max-width="400px"
>
<v-card>
<v-card-title class="headline">
삭제 확인
</v-card-title>
<v-card-text>
배너를 삭제하시겠습니까?
</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn
color="blue darken-1"
text
@click="showDeleteDialog = false"
>
취소
</v-btn>
<v-btn
color="red darken-1"
text
:disabled="isSubmitting"
@click="deleteBanner"
>
삭제
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</div>
</template>
<script>
import draggable from 'vuedraggable'
import {
getSeriesBannerList,
createSeriesBanner,
updateSeriesBanner,
deleteSeriesBanner,
updateSeriesBannerOrder,
searchSeriesList
} from '@/api/audio_content_series'
export default {
name: 'ContentSeriesBanner',
components: { draggable },
data() {
return {
isLoading: false,
isSubmitting: false,
banners: [],
page: 1,
hasMoreItems: true,
showDialog: false,
showDeleteDialog: false,
isEdit: false,
selectedBanner: null,
selectedSeries: null,
searchKeyword: '',
searchResults: [],
searchPerformed: false,
previewImage: null,
languages: [
{ text: '한국어', value: 'ko' },
{ text: '일본어', value: 'ja' },
{ text: '영어', value: 'en' }
],
bannerForm: {
image: null,
imageUrl: '',
seriesId: null,
bannerId: null,
lang: 'ko'
},
imageRules: [
v => !!v || this.isEdit || '이미지를 선택하세요'
]
}
},
computed: {
isFormValid() {
return (this.bannerForm.image || (this.isEdit && this.bannerForm.imageUrl)) && this.selectedSeries && (this.isEdit || this.bannerForm.lang)
}
},
watch: {
'bannerForm.image'(newImage) {
if (newImage) {
this.createImagePreview(newImage)
} else {
this.previewImage = null
}
}
},
mounted() {
this.loadBanners()
window.addEventListener('scroll', this.handleScroll)
},
beforeDestroy() {
window.removeEventListener('scroll', this.handleScroll)
},
methods: {
notifyError(message) {
this.$dialog && this.$dialog.notify && this.$dialog.notify.error ? this.$dialog.notify.error(message) : console.error(message)
},
notifySuccess(message) {
this.$dialog && this.$dialog.notify && this.$dialog.notify.success ? this.$dialog.notify.success(message) : console.log(message)
},
goBack() {
this.$router.push('/content/series/list')
},
resolveSeriesTitle(banner) {
return banner.seriesTitle || banner.seriesName || banner.title || banner.name || '시리즈'
},
async loadBanners() {
if (this.isLoading || !this.hasMoreItems) return
this.isLoading = true
try {
const response = await getSeriesBannerList(this.page)
if (response && response.status === 200 && response.data && response.data.success === true) {
const data = response.data.data
const newBanners = (data && (data.content || data.items || data)) || []
this.banners = [...this.banners, ...newBanners]
this.hasMoreItems = newBanners.length > 0
this.page++
} else {
this.notifyError('배너 목록을 불러오는데 실패했습니다.')
}
} catch (e) {
this.notifyError('배너 목록을 불러오는데 실패했습니다.')
} finally {
this.isLoading = false
}
},
handleScroll() {
const scrollPosition = window.innerHeight + window.scrollY
const documentHeight = document.documentElement.offsetHeight
if (scrollPosition >= documentHeight - 200 && !this.isLoading && this.hasMoreItems) {
this.loadBanners()
}
},
showAddDialog() {
this.isEdit = false
this.selectedSeries = null
this.bannerForm = { image: null, imageUrl: '', seriesId: null, bannerId: null, lang: 'ko' }
this.previewImage = null
this.searchKeyword = ''
this.searchResults = []
this.searchPerformed = false
this.showDialog = true
},
showEditDialog(banner) {
this.isEdit = true
this.selectedBanner = banner
this.selectedSeries = {
id: banner.seriesId,
title: banner.seriesTitle || banner.seriesName || banner.title || banner.name,
imageUrl: banner.seriesImageUrl
}
this.bannerForm = {
image: null,
imageUrl: banner.imageUrl || banner.imagePath,
seriesId: banner.seriesId,
bannerId: banner.id,
lang: banner.lang || 'ko'
}
this.previewImage = null
this.searchKeyword = ''
this.searchResults = []
this.searchPerformed = false
this.showDialog = true
},
closeDialog() {
this.showDialog = false
this.selectedSeries = null
this.bannerForm = { image: null, imageUrl: '', seriesId: null, bannerId: null, lang: 'ko' }
this.previewImage = null
this.searchKeyword = ''
this.searchResults = []
this.searchPerformed = false
},
confirmDelete(banner) {
this.selectedBanner = banner
this.showDeleteDialog = true
},
createImagePreview(file) {
if (!file) return
const reader = new FileReader()
reader.onload = (e) => {
this.previewImage = e.target.result
}
reader.readAsDataURL(file)
},
async searchSeries() {
if (!this.searchKeyword || this.searchKeyword.length < 2) {
this.notifyError('검색어를 2글자 이상 입력하세요.')
return
}
try {
const response = await searchSeriesList(this.searchKeyword)
if (response && response.status === 200 && response.data && response.data.success === true) {
const data = response.data.data
this.searchResults = Array.isArray(data) ? data : (data && (data.content || data.items)) || []
this.searchPerformed = true
}
} catch (error) {
console.error('시리즈 검색 오류:', error)
this.notifyError('시리즈 검색에 실패했습니다.')
}
},
selectSeries(series) {
this.selectedSeries = series
this.bannerForm.seriesId = series.id
this.searchResults = []
},
async saveBanner() {
if (!this.isFormValid || this.isSubmitting) return
this.isSubmitting = true
try {
if (this.isEdit) {
const response = await updateSeriesBanner({
image: this.bannerForm.image,
seriesId: this.selectedSeries.id,
bannerId: this.bannerForm.bannerId
})
if (response && response.status === 200 && response.data && response.data.success === true) {
this.notifySuccess('배너가 수정되었습니다.')
this.closeDialog()
this.refreshBanners()
} else {
this.notifyError('배너 수정을 실패했습니다.')
}
} else {
const response = await createSeriesBanner({
image: this.bannerForm.image,
seriesId: this.selectedSeries.id,
lang: this.bannerForm.lang
})
if (response && response.status === 200 && response.data && response.data.success === true) {
this.notifySuccess('배너가 추가되었습니다.')
this.closeDialog()
this.refreshBanners()
} else {
this.notifyError('배너 추가를 실패했습니다.')
}
}
} catch (error) {
console.error('배너 저장 오류:', error)
this.notifyError('배너 저장에 실패했습니다.')
} finally {
this.isSubmitting = false
}
},
async deleteBanner() {
if (!this.selectedBanner || this.isSubmitting) return
this.isSubmitting = true
try {
const response = await deleteSeriesBanner(this.selectedBanner.id)
if (response && response.status === 200 && response.data && response.data.success === true) {
this.notifySuccess('배너가 삭제되었습니다.')
this.showDeleteDialog = false
this.refreshBanners()
} else {
this.notifyError('배너 삭제에 실패했습니다.')
}
} catch (error) {
console.error('배너 삭제 오류:', error)
this.notifyError('배너 삭제에 실패했습니다.')
} finally {
this.isSubmitting = false
}
},
refreshBanners() {
this.banners = []
this.page = 1
this.hasMoreItems = true
this.loadBanners()
},
async onDragEnd() {
try {
const bannerIds = this.banners.map(banner => banner.id)
const response = await updateSeriesBannerOrder(bannerIds)
if (response && response.status === 200 && response.data && response.data.success === true) {
this.notifySuccess('배너 순서가 변경되었습니다.')
} else {
this.notifyError('배너 순서 변경에 실패했습니다.')
}
} catch (error) {
console.error('배너 순서 변경 오류:', error)
this.notifyError('배너 순서 변경에 실패했습니다.')
this.refreshBanners()
}
}
}
}
</script>
<style scoped>
.banner-item {
transition: all 0.3s;
}
.banner-item:hover {
transform: translateY(-5px);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
</style>

View File

@@ -44,15 +44,9 @@
<th class="text-center">
연재여부
</th>
<th class="text-center">
연재요일
</th>
<th class="text-center">
19
</th>
<th class="text-center">
수정
</th>
</tr>
</thead>
<tbody>
@@ -79,20 +73,19 @@
<td>
<vue-show-more-text
:text="item.title"
:lines="2"
:lines="3"
/>
</td>
<td style="max-width: 200px !important; word-break:break-all; height: auto;">
<vue-show-more-text
:text="item.introduction"
:lines="2"
:lines="3"
/>
</td>
<td>{{ item.creatorNickname }}</td>
<td>{{ item.genre }}</td>
<td>{{ item.numberOfWorks }}</td>
<td>{{ item.state }}</td>
<td>{{ formatPublishedDays(item.publishedDaysOfWeek) }}</td>
<td>
<div v-if="item.isAdult">
O
@@ -101,17 +94,6 @@
X
</div>
</td>
<td class="text-center">
<v-btn
small
color="#3bb9f1"
dark
depressed
@click="openEditDialog(item)"
>
수정
</v-btn>
</td>
</tr>
</tbody>
</template>
@@ -129,165 +111,6 @@
</v-col>
</v-row>
</v-container>
<v-dialog
v-model="show_edit_dialog"
max-width="700px"
persistent
>
<v-card>
<v-card-title>
시리즈 수정
</v-card-title>
<v-card-text>
<v-row>
<v-col
cols="3"
class="text-center"
>
<v-img
:src="edit_target.coverImageUrl"
max-width="120"
max-height="120"
class="rounded-circle"
/>
</v-col>
<v-col cols="9">
<div style="font-weight:600;">
{{ edit_target.title }}
</div>
<div
v-if="edit_target.introduction"
style="max-height:80px; overflow:auto; word-break:break-all;"
>
{{ edit_target.introduction }}
</div>
</v-col>
</v-row>
<v-divider class="my-4" />
<v-row align="center">
<v-col
cols="4"
class="d-flex align-center"
>
장르
</v-col>
<v-col
cols="8"
class="d-flex align-center"
>
<v-select
v-model="edit_form.genreId"
:items="genre_list"
item-text="genre"
item-value="id"
:loading="is_loading_genres"
:disabled="is_saving || is_loading_genres"
label="장르를 선택하세요"
dense
hide-details
/>
</v-col>
</v-row>
<v-row align="center">
<v-col
cols="4"
class="d-flex align-center"
>
연재 요일
</v-col>
<v-col
cols="8"
class="d-flex align-center"
>
<v-row
dense
class="flex-grow-1"
>
<v-col
v-for="opt in daysOfWeekOptions"
:key="opt.value"
cols="6"
sm="4"
md="3"
class="py-0 my-0"
>
<v-checkbox
v-model="edit_form.publishedDaysOfWeek"
:label="opt.text"
:value="opt.value"
:disabled="is_saving"
dense
hide-details
class="ma-0 pa-0"
/>
</v-col>
</v-row>
</v-col>
</v-row>
<v-row align="center">
<v-col
cols="4"
class="d-flex align-center"
>
오리지널
</v-col>
<v-col
cols="8"
class="d-flex align-center"
>
<v-checkbox
v-model="edit_form.isOriginal"
:disabled="is_saving"
dense
hide-details
class="ma-0 pa-0"
/>
</v-col>
</v-row>
<v-row align="center">
<v-col
cols="4"
class="d-flex align-center"
>
19
</v-col>
<v-col
cols="8"
class="d-flex align-center"
>
<v-checkbox
v-model="edit_form.isAdult"
:disabled="is_saving"
dense
hide-details
class="ma-0 pa-0"
/>
</v-col>
</v-row>
</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn
text
:disabled="is_saving"
@click="cancelEdit"
>
취소
</v-btn>
<v-btn
color="#3bb9f1"
dark
depressed
:loading="is_saving"
:disabled="is_saving"
@click="saveEdit"
>
저장
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</div>
</template>
@@ -307,52 +130,7 @@ export default {
page: 1,
total_page: 0,
total_count: 0,
series_list: [],
// 수정 다이얼로그 상태/데이터
show_edit_dialog: false,
is_saving: false,
is_loading_genres: false,
genre_list: [],
edit_target: {},
edit_form: {
genreId: null,
isOriginal: false,
isAdult: false,
publishedDaysOfWeek: []
},
daysOfWeekOptions: [
{ value: 'RANDOM', text: '랜덤' },
{ value: 'SUN', text: '일' },
{ value: 'MON', text: '월' },
{ value: 'TUE', text: '화' },
{ value: 'WED', text: '수' },
{ value: 'THU', text: '목' },
{ value: 'FRI', text: '금' },
{ value: 'SAT', text: '토' }
]
}
},
watch: {
'edit_form.publishedDaysOfWeek': {
handler(newVal, oldVal) {
if (!Array.isArray(newVal)) return;
const hasRandom = newVal.includes('RANDOM');
const hadRandom = Array.isArray(oldVal) && oldVal.includes('RANDOM');
const others = newVal.filter(v => v !== 'RANDOM');
// RANDOM과 특정 요일은 함께 설정될 수 없음
if (hasRandom && others.length > 0) {
if (hadRandom) {
// RANDOM 상태에서 다른 요일을 선택한 경우 → RANDOM 제거, 나머지만 유지
this.edit_form.publishedDaysOfWeek = others;
} else {
// 다른 요일이 선택된 상태에서 RANDOM을 선택한 경우 → RANDOM만 유지
this.edit_form.publishedDaysOfWeek = ['RANDOM'];
}
}
},
deep: true
series_list: []
}
},
@@ -369,19 +147,6 @@ export default {
this.$dialog.notify.success(message)
},
// 연재 요일 표시용 포맷터
formatPublishedDays(days) {
if (!Array.isArray(days) || days.length === 0) return '-'
// RANDOM 우선 처리
if (days.includes('RANDOM')) return '랜덤'
const map = this.daysOfWeekOptions.reduce((acc, cur) => {
acc[cur.value] = cur.text
return acc
}, {})
const labels = days.map(d => map[d] || d)
return labels.join(', ')
},
async getAudioContentSeries() {
this.is_loading = true
@@ -411,96 +176,6 @@ export default {
async next() {
await this.getAudioContentSeries()
},
openEditDialog(item) {
this.edit_target = item
this.show_edit_dialog = true
this.is_saving = false
this.loadGenresThenInit()
},
async loadGenresThenInit() {
try {
this.is_loading_genres = true
if (!this.genre_list || this.genre_list.length === 0) {
const res = await api.getAudioContentSeriesGenreList()
if (res.status === 200 && res.data.success === true) {
this.genre_list = res.data.data || []
} else {
this.notifyError(res.data.message || '장르 목록을 불러오지 못했습니다.')
}
}
} catch (e) {
this.notifyError('장르 목록을 불러오지 못했습니다. 다시 시도해 주세요.')
} finally {
this.is_loading_genres = false
this.initEditForm()
}
},
initEditForm() {
const item = this.edit_target || {}
let genreId = item.genreId || null
if (!genreId && item.genre && this.genre_list && this.genre_list.length > 0) {
const found = this.genre_list.find(g => g.genre === item.genre)
if (found) genreId = found.id
}
// 초기 publishedDaysOfWeek 정규화 (RANDOM과 특정 요일 혼재 금지)
let published = Array.isArray(item.publishedDaysOfWeek) ? [...item.publishedDaysOfWeek] : []
if (published.includes('RANDOM')) {
const others = published.filter(v => v !== 'RANDOM')
published = others.length > 0 ? ['RANDOM'] : ['RANDOM']
}
this.edit_form = {
genreId: genreId,
isOriginal: typeof item.isOriginal === 'boolean' ? item.isOriginal : false,
isAdult: typeof item.isAdult === 'boolean' ? item.isAdult : false,
publishedDaysOfWeek: published
}
},
cancelEdit() {
this.show_edit_dialog = false
this.edit_target = {}
this.edit_form = {
genreId: null,
isOriginal: false,
isAdult: false,
publishedDaysOfWeek: []
}
},
async saveEdit() {
if (this.is_saving) return
if (!this.edit_form.genreId) {
this.notifyError('장르를 선택해 주세요.')
return
}
this.is_saving = true
try {
const days = Array.isArray(this.edit_form.publishedDaysOfWeek) ? this.edit_form.publishedDaysOfWeek : []
const payloadDays = days.includes('RANDOM') ? ['RANDOM'] : days
const request = {
seriesId: this.edit_target.id,
genreId: this.edit_form.genreId,
isOriginal: this.edit_form.isOriginal,
isAdult: this.edit_form.isAdult,
publishedDaysOfWeek: payloadDays
}
const res = await api.updateAudioContentSeries(request)
if (res.status === 200 && res.data.success === true) {
this.notifySuccess('수정되었습니다.')
this.show_edit_dialog = false
await this.getAudioContentSeries()
} else {
this.notifyError(res.data.message || '수정에 실패했습니다. 다시 시도해 주세요.')
}
} catch (e) {
this.notifyError('수정에 실패했습니다. 다시 시도해 주세요.')
} finally {
this.is_saving = false
}
},
}
}
</script>