|
@@ -23,9 +23,6 @@
|
|
@click="confirm"
|
|
@click="confirm"
|
|
>确定</el-button
|
|
>确定</el-button
|
|
>
|
|
>
|
|
- <el-button v-if="!isEdit" size="small" type="primary" @click="initData"
|
|
|
|
- >继续出题</el-button
|
|
|
|
- >
|
|
|
|
<el-button size="small" @click="cancel">取消</el-button>
|
|
<el-button size="small" @click="cancel">取消</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -98,6 +95,7 @@ export default {
|
|
detailName: "",
|
|
detailName: "",
|
|
questionKey: "",
|
|
questionKey: "",
|
|
loading: false,
|
|
loading: false,
|
|
|
|
+ hasModifyQuestion: false,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -116,6 +114,7 @@ export default {
|
|
this.initData();
|
|
this.initData();
|
|
},
|
|
},
|
|
initData() {
|
|
initData() {
|
|
|
|
+ this.hasModifyQuestion = false;
|
|
this.questionKey = randomCode();
|
|
this.questionKey = randomCode();
|
|
this.curQuestionType = this.question.questionType || this.curQuestionType;
|
|
this.curQuestionType = this.question.questionType || this.curQuestionType;
|
|
this.questionModel = { ...this.question };
|
|
this.questionModel = { ...this.question };
|
|
@@ -123,12 +122,16 @@ export default {
|
|
this.questionModel.questionType = this.curQuestionType;
|
|
this.questionModel.questionType = this.curQuestionType;
|
|
this.loading = false;
|
|
this.loading = false;
|
|
},
|
|
},
|
|
- cancel() {
|
|
|
|
|
|
+ close() {
|
|
this.modalIsShow = false;
|
|
this.modalIsShow = false;
|
|
},
|
|
},
|
|
open() {
|
|
open() {
|
|
this.modalIsShow = true;
|
|
this.modalIsShow = true;
|
|
},
|
|
},
|
|
|
|
+ cancel() {
|
|
|
|
+ if (this.hasModifyQuestion) this.$emit("modified");
|
|
|
|
+ this.close();
|
|
|
|
+ },
|
|
async switchType(item) {
|
|
async switchType(item) {
|
|
if (this.isEdit) return;
|
|
if (this.isEdit) return;
|
|
if (this.curQuestionType === item.code) return;
|
|
if (this.curQuestionType === item.code) return;
|
|
@@ -161,8 +164,24 @@ export default {
|
|
if (!res) return;
|
|
if (!res) return;
|
|
|
|
|
|
this.$message.success(this.title + "成功");
|
|
this.$message.success(this.title + "成功");
|
|
- this.cancel();
|
|
|
|
- this.$emit("modified", this.questionModel);
|
|
|
|
|
|
+
|
|
|
|
+ this.hasModifyQuestion = true;
|
|
|
|
+
|
|
|
|
+ if (this.isEdit) {
|
|
|
|
+ this.$emit("modified");
|
|
|
|
+ this.close();
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const confirm = await this.$confirm("是否继续出题吗?", "提示", {
|
|
|
|
+ type: "warning",
|
|
|
|
+ }).catch(() => {});
|
|
|
|
+ if (confirm !== "confirm") {
|
|
|
|
+ this.$emit("modified");
|
|
|
|
+ this.close();
|
|
|
|
+ } else {
|
|
|
|
+ this.initData();
|
|
|
|
+ }
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
};
|