Initial commit
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,645 @@
|
||||
/* eslint-disable no-unreachable */
|
||||
<template>
|
||||
<div v-if="show" class="add-video-box" :class="show ? 'show' : ''">
|
||||
<div class="title">
|
||||
<i class="el-icon-back" @click="close"> 返回</i>
|
||||
<span>新增视频</span>
|
||||
</div>
|
||||
<div>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<div class="flex-item">
|
||||
<el-form-item label="上传类型:" prop="newsType">
|
||||
<el-select
|
||||
v-model="form.newsType"
|
||||
size="small"
|
||||
placeholder="请选择上传类型"
|
||||
clearable
|
||||
>
|
||||
<el-option value="SP" label="长视频"></el-option>
|
||||
<el-option value="SHORT" label="短视频"></el-option>
|
||||
<el-option value="COVER" label="图文"></el-option>
|
||||
<el-option value="SEED_LINK" label="种子贴"></el-option>
|
||||
<el-option value="AD_SP" label="视频广告"></el-option>
|
||||
<el-option value="AD_COVER" label="图片广告"></el-option>
|
||||
<el-option value="PIC" label="图集"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<div class="flex-item">
|
||||
<el-form-item
|
||||
label="上传视频:"
|
||||
v-if="
|
||||
form.newsType === 'SP' ||
|
||||
form.newsType === 'SHORT' ||
|
||||
form.newsType === 'AD_SP' ||
|
||||
form.newsType === 'SEED_LINK'
|
||||
"
|
||||
>
|
||||
<!--视频分片上传-->
|
||||
<uploader
|
||||
:options="options"
|
||||
class="uploader-example"
|
||||
ref="uploader"
|
||||
@file-added="fileAdd"
|
||||
@file-success="onFileSuccess"
|
||||
>
|
||||
<uploader-unsupport></uploader-unsupport>
|
||||
<uploader-drop>
|
||||
<uploader-btn :attrs="attrs">上传视频</uploader-btn>
|
||||
</uploader-drop>
|
||||
<uploader-list style="width: 680px"></uploader-list>
|
||||
</uploader>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="封面上传:"
|
||||
prop="cover"
|
||||
v-if="
|
||||
form.newsType === 'SP' ||
|
||||
form.newsType === 'SHORT' ||
|
||||
form.newsType === 'AD_SP' ||
|
||||
form.newsType === 'SEED_LINK'
|
||||
"
|
||||
>
|
||||
<base-upload
|
||||
:cover="form.cover"
|
||||
:action="action"
|
||||
@successCallback="successCallback"
|
||||
:id="form.sourceID"
|
||||
:wSize="360"
|
||||
:hSize="640"
|
||||
:width="'120px'"
|
||||
:height="'213px'"
|
||||
></base-upload>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="flex-item">
|
||||
<el-form-item style="width: 1100px" label="上传图集:" prop="cover">
|
||||
<!--上传图集-->
|
||||
<imgs-upload
|
||||
:cover="form.cover"
|
||||
:action="actionPics"
|
||||
@successCallback="successCallbackPic"
|
||||
:id="form.sourceID"
|
||||
:wSize="180"
|
||||
:hSize="320"
|
||||
:width="'100px'"
|
||||
:height="'100px'"
|
||||
></imgs-upload>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="flex-item">
|
||||
<el-form-item label="视频标题:" prop="title">
|
||||
<el-input v-model="form.title" size="small"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="免费时长:" prop="freeTime">
|
||||
<el-input v-model.number="form.freeTime" size="small"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="帖子定价:"
|
||||
prop="coins"
|
||||
v-if="
|
||||
form.newsType === 'SP' ||
|
||||
form.newsType === 'SHORT' ||
|
||||
form.newsType === 'COVER' ||
|
||||
form.newsType === 'SEED_LINK'
|
||||
"
|
||||
>
|
||||
<el-input
|
||||
v-model.number="form.coins"
|
||||
size="small"
|
||||
@input="changeInput()"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item v-else></el-form-item>
|
||||
</div>
|
||||
<div class="flex-item">
|
||||
<el-form-item label="视频内容:" prop="content">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder
|
||||
v-model="form.content"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="flex-item">
|
||||
<el-form-item label="城市填写:" prop="location.city">
|
||||
<el-input v-model="form.location.city" size="small"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户ID:" prop="uid" flex="1">
|
||||
<el-input
|
||||
v-model.number="form.uid"
|
||||
size="small"
|
||||
placeholder="请输入用户ID"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="广告排序号:" prop="sortCode">
|
||||
<el-input v-model.number="form.sortCode" size="small"></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="是否免费:">
|
||||
<el-switch v-model="isFree" disabled></el-switch>
|
||||
</el-form-item>-->
|
||||
</div>
|
||||
<div
|
||||
class="flex-item"
|
||||
v-if="
|
||||
form.newsType === 'SP' ||
|
||||
form.newsType === 'SHORT' ||
|
||||
form.newsType === 'AD_SP' ||
|
||||
form.newsType === 'SEED_LINK'
|
||||
"
|
||||
>
|
||||
<el-form-item label="影片类型:" prop="mimeType">
|
||||
<el-input v-model="form.mimeType" size="small"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="视频时长:" prop="playTime">
|
||||
<el-input v-model="form.playTime" size="small"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="视频来源:" prop="via">
|
||||
<el-input v-model="form.via" size="small"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div
|
||||
class="flex-item"
|
||||
v-if="
|
||||
form.newsType === 'SP' ||
|
||||
form.newsType === 'SHORT' ||
|
||||
form.newsType === 'AD_SP' ||
|
||||
form.newsType === 'SEED_LINK'
|
||||
"
|
||||
>
|
||||
<el-form-item label="文件名:" prop="filename">
|
||||
<el-input v-model="form.filename" size="small"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="分辨率:" prop="resolution">
|
||||
<el-input v-model="form.resolution" size="small"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件大小:" prop="size">
|
||||
<el-input v-model="form.size" size="small"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div
|
||||
class="flex-item"
|
||||
v-if="
|
||||
form.newsType === 'SP' ||
|
||||
form.newsType === 'SHORT' ||
|
||||
form.newsType === 'AD_SP' ||
|
||||
form.newsType === 'SEED_LINK'
|
||||
"
|
||||
>
|
||||
<el-form-item label="资源URL:">
|
||||
<el-input v-model="form.sourceURL" size="small" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="资源ID:">
|
||||
<el-input v-model="form.sourceID" size="small" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item></el-form-item>
|
||||
</div>
|
||||
<div class="flex-item">
|
||||
<el-form-item label="广告跳转连接:" prop="linkUrl">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="form.linkUrl"
|
||||
size="small"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item></el-form-item>
|
||||
</div>
|
||||
<div class="flex-item" v-if="form.newsType == 'SEED_LINK'">
|
||||
<el-form-item label="种子影片时长:" prop="seedPlayTime">
|
||||
<el-input
|
||||
v-model.number="form.seedPlayTime"
|
||||
size="small"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="种子影片大小:" prop="seedSize">
|
||||
<el-input v-model.number="form.seedSize" size="small"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="flex-item" v-if="form.newsType == 'SEED_LINK'">
|
||||
<el-form-item label="种子下载链接:" prop="seedLinkUrl">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="5"
|
||||
v-model="form.seedLinkUrl"
|
||||
size="small"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item></el-form-item>
|
||||
</div>
|
||||
<el-form-item label="标签:">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="内容以“,”号隔开,如“张三,李四”"
|
||||
v-model="tagString"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件摘要:" prop="md5">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder
|
||||
v-model="form.md5"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
:loading="flag"
|
||||
@click="submitDate"
|
||||
>立即创建</el-button
|
||||
>
|
||||
<el-button size="small" @click="close()">取消</el-button>
|
||||
<div style="height: 40px"></div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { validatorIndex } from "@/utils/validator";
|
||||
import baseConfig from "@/utils/serverUrlConfig";
|
||||
import API from "@/api";
|
||||
import local from "@/utils/localStroage.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
trackId: "",
|
||||
show: false,
|
||||
// 封面上传地址
|
||||
action: baseConfig.baseServerUrl + "/vid/uploadStatic",
|
||||
//图集上传
|
||||
actionPics: baseConfig.baseServerUrl + "/vid/uploadStaticBatch",
|
||||
// 视频播放地址
|
||||
videoBaseUrl: baseConfig.playVideoUrl,
|
||||
tagString: "",
|
||||
isFree: true,
|
||||
flag: false,
|
||||
attrs: {
|
||||
accept: [
|
||||
".mp4",
|
||||
".qlv",
|
||||
".qsv",
|
||||
".ogg",
|
||||
".flv",
|
||||
".avi",
|
||||
".wmv",
|
||||
".rmvb",
|
||||
], //接受文件类型
|
||||
},
|
||||
// 表单数据
|
||||
form: {
|
||||
uid: "",
|
||||
title: "",
|
||||
content: "",
|
||||
newsType: "", //上传文件类型
|
||||
tags: [],
|
||||
playTime: "",
|
||||
cover: "",
|
||||
coverThumb: "",
|
||||
via: "admin",
|
||||
isFree: 0,
|
||||
coins: 0,
|
||||
size: "",
|
||||
mimeType: "",
|
||||
sourceURL: "",
|
||||
sourceID: "",
|
||||
filename: "",
|
||||
resolution: "",
|
||||
md5: "",
|
||||
freeTime: 3,
|
||||
seedPlayTime: 0,
|
||||
seedSize: 0,
|
||||
location: {
|
||||
city: "香港",
|
||||
},
|
||||
seriesCover: [],
|
||||
},
|
||||
rules: {
|
||||
title: [{ required: true, message: "请输入标题", trigger: "blur" }],
|
||||
content: [{ required: true, message: "请输入内容", trigger: "blur" }],
|
||||
via: [{ message: "请输入视频来源", trigger: "blur" }],
|
||||
coins: [
|
||||
{ required: true, message: "请输入视频定价", trigger: "blur" },
|
||||
{ validator: validatorIndex, trigger: "blur" },
|
||||
],
|
||||
mimeType: [{ message: "请输入影片类型", trigger: "blur" }],
|
||||
sourceURL: [
|
||||
{ required: true, message: "请输入资源url", trigger: "blur" },
|
||||
],
|
||||
sourceID: [
|
||||
{ required: true, message: "请输入资源id", trigger: "blur" },
|
||||
],
|
||||
filename: [{ message: "请输入文件名", trigger: "blur" }],
|
||||
location: {
|
||||
city: [
|
||||
{ required: true, message: "请输入城市名称", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
uid: [
|
||||
{ required: true, message: "请输入用户uid", trigger: "blur" },
|
||||
{ validator: validatorIndex, trigger: "blur" },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
options() {
|
||||
return {
|
||||
target: baseConfig.baseServerUrl + "/vid/uploadDotStream", //上传地址
|
||||
testChunks: false, //是否开启服务器分片校验
|
||||
method: "application/json",
|
||||
headers: {
|
||||
// 额外请求头
|
||||
Authorization: local.get("userInfo")
|
||||
? local.get("userInfo").token
|
||||
: "",
|
||||
},
|
||||
fileParameterName: "upload", //文件名参数,默认为file
|
||||
query: this.uploadQuery, //额外参数
|
||||
singleFile: true, //单文件上传
|
||||
chunkSize: 2048000, //分片大小,默认1M
|
||||
simultaneousUploads: 6,
|
||||
// 把英文时间转成中文
|
||||
parseTimeRemaining: function(timeRemaining, parsedTimeRemaining) {
|
||||
return parsedTimeRemaining
|
||||
.replace(/\syears?/, "年")
|
||||
.replace(/\days?/, "天")
|
||||
.replace(/\shours?/, "小时")
|
||||
.replace(/\sminutes?/, "分钟")
|
||||
.replace(/\sseconds?/, "秒");
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 提交验证
|
||||
submitDate() {
|
||||
if (!this.tagString) {
|
||||
this.$message.error("标签不能为空!");
|
||||
return false;
|
||||
}
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.flag = true;
|
||||
this.uploadImgsInfo();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 上传图集信息
|
||||
uploadImgsInfo() {
|
||||
this.form.tags = this.tagString.split(",");
|
||||
API.uploadVideo(this.form)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.$message({
|
||||
message: "上传帖子成功!",
|
||||
type: "success",
|
||||
});
|
||||
this.$emit("handlerLoadList");
|
||||
} else {
|
||||
this.$message.error("上传帖子失败!");
|
||||
}
|
||||
this.flag = false;
|
||||
this.close();
|
||||
})
|
||||
.catch(() => {
|
||||
this.flag = false;
|
||||
this.close();
|
||||
});
|
||||
},
|
||||
// 上传视频信息
|
||||
uploadVideoInfo() {
|
||||
this.form.tags = this.tagString.split(",");
|
||||
API.uploadVideo(this.form)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.$message({
|
||||
message: "上传视频信息成功!",
|
||||
type: "success",
|
||||
});
|
||||
this.$emit("handlerLoadList");
|
||||
} else {
|
||||
this.$message.error("上传视频信息失败!");
|
||||
}
|
||||
this.flag = false;
|
||||
this.close();
|
||||
})
|
||||
.catch(() => {
|
||||
this.flag = false;
|
||||
this.close();
|
||||
});
|
||||
},
|
||||
// 监听视频定价价格动态改变是否是免费视频状态
|
||||
changeInput() {
|
||||
if (this.form.coins > 0) {
|
||||
this.isFree = true;
|
||||
this.form.isFree = 1;
|
||||
} else {
|
||||
this.isFree = false;
|
||||
this.form.isFree = 0;
|
||||
}
|
||||
},
|
||||
// 封面图上传成功回调
|
||||
successCallback(res) {
|
||||
this.form.cover = res.data.coverImg;
|
||||
this.form.coverThumb = res.data.coverImg;
|
||||
},
|
||||
// 封面图上传成功回调
|
||||
successCallbackPic(seriesCover) {
|
||||
this.form.seriesCover = seriesCover;
|
||||
},
|
||||
//视频上传额外参数
|
||||
uploadQuery(file, chunk) {
|
||||
return {
|
||||
pos: chunk.offset,
|
||||
id: String(this.trackId),
|
||||
// totalPos:chunk.offset+1,
|
||||
// data:data
|
||||
};
|
||||
},
|
||||
//视频上传选中时
|
||||
fileAdd() {
|
||||
this.generateTaskId();
|
||||
},
|
||||
//定义视频上传唯一标识符id
|
||||
generateTaskId() {
|
||||
const time = new Date().getTime();
|
||||
this.trackId = time;
|
||||
},
|
||||
//视频上传成功时回调函数
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
onFileSuccess(rootFile, file, response, chunk) {
|
||||
let res = JSON.parse(response);
|
||||
this.form.filename = res.data.filename;
|
||||
this.form.size = res.data.size;
|
||||
this.form.md5 = res.data.md5;
|
||||
this.form.mimeType = res.data.mimeType;
|
||||
this.form.sourceID = res.data.sourceID;
|
||||
this.form.sourceURL = res.data.sourceURL;
|
||||
this.form.resolution = res.data.resolution;
|
||||
this.form.playTime = res.data.playTime;
|
||||
},
|
||||
// 开启新增弹窗
|
||||
open() {
|
||||
this.show = true;
|
||||
},
|
||||
// 关闭新增弹窗
|
||||
close() {
|
||||
this.show = false;
|
||||
this.tagString = "";
|
||||
this.form.seriesCover = [];
|
||||
this.form.uid = "";
|
||||
this.form.title = "";
|
||||
this.form.content = "";
|
||||
this.form.newsType = "";
|
||||
this.form.tags = [];
|
||||
this.form.playTime = "";
|
||||
this.form.cover = "";
|
||||
this.form.coverThumb = "";
|
||||
this.form.via = "admin";
|
||||
this.form.isFree = 0;
|
||||
this.form.coins = 0;
|
||||
this.form.size = "";
|
||||
this.form.mimeType = "";
|
||||
this.form.sourceURL = "";
|
||||
this.form.sourceID = "";
|
||||
this.form.filename = "";
|
||||
this.form.resolution = "";
|
||||
this.form.md5 = "";
|
||||
this.form.freeTime = 3;
|
||||
this.form.seedPlayTime = 0;
|
||||
this.form.seedSize = 0;
|
||||
this.form.location = {
|
||||
city: "香港",
|
||||
};
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.add-video-box {
|
||||
width: calc(100% - 40px);
|
||||
height: calc(100% - 60px);
|
||||
background: white;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: -2000px;
|
||||
z-index: 10;
|
||||
transition: left 0.2s linear;
|
||||
.flex-item {
|
||||
width: 90%;
|
||||
display: flex;
|
||||
.el-form-item {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
.el-upload .el-upload--picture-card {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
.el-textarea {
|
||||
width: 500px;
|
||||
}
|
||||
.el-input {
|
||||
width: 250px;
|
||||
}
|
||||
.uploader-drop {
|
||||
background: none;
|
||||
border-radius: 5px;
|
||||
border: none;
|
||||
padding: 0;
|
||||
}
|
||||
.uploader-file {
|
||||
border-bottom: 1px dashed #ccc;
|
||||
}
|
||||
.uploader-btn {
|
||||
background: #e63765;
|
||||
color: white;
|
||||
padding: 5px 10px;
|
||||
font-size: 13px;
|
||||
border: none;
|
||||
border-radius: 3px;
|
||||
&:hover {
|
||||
background: #eb5f84;
|
||||
}
|
||||
}
|
||||
.title {
|
||||
width: 100%;
|
||||
height: 30px;
|
||||
display: inline-block;
|
||||
font-size: 14px;
|
||||
line-height: 30px;
|
||||
overflow: hidden;
|
||||
color: #666;
|
||||
margin-bottom: 15px;
|
||||
cursor: pointer;
|
||||
i {
|
||||
&:hover {
|
||||
color: #e63765;
|
||||
}
|
||||
}
|
||||
span {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
.upload-video {
|
||||
width: 300px !important;
|
||||
.circle-bar {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
.el-progress-circle {
|
||||
margin: 0 auto;
|
||||
margin-top: 8px;
|
||||
}
|
||||
}
|
||||
.video-box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.avatar-uploader {
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
}
|
||||
.el-upload {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px dashed #d9d9d9;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
&:hover {
|
||||
border: 1px dashed #e63765;
|
||||
}
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
line-height: 150px;
|
||||
text-align: center;
|
||||
&:hover {
|
||||
color: 1px dashed #e63765 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
.show {
|
||||
left: 20px;
|
||||
transition: left 0.2s linear;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,211 @@
|
||||
<template>
|
||||
<div class="edit-video-box">
|
||||
<el-dialog
|
||||
:title="'新增自动上架'"
|
||||
:visible.sync="dialogVisible"
|
||||
width="500px"
|
||||
:before-close="handleClose"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="param"
|
||||
label-position="left"
|
||||
label-width="100px"
|
||||
>
|
||||
<div class="form-flex-box" v-if="diaType == 'batch'">
|
||||
<el-form-item label="价格:" prop="vid">
|
||||
<el-input
|
||||
v-model="param.coins"
|
||||
size="small"
|
||||
placeholder="请输入帖子价格"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<!-- <div class="form-flex-box">
|
||||
<el-form-item label="模块ID:" prop="sectionID">
|
||||
<el-input
|
||||
v-model="param.sectionID"
|
||||
size="small"
|
||||
placeholder="请输入模块ID"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</div> -->
|
||||
|
||||
<el-form-item label="父专题:" prop="start">
|
||||
<el-select
|
||||
v-model="fatherSections"
|
||||
placeholder="请选择父专题"
|
||||
size="small"
|
||||
clearable
|
||||
@change="searchSelectSection"
|
||||
>
|
||||
<el-option
|
||||
v-for="(section, index) in sections"
|
||||
:key="index"
|
||||
:label="section.subModuleName"
|
||||
:value="section.subModuleName"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="子专题:" prop="start">
|
||||
<el-select
|
||||
v-model="param.sectionID"
|
||||
placeholder="请选择子专题"
|
||||
size="small"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="(subSection, index) in searchSubSections"
|
||||
:key="index"
|
||||
:label="subSection.sectionName"
|
||||
:value="subSection.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="上架时间:" prop="onlineTime">
|
||||
<el-date-picker
|
||||
v-model="param.onlineTime"
|
||||
type="datetime"
|
||||
:editable="false"
|
||||
placeholder="请选择上架时间"
|
||||
size="small"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="handleClose" size="small">取 消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="submitDate()"
|
||||
:loading="flag"
|
||||
>确 认</el-button
|
||||
>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import API from "@/api";
|
||||
import { changeTime } from "@/utils/global.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
flag: false,
|
||||
diaTitle: "帖子自动上线新增",
|
||||
diaType: "add",
|
||||
vids: [],
|
||||
param: {
|
||||
vids: "",
|
||||
sectionID: "",
|
||||
onlineTime: "",
|
||||
coins: undefined,
|
||||
},
|
||||
sections: [],
|
||||
searchSubSections: "",
|
||||
subSectionList: [],
|
||||
subSectionId: "",
|
||||
fatherSections: "",
|
||||
searchSubSectionId: "",
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getSections();
|
||||
},
|
||||
methods: {
|
||||
searchSelectSection() {
|
||||
this.sections.forEach((item) => {
|
||||
if (item.subModuleName == this.fatherSections) {
|
||||
this.searchSubSections = item.sections;
|
||||
}
|
||||
});
|
||||
this.param.sectionID = "";
|
||||
},
|
||||
getSections() {
|
||||
API.sectionList({}).then((res) => {
|
||||
if (res && res.code === 200) {
|
||||
this.sections = res.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 提交
|
||||
submitDate() {
|
||||
this.param.coins = this.param.coins
|
||||
? Number(this.param.coins)
|
||||
: undefined;
|
||||
this.param.onlineTime = this.param.onlineTime
|
||||
? changeTime(this.param.onlineTime)
|
||||
: "";
|
||||
API.batchVidTimeOnline(this.param)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.$message({
|
||||
message: "新增成功!",
|
||||
type: "success",
|
||||
});
|
||||
} else {
|
||||
this.$message.error("新增失败!");
|
||||
}
|
||||
this.flag = false;
|
||||
this.handleClose();
|
||||
})
|
||||
.catch(() => {
|
||||
this.flag = false;
|
||||
this.handleClose();
|
||||
});
|
||||
},
|
||||
// 打开编辑视频弹窗、传递需要编辑的参数
|
||||
open(ids) {
|
||||
this.dialogVisible = true;
|
||||
this.param.vids = ids || [];
|
||||
},
|
||||
// 关闭回掉
|
||||
handleClose() {
|
||||
this.dialogVisible = false;
|
||||
this.searchSubSections = "";
|
||||
this.subSectionList = [];
|
||||
this.subSectionId = "";
|
||||
this.fatherSections = "";
|
||||
this.searchSubSectionId = "";
|
||||
this.param = {
|
||||
vids: undefined,
|
||||
sectionID: "",
|
||||
onlineTime: "",
|
||||
coins: undefined,
|
||||
};
|
||||
this.$emit("batchClose");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.edit-video-box {
|
||||
.el-input {
|
||||
width: 300px;
|
||||
}
|
||||
.el-select {
|
||||
width: 300px;
|
||||
/deep/ .el-input {
|
||||
width: 300px;
|
||||
}
|
||||
}
|
||||
.activity-box {
|
||||
/deep/ .el-input {
|
||||
width: 500px !important;
|
||||
}
|
||||
}
|
||||
.form-flex-box {
|
||||
display: flex;
|
||||
.el-form-item {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<div class="configuration-popup-box">
|
||||
<el-dialog :title="'不通过原因列表'" :visible.sync="dialogVisible" width="800px" :before-close="handleClose" :close-on-click-modal="false" append-to-body>
|
||||
<table-List :isShow="isShow" :reasonTableData="reasonTableData" :reasonTotal="reasonTotal" :reasonLoading="reasonLoading" @handReasonList="handReasonList"></table-List>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import TableList from './notPass-list'
|
||||
import API from '@/api'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
isShow: false,
|
||||
// 不通过理由列表
|
||||
reasonTableData: [],
|
||||
// 不通过理由列表总条数
|
||||
reasonTotal: [],
|
||||
// 不通过理由加载
|
||||
reasonLoading: false,
|
||||
params: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
TableList
|
||||
},
|
||||
methods: {
|
||||
// 获取不通过理由列表
|
||||
queryFailList() {
|
||||
this.reasonLoading = true
|
||||
API.queryFailList(this.params).then(res => {
|
||||
if (res.code === 200 && res.data.list) {
|
||||
this.reasonTableData = res.data.list
|
||||
this.reasonTotal = res.data.total
|
||||
} else {
|
||||
this.reasonTableData = []
|
||||
this.reasonTotal = 0
|
||||
}
|
||||
this.reasonLoading = false
|
||||
}).catch(() => {
|
||||
this.reasonTableData = []
|
||||
this.reasonLoading = false
|
||||
})
|
||||
},
|
||||
// 新增/编辑成功回掉
|
||||
handReasonList() {
|
||||
this.queryFailList()
|
||||
},
|
||||
// 外层弹窗关闭
|
||||
handleClose() {
|
||||
this.dialogVisible = false
|
||||
this.isShow = false
|
||||
this.reasonTableData = []
|
||||
},
|
||||
open(type) {
|
||||
if(type === 'operating') {
|
||||
this.isShow = true
|
||||
this.queryFailList()
|
||||
}
|
||||
this.dialogVisible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,587 @@
|
||||
<template>
|
||||
<div class="edit-video-box">
|
||||
<el-dialog
|
||||
:title="'视频编辑'"
|
||||
:visible.sync="dialogVisible"
|
||||
width="800px"
|
||||
:before-close="handleClose"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" :model="editParam" :rules="rules" label-width="100px">
|
||||
<div class="form-flex-box">
|
||||
<el-form-item label="视频标题:">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
placeholder="请谨慎修改用户上传数据"
|
||||
v-model="editParam.title"
|
||||
:disabled="editTitle"
|
||||
></el-input>
|
||||
<el-button type="success" size="small" @click="editTitle = false"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="form-flex-box">
|
||||
<el-form-item label="视频内容:">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
placeholder="请谨慎修改用户上传数据"
|
||||
v-model="editParam.content"
|
||||
:disabled="editContent"
|
||||
></el-input>
|
||||
<el-button type="success" size="small" @click="editContent = false"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="form-flex-box">
|
||||
<el-form-item label="封面上传:" prop="cover">
|
||||
<base-upload
|
||||
:cover="editParam.cover"
|
||||
:action="action"
|
||||
@successCallback="successCallback"
|
||||
@changeImgUrl="changeImgUrl"
|
||||
:id="sourceID"
|
||||
:wSize="360"
|
||||
:hSize="640"
|
||||
:width="'120px'"
|
||||
:height="'213px'"
|
||||
></base-upload>
|
||||
</el-form-item>
|
||||
<div class="item-box el-form-item">
|
||||
<el-form-item label="价格:" prop="coins">
|
||||
<el-input
|
||||
v-model.number="editParam.coins"
|
||||
size="small"
|
||||
placeholder="请输入价格"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="免费时长:">
|
||||
<el-input
|
||||
v-model.number="editParam.freeTime"
|
||||
size="small"
|
||||
placeholder="请输入视频免费时长"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户ID:" prop="publisherID">
|
||||
<el-input
|
||||
v-model.number="editParam.publisherID"
|
||||
size="small"
|
||||
placeholder="请输入用户ID"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否可推荐:" prop="recoWeight">
|
||||
<el-select
|
||||
v-model.number="editParam.recoWeight"
|
||||
placeholder="请选择可否推荐"
|
||||
size="small"
|
||||
>
|
||||
<el-option label="可推荐" :value="0"></el-option>
|
||||
<el-option label="不可推荐" :value="-1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="广告排序号:" prop="sortCode">
|
||||
<el-input
|
||||
v-model.number="editParam.sortCode"
|
||||
size="small"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="作品排序:" prop="worksSort">
|
||||
<el-input
|
||||
v-model.number="editParam.worksSort"
|
||||
size="small"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="帖子类型:">
|
||||
<el-select
|
||||
v-model="editParam.newsType"
|
||||
placeholder="请输入帖子类型"
|
||||
size="small"
|
||||
style="width: 180px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in newsTypes"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item">
|
||||
<el-form-item label="广告跳转链接:" prop="linkUrl">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="editParam.linkUrl"
|
||||
size="small"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="flex-item">
|
||||
<el-form-item
|
||||
label="种子下载链接:"
|
||||
prop="seedLinkUrl"
|
||||
v-if="editParam.newsType == 'SEED_LINK'"
|
||||
>
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="editParam.seedLinkUrl"
|
||||
size="small"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="flex-item" v-if="editParam.newsType == 'SEED_LINK'">
|
||||
<el-form-item label="种子影片时长:" prop="seedPlayTime">
|
||||
<el-input
|
||||
v-model.number="editParam.seedPlayTime"
|
||||
size="small"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="种子影片大小:" prop="seedSize">
|
||||
<el-input
|
||||
v-model.number="editParam.seedSize"
|
||||
size="small"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="topic">
|
||||
<el-form-item label="选择父专题" class="tipicItem">
|
||||
<el-select
|
||||
v-model="subSections"
|
||||
placeholder="请选择父专题"
|
||||
size="small"
|
||||
clearable
|
||||
@change="selectChild"
|
||||
clear
|
||||
>
|
||||
<el-option
|
||||
v-for="(section, index) in sections"
|
||||
:key="index"
|
||||
:label="section.subModuleName"
|
||||
:value="section.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="选择子专题" class="tipicItem">
|
||||
<el-select
|
||||
v-model="subSectionId"
|
||||
placeholder="请选择子专题"
|
||||
size="small"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="(subSection, index) in subSectionList"
|
||||
:key="index"
|
||||
:label="subSection.sectionName"
|
||||
:value="subSection.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-form-item label="选择活动:">
|
||||
<el-select
|
||||
v-model="editParam.activityId"
|
||||
filterable
|
||||
placeholder="未选择活动则该视频不参加大赛"
|
||||
clearable
|
||||
class="activity-box"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in activityList"
|
||||
:key="item.id"
|
||||
:label="item.desc"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<div class="form-flex-box">
|
||||
<el-form-item label="标签:" prop="tags">
|
||||
<tag-selector
|
||||
v-model="editParam.tags"
|
||||
:tagList="tagList"
|
||||
></tag-selector>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="handleClose" size="small">取 消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="submitDate()"
|
||||
:loading="flag"
|
||||
>确 认</el-button
|
||||
>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import baseConfig from "@/utils/serverUrlConfig";
|
||||
import { validatorIndex, validatorWorksSort } from "@/utils/validator";
|
||||
import API from "@/api";
|
||||
import TagSelector from "@/components/tagSelector";
|
||||
export default {
|
||||
components: {
|
||||
TagSelector,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
flag: false,
|
||||
// 封面上传地址
|
||||
action: baseConfig.baseServerUrl + "/vid/uploadStatic",
|
||||
tagList: [],
|
||||
sourceID: "",
|
||||
editTitle: true,
|
||||
editContent: true,
|
||||
editParam: {
|
||||
id: "",
|
||||
tags: [],
|
||||
cover: "",
|
||||
coverThumb: "",
|
||||
title: "",
|
||||
content: "",
|
||||
fakeLikeCount: 0,
|
||||
fakePlayCount: 0,
|
||||
fakeShareCount: 0,
|
||||
size: "",
|
||||
likeCount: 0,
|
||||
playCount: 0,
|
||||
shareCount: 0,
|
||||
freeTime: 0,
|
||||
coins: 0,
|
||||
type: 0,
|
||||
linkUrl: "",
|
||||
seedPlayTime: 0,
|
||||
seedSize: 0,
|
||||
sortCode: "",
|
||||
worksSort: "",
|
||||
activityId: "",
|
||||
publisherID: "",
|
||||
recoWeight: 0,
|
||||
tID: undefined,
|
||||
newsType: "SP",
|
||||
// isSubSection: true,
|
||||
},
|
||||
newsType: "SP",
|
||||
newsTypes: [
|
||||
{
|
||||
label: "长视频",
|
||||
value: "SP",
|
||||
},
|
||||
{
|
||||
label: "短视频",
|
||||
value: "SHORT",
|
||||
},
|
||||
{
|
||||
label: "图集",
|
||||
value: "PIC",
|
||||
},
|
||||
{
|
||||
label: "种子贴",
|
||||
value: "SEED_LINK",
|
||||
},
|
||||
{
|
||||
label: "图文",
|
||||
value: "COVER",
|
||||
},
|
||||
],
|
||||
subSectionList: [],
|
||||
subSectionId: "",
|
||||
sections: [],
|
||||
subSections: [],
|
||||
activityList: [],
|
||||
// 表单验证规则
|
||||
rules: {
|
||||
cover: [
|
||||
{ required: true, message: "请输入添加封面图片", trigger: "blur" },
|
||||
],
|
||||
freeTime: [
|
||||
{ required: true, message: "请输入免费时长", trigger: "blur" },
|
||||
{ validator: validatorIndex, trigger: "blur" },
|
||||
],
|
||||
coins: [
|
||||
{ required: true, message: "请输入价格", trigger: "blur" },
|
||||
{ validator: validatorIndex, trigger: "blur" },
|
||||
],
|
||||
tags: [{ required: true, message: "请选择标签", trigger: "blur" }],
|
||||
worksSort: [{ validator: validatorWorksSort, trigger: "blur" }],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
async getVideoActivity() {
|
||||
const params = {};
|
||||
let ret = await API.getVideoActivity(params);
|
||||
if (ret.code == 200) {
|
||||
this.activityList = ret.data;
|
||||
this.activityList = this.activityList.concat([
|
||||
{
|
||||
id: "000000000000000000000000",
|
||||
desc: "不参加活动",
|
||||
},
|
||||
]);
|
||||
}
|
||||
},
|
||||
getTagList() {
|
||||
const params = {};
|
||||
API.queryTagList(params).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.tagList = res.data.list;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 提交验证
|
||||
submitDate() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.subSections && !this.subSectionId) {
|
||||
this.$message.error("请选择子专题");
|
||||
return;
|
||||
}
|
||||
// this.flag = true;
|
||||
// const tags = this.editParam.tags.filter(
|
||||
// (item) => this.tagList.map((e) => e.name).indexOf(item) === -1
|
||||
// );
|
||||
// if (tags.length > 0) {
|
||||
// this.$confirm(
|
||||
// `标签${tags.join(",")}不属于常用标签,确定修改?`,
|
||||
// "提示",
|
||||
// {
|
||||
// confirmButtonText: "确定",
|
||||
// cancelButtonText: "取消",
|
||||
// type: "warning",
|
||||
// }
|
||||
// )
|
||||
// .then(() => {
|
||||
// this.editVideo();
|
||||
// })
|
||||
// .catch(() => {
|
||||
// this.flag = false;
|
||||
// return false;
|
||||
// });
|
||||
// } else {
|
||||
this.editVideo();
|
||||
// }
|
||||
} else {
|
||||
this.flag = false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 编辑
|
||||
editVideo() {
|
||||
if (!this.editParam.activityId) {
|
||||
this.editParam.activityId = "000000000000000000000000";
|
||||
}
|
||||
if (this.subSections && !this.subSectionId) {
|
||||
this.$message.error("请选择子专题");
|
||||
return;
|
||||
}
|
||||
if (this.subSections && this.subSectionId) {
|
||||
this.editParam.sectionID = this.subSectionId;
|
||||
} else {
|
||||
this.editParam.sectionID = "";
|
||||
}
|
||||
|
||||
API.editVideoInfo(this.editParam)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.$message({
|
||||
message: "编辑成功!",
|
||||
type: "success",
|
||||
});
|
||||
this.$emit("handlerEditList");
|
||||
} else {
|
||||
this.$message.error("编辑失败!");
|
||||
}
|
||||
this.handleClose();
|
||||
this.flag = false;
|
||||
})
|
||||
.catch(() => {
|
||||
this.handleClose();
|
||||
this.flag = false;
|
||||
});
|
||||
},
|
||||
// 标签封面上传成功回掉
|
||||
successCallback(res) {
|
||||
this.editParam.cover = res.data.coverImg;
|
||||
this.editParam.coverThumb = res.data.coverImg;
|
||||
},
|
||||
// 打开编辑视频弹窗、传递需要编辑的参数
|
||||
open(data) {
|
||||
this.getTagList();
|
||||
this.getVideoActivity();
|
||||
this.dialogVisible = true;
|
||||
this.editParam.id = data.id;
|
||||
this.editParam.cover = data.cover;
|
||||
this.editParam.title = data.title;
|
||||
this.editParam.content = data.content;
|
||||
this.editParam.activityId = data.activityId;
|
||||
this.editParam.publisherID = data.publisher.uid;
|
||||
this.editParam.coverThumb = data.coverThumb;
|
||||
this.editParam.fakeLikeCount = data.fakeLikeCount;
|
||||
this.editParam.fakePlayCount = data.fakePlayCount;
|
||||
this.editParam.fakeShareCount = data.fakeShareCount;
|
||||
this.editParam.size = data.size;
|
||||
this.editParam.likeCount = data.likeCount;
|
||||
this.editParam.playCount = data.playCount;
|
||||
this.editParam.shareCount = data.shareCount;
|
||||
this.editParam.freeTime = data.freeTime > 2 ? data.freeTime : 3;
|
||||
this.editParam.isChosen = data.chosen;
|
||||
this.editParam.coins = data.coins;
|
||||
this.editParam.recoWeight = data.recoWeight;
|
||||
this.editParam.linkUrl = data.linkUrl;
|
||||
this.editParam.seedPlayTime = data.seedPlayTime;
|
||||
this.editParam.seedSize = data.seedSize;
|
||||
this.editParam.sortCode = data.sortCode;
|
||||
this.editParam.worksSort = data.worksSort;
|
||||
this.editParam.newsType = data.newsType;
|
||||
this.sourceID = data.sourceID;
|
||||
this.editParam.tags = data.tags ? data.tags.map((item) => item.name) : [];
|
||||
this.editParam.freeTime = data.freeTime;
|
||||
this.getSections(data.sectionName);
|
||||
this.editParam.tID =
|
||||
data.sectionName && data.sectionName.length > 0
|
||||
? data.sectionName[0].tID
|
||||
: undefined;
|
||||
this.subSections =
|
||||
data.sectionName && data.sectionName.length > 0
|
||||
? data.sectionName[0].subModuleID
|
||||
: undefined;
|
||||
},
|
||||
// 关闭回掉
|
||||
handleClose() {
|
||||
this.dialogVisible = false;
|
||||
this.editTitle = true;
|
||||
this.editContent = true;
|
||||
this.$refs.form.resetFields();
|
||||
this.subSectionList = [];
|
||||
// this.subSectionId = "";
|
||||
this.sections = [];
|
||||
this.subSections = "";
|
||||
},
|
||||
|
||||
changeImgUrl(data) {
|
||||
this.editParam.cover = data;
|
||||
this.editParam.coverThumb = data;
|
||||
},
|
||||
|
||||
// 验证播放数
|
||||
validatorPlayer(rule, value, callback) {
|
||||
if (value >= this.editParam.playCount) {
|
||||
callback();
|
||||
} else {
|
||||
callback(
|
||||
new Error(
|
||||
"假播放数必须大于或者等于真播放数(当前真播放数为:" +
|
||||
this.editParam.playCount +
|
||||
")",
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
// 验证点赞数
|
||||
validatorLike(rule, value, callback) {
|
||||
if (value >= this.editParam.likeCount) {
|
||||
callback();
|
||||
} else {
|
||||
callback(
|
||||
new Error(
|
||||
"假点赞数必须大于或者等于真点赞数(当前真点赞数为:" +
|
||||
this.editParam.likeCount +
|
||||
")",
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
// 验证点赞数
|
||||
validatorShare(rule, value, callback) {
|
||||
if (value >= this.editParam.shareCount) {
|
||||
callback();
|
||||
} else {
|
||||
callback(
|
||||
new Error(
|
||||
"假共享数必须大于或者等于真共享数(当前真共享数为:" +
|
||||
this.editParam.shareCount +
|
||||
")",
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
selectChild(val) {
|
||||
// this.isSubSection = false;
|
||||
this.sections.forEach((i) => {
|
||||
if (i.id == val) {
|
||||
this.subSectionList = i.sections;
|
||||
}
|
||||
});
|
||||
// this.subSectionList = val;
|
||||
this.subSectionId = "";
|
||||
},
|
||||
getSections(item) {
|
||||
API.sectionList().then((res) => {
|
||||
if (res && res.code === 200) {
|
||||
this.sections = res.data;
|
||||
if (item && item.length > 0) {
|
||||
this.sections.forEach((i) => {
|
||||
if (i.id == item[0].subModuleID) {
|
||||
this.subSectionList = i.sections;
|
||||
this.subSectionId = item[0].sectionsId;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.edit-video-box {
|
||||
.el-input {
|
||||
width: 150px;
|
||||
}
|
||||
.activity-box {
|
||||
/deep/ .el-input {
|
||||
width: 500px !important;
|
||||
}
|
||||
}
|
||||
.flex-item {
|
||||
width: 90%;
|
||||
display: flex;
|
||||
.el-form-item {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
.form-flex-box {
|
||||
display: flex;
|
||||
.el-form-item {
|
||||
flex: 1;
|
||||
}
|
||||
.item-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
.topic {
|
||||
margin-top: 10px;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
.tipicItem {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,201 @@
|
||||
<template>
|
||||
<div class="examine-all">
|
||||
<el-dialog
|
||||
:title="title"
|
||||
align="center"
|
||||
:visible.sync="dialogVisible"
|
||||
width="90%"
|
||||
:close-on-click-modal="false"
|
||||
:before-close="handleClose"
|
||||
@opened="onOpened"
|
||||
>
|
||||
<div class="media-box">
|
||||
<div
|
||||
class="video-box"
|
||||
v-for="(item, i) in list"
|
||||
:key="item.url + '-' + i"
|
||||
>
|
||||
<div class="title" :title="item.title || '未知'">
|
||||
{{ item.title || "未知" }}
|
||||
</div>
|
||||
<video
|
||||
ref="videoEls"
|
||||
class="preview-video"
|
||||
controls
|
||||
preload="auto"
|
||||
playsinline
|
||||
></video>
|
||||
</div>
|
||||
<div v-if="!list.length" class="empty-tip">当前列表没有可预览的视频</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Hls from "hls.js";
|
||||
import baseConfig from "@/utils/serverUrlConfig";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
title: "查看当前列表所有视频",
|
||||
dialogVisible: false,
|
||||
list: [],
|
||||
hlsList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
token() {
|
||||
return this.$store.state.token;
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.destroyPlayers();
|
||||
},
|
||||
methods: {
|
||||
getVideoEl(i) {
|
||||
const refs = this.$refs.videoEls;
|
||||
if (!refs) return null;
|
||||
return Array.isArray(refs) ? refs[i] : i === 0 ? refs : null;
|
||||
},
|
||||
destroyPlayers() {
|
||||
this.hlsList.forEach(hls => {
|
||||
if (hls) hls.destroy();
|
||||
});
|
||||
this.hlsList = [];
|
||||
|
||||
const refs = this.$refs.videoEls;
|
||||
const videos = !refs ? [] : Array.isArray(refs) ? refs : [refs];
|
||||
videos.forEach(video => {
|
||||
if (!video) return;
|
||||
video.pause();
|
||||
video.removeAttribute("src");
|
||||
video.load();
|
||||
});
|
||||
},
|
||||
handleClose(done) {
|
||||
this.destroyPlayers();
|
||||
this.list = [];
|
||||
this.dialogVisible = false;
|
||||
if (typeof done === "function") {
|
||||
done();
|
||||
}
|
||||
},
|
||||
buildMediaUrl(url) {
|
||||
if (!url) return "";
|
||||
let path = String(url);
|
||||
if (path.slice(0, 1) === "/") {
|
||||
path = path.slice(1);
|
||||
}
|
||||
return (
|
||||
baseConfig.baseServerUrl +
|
||||
baseConfig.playVideoUrl +
|
||||
path +
|
||||
"?token=" +
|
||||
this.token
|
||||
);
|
||||
},
|
||||
initHlsPlayer(i, src) {
|
||||
const video = this.getVideoEl(i);
|
||||
if (!video || !src) return;
|
||||
|
||||
if (Hls.isSupported()) {
|
||||
const hls = new Hls({
|
||||
enableWorker: true,
|
||||
maxBufferLength: 15,
|
||||
maxMaxBufferLength: 180
|
||||
});
|
||||
this.hlsList[i] = hls;
|
||||
hls.loadSource(src);
|
||||
hls.attachMedia(video);
|
||||
hls.on(Hls.Events.ERROR, (event, data) => {
|
||||
if (!data.fatal || !this.hlsList[i]) return;
|
||||
if (data.type === Hls.ErrorTypes.NETWORK_ERROR) {
|
||||
this.hlsList[i].startLoad();
|
||||
} else if (data.type === Hls.ErrorTypes.MEDIA_ERROR) {
|
||||
this.hlsList[i].recoverMediaError();
|
||||
} else {
|
||||
this.hlsList[i].destroy();
|
||||
this.hlsList[i] = null;
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Safari 等原生 HLS
|
||||
if (video.canPlayType("application/vnd.apple.mpegurl")) {
|
||||
video.src = src;
|
||||
}
|
||||
},
|
||||
initAllPlayers() {
|
||||
if (!this.dialogVisible || !this.list.length) return;
|
||||
// 先清旧实例,避免 opened / nextTick 重复初始化
|
||||
this.destroyPlayers();
|
||||
this.list.forEach((item, i) => {
|
||||
this.initHlsPlayer(i, this.buildMediaUrl(item.url));
|
||||
});
|
||||
},
|
||||
onOpened() {
|
||||
this.$nextTick(() => {
|
||||
this.initAllPlayers();
|
||||
});
|
||||
},
|
||||
open(list) {
|
||||
this.destroyPlayers();
|
||||
this.list = (list || []).filter(item => item && item.url);
|
||||
// 已打开时不会再触发 opened,需要手动初始化
|
||||
if (this.dialogVisible) {
|
||||
this.$nextTick(() => {
|
||||
this.initAllPlayers();
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.dialogVisible = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.examine-all {
|
||||
.media-box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
.el-dialog {
|
||||
margin-top: 70px !important;
|
||||
}
|
||||
.el-dialog__body {
|
||||
overflow: auto;
|
||||
max-height: calc(100vh - 200px);
|
||||
}
|
||||
.empty-tip {
|
||||
text-align: center;
|
||||
color: #999;
|
||||
padding: 40px 0;
|
||||
}
|
||||
.video-box {
|
||||
width: 19%;
|
||||
float: left;
|
||||
height: 330px;
|
||||
margin-left: 1%;
|
||||
margin-bottom: 30px;
|
||||
.preview-video {
|
||||
width: 100%;
|
||||
height: calc(100% - 30px);
|
||||
background: #000;
|
||||
object-fit: contain;
|
||||
}
|
||||
.title {
|
||||
width: 100%;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,405 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
:title="'帖子审核'"
|
||||
:visible.sync="dialogVisible"
|
||||
width="850px"
|
||||
border
|
||||
:before-close="handleClose"
|
||||
:close-on-click-modal="false"
|
||||
top="1%"
|
||||
>
|
||||
<el-table :data="tableData" style="width: 100%;">
|
||||
<el-table-column label="用户ID" align="center" width="110" fixed>
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.publisher.uid || '未知'}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="id" label="视频ID" align="center" width="220"></el-table-column>
|
||||
<el-table-column
|
||||
prop="userName"
|
||||
label="用户昵称"
|
||||
align="center"
|
||||
width="140"
|
||||
:show-overflow-tooltip="true"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.publisher.name || '未知'}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="title"
|
||||
label="视频标题"
|
||||
align="center"
|
||||
:show-overflow-tooltip="true"
|
||||
width="250"
|
||||
></el-table-column>
|
||||
<el-table-column prop="isPay" label="是否付费" align="center" width="80">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.coins > 0 ? '是' : '否'}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="coins" label="价格" align="center" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
v-model.number="scope.row.coins"
|
||||
size="small"
|
||||
class="param-input"
|
||||
v-if="type === 'many'"
|
||||
></el-input>
|
||||
<span v-else>{{scope.row.coins}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="freeTime" label="免费时长" align="center" width="80" v-if="type === 'many'">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.freeTime" size="small" class="param-input"></el-input>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
<el-table-column
|
||||
prop="reason"
|
||||
label="不通过理由"
|
||||
align="center"
|
||||
width="300"
|
||||
v-if="type === 'many'"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
v-model="scope.row.reason"
|
||||
size="small"
|
||||
class="param-input"
|
||||
type="textarea"
|
||||
:row="10"
|
||||
></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="tags" label="标签" align="center" min-width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-tag
|
||||
type="success"
|
||||
size="mini"
|
||||
effect="plain"
|
||||
:closable="true"
|
||||
@close="handleCloseTag(i,scope.row)"
|
||||
class="tags"
|
||||
v-for="(tag,i) in scope.row.tags"
|
||||
:key="i"
|
||||
>{{tag.name}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button
|
||||
:type=" (type === 'many') ? 'danger' : '' "
|
||||
@click="changeStatus"
|
||||
size="small"
|
||||
>{{type === 'many' ? '不通过' : '取消'}}</el-button>
|
||||
<el-button type="success" size="small" @click="examine(1)">通过</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
size="small"
|
||||
@click="examine(3)"
|
||||
v-if="type === 'single'"
|
||||
>通过并修改为免费视频</el-button>
|
||||
<el-button type="danger" size="small" @click="passButton" v-if="type === 'single'">不通过</el-button>
|
||||
</span>
|
||||
<!-- <div class="not_pass" v-if="type === 'many'">
|
||||
<table-List :isShow="isShow" :reasonTableData="reasonTableData" :reasonTotal="reasonTotal" :reasonLoading="reasonLoading" @handTextArea1="handTextArea1" :isFocus="isFocus"></table-List>
|
||||
</div>-->
|
||||
</el-dialog>
|
||||
<!--审核不通过信息填写弹窗-->
|
||||
<el-dialog
|
||||
:title="'驳回原因'"
|
||||
:visible.sync="dialogVisible1"
|
||||
width="30%"
|
||||
:before-close="handleClose1"
|
||||
append-to-body
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-input
|
||||
type="textarea"
|
||||
placeholder="请输入审核不通过理由"
|
||||
v-model="textarea"
|
||||
maxlength="50"
|
||||
show-word-limit
|
||||
></el-input>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="handleClose1" size="small">取 消</el-button>
|
||||
<el-button type="success" size="small" @click="examineNo()">确定提交</el-button>
|
||||
</span>
|
||||
<div>
|
||||
<!-- 审核不通过理由弹窗 -->
|
||||
<p class="passTitle">驳回原因列表</p>
|
||||
<table-List
|
||||
:isShow="isShow"
|
||||
:reasonTableData="reasonTableData"
|
||||
:reasonTotal="reasonTotal"
|
||||
:reasonLoading="reasonLoading"
|
||||
:showType="showType"
|
||||
@handTextArea="handTextArea"
|
||||
></table-List>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import API from "@/api";
|
||||
import TableList from "./notPass-list";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
center: true,
|
||||
dialogVisible: false,
|
||||
dialogVisible1: false,
|
||||
showType: "single",
|
||||
index: "",
|
||||
tableData: [],
|
||||
idList: [],
|
||||
isFocus: false,
|
||||
isClickPl: false,
|
||||
type: "", // 通过单条审核还是多条判断多条时不能点击审核不通过
|
||||
textarea: "", // 不通过原由
|
||||
isShow: false,
|
||||
// 不通过理由列表
|
||||
reasonTableData: [],
|
||||
// 不通过理由列表总条数
|
||||
reasonTotal: 0,
|
||||
// 不通过理由加载
|
||||
reasonLoading: false,
|
||||
params: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10
|
||||
}
|
||||
};
|
||||
},
|
||||
components: {
|
||||
TableList
|
||||
},
|
||||
methods: {
|
||||
open(data, type) {
|
||||
// eslint-disable-next-line no-console
|
||||
this.dialogVisible = true;
|
||||
this.tableData = data;
|
||||
if (type === "many") {
|
||||
this.isClickPl = true;
|
||||
this.queryFailList();
|
||||
}
|
||||
this.type = type;
|
||||
this.textarea = "";
|
||||
data.forEach(element => {
|
||||
this.idList.push(element.vid);
|
||||
});
|
||||
},
|
||||
//批量不通过
|
||||
changeStatus() {
|
||||
if (this.type === "many") {
|
||||
// 不通过
|
||||
let infos = [];
|
||||
this.tableData.forEach(item => {
|
||||
let params1 = {};
|
||||
params1.id = item.id;
|
||||
params1.reason = item.reason;
|
||||
params1.coins = item.coins;
|
||||
params1.freeTime = item.freeTime;
|
||||
infos.push(params1);
|
||||
});
|
||||
let params2 = {
|
||||
pass: 2,
|
||||
infos: infos
|
||||
};
|
||||
this.batchReview(params2);
|
||||
} else {
|
||||
this.handleClose();
|
||||
}
|
||||
},
|
||||
// 点击不通过按钮
|
||||
passButton() {
|
||||
this.dialogVisible1 = true;
|
||||
this.queryFailList();
|
||||
},
|
||||
handleCloseTag(index,row){
|
||||
let tags = row.tags;
|
||||
tags.splice(index,1)
|
||||
|
||||
let id = row.id;
|
||||
let params = {
|
||||
id:id,
|
||||
tags:tags.map(e=> e.name),
|
||||
type:1
|
||||
}
|
||||
this.deleteTag(params);
|
||||
},
|
||||
// 提交tags
|
||||
deleteTag(params) {
|
||||
API.editVideoInfo(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$message({
|
||||
message: '删除成功!',
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
this.$message.error('删除失败!');
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$message.error('删除失败!');
|
||||
})
|
||||
},
|
||||
// 获取不通过理由列表
|
||||
queryFailList(type) {
|
||||
if (type === "status") {
|
||||
this.params.pageNumber = 1;
|
||||
}
|
||||
this.reasonLoading = true;
|
||||
API.queryFailList(this.params)
|
||||
.then(res => {
|
||||
if (res.code === 200 && res.data.list) {
|
||||
this.reasonTableData = res.data.list;
|
||||
this.reasonTotal = res.data.total;
|
||||
} else {
|
||||
this.reasonTableData = [];
|
||||
this.reasonTotal = 0;
|
||||
}
|
||||
this.reasonLoading = false;
|
||||
})
|
||||
.catch(() => {
|
||||
this.reasonTableData = [];
|
||||
this.reasonLoading = false;
|
||||
});
|
||||
},
|
||||
// 关闭外层弹窗
|
||||
handleClose() {
|
||||
this.dialogVisible = false;
|
||||
this.isShow = false;
|
||||
(this.reasonTableData = []),
|
||||
(this.reasonTotal = 0),
|
||||
(this.reasonLoading = false),
|
||||
(this.isClickPl = false);
|
||||
// 关闭弹窗时清空视频审核界面理由
|
||||
this.tableData.forEach(item => {
|
||||
item.reason = "";
|
||||
});
|
||||
},
|
||||
// 通过审核
|
||||
examine(status) {
|
||||
if (
|
||||
this.type !== "many" &&
|
||||
this.tableData[0].coins === 0 &&
|
||||
status === 3
|
||||
) {
|
||||
this.$message.error("该视频已是免费视频!");
|
||||
return;
|
||||
}
|
||||
let params = {
|
||||
ids: [],
|
||||
pass: status,
|
||||
reason: "",
|
||||
freeTime: ""
|
||||
};
|
||||
if (this.type === "many") {
|
||||
delete params.reason;
|
||||
delete params.ids;
|
||||
let infos = [];
|
||||
this.tableData.forEach(item => {
|
||||
let params1 = {};
|
||||
params1.id = item.id;
|
||||
params1.reason = item.reason;
|
||||
params1.coins = item.coins;
|
||||
params1.freeTime = item.freeTime;
|
||||
infos.push(params1);
|
||||
});
|
||||
params.infos = infos;
|
||||
this.batchReview(params);
|
||||
} else {
|
||||
params.ids.push(this.tableData[0].id);
|
||||
this.examineVideo(params);
|
||||
}
|
||||
},
|
||||
// 审核不通过
|
||||
examineNo() {
|
||||
this.dialogVisible1 = true;
|
||||
if (!this.textarea && this.type === "single") {
|
||||
this.$message.error("请填写不通过理由");
|
||||
return;
|
||||
}
|
||||
this.examineVideo({
|
||||
ids: [this.tableData[0].id],
|
||||
pass: 2,
|
||||
reason: this.textarea
|
||||
});
|
||||
},
|
||||
// 审核请求
|
||||
examineVideo(params) {
|
||||
API.examineVideo(params)
|
||||
.then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$message({
|
||||
message: "操作成功!",
|
||||
type: "success"
|
||||
});
|
||||
this.$emit("handlerExamine");
|
||||
} else {
|
||||
this.$message.error("操作失败!");
|
||||
}
|
||||
this.dialogVisible = false;
|
||||
this.dialogVisible1 = false;
|
||||
})
|
||||
.catch(() => {
|
||||
this.dialogVisible = false;
|
||||
this.dialogVisible1 = false;
|
||||
});
|
||||
},
|
||||
// 批量审核请求
|
||||
batchReview(params) {
|
||||
API.batchReview(params)
|
||||
.then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$message({
|
||||
message: "操作成功!",
|
||||
type: "success"
|
||||
});
|
||||
this.$emit("handlerExamine");
|
||||
} else {
|
||||
this.$message.error("操作失败!");
|
||||
}
|
||||
this.dialogVisible = false;
|
||||
this.dialogVisible1 = false;
|
||||
})
|
||||
.catch(() => {
|
||||
this.dialogVisible = false;
|
||||
this.dialogVisible1 = false;
|
||||
});
|
||||
},
|
||||
// 驳回信息弹出框
|
||||
handleClose1() {
|
||||
this.dialogVisible1 = false;
|
||||
this.textarea = "";
|
||||
},
|
||||
handTextArea(text) {
|
||||
this.textarea = text;
|
||||
}
|
||||
// handTextArea1(text) {
|
||||
// this.tableData[this.index].reason = text
|
||||
// },
|
||||
// 输入框获得焦点时
|
||||
// focus(index) {
|
||||
// // eslint-disable-next-line no-console
|
||||
// console.log(index);
|
||||
// this.index = index;
|
||||
// this.isFocus = true
|
||||
// }
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.passTitle {
|
||||
text-align: center;
|
||||
font-size: 18px;
|
||||
padding-top: 20px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
.not_pass {
|
||||
position: absolute;
|
||||
width: 300px;
|
||||
top: 300px;
|
||||
right: -350px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,219 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="action-bar">
|
||||
<el-button type="primary" size="small" @click="reasonAction('add')" v-if="isShow">新增原因</el-button>
|
||||
</div>
|
||||
<el-table :data="reasonTableData" style="width: 100%" border ref="multipleTable" v-loading="reasonLoading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading" :row-key="getRowKeys" @selection-change="handleSelectionChange" @row-click="rowClick">
|
||||
<el-table-column prop="" label="操作" align="center" v-if="isShow" width="250">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="success" size="mini" icon="el-icon-edit" @click="reasonAction('edit',scope.row)"></el-button>
|
||||
<el-button type="danger" size="mini" icon="el-icon-delete" @click="removeAction(scope.row.number)"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column type="selection" width="50" align="center" v-if="!isShow"> </el-table-column>
|
||||
<el-table-column prop="number" label="序号" align="center" width=100></el-table-column>
|
||||
<el-table-column prop="content" label="驳回原因" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.content}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
:page-sizes="[5, 10, 15, 20]"
|
||||
:current-page="params.pageNumber"
|
||||
:page-size="params.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="reasonTotal"
|
||||
background
|
||||
v-if="reasonTotal > 10"
|
||||
@size-change="changeSize"
|
||||
@current-change="changeCurrent"
|
||||
highlight-current-row="true"
|
||||
></el-pagination>
|
||||
<div>
|
||||
<el-dialog :title="titleInside" :visible.sync="dialogVisibleInside" width="800px" :before-close="handleCloseInside" :close-on-click-modal="false" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
|
||||
<el-form-item label="驳回原因:" prop="statusDesc">
|
||||
<el-input type="textarea" :rows="3" placeholder="请输入驳回原因" v-model="form.content">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="handleCloseInside" size="small">取 消</el-button>
|
||||
<el-button type="primary" @click="submitDate()" :loading="flag" size="small">确 认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import API from '@/api'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
numberArr: [],
|
||||
// 外层弹窗
|
||||
loading: false,
|
||||
type: '',
|
||||
titleInside: '',
|
||||
dialogVisibleInside: false,
|
||||
// 现在已经选择的不通过理由
|
||||
arrNow: [],
|
||||
params: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
// 内层弹窗
|
||||
id: '',
|
||||
flag: false,
|
||||
form: {
|
||||
number: 0,
|
||||
content: '',
|
||||
},
|
||||
rules: {
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
props: ["isShow","reasonTotal","reasonTableData","reasonLoading","showType","isFocus"],
|
||||
methods: {
|
||||
// 内层弹窗关闭
|
||||
handleCloseInside() {
|
||||
this.dialogVisibleInside = false
|
||||
this.flag = false
|
||||
this.form = {
|
||||
content: '',
|
||||
}
|
||||
},
|
||||
// 内层表单提交验证
|
||||
submitDate() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.flag = true
|
||||
if(this.titleInside === "新增原因") {
|
||||
this.addReason();
|
||||
} else {
|
||||
this.editReason();
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 新增原因
|
||||
addReason() {
|
||||
let num = 0;
|
||||
if(this.reasonTableData.length) {
|
||||
num = this.reasonTableData[this.reasonTableData.length-1].number
|
||||
}
|
||||
let form = {
|
||||
number: ++num,
|
||||
content: this.form.content,
|
||||
}
|
||||
API.addFailList(form).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$message({
|
||||
message: '新增成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.$emit("handReasonList")
|
||||
} else {
|
||||
this.$message.error('新增失败!');
|
||||
}
|
||||
this.flag = false
|
||||
this.handleCloseInside()
|
||||
}).catch(() => {
|
||||
this.$emit("handReasonList")
|
||||
this.flag = false
|
||||
})
|
||||
},
|
||||
// 编辑原因
|
||||
editReason() {
|
||||
API.editFailList(this.form).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$message({
|
||||
message: '编辑成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.$emit("handReasonList")
|
||||
} else {
|
||||
this.$message.error('编辑失败!')
|
||||
}
|
||||
this.handleCloseInside()
|
||||
this.flag = false
|
||||
}).catch(() => {
|
||||
this.handleCloseInside()
|
||||
this.flag = false
|
||||
})
|
||||
},
|
||||
removeAction(number) {
|
||||
this.$confirm('您确定要删除当前原因吗?', '删除提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
API.delFailList({ numbers: [number] }).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success'
|
||||
});
|
||||
this.$emit("handReasonList")
|
||||
} else {
|
||||
this.$message.error('删除失败!');
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 新增编辑理由弹窗(内层弹窗)
|
||||
reasonAction(type,data) {
|
||||
this.dialogVisibleInside = true
|
||||
if(type === "add") {
|
||||
this.titleInside = "新增原因"
|
||||
} else {
|
||||
this.titleInside = "编辑原因"
|
||||
this.id = data.id
|
||||
this.form.number = data.number
|
||||
this.form.content = data.content
|
||||
}
|
||||
},
|
||||
// 判断某行是否点击过
|
||||
rowClick(row) {
|
||||
if(row.isClick) {
|
||||
row.isClick = false;
|
||||
this.$refs.multipleTable.toggleRowSelection(row, false)
|
||||
} else {
|
||||
row.isClick = true;
|
||||
this.$refs.multipleTable.toggleRowSelection(row, true)
|
||||
}
|
||||
},
|
||||
// 进行数据勾选时触发事件
|
||||
handleSelectionChange(row) {
|
||||
let arr = [];
|
||||
for(let i = 0 ; i<row.length; i++) {
|
||||
arr.push(row[i].content)
|
||||
}
|
||||
let str = arr.join(";")
|
||||
this.$emit('handTextArea',str)
|
||||
},
|
||||
clear() {
|
||||
this.arrNow = [];
|
||||
this.numberArr = [];
|
||||
},
|
||||
getRowKeys(row) {
|
||||
return row.number;
|
||||
},
|
||||
// 分页条数改变回调
|
||||
changeSize(size) {
|
||||
this.params.pageSize = size
|
||||
this.queryFailList()
|
||||
},
|
||||
// 分页页码改变回调
|
||||
changeCurrent(number) {
|
||||
this.params.pageNumber = number
|
||||
this.queryFailList()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,179 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
:title="title"
|
||||
align="center"
|
||||
:visible.sync="dialogVisible"
|
||||
width="40%"
|
||||
:before-close="handleClose"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div :data="myData" class="my_data">
|
||||
<span>视频状态:{{ myData.status | videoStatus }}</span>
|
||||
<span>视频高度:{{ myData.height }}</span>
|
||||
<span>视频宽度:{{ myData.width }}</span>
|
||||
<span>视频时长:{{ myData.playTime + "s" }}</span>
|
||||
</div>
|
||||
<div class="media-box" v-if="videoShow">
|
||||
<video
|
||||
ref="videoEl"
|
||||
class="preview-video"
|
||||
controls
|
||||
preload="auto"
|
||||
playsinline
|
||||
></video>
|
||||
</div>
|
||||
<div class="media-box" id="img-box" v-if="imgShow">
|
||||
<img :src="mediaUrl" />
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Hls from "hls.js";
|
||||
import baseConfig from "@/utils/serverUrlConfig";
|
||||
import API from "@/api";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
imgShow: true,
|
||||
mediaUrl: "",
|
||||
videoShow: false,
|
||||
title: "封面图查看",
|
||||
params: {},
|
||||
urll: "",
|
||||
myData: [],
|
||||
hls: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
token() {
|
||||
return this.$store.state.token;
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.destroyPlayer();
|
||||
},
|
||||
methods: {
|
||||
// 视频审查列表
|
||||
videoFeviewList() {
|
||||
let urll = this.urll;
|
||||
API.videoFeviewList(this.params, urll).then(res => {
|
||||
this.myData = res.data;
|
||||
});
|
||||
},
|
||||
destroyPlayer() {
|
||||
if (this.hls) {
|
||||
this.hls.destroy();
|
||||
this.hls = null;
|
||||
}
|
||||
const video = this.$refs.videoEl;
|
||||
if (video) {
|
||||
video.pause();
|
||||
video.removeAttribute("src");
|
||||
video.load();
|
||||
}
|
||||
},
|
||||
handleClose() {
|
||||
this.destroyPlayer();
|
||||
this.dialogVisible = false;
|
||||
this.imgShow = false;
|
||||
this.videoShow = false;
|
||||
this.mediaUrl = "";
|
||||
},
|
||||
initHlsPlayer(src) {
|
||||
const video = this.$refs.videoEl;
|
||||
if (!video || !src) return;
|
||||
|
||||
if (Hls.isSupported()) {
|
||||
this.hls = new Hls({
|
||||
enableWorker: true,
|
||||
maxBufferLength: 15,
|
||||
maxMaxBufferLength: 180
|
||||
});
|
||||
this.hls.loadSource(src);
|
||||
this.hls.attachMedia(video);
|
||||
this.hls.on(Hls.Events.MANIFEST_PARSED, () => {
|
||||
video.play().catch(() => {});
|
||||
});
|
||||
this.hls.on(Hls.Events.ERROR, (event, data) => {
|
||||
if (!data.fatal || !this.hls) return;
|
||||
if (data.type === Hls.ErrorTypes.NETWORK_ERROR) {
|
||||
this.hls.startLoad();
|
||||
} else if (data.type === Hls.ErrorTypes.MEDIA_ERROR) {
|
||||
this.hls.recoverMediaError();
|
||||
} else {
|
||||
this.destroyPlayer();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Safari 等原生 HLS
|
||||
if (video.canPlayType("application/vnd.apple.mpegurl")) {
|
||||
video.src = src;
|
||||
video.addEventListener(
|
||||
"loadedmetadata",
|
||||
() => {
|
||||
video.play().catch(() => {});
|
||||
},
|
||||
{ once: true }
|
||||
);
|
||||
}
|
||||
},
|
||||
open(url, type, data) {
|
||||
this.destroyPlayer();
|
||||
this.dialogVisible = true;
|
||||
if (type === "img") {
|
||||
this.imgShow = true;
|
||||
this.videoShow = false;
|
||||
this.title = "封面图查看";
|
||||
this.mediaUrl = url;
|
||||
} else {
|
||||
this.imgShow = false;
|
||||
this.videoShow = true;
|
||||
this.title = "视频查看";
|
||||
this.mediaUrl =
|
||||
baseConfig.baseServerUrl +
|
||||
baseConfig.playVideoUrl +
|
||||
url +
|
||||
"?token=" +
|
||||
this.token;
|
||||
this.urll = data.id;
|
||||
this.$nextTick(() => {
|
||||
this.initHlsPlayer(this.mediaUrl);
|
||||
this.videoFeviewList();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.my_data {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.media-box {
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
img {
|
||||
height: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
.preview-video {
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
border: none !important;
|
||||
background: #000;
|
||||
object-fit: contain;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,202 @@
|
||||
<template>
|
||||
<div class="tags-box">
|
||||
<el-dialog
|
||||
:title="'图集详情'"
|
||||
:visible.sync="dialogVisible"
|
||||
:width="width"
|
||||
:before-close="handleClose"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div class="picturePopup" :style="{ overflow: over }">
|
||||
<div v-for="(item, i) in pictureList" :key="i" class="pictureInside">
|
||||
<base-upload
|
||||
:cover="item.src"
|
||||
:action="action"
|
||||
@successCallback="item.successCallback"
|
||||
:wSize="360"
|
||||
:hSize="480"
|
||||
:width="'180px'"
|
||||
:height="'180px'"
|
||||
:hide="true"
|
||||
:customPreview="true"
|
||||
@preview="preview(i)"
|
||||
@load="onImgLoad(i, $event)"
|
||||
></base-upload>
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
circle
|
||||
size="small"
|
||||
class="deleteButton"
|
||||
@click="deletePicture(i)"
|
||||
></el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<!-- <el-button @click="handleClose" size="small">取 消</el-button> -->
|
||||
<el-button type="primary" size="small" @click="addPicture"
|
||||
>新增</el-button
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="submitDate()"
|
||||
:loading="flag"
|
||||
>确 认</el-button
|
||||
>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import baseConfig from "@/utils/serverUrlConfig";
|
||||
import API from "@/api";
|
||||
import previewImages from "@/utils/previewImages";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
id: "",
|
||||
tags: [],
|
||||
flag: false,
|
||||
dialogVisible: false,
|
||||
// 封面上传地址
|
||||
action: baseConfig.baseServerUrl + "/vid/uploadStatic",
|
||||
imgUrl: baseConfig.imgUrl,
|
||||
pictureList: [],
|
||||
picturePopupLength: ["240px", "430px", "620px"],
|
||||
previewBlobs: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
width() {
|
||||
if (this.pictureList.length < 4 && this.pictureList.length > 0) {
|
||||
return this.picturePopupLength[this.pictureList.length - 1];
|
||||
} else if (this.pictureList.length < 10) {
|
||||
return "620px";
|
||||
} else {
|
||||
return "640px";
|
||||
}
|
||||
},
|
||||
over() {
|
||||
return this.pictureList.length < 10 ? "hidden" : "auto";
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onImgLoad(i, e) {
|
||||
const arr = Object.assign([], this.previewBlobs);
|
||||
arr[i] = e.blob;
|
||||
this.previewBlobs = arr;
|
||||
},
|
||||
preview(i) {
|
||||
previewImages(this.previewBlobs, i);
|
||||
},
|
||||
// 封面图上传成功回调
|
||||
successCallback(res) {
|
||||
this.params.cover = res.data.coverImg;
|
||||
},
|
||||
// 删除某张图片
|
||||
deletePicture(i) {
|
||||
if (this.pictureList.length === 1) {
|
||||
this.$message.error("请至少保留一张!");
|
||||
return;
|
||||
}
|
||||
this.pictureList.splice(i, 1);
|
||||
},
|
||||
// 新增图片
|
||||
addPicture() {
|
||||
let obj = {
|
||||
src: "",
|
||||
successCallback(res) {
|
||||
obj.src = res.data.coverImg;
|
||||
},
|
||||
};
|
||||
this.pictureList.push(obj);
|
||||
},
|
||||
// 提交表单
|
||||
submitDate() {
|
||||
let arr = [];
|
||||
this.pictureList.forEach((item) => {
|
||||
arr.push(item.src);
|
||||
});
|
||||
this.editVideoInfo({ seriesCover: arr, id: this.id, tags: this.tags });
|
||||
},
|
||||
editVideoInfo(params) {
|
||||
API.editVideoInfo(params)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.$message({
|
||||
message: "操作成功!",
|
||||
type: "success",
|
||||
});
|
||||
this.$emit("handlerPreviewList");
|
||||
} else {
|
||||
this.$message.error("操作失败!");
|
||||
}
|
||||
this.handleClose();
|
||||
this.flag = false;
|
||||
})
|
||||
.catch(() => {
|
||||
this.handleClose();
|
||||
this.flag = false;
|
||||
});
|
||||
},
|
||||
// 打开弹窗并初始化tags数据
|
||||
open(pictureArr, id, tags) {
|
||||
this.id = id;
|
||||
this.tags = tags.map((el) => el.name);
|
||||
this.dialogVisible = true;
|
||||
let arr = [];
|
||||
for (var i = 0; i < pictureArr.length; i++) {
|
||||
let obj = {
|
||||
src: pictureArr[i],
|
||||
successCallback(res) {
|
||||
obj.src = res.data.coverImg;
|
||||
},
|
||||
};
|
||||
arr.push(obj);
|
||||
}
|
||||
this.pictureList = arr;
|
||||
},
|
||||
// 关闭弹窗
|
||||
handleClose() {
|
||||
this.dialogVisible = false;
|
||||
this.pictureList = [];
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.tags-box {
|
||||
.el-dialog {
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
.input-box {
|
||||
margin-top: 15px;
|
||||
text-align: left;
|
||||
}
|
||||
.el-input {
|
||||
width: 200px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.picturePopup {
|
||||
border: solid 5px black;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
flex-wrap: wrap;
|
||||
max-height: 580px;
|
||||
.pictureInside {
|
||||
margin: 5px;
|
||||
position: relative;
|
||||
.deleteButton {
|
||||
position: absolute;
|
||||
opacity: 0.5;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,95 @@
|
||||
<template>
|
||||
<div class="tags-box">
|
||||
<el-dialog :title="'标签编辑'" :visible.sync="dialogVisible" width="500px" :before-close="handleClose" :close-on-click-modal="false">
|
||||
<el-form ref="form" :model="editParam" label-width="55px">
|
||||
<el-form-item label="标签:">
|
||||
<el-input type="textarea" :rows="3" placeholder="内容以“,”号隔开,如“张三,李四”" v-model="tagList"> </el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="handleClose" size="small">取 消</el-button>
|
||||
<el-button type="primary" @click="submitTag" size="small" :loading="flag">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import API from '@/api'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
tagList: '',
|
||||
coverMap: '',
|
||||
textarea: '',
|
||||
flag: false,
|
||||
editParam: {
|
||||
id: '',
|
||||
type: 1,
|
||||
tags: []
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 打开弹窗并初始化tags数据
|
||||
open(row, pic) {
|
||||
this.dialogVisible = true
|
||||
this.coverMap = pic
|
||||
this.editParam.id = row.id
|
||||
if (!row.tags) {
|
||||
this.tagList = ''
|
||||
return false
|
||||
}
|
||||
let tagList = []
|
||||
row.tags.forEach(item => {
|
||||
tagList.push(item.name)
|
||||
})
|
||||
this.tagList = tagList.join(',')
|
||||
},
|
||||
// 关闭弹窗
|
||||
handleClose() {
|
||||
this.dialogVisible = false
|
||||
this.$refs.form.resetFields()
|
||||
},
|
||||
// 提交tags
|
||||
submitTag() {
|
||||
if (!this.tagList) {
|
||||
this.$message.error('标签不能为空!');
|
||||
return false
|
||||
}
|
||||
this.flag = true
|
||||
this.editParam.tags = this.tagList.split(",")
|
||||
API.editVideoInfo(this.editParam).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$message({
|
||||
message: '编辑成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.$emit("handlerVideoList")
|
||||
} else {
|
||||
this.$message.error('编辑失败!');
|
||||
}
|
||||
this.handleClose()
|
||||
this.flag = false
|
||||
}).catch(() => {
|
||||
this.handleClose()
|
||||
this.flag = false
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.tags-box {
|
||||
.input-box {
|
||||
margin-top: 15px;
|
||||
text-align: left;
|
||||
}
|
||||
.el-input {
|
||||
width: 200px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user