<template>
  <transition name="dialog-fade">
    <el-dialog
      v-if="showDialog"
      :title="dialogTitle"
      class="dialog-component"
      v-model="showDialog"
      width="800px"
      @close="closeDialog(0)"
    >
      <el-form
        ref="formInfo"
        class="demo-form-inline alarmStatusDialog"
        label-width="130px"
      >
        <div class="topInfo underline">
          <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item label="户号：">2021-09-14 14:53:28</el-form-item>
              <el-form-item label="站点名称：">测试222</el-form-item>
              <el-form-item label="监察：">张三</el-form-item>
              <el-form-item label="电试报告时间：">
                <div>2021-09-14</div>
                <div>距离电试超期还有 730 天</div>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <div class="grid-content">
                <el-form-item label="流变变比：">11111</el-form-item>
                <el-form-item label="单路电源容量：">11</el-form-item>
                <el-form-item label="线路：">育11彭伟万众实业</el-form-item>
              </div>
            </el-col>
          </el-row>
        </div>

        <el-row :gutter="20">
          <el-col :span="12">
            <div class="basicTit">现场问题：</div>
            <el-form-item label="电缆空洞：">
              <el-radio disabled v-model="radio1" label="1">备选项</el-radio>
              <div><img src="@/assets/images/archiveImg.png" alt="" /></div>
            </el-form-item>
            <el-form-item label="堆放杂物：">
              <el-radio disabled v-model="radio2" label="2">是</el-radio>
              <div><img src="@/assets/images/archiveImg.png" alt="" /></div>
            </el-form-item>
            <el-form-item label="缺少模拟屏：">
              <el-radio disabled v-model="radio3" label="3">是</el-radio>
              <div><img src="@/assets/images/archiveImg.png" alt="" /></div>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <div class="grid-content">
              <div class="basicTit">其他</div>
              <div>
                <el-radio disabled v-model="radio1" label="1">
                  屋顶墙壁渗漏水：
                </el-radio>
              </div>
              <div>
                <el-radio disabled v-model="radio1" label="1">
                  门窗、墙壁破损：
                </el-radio>
              </div>
              <div>
                <el-radio disabled v-model="radio1" label="1">
                  灭火器配置不足：
                </el-radio>
              </div>
              <div>
                <el-radio disabled v-model="radio1" label="1">
                  灭火器超期：
                </el-radio>
              </div>
              <div>
                <el-radio disabled v-model="radio1" label="1">
                  积灰严重：
                </el-radio>
              </div>
              <div>
                <el-radio disabled v-model="radio1" label="1">
                  无电工：
                </el-radio>
              </div>
              <div>
                <el-radio disabled v-model="radio1" label="1">
                  电工人数配置不足：
                </el-radio>
              </div>
              <div>
                <el-radio disabled v-model="radio1" label="1">
                  电工证超期：
                </el-radio>
              </div>
              <div>
                <el-radio disabled v-model="radio1" label="1">
                  配置不足（绝缘体）：
                </el-radio>
              </div>
              <div>
                <el-radio disabled v-model="radio1" label="1">
                  缺少接地线与存放位置编号：
                </el-radio>
              </div>
              <div>
                <el-form-item label="备注："></el-form-item>
              </div>
             
            </div>
          </el-col>
        </el-row>
      </el-form>
    </el-dialog>
  </transition>
</template>

<script>
export default {
  name: 'CheckVideo',
  props: {
    dialogTitle: {
      type: String,
    },
    itemInfo: {
      type: Object,
      default: function () {
        return {}
      },
    },
  },
  data() {
    return {
      checked: true,
      showDialog: false,
      formInfo: JSON.parse(JSON.stringify(this.itemInfo)),
      radio1: '1',
      radio2: '2',
      radio3: '3',

      options: [
        {
          value: '选项1',
          label: '站点一',
        },
        {
          value: '选项2',
          label: '站点二',
        },
        {
          value: '选项3',
          label: '站点三',
        },
        {
          value: '选项4',
          label: '站点四',
        },
        {
          value: '选项5',
          label: '站点五',
        },
      ],

      rules: {
        watchName: [
          // required  是否为必填项， trigger:表单验证的触发时机，失去焦点进行验证
          { required: true, message: '请输入设备名称', trigger: 'blur' },
          {
            min: 3,
            max: 6,
            message: '用户名长度在 3 到 6 个字符',
            trigger: 'blur',
          },
        ],
        watchCode: [
          { required: true, message: '请输入设备编号', trigger: 'blur' },
          {
            min: 3,
            max: 6,
            message: '用户名长度在 3 到 6 个字符',
            trigger: 'blur',
          },
        ],
        routeAddress: [
          { required: true, message: '请选则回路表记地址', trigger: 'change' },
        ],
        ratedVoltage: [
          { required: true, message: '请选择站点列表', trigger: 'change' },
        ],
        ratedCurrent: [
          { required: true, message: '请输入已选站点个数', trigger: 'blur' },
          { trigger: 'blur' },
        ],
        fzlMx: [
          { required: true, message: '请输入挂载设备个数', trigger: 'blur' },
          { trigger: 'blur' },
        ],
      },
    }
  },
  methods: {
    roleValid(rule, value, callback) {
      if (value.length === 0) {
        callback(new Error('角色不能为空'))
      } else {
        callback()
      }
    },

    // onSelectedDrug(event) {
    //   this.routeAddress = event;
    //   console.log(this.routeAddress);
    // },
    // 保存操作
    submitForm(formName) {
      const params = Object.assign(this.formInfo, {})
      params
      this.$refs[formName].validate((valid) => {
        if (valid) {
          // 走保存请求
          this.$message({
            message: '操作成功！',
            type: 'success',
          })
          this.closeDialog(1)
        } else {
          return false
        }
      })
    },
    // 关闭弹框
    closeDialog(flag) {
      //   this.$refs["formInfo"].resetFields();
      this.showDialog = false
      this.$emit('closeDialog', flag)
    },
  },
}
</script>
 
<style scoped lang="scss">
.el-input,
.el-select {
  width: 240px;
}

// label样式
.el-form-item__label {
  width: 150px;
}
.el-form-item__content {
  margin-left: 150px;
}
</style>