考试 字段校验,没传考试id

This commit is contained in:
zhangyc
2022-12-03 19:40:34 +08:00
parent 67982d3720
commit 988683b1d5
4 changed files with 35 additions and 35 deletions

View File

@@ -114,26 +114,20 @@
</a-menu>
</template>
</a-dropdown> -->
<span style="margin-left: 10px">
<a-tag
class="tag-style"
v-if="paperName != ''"
:closable="true"
@close="delTag"
>{{ paperName }}</a-tag
>
<!-- <a-tag
class="tag-style"
v-for="item in choosedTestList"
:closable="true"
@close="closeTag(item.key)"
:key="item.key"
>{{ item.value }}</a-tag
> -->
</span>
<a-tag v-if="paperName != ''" closable color="processing" @close="delTag">
<span style="font-size:14px;line-height: 33px;">删除考试</span>
</a-tag>
</a-form-item>
</div>
</div>
<div class="main_item">
<div class="btnbox">
<a-form-item has-feedback label="考试时间" name="choosedTime">
@@ -721,9 +715,13 @@ export default {
scoringModel: formState.scoringModel,
showAnalysis: formState.showAnalysis,
showAnswers: formState.showAnswers,
examinationTestId: state.id,
examinationTestName: state.testName,
examinationTestId: state.paperId,
examinationTestName: state.paperName,
};
if(!(state.paperId >0)){
message.destroy();
return message.error("请选择考试");
}
if (props.edit) {
// 编辑任务
updateExamination(obj)
@@ -732,6 +730,7 @@ export default {
closeDrawer();
})
.catch(() => {
message.destroy();
message.error(`编辑失败`);
});
} else {
@@ -742,6 +741,7 @@ export default {
closeDrawer();
})
.catch(() => {
message.destroy();
message.error(`创建失败`);
});
}
@@ -852,6 +852,7 @@ export default {
state.id = value.id;
state.testName = value.testName;
};
return {
formState,
afterVisibleChange,
@@ -876,6 +877,7 @@ export default {
chooseTest,
closeTag,
getData,
...toRefs(state),
};
},