周立森 5 vuotta sitten
vanhempi
commit
5842395aa4

+ 11
- 1
src/pages/activity/drainage/Detail.jsx Näytä tiedosto

21
   const [columns, setColumns] = useState([])
21
   const [columns, setColumns] = useState([])
22
   const [startDate, setStartDate] = useState('')
22
   const [startDate, setStartDate] = useState('')
23
   const [endDate, setEndDate] = useState('')
23
   const [endDate, setEndDate] = useState('')
24
+  const [total,setTotal] = useState({})
24
   let daterange = []
25
   let daterange = []
25
   // let content = {}
26
   // let content = {}
26
   useEffect(() => {
27
   useEffect(() => {
32
   function gettaDrainageRecord (params) {
33
   function gettaDrainageRecord (params) {
33
     request({ ...apis.activity.taDrainageRecord, params: { ...params } }).then((data) => {
34
     request({ ...apis.activity.taDrainageRecord, params: { ...params } }).then((data) => {
34
       // setDatas(data)
35
       // setDatas(data)
35
-      console.log(data, '3333333333333')
36
+      setTotal(data)
37
+      console.log(data.total, '3333333333333')
36
       setDatas(tableData(data.records))
38
       setDatas(tableData(data.records))
37
       // content = data.records[0]
39
       // content = data.records[0]
38
       console.log('json: ', eval('(' + data.records[0].content + ')'))
40
       console.log('json: ', eval('(' + data.records[0].content + ')'))
86
     
88
     
87
   }
89
   }
88
 
90
 
91
+  const changePageNum = pageNumber => {
92
+    gettaDrainageRecord({ pageNum: pageNumber, pageSize: 10 ,drainageId: drainageId, startTime: fromTime(startDate) ,endTime: fromTime(endDate)})
93
+}
89
   function excelPort(){
94
   function excelPort(){
90
     // const fieldsValue = getFieldsValue()
95
     // const fieldsValue = getFieldsValue()
91
     request({ ...apis.activity.exporttaDrainageRecord, params: { drainageId: drainageId ,startTime: fromTime(startDate) ,endTime: fromTime(endDate) }  })
96
     request({ ...apis.activity.exporttaDrainageRecord, params: { drainageId: drainageId ,startTime: fromTime(startDate) ,endTime: fromTime(endDate) }  })
96
       })
101
       })
97
   }
102
   }
98
 
103
 
104
+
105
+
99
   function download (data) {
106
   function download (data) {
100
     if (!data) {
107
     if (!data) {
101
       return
108
       return
131
         {/* H5项目名称 */}
138
         {/* H5项目名称 */}
132
         {}  <Button type="primary" style={{ marginLeft: '30px', float: 'right', marginTop: '30px',marginBottom: '30px' }} onClick={excelPort}>导出数据</Button>
139
         {}  <Button type="primary" style={{ marginLeft: '30px', float: 'right', marginTop: '30px',marginBottom: '30px' }} onClick={excelPort}>导出数据</Button>
133
         <Table columns={columns} dataSource={datas}  pagination={false} />
140
         <Table columns={columns} dataSource={datas}  pagination={false} />
141
+        <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
142
+       <Pagination showQuickJumper defaultCurrent={1} total={total.total} onChange={(e) => changePageNum(e)} />
143
+      </div>
134
       </div>
144
       </div>
135
 
145
 
136
 
146
 

+ 6
- 3
src/pages/activity/drainage/DrainageList.jsx Näytä tiedosto

231
       visible: true,
231
       visible: true,
232
     });
232
     });
233
   };
233
   };
234
-
234
+  const changePageNum = pageNumber => {
235
+    gettaDrainage({ pageNum: pageNumber, pageSize: 10 })
236
+}
235
 
237
 
236
   function handleOk () {
238
   function handleOk () {
237
 
239
 
277
                 // prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
279
                 // prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
278
                 placeholder="H5项目编号"
280
                 placeholder="H5项目编号"
279
               />,
281
               />,
280
-
281
               // {getFieldDecorator('name', {
282
               // {getFieldDecorator('name', {
282
               // })(<Input/>)}
283
               // })(<Input/>)}
283
             )}
284
             )}
313
           <Forms />
314
           <Forms />
314
         </Modal>
315
         </Modal>
315
         <Table columns={columns} dataSource={datas.records} pagination={false} rowKey="drainageList"/>
316
         <Table columns={columns} dataSource={datas.records} pagination={false} rowKey="drainageList"/>
316
-     
317
+        <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
318
+       <Pagination showQuickJumper defaultCurrent={1} total={datas.total} onChange={(e) => changePageNum(e)} />
319
+      </div>
317
       </div>
320
       </div>
318
     </>
321
     </>
319
   )
322
   )