시리즈 메뉴
1. 시리즈 디렉토리 생성 2. 시리즈 장르, 리스트 페이지 UI - 콘텐츠 디렉토리에서 시리즈 디렉토리로 이동 3. webpackChunk - content -> series 로 분리
This commit is contained in:
@@ -1,330 +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="10" />
|
||||
<v-col>
|
||||
<v-btn
|
||||
block
|
||||
color="#9970ff"
|
||||
dark
|
||||
depressed
|
||||
@click="showWriteDialog"
|
||||
>
|
||||
시리즈 장르 등록
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:items="series_genre_list"
|
||||
:loading="is_loading"
|
||||
item-key="id"
|
||||
class="elevation-1"
|
||||
hide-default-footer
|
||||
disable-pagination
|
||||
>
|
||||
<template v-slot:body="props">
|
||||
<draggable
|
||||
v-model="props.items"
|
||||
tag="tbody"
|
||||
@end="onDropCallback(props.items)"
|
||||
>
|
||||
<tr
|
||||
v-for="(item, index) in props.items"
|
||||
:key="index"
|
||||
>
|
||||
<td>
|
||||
{{ item.genre }}
|
||||
</td>
|
||||
<td>
|
||||
<h3 v-if="item.isAdult">
|
||||
O
|
||||
</h3>
|
||||
<h3 v-else>
|
||||
X
|
||||
</h3>
|
||||
</td>
|
||||
<td>
|
||||
<v-row>
|
||||
<v-col />
|
||||
<v-col>
|
||||
<v-btn
|
||||
:disabled="is_loading"
|
||||
@click="deleteConfirm(item)"
|
||||
>
|
||||
삭제
|
||||
</v-btn>
|
||||
</v-col>
|
||||
<v-col />
|
||||
</v-row>
|
||||
</td>
|
||||
</tr>
|
||||
</draggable>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
|
||||
<v-dialog
|
||||
v-model="show_write_dialog"
|
||||
max-width="1000px"
|
||||
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-text-field
|
||||
v-model="series_genre.genre"
|
||||
label="장르"
|
||||
required
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
<v-card-text>
|
||||
<v-row>
|
||||
<v-col cols="4">
|
||||
19금
|
||||
</v-col>
|
||||
<v-col cols="8">
|
||||
<input
|
||||
v-model="series_genre.is_adult"
|
||||
type="checkbox"
|
||||
>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
<v-card-actions v-show="!is_loading">
|
||||
<v-spacer />
|
||||
<v-btn
|
||||
color="blue darken-1"
|
||||
text
|
||||
@click="cancel"
|
||||
>
|
||||
취소
|
||||
</v-btn>
|
||||
<v-btn
|
||||
color="blue darken-1"
|
||||
text
|
||||
@click="submit"
|
||||
>
|
||||
등록
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
<v-dialog
|
||||
v-model="show_delete_confirm_dialog"
|
||||
max-width="400px"
|
||||
persistent
|
||||
>
|
||||
<v-card>
|
||||
<v-card-text />
|
||||
<v-card-text>
|
||||
"{{ selected_series_genre.genre }}"을 삭제하시겠습니까?
|
||||
</v-card-text>
|
||||
<v-card-actions v-show="!is_loading">
|
||||
<v-spacer />
|
||||
<v-btn
|
||||
color="blue darken-1"
|
||||
text
|
||||
@click="deleteCancel"
|
||||
>
|
||||
취소
|
||||
</v-btn>
|
||||
<v-btn
|
||||
color="blue darken-1"
|
||||
text
|
||||
@click="deleteSeriesGenre"
|
||||
>
|
||||
확인
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Draggable from 'vuedraggable';
|
||||
import * as api from '@/api/audio_content_series';
|
||||
|
||||
export default {
|
||||
name: "ContentSeriesGenre",
|
||||
components: {Draggable},
|
||||
data() {
|
||||
return {
|
||||
is_loading: false,
|
||||
show_delete_confirm_dialog: false,
|
||||
show_write_dialog: false,
|
||||
selected_series_genre: {},
|
||||
series_genre: {is_adult: false},
|
||||
series_genre_list: [],
|
||||
headers: [
|
||||
{
|
||||
text: '장르',
|
||||
align: 'center',
|
||||
sortable: false,
|
||||
value: 'genre',
|
||||
},
|
||||
{
|
||||
text: '19금',
|
||||
align: 'center',
|
||||
sortable: false,
|
||||
value: 'isAdult',
|
||||
},
|
||||
{
|
||||
text: '관리',
|
||||
align: 'center',
|
||||
sortable: false,
|
||||
value: 'management'
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
|
||||
async created() {
|
||||
await this.getSeriesGenreList();
|
||||
},
|
||||
|
||||
methods: {
|
||||
notifyError(message) {
|
||||
this.$dialog.notify.error(message)
|
||||
},
|
||||
|
||||
notifySuccess(message) {
|
||||
this.$dialog.notify.success(message)
|
||||
},
|
||||
|
||||
showWriteDialog() {
|
||||
this.show_write_dialog = true
|
||||
},
|
||||
|
||||
cancel() {
|
||||
this.series_genre = {is_adult: false}
|
||||
this.selected_series_genre = {}
|
||||
this.show_write_dialog = false
|
||||
},
|
||||
|
||||
deleteConfirm(series_genre) {
|
||||
this.selected_series_genre = series_genre
|
||||
this.show_delete_confirm_dialog = true
|
||||
},
|
||||
|
||||
deleteCancel() {
|
||||
this.selected_series_genre = {}
|
||||
this.show_delete_confirm_dialog = false
|
||||
},
|
||||
|
||||
async submit() {
|
||||
if (this.is_loading) return;
|
||||
this.isLoading = true
|
||||
|
||||
try {
|
||||
const res = await api.createAudioContentSeriesGenre(this.series_genre.genre, this.series_genre.is_adult)
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
this.cancel()
|
||||
this.notifySuccess('등록되었습니다.')
|
||||
|
||||
this.series_genre_list = []
|
||||
await this.getSeriesGenreList()
|
||||
} else {
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
}
|
||||
} catch (e) {
|
||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
} finally {
|
||||
this.is_loading = false
|
||||
}
|
||||
},
|
||||
|
||||
async getSeriesGenreList() {
|
||||
this.is_loading = true
|
||||
|
||||
try {
|
||||
const res = await api.getAudioContentSeriesGenreList()
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
this.series_genre_list = res.data.data
|
||||
} else {
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
}
|
||||
} catch (e) {
|
||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
} finally {
|
||||
this.is_loading = false
|
||||
}
|
||||
},
|
||||
|
||||
async onDropCallback(items) {
|
||||
this.series_genre_list = items
|
||||
const ids = items.map((item) => {
|
||||
return item.id
|
||||
})
|
||||
|
||||
try {
|
||||
this.is_loading = true
|
||||
const res = await api.updateAudioContentSeriesGenreOrders(ids)
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
this.notifySuccess(res.data.message)
|
||||
} else {
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
}
|
||||
} catch (e) {
|
||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
} finally {
|
||||
this.is_loading = false
|
||||
}
|
||||
},
|
||||
|
||||
async deleteSeriesGenre() {
|
||||
if (this.is_loading) return;
|
||||
this.is_loading = true
|
||||
|
||||
try {
|
||||
let request = {id: this.selected_series_genre.id, isActive: false}
|
||||
|
||||
const res = await api.updateAudioContentSeriesGenre(request)
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
this.show_delete_confirm_dialog = false
|
||||
this.cancel()
|
||||
this.notifySuccess('삭제되었습니다.')
|
||||
|
||||
this.series_genre_list = []
|
||||
await this.getSeriesGenreList()
|
||||
} else {
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
}
|
||||
} catch (e) {
|
||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
} finally {
|
||||
this.is_loading = false
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@@ -1,191 +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 class="text-left total-count">
|
||||
전체 <span>{{ total_count }}</span> 개
|
||||
</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>
|
||||
<th class="text-center">
|
||||
19금
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr
|
||||
v-for="item in series_list"
|
||||
:key="item.id"
|
||||
>
|
||||
<td>{{ item.id }}</td>
|
||||
<td align="center">
|
||||
<v-img
|
||||
max-width="70"
|
||||
max-height="70"
|
||||
:src="item.coverImageUrl"
|
||||
class="rounded-circle"
|
||||
/>
|
||||
<br>
|
||||
<a
|
||||
:href="item.coverImageUrl"
|
||||
class="v-btn v-btn--outlined"
|
||||
>
|
||||
다운로드
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<vue-show-more-text
|
||||
:text="item.title"
|
||||
:lines="3"
|
||||
/>
|
||||
</td>
|
||||
<td style="max-width: 200px !important; word-break:break-all; height: auto;">
|
||||
<vue-show-more-text
|
||||
:text="item.introduction"
|
||||
:lines="3"
|
||||
/>
|
||||
</td>
|
||||
<td>{{ item.creatorNickname }}</td>
|
||||
<td>{{ item.genre }}</td>
|
||||
<td>{{ item.numberOfWorks }}</td>
|
||||
<td>{{ item.state }}</td>
|
||||
<td>
|
||||
<div v-if="item.isAdult">
|
||||
O
|
||||
</div>
|
||||
<div v-else>
|
||||
X
|
||||
</div>
|
||||
</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="next"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as api from '@/api/audio_content_series'
|
||||
|
||||
import VueShowMoreText from 'vue-show-more-text'
|
||||
|
||||
export default {
|
||||
name: "AudioContentSeriesList",
|
||||
|
||||
components: {VueShowMoreText},
|
||||
|
||||
data() {
|
||||
return {
|
||||
is_loading: false,
|
||||
page: 1,
|
||||
total_page: 0,
|
||||
total_count: 0,
|
||||
series_list: []
|
||||
}
|
||||
},
|
||||
|
||||
async created() {
|
||||
await this.getAudioContentSeries()
|
||||
},
|
||||
|
||||
methods: {
|
||||
notifyError(message) {
|
||||
this.$dialog.notify.error(message)
|
||||
},
|
||||
|
||||
notifySuccess(message) {
|
||||
this.$dialog.notify.success(message)
|
||||
},
|
||||
|
||||
async getAudioContentSeries() {
|
||||
this.is_loading = true
|
||||
|
||||
try {
|
||||
const res = await api.getAudioContentSeriesList(this.page)
|
||||
if (res.status === 200 && res.data.success === true) {
|
||||
const data = res.data.data
|
||||
const total_page = Math.ceil(data.totalCount / 10)
|
||||
this.series_list = data.items
|
||||
this.total_count = data.totalCount
|
||||
|
||||
if (total_page <= 0)
|
||||
this.total_page = 1
|
||||
else
|
||||
this.total_page = total_page
|
||||
} else {
|
||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
}
|
||||
|
||||
this.is_loading = false
|
||||
} catch (e) {
|
||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||
this.is_loading = false
|
||||
}
|
||||
},
|
||||
|
||||
async next() {
|
||||
await this.getAudioContentSeries()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.total-count {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.total-count > span {
|
||||
color: #3bb9f1;
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user