import React,{ Component } from "react"; import '../../css/members.css' import '../../css/busyWork.css' import '../style.css' import axios from "axios"; import GraduateTopicReply from './GraduateTopicReply' import { ConditionToolTip , MarkdownToHtml , AttachmentList } from 'educoder' const $=window.$; const type={1: "设计",2: "论文", 3: "创作"} const source={1: "生产/社会实际", 2:"结合科研", 3: "其它"} const first={1:'真题', 2:'模拟题'} const second={1:'纵向课题', 2:'横向课题', 3: "自选"} const repeat={1:'新题',2:"往届题,有新要求",3:'往届题,无新要求'} class GraduateTopicDetailTable extends Component{ constructor(props){ super(props); this.state={ topicInfo:undefined } } componentDidMount=()=>{ let course_id=this.props.match.params.course_id; let graduation_topic_id=this.props.match.params.graduation_topic_id; let url=`/courses/${course_id}/graduation_topics/${graduation_topic_id}/show_detail.json`; axios.get(url).then((result)=>{ if(result.status==200){ this.setState({ topicInfo:result.data }) } }).catch((error)=>{ console.log(error); }) } render(){ let{topicInfo}=this.state console.log(topicInfo) let course_id=this.props.match.params.course_id; let graduation_topic_id=this.props.match.params.graduation_topic_id; return(
课题类型: {topicInfo.topic_type ? type[`${topicInfo.topic_type}`] :"--"} 课题来源: {topicInfo.topic_source ? source[`${topicInfo.topic_source}`] :"--"} 课题性质1: {topicInfo.topic_property_first ? first[`${topicInfo.topic_property_first}`] :"--"} 课题性质2: {topicInfo.topic_property_second ? second[`${topicInfo.topic_property_second}`] :"--"}
} { topicInfo &&课题重复情况: {topicInfo.topic_repeat ? repeat[`${topicInfo.topic_repeat}`] :"--"} 调研或实习地点: {topicInfo.city || "--"} 课题来源单位: {topicInfo.source_unit || "--"}
}