| | |
| | | <el-form-item label="试卷名称:" prop="name" required> |
| | | <el-input v-model="form.name"/> |
| | | </el-form-item> |
| | | <el-form-item :key="index" :label="titleItem.label+':'" required v-for="(titleItem,index) in subjectIdList"> |
| | | <el-form-item :key="index" :label="titleItem.label+':'" required v-for="(titleItem,index) in subjectIdList" v-if="subjectIdList.length>1"> |
| | | <el-row> |
| | | <el-col :span="3"> |
| | | <span>题目数量:</span> |
| | |
| | | </el-form-item> |
| | | <el-form-item :key="index" :label="'标题'+(index+1)+':'" required v-for="(titleItem,index) in form.titleItems"> |
| | | <el-input v-model="titleItem.name" style="width: 80%"/> |
| | | <el-button type="text" class="link-left" style="margin-left: 20px" size="mini" @click="addQuestion(titleItem)"> |
| | | <el-button v-if="subjectIdList.length<2" type="text" class="link-left" style="margin-left: 20px" size="mini" @click="addQuestion(titleItem)"> |
| | | 添加题目 |
| | | </el-button> |
| | | <el-button type="text" class="link-left" size="mini" @click="form.titleItems.splice(index,1)">删除</el-button> |
| | | <el-card class="exampaper-item-box" v-if="titleItem.questionItems.length!==0"> |
| | | <el-card class="exampaper-item-box" v-if="titleItem.questionItems.length!==0&&subjectIdList.length<2"> |
| | | <el-form-item :key="questionIndex" :label="'题目'+(questionIndex+1)+':'" |
| | | v-for="(questionItem,questionIndex) in titleItem.questionItems" style="margin-bottom: 15px"> |
| | | <el-row> |
| | |
| | | //說明是隨機 |
| | | this.subjectIdList = arr |
| | | this.form.paperType = 7 |
| | | this.form.titleItems = [] |
| | | }else { |
| | | this.subjectIdList = [] |
| | | this.form.paperType = 1 |
| | |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | this.formLoading = true |
| | | if (this.subjectIdList.length=1){ |
| | | this.form.subjectId= this.form.subjectId[0] |
| | | } |
| | | examPaperApi.edit(this.form).then(re => { |
| | | if (re.code === 1) { |
| | | _this.$message.success(re.message) |
| | |
| | | this.subjectFilter = this.subjects.filter(data => data.level === this.form.level) |
| | | }, |
| | | search () { |
| | | this.questionPage.queryParam.subjectId = this.form.subjectId |
| | | if (this.subjectIdList.length=1){ |
| | | this.questionPage.queryParam.subjectId = this.form.subjectId[0] |
| | | } |
| | | |
| | | this.questionPage.listLoading = true |
| | | questionApi.pageList(this.questionPage.queryParam).then(data => { |
| | | const re = data.response |