|
@@ -375,15 +375,17 @@ export default {
|
|
|
|
|
|
/**
|
|
|
* 新增选项
|
|
|
+ * @param {QuestionItem} question - 题目数据
|
|
|
* @returns {void}
|
|
|
*/
|
|
|
- handleAddOption() {
|
|
|
+ async handleAddOption(question) {
|
|
|
this.optionDialogMode = 'add'
|
|
|
this.optionAddDialogVisible = true
|
|
|
this.resetOptionForm()
|
|
|
- this.optionForm.questionId = this.currentQuestionId
|
|
|
+ this.optionForm.questionId = question.id
|
|
|
+ this.currentQuestionOptions = await this.loadQuestionOptions(question.id)
|
|
|
this.optionForm.optionNo = this.getNextOptionNo()
|
|
|
- this.optionDialogVisible = true
|
|
|
+ // this.optionDialogVisible = true
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -391,10 +393,11 @@ export default {
|
|
|
* @param {OptionItem} option - 选项数据
|
|
|
* @returns {void}
|
|
|
*/
|
|
|
- handleEditOption(option) {
|
|
|
+ async handleEditOption(option) {
|
|
|
this.optionDialogMode = 'edit'
|
|
|
this.setOptionForm(option)
|
|
|
- this.currentQuestionId = option.questionId
|
|
|
+ this.currentQuestionId = option.questionId
|
|
|
+ this.currentQuestionOptions = await this.loadQuestionOptions(option.questionId)
|
|
|
// this.optionDialogVisible = true
|
|
|
this.optionAddDialogVisible = true
|
|
|
},
|