提交 272cd809 authored 作者: 王鹏飞's avatar 王鹏飞

update

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