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){
debugger
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{
this.props.showNotification(response.data.message)
}

@ -157,7 +157,7 @@ class ShixunWorkReport extends Component {
showAppraiseModal=(type,id,show,hidden)=>{
let{data}=this.state;
debugger
if(type==="child"){
data.stage_list.forEach((item,key)=>{
if(item.challenge_id===id){
@ -188,17 +188,17 @@ class ShixunWorkReport extends Component {
showAppraiseModaltype:false,
})
}
showAppraiseModals=(show,hidden,id)=>{
showAppraiseModals=(show,hidden,id,comment_id)=>{
let{data,showAppraisetype}=this.state;
debugger
if(showAppraisetype==="child"){
data.stage_list.forEach((item,key)=>{
if(item.challenge_id===id){
item.challenge_comment=show;
item.challenge_comment_hidden=hidden;
item.challenge_id=id;
item.comment_id=comment_id
}
})
this.setState({
@ -206,7 +206,7 @@ class ShixunWorkReport extends Component {
data:data
})
}else{
data.comment_id=id
data.comment_id=comment_id;
this.setState({
showAppraiseModaltype:false,
work_comment:show,
@ -216,11 +216,11 @@ class ShixunWorkReport extends Component {
}
}
isdeleteModal=(comment_id,visible_comment)=>{
isdeleteModal=(comment_id,visible_comment,type)=>{
this.setState({
modalsType: true,
modalsTopval:"是否确认删除?",
modalSave: ()=>this.isdeleteModals(comment_id,visible_comment),
modalSave: ()=>this.isdeleteModals(comment_id,visible_comment,type),
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;
if(showAppraisetype==="child"){
data.stage_list.forEach((item,key)=>{
if(item.comment_id===comment_id){
if(visible_comment===true){
let{data,work_comment,work_comment_hidden}=this.state;
if(type==="child"){
data.stage_list.map((item,key)=>{
console.log(item)
if(item.comment_id!=null){
if(item.comment_id===comment_id){
item.challenge_comment=null;
}else{
item.challenge_comment_hidden=null;
}
}
})
this.setState({
modalsType:false,
modalsTopval:"是否确认删除?",
@ -256,40 +258,36 @@ class ShixunWorkReport extends Component {
modalCancel:"",
data:data
})
}else{
if(visible_comment===true){
this.setState({
modalsType:false,
modalsTopval:"是否确认删除?",
modalSave: "",
modalCancel:"",
work_comment:visible_comment===true?null:work_comment,
})
}else{
this.setState({
modalsType:false,
modalsTopval:"是否确认删除?",
modalSave: "",
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`
axios.delete(url, { data: {
comment_id:comment_id,
visible_comment:visible_comment
}}).then((response) => {
// const { status } = response.data;
if(response.data.status===0){
this.props.showNotification(response.data.message)
this.hideisdeleteModal(comment_id,visible_comment)
this.hideisdeleteModal(newcomment_id,newvisible_comment,newtype)
}else{
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=work_comment===null||work_comment===undefined?false:true;
console.log(data)
console.log(work_comment_hidden)
console.log(work_comment)
return (
data===undefined?"":<Spin indicator={antIcon} spinning={this.state.spinning}>
@ -329,7 +325,7 @@ class ShixunWorkReport extends Component {
{...this.state}
visible={showAppraiseModaltype}
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_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
{...this.props}
{...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)}
/>

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

Loading…
Cancel
Save