<template>
    <!-- 人工检测 -->
    <el-dialog v-dialogDrag ref="diaFrom" title="安全性检测反馈信息" :close-on-click-modal="false" :visible.sync="visible"
    width="45%" top="10px" :before-close="cancel">
        <p class="tips">本机是否包含杀毒软件，检测通过结果填写杀毒软件名称，检测未通过结果填写未通过原因</p>
        <el-form :model="formParams" ref="ruleForm" label-width="110px" :rules="rules">
            <el-form-item label="检测：" prop="status">
                <el-radio-group v-model="formParams.status">
                    <el-radio :label="0">不通过</el-radio>
                    <el-radio :label="1">通过</el-radio>
                </el-radio-group>
            </el-form-item>
            <el-form-item label="结果显示：" prop="desc">
                <el-input type="textarea" v-model="formParams.desc"></el-input>
            </el-form-item>
            <el-form-item label=" ">
                <el-button size="mini" @click="handleClick('ruleForm')" type="primary">确定</el-button>
                <el-button size="mini" @click="cancel" type="info">取消</el-button>
            </el-form-item>
        </el-form>
  </el-dialog>
</template>

<script>
export default{
    name:'ManualTestingModal',
    props:{
        visible:{
            type:Boolean,
            default:()=>false
        },
        formParams:{
            type:Object,
            default:()=>{}
        }
    },
    data(){
        return {
            rules:{
                status: [
                    { required: true, message: '请选择检测方式', trigger: 'blur' },
                ]
            }
        }
    },
    methods:{
        // 确定按钮
        handleClick(formName){
            this.$refs[formName].validate((valid) => {
                if (valid) {
                    this.$emit("clickSubmit",this.formParams);
                } else {
                console.log("error submit!!");
                return false;
                }
            });
        },
        cancel(){
            this.$emit('clickCancel');
        }
    },
}
</script>

<style lang="scss" scoped>
.tips{
    border: 1px dashed #e88f21;
    padding: 10px;
    background-color: #f2e7d8;
}
</style>