<template>
  <el-row>
    <el-col :span="24">
      <el-form
        :model="assayForm"
        ref="assayForm"
        class="sub-form"
        :validate-on-rule-change="false"
      >
        <el-form-item label="特异性" label-width="110px">
          <el-select
            v-model="assayForm.special"
            placeholder="请选择特异性"
            clearable
            @change="handleValue('special')"
            style="width: 100%"
            ref="special"
          >
            <el-option label="是" value="是"></el-option>
            <el-option label="否" value="否"></el-option>
          </el-select>
        </el-form-item>
      </el-form>
    </el-col>
  </el-row>
</template>

<script>
export default {
  name: 'AssayForm',
  props: ['data'],
  data() {
    // let checkFrequency = (rule, value, callback) => {
    //   let special = this.$refs.special.value;
    //   if (special === '' || special === null) {
    //     callback('请选择特殊');
    //   } else {
    //     callback();
    //   }
    // };

    return {
      assayForm: {
        special: ''
      },
      // rules: {
      //   special: [
      //     {
      //       required: true,
      //       validator: checkFrequency,
      //       trigger: ['blur', 'change']
      //     }
      //   ]
      // }
    };
  },
  computed: {},
  created() {
    this._initData();
  },
  mounted() {},
  methods: {
    _initData() {
      this.assayForm.special = this.data.special;
    },
    // 传值
    handleValue(from) {
      this.$emit('handleInput', {
        type: from,
        value: this.assayForm[from]
      });
    }
  }
};
</script>

<style lang="less" scoped>
</style>