import React,{ Component } from "react"; import CoursesListType from '../../coursesPublic/CoursesListType'; import { WordsBtn } from 'educoder' import {Tooltip} from 'antd' import axios from 'axios' import LoginDialog from "../../../login/LoginDialog"; const map={0:"待选中",1:"待确认",2:"已确认"} class GraduateTopicItem extends Component{ constructor(props){ super(props); this.state = { isRender:false, } } editTopic=(topicId)=>{ let courseId=this.props.match.params.coursesId; this.props.history.push(`/courses/${courseId}/graduation_topics/${topicId}/edit`); } toDetailPage=(topicId)=>{ // console.log("toDetailPage"); // console.log(this.props); try { if(this.props.current_user.username==="游客"){ this.setState({ isRender:true, match:"", }); return } }catch (e) { } let courseId=this.props.match.params.coursesId; this.props.history.push(`/courses/${courseId}/graduation_topics/${topicId}/detail`); }; Modifyloginvalue=()=>{ this.setState({ isRender:false, }) }; render(){ const { checkBox, discussMessage, index,chooseTopic, data, courseId } = this.props; const { isRender }=this.state; const isAdmin = this.props.isAdmin(); const isStudent=this.props.isStudent(); const isNotMember=this.props.isNotMember(); if (!discussMessage || !discussMessage.author) { return ''; } return(
{isRender===true?this.Modifyloginvalue()} {...this.props} {...this.state} />:""}
window.$(`.topicItem${index} input`).click() }> { isAdmin ? {checkBox} : ""}
{ isNotMember? this.toDetailPage(`${discussMessage.id}`)} className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}:"" } { isStudent? this.toDetailPage(`${discussMessage.id}`)} className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}:"" } { isAdmin? this.toDetailPage(`${discussMessage.id}`)} className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}:"" } { discussMessage.private_icon===true? :"" }

{discussMessage.author} {discussMessage.selected_count} 已选 {discussMessage.confirmation_count} 已确认 { isAdmin && this.editTopic(`${discussMessage.id}`)} style="blue" className="font-16">编辑 } { isStudent && data.user_selected == true && discussMessage.user_topic_status==0 && chooseTopic(`${discussMessage.id}`,index,true)} style="blue" className="font-16"> 取消选题 } { isStudent && data.user_selected==false && (discussMessage.user_topic_status == null || discussMessage.user_topic_status == 2) && chooseTopic(`${discussMessage.id}`,index,false)} style="blue" className="font-16"> 选题 }

) } } export default GraduateTopicItem;