<template>
  <!--  <el-tabs v-model="activeName" v-loading="loading" style="min-height:500px">-->
  <!--    <el-tab-pane-->
  <!--      v-for="criterion in criterions"-->
  <!--      :key="criterion.ReadingQuestionCriterionTrialId"-->
  <!--      :label="criterion.ReadingQuestionCriterionTrialName"-->
  <!--      :name="criterion.ReadingQuestionCriterionTrialId"-->
  <!--    >-->
  <div v-loading="loading" style="min-height:500px">
    <ECRF
      :trial-id="trialId"
      :subject-id="subjectId"
      :criterion-id="criterionId"
      :visit-task-id="visitTaskId"
    />
  </div>

<!--    </el-tab-pane>-->
  <!-- <el-tab-pane label="标准2" name="second">
      <ECRF ref="second" />
    </el-tab-pane> -->
<!--  </el-tabs>-->
</template>
<script>
import { getTrialConfirmCriterionList } from '@/api/trials'
import ECRF from './ECRF'
export default {
  name: 'Criterions',
  components: { ECRF },
  props: {
    trialId: {
      type: String,
      required: true
    },
    subjectId: {
      type: String,
      required: true
    },
    visitTaskId: {
      type: String,
      required: true
    },
    criterionId: {
      type: String,
      required: true
    }
  },
  data() {
    return {
      activeName: '',
      loading: false,
      criterions: []
    }
  },
  mounted() {
    this.getCriterions()
  },
  methods: {
    getCriterions() {
      this.loading = true
      var param = {
        trialId: this.$router.currentRoute.query.trialId
      }
      getTrialConfirmCriterionList(param).then(res => {
        this.criterions = res.Result
        this.activeName = this.criterions[0].ReadingQuestionCriterionTrialId
        this.loading = false
      }).catch(() => { this.loading = false })
    }

  }
}
</script>
