|
|
@@ -5,6 +5,7 @@
|
|
|
|
|
|
import React, { Component } from 'react'
|
|
|
import { connect } from 'react-redux'
|
|
|
+import ReactDOM from 'react-dom'
|
|
|
import './task-todo.less'
|
|
|
import TaskTodoItem from '../../../components/private/tasktodo/TaskTodoItem'
|
|
|
import { isObjEmpty } from '../../../utils/common/common.util'
|
|
|
@@ -21,12 +22,26 @@ class TaskTodo extends Component {
|
|
|
this.state = {
|
|
|
data: [],
|
|
|
refreshing: false,
|
|
|
+ height: document.documentElement.clientHeight,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
componentDidMount () {
|
|
|
document.title = '待办任务'
|
|
|
this.getListData()
|
|
|
+ setTimeout(() => {
|
|
|
+ if (this.props.height) {
|
|
|
+ this.setState({
|
|
|
+ height: this.props.height,
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ const hei = this.state.height -
|
|
|
+ ReactDOM.findDOMNode(this.ptr).getBoundingClientRect().top
|
|
|
+ this.setState({
|
|
|
+ height: hei,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }, 0)
|
|
|
}
|
|
|
|
|
|
componentWillUnmount () {
|
|
|
@@ -34,7 +49,7 @@ class TaskTodo extends Component {
|
|
|
}
|
|
|
|
|
|
render () {
|
|
|
- let { data } = this.state
|
|
|
+ let { data, height } = this.state
|
|
|
|
|
|
return (
|
|
|
<div className="task-todo-page">
|
|
|
@@ -45,6 +60,11 @@ class TaskTodo extends Component {
|
|
|
refreshing={this.state.refreshing}
|
|
|
onRefresh={this.refreshFunc}
|
|
|
className='report-func-root'
|
|
|
+ ref={el => this.ptr = el}
|
|
|
+ style={{
|
|
|
+ height: height,
|
|
|
+ overflow: 'auto',
|
|
|
+ }}
|
|
|
>
|
|
|
<TaskTodoItem rowList={data}/>
|
|
|
</PullToRefresh>
|