<template>
  <div class="mix-step">
    <el-form label-width="120px">
      <el-form-item label="混合方式">
        <el-select v-model="formData.method" placeholder="请选择混合方式">
          <el-option label="涡旋混匀" value="vortex"></el-option>
          <el-option label="颠倒混匀" value="invert"></el-option>
          <el-option label="移液器吹打" value="pipette"></el-option>
          <el-option label="磁力搅拌" value="magnetic"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="混合时间(s)">
        <el-input v-model="formData.time" placeholder="请输入混合时间"></el-input>
      </el-form-item>
      <el-form-item label="混合速度">
        <el-select v-model="formData.speed" placeholder="请选择混合速度">
          <el-option label="低速" value="low"></el-option>
          <el-option label="中速" value="medium"></el-option>
          <el-option label="高速" value="high"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="温度(℃)">
        <el-input v-model="formData.temperature" placeholder="请输入温度"></el-input>
      </el-form-item>
      <el-form-item label="备注">
        <el-input v-model="formData.notes" type="textarea" :rows="2"></el-input>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: 'MixStep',
  props: ['stepData'],
  data() {
    return {
      formData: {
        method: '',
        time: '',
        speed: '',
        temperature: '',
        notes: ''
      }
    }
  },
  created() {
    this.formData = { ...this.formData, ...this.stepData }
  },
  watch: {
    formData: {
      handler(newVal) {
        this.$emit('update', newVal)
      },
      deep: true
    }
  }
}
</script>