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

课后作业新增我收到的评论

上级 c27ab763
......@@ -186,3 +186,13 @@ export function getChapterHomeworkOtherAll(semesterId, courseId, chapterId, para
export function addChapterHomeworkComment(data) {
return httpRequest.post('/api/lms/v2/education/homeworks/comment', data)
}
/**
* 我收到的评论
* @param {string} semesterId 学期ID
* @param {string} courseId 课程ID
* @param {string} chapterId 章节ID
*/
export function getChapterHomeworkComment(params) {
return httpRequest.get('/api/lms/v2/education/homeworks/fmcomment', params)
}
......@@ -62,7 +62,9 @@
</div>
</template>
</container>
<!-- 我收到的作业评论 -->
<chapter-work-comment-to-me :id="resourceId" v-if="showComment"></chapter-work-comment-to-me>
<!-- 评论同学作业 -->
<chapter-work-comment
id="comment"
:endDate="commentEndDate"
......@@ -122,13 +124,14 @@ import Base64 from 'Base64'
import Container from '../common/container.vue'
import ExamItem from './examItem.vue'
import ChapterWorkComment from './chapterWorkComment.vue'
import ChapterWorkCommentToMe from './chapterWorkCommentToMe.vue'
// api
import * as api from '../../api'
// 章节作业
export default {
name: 'ChapterWork',
components: { Container, ExamItem, ChapterWorkComment },
components: { Container, ExamItem, ChapterWorkComment, ChapterWorkCommentToMe },
props: {
// 当前选中的
chapter: { type: Object, default: () => ({}) },
......
<template>
<container :title="$t('viewerWork.commentToMeTitle')">
<template v-for="(item, index) in list">
<div class="module-item" :key="index">
<div class="module-item-hd">{{ $t('viewerWork.comment') }}{{ index + 1 }}:</div>
<div class="module-item-bd">
<show-more>
<div v-html="item.comment"></div>
</show-more>
</div>
</div>
</template>
</container>
</template>
<script>
// api
import * as api from '../../api'
// componets
import Container from '../common/container.vue'
import showMore from '@/components/showMore'
export default {
props: { id: { type: String } },
components: { Container, showMore },
data() {
return {
list: []
}
},
computed: {},
methods: {
getList() {
api.getChapterHomeworkComment({ homework_id: this.id }).then(response => {
// this.list = response
})
}
},
beforeMount() {
this.getList()
}
}
</script>
<style lang="scss" scoped>
.module-item {
margin-bottom: 20px;
}
.module-item + .module-item {
margin-top: 10px;
}
.module-item-hd {
margin-bottom: 10px;
}
.module-item-bd {
padding: 10px;
border-radius: 8px;
background-color: #fff;
img {
max-width: 100%;
}
}
</style>
......@@ -77,7 +77,9 @@ export default {
commentSubmitTips: 'Deadline: {date} Modifications can be made any time before deadline.',
answerMoreButtonText: 'Check other students assignments',
submittedAssignments: 'Submitted Assignments',
student: 'student'
student: 'student',
commentToMeTitle: '我收到的评论',
comment: '评论'
},
viewerExam: {},
viewerRead: {
......
......@@ -76,7 +76,9 @@ export default {
commentSubmitText: '提交评价',
answerMoreButtonText: '去看其他同学作业',
submittedAssignments: '同学提交的作业',
student: '同学'
student: '同学',
commentToMeTitle: '我收到的评论',
comment: '评论'
},
viewerRead: {
download: '下载',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论