import React,{Component} from "react"; import { Form, Select, Input, Button,Checkbox,Icon,message,Modal, Table, Divider, Tag,DatePicker,Radio,Tooltip} from "antd"; import {Link} from 'react-router-dom'; import { WordsBtn, MarkdownToHtml } from 'educoder'; import axios from 'axios'; import PublishRightnow from '../PublishRightnow' import AccessoryModal from "../../coursesPublic/AccessoryModal"; import DownloadMessageysl from "../../../modals/DownloadMessageysl"; 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 TabRightComponents extends Component{ constructor(props){ super(props) this.publishModal = React.createRef(); this.endModal = React.createRef(); this.state={ accessoryVisible: false, DownloadType:false, DownloadMessageval:undefined, } } componentDidMount() { } onToPublishClick = () => { } // 补交附件 Cancelvisible=()=>{ this.setState({ accessoryVisible:false }) } /// 确认是否下载 confirmysl(url){ axios.get(url + '?export=true' ).then((response) => { if(response.data.status&&response.data.status===-1){ }else if(response.data.status&&response.data.status===-2){ if(response.data.message === "100"){ // 已超出文件导出的上限数量(100 ),建议: this.setState({ DownloadType:true, DownloadMessageval:100 }) }else { //因附件资料超过500M this.setState({ DownloadType:true, DownloadMessageval:500 }) } }else { this.props.slowDownload(url); // this.props.showNotification(`正在下载中`); // window.open("/api"+url, '_blank'); } }).catch((error) => { console.log(error) }); } Downloadcal=()=>{ this.setState({ DownloadType:false, DownloadMessageval:undefined }) } addAccessory=()=>{ this.setState({ accessoryVisible:true }) } setupdate = () => { } render(){ const dateFormat = 'YYYY-MM-DD HH:mm'; const { accessoryVisible } = this.state let { work_statuses, publish_immediately, work_id , end_immediately } =this.props; let courseId=this.props.match.params.coursesId; let category_id=this.props.match.params.category_id; let workId=this.props.match.params.workId; const isGroup = this.props.isGroup() const moduleName = !isGroup? "普通作业":"分组作业"; const moduleEngName = this.props.getModuleName() const childModuleName = this.props.moduleName const isAdmin = this.props.isAdmin() const isSuperAdmin = this.props.isSuperAdmin() let exportUrl = `/api/homework_commons/${workId}/works_list.zip` const exportResultUrl = `/api/homework_commons/${workId}/works_list.xlsx` return( {isAdmin ?
{this.props.isAdmin()?
  • 导出
  • :""} {/* 导出作品附件 导出成绩 */} {/*导出*/} {end_immediately && { this.endModal.current.open() } }>立即截止} {publish_immediately && { this.publishModal.current.open() } } >立即发布} {/*项目在线质量检测*/} {isAdmin && this.props.toEditPage(this.props.match.params, workId)}>编辑作业}
    : {work_statuses && work_statuses.indexOf('提交作品') != -1 && { this.props.toWorkPostPage(this.props.match.params)}} >提交作品} {work_statuses && work_statuses.indexOf('修改作品') != -1 && { this.props.toWorkPostPage(this.props.match.params, null, true, work_id)}} >修改作品} {work_statuses && work_statuses.indexOf('补交附件') != -1 && 补交附件 } }
    ) } } export default TabRightComponents;