feat:合并

This commit is contained in:
lixg
2022-11-30 12:03:59 +08:00
16 changed files with 453 additions and 356 deletions

View File

@@ -32,7 +32,6 @@
外部考试
</button>
</div>
<a-form
v-if="isOuter == 1"
ref="formRef"
@@ -119,6 +118,7 @@
class="tag-style"
v-if="paperName != ''"
:closable="true"
@close="delTag"
>{{ paperName }}</a-tag
>
<!-- <a-tag
@@ -266,7 +266,6 @@
style="width: 88px; height: 32px; margin-left: 35px"
/>
</a-form-item>
<span style="margin-left: 8px"></span>
</div>
</div>
@@ -310,7 +309,6 @@
<a-button class="btn2" html-type="submit">确定</a-button>
</div>
</a-form>
<a-form
v-else
ref="formRef"
@@ -341,7 +339,6 @@
</a-form-item>
</div>
</div>
<div class="main_item">
<div class="btnbox">
<a-form-item
@@ -403,7 +400,6 @@ import STest from "./SelectTest.vue";
import { ProjectEditTask, RouterEditTask } from "@/api/indexTask";
import { addTempTask } from "../../api/indexTaskadd";
import dayjs from "dayjs";
export default {
name: "AddTest",
components: {
@@ -476,6 +472,7 @@ export default {
showAnalysis: 2,
showAnswers: 2,
choosedTime: "",
paperName: "",
choosedTest: [
{
key: 1,
@@ -497,6 +494,8 @@ export default {
STvisible: false, //选择试卷抽屉
paperId: null, //试卷id 子组件传过来给考试抽屉创建考试信息需要
paperName: "", //试卷名称 子组件传过来给考试抽屉选择试卷后框框用
id: "",
testName: "",
choosedTestList: [
{
value: "提高核心竞争力",
@@ -626,7 +625,6 @@ export default {
},
],
};
const options1 = ref([
{
label: "math",
@@ -640,16 +638,16 @@ export default {
const handleFinish = () => {
updateTest();
};
const handleFinishFailed = (e) => {
console.log("提交失败", e);
const handleFinishFailed = () => {
message.error("handleFinishFailed");
};
const resetForm = () => {
formRef.value.resetFields();
state.paperName = "";
state.paperId = null;
state.id = "";
state.testName = "";
};
const handleValidate = (...args) => {
console.log(args);
};
@@ -668,11 +666,13 @@ export default {
queryTest();
}
};
const selectTest = () => {
state.STvisible = true;
};
const delTag = () => {
state.paperId = 0;
state.paperName = "";
};
const queryTest = () => {
// state.addLoading = true;
queryExaminationDetailById({ examinationId: props.EditTestId })
@@ -689,6 +689,8 @@ export default {
formState.scoringModel = Number(res.data.data.scoringModel) || 1;
formState.showAnalysis = Number(res.data.data.showAnalysis) || 1;
formState.showAnswers = Number(res.data.data.showAnswers) || 1;
formState.papaerName = res.data.data.examinationTestName;
state.paperName = res.data.data.examinationTestName;
if (
res.data.data.examinationEndTime &&
res.data.data.examinationStartTime
@@ -707,7 +709,7 @@ export default {
});
};
const updateTest = () => {
//state.addLoading = true;
//state.addLoading = true;updateTask
let obj = {
examinationDuration: formState.examinationDuration,
examinationEndTime: dayjs(formState.choosedTime[1]).format(
@@ -727,17 +729,17 @@ export default {
scoringModel: formState.scoringModel,
showAnalysis: formState.showAnalysis,
showAnswers: formState.showAnswers,
examinationTestId: state.id,
examinationTestName: state.testName,
};
if (props.edit) {
// 编辑任务
updateExamination(obj)
.then((res) => {
console.log("编辑考试", res);
updateTask(res);
closeDrawer();
})
.catch((err) => {
console.log("编辑失败", err);
.catch(() => {
message.error(`编辑失败`);
});
} else {
@@ -747,19 +749,15 @@ export default {
updateTask(res);
closeDrawer();
})
.catch((err) => {
console.log("创建失败", err);
.catch(() => {
message.error(`编辑失败`);
});
}
};
const updateTask = (res) => {
state.EditTestId = res.data.data.examinationId;
console.log("state.EditTestId=====0", state.EditTestId, props.faceLevel);
if (props.faceLevel) {
state.EditTestId = res.data.data.examinationId;
console.log("state.EditTestId=====", state.EditTestId);
} else {
if (props.isLevel == 1) {
let editObj1 = {
@@ -804,7 +802,6 @@ export default {
);
});
} else if (props.isLevel == 3) {
console.log("");
addTempTask({
courseId: res.data.data.examinationId,
duration: res.data.data.examinationDuration,
@@ -828,7 +825,6 @@ export default {
}
}
};
const cloradio1 = (value) => {
if (value != "") {
formState.showAnswers = "";
@@ -868,6 +864,8 @@ export default {
const getData = (value) => {
state.paperId = value.paperId;
state.paperName = value.testName;
state.id = value.id;
state.testName = value.testName;
};
return {
formState,
@@ -884,6 +882,7 @@ export default {
resetForm,
handleValidate,
formRef,
delTag,
// layout,
rules,
updateTest,