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