Commit 1d179998 by 前端

Merge branch 'xuyl_dev_v3.2.0' into 'v3.2.0'

Xuyl dev v3.2.0

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