dev_forum
杨树林 5 years ago
parent bfe5e24935
commit c3b2e8eefd

@ -136,7 +136,7 @@ class CommonWorkDetailIndex extends Component{
DownloadMessageval:undefined DownloadMessageval:undefined
}) })
} }
bindRef = ref => { this.child = ref };
render() { render() {
@ -171,8 +171,10 @@ class CommonWorkDetailIndex extends Component{
let params = {} let params = {}
if (isListModule) { if (isListModule) {
// TODO // TODO
// params = this.refs.commonWorkList._getRequestParams() params =this.child._getRequestParams()!==undefined?this.child._getRequestParams():{};
} }
// console.log("普通作业176176176");
// console.log(params);
let exportUrl = `/homework_commons/${workId}/works_list.zip?${queryString.stringify(params)}` let exportUrl = `/homework_commons/${workId}/works_list.zip?${queryString.stringify(params)}`
let exportResultUrl = `/homework_commons/${workId}/works_list.xlsx?${queryString.stringify(params)}` let exportResultUrl = `/homework_commons/${workId}/works_list.xlsx?${queryString.stringify(params)}`
return ( return (
@ -356,7 +358,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 ref="commonWorkList" {...this.props} {...props} {...this.state} {...commonHandler}/>) (props) => (<CommonWorkList ref="commonWorkList" triggerRef={this.bindRef} {...this.props} {...props} {...this.state} {...commonHandler}/>)
} }
></Route> ></Route>

@ -401,7 +401,7 @@ class CommonWorkList extends Component{
this.fetchList() this.fetchList()
on('commonwork_fetch_all', this.fetchAllListener) on('commonwork_fetch_all', this.fetchAllListener)
$("html").animate({ scrollTop: $('html').scrollTop() - 100 }) $("html").animate({ scrollTop: $('html').scrollTop() - 100 })
this.props.triggerRef(this);
} }
componentWillUnmount() { componentWillUnmount() {
off('commonwork_fetch_all', this.fetchAllListener) off('commonwork_fetch_all', this.fetchAllListener)

Loading…
Cancel
Save