dev_newshixunModel
杨树林 5 years ago
parent 56665203d5
commit 638d76ac27

@ -10,14 +10,15 @@ import { formatDuring ,handleDateString} from 'educoder';
import '../css/members.css';
import '../css/busyWork.css';
import CourseLayoutcomponent from "./Exercise";
import LoginDialog from '../../login/LoginDialog';
const dataformat="YYYY-MM-DD HH:mm";
const polls_status={1:"未发布",2:"提交中",3:"已截止",4:"已结束"}
class ExerciseListItem extends Component{
constructor(props){
super(props);
this.state={
Modalstype:false
Modalstype:false,
isRender:false,
}
}
@ -40,7 +41,30 @@ class ExerciseListItem extends Component{
})
}
};
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
};
cancelmodel=()=>{
this.setState({
@ -52,6 +76,7 @@ class ExerciseListItem extends Component{
})
}
render(){
let {isRender}=this.state;
let{item,checkBox,index}=this.props;
let {coursesId,Id}=this.props.match.params
const IsAdmin =this.props.isAdmin();
@ -76,6 +101,11 @@ class ExerciseListItem extends Component{
modalSave={this.state.ModalSave}
antIcon={this.state.Modalstypeloding}
></Modals>:""}
{isRender===true?<LoginDialog
Modifyloginvalue={()=>this.Modifyloginvalue()}
{...this.props}
{...this.state}
/>:""}
<style>
{
`
@ -96,20 +126,25 @@ class ExerciseListItem extends Component{
{/*<Link to={`/courses/${coursesId}/exercises/${item.id}/exercises/student_exercise_list?tab=0`} className="fl font-16 font-bd mt2 color-grey-3 task-hide" style={{"maxWidth":"600px"}}>{item.exercise_name}</Link>*/}
{
this.props.isAdmin()? <Link className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580"
this.props.isAdmin()? <a onClick={()=>this.showfiles(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}
className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580"
title={item.exercise_name}
to={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`}>{item.exercise_name}</Link>:""
>{item.exercise_name}</a>:""
}
{
this.props.isStudent()?
<Link className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580" title={item.exercise_name} to={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`}>{item.exercise_name}</Link>:""
<a className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580" title={item.exercise_name}
onClick={()=>this.showfiles(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}
>{item.exercise_name}</a>:""
}
{
this.props.isNotMember()? item.lock_status === 0 ?
<span className="fl mt3 font-16 font-bd color-dark comnonwidth580" title={item.exercise_name}>{item.exercise_name}</span>
: <Link className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580" title={item.exercise_name} to={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`}>{item.exercise_name}</Link>:""
: <a className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580" title={item.exercise_name}
onClick={()=>this.showfiles(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}
>{item.exercise_name}</a>:""
}
{

@ -103,6 +103,7 @@ class GraduateTopicItem extends Component{
{
isNotMember?
<a
onClick={() => this.toDetailPage(`${discussMessage.id}`)}
className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
}

@ -6,6 +6,7 @@ import CoursesListType from '../coursesPublic/CoursesListType';
import { WordsBtn,formatDuring } from 'educoder';
import '../css/members.css';
import '../css/busyWork.css';
import LoginDialog from '../../login/LoginDialog';
const polls_status={1:"未发布",2:"提交中",3:"已截止",4:"已结束"}
@ -14,8 +15,34 @@ const dataformat="YYYY-MM-DD HH:mm";
class PollListItem extends Component{
constructor(props){
super(props);
this.state={
isRender: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{isRender}=this.state;
let{item,checkBox,courseType,index}=this.props;
let {coursesId}=this.props.match.params;
@ -35,10 +62,17 @@ class PollListItem extends Component{
{checkBox}
</span>
}
{isRender===true?<LoginDialog
Modifyloginvalue={()=>this.Modifyloginvalue()}
{...this.props}
{...this.state}
/>:""}
<div className="flex1 pr">
<p className="clearfix mb30">
{ canNotLink ? <a className="fl font-16 font-bd mt2 color-grey-3 task-hide" style={{"maxWidth":"600px", "cursor": "default"}} title={item.polls_name}>{item.polls_name}</a> :
<Link to={`/courses/${coursesId}/polls/${item.id}/detail`} className="fl font-16 font-bd mt2 color-grey-3 task-hide" style={{"maxWidth":"600px"}} title={item.polls_name}>{item.polls_name}</Link>
{ canNotLink ? <a className="fl font-16 font-bd mt2 color-grey-3 task-hide" onClick={()=>this.showfiles(`/courses/${coursesId}/polls/${item.id}/detail`)} style={{"maxWidth":"600px", "cursor": "default"}} title={item.polls_name}>{item.polls_name}</a> :
<a
onClick={()=>this.showfiles(`/courses/${coursesId}/polls/${item.id}/detail`)}
className="fl font-16 font-bd mt2 color-grey-3 task-hide" style={{"maxWidth":"600px"}} title={item.polls_name}>{item.polls_name}</a>
}
{
item.lock_status === 0 ?

Loading…
Cancel
Save