|
@@ -30,15 +30,25 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="题目类别" prop="questionType">
|
|
|
- <el-select v-model="queryParams.questionType" placeholder="请选择类别" clearable size="small">
|
|
|
+ <el-select v-model="queryParams.questionType" placeholder="请选择类别" @change="changeCateType" clearable size="small">
|
|
|
<el-option
|
|
|
- v-for="dict in questionTypeOptions"
|
|
|
+ v-for="dict in questionRootTypeOptions"
|
|
|
:key="dict.dictValue"
|
|
|
:label="dict.dictLabel"
|
|
|
:value="dict.dictValue"
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="题目子类别" prop="questionSubType" label-width="100px">
|
|
|
+ <el-select v-model="queryParams.questionSubType" ref="typeSelect" placeholder="请选择子类别" clearable size="small">
|
|
|
+ <el-option
|
|
|
+ v-for="item in questionSubTypeOptions"
|
|
|
+ :key="item.dictValue"
|
|
|
+ :label="item.dictLabel"
|
|
|
+ :value="item.dictValue"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
@@ -188,6 +198,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { listCourseQuestionBank, getCourseQuestionBank, delCourseQuestionBank, addCourseQuestionBank, updateCourseQuestionBank, exportCourseQuestionBank } from "@/api/course/courseQuestionBank";
|
|
|
+import { getCateListByPid, getCatePidList, listUserCourseCategory } from '@/api/course/userCourseCategory'
|
|
|
|
|
|
export default {
|
|
|
name: "CourseQuestionBank",
|
|
@@ -230,6 +241,8 @@ export default {
|
|
|
// 题库表格数据
|
|
|
courseQuestionBankList: [],
|
|
|
questionTypeOptions: [],
|
|
|
+ questionRootTypeOptions: [],
|
|
|
+ questionSubTypeOptions: [],
|
|
|
// 弹出层标题
|
|
|
title: "",
|
|
|
// 是否显示弹出层
|
|
@@ -244,6 +257,7 @@ export default {
|
|
|
status: null,
|
|
|
question: null,
|
|
|
questionType: null,
|
|
|
+ questionSubType: null,
|
|
|
answer: null,
|
|
|
},
|
|
|
// 表单参数
|
|
@@ -270,13 +284,27 @@ export default {
|
|
|
this.getDicts("sys_course_question_type").then(response => {
|
|
|
this.questionTypeOptions = response.data;
|
|
|
});
|
|
|
-
|
|
|
+ this.getCategoryType()
|
|
|
},
|
|
|
methods: {
|
|
|
getOptionLabel(index) {
|
|
|
return this.alphabet[index];
|
|
|
},
|
|
|
-
|
|
|
+ getCategoryType() {
|
|
|
+ getCatePidList().then(response => {
|
|
|
+ this.questionRootTypeOptions = response.data
|
|
|
+ });
|
|
|
+ },
|
|
|
+ changeCateType(val) {
|
|
|
+ this.questionSubTypeOptions = []
|
|
|
+ this.queryParams.questionSubType = null
|
|
|
+ if (!val) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ getCateListByPid(val).then(response => {
|
|
|
+ this.questionSubTypeOptions = response.data
|
|
|
+ })
|
|
|
+ },
|
|
|
//选择此课
|
|
|
chooseQuestion(val){
|
|
|
this.$emit('questionBankResult',val)
|