|
@@ -342,6 +342,7 @@ export default {
|
|
|
questionType: "",
|
|
|
courseNo: "",
|
|
|
courseLevel: "",
|
|
|
+ courseName: "",
|
|
|
publicity: "",
|
|
|
coursePropertyName: "",
|
|
|
firstPropertyId: "",
|
|
@@ -378,6 +379,7 @@ export default {
|
|
|
questionType: "",
|
|
|
courseNo: "",
|
|
|
courseLevel: "",
|
|
|
+ courseName: "",
|
|
|
publicity: "",
|
|
|
coursePropertyName: "",
|
|
|
firstPropertyId: "",
|
|
@@ -418,8 +420,16 @@ export default {
|
|
|
this.currentPage = val;
|
|
|
this.searchQues();
|
|
|
},
|
|
|
+ getCourseName(courseNo) {
|
|
|
+ for (let course of this.courseList) {
|
|
|
+ if (course.code == courseNo) {
|
|
|
+ this.formSearch.courseName = course.name;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
//修改
|
|
|
updateRow(row) {
|
|
|
+ this.getCourseName(this.formSearch.courseNo);
|
|
|
//选择题:单选、多选
|
|
|
if (
|
|
|
row.questionType === "SINGLE_ANSWER_QUESTION" ||
|
|
@@ -661,6 +671,33 @@ export default {
|
|
|
this.secondPropertyList = response.data;
|
|
|
});
|
|
|
}
|
|
|
+ },
|
|
|
+ initVue() {
|
|
|
+ this.isClear = this.$route.params.isClear;
|
|
|
+ if (this.isClear == 0 || !this.isClear) {
|
|
|
+ sessionStorage.removeItem("question");
|
|
|
+ sessionStorage.removeItem("question_currentPage");
|
|
|
+ this.formSearch = {
|
|
|
+ questionType: "",
|
|
|
+ courseNo: "",
|
|
|
+ courseLevel: "",
|
|
|
+ courseName: "",
|
|
|
+ publicity: "",
|
|
|
+ coursePropertyName: "",
|
|
|
+ firstPropertyId: "",
|
|
|
+ secondPropertyId: ""
|
|
|
+ };
|
|
|
+ this.currentPage = 1;
|
|
|
+ } else {
|
|
|
+ this.formSearch = JSON.parse(sessionStorage.getItem("question"));
|
|
|
+ this.currentPage = parseInt(
|
|
|
+ sessionStorage.getItem("question_currentPage")
|
|
|
+ );
|
|
|
+ }
|
|
|
+ if (this.formSearch.courseName) {
|
|
|
+ this.getCourses(this.formSearch.courseName);
|
|
|
+ }
|
|
|
+ this.searchQues();
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -702,21 +739,12 @@ export default {
|
|
|
return true;
|
|
|
}
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ $route: "initVue"
|
|
|
+ },
|
|
|
//钩子函数
|
|
|
created() {
|
|
|
- this.isClear = this.$route.params.isClear;
|
|
|
- if (this.isClear == 0 || !this.isClear) {
|
|
|
- sessionStorage.removeItem("question");
|
|
|
- sessionStorage.removeItem("question_currentPage");
|
|
|
- } else {
|
|
|
- this.formSearch = JSON.parse(sessionStorage.getItem("question"));
|
|
|
- //this.formSearch.firstPropertyId = parseInt(formSearch.firstPropertyId);
|
|
|
- //this.formSearch.secondPropertyId = parseInt(formSearch.secondPropertyId);
|
|
|
- this.currentPage = parseInt(
|
|
|
- sessionStorage.getItem("question_currentPage")
|
|
|
- );
|
|
|
- }
|
|
|
- this.searchQues();
|
|
|
+ this.initVue();
|
|
|
}
|
|
|
};
|
|
|
</script>
|