| | |
| | | <hr style="border : 0.5px dashed #b3d8ff;" /> |
| | | <div style="color: red;font-size: smaller">{{$t('pleaseAnswerCarefully_exercise')}}</div> |
| | | |
| | | <el-row class="do-align-center" v-if="itemOrder > 1"> |
| | | <el-button @click="doExam" type="success" round>{{$t('startDo_apifan')}}</el-button> |
| | | <el-button @click="preSubject" type="warning" round>{{$t('lastQuestion')}}</el-button> |
| | | </el-row> |
| | | <el-row class="do-align-center" v-if="itemOrder <= 1"> |
| | | <el-button @click="doExam" type="success" round>{{$t('startDo_apifan')}}</el-button> |
| | | <el-button @click="nextSubject" type="primary" round>{{$t('nextQuestion')}}</el-button> |
| | | <el-row class="do-align-center"> |
| | | <el-button v-if="isSubmit" @click="doExam" type="success" round>{{$t('startDo_apifan')}}</el-button> |
| | | <el-button v-if="isStart && !isLast" @click="preSubject" type="warning" round>{{$t('lastQuestion')}}</el-button> |
| | | <el-button v-if="isStart && isLast" @click="nextSubject" type="primary" round>{{$t('nextQuestion')}}</el-button> |
| | | </el-row> |
| | | </el-card> |
| | | </el-row> |
| | |
| | | name: this.$route.query.formDo.name |
| | | }, |
| | | itemOrder: 1, |
| | | itemSize: 2, |
| | | itemSize: 3, |
| | | note: this.$t('exercise_note'), |
| | | guide: this.$t('exercise_guide'), |
| | | note_1: this.$t('exercise_note_1'), |
| | | guide_1: this.$t('exercise_guide_1'), |
| | | answer: { |
| | | answerItems: [ |
| | | { |
| | | content: '', |
| | | readOnly: false |
| | | }, |
| | | { |
| | | content: '', |
| | | readOnly: false |
| | | } |
| | | ] |
| | | answerItems: [] |
| | | }, |
| | | titleItems: [], |
| | | questionItem: {}, |
| | | isSubmit: false |
| | | isSubmit: false, |
| | | isStart: false, |
| | | isLast: false |
| | | } |
| | | }, |
| | | created: function () { |
| | |
| | | initQuestion () { |
| | | this.titleItems = [ |
| | | { |
| | | questionItems: [ |
| | | this.formDo.titleItems[0].questionItems[0], |
| | | this.formDo.titleItems[0].questionItems[1] |
| | | ] |
| | | questionItems: [] |
| | | } |
| | | ] |
| | | for (let i = 0; i < this.itemSize; i++) { |
| | | this.titleItems[0].questionItems.push(this.formDo.titleItems[0].questionItems[i]) |
| | | } |
| | | this.questionItem = this.titleItems[0].questionItems[this.itemOrder - 1] |
| | | |
| | | for (let i = 0; i < this.itemSize; i++) { |
| | | let data = { |
| | | content: '', |
| | | readOnly: false |
| | | } |
| | | this.answer.answerItems.push(data) |
| | | } |
| | | }, |
| | | nextSubject () { |
| | | console.log(this.answer) |
| | | console.log('formDo') |
| | | console.log(this.formDo) |
| | | if (this.itemOrder === 2) { |
| | | this.isStart = true |
| | | this.isLast = false |
| | | if (this.itemOrder === this.itemSize) { |
| | | this.isSubmit = true |
| | | this.$message({ |
| | | message: this.$t('exercise_submit_tip'), |
| | | type: 'success' |
| | | }) |
| | | return |
| | | } |
| | | this.itemOrder = 2 |
| | | this.itemOrder += 1 |
| | | this.answer.answerItems[this.itemOrder - 1].readOnly = false |
| | | this.questionItem = this.titleItems[0].questionItems[this.itemOrder - 1] |
| | | if (this.itemOrder === this.itemSize && this.answer.answerItems[this.itemOrder - 1].content !== '') { |
| | | this.isSubmit = true |
| | | } |
| | | }, |
| | | preSubject () { |
| | | this.isLast = true |
| | | this.isSubmit = false |
| | | this.itemOrder = 1 |
| | | this.itemOrder -= 1 |
| | | this.answer.answerItems[this.itemOrder - 1].readOnly = false |
| | | this.questionItem = this.titleItems[0].questionItems[this.itemOrder - 1] |
| | | }, |