| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- <template>
- <el-container>
- <el-header height="220">
- <h3>实时日志</h3>
- </el-header>
- <el-main>
- </el-main>
- <!-- 修改视频可见范围对话框 -->
- <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="onUpdateScope">更新</el-button>
- </div>
- <div class="text item">
- <el-select v-model="form.scope" placeholder="选择可见范围">
- <el-option label="本人可见" value="1" />
- <el-option label="所有人可见" value="2" />
- <el-option label="VIP 可见" value="3" />
- </el-select>
- </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="videoProp" />
- </template>
- </el-dialog>
- </el-container>
- </template>
- <script>
- import VideoPreviewPlayer from 'components/VideoPreviewPlayer'
- import { updateVideoScope, videoInfo } from '@/api/vod'
- import { getVideoList } from '@/api/admin'
- export default {
- name: 'VideoPost',
- components: { VideoPreviewPlayer },
- data() {
- return {
- queryInfo: {
- scope: null,
- pn: 1
- },
- // 屏幕宽度, 为了控制分页条的大小
- screenWidth: document.body.clientWidth,
- currentPage: 1,
- pageSize: 10,
- totalSize: 0,
- dataList: [],
- nextId: 0,
- // **********************************************************************
- videoProp: null,
- showVideoResourceDialog: false,
- showEditScopeDialog: false,
- showPreviewDialog: false,
- form: {
- videoId: null,
- scope: 1
- },
- videoResources: [],
- publishVideoDiaglog: false
- }
- },
- created() {
- document.title = 'AdminVideoList'
- this.getData()
- },
- methods: {
- handleCurrentChange(pageNumber) {
- this.currentPage = pageNumber
- this.getData()
- // 回到顶部
- scrollTo(0, 0)
- },
- getData() {
- this.dataList = []
- getVideoList(0).then(resp => {
- if (resp.code === 0) {
- const respData = resp.data
- this.dataList = respData.list
- this.totalSize = respData.totalSize
- } else {
- this.$message.error(resp.msg)
- }
- })
- },
- onRefresh() {
- this.getData()
- },
- 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
- }
- }
- })
- },
- handleEdit(index, row) {
- const path = '/post/video/edit/' + row.videoId
- this.$router.push(path)
- },
- onUpdateScope() {
- 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
- })
- })
- },
- onSelectChange() {
- this.$message.info(this.queryInfo)
- },
- handleClose() {
- }
- }
- }
- </script>
- <style>
- </style>
|