dingxin 5 years ago
parent
commit
b87fb40fcc
1 changed files with 6 additions and 1 deletions
  1. 6
    1
      src/pages/activity/helpActivity/helpRecord.jsx

+ 6
- 1
src/pages/activity/helpActivity/helpRecord.jsx View File

32
 
32
 
33
   componentDidUpdate (preProps, preState) {
33
   componentDidUpdate (preProps, preState) {
34
     const { helpId } = this.state.visibleData
34
     const { helpId } = this.state.visibleData
35
-
36
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
35
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
37
       this.getList({ helpRecordInitiateId: helpId, pageNumber: 1, pageSize: 5 })
36
       this.getList({ helpRecordInitiateId: helpId, pageNumber: 1, pageSize: 5 })
38
       this.setState({ visibleData: this.props.visibleData });
37
       this.setState({ visibleData: this.props.visibleData });
43
   // eslint-disable-next-line react/sort-comp
42
   // eslint-disable-next-line react/sort-comp
44
   handleOk () {
43
   handleOk () {
45
     this.props.onCancel()
44
     this.props.onCancel()
45
+    this.setState({ dataSource: { records: [] } })
46
   }
46
   }
47
 
47
 
48
   // 弹框取消按钮
48
   // 弹框取消按钮
49
   handleCancel () {
49
   handleCancel () {
50
     this.props.onCancel()
50
     this.props.onCancel()
51
+    this.setState({ dataSource: { records: [] } })
51
   }
52
   }
52
 
53
 
53
   getList (params) {
54
   getList (params) {
55
+    console.log('paramsparamsparams', params)
56
+    if (params.helpId === '') {
57
+      return
58
+    }
54
     request({ ...apis.helpActivity.helpPeopleDetails, params: { ...params } }).then(res => {
59
     request({ ...apis.helpActivity.helpPeopleDetails, params: { ...params } }).then(res => {
55
       this.setState({ dataSource: res })
60
       this.setState({ dataSource: res })
56
     }).catch(err => {
61
     }).catch(err => {