From 638d76ac27bf91c17c2c9eacc5f57710d71b857e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 24 Sep 2019 16:34:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/exercise/ExerciseListItem.js | 47 ++++++++++++++++--- .../graduation/topics/GraduateTopicItem.js | 1 + .../src/modules/courses/poll/PollListItem.js | 38 ++++++++++++++- 3 files changed, 78 insertions(+), 8 deletions(-) diff --git a/public/react/src/modules/courses/exercise/ExerciseListItem.js b/public/react/src/modules/courses/exercise/ExerciseListItem.js index f61a7852b..1585b61ba 100644 --- a/public/react/src/modules/courses/exercise/ExerciseListItem.js +++ b/public/react/src/modules/courses/exercise/ExerciseListItem.js @@ -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} >:""} + {isRender===true?this.Modifyloginvalue()} + {...this.props} + {...this.state} + />:""}