import React,{Component} from "React"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider, Tag,DatePicker,Radio,Tooltip} from "antd"; import {Link} from 'react-router-dom'; import locale from 'antd/lib/date-picker/locale/zh_CN'; import { WordsBtn, MarkdownToHtml, on, off } from 'educoder'; import axios from 'axios'; import Modals from '../../modals/Modals'; import CoursesListType from '../coursesPublic/CoursesListType'; import HomeworkModal from "../coursesPublic/HomeworkModal"; import CheckAllGroup from '../common/button/CheckAllGroup' import moment from 'moment'; import CheckCodeModal from '../coursesPublic/modal/CheckCodeModal' import NoneData from '../coursesPublic/NoneData' import '../css/Courses.css' import WorkDetailPageHeader from './common/WorkDetailPageHeader' import TabRightComponents from './common/TabRightComponents' const { Option} = Select; const CheckboxGroup = Checkbox.Group; const confirm = Modal.confirm; let GraduationTasksnewtype=true; const $ = window.$; const Search = Input.Search; const RadioGroup = Radio.Group; class CommonWorkAnswer extends Component{ constructor(props){ super(props) this.state={ course_name:"", homework_name:"", search: '' } } fetchData = () => { let workId=this.props.match.params.workId; const url = `/homework_commons/${workId}/reference_answer.json` axios.get(url).then((result)=> { if (result.data.course_id) { this.setState({ ...result.data }, () => { }) this.props.initWorkDetailCommonState && this.props.initWorkDetailCommonState( Object.assign({...result.data}, { moduleName: '参考答案' })) } }).catch((error)=>{ console.log(error) }) } componentDidMount() { this.fetchData() on('commonwork_fetch_all', this.fetchAllListener) } componentWillUnmount() { off('commonwork_fetch_all', this.fetchAllListener) } fetchAllListener = () => { this.fetchData() } render(){ const dateFormat = 'YYYY-MM-DD HH:mm'; let {course_name, homework_name, search, page, loadingstate, homework_status, reference_answer, attachments } =this.state; let courseId=this.props.match.params.coursesId; let category_id=this.props.match.params.category_id; let workId=this.props.match.params.workId; const exportResultUrl = `/api/homework_commons/${workId}/works_list.xlsx` return( {/* 内容区 */}
{reference_answer ? : reference_answer === undefined ? '' : ((!attachments || attachments.length == 0) && )} { attachments && attachments.map((item) => { return (
{item.title} {item.filesize}
) }) }
) } } export default CommonWorkAnswer;