<template>
  <div class="justify-wrapper">
    <el-form
      ref="addform"
      :model="formInfo"
      label-width="80px"
      :rules="rules"
    >
      <el-form-item
        label="题干"
        prop="outline"
      >
        <el-input
          v-model="formInfo.outline"
          type="textarea"
          autosize
        />
      </el-form-item>
      <el-form-item
        label="判断"
        prop="isTrue"
      >
        <el-radio v-model="formInfo.isTrue" label="是" />
        <el-radio v-model="formInfo.isTrue" label="否" />
      </el-form-item>
      <el-form-item
        label="解析"
        prop="answer"
      >
        <el-input
          v-model="formInfo.answer"
          type="textarea"
          autosize
        />
      </el-form-item>
      <el-form-item
        label="分值"
        prop="score"
      >
        <el-input
          v-model="formInfo.score"
        />
      </el-form-item>
    </el-form>
    <div class="tools-wrapper">
      <el-button type="primary" @click="saveAndAdd">保存并继续添加</el-button>
      <el-button type="primary" @click="save">保存</el-button>
      <el-button type="text" @click="goback">返回</el-button>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      formInfo: {
        outline: '',
        isTrue: '',
        answer: '',
        score: ''
      },
      rules: {
        outline: [
          {
            required: true,
            message: '请输入题干',
            trigger: 'blur'
          }
        ],
        isTrue: [
          {
            required: true,
            message: '请输入判断答案'
          }
        ]
      }
    }
  },
  methods: {
    goback() {
      this.$router.push({
        path: '/exam/manage/45666655'
      })
    },
    save() {
      // axios
      // $router.push
    },
    saveAndAdd() {
      // axios add
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
