Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_hss
杨树林 6 years ago
commit 45152b2420

@ -32,7 +32,7 @@ module.exports = {
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s
// devtool: "cheap-module-eval-source-map",
// 开启调试
// devtool: "source-map", // 开启调试
devtool: "source-map", // 开启调试
// These are the "entry points" to our application.
// This means they will be the "root" imports that are included in JS bundle.
// The first two entry points enable "hot" CSS and auto-refreshes for JS.

@ -11,11 +11,20 @@ class AppraiseModal extends Component{
fileList:[],
textareaval:undefined,
Inputsval:undefined,
valuetype:1,
valuetype:0,
textareavaltype:false
}
}
componentDidMount() {
this.setState({
valuetype:this.props.work_type===undefined?0:this.props.work_type,
textareaval:this.props.work_comment,
})
}
onChanges=(e)=>{
this.setState({
valuetype:e.target.value
@ -30,7 +39,6 @@ class AppraiseModal extends Component{
Saves=()=>{
let{textareaval,valuetype}=this.state;
let newvaluetype=valuetype===1?false:true;
if(textareaval===undefined||textareaval===null||textareaval===""){
this.setState({
@ -42,11 +50,11 @@ class AppraiseModal extends Component{
let url=`/student_works/${this.props.match.params.homeworkid}/shixun_work_comment.json`
axios.post(url, {
comment:textareaval,
is_hidden:newvaluetype
is_hidden:valuetype
}).then((response) => {
if(response.data.status===0){
this.props.showNotification(response.data.message)
this.props.Cancel()
this.props.showCancel(textareaval,valuetype)
}else{
this.props.showNotification(response.data.message)
}
@ -62,6 +70,7 @@ class AppraiseModal extends Component{
height: '30px',
lineHeight: '30px',
};
return(
<div>
<Modal
@ -107,8 +116,8 @@ class AppraiseModal extends Component{
权限
</p>
<Radio.Group onChange={this.onChanges} value={this.state.valuetype}>
<Radio value={1} style={radioStyle} className={"newfont"}>可见 (学生查看老师的评阅内容</Radio>
<Radio value={2} style={radioStyle} className={"newfont"}>不可见 (仅对课堂老师可见</Radio>
<Radio value={0} style={radioStyle} className={"newfont"}>可见 (学生查看老师的评阅内容</Radio>
<Radio value={1} style={radioStyle} className={"newfont"}>不可见 (仅对课堂老师可见</Radio>
</Radio.Group>
<p className={"font mt10 mb20"}>
@ -125,7 +134,7 @@ class AppraiseModal extends Component{
</div>
<div className={textareavaltype===false?"mt20 clearfix edu-txt-center":"clearfix edu-txt-center"}>
<a className="task-btn color-white mr30" onClick={this.props.Cancel()}>{this.props.Cancelname || '取消'}</a>
<a className="task-btn color-white mr30" onClick={()=>this.props.Cancel()}>{this.props.Cancelname || '取消'}</a>
<a className="task-btn task-btn-orange" onClick={this.Saves}>{this.props.Savesname || '确定'}</a>
</div>
</div>

@ -32,7 +32,9 @@ class ShixunWorkReport extends Component {
DownloadMessageval:undefined,
isspinning:false,
showAppraiseModaltype:false,
work_comment_hidden:false
work_comment_hidden:false,
showAppraiseModalsshow:true,
work_comment:null
}
}
@ -104,6 +106,7 @@ class ShixunWorkReport extends Component {
this.setState({
data:result.data,
work_comment_hidden:result.data.work_comment_hidden,
work_comment:result.data.work_comment,
spinning:false
})
}
@ -151,25 +154,40 @@ class ShixunWorkReport extends Component {
}
showAppraiseModal=()=>{
debugger
this.setState({
showAppraiseModaltype:true
})
}
hideAppraiseModal=()=>{
let{data}=this.state;
let{data,work_comment}=this.state;
this.setState({
showAppraiseModaltype:false,
work_comment_hidden:data&&data.work_comment_hidden===true?true:data&&data.work_description!=null?true:false,
work_comment_hidden:data&&data.work_comment_hidden===true?true:work_comment!=null?true:false,
})
}
showAppraiseModals=(list,type)=>{
let{data,work_comment}=this.state;
this.setState({
showAppraiseModaltype:false,
work_comment_hidden:data&&data.work_comment_hidden===true?true:work_comment!=null?true:false,
work_comment:list,
work_type:type,
showAppraiseModals:true,
showAppraiseModalsshow:true
})
}
isdeleteModal=()=>{
let url =`/student_works/${this.props.match.params.homeworkid}/destroy_work_comment.json`
axios.delete(url).then((response) => {
// const { status } = response.data;
if(response.data.status===0){
this.props.showNotification(response.data.message)
this.setState({
showAppraiseModalsshow:false,
work_comment_hidden:false
})
}else{
this.props.showNotification(response.data.message)
}
@ -179,14 +197,14 @@ class ShixunWorkReport extends Component {
});
}
render() {
let{data,showAppraiseModaltype,work_comment_hidden} =this.state;
let{data,showAppraiseModaltype,work_comment_hidden,showAppraiseModalsshow,work_comment} =this.state;
let category_id=data===undefined?"":data.category===null?"":data.category.category_id;
let homework_common_id=data===undefined?"":data.homework_common_id;
let homeworkid=this.props.match.params.homeworkid;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
let showAppraiseModals=this.props&&this.props.isAdminOrTeacher()===true?work_comment_hidden===true?true:false:data&&data.work_description===null?false:true;
let showAppraiseModals=this.props&&this.props.isAdminOrTeacher()===true?work_comment_hidden===true?true:false:work_comment===null?false:true;
return (
@ -197,6 +215,9 @@ class ShixunWorkReport extends Component {
{...this.state}
visible={showAppraiseModaltype}
Cancel={()=>this.hideAppraiseModal()}
showCancel={(list,type)=>this.showAppraiseModals(list,type)}
work_comment={this.state.work_comment}
work_type={this.state.work_type}
/>:""}
<div className="newMain clearfix ">
<div className={"educontent mb20" }>
@ -395,7 +416,7 @@ class ShixunWorkReport extends Component {
</div>
{showAppraiseModals===true?<div className="stud-class-set mt17">
{showAppraiseModals===true&&showAppraiseModalsshow===true?<div className="stud-class-set mt17">
<div className="clearfix edu-back-white poll_list">
<div className="font-16 color-dark-21 shixunreporttitleboxtop pd20 color333">
@ -415,7 +436,7 @@ class ShixunWorkReport extends Component {
<div style={{minHeight:'50px'}}>
<div className={"personalsummary"}>
<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(data&&data.work_description).replace(/▁/g, "▁▁▁")}}></div>
dangerouslySetInnerHTML={{__html: markdownToHTML(work_comment).replace(/▁/g, "▁▁▁")}}></div>
</div>
</div>
</div>

@ -14,7 +14,7 @@ render() {
onInput={(e)=>this.props.onInput(e)}
maxlength={this.props.maxlength}
/>
<div className="WordNumberTextarea-count"><span>{this.props.value===undefined?0:this.props.value.length}</span>/{this.props.maxlength}</div>
<div className="WordNumberTextarea-count"><span>{this.props.value===undefined||this.props.value===null?0:this.props.value.length}</span>/{this.props.maxlength}</div>
</div>
)
}

Loading…
Cancel
Save