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

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

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

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

@ -7,6 +7,7 @@ import axios from 'axios';
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';
import Associationmodel from '../coursesPublic/Associationmodel'; import Associationmodel from '../coursesPublic/Associationmodel';
import ModalsRename from '../coursesPublic/ModalsRename'; import ModalsRename from '../coursesPublic/ModalsRename';
import LoginDialog from '../../login/LoginDialog';
// import '../../css/members.css' // import '../../css/members.css'
import './style.css' import './style.css'
@ -19,7 +20,8 @@ class ShixunhomeWorkItem extends Component{
modalname:"关联项目", modalname:"关联项目",
visible:false, visible:false,
startbtn:false, startbtn:false,
code_review:false code_review:false,
isRender:false,
} }
// console.log("获取到this.propssssssssssss") // console.log("获取到this.propssssssssssss")
// console.log(this.props) // console.log(this.props)
@ -142,7 +144,29 @@ class ShixunhomeWorkItem extends Component{
this.setState({ this.setState({
ModalsRenametype:false, 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(){ render(){
let { let {
Modalstype, Modalstype,
@ -158,7 +182,7 @@ class ShixunhomeWorkItem extends Component{
startshixunCombattype, startshixunCombattype,
shixunsmessage, shixunsmessage,
startbtn, startbtn,
isRender,
} = this.state; } = this.state;
const { checkBox, const { checkBox,
@ -179,6 +203,12 @@ class ShixunhomeWorkItem extends Component{
cannerNavmoda={()=>this.cannerNavmoda()} cannerNavmoda={()=>this.cannerNavmoda()}
/> />
:""} :""}
{isRender===true?<LoginDialog
Modifyloginvalue={()=>this.Modifyloginvalue()}
{...this.props}
{...this.state}
/>:""}
<Modals <Modals
modalsType={Modalstype} modalsType={Modalstype}
modalsTopval={Modalstopval} modalsTopval={Modalstopval}
@ -289,28 +319,31 @@ class ShixunhomeWorkItem extends Component{
text-overflow:ellipsis; text-overflow:ellipsis;
white-space:nowrap white-space:nowrap
} }
.ShixunhomeWorkItemA{
}
`}</style> `}</style>
<h6> <h6>
{/*to={`/courses/${this.props.match.params.coursesId}/${discussMessage.homework_id}/jobsettings`}*/} {/*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} 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} 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? 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> <span
: <Link to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`} 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} 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 = () => { handleDialogClose = () => {
// https://www.trustie.net/issues/24441 // this.setState({
// console.log(JSON.stringify(this.props)); // isRender:true,
// console.log("handleDialogClose"); // match:"",
// console.log(this.props.match); // });
// if(this.props.match===undefined){ // 上头像上面传个""就不是undefined了 就会不隐藏了
// window.location.href="/"; if(this.props.match===undefined){
// }else{ window.location.href="/";
// this.props.history.goBack(); }else{
this.setState({ this.setState({
isRender: false isRender: false
}); })
this.props.Modifyloginvalue(); this.props.Modifyloginvalue();
// } }
// this.setState({ // this.setState({
// isRender: false // isRender: false
// }) // })

Loading…
Cancel
Save