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

dev_cs
hjm 5 years ago
commit 2945cd4e16

@ -74,7 +74,7 @@ class AppraiseModal extends Component{
if(response.data.status===0){ if(response.data.status===0){
debugger debugger
this.props.showNotification(response.data.message) this.props.showNotification(response.data.message)
this.props.showCancel(comment,hidden_comment,response.data.comment_id) this.props.showCancel(comment,hidden_comment,challenge_id,response.data.comment_id)
}else{ }else{
this.props.showNotification(response.data.message) this.props.showNotification(response.data.message)
} }

@ -157,7 +157,7 @@ class ShixunWorkReport extends Component {
showAppraiseModal=(type,id,show,hidden)=>{ showAppraiseModal=(type,id,show,hidden)=>{
let{data}=this.state; let{data}=this.state;
debugger
if(type==="child"){ if(type==="child"){
data.stage_list.forEach((item,key)=>{ data.stage_list.forEach((item,key)=>{
if(item.challenge_id===id){ if(item.challenge_id===id){
@ -188,17 +188,17 @@ class ShixunWorkReport extends Component {
showAppraiseModaltype:false, showAppraiseModaltype:false,
}) })
} }
showAppraiseModals=(show,hidden,id)=>{ showAppraiseModals=(show,hidden,id,comment_id)=>{
let{data,showAppraisetype}=this.state; let{data,showAppraisetype}=this.state;
debugger
if(showAppraisetype==="child"){ if(showAppraisetype==="child"){
data.stage_list.forEach((item,key)=>{ data.stage_list.forEach((item,key)=>{
if(item.challenge_id===id){ if(item.challenge_id===id){
item.challenge_comment=show; item.challenge_comment=show;
item.challenge_comment_hidden=hidden; item.challenge_comment_hidden=hidden;
item.challenge_id=id; item.comment_id=comment_id
} }
}) })
this.setState({ this.setState({
@ -206,7 +206,7 @@ class ShixunWorkReport extends Component {
data:data data:data
}) })
}else{ }else{
data.comment_id=id data.comment_id=comment_id;
this.setState({ this.setState({
showAppraiseModaltype:false, showAppraiseModaltype:false,
work_comment:show, work_comment:show,
@ -216,11 +216,11 @@ class ShixunWorkReport extends Component {
} }
} }
isdeleteModal=(comment_id,visible_comment)=>{ isdeleteModal=(comment_id,visible_comment,type)=>{
this.setState({ this.setState({
modalsType: true, modalsType: true,
modalsTopval:"是否确认删除?", modalsTopval:"是否确认删除?",
modalSave: ()=>this.isdeleteModals(comment_id,visible_comment), modalSave: ()=>this.isdeleteModals(comment_id,visible_comment,type),
modalCancel:()=>this.hideisdeleteModals(), modalCancel:()=>this.hideisdeleteModals(),
}) })
} }
@ -235,20 +235,22 @@ class ShixunWorkReport extends Component {
} }
hideisdeleteModal=(comment_id,visible_comment)=>{ hideisdeleteModal=(comment_id,visible_comment,type)=>{
let{data,work_comment,work_comment_hidden,showAppraisetype}=this.state; let{data,work_comment,work_comment_hidden}=this.state;
if(showAppraisetype==="child"){
data.stage_list.forEach((item,key)=>{ if(type==="child"){
if(item.comment_id===comment_id){ data.stage_list.map((item,key)=>{
if(visible_comment===true){ console.log(item)
if(item.comment_id!=null){
if(item.comment_id===comment_id){
item.challenge_comment=null; item.challenge_comment=null;
}else{
item.challenge_comment_hidden=null; item.challenge_comment_hidden=null;
} }
} }
}) })
this.setState({ this.setState({
modalsType:false, modalsType:false,
modalsTopval:"是否确认删除?", modalsTopval:"是否确认删除?",
@ -256,40 +258,36 @@ class ShixunWorkReport extends Component {
modalCancel:"", modalCancel:"",
data:data data:data
}) })
}else{ }else{
if(visible_comment===true){
this.setState({
modalsType:false,
modalsTopval:"是否确认删除?",
modalSave: "",
modalCancel:"",
work_comment:visible_comment===true?null:work_comment,
})
}else{
this.setState({ this.setState({
modalsType:false, modalsType:false,
modalsTopval:"是否确认删除?", modalsTopval:"是否确认删除?",
modalSave: "", modalSave: "",
modalCancel:"", modalCancel:"",
work_comment_hidden:visible_comment===false?null:work_comment_hidden work_comment:null,
work_comment_hidden:null
}) })
}
} }
} }
isdeleteModals=(comment_id,visible_comment)=>{ isdeleteModals=(comment_id,visible_comment,type)=>{
let newcomment_id=comment_id;
let newvisible_comment=visible_comment;
let newtype=type;
let url =`/student_works/${this.props.match.params.homeworkid}/destroy_work_comment.json` let url =`/student_works/${this.props.match.params.homeworkid}/destroy_work_comment.json`
axios.delete(url, { data: { axios.delete(url, { data: {
comment_id:comment_id, comment_id:comment_id,
visible_comment:visible_comment
}}).then((response) => { }}).then((response) => {
// const { status } = response.data; // const { status } = response.data;
if(response.data.status===0){ if(response.data.status===0){
this.props.showNotification(response.data.message) this.props.showNotification(response.data.message)
this.hideisdeleteModal(newcomment_id,newvisible_comment,newtype)
this.hideisdeleteModal(comment_id,visible_comment)
}else{ }else{
this.props.showNotification(response.data.message) this.props.showNotification(response.data.message)
} }
@ -308,9 +306,7 @@ class ShixunWorkReport extends Component {
// let showAppraiseModals=this.props&&this.props.isAdminOrTeacher()===true?work_comment===null||work_comment===undefined?false:true:work_comment===null||work_comment===undefined?false:true; // let showAppraiseModals=this.props&&this.props.isAdminOrTeacher()===true?work_comment===null||work_comment===undefined?false:true:work_comment===null||work_comment===undefined?false:true;
let showAppraiseModals=work_comment===null||work_comment===undefined?false:true; let showAppraiseModals=work_comment===null||work_comment===undefined?false:true;
console.log(data)
console.log(work_comment_hidden)
console.log(work_comment)
return ( return (
data===undefined?"":<Spin indicator={antIcon} spinning={this.state.spinning}> data===undefined?"":<Spin indicator={antIcon} spinning={this.state.spinning}>
@ -329,7 +325,7 @@ class ShixunWorkReport extends Component {
{...this.state} {...this.state}
visible={showAppraiseModaltype} visible={showAppraiseModaltype}
Cancel={()=>this.hideAppraiseModal()} Cancel={()=>this.hideAppraiseModal()}
showCancel={(show,hidden,id)=>this.showAppraiseModals(show,hidden,id)} showCancel={(show,hidden,id,comment_id)=>this.showAppraiseModals(show,hidden,id,comment_id)}
work_comment={this.state.work_comment} work_comment={this.state.work_comment}
work_type={work_comment===null||work_comment===undefined?this.state.work_type:work_comment_hidden===true?1:0} work_type={work_comment===null||work_comment===undefined?this.state.work_type:work_comment_hidden===true?1:0}
/>:""} />:""}
@ -551,7 +547,7 @@ class ShixunWorkReport extends Component {
<ShowAppraiseList <ShowAppraiseList
{...this.props} {...this.props}
{...this.state} {...this.state}
isdeleteModal={(comment_id,visible_comment)=>this.isdeleteModal(comment_id,visible_comment)} isdeleteModal={(comment_id,visible_comment,type)=>this.isdeleteModal(comment_id,visible_comment,type)}
showAppraiseModal={(type,id,show,hidden)=>this.showAppraiseModal(type,id,show,hidden)} showAppraiseModal={(type,id,show,hidden)=>this.showAppraiseModal(type,id,show,hidden)}
/> />

@ -11,16 +11,12 @@ class ShowAppraiseList extends Component{
} }
} }
componentDidMount() {
}
render(){ render(){
let {data,work_comment,work_comment_hidden}=this.props; let {data, work_comment,work_comment_hidden}=this.props;
console.log(data) let work_commenttype=work_comment===undefined||work_comment===null||work_comment==="";
let work_comment_hiddentype=work_comment===undefined||work_comment===null||work_comment==="";
return( return(
<div> <div>
<style> <style>
@ -38,10 +34,18 @@ class ShowAppraiseList extends Component{
text-align: center; text-align: center;
line-height: 22px; line-height: 22px;
} }
.666w{
color: #666;
font-size:14px;
}
.000w{
color: #000;
font-size:15px;
}
` `
} }
</style> </style>
{data===undefined?"":work_comment===undefined||work_comment===null||work_comment===""?"": {data===undefined?"":work_commenttype===true&&work_comment_hiddentype===true?"":
<div className="stud-class-set mt17"> <div className="stud-class-set mt17">
<div className="clearfix edu-back-white poll_list"> <div className="clearfix edu-back-white poll_list">
@ -49,7 +53,7 @@ class ShowAppraiseList extends Component{
<span className={"appraisebox"}>总体评阅</span> <span className={"appraisebox"}>总体评阅</span>
{this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr ml20" {this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr ml20"
onClick={()=>this.props.isdeleteModal(data.comment_id,true)} onClick={()=>this.props.isdeleteModal(data.comment_id,true,"main")}
>删除</a>:""} >删除</a>:""}
{this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr" {this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr"
@ -58,103 +62,92 @@ class ShowAppraiseList extends Component{
</div> </div>
<div className="font-16 color-dark-21 shixunreporttitleboxbom pd30"> {this.props&&this.props.isAdminOrTeacher()===true?
<div className="font-16 color-dark-21 shixunreporttitleboxbom pd30">
<div>
<span className={"000w"}>学生不可见<span className={"666w"}>仅对课堂老师可见</span></span>
</div>
<div style={{minHeight:'50px'}}>
{work_comment_hidden===true?"":<div className={"personalsummary"}>
<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(work_comment_hidden).replace(/▁/g, "▁▁▁")}}></div>
</div>}
</div>
<div>
<span className={"000w"}>学生可见<span className={"666w"}>学生可查看老师的评阅内容</span></span>
</div>
<div style={{minHeight:'50px'}}> <div style={{minHeight:'50px'}}>
<div className={"personalsummary"}> {work_comment===true?"":<div className={"personalsummary"}>
<div className={"markdown-body"} <div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(work_comment).replace(/▁/g, "▁▁▁")}}></div> dangerouslySetInnerHTML={{__html: markdownToHTML(work_comment).replace(/▁/g, "▁▁▁")}}></div>
</div> </div>}
</div> </div>
</div>
</div>
</div>}
{data===undefined?"":work_comment_hidden===undefined||work_comment_hidden===null||work_comment_hidden===""?"":this.props&&this.props.isAdminOrTeacher()===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">
<span className={"appraisebox"}>总体评阅</span><span></span>
{this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr ml20"
onClick={()=>this.props.isdeleteModal(data.comment_id,false)}
>删除</a>:""}
{this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr"
onClick={()=>this.props.showAppraiseModal("main",undefined,work_comment,work_comment_hidden)}
>编辑</a>:""}
</div>
<div className="font-16 color-dark-21 shixunreporttitleboxbom pd30"> </div>:<div className="font-16 color-dark-21 shixunreporttitleboxbom pd30">
<div style={{minHeight:'50px'}}> <div style={{minHeight:'50px'}}>
<div className={"personalsummary"}> <div className={"personalsummary"}>
<div className={"markdown-body"} <div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(work_comment_hidden).replace(/▁/g, "▁▁▁")}}></div> dangerouslySetInnerHTML={{__html: markdownToHTML(work_comment).replace(/▁/g, "▁▁▁")}}></div>
</div> </div>
</div> </div>
</div> </div>}
</div> </div>
</div>:""} </div>}
{data===undefined?"":data.stage_list.map((item,key)=>{ {data===undefined?"":data.stage_list.map((item,key)=>{
let challenge_comment_hidden=item.challenge_comment_hidden===undefined||item.challenge_comment_hidden===null||item.challenge_comment_hidden===""; let challenge_comment_hidden=item.challenge_comment_hidden===undefined||item.challenge_comment_hidden===null||item.challenge_comment_hidden==="";
let challenge_comment=item.challenge_comment===undefined||item.challenge_comment===null||item.challenge_comment===""; let challenge_comment=item.challenge_comment===undefined||item.challenge_comment===null||item.challenge_comment==="";
return( return(
<div> <div key={key}>
{challenge_comment===false?<div className="stud-class-set mt17" key={key}> {challenge_comment===false&&challenge_comment_hidden==false?<div className="stud-class-set mt17" >
<div className="clearfix edu-back-white poll_list"> <div className="clearfix edu-back-white poll_list">
<div className="font-16 color-dark-21 shixunreporttitleboxtop pd20 color333"> <div className="font-16 color-dark-21 shixunreporttitleboxtop pd20 color333">
<span className={"appraisebox"}>{key+1}</span> <span className={"appraisebox"}>{key+1}</span>{item.name}
{this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr ml20" {this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr ml20"
onClick={()=>this.props.isdeleteModal(item.comment_id,true)} onClick={()=>this.props.isdeleteModal(item.comment_id,true,"child")}
>删除</a>:""} >删除</a>:""}
{this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr" {this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr"
onClick={()=>this.props.showAppraiseModal("child",item.challenge_id,item.challenge_comment,item.challenge_comment_hidden)} onClick={()=>this.props.showAppraiseModal("child",item.challenge_id,item.challenge_comment,item.challenge_comment_hidden)}
>编辑</a>:""} >编辑</a>:""}
</div> </div>
<div className="font-16 color-dark-21 shixunreporttitleboxbom pd30">
<div style={{minHeight:'50px'}}>
<div className={"personalsummary"}>
<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment).replace(/▁/g, "▁▁▁")}}></div>
</div>
</div>
</div>
</div>
</div>:""}
{challenge_comment_hidden===false&&this.props&&this.props.isAdminOrTeacher()===true?<div className="stud-class-set mt17" key={key}> {this.props&&this.props.isAdminOrTeacher()===true?
<div className="clearfix edu-back-white poll_list"> <div className="font-16 color-dark-21 shixunreporttitleboxbom pd30">
<div className="font-16 color-dark-21 shixunreporttitleboxtop pd20 color333"> <div>
<span className={"appraisebox"}>{key+1}</span><span></span> <span className={"000w"}>学生不可见<span className={"666w"}>仅对课堂老师可见</span></span>
</div>
{this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr ml20" <div style={{minHeight:'50px'}}>
onClick={()=>this.props.isdeleteModal(item.comment_id,false)} {challenge_comment_hidden===true?"":<div className={"personalsummary"}>
>删除</a>:""} <div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment_hidden).replace(/▁/g, "▁▁▁")}}></div>
</div>}
</div>
<div>
<span className={"000w"}>学生可见<span className={"666w"}>学生可查看老师的评阅内容</span></span>
</div>
<div style={{minHeight:'50px'}}>
{challenge_comment===true?"":<div className={"personalsummary"}>
<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment).replace(/▁/g, "▁▁▁")}}></div>
</div>}
</div>
{this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr" </div>: <div className="font-16 color-dark-21 shixunreporttitleboxbom pd30">
onClick={()=>this.props.showAppraiseModal("child",item.challenge_id,item.challenge_comment,item.challenge_comment_hidden)} <div style={{minHeight:'50px'}}>
>编辑</a>:""} <div className={"personalsummary"}>
</div> <div className={"markdown-body"}
<div className="font-16 color-dark-21 shixunreporttitleboxbom pd30"> dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment).replace(/▁/g, "▁▁▁")}}></div>
<div style={{minHeight:'50px'}}> </div>
<div className={"personalsummary"}>
<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(item.challenge_comment_hidden).replace(/▁/g, "▁▁▁")}}></div>
</div> </div>
</div> </div>}
</div>
</div> </div>
</div>:""} </div>:""}

Loading…
Cancel
Save