dev_cs
杨树明 5 years ago
parent 5794d7a6a1
commit 4e67d4e2cc

@ -9,10 +9,11 @@ class AppraiseModal extends Component{
this.state={
group_ids:[],
fileList:[],
textareaval:undefined,
Inputsval:undefined,
valuetype:0,
textareavaltype:false
textareavaltype:false,
comment:undefined,
hidden_comment:undefined
}
}
@ -25,32 +26,40 @@ class AppraiseModal extends Component{
}
onChanges=(e)=>{
comment=(e)=>{
this.setState({
valuetype:e.target.value
comment:e.target.value
})
}
settextarea=(e)=>{
hidden_comment=(e)=>{
this.setState({
textareaval:e.target.value
hidden_comment:e.target.value
})
}
Saves=()=>{
let{textareaval,valuetype}=this.state;
let{textareaval,valuetype,comment,hidden_comment}=this.state;
let commenttype=comment===undefined||comment===null||comment==="";
let hidden_commenttype=hidden_comment===undefined||hidden_comment===null||hidden_comment==="";
if(textareaval===undefined||textareaval===null||textareaval===""){
if(commenttype===true&&hidden_commenttype===true){
this.setState({
textareavaltype:true
})
return
}
//comment 是 text 可见的评阅内容
// hidden_comment 是 text 不可见的评阅内容
// challenge_id 否 int 关卡id关卡评阅才需传关卡id
let url=`/student_works/${this.props.match.params.homeworkid}/shixun_work_comment.json`
axios.post(url, {
comment:textareaval,
is_hidden:valuetype
hidden_comment:valuetype
}).then((response) => {
if(response.data.status===0){
this.props.showNotification(response.data.message)
@ -64,15 +73,41 @@ class AppraiseModal extends Component{
}
render(){
let {textareaval,Inputsval,textareavaltype,Inputsvaltype}=this.state;
const radioStyle = {
display: 'block',
height: '30px',
lineHeight: '30px',
};
let {textareavaltype,comment,hidden_comment}=this.state;
return(
<div>
<style>
{
`
@media (max-width: 2000px) {
.WordNumberTextarea{
height: 130px !important;
}
}
@media (max-width: 1350px) {
.HomeworkModal{
top:10px !important;
}
.WordNumberTextarea{
height: 80px !important;
}
}
@media (max-width: 1250px) {
.HomeworkModal{
top:0px !important;
}
.WordNumberTextarea{
height: 40px !important;
}
}
`
}
</style>
<Modal
keyboard={false}
className={"HomeworkModal"}
@ -91,12 +126,9 @@ class AppraiseModal extends Component{
padding: 0px 15px 15px 15px;
}
.font{
height: 16px;
font-size: 16px;
font-size: 14px;
font-weight: 400;
color: rgba(5,16,26,1);
line-height: 16px;
}
.newfont{
height: 16px;
@ -110,7 +142,7 @@ class AppraiseModal extends Component{
}
</style>
<div className="clearfix">
<p className={"font mt10 mb10"}>
<p className={"font mt10 mb10 ml10"}>
可见:(学生可查看老师的评阅内容
</p>
{/*<Radio.Group onChange={this.onChanges} value={this.state.valuetype}>*/}
@ -119,22 +151,22 @@ class AppraiseModal extends Component{
{/*</Radio.Group>*/}
<WordNumberTextarea
placeholder={"请填写评阅内容"}
onInput={(e)=>this.settextarea(e)}
value={textareaval}
onInput={(e)=>this.comment(e)}
value={comment}
maxlength={500}
/>
<p className={"font mt10 mb20"}>
<p className={"font mt10 mb10 ml10"}>
不可见:(仅对课堂老师可见
</p>
<WordNumberTextarea
placeholder={"请填写评阅内容"}
onInput={(e)=>this.settextarea(e)}
value={textareaval}
onInput={(e)=>this.hidden_comment(e)}
value={hidden_comment}
maxlength={500}
/>
<li style={{height:"20px",lineHeight:"20px"}} className={textareavaltype===true?"color-red mt20 mb10":"none"}><span>评阅内容为空</span></li>
<li style={{height:"20px",lineHeight:"20px"}} className={textareavaltype===true?"color-red mt20 mb10":"none"}><span>评阅内容至少有一个不为空</span></li>
</div>
<div className={textareavaltype===false?"mt20 clearfix edu-txt-center":"clearfix edu-txt-center"}>

@ -155,19 +155,20 @@ class ShixunWorkReport extends Component {
})
}
showAppraiseModal=(sum)=>{
// if(sum===undefined){
// this.setState({
// showAppraiseModaltype:true,
// })
// }else{
// this.setState({
// showAppraiseModaltype:true,
// work_comment:undefined,
// work_type:0,
// })
//
// }
showAppraiseModal=(type,id)=>{
if(type==="child"){
this.setState({
showAppraisetype:type,
challenge_id:id
})
}else{
this.setState({
showAppraisetype:type,
challenge_id:undefined
})
}
let{work_comment,work_comment_hidden}=this.state;
this.setState({
showAppraiseModaltype:true,
@ -253,6 +254,9 @@ class ShixunWorkReport extends Component {
modalSave={this.state.modalSave}
modalCancel={this.state.modalCancel}
></Modals>
{showAppraiseModaltype===true?<AppraiseModal
{...this.props}
{...this.state}
@ -299,7 +303,7 @@ class ShixunWorkReport extends Component {
{/*>评阅</a> : ""}*/}
{this.props.isAdmin() ?<a
className=" color-blue font-14 fr ml20 mt15"
onClick={()=>this.showAppraiseModal(1)}
onClick={()=>this.showAppraiseModal("main")}
>评阅</a>:""}
</div>
{/*{work_comment===null||work_comment===undefined?"评阅":"编辑评阅"}*/}
@ -421,7 +425,7 @@ class ShixunWorkReport extends Component {
jumptopic={this.jumptopic}
getdatalist={()=>this.getdatalist()}
setupdalist={(challenge_score,overall_appraisal,work_score)=>this.setupdalist(challenge_score,overall_appraisal,work_score)}
showAppraiseModal={(sum)=>this.showAppraiseModal(sum)}
showAppraiseModal={(type,id)=>this.showAppraiseModal(type,id)}
/>
</div>
@ -484,7 +488,7 @@ class ShixunWorkReport extends Component {
>删除</a>:""}
{this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr"
onClick={()=>this.showAppraiseModal()}
onClick={()=>this.showAppraiseModal("main")}
>编辑</a>:""}
</div>

@ -29,7 +29,9 @@ class OfficialAcademicTranscript extends Component {
elapsedtime:item.time_consuming,
empvalue:{myself:item.myself_experience,experience:item.experience},
game_scores:{game_score:item.game_score,game_score_full:item.game_score_full},
challenge_id:{id:item.challenge_id}
challenge_id:{id:item.challenge_id},
challenge_comment: item.challenge_comment,
challenge_comment_hidden: item.challenge_comment_hidden,
// adjustmentminute:asdasd
})
})
@ -205,9 +207,10 @@ class OfficialAcademicTranscript extends Component {
render: (text, record) => (
<span>
{console.log(record)}
<a
className=" color-blue font-14 fr mr22"
onClick={()=>this.props.showAppraiseModal(1)}
onClick={()=>this.props.showAppraiseModal("child",record.challenge_id.id,record.challenge_comment,record.challenge_comment_hidden)}
>评阅</a>
</span>
),

@ -10,7 +10,7 @@
resize:none; /*禁止拉伸*/
border: none; /*去掉默认边框*/
width: 100%;
height:150px;
height:130px;
border:none;
display: block;
}
@ -26,7 +26,7 @@
border: 1px solid rgba(234,234,234,1);
border-radius: 0.125rem;
margin: 10px 10px 0px 10px;
padding: 10px 10px 5px 10px
padding: 10px 10px 5px 10px;
backgroud:rgba(234,234,234,1);
}
.WordNumberTextarea-count {

Loading…
Cancel
Save