提交 15e006dd authored 作者: haodaking's avatar haodaking

fix: 修改作业提交判断逻辑

上级 e59bb059
...@@ -8,14 +8,7 @@ ...@@ -8,14 +8,7 @@
<template v-for="(item, index) in questions"> <template v-for="(item, index) in questions">
<el-form :disabled="disabled" :key="item.id" ref="form" :model="item.formModel" :rules="rules"> <el-form :disabled="disabled" :key="item.id" ref="form" :model="item.formModel" :rules="rules">
<el-form-item prop="user_answer"> <el-form-item prop="user_answer">
<exam-item <exam-item :index="index" :type="item.question_type" :data="item" :value="item.formModel" :disabled="disabled" :hasUpload="hasUpload"></exam-item>
:index="index"
:type="item.question_type"
:data="item"
:value="item.formModel"
:disabled="disabled"
:hasUpload="hasUpload"
></exam-item>
</el-form-item> </el-form-item>
</el-form> </el-form>
</template> </template>
...@@ -65,13 +58,7 @@ ...@@ -65,13 +58,7 @@
<!-- 我收到的作业评论 --> <!-- 我收到的作业评论 -->
<chapter-work-comment-to-me :id="detail.id" v-if="showComment"></chapter-work-comment-to-me> <chapter-work-comment-to-me :id="detail.id" v-if="showComment"></chapter-work-comment-to-me>
<!-- 评论同学作业 --> <!-- 评论同学作业 -->
<chapter-work-comment <chapter-work-comment id="comment" :endTime="commentEndTime" :status="detail.status2" @update="$emit('updateHomework')" v-if="showComment">
id="comment"
:endTime="commentEndTime"
:status="detail.status2"
@update="$emit('updateHomework')"
v-if="showComment"
>
<!-- 已批改 --> <!-- 已批改 -->
<template v-if="isRevised"> <template v-if="isRevised">
<div class="work-bottom"> <div class="work-bottom">
...@@ -168,10 +155,7 @@ export default { ...@@ -168,10 +155,7 @@ export default {
const { questions = [], answer = {} } = data const { questions = [], answer = {} } = data
this.questions = this.genQuestions(questions) this.questions = this.genQuestions(questions)
this.detail = Array.isArray(answer) ? {} : answer this.detail = Array.isArray(answer) ? {} : answer
if ( if ((this.detail.status === 1 || this.detail.status2 === 1) && !([-1, -2].includes(this.detail.status) || [-1, -2].includes(this.detail.status2))) {
(this.detail.status === 1 || this.detail.status2 === 1) &&
!([-1, -2].includes(this.detail.status) || [-1, -2].includes(this.detail.status2))
) {
this.dialogVisible = true this.dialogVisible = true
} }
// 答案处理 // 答案处理
...@@ -234,12 +218,11 @@ export default { ...@@ -234,12 +218,11 @@ export default {
disabled() { disabled() {
// 已提交 // 已提交
const isSubmit = !!this.detail.created_time const isSubmit = !!this.detail.created_time
if (this.detail.status === 1) {
return false
}
// -1未处理 0已处理 1驳回
return this.detail.status === 0 || (isSubmit && !this.isWorkTime) return this.detail.status === 0 || (isSubmit && !this.isWorkTime)
// if (this.detail.status === 1) {
// return false
// }
// // -1未处理 0已处理 1驳回
// return this.detail.status === 0 || !this.isWorkTime
}, },
dialogTitle() { dialogTitle() {
if (this.detail.status === 1 && this.detail.status2 === 1) { if (this.detail.status === 1 && this.detail.status2 === 1) {
...@@ -356,8 +339,7 @@ export default { ...@@ -356,8 +339,7 @@ export default {
const answers = this.questions.map(item => { const answers = this.questions.map(item => {
return { return {
question_id: item.id, question_id: item.id,
descreption: descreption: item.question_type === 3 ? Base64.encode(item.formModel.user_answer) : item.formModel.user_answer,
item.question_type === 3 ? Base64.encode(item.formModel.user_answer) : item.formModel.user_answer,
file_url: item.formModel.attachments, file_url: item.formModel.attachments,
is_encoded: 1 is_encoded: 1
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论