dev_forum
hjm 5 years ago
parent 5f1847ea35
commit b95c8b17cb

@ -8,12 +8,13 @@ import { CNotificationHOC } from '../common/CNotificationHOC'
import { RouteHOC } from './common' import { RouteHOC } from './common'
import locale from 'antd/lib/date-picker/locale/zh_CN'; import locale from 'antd/lib/date-picker/locale/zh_CN';
import { WordsBtn, MarkdownToHtml, trigger } from 'educoder'; import { WordsBtn, MarkdownToHtml, trigger, queryString } from 'educoder';
import axios from 'axios'; import axios from 'axios';
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';
import CoursesListType from '../coursesPublic/CoursesListType'; import CoursesListType from '../coursesPublic/CoursesListType';
import AccessoryModal from "../coursesPublic/AccessoryModal"; import AccessoryModal from "../coursesPublic/AccessoryModal";
import PublishRightnow from './PublishRightnow' import PublishRightnow from './PublishRightnow'
import DownloadMessage from '../../modals/DownloadMessage';
import '../css/Courses.css' import '../css/Courses.css'
import CBreadcrumb from '../common/CBreadcrumb' import CBreadcrumb from '../common/CBreadcrumb'
@ -121,9 +122,17 @@ class CommonWorkDetailIndex extends Component{
} }
const isAdmin = this.props.isAdmin() const isAdmin = this.props.isAdmin()
let exportUrl = `/api/homework_commons/${workId}/works_list.zip`
const exportResultUrl = `/api/homework_commons/${workId}/works_list.xlsx`
let exportParams = {}
const isListModule = childModuleName == '作品列表';
// 是列表页
let params = {}
if (isListModule) {
// TODO
// params = this.refs.commonWorkList._getRequestParams()
}
let exportUrl = `/homework_commons/${workId}/works_list.zip?${queryString.stringify(params)}`
let exportResultUrl = `/homework_commons/${workId}/works_list.xlsx?${queryString.stringify(params)}`
return ( return (
<div> <div>
<PublishRightnow ref={this.publishModal} showActionButton={false} {...this.props} checkBoxValues={[workId]} <PublishRightnow ref={this.publishModal} showActionButton={false} {...this.props} checkBoxValues={[workId]}
@ -132,6 +141,9 @@ class CommonWorkDetailIndex extends Component{
></PublishRightnow> ></PublishRightnow>
<PublishRightnow ref={this.endModal} showActionButton={false} {...this.props} checkBoxValues={[workId]} <PublishRightnow ref={this.endModal} showActionButton={false} {...this.props} checkBoxValues={[workId]}
isPublish={false} doWhenSuccess={this.doWhenSuccess}></PublishRightnow> isPublish={false} doWhenSuccess={this.doWhenSuccess}></PublishRightnow>
<DownloadMessage ref="DownloadMessage" {...this.props} />
<div className="newMain clearfix worklist1"> <div className="newMain clearfix worklist1">
<div className={"educontent mt20"}> <div className={"educontent mt20"}>
<style>{` <style>{`
@ -189,7 +201,7 @@ class CommonWorkDetailIndex extends Component{
<div className="mt10 clearfix edu-back-white poll_list pl5"> <div className="mt10 clearfix edu-back-white poll_list pl5">
<Link <Link
onClick={() => this.setState({moduleName: '作品列表'})} onClick={() => this.setState({moduleName: '作品列表'})}
className={`${childModuleName == '作品列表' ? 'active' : '' } `} className={`${isListModule ? 'active' : '' } `}
to={`/courses/${courseId}/${moduleEngName}/${workId}/list`}>作品列表</Link> to={`/courses/${courseId}/${moduleEngName}/${workId}/list`}>作品列表</Link>
<Link <Link
onClick={() => this.setState({moduleName: '作业问答'})} onClick={() => this.setState({moduleName: '作业问答'})}
@ -228,8 +240,12 @@ class CommonWorkDetailIndex extends Component{
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding":"0 20px"}}> {this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding":"0 20px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i> 导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}> <ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a href={exportResultUrl} className="color-dark">导出成绩</a></li> <li><a href={"javascript:void(0)"} className="color-dark"
<li><a href={exportUrl} className="color-dark">导出作品附件</a></li> onClick={() => this.refs.DownloadMessage.confirmysl(exportResultUrl, exportParams)}
>导出成绩</a></li>
<li><a href={"javascript:void(0)"} className="color-dark"
onClick={() => this.refs.DownloadMessage.confirmysl(exportUrl, exportParams)}
>导出作品附件</a></li>
</ul> </ul>
</li>:""} </li>:""}
@ -293,7 +309,7 @@ class CommonWorkDetailIndex extends Component{
{/* 作品列表 */} {/* 作品列表 */}
<Route exact path="/courses/:coursesId/common_homeworks/:workId/list" <Route exact path="/courses/:coursesId/common_homeworks/:workId/list"
render={ render={
(props) => (<CommonWorkList {...this.props} {...props} {...this.state} {...commonHandler}/>) (props) => (<CommonWorkList ref="commonWorkList" {...this.props} {...props} {...this.state} {...commonHandler}/>)
} }
></Route> ></Route>

Loading…
Cancel
Save