<template>
  <div class="speech-material">
      <p class="speech-material-appellation">亲爱的嘉宾，您好！</p>
      <p class="speech-material-tip">您已经是我们本次会议的发言嘉宾，请您在明天早上7点前，完成发言材料上传。</p>
      <el-form :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm">
        <el-form-item label="" prop="resource">
            <UpLoadFile @getFileUrl="getPreviousPositions"></UpLoadFile>
            <p class="tip-custom">直接拖拽材料放到本区域或者点击选择发言材料，完成上传。支持word、pdf格式。请您以姓名+文件名格式，方便为你做数据管理储存。</p>
        </el-form-item>
        <el-form-item prop="desc">
            <span class="label-custom">材料描述</span>
            <el-input type="textarea" v-model="ruleForm.desc" :rows="8"></el-input>
        </el-form-item>
        <el-form-item label="是否公开" prop="resource" label-width="100px">
            <el-radio-group v-model="ruleForm.resource">
            <el-radio label="是"></el-radio>
            <el-radio label="否"></el-radio>
            </el-radio-group>
        </el-form-item>
        <el-form-item style="text-align: center">
            <el-button type="primary" @click="submitForm('ruleForm')">提交材料</el-button>
        </el-form-item>
    </el-form>
  </div>
</template>

<script>
import UpLoadFile from "@/views/conferenceServices/UpLoadFile";
export default {
    components: {
        UpLoadFile
    },
    data() {
        return {
        ruleForm: {
            resource: '',
            desc: ''
        },
        rules: {
            resource: [
            { required: true, message: '请选择活动资源', trigger: 'change' }
            ],
            desc: [
            { required: true, message: '请填写活动形式', trigger: 'blur' }
            ]
        }
        };
    },
    methods: {
        getPreviousPositions(){

        },
        submitForm(formName) {
            this.$refs[formName].validate((valid) => {
                if (valid) {
                alert('submit!');
                } else {
                console.log('error submit!!');
                return false;
                }
            });
        },
    }
}
</script>

<style scoped>
.speech-material{
    background: #fff;
    min-height: 700px;
    padding: 20px 150px;
}
.speech-material-appellation{
    font-size: 20px;
    font-weight: bold;
    margin: 0;
    line-height: 60px;
}
.speech-material-tip{
    font-size: 18px;
    text-indent: 2em;
    margin-top: 0;
    margin-bottom: 20px;
}
.speech-material /deep/ .el-textarea__inner{
    border-style: dashed;
}
.speech-material /deep/ .el-form-item__label{
    color: #333;
    font-weight: bold;
    text-align: left;
}
.label-custom{
    color: #333;
    font-weight: bold;
}
.tip-custom{
    color: #de571a;
    text-indent: 2em;
    margin-top: 10px;
    margin-bottom: 0;
    line-height: 26px;
}
</style>