提交 992f71f4 authored 作者: 王鹏飞's avatar 王鹏飞

update

上级 5807d279
......@@ -67,7 +67,7 @@
<!-- 评论同学作业 -->
<chapter-work-comment
id="comment"
:endDate="commentEndDate"
:endTime="commentEndTime"
:status="detail.status2"
@update="$emit('updateHomework')"
v-if="showComment"
......@@ -151,7 +151,8 @@ export default {
hasUpload: true, // 是否可以上传
isAnonymous: false, // 是否匿名
hasComment: false, // 是否评论
commentEndDate: '',
commentStartTime: '', // 评论开始时间
commentEndTime: '', // 评论结束时间
rules: {
user_answer: [{ required: true, message: '请输入', trigger: 'change' }]
},
......@@ -225,15 +226,16 @@ export default {
return false
}
const currentTime = new Date().getTime()
const endTime = +new Date(this.deadline)
return this.hasComment && currentTime > endTime && this.detail.status !== 1
const startTime = +new Date(this.commentStartTime)
return this.hasComment && currentTime >= startTime && this.detail.status !== 1
},
disabled() {
if (this.detail.status === 1) {
return false
}
// -1未处理 0已处理 1驳回
return this.detail.status === 0 || !this.isWorkTime
return this.detail.status === 0
// if (this.detail.status === 1) {
// return false
// }
// // -1未处理 0已处理 1驳回
// return this.detail.status === 0 || !this.isWorkTime
},
dialogTitle() {
if (this.detail.status === 1 && this.detail.status2 === 1) {
......@@ -255,7 +257,8 @@ export default {
this.hasUpload = response.pdf !== 0
this.isAnonymous = !!response.anonymous
this.hasComment = !!response.comment
this.commentEndDate = response.comment_end
this.commentStartTime = response.comment_begin
this.commentEndTime = response.comment_end
})
},
// 组装问题数据
......
......@@ -11,13 +11,7 @@
ref="form"
>
<el-form-item prop="comment">
<chapter-work-comment-item
:data="item"
:index="index"
:endDate="endDate"
:disabled="disabled"
:key="item.id"
/> </el-form-item
<chapter-work-comment-item :data="item" :index="index" :disabled="disabled" :key="item.id" /> </el-form-item
></el-form>
</template>
<div class="button" v-if="status !== 0">
......@@ -25,7 +19,7 @@
$t('viewerWork.commentSubmitText')
}}</el-button>
<p v-if="status === 1">注:重新提交后不可修改,请检查好作业内容再做提交。</p>
<p v-else>{{ $t('viewerWork.commentSubmitTips', { date: endDate }) }}</p>
<!-- <p v-else>{{ $t('viewerWork.commentSubmitTips', { date: endTime }) }}</p> -->
</div>
<slot></slot>
<div class="more">
......@@ -45,7 +39,7 @@ import ChapterWorkCommentItem from './chapterWorkCommentItem.vue'
export default {
components: { Container, ChapterWorkCommentItem },
props: { endDate: { type: String }, status: { type: Number } },
props: { endTime: { type: String }, status: { type: Number } },
data() {
return {
list: [],
......@@ -70,17 +64,20 @@ export default {
},
isSubmitTime() {
// 大于开始时间,小于结束时间
const endTime = +new Date(this.endDate)
const endTime = +new Date(this.endTime)
const currentTime = new Date().getTime()
return currentTime < endTime
},
// 是否禁用
disabled() {
// -1未处理 0已处理 1驳回
if (this.status === 1) {
return false
if (this.status === 0) {
return true
}
return !this.isSubmitTime
// -1未处理 0已处理 1驳回
// if (this.status === 1) {
// return false
// }
// return !this.isSubmitTime
}
},
methods: {
......
......@@ -11,7 +11,7 @@ import ChapterWorkAnswerItem from './chapterWorkAnswerItem.vue'
import VEditor from '@/components/tinymce'
export default {
props: { endDate: { type: String }, data: { type: Object, default: () => ({}) }, disabled: { type: Boolean } },
props: { data: { type: Object, default: () => ({}) }, disabled: { type: Boolean } },
components: { ChapterWorkAnswerItem, VEditor },
data() {
return {}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论