fix:编辑面授课时,配置考试每次都为新建考试修改,不允许在原来考试基础上进行编辑。

This commit is contained in:
wyx
2023-01-18 22:24:13 +08:00
parent 8b259f57a3
commit 3b08dfe999

View File

@@ -309,8 +309,8 @@ import {message} from "ant-design-vue";
import { import {
createExamination, createExamination,
queryExaminationDetailById, queryExaminationDetailById,
updateExamination,
} from "@/api/indexExam"; } from "@/api/indexExam";
// updateExamination,
import STest from "./SelectTest.vue"; import STest from "./SelectTest.vue";
import {ProjectEditTask, RouterEditTask} from "@/api/indexTask"; import {ProjectEditTask, RouterEditTask} from "@/api/indexTask";
import {addTempTask} from "../../api/indexTaskadd"; import {addTempTask} from "../../api/indexTaskadd";
@@ -456,7 +456,7 @@ export default {
console.log("props", props); console.log("props", props);
if (props.addtestVisible && props.EditTestId && props.EditTestId >0) { if (props.addtestVisible && props.EditTestId && props.EditTestId >0) {
// 该页面显示同时 edit为true 时,发送查询请求, // 该页面显示同时 edit为true 时,发送查询请求,
queryTest(); // queryTest();
} }
if (bool) { if (bool) {
state.test.showAnswers = 1; state.test.showAnswers = 1;
@@ -553,18 +553,18 @@ export default {
} }
if (props.EditTestId > 0) { // if (props.EditTestId > 0) {
// 编辑任务 // // 编辑任务
updateExamination(state.test) // updateExamination(state.test)
.then(async (res) => { // .then(async (res) => {
await updateTask(res); // await updateTask(res);
// closeDrawer(); // // closeDrawer();
}) // })
.catch(() => { // .catch(() => {
message.destroy(); // message.destroy();
message.error(`编辑失败`); // message.error(`编辑失败`);
}); // });
} else { // } else {
// 创建任务 // 创建任务
createExamination(state.test) createExamination(state.test)
.then(async (res) => { .then(async (res) => {
@@ -575,7 +575,7 @@ export default {
message.destroy(); message.destroy();
message.error(`创建失败`); message.error(`创建失败`);
}); });
} // }
}; };
const updateTask = (res) => { const updateTask = (res) => {
state.EditTestId = res.data.data.examinationId; state.EditTestId = res.data.data.examinationId;