Commit e152c25b by xuyl

更新

1 parent 0e166c61
<template>
<div class="createANewLiveRoom">
<div class="header">
<!-- <el-steps :active="active" finish-status="success">-->
<!-- <el-step title="基本信息"></el-step>-->
<!-- <el-step title="直播间配置"></el-step>-->
<!-- </el-steps>-->
<div class="step">
<div class="beseinfo">
<div class="circular">1</div>
<div class="">基本信息</div>
</div>
<div class="horizontalLine"></div>
<div class="beseinfo">
<div class="circular">2</div>
<div>直播间配置</div>
</div>
</div>
</div>
<div class="foot">
<div>
<el-button>下一步</el-button>
<el-button>保存</el-button>
</div>
</div>
</div>
</template>
<script>
export default {
name: "createANewLiveRoom",
data() {
return {
active: 0
};
}
};
</script>
<style lang="scss" scoped>
.createANewLiveRoom {
.header {
width: 30%;
.step {
display: flex;
align-items: center;
.horizontalLine{
height: 1px;
width: 30%;
background:#C6C6C6 ;
margin: 0 15px;
}
.beseinfo {
display: flex;
line-height: 32px;
.circular {
width: 32px;
height: 32px;
border-radius: 50%;
border:1px solid #C6C6C6;
color: #C6C6C6;
text-align: center;
line-height: 32px;
}
}
}
}
}
</style>
...@@ -5,8 +5,9 @@ ...@@ -5,8 +5,9 @@
:size="size" :size="size"
type="primary" type="primary"
class="el-icon-plus" class="el-icon-plus"
@click="pageClick(1)" @click="goLiveRoom"
>新建</el-button> >新建
</el-button>
</div> </div>
<div class="container"> <div class="container">
<div> <div>
...@@ -36,7 +37,7 @@ ...@@ -36,7 +37,7 @@
slot-scope="scope" slot-scope="scope"
> >
<span :class="['table-circle', 'm-r-8', scope.scope.status == 1 ?'back-blue': 'back-grey']"></span> <span :class="['table-circle', 'm-r-8', scope.scope.status == 1 ?'back-blue': 'back-grey']"></span>
<span>{{scope.scope.statusStr || '--'}}</span> <span>{{ scope.scope.statusStr || "--" }}</span>
</div> </div>
<div <div
class="table-btns" class="table-btns"
...@@ -134,241 +135,252 @@ ...@@ -134,241 +135,252 @@
</template> </template>
<script> <script>
import url from '@/assets/empty.png' import url from "@/assets/empty.png";
export default { export default {
name: 'LiveIndex', name: "LiveIndex",
data () { data() {
return { return {
pickerOptions: { pickerOptions: {
disabledDate (date) { disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate() - 1)) const yesterday = new Date(new Date().setDate(new Date().getDate() - 1));
return date < yesterday return date < yesterday;
} }
}, },
dialogObj: { dialogObj: {
show: false show: false
}, },
size: 'small', size: "small",
url: url, url: url,
searchForm: { searchForm: {
term: '', term: "",
status: '' status: ""
}, },
tableSearchForm: {}, tableSearchForm: {},
// 搜索 // 搜索
searchFormData: [ searchFormData: [
{ {
label: '直播间搜索', label: "直播间搜索",
name: 'term', name: "term",
type: 'input', type: "input",
maxlength: 20 maxlength: 20
}, },
{ {
label: '直播状态', label: "直播状态",
name: 'status', name: "status",
type: 'select', type: "select",
width: '215px', width: "215px",
optionList: [ optionList: [
{ confId: '', confName: '全部' }, { confId: "", confName: "全部" },
{ confId: '0', confName: '未开始' }, { confId: "0", confName: "未开始" },
{ confId: '1', confName: '进行中' }, { confId: "1", confName: "进行中" },
{ confId: '2', confName: '已结束' }, { confId: "2", confName: "已结束" }
], ],
optionId: 'confId', optionId: "confId",
optionLabel: 'confName' optionLabel: "confName"
} }
], ],
// 表格 // 表格
getListApi: this.$apis.live.getListApi, getListApi: this.$apis.live.getListApi,
tableParams: { tableParams: {
listName: 'list', listName: "list",
tableOption: true, tableOption: true,
tableColumns: [ tableColumns: [
{ {
label: '房间号', label: "房间号",
prop: 'roomNumber', prop: "roomNumber"
}, },
{ {
label: '直播间名称', label: "直播间名称",
prop: 'name', prop: "name"
}, },
{ {
label: '最近开播', label: "最近开播",
prop: 'liveTime' prop: "liveTime"
}, },
{ {
label: '直播状态', label: "直播状态",
prop: 'status', prop: "status",
addHtml: 'status', addHtml: "status"
} }
] ]
}, },
tableButtonList: [ tableButtonList: [
{ {
type: 'el-button', type: "el-button",
name: '详情', name: "详情",
attrs: { attrs: {
type: 'text' type: "text"
}, },
listeners: { listeners: {
click: row => { click: row => {
this.$apis.live this.$apis.live
.LiveRoomDetailApi({ id: row.id }) .LiveRoomDetailApi({ id: row.id })
.then(res => { .then(res => {
console.log(JSON.parse(JSON.stringify(res))) console.log(JSON.parse(JSON.stringify(res)));
this.liveDetail = res this.liveDetail = res;
this.pageClick() this.pageClick();
}) });
} }
} }
} }
], ],
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' }, pageConf: { pageSize: "pageSize", pageNum: "currentPage", totalCount: "total" },
editChildRef: 'editChildRef', editChildRef: "editChildRef",
editForm: { editForm: {
name: '', name: "",
liveTime: [] liveTime: []
}, },
configEditFormData: [ configEditFormData: [
{ {
label: '直播间名称', label: "直播间名称",
name: 'name', name: "name",
type: 'input', type: "input",
maxlength: 20, maxlength: 20
}, },
{ {
label: '开播时间', label: "开播时间",
name: 'liveTime', name: "liveTime",
type: 'datePicker', type: "datePicker",
addHtml: 'liveTimeHtml' addHtml: "liveTimeHtml"
} }
], ],
editRule: { editRule: {
name: [{ required: true, message: '请输入直播间名称', trigger: 'change' }], name: [{ required: true, message: "请输入直播间名称", trigger: "change" }],
liveTime: [{ required: true, message: '请选择开播时间', trigger: 'change' }], liveTime: [{ required: true, message: "请选择开播时间", trigger: "change" }]
}, },
liveDetail: {} liveDetail: {}
} };
}, },
mounted () { mounted() {
}, },
methods: { methods: {
pageClick (type) { goLiveRoom() {
this.$router.push(
{ path: "./createANewLiveRoom" }
);
},
pageClick(type) {
this.editForm = { this.editForm = {
name: '', name: "",
liveTime: [] liveTime: []
} };
this.dialogObj = { this.dialogObj = {
type, type,
show: true show: true
} };
}, },
getParams () { getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm)) var params = JSON.parse(JSON.stringify(this.searchForm));
return params return params;
}, },
beforeSearchFn () { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
this.tableSearchForm = this.getParams() this.tableSearchForm = this.getParams();
resolve() resolve();
}) });
}, },
setTableFinishFun () { setTableFinishFun() {
//接收到的数据为空 //接收到的数据为空
this.$refs.classifyRef.data.length ? (this.$refs.classifyRef.tableHeightValues = '') : this.$refs.classifyRef.setTableHeightFun() this.$refs.classifyRef.data.length ? (this.$refs.classifyRef.tableHeightValues = "") : this.$refs.classifyRef.setTableHeightFun();
}, },
handleSearch () { handleSearch() {
this.$refs.classifyRef.refreshTable() this.$refs.classifyRef.refreshTable();
}, },
handleReset () { handleReset() {
this.searchForm = { this.searchForm = {
classifyName: '', classifyName: "",
createDate: [] createDate: []
} };
this.handleSearch() this.handleSearch();
}, },
handleTimeChange (e) { handleTimeChange(e) {
this.editForm.liveTime = e this.editForm.liveTime = e;
}, },
handleCopy (txt) { handleCopy(txt) {
this.$message({ this.$message({
message: '复制成功', message: "复制成功",
type: 'success', type: "success",
customClass: 'message-Z-zinde' customClass: "message-Z-zinde"
}) });
const input = document.createElement('input') const input = document.createElement("input");
document.body.appendChild(input) document.body.appendChild(input);
input.setAttribute('value', txt) input.setAttribute("value", txt);
input.select() input.select();
document.execCommand('Copy') document.execCommand("Copy");
document.body.removeChild(input) document.body.removeChild(input);
}, },
handleCreateLiveRoom () { handleCreateLiveRoom() {
this.$refs.configEditFormRef.$refs[this.editChildRef].validate(valid => { this.$refs.configEditFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) { if (valid) {
let { name, liveTime } = this.editForm, let { name, liveTime } = this.editForm,
params = { params = {
name name
} };
if (liveTime.length) { if (liveTime.length) {
let [startTimeStr, endTimeStr] = liveTime let [startTimeStr, endTimeStr] = liveTime;
params.startTimeStr = startTimeStr params.startTimeStr = startTimeStr;
params.endTimeStr = endTimeStr params.endTimeStr = endTimeStr;
} }
this.loading = true this.loading = true;
this.$apis.live this.$apis.live
.addOrUpdataLiveRoomApi(params) .addOrUpdataLiveRoomApi(params)
.then(res => { .then(res => {
this.$message({ this.$message({
message: res.code == '0' ? '操作成功' : res.message ? res.message : '操作失败', message: res.code == "0" ? "操作成功" : res.message ? res.message : "操作失败",
type: res.code == '0' ? 'success' : 'error' type: res.code == "0" ? "success" : "error"
}) });
if (res.code == '0') { if (res.code == "0") {
this.handleSearch() this.handleSearch();
this.dialogObj.show = false this.dialogObj.show = false;
} }
}) })
.finally(() => { .finally(() => {
this.loading = false this.loading = false;
}) });
} }
}) });
} }
} }
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.dialog-content { .dialog-content {
.box { .box {
padding-left: 20px; padding-left: 20px;
.isBlock { .isBlock {
margin-bottom: 20px; margin-bottom: 20px;
} }
.el-form-item__content { .el-form-item__content {
cursor: pointer; cursor: pointer;
} }
.el-form-item__label { .el-form-item__label {
width: 154px; width: 154px;
} }
.el-input { .el-input {
width: 284px; width: 284px;
height: 32px; height: 32px;
background: #ffffff; background: #ffffff;
border-radius: 4px; border-radius: 4px;
/deep/.el-input__inner {
/deep/ .el-input__inner {
height: 100%; height: 100%;
} }
/deep/.el-input__icon {
/deep/ .el-input__icon {
line-height: 32px; line-height: 32px;
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!