From bead5d1a1ae159dfc916de7bff3276c3cb842e11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 31 Dec 2019 16:20:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E9=94=AE=E8=AF=84=E9=98=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesPublic/ApprausePublic.js | 167 ++++++++++++++++++ .../courses/coursesPublic/Newshixunmodel.css | 2 +- .../courses/poll/PollDetailTabForth.js | 1 + .../shixunHomework/Listofworksstudentone.js | 19 +- .../shixunHomework/ShixunHomeworkPage.js | 68 ++++++- .../modules/tpm/newshixuns/css/Newshixuns.css | 2 +- 6 files changed, 245 insertions(+), 14 deletions(-) create mode 100644 public/react/src/modules/courses/coursesPublic/ApprausePublic.js diff --git a/public/react/src/modules/courses/coursesPublic/ApprausePublic.js b/public/react/src/modules/courses/coursesPublic/ApprausePublic.js new file mode 100644 index 000000000..af5d1acdd --- /dev/null +++ b/public/react/src/modules/courses/coursesPublic/ApprausePublic.js @@ -0,0 +1,167 @@ +import React,{ Component } from "react"; +import { Modal,Checkbox,Upload,Button,Icon,message,Input,Radio} from "antd"; +import { WordNumberTextarea } from 'educoder'; + + +class ApprausePublic extends Component{ + constructor(props){ + super(props); + this.state={ + group_ids:[], + fileList:[], + Inputsval:undefined, + textareavaltype:false, + comment:undefined, + hidden_comment:undefined + } + } + + componentDidMount() { + + + } + + comment=(e)=>{ + this.setState({ + comment:e.target.value + }) + this.hideentyps(e.target.value) + } + + hideentyps=(value)=>{ + if(value===undefined||value===null||value===""){ + + }else{ + this.setState({ + textareavaltype:false + }) + } + } + hidden_comment=(e)=>{ + this.setState({ + hidden_comment:e.target.value + }) + this.hideentyps(e.target.value) + } + + Saves=()=>{ + let{comment,hidden_comment}=this.state; + let commenttype=comment===undefined||comment===null||comment===""; + let hidden_commenttype=hidden_comment===undefined||hidden_comment===null||hidden_comment===""; + + if(commenttype===true&&hidden_commenttype===true){ + this.setState({ + textareavaltype:true + }) + return + } + this.props.SaveAppraiseModal(this.state.comment,this.state.hidden_comment); + } + render(){ + let {textareavaltype,comment,hidden_comment}=this.state; + return( +
+ + + + +
+ +
+

+ 可见(学生可查看老师的评阅内容) +

+ {/**/} + {/*可见 (学生查看老师的评阅内容)*/} + {/*不可见 (仅对课堂老师可见)*/} + {/**/} + this.comment(e)} + value={comment} + maxlength={500} + /> + +

+ 不可见(仅对课堂老师可见) +

+ this.hidden_comment(e)} + value={hidden_comment} + maxlength={500} + /> + +
  • 评阅内容至少有一个不为空
  • +
    + +
    + this.props.Cancel()}>{this.props.Cancelname || '取消'} + this.Saves()}>{this.props.Savesname || '确定'} +
    +
    +
    +
    + ) + } +} +export default ApprausePublic; \ No newline at end of file diff --git a/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css b/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css index 9bdf44e68..326548202 100644 --- a/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css +++ b/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css @@ -308,7 +308,7 @@ backgroud: rgba(234, 234, 234, 1); width: 530px; margin-left: 10px; - margin-top: 25px; + margin-top: 5px; height: 214px !important; } diff --git a/public/react/src/modules/courses/poll/PollDetailTabForth.js b/public/react/src/modules/courses/poll/PollDetailTabForth.js index 1af04bebe..485cdc07c 100644 --- a/public/react/src/modules/courses/poll/PollDetailTabForth.js +++ b/public/react/src/modules/courses/poll/PollDetailTabForth.js @@ -116,6 +116,7 @@ class PollDetailTabForth extends Component{ let url=`/polls/${pollId}/poll_setting.json`; axios.get(url).then((result)=>{ if(result){ + this.props.getPollInfo(); this.setState({ polls:result.data.poll, unitSetting:result.data.poll.unified_setting, diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 438df7b05..e1c55625a 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -1294,11 +1294,11 @@ class Listofworksstudentone extends Component { record.submitstate === "未开启" ? this.Viewstudenttraininginformationtysl2(e, record)} - onClick={() => this.Viewstudenttraininginformationt(record)}>评阅 : + onClick={() => this.Viewstudenttraininginformationt(record)}>{record.has_comment===false?"评阅":"详情"} : this.Viewstudenttraininginformationtysl2(e, record)} - onClick={() => this.Viewstudenttraininginformationt(record)}>评阅 + onClick={() => this.Viewstudenttraininginformationt(record)}>{record.has_comment===false?"评阅":"详情"} ) }, @@ -1656,11 +1656,11 @@ class Listofworksstudentone extends Component { record.submitstate === "未开启" ? this.Viewstudenttraininginformationtysl2(e, record)} - onClick={() => this.Viewstudenttraininginformationt(record)}>评阅 : + onClick={() => this.Viewstudenttraininginformationt(record)}>{record.has_comment===false?"评阅":"详情"} : this.Viewstudenttraininginformationtysl2(e, record)} - onClick={() => this.Viewstudenttraininginformationt(record)}>评阅 + onClick={() => this.Viewstudenttraininginformationt(record)}>{record.has_comment===false?"评阅":"详情"} ) }, @@ -1886,7 +1886,12 @@ class Listofworksstudentone extends Component { console.log(error); }) } - + AkeyreviewitGetalistofworkstwo=()=>{ + this.setState({ + loadingstate: true, + }) + this.Getalistofworkstwo("", "", "", "", 1, 20); + } // 获取作品列表 Getalistofworkstwo = (ordervlue, checkedValuesine, checkedValuesineinfo, searchtext, page, limit) => { // console.log("获取作品列表");222222222222 @@ -2075,6 +2080,7 @@ class Listofworksstudentone extends Component { stduynumber: teacherdata.student_id, classroom: teacherdata.group_name, cost_time: teacherdata.cost_time, + has_comment:teacherdata.has_comment, submitstate: teacherdata.work_status === 0 ? "未开启" : teacherdata.work_status === 1 ? "未通关" : teacherdata.work_status === 2 ? "按时通关" : "迟交通关", // updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:"", @@ -2119,6 +2125,7 @@ class Listofworksstudentone extends Component { stduynumber: student_works[i].student_id, classroom: student_works[i].group_name, cost_time: student_works[i].cost_time, + has_comment:teacherdata[i].has_comment, submitstate: student_works[i].work_status === 0 ? "未开启" : student_works[i].work_status === 1 ? "未通关" : student_works[i].work_status === 2 ? "按时通关" : "迟交通关", // updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:"", @@ -2280,6 +2287,7 @@ class Listofworksstudentone extends Component { stduynumber: teacherdata.student_id, classroom: teacherdata.group_name, cost_time: teacherdata.cost_time, + has_comment:teacherdata.has_comment, submitstate: teacherdata.work_status === 0 ? "未开启" : teacherdata.work_status === 1 ? "未通关" : teacherdata.work_status === 2 ? "按时通关" : "迟交通关", // updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:"", @@ -2642,6 +2650,7 @@ class Listofworksstudentone extends Component { stduynumber: student_works[i].student_id, classroom: student_works[i].group_name, cost_time: student_works[i].cost_time, + has_comment:teacherdata[i].has_comment, submitstate: student_works[i].work_status === 0 ? "未开启" : student_works[i].work_status === 1 ? "未通关" : student_works[i].work_status === 2 ? "按时通关" : "迟交通关", // updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:"", diff --git a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js index d4ccb2af9..ca31f9fc8 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js @@ -6,18 +6,20 @@ import { notification, Spin } from "antd"; -import '../css/members.css'; -import "../common/formCommon.css"; -import '../css/Courses.css'; -import './style.css'; -import '../css/busyWork.css'; -import '../poll/pollStyle.css'; +import ApprausePublic from "../coursesPublic/ApprausePublic"; import Listofworksstudentone from './Listofworksstudentone'; import Trainingjobsetting from './Trainingjobsetting'; import Workquestionandanswer from './Workquestionandanswer'; import CoursesListType from '../coursesPublic/CoursesListType'; import ShixunStudentWork from "./ShixunStudentWork"; import Startshixuntask from "../coursesPublic/Startshixuntask"; +import '../css/members.css'; +import "../common/formCommon.css"; +import '../css/Courses.css'; +import './style.css'; +import '../css/busyWork.css'; +import '../poll/pollStyle.css'; + import TPMMDEditor from "../../tpm/challengesnew/TPMMDEditor"; import DownloadMessageysl from "../../modals/DownloadMessageysl"; @@ -41,6 +43,7 @@ class ShixunHomeworkPage extends Component { ModalsType:false, mylistisSpin:false, Showupdateinstructions:false, + AppraiseModaltype:false } } @@ -189,8 +192,41 @@ class ShixunHomeworkPage extends Component { this.props.history.replace(`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_id === undefined ? "" : jobsettingsdatapage.data.category.category_id}`); } + + Akeyreviewit=()=>{ + this.setState({ + AppraiseModaltype:true + }) + } + + hideAppraiseModaltype=()=>{ + this.setState({ + AppraiseModaltype:false + }) + } + + SaveAppraiseModal=(comment,hidden_comment)=>{ + let url = `/homework_commons/${this.props.match.params.homeworkid}/batch_comment.jsonr` + axios.post(url,{ + comment: comment, + hidden_comment: hidden_comment, + } + ) + .then((response) => { + if (response.data.status == 0) { + this.props.showNotification('一键评阅成功') + this.hideAppraiseModaltype() + this.child.AkeyreviewitGetalistofworkstwo() + } else { + + } + }) + .catch( (error) =>{ + + }); + } render() { - let {tab, teacherdatapage, jobsettingsdatapage} = this.state; + let {tab, teacherdatapage, jobsettingsdatapage,AppraiseModaltype} = this.state; const isAdmin = this.props.isAdmin(); // console.log(119) @@ -207,6 +243,17 @@ class ShixunHomeworkPage extends Component { loadtype={false} > + + {AppraiseModaltype===true?this.hideAppraiseModaltype()} + SaveAppraiseModal={(comment,hidden_comment)=>this.SaveAppraiseModal(comment,hidden_comment)} + />:""} + +
    { @@ -313,10 +360,17 @@ class ShixunHomeworkPage extends Component { this.homeworkstarts(this.child)}>立即发布 : "" : ""} + {this.props.isAdmin() ? teacherdatapage && teacherdatapage.code_review === true ? this.workshowmodels(this.child)}>代码查重 : "" : ""} + + {parseInt(tab) === 0 ?this.props.isAdmin() ? + jobsettingsdatapage === undefined ? [""] : jobsettingsdatapage.data.homework_status[0] === "未发布" ? "" : + this.Akeyreviewit()}>一键评阅 + : "":""} + { parseInt(tab)===1? this.props.isAdmin() ? diff --git a/public/react/src/modules/tpm/newshixuns/css/Newshixuns.css b/public/react/src/modules/tpm/newshixuns/css/Newshixuns.css index 9a85f33d4..003002749 100644 --- a/public/react/src/modules/tpm/newshixuns/css/Newshixuns.css +++ b/public/react/src/modules/tpm/newshixuns/css/Newshixuns.css @@ -733,7 +733,7 @@ a.white-btn.use_scope-btn:hover{ backgroud: rgba(234, 234, 234, 1); width: 530px; margin-left: 10px; - margin-top: 25px; + margin-top: 5px; height: 214px !important; }