Commit 37bfd553 authored by 黄媛媛's avatar 黄媛媛

update

parent f612518c
<template>
<div class="Educationvideo">
<div class="left">
<ul class="lineUl" style="margin-top:30px">
<li @click="SelectLineId(-1)" :class="msg.LineId ==-1 ? 'Active' : ''">
不限
</li>
<li @click="SelectLineId(item.LineID)" :class="msg.LineId == item.LineID ? 'Active' : ''" v-for="(item,index) in LineList" :key="index">
{{item.LineName}}
</li>
</ul>
</div>
<div class="right">
<div class="search">
<el-input style="width:600px" placeholder="请输入内容" v-model="msg.Name" class="input-with-select">
<el-button @click="getList" slot="append" icon="el-icon-search"></el-button>
</el-input>
</div>
<div class="Content">
<ul class="videoUl">
<li v-for="(item,index) in dataList" :key="index">
<div @click.prevent="goUrl('EducationvideoSee',item)" class="imgDiv">
<img v-if="item.Cover && item.Cover!=''" :onerror="defaultImg" style="height:195px;width:100%" :src="item.Cover" alt="">
<img v-else style="height:195px;width:100%" src="../assets/img/hotel/biefu.png" alt="">
<div @click.prevent="goUrl1('EducationvideoList',$event)" class="icon">
<span class="iconfont icon-weihu"></span>
</div>
</div>
<p>{{item.Name}}</p>
<p>{{item.EmName}}</p>
<p>{{item.WatchNum}}次观看
<span class="circle"></span>
<span>{{item.UpdateDate}}</span>
</p>
</li>
</ul>
<div v-if="dataList.length==0" style="text-align:center">暂无数据</div>
<el-pagination background @current-change="handleCurrentChange"
layout="total,prev, pager, next, jumper" :page-size="msg.pageSize" :total='total'>
</el-pagination>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'Educationvideo',
created() {
},
data () {
return {
defaultImg: 'this.src="' + require("../assets/img/bg_z1@2x.png") + '"',
val:'',
LineList:[],
msg:{
pageIndex:1,
pageSize:20,
Name:'',
UserType:1,
VideoStatus:1,
CreateBy:'',
LineId:-1,
},
dataList:[],
total:0,
}
},
mounted() {
this.getLineList();
this.getList();
},
methods: {
SelectLineId(id){
this.msg.LineId=id;
this.getList();
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
//获取列表
getList() {
this.apipost(
"Video_get_GetPCVideoPageList",this.msg,
res => {
if (res.data.resultCode == 1) {
this.dataList = res.data.data.pageData;
this.total = res.data.data.count;
console.log("this.dataList",this.dataList)
}
}
);
},
goUrl1(path,e){
e.stopPropagation()
this.$router.push({
name:path,
query: {
blank: "y"
}
});
},
goUrl(path,item){
let msg=JSON.stringify(item)
this.$router.push({
name:path,
query: {
msg:msg,
blank: "y"
}
});
},
//获取线路列表
getLineList() {
this.apipost(
"line_post_GetList", {
LineDirection: 2
},
res => {
if (res.data.resultCode == 1) {
this.LineList = res.data.data;
}
}
);
},
},
}
</script>
<style>
.Educationvideo .right .Content .circle{
display: inline-block;
width: 3px;
height:3px;
background: #666666;
border-radius: 50%;
}
.Educationvideo .right .Content .videoUl li .imgDiv:hover .icon{
display: block;
}
.Educationvideo .right .Content .videoUl li .imgDiv .icon{
position: absolute;
right: 3px;
top: 3px;
padding: 2px 6px;
background: #000;
display: none;
}
.Educationvideo .right .Content .videoUl li .imgDiv .icon .iconfont{
color:#fff;
}
.Educationvideo .right .Content .videoUl li .imgDiv{
position: relative;
cursor: pointer;
}
.Educationvideo .right .Content .videoUl li p{
font-size: 14px;
color:#666666;
}
.Educationvideo .right .Content .videoUl li{
display: inline-block;
width: 300px;
padding: 5px;
box-sizing: border-box;
}
.Educationvideo .right .Content{
padding:90px 15px 10px 15px;
box-sizing: border-box;
}
*{
margin:0;
padding: 0;
}
.Educationvideo .left .lineUl .Active{
background: #f5f5f5;
}
.Educationvideo .left .lineUl li:hover{
background: #f5f5f5;
}
.Educationvideo .left .lineUl li{
padding:10px 35px;
box-sizing: border-box;
font-size: 14px;
}
li{
list-style: none;
}
.Educationvideo .right .search{
padding: 15px 0;
padding-left: 50px;
box-sizing: border-box;
position: fixed;
top: 0;
width: calc(100% - 240px);
background: #fff;
left: 240px;
}
.Educationvideo{
position: relative;
min-height: 100%;
background: #fff;
}
.Educationvideo .left{
position: fixed;
min-height: 100%;
width: 240px;
z-index: 100;
background: #fff;
}
.Educationvideo .right{
background: #f5f5f5;
padding-left: 250px;
box-sizing: border-box;
min-height: 100%;
}
</style>
<template>
<div class="Educationvideo">
<!-- <div class="left">
<ul class="lineUl" style="margin-top:30px">
<li v-for="(item,index) in LineList" :key="index">
{{item.LineName}}
</li>
</ul>
</div> -->
<div class="right">
<div class="search">
<el-input style="width:600px" placeholder="请输入内容" v-model="msg.Name" class="input-with-select">
<el-button @click="getList" slot="append" icon="el-icon-search"></el-button>
</el-input>
</div>
<div class="Content">
<ul class="videoUl">
<li v-for="(item,index) in dataList" :key="index">
<div @click.prevent="goUrl('EducationvideoSee',item)" class="imgDiv">
<img v-if="item.Cover && item.Cover!=''" :onerror="defaultImg" style="height:195px;width:100%" :src="item.Cover" alt="">
<img v-else style="height:195px;width:100%" src="../assets/img/hotel/biefu.png" alt="">
<el-tooltip class="item" effect="dark" content="编辑" placement="left">
<div @click.prevent="Edit(item,$event)" class="icon">
<span class="iconfont icon-bianji-smal"></span>
</div>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="删除" placement="left">
<div style="top:35px" @click.prevent="Delete(item,$event)" class="icon">
<span class="iconfont icon-shanchu"></span>
</div>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="撤回" placement="left">
<div style="top:70px" @click.prevent="Chehui(item,$event)" class="icon">
<span class="iconfont icon-chehui"></span>
</div>
</el-tooltip>
</div>
<p>{{item.Name}}</p>
<p>{{item.EmName}}</p>
<p>{{item.WatchNum}}次观看
<span class="circle"></span>
<span>{{item.UpdateDate}}</span>
</p>
</li>
</ul>
<div v-if="dataList.length==0" style="text-align:center">暂无数据</div>
<el-pagination background @current-change="handleCurrentChange"
layout="total,prev, pager, next, jumper" :page-size="msg.pageSize" :total='total'>
</el-pagination>
</div>
</div>
<el-dialog
title="上传"
:visible.sync="dialogVisible"
width="800px">
<el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="100px">
<el-form-item style="display:inline-block;" label="标题" prop="Name">
<el-input style="width:220px" v-model="addMsg.Name"></el-input>
</el-form-item>
<el-form-item style="display:inline-block" label="标签" prop="Name">
<el-input style="width:220px" v-model="addMsg.Label"></el-input>
</el-form-item>
<el-form-item style="display:inline-block" label="状态" prop="VideoStatus">
<el-select style="width:220px" v-model="addMsg.VideoStatus" placeholder="请选择状态">
<el-option label="发布" :value="1"></el-option>
<el-option label="草稿" :value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item style="display:inline-block" label="线路" prop="LineId">
<el-select style="width:220px" v-model="addMsg.LineId" placeholder="请选择线路">
<el-option v-for="(item,index) in LineList" :key="index" :label="item.LineName" :value="item.LineID"></el-option>
</el-select>
</el-form-item>
<el-form-item label="视频地址">
<el-upload class="EducationvideoListupload"
drag
:http-request="uploadFileBtn"
:multiple="false" :show-file-list="false" action="">
<i class="el-icon-plus avatar-uploader-icon"></i>
<div class="el-upload__text">{{$t("active.ld_djscwj")}}</div>
</el-upload>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="submitForm('addMsg')">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'Educationvideo',
created() {
},
data () {
return {
defaultImg: 'this.src="' + require("../assets/img/bg_z1@2x.png") + '"',
val:'',
LineList:[],
dialogVisible:true,
dataList:[],
msg:{
pageIndex:1,
pageSize:20,
Name:'',
UserType:1,
VideoStatus:'',
CreateBy:'',
LineId:-1,
},
addMsg:{
Id:0,
Name:'',
Cover:'',
VideoAddress:'',
Label:'',
VideoStatus:1,
LineId:'',
},
total:0,
rules: {
Name: [
{ required: true, message: '请输入标题', trigger: 'blur' },
],
VideoStatus: [
{ required: true, message: '请选择状态', trigger: 'change' }
],
LineId: [
{ required: true, message: '请选择线路', trigger: 'change' }
],
}
}
},
mounted() {
this.getLineList();
this.getList();
},
methods: {
uploadFileBtn(file) {
let newArr = [];
newArr.push(file.file);
// console.log("newArr",newArr);
let path = "/Sale/Uploadvideo/";
this.uploadFile(path, newArr, x => {
// let fileSize =
// file.file.size < 1024
// ? file.file.size
// : (file.file.size / 1024).toFixed(0);
// this.addMsg.images = this.domainManager().ViittoFileUrl + x.data.FilePath;
console.log("x",x);
});
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
//获取列表
getList() {
this.apipost(
"Video_get_GetPCVideoPageList",this.msg,
res => {
if (res.data.resultCode == 1) {
this.dataList = res.data.data.pageData;
this.total = res.data.data.count;
console.log("this.dataList",this.dataList)
}
}
);
},
Chehui(item,e){
e.stopPropagation()
this.$confirm("是否撤回?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.apipost('Video_post_CancelVidelInfo', {VideoId:item.Id}, res => {
if (res.data.resultCode == 1) {
this.Success(res.data.message)
this.getList()
}else{
this.Error(res.data.message)
}
})
})
.catch(() => {});
},
Delete(item,e){
e.stopPropagation()
this.$confirm("是否删除? 删除后不可恢复", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.apipost('Video_post_DelVidelInfo', {VideoId:item.Id}, res => {
if (res.data.resultCode == 1) {
this.Success(res.data.message)
this.getList()
}else{
this.Error(res.data.message)
}
})
})
.catch(() => {});
},
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.apipost('Video_post_SetPCVideoInfo', this.addMsg, res => {
if (res.data.resultCode == 1) {
this.Success(res.data.message)
this.getList()
}else{
this.Error(res.data.message)
}
})
} else {
}
});
},
Edit(item,e){
console.log(item);
e.stopPropagation()
this.addMsg.Cover=item.Cover;
this.addMsg.Id=item.Id;
this.addMsg.LineId=item.LineId;
this.addMsg.Name=item.Name;
this.addMsg.VideoAddress=item.VideoAddress;
this.addMsg.VideoStatus=item.VideoStatus;
this.dialogVisible=true;
},
goUrl(path,item){
let msg=JSON.stringify(item)
this.$router.push({
name:path,
query: {
msg:msg,
blank: "y"
}
});
},
//获取线路列表
getLineList() {
this.apipost(
"line_post_GetList", {
LineDirection: 2
},
res => {
if (res.data.resultCode == 1) {
this.LineList = res.data.data;
}
}
);
},
},
}
</script>
<style>
.Educationvideo .right .Content .circle{
display: inline-block;
width: 3px;
height:3px;
background: #666666;
border-radius: 50%;
}
.EducationvideoListupload .el-upload .el-upload-dragger{
width: 220px!important;
height: 115px!important;
}
.Educationvideo .right .Content .videoUl li .imgDiv:hover .icon{
display: block;
}
.Educationvideo .right .Content .videoUl li .imgDiv .icon{
position: absolute;
right: 3px;
top: 3px;
padding: 2px 6px;
background: #000;
display: none;
}
.Educationvideo .right .Content .videoUl li .imgDiv .icon .iconfont{
color:#fff;
}
.Educationvideo .right .Content .videoUl li .imgDiv{
position: relative;
cursor: pointer;
}
.Educationvideo .right .Content .videoUl li p{
font-size: 14px;
color:#666666;
}
.Educationvideo .right .Content .videoUl li{
display: inline-block;
width: 300px;
padding: 5px;
box-sizing: border-box;
}
.Educationvideo .right .Content{
padding:90px 15px 10px 15px;
box-sizing: border-box;
}
*{
margin:0;
padding: 0;
}
.Educationvideo .left .lineUl li:hover{
background: #f5f5f5;
}
.Educationvideo .left .lineUl li{
padding:10px 35px;
box-sizing: border-box;
font-size: 14px;
}
li{
list-style: none;
}
.Educationvideo .right .search{
padding: 15px 0;
padding-left: 50px;
box-sizing: border-box;
position: fixed;
top: 0;
width: 100%;
background: #fff;
/* left: 240px; */
}
.Educationvideo{
position: relative;
min-height: 100%;
background: #fff;
}
.Educationvideo .left{
position: fixed;
min-height: 100%;
width: 240px;
z-index: 100;
background: #fff;
}
.Educationvideo .right{
background: #f5f5f5;
/* padding-left: 250px; */
box-sizing: border-box;
min-height: 100%;
}
</style>
<template>
<div class="EducationvideoSee">
<div class="imgDiv">
<video height="500" :src="datainfo.VideoAddress" controls="controls">
您的浏览器不支持 video 标签。
</video>
<!-- <img style="height:100%;width:100%" src="../assets/img/hotel/biefu.png" alt=""> -->
<!-- <div class="icon">
<span class="iconfont icon-weihu"></span>
</div> -->
<p>{{datainfo.Name}}</p>
<p>{{datainfo.EmName}}</p>
<p>{{datainfo.WatchNum}}次观看
<span class="circle"></span>
<span>{{datainfo.UpdateDate}}</span>
</p>
</div>
</div>
</template>
<script>
export default {
name: 'EducationvideoSee',
created() {
},
data () {
return {
val:'',
datainfo:{},
}
},
mounted() {
if(this.$route.query.msg){
this.datainfo=JSON.parse(this.$route.query.msg)
console.log("this.datainfo",this.datainfo)
}
},
methods: {
},
}
</script>
<style>
.EducationvideoSee .circle{
display: inline-block;
width: 3px;
height:3px;
background: #666666;
border-radius: 50%;
}
.EducationvideoSee .imgDiv{
width: 850px;
height: 453px;
position: relative;
}
.EducationvideoSee{
min-height:100%;
background: #fff;
padding: 15px 50px;
box-sizing: border-box;
}
</style>
......@@ -708,27 +708,40 @@ export default {
//files 文件数组
//p 进度回调函数
Vue.prototype.uploadFile = function (path, files, successCall) {
if (files && files.length > 0) {
let nameList = new Array()
for (let index = 0; index < files.length; index++) {
nameList.push(this.random_string());
}
var oss = new OSS({
region: 'oss-cn-hangzhou',
region: 'oss-cn-chengdu',
accessKeyId: 'LTAIwE7l9dImZSa3',
accessKeySecret: 'j47Ajn0d0WzUCIX8Biyj3P2r8QDltI',
bucket: 'reborndev'
bucket: 'vt-im-bucket'
})
let that = this
let that = this;
let checkpoint=null;
let percentage=0;
co(function* () {
for (let index = 0; index < files.length; index++) {
let fileName = nameList[index]
fileName = "/New" + path + fileName + "." + files[index].name.split('.').pop()
var result = yield oss.multipartUpload(fileName, files[index], {
progress: function* (p) {},
mime: 'application/octet-stream'
})
successCall(result);
// var result = oss.multipartUpload(filename, files[index], {
// progress: async function (p, checkpoint) {
// checkpoint = checkpoint
// percentage = p * 100
// },
// checkpoint: that.checkpoint
// })
console.log("result",result)
// successCall(result);
}
}).catch(function (err) {
......
......@@ -4495,7 +4495,32 @@ export default {
title: '资产管理'
},
},
{
path: '/Educationvideo', //教育视频
name: 'Educationvideo',
component: resolve => require(['@/components/Educationvideo'], resolve),
meta: {
title: '教育视频'
},
},
{
path: '/EducationvideoSee', //教育视频
name: 'EducationvideoSee',
component: resolve => require(['@/components/EducationvideoSee'], resolve),
meta: {
title: '观看教育视频'
},
},
{
path: '/EducationvideoList', //教育视频
name: 'EducationvideoList',
component: resolve => require(['@/components/EducationvideoList'], resolve),
meta: {
title: '维护教育视频'
},
},
{
path: '/supplierIndex', //供应商首页
name: 'supplierIndex',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment