| | |
| | | <template> |
| | | <div> |
| | | <el-container class="app-item-contain"> |
| | | <div v-loading.fullscreen.lock="!formDo"> |
| | | <el-container class="app-item-contain" v-if="formDo"> |
| | | <el-main style="padding-top: 3%;"> |
| | | <el-form :model="form" ref="form" label-width="100%"> |
| | | <el-row :key="index" v-for="(titleItem,index) in titleItems"> |
| | |
| | | components: { QuestionEdit }, |
| | | data () { |
| | | return { |
| | | formDo: this.$route.query.formDo, |
| | | memberName: this.$route.query.formDo.memberName, |
| | | // formDo: this.$route.query.formDo, |
| | | memberName: '', |
| | | form: { |
| | | name: this.$route.query.formDo.name |
| | | name: '' |
| | | }, |
| | | itemOrder: 1, |
| | | itemSize: 3, |
| | |
| | | } |
| | | }, |
| | | created: function () { |
| | | this.getFormDo() |
| | | this.initQuestion() |
| | | }, |
| | | mounted () { |
| | |
| | | beforeDestroy () { |
| | | }, |
| | | watch: { |
| | | 'formDo': function (newVal, oldVal) { |
| | | this.initQuestion() |
| | | } |
| | | }, |
| | | methods: { |
| | | // 初始化题目 |
| | | initQuestion () { |
| | | this.memberName = this.formDo.memberName |
| | | this.form.name = this.formDo.name |
| | | this.titleItems = [ |
| | | { |
| | | questionItems: [] |
| | |
| | | doExam () { |
| | | let _this = this |
| | | examPaperApi.updateTestMemberStatus(_this.memberToken).then(re => { |
| | | _this.$router.push({ path: '/exam/' + _this.doUrl, query: { formDo: _this.$route.query.formDo } }) |
| | | _this.$router.push({ path: '/exam/' + _this.doUrl, query: { formDo: _this.formDo } }) |
| | | }).catch(re => { |
| | | _this.$message.error(re.message + ' 更新状态失败') |
| | | }) |
| | | } |
| | | }, |
| | | ...mapMutations('user', ['getFormDo']) |
| | | }, |
| | | computed: { |
| | | ...mapState('exam', { doUrl: state => state.doUrl }), |
| | | ...mapState('user', { memberToken: state => state.memberToken }) |
| | | ...mapState('user', { memberToken: state => state.memberToken }), |
| | | ...mapState('user', { formDo: state => state.formDo }) |
| | | } |
| | | } |
| | | </script> |