|
@@ -426,6 +426,7 @@ export default {
|
|
|
courseAll: [],
|
|
|
isInsert: false,
|
|
|
tplList: [],
|
|
|
+ curCourseId: "",
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -457,10 +458,22 @@ export default {
|
|
|
"extractConfig2.randomPaperId"() {
|
|
|
this.getData();
|
|
|
},
|
|
|
+ "extractConfig.courseCode"(val) {
|
|
|
+ if (!val) {
|
|
|
+ this.extractConfig2.randomPaperId = "";
|
|
|
+ }
|
|
|
+ let id = "";
|
|
|
+ for (let course of this.courseList) {
|
|
|
+ if (this.extractConfig.courseCode == val) {
|
|
|
+ id = course.courseId;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.getTplList("", id);
|
|
|
+ },
|
|
|
},
|
|
|
//初始化
|
|
|
async created() {
|
|
|
- // await this.getTplList();
|
|
|
let extractConfigId = this.$route.params.extractConfigId;
|
|
|
//1.查询考试集合
|
|
|
this.getExams("");
|
|
@@ -468,13 +481,16 @@ export default {
|
|
|
this.isInsert = true;
|
|
|
//规则ID存在,表示是修改操作
|
|
|
this.getExtractConfig(extractConfigId);
|
|
|
- } else {
|
|
|
- this.getTplList();
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
getData() {
|
|
|
if (!this.tplList.length || !this.extractConfig2.randomPaperId) {
|
|
|
+ this.randomTplInfo.paperStructOptions = [];
|
|
|
+ this.randomTplInfo.paperStructType = "";
|
|
|
+ this.randomTplInfo.paperIds = [];
|
|
|
+ this.randomTplInfo.tableData = [];
|
|
|
+ this.randomTplInfo.difficultyDegree = "";
|
|
|
return;
|
|
|
}
|
|
|
let item = this.tplList.find(
|
|
@@ -514,8 +530,8 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
- async getTplList(id) {
|
|
|
- let courseId = this.$route.query.courseId;
|
|
|
+ async getTplList(id, cId) {
|
|
|
+ let courseId = cId || this.$route.query.courseId;
|
|
|
let params = {
|
|
|
pageNumber: 1,
|
|
|
pageSize: 10000,
|
|
@@ -534,7 +550,9 @@ export default {
|
|
|
this.tplList = res.data.content || [];
|
|
|
this.getData();
|
|
|
} catch (e) {
|
|
|
- this.$message.error("获取抽题模板失败");
|
|
|
+ // this.$message.error("获取抽题模板失败");
|
|
|
+ this.tplList = [];
|
|
|
+ this.getData();
|
|
|
}
|
|
|
},
|
|
|
getCurCallType() {
|
|
@@ -606,6 +624,7 @@ export default {
|
|
|
for (let course of this.courseList) {
|
|
|
if (this.extractConfig.courseCode == course.courseCode) {
|
|
|
id = course.courseId;
|
|
|
+ this.curCourseId = id;
|
|
|
break;
|
|
|
}
|
|
|
}
|