|
@@ -103,7 +103,7 @@ const CartBody = (props) => {
|
103
|
103
|
}
|
104
|
104
|
|
105
|
105
|
const header = (props) => {
|
106
|
|
- const [tempData, setTempData] = useState([])
|
|
106
|
+ const [tempData, setTempData] = useState({ records: [] })
|
107
|
107
|
const [pageTotal, setPageTotal] = useState('')
|
108
|
108
|
useEffect(() => {
|
109
|
109
|
getList({ pageNum: 1, pageSize: 10 });
|
|
@@ -112,7 +112,7 @@ const header = (props) => {
|
112
|
112
|
const getList = (params) => {
|
113
|
113
|
request({ ...apis.staff.taUser, params: { ...params } }).then((data) => {
|
114
|
114
|
console.log(data, "listData")
|
115
|
|
- setTempData(data.records)
|
|
115
|
+ setTempData(data)
|
116
|
116
|
setPageTotal(data.total)
|
117
|
117
|
})
|
118
|
118
|
}
|
|
@@ -193,7 +193,7 @@ const header = (props) => {
|
193
|
193
|
<Button type="danger" style={{ margin: '20px 0', padding: '2px 36px' }} onClick={toEditStaff()}>新增</Button>
|
194
|
194
|
<Row style={{ padding: ' 0 10px' }}>
|
195
|
195
|
{
|
196
|
|
- tempData.map((item, index) => (
|
|
196
|
+ tempData.records.map((item, index) => (
|
197
|
197
|
<Col span={6}>
|
198
|
198
|
<CartBody data={item} onFresh={()=> getList({ pageNum: 1, pageSize: 10 })}/>
|
199
|
199
|
</Col>
|
|
@@ -203,7 +203,7 @@ const header = (props) => {
|
203
|
203
|
|
204
|
204
|
{/* 分页 */}
|
205
|
205
|
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
|
206
|
|
- <Pagination showQuickJumper defaultCurrent={1} total={pageTotal} onChange={onChange} current={data.current}/>
|
|
206
|
+ <Pagination showQuickJumper defaultCurrent={1} total={pageTotal} onChange={onChange} current={tempData.current}/>
|
207
|
207
|
</div>
|
208
|
208
|
</>
|
209
|
209
|
)
|