dev_newshixunModel
杨树林 5 years ago
parent 212362384d
commit a11da1841a

@ -21,16 +21,16 @@ let hashTimeout
// TODO 开发期多个身份切换
let debugType =""
if (isDev) {
const _search = window.location.search;
let parsed = {};
if (_search) {
parsed = queryString.parse(_search);
}
debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
window.location.search.indexOf('debug=s') != -1 ? 'student' :
window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin'
}
// if (isDev) {
// const _search = window.location.search;
// let parsed = {};
// if (_search) {
// parsed = queryString.parse(_search);
// }
// debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
// window.location.search.indexOf('debug=s') != -1 ? 'student' :
// window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin'
// }
window._debugType = debugType;
export function initAxiosInterceptors(props) {

@ -194,6 +194,9 @@ class Fileslistitem extends Component{
text-overflow:ellipsis;
white-space:nowrap
}
.fileslistitemsA{
}
`}</style>
<div className="clearfix ds pr contentSection" style={{cursor : this.props.isAdmin ? "pointer" : "default"}} onClick={() => window.$(`.sourceitem${index} input`).click() }>
<h6 onClick={(event)=>this.eventStop(event)}>
@ -205,23 +208,23 @@ class Fileslistitem extends Component{
// href={"/courses/" + coursesId + "/graduation/graduation_tasks/" + categoryid + "/" + taskid + "/list"}
onClick={()=>this.showfiles(discussMessage)}
title={discussMessage.title}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title}</a> : ""
className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title}</a> : ""
}
{
this.props.isStudent? <a
onClick={()=>this.showfiles(discussMessage)}
title={discussMessage.title}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title}</a> :""
className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title}</a> :""
}
{
this.props.isNotMember===true?
discussMessage.is_lock === true ?
<span className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title}</span>
<span className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title}</span>
:<a
onClick={()=>this.showfiles(discussMessage)}
title={discussMessage.title}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title}</a>:""
className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title}</a>:""
}

@ -211,26 +211,31 @@ class GraduateTaskItem extends Component{
text-overflow:ellipsis;
white-space:nowrap
}
.graduatetaskitemA{
}
`}</style>
<h6>
{
this.props.isAdmin?<Link to={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/list"}
this.props.isAdmin?<Link
to={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/list"}
title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
}
{
this.props.isStudent? <Link to={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/list"}
this.props.isStudent? <Link
to={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/list"}
title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
}
{
this.props.isNotMember===true?this.props.discussMessage.private_icon===true?
<span className="fl mt3 font-16 font-bd color-dark maxwidth580" title={discussMessage.name}>{discussMessage.name}</span>
:<a href={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/"+taskid+"/list"}
<span className=" fl mt3 font-16 font-bd color-dark maxwidth580" title={discussMessage.name}>{discussMessage.name}</span>
:<a
href={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/"+taskid+"/list"}
title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
}

@ -67,19 +67,24 @@ class GraduateTopicItem extends Component{
text-overflow:ellipsis;
white-space:nowrap
}
.GraduateTopicItemA{
}
`}</style>
<h6>
{
isNotMember?
<a className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
<a
className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
}
{
isStudent?<a onClick={() => this.toDetailPage(`${discussMessage.id}`)}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
isStudent?<a
onClick={() => this.toDetailPage(`${discussMessage.id}`)}
className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
}
{
isAdmin?<a onClick={() => this.toDetailPage(`${discussMessage.id}`)} className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
isAdmin?<a
onClick={() => this.toDetailPage(`${discussMessage.id}`)} className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
}
{
discussMessage.private_icon===true?

@ -181,9 +181,7 @@ class ShixunHomeworkPage extends Component {
const isAdmin = this.props.isAdmin();
// console.log(119)
console.log(jobsettingsdatapage);
// console.log(jobsettingsdatapage);
return (
<div className="newMain clearfix ">
<Modals

@ -7,6 +7,7 @@ import axios from 'axios';
import Modals from '../../modals/Modals';
import Associationmodel from '../coursesPublic/Associationmodel';
import ModalsRename from '../coursesPublic/ModalsRename';
import LoginDialog from '../../login/LoginDialog';
// import '../../css/members.css'
import './style.css'
@ -19,7 +20,8 @@ class ShixunhomeWorkItem extends Component{
modalname:"关联项目",
visible:false,
startbtn:false,
code_review:false
code_review:false,
isRender:false,
}
// console.log("获取到this.propssssssssssss")
// console.log(this.props)
@ -142,7 +144,29 @@ class ShixunhomeWorkItem extends Component{
this.setState({
ModalsRenametype:false,
})
};
Modifyloginvalue=()=>{
this.setState({
isRender:false,
})
};
showfiles =(url)=>{
// console.log("ShixunhomeWorkItemshowfiles");
// console.log( this.props.current_user.username);
try {
if(this.props.current_user.username==="游客"){
this.setState({
isRender:true,
match:"",
});
return
}
}catch (e) {
}
this.props.history.push(url);
// this.props.current_user
};
render(){
let {
Modalstype,
@ -158,7 +182,7 @@ class ShixunhomeWorkItem extends Component{
startshixunCombattype,
shixunsmessage,
startbtn,
isRender,
} = this.state;
const { checkBox,
@ -179,6 +203,12 @@ class ShixunhomeWorkItem extends Component{
cannerNavmoda={()=>this.cannerNavmoda()}
/>
:""}
{isRender===true?<LoginDialog
Modifyloginvalue={()=>this.Modifyloginvalue()}
{...this.props}
{...this.state}
/>:""}
<Modals
modalsType={Modalstype}
modalsTopval={Modalstopval}
@ -289,28 +319,31 @@ class ShixunhomeWorkItem extends Component{
text-overflow:ellipsis;
white-space:nowrap
}
.ShixunhomeWorkItemA{
}
`}</style>
<h6>
{/*to={`/courses/${this.props.match.params.coursesId}/${discussMessage.homework_id}/jobsettings`}*/}
{
this.props.isAdmin?<Link to={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+discussMessage.homework_id+"/list?tab=0"}
this.props.isAdmin?<a onClick={()=>this.showfiles("/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+discussMessage.homework_id+"/list?tab=0")}
title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
}
{
this.props.isStudent? <Link to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`}
this.props.isStudent? <a onClick={()=>this.showfiles(`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`)}
title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
}
{
this.props.isNotMember===true? this.props.discussMessage.private_icon===true?
<span className="fl mt3 font-16 font-bd color-dark maxwidth580" title={discussMessage.name}>{discussMessage.name}</span>
: <Link to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`}
<span
className=" fl mt3 font-16 font-bd color-dark maxwidth580" title={discussMessage.name}>{discussMessage.name}</span>
: <a onClick={()=>this.showfiles(`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`)}
title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
}

@ -398,19 +398,19 @@ class LoginDialog extends Component {
});
}
handleDialogClose = () => {
// https://www.trustie.net/issues/24441
// console.log(JSON.stringify(this.props));
// console.log("handleDialogClose");
// console.log(this.props.match);
// if(this.props.match===undefined){
// window.location.href="/";
// }else{
// this.props.history.goBack();
// this.setState({
// isRender:true,
// match:"",
// });
// 上头像上面传个""就不是undefined了 就会不隐藏了
if(this.props.match===undefined){
window.location.href="/";
}else{
this.setState({
isRender: false
});
})
this.props.Modifyloginvalue();
// }
}
// this.setState({
// isRender: false
// })

Loading…
Cancel
Save