Commit 0bb26d00 authored by 高宇's avatar 高宇

试题管理

parent 5a021fe2
......@@ -120,7 +120,7 @@
</div>
<!-- 新建题型对话框-->
<el-dialog
title="新建试题"
:title="title"
:visible.sync="dialogFormVisible"
width="50%"
>
......@@ -128,7 +128,7 @@
<el-row>
<el-col :span="12">
<el-form-item label="题型" prop="questionType">
<el-select v-model="form.questionType" class="selectClass" placeholder="请选择题目类型">
<el-select v-model="form.questionType" class="selectClass" placeholder="请选择题目类型" @change="handleQuestionsChange(form.questionType)">
<el-option
v-for="item in questionTypeList"
:key="item.value"
......@@ -294,6 +294,7 @@ export default {
},
data() {
return {
title: '',
imageSrc: require('@/assets/image/test.png'),
imagePath: 'http://49.232.167.247:20020/eduServer/',
// 显示开关
......@@ -413,6 +414,48 @@ export default {
this.loadData()
},
methods: {
/**
* @description: 处理切换试题
* @author: gaoyu
* @param:
* @return:
**/
handleQuestionsChange(value) {
console.log('value', value)
switch (value) {
case 1:
this.form.answer = null
this.form.answerList = []
break
case 2:
this.form.answer = null
this.form.answerList = []
break
case 3:
this.form.optionC = ''
this.form.optionD = ''
this.form.answer = null
this.form.answerList = []
this.form.mark = ''
this.form.number = ''
this.form.weight = '0'
this.form.flag = '1'
break
case 4:
this.form.optionA = ''
this.form.optionB = ''
this.form.optionC = ''
this.form.optionD = ''
this.form.answer = null
this.form.answerList = []
this.form.mark = ''
this.form.number = ''
this.form.weight = '0'
this.form.flag = '1'
break
}
console.log('form', this.form)
},
/**
* @description: 点击蒙版关闭预览图片
* @author: gaoyu
......@@ -566,6 +609,7 @@ export default {
this.tableData = []
_this.fullscreenLoading = true
const params = {
courseId: _this.form.courseId,
page: _this.queryParams.page,
rows: _this.queryParams.rows,
number: _this.queryParams.number,
......@@ -610,6 +654,8 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.resetForm()
this.title = '添加试题'
this.dialogFormVisible = true
},
/** 修改按钮操作 */
......@@ -628,6 +674,7 @@ export default {
this.form.optionB = optionB
this.form.optionC = optionC
this.form.optionD = optionD
this.title = '修改试题'
this.dialogFormVisible = true
})
},
......@@ -683,7 +730,6 @@ export default {
},
cancel() {
// 重置表单
this.$refs.form.resetFields()
this.resetForm()
this.dialogFormVisible = false
},
......@@ -708,6 +754,9 @@ export default {
optionsList: [],
answerList: []
}
this.$nextTick().then(() => {
this.$refs.form.clearValidate()
})
},
// 封面图片预览
justEnter(event) {
......
......@@ -6,12 +6,12 @@
<el-tabs v-model="activeName" @tab-click="tabClick">
<el-tab-pane label="试题管理" name="ExaminationPaper">
<examination-paper :bussiness-id="courseId" />
</el-tab-pane>
<el-tab-pane label="试卷管理" name="QuestionManagement">
<question-management :bussiness-id="courseId" />
</el-tab-pane>
</el-tabs>
<!-- 动态展示tabs-->
<component :is="activeName" :bussinessId="bussinessId" />
</div>
</template>
<script >
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment