|
@@ -176,7 +176,8 @@
|
|
|
]
|
|
]
|
|
|
},
|
|
},
|
|
|
form: JSON.parse(JSON.stringify(defQuestionForm)),
|
|
form: JSON.parse(JSON.stringify(defQuestionForm)),
|
|
|
- questionList: createQuestionList()
|
|
|
|
|
|
|
+ questionList: createQuestionList(),
|
|
|
|
|
+ originalQuestionList: createQuestionList()
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -217,6 +218,7 @@
|
|
|
} else {
|
|
} else {
|
|
|
this.bankForm = JSON.parse(JSON.stringify(defBankForm));
|
|
this.bankForm = JSON.parse(JSON.stringify(defBankForm));
|
|
|
this.questionList = createQuestionList();
|
|
this.questionList = createQuestionList();
|
|
|
|
|
+ this.originalQuestionList = createQuestionList();
|
|
|
this.form = JSON.parse(JSON.stringify(defQuestionForm));
|
|
this.form = JSON.parse(JSON.stringify(defQuestionForm));
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
this.$refs.treeRef && this.$refs.treeRef.setCurrentKey('1');
|
|
this.$refs.treeRef && this.$refs.treeRef.setCurrentKey('1');
|
|
@@ -232,14 +234,25 @@
|
|
|
this.bankForm = JSON.parse(JSON.stringify(defBankForm));
|
|
this.bankForm = JSON.parse(JSON.stringify(defBankForm));
|
|
|
this.form = JSON.parse(JSON.stringify(defQuestionForm));
|
|
this.form = JSON.parse(JSON.stringify(defQuestionForm));
|
|
|
this.questionList = createQuestionList();
|
|
this.questionList = createQuestionList();
|
|
|
|
|
+ this.originalQuestionList = createQuestionList();
|
|
|
this.visible = false;
|
|
this.visible = false;
|
|
|
},
|
|
},
|
|
|
onDeptChange(deptId, node) {
|
|
onDeptChange(deptId, node) {
|
|
|
this.bankForm.deptName = node ? node.name : '';
|
|
this.bankForm.deptName = node ? node.name : '';
|
|
|
},
|
|
},
|
|
|
handleSearchQuestion() {
|
|
handleSearchQuestion() {
|
|
|
- // TODO: 搜索试题
|
|
|
|
|
- console.log('搜索试题', this.questionSearch);
|
|
|
|
|
|
|
+ const keyword = (this.questionSearch || '').trim();
|
|
|
|
|
+ if (!keyword) {
|
|
|
|
|
+ this.questionList = [...this.originalQuestionList];
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.questionList = this.originalQuestionList.filter((item) => {
|
|
|
|
|
+ const content =
|
|
|
|
|
+ item.question && item.question.questionContent
|
|
|
|
|
+ ? String(item.question.questionContent)
|
|
|
|
|
+ : '';
|
|
|
|
|
+ return content.includes(keyword);
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
handleQuestionClick(data) {
|
|
handleQuestionClick(data) {
|
|
|
if (!data.question) return;
|
|
if (!data.question) return;
|
|
@@ -311,6 +324,7 @@
|
|
|
label: `第${question.sortNo || index + 1}题`,
|
|
label: `第${question.sortNo || index + 1}题`,
|
|
|
question
|
|
question
|
|
|
}));
|
|
}));
|
|
|
|
|
+ this.originalQuestionList = [...this.questionList];
|
|
|
this.form =
|
|
this.form =
|
|
|
selectFirstQuestion && questions.length
|
|
selectFirstQuestion && questions.length
|
|
|
? this.mapQuestionToForm(questions[0])
|
|
? this.mapQuestionToForm(questions[0])
|