周立森 5 yıl önce
ebeveyn
işleme
5842395aa4

+ 11
- 1
src/pages/activity/drainage/Detail.jsx Dosyayı Görüntüle

@@ -21,6 +21,7 @@ const header = (props) => {
21 21
   const [columns, setColumns] = useState([])
22 22
   const [startDate, setStartDate] = useState('')
23 23
   const [endDate, setEndDate] = useState('')
24
+  const [total,setTotal] = useState({})
24 25
   let daterange = []
25 26
   // let content = {}
26 27
   useEffect(() => {
@@ -32,7 +33,8 @@ const header = (props) => {
32 33
   function gettaDrainageRecord (params) {
33 34
     request({ ...apis.activity.taDrainageRecord, params: { ...params } }).then((data) => {
34 35
       // setDatas(data)
35
-      console.log(data, '3333333333333')
36
+      setTotal(data)
37
+      console.log(data.total, '3333333333333')
36 38
       setDatas(tableData(data.records))
37 39
       // content = data.records[0]
38 40
       console.log('json: ', eval('(' + data.records[0].content + ')'))
@@ -86,6 +88,9 @@ const header = (props) => {
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 94
   function excelPort(){
90 95
     // const fieldsValue = getFieldsValue()
91 96
     request({ ...apis.activity.exporttaDrainageRecord, params: { drainageId: drainageId ,startTime: fromTime(startDate) ,endTime: fromTime(endDate) }  })
@@ -96,6 +101,8 @@ const header = (props) => {
96 101
       })
97 102
   }
98 103
 
104
+
105
+
99 106
   function download (data) {
100 107
     if (!data) {
101 108
       return
@@ -131,6 +138,9 @@ const header = (props) => {
131 138
         {/* H5项目名称 */}
132 139
         {}  <Button type="primary" style={{ marginLeft: '30px', float: 'right', marginTop: '30px',marginBottom: '30px' }} onClick={excelPort}>导出数据</Button>
133 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 144
       </div>
135 145
 
136 146
 

+ 6
- 3
src/pages/activity/drainage/DrainageList.jsx Dosyayı Görüntüle

@@ -231,7 +231,9 @@ console.log(datas,'22222222')
231 231
       visible: true,
232 232
     });
233 233
   };
234
-
234
+  const changePageNum = pageNumber => {
235
+    gettaDrainage({ pageNum: pageNumber, pageSize: 10 })
236
+}
235 237
 
236 238
   function handleOk () {
237 239
 
@@ -277,7 +279,6 @@ console.log(datas,'22222222')
277 279
                 // prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
278 280
                 placeholder="H5项目编号"
279 281
               />,
280
-
281 282
               // {getFieldDecorator('name', {
282 283
               // })(<Input/>)}
283 284
             )}
@@ -313,7 +314,9 @@ console.log(datas,'22222222')
313 314
           <Forms />
314 315
         </Modal>
315 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 320
       </div>
318 321
     </>
319 322
   )