提交 b9f66183 编写于 作者: alex.zhang's avatar alex.zhang

直播管理

上级 483bda12
...@@ -3,7 +3,13 @@ ...@@ -3,7 +3,13 @@
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb> <bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb>
<div class="yqrange-index-content screenSet" id="screenSet"> <div class="yqrange-index-content screenSet" id="screenSet">
<div class="header-title">直播管理</div> <div class="header-title">直播管理</div>
<el-form ref="searchForm" :model="searchForm" label-width="75px" label-suffix=":" :inline="true"> <el-form
ref="searchForm"
:model="searchForm"
label-width="75px"
label-suffix=":"
:inline="true"
>
<el-row :gutter="30" type="flex" style="margin-top: 10px"> <el-row :gutter="30" type="flex" style="margin-top: 10px">
<el-col :span="10"> <el-col :span="10">
<el-form-item label="直播名称"> <el-form-item label="直播名称">
...@@ -12,13 +18,18 @@ ...@@ -12,13 +18,18 @@
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<el-form-item label="直播状态"> <el-form-item label="直播状态">
<el-select v-model="searchForm.liveStatus" placeholder="请选择发布状态" clearable style="margin-left:20px;"> <el-select
v-model="searchForm.liveStatus"
placeholder="请选择发布状态"
clearable
style="margin-left:20px;"
>
<el-option <el-option
v-for="item in statusList" v-for="item in statusList"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.label"> :value="item.label"
</el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -45,7 +56,7 @@ ...@@ -45,7 +56,7 @@
<el-table-column prop="endTime" label="结束时间" min-width="100" align="center"></el-table-column> <el-table-column prop="endTime" label="结束时间" min-width="100" align="center"></el-table-column>
<el-table-column label="操作" min-width="300" align="center"> <el-table-column label="操作" min-width="300" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button @click="reviewLive(scope.row)" type="text" size="small">设置回放</el-button> <!-- <el-button @click="reviewLive(scope.row)" type="text" size="small">设置回放</el-button> -->
<el-button @click="liveLink(scope.row)" type="text" size="small">直播链接</el-button> <el-button @click="liveLink(scope.row)" type="text" size="small">直播链接</el-button>
<el-button @click="countLive(scope.row)" type="text" size="small">数据统计</el-button> <el-button @click="countLive(scope.row)" type="text" size="small">数据统计</el-button>
<el-button @click="editLive(scope.row)" type="text" size="small">编辑</el-button> <el-button @click="editLive(scope.row)" type="text" size="small">编辑</el-button>
...@@ -65,59 +76,96 @@ ...@@ -65,59 +76,96 @@
:total="totalRows" :total="totalRows"
></el-pagination> ></el-pagination>
</div> </div>
<el-dialog
title="数据统计"
:visible.sync="dialogStatisticsVisible"
width="500px"
:close-on-click-modal="false"
@close="handleTypeClose"
center
>
<!-- <el-table-column prop="peopleNum" label="观看人次" min-width="50" align="center"></el-table-column>
<el-table-column prop="liveDuration" label="直播时长" min-width="50" align="center"></el-table-column>-->
<el-table :data="dialogStatisticsData" align="center">
<el-table-column property="peopleNum" label="观看人次" align="center"></el-table-column>
<el-table-column property="liveDuration" label="直播时长" align="center"></el-table-column>
</el-table>
</el-dialog>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import BreadCrumb from "@/components/breadcrumb.vue"; let vm = null;
export default { import BreadCrumb from "@/components/breadcrumb.vue";
export default {
components: { components: {
BreadCrumb BreadCrumb
}, },
data(){ data() {
return{ return {
curmbFirst: '云鹊小圈', curmbFirst: "云鹊小圈",
curmbSecond: '直播管理', curmbSecond: "直播管理",
dialogStatisticsVisible: false,
searchForm: { searchForm: {
liveName: '', liveName: "",
liveStatus: '', liveStatus: "",
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10
}, },
totalRows: 0, totalRows: 0,
statusList: [{ statusList: [
value: '1', {
label: '预告' value: "1",
}, { label: "预告"
value: '2', },
label: '直播中' {
}, { value: "2",
value: '3', label: "直播中"
label: '已结束' },
}], {
value: "3",
label: "已结束"
}
],
tableData: [ tableData: [
{ {
liveName: '浙江医学大会第二场', liveName: "浙江医学大会第二场",
liveStatus: 1, liveStatus: 3,
createTime: '', createTime: "",
startTime: '', startTime: "",
endTime: '', endTime: "",
rtcId: 0,
} }
], ],
dialogStatisticsData: [
{
peopleNum: 234,
liveDuration: "38分钟"
} }
],
circleId: null
};
},
created() {
vm = this;
this.circleId = this.$route.query.id;
vm.getLiveList("", "");
}, },
methods: { methods: {
searchList() { searchList() {
console.log('查询') console.log("查询");
this.getLiveList(this.searchForm.liveName, this.searchForm.liveStatus);
}, },
resetForm() { resetForm() {
console.log('重置') console.log("重置");
}, },
//新建直播 //新建直播
createLive() { createLive() {
this.$router.push({ this.$router.push({
path: '/create-live', path: "/create-live"
}) });
}, },
//直播链接 //直播链接
liveLink(row) {}, liveLink(row) {},
...@@ -125,39 +173,67 @@ ...@@ -125,39 +173,67 @@
reviewLive(row) {}, reviewLive(row) {},
//数据统计 //数据统计
countLive(row) { countLive(row) {
this.$msgbox({ this.dialogStatisticsVisible = true;
title: '直播链接', this.getStatisticsData();
message: '这是一段内容', },
showCancelButton: true getStatisticsData() {
// confirmButtonText: '确定', console.log("getStatisticsData() : this.circleId = " + this.circleId);
// cancelButtonText: '取消' let req = {
}).then(action => { rtcId: this.circleId
this.$message({ };
type: 'info', vm.GET("liveAdmin/data", req).then(res => {
message: 'action: ' + action if (res.code == "000000") {
let listData = [];
let obj = {
peopleNum: res.data.viewedPersonTime,
liveDuration: res.data.liveDuration
};
listData.push(obj);
this.dialogStatisticsData = listData;
} else {
this.dialogStatisticsData = [];
}
}); });
})
}, },
//编辑直播 //编辑直播
editLive(row) { editLive(row) {
this.$router.push({ this.$router.push({
path: '/create-live', path: "/create-live",
query: { query: {
// rtcId: "1" // rtcId: "1"
rtcId: row.id rtcId: row.id
} }
}) });
}, },
//删除直播 //删除直播
deleteLive(row) { deleteLive(row) {
this.$confirm(`确定删除“${row.liveName}”吗?`, '', { this.$confirm(`确定删除“${row.liveName}”吗?`, "", {
confirmButtonText: '删除', confirmButtonText: "删除",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning', type: "warning"
customClass: 'range-make-box', // customClass: 'range-make-box',
}).then(() => { })
.then(() => {
// confirm // confirm
}).catch(() => { let req = {
rtcId: row.rtcId,
};
vm.DELETE("liveAdmin", req).then(res => {
if (res.code == "000000") {
vm.$message({
type: "success",
message: "删除成功"
});
this.getLiveList("", "")
} else {
vm.$message({
type: "success",
message: "删除失败"
});
}
});
})
.catch(() => {
// cancel // cancel
}); });
}, },
...@@ -170,35 +246,65 @@ ...@@ -170,35 +246,65 @@
this.searchForm.pageNo = val; this.searchForm.pageNo = val;
this.searchList(); this.searchList();
}, },
}, getLiveList(name, status) {
let req = {
circleId: this.circleId,
name: name,
liveStatus: status,
pageNo: 1,
pageSize: 30
};
console.log("alex name = " + name + ", status = " + status);
vm.GET("liveAdmin/list", req).then(res => {
if (res.code == "000000") {
// console.log(res);
let listData = [];
for (let i = 0; i < data.length; i++) {
let obj = {
liveName: res.data.pageContents[i].name,
liveStatus: res.data.pageContents[i].liveStatus,
createTime: res.data.pageContents[i].createdTime,
startTime: res.data.pageContents[i].openTime,
endTime: res.data.pageContents[i].endTime,
rtcId: res.data.pageContents[i].rtcIntroduces[0].rtcId,
};
listData.push(obj);
} }
this.tableData = listData;
} else {
this.tableData = [];
}
});
}
}
};
</script> </script>
<style lang="scss"> <style lang="scss">
.yqrange-index-wrapper{ .yqrange-index-wrapper {
.yqrange-index-content{ .yqrange-index-content {
background: #fff; background: #fff;
padding: 10px; padding: 10px;
.header-title{ .header-title {
padding: 10px 12px; padding: 10px 12px;
font-size: 12px; font-size: 12px;
color: #449284; color: #449284;
border-bottom: 1px solid #efefef; border-bottom: 1px solid #efefef;
} }
} }
.el-button--text{ .el-button--text {
color: #449284; color: #449284;
font-size: 14px; font-size: 14px;
&::after{ &::after {
content: ''; content: "";
position: relative; position: relative;
height: 14px; height: 14px;
/*border-right: 1px solid #EBEEF5;*/ /*border-right: 1px solid #EBEEF5;*/
border-right: 1px solid #aaaaaa; border-right: 1px solid #aaaaaa;
padding-right: 10px; padding-right: 10px;
} }
&:last-of-type{ &:last-of-type {
&::after{ &::after {
content: ''; content: "";
position: relative; position: relative;
width: 1px; width: 1px;
height: 14px; height: 14px;
...@@ -206,5 +312,5 @@ ...@@ -206,5 +312,5 @@
} }
} }
} }
} }
</style> </style>
...@@ -142,7 +142,7 @@ export default { ...@@ -142,7 +142,7 @@ export default {
//直播管理 //直播管理
liveManage(row) { liveManage(row) {
this.$router.push({ this.$router.push({
path: '/live-manage', path: '/live-manage?id=' + row.id,
}) })
}, },
//成员管理 //成员管理
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册