<!-- 父页面-->
<el-dialog title="直播详情" :visible.sync="dialogFormVisible" append-to-body
:close-on-click-modal="false" width="50%" @close="dialogClose">
<editUserVideo v-if="dialogFormVisible" :formData="formData" callBackName="editUserVideo"
@editUserVideo="getUserVideo"></editUserVideo>
</el-dialog>
<el-button size="mini" type="primary" @click="detailsButton(scope.row)">直播详情</el-button>
getUserVideo(){
let _this = this;
_this.dialogFormVisible=false
this.page.currentPage=1
_this.getList(_this.page,_this.search)
},
/**
*直播详情
*/
detailsButton(row) {
let _this = this;
let isNull = validatenull;
detailsData(row.id).then((res)=>{
_this.formData = res.data.data
_this.dialogFormVisible=true
});
},
子页面:
<el-form-item prop="liveCoverUrl">直播封面:
<!-- :imgRestrictName="'请上传800px*480px的图片,格式为jpg,jpeg,png,大小不超过5m'" -->
<imgUploadVod
v-if="ImgiS"
style="margin-left:10%"
ref="imgUploadVod"
callBackName="imgUploadVod"
:imgWidth="800"
:imgHeight="480"
:fileList="fileList"
:imgSizeMB="1"
:imgFormat="'jpg,png'"
:accept="'.jpg,.png'"
:imgName="formData.name"
@imgUploadVod="getImgUrl"
></imgUploadVod>
</el-form-item>
mounted(){
this.imgData();
},
methods:{
imgData(){
let isNull=validatenull;
if(!isNull(this.formData.liveCoverUrl)){
let map = {};
map['name'] = '';
map['url'] = this.formData.liveCoverUrl;
this.fileList.push(map);
}
},
}
/**
* 上传图片后回调函数
* @param childValue
* @param callback
*/
getImgUrl(childValue, callback) {
this.formData.liveCoverUrl = childValue.url;
this.$refs.formData.validateField('liveCoverUrl');
},
// 关闭
closeButton(){
let isNull = validatenull;
if (!isNull(this.callBackName)) {
this.$emit(this.callBackName)
}
},
/**
*公共弹窗事件,text,提示内容
* type,提示类型;warning 警告 success成功
*/
showToal(title, message, type) {
this.$notify({
title: title,
message: message,
type: type,
duration: 2000
})
}
效果: