Commit c86a7940 authored by 黄奎's avatar 黄奎

页面修改

parent 94769a57
......@@ -3,16 +3,15 @@
<template v-if="videoIsShowAdd">
<div class="head-title">
视频
<el-button @click="videoIsShowAdd=false" style="float:right;margin-top: -5px;" size="small"
type="primary">
<el-button @click="videoIsShowAdd=false" style="float:right;margin-top: -5px;" size="small" type="primary">
添加视频
</el-button>
</div>
<div class="content">
<div>
<div class="searchInput">
<el-input style="display:inline-block;width:225px;height:30px" placeholder="请输入搜索内容"
v-model="msg.TopicName" size="small" clearable @keyup.enter.native="msg.pageIndex=1,getList()">
<el-input style="display:inline-block;width:225px;height:30px" placeholder="请输入搜索内容" v-model="msg.Title"
size="small" clearable @keyup.enter.native="msg.pageIndex=1,getList()">
</el-input>
<span class="el-icon-search" style="color:#979dad;font-size:14px;position:relative;top:1px"
@click="msg.pageIndex=1,getList()"> </span>
......@@ -21,15 +20,13 @@
<el-table :data="dataList" v-loading="loading" border style="width: 100%;margin:20px 0">
<el-table-column prop="Id" label="ID" width="150">
</el-table-column>
<el-table-column prop="TopicName" label="分类名称" width="829">
<el-table-column prop="Title" label="标题" width="200">
</el-table-column>
<el-table-column prop="SortNum" label="排序" width="250">
</el-table-column>
<el-table-column prop="IsDisable" label="状态" width="150">
<el-table-column prop="VedioUrl" label="封面" width="150">
<template slot-scope="scope">
<el-switch v-model="scope.row.IsDisable" active-color="#409EFF" :active-value="1" :inactive-value="0"
@change="updateIsDisable(scope.row)">
</el-switch>
<img v-if="scope.row.VedioCoverImg" :src="scope.row.VedioCoverImg" />
</template>
</el-table-column>
<el-table-column label="操作">
......@@ -64,22 +61,22 @@
</el-radio-group>
</el-form-item>
<el-form-item label="视频链接">
<el-input placeholder="请输入链接" v-model="addMsg.VedioUrl" size="small">
<el-button slot="append">选择文件</el-button>
</el-input>
<el-link class="box-grow-0" type="primary" style="font-size:12px" v-if='addMsg.VedioUrl' :underline="false"
target="_blank" :href="data.video_url">视频预览
</el-link>
<el-input placeholder="请输入链接" v-model="addMsg.VedioUrl" size="small">
<el-button slot="append">选择文件</el-button>
</el-input>
<el-link class="box-grow-0" type="primary" style="font-size:12px" v-if='addMsg.VedioUrl'
:underline="false" target="_blank" :href="addMsg.VedioUrl">视频预览
</el-link>
</el-form-item>
<el-form-item label="封面图" prop="VedioCoverImg">
<el-tooltip class="item" effect="dark" content="建议尺寸:750 * 400" placement="top">
<el-button size="mini" @click="choicImg=true">选择图片</el-button>
<el-button size="mini" @click="choicImg=true">选择图片</el-button>
</el-tooltip>
<div class="customize-share-title">
<div class="zk_pic_box" flex="main:center cross:center"
:style="{backgroundImage:'url(' + getIconLink(addMsg.VedioCoverImg) + ')'}">
<i v-if="addMsg.VedioCoverImg==''" class="el-icon-picture-outline"></i>
</div>
<div class="zk_pic_box" flex="main:center cross:center"
:style="{backgroundImage:'url(' + getIconLink(addMsg.VedioCoverImg) + ')'}">
<i v-if="addMsg.VedioCoverImg==''" class="el-icon-picture-outline"></i>
</div>
</div>
</el-form-item>
<el-form-item label="排序">
......@@ -114,19 +111,19 @@
msg: {
pageIndex: 1,
pageSize: 15,
TopicName: ""
Title: ""
},
total: 0,
videoIsShowAdd: true,
choicImg:false,
choicImg: false,
addMsg: {
Id: 0, //视频编号
Title: '', //视频标题
SourceType: 1, //视频来源(1-源地址,2-腾讯)
VedioUrl:'', //视频链接
VedioCoverImg:'', //封面图
SortNum:'', //排序
VedioIntro:'' //视频详情介绍
VedioUrl: '', //视频链接
VedioCoverImg: '', //封面图
SortNum: '', //排序
VedioIntro: '' //视频详情介绍
},
rules: {
Title: [{
......@@ -134,7 +131,7 @@
message: '标题不能为空',
trigger: 'change'
}],
VedioCoverImg:[{
VedioCoverImg: [{
required: true,
message: '封面图',
trigger: 'change'
......@@ -152,7 +149,7 @@
this.getList();
},
getList() {
this.apipost("/api/MContent/GetTopicTypePageList", this.msg, res => {
this.apipost("/api/MContent/GetVideoPageList", this.msg, res => {
if (res.data.resultCode == 1) {
this.dataList = res.data.data.pageData;
this.total = res.data.data.count;
......@@ -171,12 +168,22 @@
}
});
},
clearMsg() {
this.addMsg.Id = 0;
this.addMsg.Title = '';
this.addMsg.SourceType = 1;
this.addMsg.VedioUrl = '';
this.addMsg.VedioCoverImg = '';
this.addMsg.SortNum = 0;
this.addMsg.VedioIntro = '';
},
//保存
saveMsg() {
this.apipost("/api/MContent/SetTopicType", this.addMsg, res => {
this.apipost("/api/MContent/SetVideo", this.addMsg, res => {
if (res.data.resultCode == 1) {
this.videoIsShowAdd = true;
this.getList();
this.clearMsg();
this.Success(res.data.message);
} else {
this.Info(res.data.message);
......@@ -188,6 +195,41 @@
this.addMsg.VedioCoverImg = msg.url;
this.choicImg = false;
},
//修改
EditprojectClass(item) {
this.apipost("/api/MContent/GetVideo", {
Id: item.Id
}, res => {
if (res.data.resultCode == 1) {
this.projectClassIsShowAdd = false;
var jsonData = res.data.data;
this.addMsg.Id = jsonData.Id;
this.addMsg.Title = jsonData.Title;
this.addMsg.SourceType = jsonData.SourceType;
this.addMsg.VedioUrl = jsonData.VedioUrl;
this.addMsg.VedioCoverImg = jsonData.VedioCoverImg;
this.addMsg.SortNum = jsonData.SortNum;
this.addMsg.VedioIntro = jsonData.VedioIntro;
} else {
this.Info(res.data.message);
}
})
},
//删除
RemoveprojectClass(item) {
var that = this;
that.Confirm("是否要删除?", function () {
that.apipost("/api/MContent/RemoveVideo", {
Id: item.Id
}, res => {
if (res.data.resultCode == 1) {
that.getList();
} else {
that.Info(res.data.message);
}
})
})
},
},
mounted() {
this.getList();
......
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