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

试题管理

parent 5a021fe2
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
</div> </div>
<!-- 新建题型对话框--> <!-- 新建题型对话框-->
<el-dialog <el-dialog
title="新建试题" :title="title"
:visible.sync="dialogFormVisible" :visible.sync="dialogFormVisible"
width="50%" width="50%"
> >
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="题型" prop="questionType"> <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 <el-option
v-for="item in questionTypeList" v-for="item in questionTypeList"
:key="item.value" :key="item.value"
...@@ -294,6 +294,7 @@ export default { ...@@ -294,6 +294,7 @@ export default {
}, },
data() { data() {
return { return {
title: '',
imageSrc: require('@/assets/image/test.png'), imageSrc: require('@/assets/image/test.png'),
imagePath: 'http://49.232.167.247:20020/eduServer/', imagePath: 'http://49.232.167.247:20020/eduServer/',
// 显示开关 // 显示开关
...@@ -413,6 +414,48 @@ export default { ...@@ -413,6 +414,48 @@ export default {
this.loadData() this.loadData()
}, },
methods: { 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: 点击蒙版关闭预览图片 * @description: 点击蒙版关闭预览图片
* @author: gaoyu * @author: gaoyu
...@@ -566,6 +609,7 @@ export default { ...@@ -566,6 +609,7 @@ export default {
this.tableData = [] this.tableData = []
_this.fullscreenLoading = true _this.fullscreenLoading = true
const params = { const params = {
courseId: _this.form.courseId,
page: _this.queryParams.page, page: _this.queryParams.page,
rows: _this.queryParams.rows, rows: _this.queryParams.rows,
number: _this.queryParams.number, number: _this.queryParams.number,
...@@ -610,6 +654,8 @@ export default { ...@@ -610,6 +654,8 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.resetForm()
this.title = '添加试题'
this.dialogFormVisible = true this.dialogFormVisible = true
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
...@@ -628,6 +674,7 @@ export default { ...@@ -628,6 +674,7 @@ export default {
this.form.optionB = optionB this.form.optionB = optionB
this.form.optionC = optionC this.form.optionC = optionC
this.form.optionD = optionD this.form.optionD = optionD
this.title = '修改试题'
this.dialogFormVisible = true this.dialogFormVisible = true
}) })
}, },
...@@ -683,7 +730,6 @@ export default { ...@@ -683,7 +730,6 @@ export default {
}, },
cancel() { cancel() {
// 重置表单 // 重置表单
this.$refs.form.resetFields()
this.resetForm() this.resetForm()
this.dialogFormVisible = false this.dialogFormVisible = false
}, },
...@@ -708,6 +754,9 @@ export default { ...@@ -708,6 +754,9 @@ export default {
optionsList: [], optionsList: [],
answerList: [] answerList: []
} }
this.$nextTick().then(() => {
this.$refs.form.clearValidate()
})
}, },
// 封面图片预览 // 封面图片预览
justEnter(event) { justEnter(event) {
......
...@@ -6,12 +6,12 @@ ...@@ -6,12 +6,12 @@
<el-tabs v-model="activeName" @tab-click="tabClick"> <el-tabs v-model="activeName" @tab-click="tabClick">
<el-tab-pane label="试题管理" name="ExaminationPaper"> <el-tab-pane label="试题管理" name="ExaminationPaper">
<examination-paper :bussiness-id="courseId" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="试卷管理" name="QuestionManagement"> <el-tab-pane label="试卷管理" name="QuestionManagement">
<question-management :bussiness-id="courseId" />
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<!-- 动态展示tabs-->
<component :is="activeName" :bussinessId="bussinessId" />
</div> </div>
</template> </template>
<script > <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