From bfc75fbbc6be3849c4934b0f25a252e227cca5c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 18 Mar 2020 22:41:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=99=AE=E9=80=9A/=E5=88=86=E7=BB=84=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E5=89=8D=E7=AB=AF=E8=80=81=E5=B8=88=E8=A7=86=E8=A7=92?= =?UTF-8?q?=E7=9A=84=E8=AF=84=E9=98=85=E8=AF=A6=E6=83=85=E9=A1=B5=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=B5=AE=E5=8A=A8=E6=98=BE=E7=A4=BA=E2=80=9C=E4=B8=8B?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E8=AF=84=E9=98=85=E2=80=9D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/busyWork/CommonWorkAppraise.js | 94 +++++++++++++++++-- .../busyWork/reply/CommonWorkAppraiseReply.js | 18 ++-- .../GraduationTasksappraiseMainEditor.js | 3 + 3 files changed, 98 insertions(+), 17 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js b/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js index 60194c744..7e28ef899 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js @@ -2,6 +2,7 @@ import '../katex.css'; import '../css/Courses.css'; import React,{Component} from "react"; import {markdownToHTML, ImageLayer2 } from 'educoder'; +import {Button, Row, Col} from "antd"; import axios from 'axios'; import Modals from '../../modals/Modals'; import moment from 'moment'; @@ -19,10 +20,10 @@ class CommonWorkAppraise extends Component{ course_name:"", homework_name:"", search: '', - - + get_next_work:undefined, attachments: [], revise_attachments: [], + get_next_worktype:false } } getWork = () => { @@ -87,6 +88,34 @@ class CommonWorkAppraise extends Component{ this.getReviseAttachments() } + get_next_works=(id)=>{ + let workId =this.props.match.params.workId; + let url + if(id){ + url=`/homework_commons/${workId}/get_next_work.json?work_id=${id}`; + }else{ + url=`/homework_commons/${workId}/get_next_work.json`; + } + axios.get(url).then((result)=> { + this.setState({ + get_next_work:result.data, + get_next_worktype:true + }) + }).catch((error)=>{ + console.log(error) + }) + } + + gotoget_next_work=(id)=>{ + if(this.props.match.path===`/classrooms/:coursesId/common_homeworks/:workId/:studentWorkId/appraise`){ + this.props.history.replace(`/classrooms/${this.props.match.params.coursesId}/common_homeworks/${this.props.match.params.workId}/${id}/appraise`); + } + + if(this.props.match.path===`/classrooms/:coursesId/group_homeworks/:workId/:studentWorkId/appraise`){ + this.props.history.replace(`/classrooms/${this.props.match.params.coursesId}/common_homeworks/${this.props.match.params.workId}/${id}/appraise`); + } + } + onAttachmentRemove = (id) => { this.setState({ Modalstype:true, @@ -128,22 +157,21 @@ class CommonWorkAppraise extends Component{ } render(){ - const dateFormat = 'YYYY-MM-DD HH:mm'; - - let {course_name, homework_name, search, page, loadingstate, homework_status, reference_answer, - attachments, homework_id, project_info, work_members, is_evaluation, + let {course_name, get_next_work,get_next_worktype, + attachments, project_info, work_members, is_evaluation, description, update_user_name, commit_user_name, update_time, commit_time, author_name, - revise_attachments, revise_reason, atta_update_user, atta_update_time, atta_update_user_login, Modalstype,Modalstopval,ModalCancel,ModalSave,loadtype, is_leader_work } =this.state; - let courseId=this.props.match.params.coursesId; - let category_id=this.props.match.params.category_id; + // let courseId=this.props.match.params.coursesId; + // let category_id=this.props.match.params.category_id; let studentWorkId=this.props.match.params.studentWorkId; const isAdmin = this.props.isAdmin() document.title=course_name&&course_name; return( +
+ {this.commonWorkAppraiseReply = ref}} + get_next_works={()=>this.get_next_works()} >
+ {isAdmin===true&&get_next_worktype===true?:""} + + {isAdmin===true&&get_next_worktype===true?
+ +
+
+ + + + {get_next_work&&get_next_work.work_id===null? + +
已全部评阅完
+
: +
{get_next_work&&get_next_work?`下一位待评阅人员:${get_next_work&&get_next_work.user_name}`:""}
+ this.get_next_works(get_next_work&&get_next_work.work_id)}>跳过 +
} + + {get_next_work&&get_next_work.work_id===null?"": + + + + + + } +
+ +
+
+
:""} + ) } } diff --git a/public/react/src/modules/courses/busyWork/reply/CommonWorkAppraiseReply.js b/public/react/src/modules/courses/busyWork/reply/CommonWorkAppraiseReply.js index 3d3f83bc6..0a1f38965 100644 --- a/public/react/src/modules/courses/busyWork/reply/CommonWorkAppraiseReply.js +++ b/public/react/src/modules/courses/busyWork/reply/CommonWorkAppraiseReply.js @@ -20,7 +20,7 @@ import Modals from '../../../modals/Modals'; const REPLY_PAGE_COUNT = 10 const $ = window.$; -/* +/* */ class CommonWorkAppraiseReply extends Component{ @@ -79,7 +79,7 @@ class CommonWorkAppraiseReply extends Component{ reply.journals.push(reply.appeal_info) reply.journals = _.orderBy(reply.journals, 'time', 'asc') } - + return { isSuperAdmin: isSuperAdmin, admin: isAdmin, // @@ -93,7 +93,7 @@ class CommonWorkAppraiseReply extends Component{ // time: moment(reply.comment_time).fromNow(), time: moment(reply.comment_time).format('YYYY-MM-DD HH:mm'), - image_url: reply.user_image_url, + image_url: reply.user_image_url, user_id: reply.user_id, user_login: reply.user_login, username: reply.user_name, @@ -131,7 +131,7 @@ class CommonWorkAppraiseReply extends Component{ console.log('Cancel'); }, }); - + } showModulationtype=(id)=>{ @@ -221,6 +221,7 @@ class CommonWorkAppraiseReply extends Component{ if (!needNiPingEditor && comment_scores.length == 0) { return '' } + return(
@@ -257,13 +258,13 @@ class CommonWorkAppraiseReply extends Component{ {/*{this.props.isStudent()?补交附件:""}*/} {/*
*/} - + {/* { - (!!comment_scores.length && + (!!comment_scores.length &&
全部评阅 - ({comment_scores.length}) + ({comment_scores.length})
)} */}
{!!comment_scores.length &&
@@ -283,13 +284,14 @@ class CommonWorkAppraiseReply extends Component{ addSuccess={this.addSuccess} ref={this.editorRef} totalCount={comment_scores.length} onReply={this.onReply} placeholder={"请在此输入对本作品的评语,最大限制2000个字符"} showSameScore={isGroup && isAdmin} + get_next_works={()=>this.props.get_next_works()} > }
{/* ${!!comment_scores.length ? 'bor-bottom-greyE' : ''} */}
- {/* + {/* .course-message .panel-comment_item { margin-top: ${needNiPingEditor ? 56 : 28}px; } diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseMainEditor.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseMainEditor.js index faf0d67a4..6b3f9ecdd 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseMainEditor.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseMainEditor.js @@ -67,6 +67,9 @@ class GraduationTasksappraiseMainEditor extends Component{ same_score } if (this.props.onReply) { + if(this.props.get_next_works){ + this.props.get_next_works() + } this.props.onReply(params) } else { axios.post(url, params).then((response)=>{