<template>
  <el-row>
    <el-col :span="24">
      <el-form
        :model="operationForm"
        ref="operationForm"
        class="sub-form"
        :validate-on-rule-change="false"
        :rules="rules"
      >
        <el-form-item label="手术级别" label-width="110px" prop="operationLevel">
          <el-select
            v-model="operationForm.operationLevel"
            placeholder="请选择手术级别"
            style="width: 100%"
            ref="operationLevel"
            clearable
          >
            <el-option label="1" :value="1"></el-option>
            <el-option label="2" :value="2"></el-option>
            <el-option label="3" :value="3"></el-option>
            <el-option label="4" :value="4"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="高危条件" label-width="110px" prop="planName" v-if="operationForm.operationLevel === 2">
          <!-- <el-input v-model="operationForm.highRisk" disabled></el-input> -->
          <span style="paddingLeft: 12px; color: #606266">{{operationForm.highRisk}}</span>
        </el-form-item>
      </el-form>
    </el-col>
  </el-row>
</template>

<script>
import api from '@api/icss.js';
export default {
  name: 'OperationForm',
  props: [],
  data() {
    let checkFrequency = (rule, value, callback) => {
      let operationLevel = this.$refs.operationLevel.value;
      if (operationLevel === '') {
        callback('请选择手术级别');
      } else {
        callback();
      }
    };

    return {
      operationForm: {
        operationLevel: 1,
        highRisk: '未设置'
      },
      rules: {
        operationLevel: [
          {
            required: true,
            validator: checkFrequency,
            trigger: ['blur', 'change']
          }
        ]
      }
    };
  },
  computed: {},
  created() {},
  mounted() {},
  methods: {}
};
</script>

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