<template>
  <div class="ultrasound-step">
    <el-form label-width="120px">
      <el-form-item label="功率(%)">
        <el-input v-model="formData.power" placeholder="请输入功率百分比"></el-input>
      </el-form-item>
      <el-form-item label="时间(min)">
        <el-input v-model="formData.time" placeholder="请输入超声时间"></el-input>
      </el-form-item>
      <el-form-item label="温度(℃)">
        <el-input v-model="formData.temperature" placeholder="请输入温度"></el-input>
      </el-form-item>
      <el-form-item label="频率(kHz)">
        <el-input v-model="formData.frequency" 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: 'UltrasoundStep',
  props: ['stepData'],
  data() {
    return {
      formData: {
        power: '',
        time: '',
        temperature: '',
        frequency: '',
        notes: ''
      }
    }
  },
  created() {
    this.formData = { ...this.formData, ...this.stepData }
  },
  watch: {
    formData: {
      handler(newVal) {
        this.$emit('update', newVal)
      },
      deep: true
    }
  }
}
</script>