|
|
@@ -16,232 +16,16 @@
|
|
|
<el-row>
|
|
|
<el-tabs v-model="activeName" @tab-click='tabClick'>
|
|
|
<el-tab-pane label="视频" name="video">
|
|
|
- <el-row :md="6" :sm="12" :xs="12">
|
|
|
- <el-table
|
|
|
- :data="dataList"
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <el-table-column
|
|
|
- type="index">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="pubDate"
|
|
|
- label="发布时间">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="coverUrl"
|
|
|
- label="封面"
|
|
|
- width="80">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-image :src="scope.row.coverUrl" min-width="40" height="30" />
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="videoId"
|
|
|
- label="视频 ID">
|
|
|
- <template slot-scope="scope">
|
|
|
- <router-link target="_blank" :to="`/video/${scope.row.videoId}`">
|
|
|
- <span>{{scope.row.videoId}}</span>
|
|
|
- </router-link>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="title"
|
|
|
- label="标题">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="description"
|
|
|
- label="描述">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="scope"
|
|
|
- label="可见范围">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-tooltip class="item" effect="dark" content="点击修改视频可见范围" placement="top-end">
|
|
|
- <el-button
|
|
|
- v-if="scope.row.scope === 1"
|
|
|
- size="mini"
|
|
|
- @click="handleScope(scope.$index, scope.row)">所有人可见</el-button>
|
|
|
- <el-button
|
|
|
- v-else-if="scope.row.scope === 2"
|
|
|
- size="mini"
|
|
|
- type="success"
|
|
|
- @click="handleScope(scope.$index, scope.row)">VIP 可见</el-button>
|
|
|
- <el-button
|
|
|
- v-else-if="scope.row.scope === 3"
|
|
|
- size="mini"
|
|
|
- type="warning"
|
|
|
- @click="handleScope(scope.$index, scope.row)">验证码可见</el-button>
|
|
|
- <el-button
|
|
|
- v-else
|
|
|
- size="mini"
|
|
|
- type="danger"
|
|
|
- @click="handleScope(scope.$index, scope.row)">本人可见</el-button>
|
|
|
- </el-tooltip>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="scope"
|
|
|
- label="审核状态">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-tag v-if="scope.row.status === 1" :type="'warning'" disable-transitions>
|
|
|
- 审核中
|
|
|
- </el-tag>
|
|
|
- <el-tag v-else-if="scope.row.status === 2" :type="'success'" disable-transitions>
|
|
|
- 审核通过
|
|
|
- </el-tag>
|
|
|
- <el-tag v-else-if="scope.row.status === 3" :type="'danger'" disable-transitions>
|
|
|
- 审核未通过
|
|
|
- </el-tag>
|
|
|
- <el-tag v-else :type="'danger'" disable-transitions>
|
|
|
- 下架
|
|
|
- </el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作" width="210">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- @click="handlePreview(scope.$index, scope.row)">预览</el-button>
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="danger"
|
|
|
- @click="handleDelete(scope.$index, scope.row)">删除</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </el-row>
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane label="相册" name="image">
|
|
|
- <el-row :md="6" :sm="12" :xs="12">
|
|
|
- <el-table
|
|
|
- :data="dataList"
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <el-table-column
|
|
|
- type="index">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="coverUrl"
|
|
|
- label="相册封面"
|
|
|
- width="150">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-image :src="scope.row.coverUrl" min-width="40" height="30" />
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="pubDate"
|
|
|
- label="发布时间">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="albumName"
|
|
|
- label="相册名字"
|
|
|
- width="180">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="total"
|
|
|
- label="图片数量">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="scope"
|
|
|
- label="可见范围">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-tag v-if="scope.row.scope === 1" disable-transitions>
|
|
|
- 全部可见
|
|
|
- </el-tag>
|
|
|
- <el-tag v-else-if="scope.row.scope === 2" :type="'success'" disable-transitions>
|
|
|
- VIP 可见
|
|
|
- </el-tag>
|
|
|
- <el-tag v-else-if="scope.row.scope === 3" :type="'warning'" disable-transitions>
|
|
|
- 验证码可见
|
|
|
- </el-tag>
|
|
|
- <el-tag v-else :type="'danger'" disable-transitions>
|
|
|
- 本人可见
|
|
|
- </el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- @click="handleEditImage(scope.$index, scope.row)">编辑</el-button>
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="danger"
|
|
|
- @click="handleDeleteImage(scope.$index, scope.row)">删除</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </el-row>
|
|
|
+ <video-post :data-list="dataList"/>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="音频" name="audio">
|
|
|
- <el-row :md="6" :sm="12" :xs="12">
|
|
|
- <el-table
|
|
|
- :data="dataList"
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <el-table-column
|
|
|
- type="index">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="coverUrl"
|
|
|
- label="音频封面"
|
|
|
- width="150">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-image :src="scope.row.coverUrl" min-width="40" height="30" />
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="pubDate"
|
|
|
- label="发布时间">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="title"
|
|
|
- label="音频名字">
|
|
|
- </el-table-column>
|
|
|
- <!-- <el-table-column
|
|
|
- prop="description"
|
|
|
- label="音频简介">
|
|
|
- </el-table-column>-->
|
|
|
- <el-table-column
|
|
|
- prop="scope"
|
|
|
- label="可见范围">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-tag v-if="scope.row.scope === 1" disable-transitions>
|
|
|
- 全部可见
|
|
|
- </el-tag>
|
|
|
- <el-tag v-else-if="scope.row.scope === 2" :type="'success'" disable-transitions>
|
|
|
- VIP 可见
|
|
|
- </el-tag>
|
|
|
- <el-tag v-else-if="scope.row.scope === 3" :type="'warning'" disable-transitions>
|
|
|
- 验证码可见
|
|
|
- </el-tag>
|
|
|
- <el-tag v-else :type="'danger'" disable-transitions>
|
|
|
- 本人可见
|
|
|
- </el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- @click="handleEditAudio(scope.$index, scope.row)">编辑</el-button>
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="danger"
|
|
|
- @click="handleDeleteAudio(scope.$index, scope.row)">删除</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </el-row>
|
|
|
+ <audio-post :data-list="dataList"/>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="相册" name="image">
|
|
|
+ <image-post :data-list="dataList"/>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="文章" name="article">
|
|
|
- <span>
|
|
|
- <h4>文章稿件</h4>
|
|
|
- </span>
|
|
|
+ <article-post :data-list="dataList"/>
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</el-row>
|
|
|
@@ -261,59 +45,23 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-col>
|
|
|
-
|
|
|
- <!-- 修改视频可见范围对话框 -->
|
|
|
- <el-dialog
|
|
|
- append-to-body
|
|
|
- :visible.sync="showEditScopeDialog"
|
|
|
- width="30%"
|
|
|
- center
|
|
|
- >
|
|
|
- <el-card class="box-card">
|
|
|
- <div slot="header" class="clearfix">
|
|
|
- <span>修改视频可见范围</span>
|
|
|
- <el-button style="float: right; padding: 3px 0" type="text" @click="onUpdateVideoScope">更新</el-button>
|
|
|
- </div>
|
|
|
- <div class="text item">
|
|
|
- <el-form ref="form" :model="form" label-width="80px">
|
|
|
- <el-form-item label="可见范围">
|
|
|
- <el-select v-model="form.scope" placeholder="选择可见范围">
|
|
|
- <el-option label="所有人可见" value="1" />
|
|
|
- <el-option label="验证码可见" value="2" />
|
|
|
- <el-option label="VIP 可见" value="3" />
|
|
|
- <el-option label="仅自己可见" value="4" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </div>
|
|
|
- </el-card>
|
|
|
- </el-dialog>
|
|
|
- <!-- 视频预览对话框 -->
|
|
|
- <el-dialog
|
|
|
- title="预览视频"
|
|
|
- append-to-body
|
|
|
- :visible.sync="showPreviewDialog"
|
|
|
- :before-close="handleDialogClose"
|
|
|
- width="70%"
|
|
|
- center
|
|
|
- >
|
|
|
- <template>
|
|
|
- <video-preview-player :video-prop.sync="this.videoProp"/>
|
|
|
- </template>
|
|
|
- </el-dialog>
|
|
|
</el-row>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import VideoPreviewPlayer from 'components/VideoPreviewPlayer'
|
|
|
+import VideoPost from "@/views/post/VideoPost";
|
|
|
+import AudioPost from "@/views/post/AudioPost";
|
|
|
+import ImagePost from "@/views/post/ImagePost";
|
|
|
+import ArticlePost from "@/views/post/ArticlePost";
|
|
|
|
|
|
-import {userVideoPost, updateVideoScope, videoInfo, deleteVideo} from "@/api/video";
|
|
|
-import {getUserAlbums} from "@/api/image";
|
|
|
+import { userVideoPost } from "@/api/video";
|
|
|
import { getUserAudio } from "@/api/audio";
|
|
|
+import { getUserAlbums } from "@/api/image";
|
|
|
+import { getArticles } from "@/api/article";
|
|
|
|
|
|
export default {
|
|
|
name: 'PostList',
|
|
|
- components: { VideoPreviewPlayer },
|
|
|
+ components: { VideoPost, ImagePost, AudioPost, ArticlePost },
|
|
|
data() {
|
|
|
return {
|
|
|
// 屏幕宽度, 为了控制分页条的大小
|
|
|
@@ -333,10 +81,6 @@ export default {
|
|
|
showPreviewDialog: false,
|
|
|
videoProp: null,
|
|
|
showEditScopeDialog: false,
|
|
|
- form: {
|
|
|
- videoId: null,
|
|
|
- scope: null
|
|
|
- }
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
@@ -371,65 +115,6 @@ export default {
|
|
|
// 回到顶部
|
|
|
scrollTo(0, 0)
|
|
|
},
|
|
|
- handleScope(index, row) {
|
|
|
- this.form.videoId = row.videoId
|
|
|
- this.form.scope = row.scope
|
|
|
- this.showEditScopeDialog = true
|
|
|
- },
|
|
|
- handleDialogClose(done) {
|
|
|
- this.showPreviewDialog = false
|
|
|
- this.videoProp = {
|
|
|
- videoId: null,
|
|
|
- play: false
|
|
|
- }
|
|
|
- done()
|
|
|
- },
|
|
|
- handlePreview(index, row) {
|
|
|
- videoInfo(row.videoId).then(res => {
|
|
|
- if (res.code === 0) {
|
|
|
- this.showPreviewDialog = true
|
|
|
- this.videoProp = {
|
|
|
- videoId: res.data.videoId,
|
|
|
- play: true
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- console.log('预览 ' + row.videoId);
|
|
|
- },
|
|
|
- handleEdit(index, row) {
|
|
|
- console.log(row.videoId);
|
|
|
- const path = '/post/edit/video/' + row.videoId
|
|
|
- this.$router.push(path)
|
|
|
- },
|
|
|
- handleDelete(index, row) {
|
|
|
- deleteVideo(row.videoId).then(res => {
|
|
|
- if (res.code === 0) {
|
|
|
- this.$notify({
|
|
|
- title: '提示',
|
|
|
- message: '视频稿件已删除',
|
|
|
- type: 'warning',
|
|
|
- duration: 3000
|
|
|
- })
|
|
|
- this.$router.go(0)
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- handleEditImage(index, row) {
|
|
|
- console.log(row.videoId);
|
|
|
- const path = '/post/edit/album/' + row.albumId
|
|
|
- this.$router.push(path)
|
|
|
- },
|
|
|
- handleDeleteImage(index, row) {
|
|
|
- console.log(row.videoId);
|
|
|
- },
|
|
|
- handleEditAudio(index, row) {
|
|
|
- console.log(row.videoId);
|
|
|
- const path = '/post/edit/audio/' + row.audioId
|
|
|
- this.$router.push(path)
|
|
|
- },
|
|
|
- handleDeleteAudio(index, row) {
|
|
|
- console.log(row.videoId);
|
|
|
- },
|
|
|
tabClick(tab) {
|
|
|
this.activeName = tab.name
|
|
|
this.goToTab(this.activeName)
|
|
|
@@ -505,28 +190,21 @@ export default {
|
|
|
} else if (this.activeName === 'article') {
|
|
|
this.currentPage = 1
|
|
|
this.lastId = 0
|
|
|
+ getArticles(1).then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ const resData = res.data.list
|
|
|
+ if (resData.length !== 0) {
|
|
|
+ this.showEmpty = false
|
|
|
+ for (const item of resData) {
|
|
|
+ this.dataList.push(item)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.showEmpty = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
- onUpdateVideoScope() {
|
|
|
- this.showEditScopeDialog = false
|
|
|
- updateVideoScope(this.form).then(res => {
|
|
|
- if (res.code === 0) {
|
|
|
- this.$notify({
|
|
|
- title: '提示',
|
|
|
- message: '视频可见范围已更新',
|
|
|
- type: 'warning',
|
|
|
- duration: 3000
|
|
|
- })
|
|
|
- }
|
|
|
- }).catch(error => {
|
|
|
- this.$notify({
|
|
|
- title: '提示',
|
|
|
- message: error.message,
|
|
|
- type: 'warning',
|
|
|
- duration: 3000
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
</script>
|