周立森 5 years ago
parent
commit
07ab51117d

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

279
       </AuthButton>
279
       </AuthButton>
280
       <Table dataSource={data.records} columns={columns} pagination={false} rowKey="activityList"/>
280
       <Table dataSource={data.records} columns={columns} pagination={false} rowKey="activityList"/>
281
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
281
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
282
-        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
282
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
283
       </div>
283
       </div>
284
     </>
284
     </>
285
   )
285
   )

+ 2
- 1
src/pages/building/list/index.jsx View File

179
     // 网路请求
179
     // 网路请求
180
     request({ ...apis.building.getList, params: { ...params } }).then(res => {
180
     request({ ...apis.building.getList, params: { ...params } }).then(res => {
181
       setDataSource(res)
181
       setDataSource(res)
182
+      console.log("res:",res)
182
     }).catch(err => {
183
     }).catch(err => {
183
       // eslint-disable-next-line no-unused-expressions
184
       // eslint-disable-next-line no-unused-expressions
184
       <Alert
185
       <Alert
321
       </Row>
322
       </Row>
322
       {/* 分页 */}
323
       {/* 分页 */}
323
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
324
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
324
-        <Pagination showQuickJumper defaultCurrent={1} total={dataSource.total} onChange={onChange} current={data.current}/>
325
+        <Pagination showQuickJumper defaultCurrent={1} total={dataSource.total} onChange={onChange} pageSize={dataSource.size} current={dataSource.current}/>
325
       </div>
326
       </div>
326
     </>
327
     </>
327
   );
328
   );

+ 1
- 1
src/pages/news/list/NewsList.jsx View File

319
       </Row>
319
       </Row>
320
       {/* 分页 */}
320
       {/* 分页 */}
321
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
321
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
322
-        <Pagination showQuickJumper defaultCurrent={1} total={dataSource.total} onChange={onChange} current={data.current}/>
322
+        <Pagination showQuickJumper defaultCurrent={1} total={dataSource.total} onChange={onChange} current={dataSource.current}/>
323
       </div>
323
       </div>
324
     </>
324
     </>
325
   );
325
   );

+ 23
- 20
src/pages/staff/list/StaffList.jsx View File

31
  */
31
  */
32
 const CartBody = (props) => {
32
 const CartBody = (props) => {
33
   const { data } = props
33
   const { data } = props
34
+  // console.log("data11:", data)
34
 
35
 
35
   const confirm = (data) => () => {
36
   const confirm = (data) => () => {
36
-    console.log(data,"11111")
37
-    if(data.status === 1){
37
+    // console.log(data, "11111")
38
+    if (data.status === 1) {
38
       Modal.confirm({
39
       Modal.confirm({
39
         title: '确认停用该角色?',
40
         title: '确认停用该角色?',
40
         okText: '确认',
41
         okText: '确认',
41
         cancelText: '取消',
42
         cancelText: '取消',
42
-        onOk() {
43
-          request({ ...apis.staff.change, urlData: {id:data.userId,type:'off'}}).then((data) => {
43
+        onOk () {
44
+          request({ ...apis.staff.change, urlData: { id: data.userId, type: 'off' } }).then((data) => {
44
             message.info("操作成功")
45
             message.info("操作成功")
45
             props.onFresh()
46
             props.onFresh()
46
           })
47
           })
47
         }
48
         }
48
       });
49
       });
49
-    }else{
50
+    } else {
50
       Modal.confirm({
51
       Modal.confirm({
51
         title: '确认启用该角色?',
52
         title: '确认启用该角色?',
52
         okText: '确认',
53
         okText: '确认',
53
         cancelText: '取消',
54
         cancelText: '取消',
54
-        onOk() {
55
-          request({ ...apis.staff.change, urlData: {id:data.userId,type:'on'}}).then((data) => {
55
+        onOk () {
56
+          request({ ...apis.staff.change, urlData: { id: data.userId, type: 'on' } }).then((data) => {
56
             message.info("操作成功")
57
             message.info("操作成功")
57
             props.onFresh()
58
             props.onFresh()
58
           })
59
           })
59
         }
60
         }
60
       });
61
       });
61
     }
62
     }
62
-    
63
+
63
   }
64
   }
64
   return (
65
   return (
65
 
66
 
66
     <Card className={Styles.card}>
67
     <Card className={Styles.card}>
67
       <div>
68
       <div>
68
         <Avatar src={data.photo} style={{ width: '0.48rem', height: '0.48rem' }} />
69
         <Avatar src={data.photo} style={{ width: '0.48rem', height: '0.48rem' }} />
69
-        <Button type="link" style={{color: '#FF925C', fontSize: '0.106rem',position: 'absolute', top: '40px', left: '0.56rem' }} onClick={toEditStaff(data.userId)}>
70
+        <Button type="link" style={{ color: '#FF925C', fontSize: '0.106rem', position: 'absolute', top: '40px', left: '0.56rem' }} onClick={toEditStaff(data.userId)}>
70
           编辑
71
           编辑
71
                 <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '0.04rem' }} />
72
                 <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '0.04rem' }} />
72
         </Button>
73
         </Button>
73
         <Button type="link" style={{ fontSize: ' 0.106rem', color: '#cacaca', position: 'absolute', top: '40px', right: '0' }} onClick={confirm(data)}>
74
         <Button type="link" style={{ fontSize: ' 0.106rem', color: '#cacaca', position: 'absolute', top: '40px', right: '0' }} onClick={confirm(data)}>
74
           {data.status === 1 ? '停用' : '启用'}
75
           {data.status === 1 ? '停用' : '启用'}
75
-                <Icon type={data.status===1?'close-circle':'form'} style={{ color: '#C0C4CC', marginLeft: '0.04rem' }} />
76
+          <Icon type={data.status === 1 ? 'close-circle' : 'form'} style={{ color: '#C0C4CC', marginLeft: '0.04rem' }} />
76
         </Button>
77
         </Button>
77
         {/* <Button type="link" style={{ fontSize: ' 0.106rem', color: '#FF925C', position: 'absolute', top: '50px', right: '0' }} onClick={confirm}>
78
         {/* <Button type="link" style={{ fontSize: ' 0.106rem', color: '#FF925C', position: 'absolute', top: '50px', right: '0' }} onClick={confirm}>
78
           启用
79
           启用
105
 const header = (props) => {
106
 const header = (props) => {
106
   const [tempData, setTempData] = useState([])
107
   const [tempData, setTempData] = useState([])
107
   const [pageTotal, setPageTotal] = useState('')
108
   const [pageTotal, setPageTotal] = useState('')
109
+  const [data,setData] = useState({})
108
   useEffect(() => {
110
   useEffect(() => {
109
-    getList({ pageNum: 1, pageSize: 10 });
111
+    getList({ pageNum: 1, pageSize: 8 });
110
   }, [])
112
   }, [])
111
 
113
 
112
   const getList = (params) => {
114
   const getList = (params) => {
113
     request({ ...apis.staff.taUser, params: { ...params } }).then((data) => {
115
     request({ ...apis.staff.taUser, params: { ...params } }).then((data) => {
114
       console.log(data, "listData")
116
       console.log(data, "listData")
117
+      setData(data)
115
       setTempData(data.records)
118
       setTempData(data.records)
116
       setPageTotal(data.total)
119
       setPageTotal(data.total)
117
     })
120
     })
119
 
122
 
120
   // 分页
123
   // 分页
121
   const onChange = (pageNumber) => {
124
   const onChange = (pageNumber) => {
122
-    getList({ pageNum: pageNumber, pageSize: 10 });
125
+    getList({ pageNum: pageNumber, pageSize: 8 });
123
   }
126
   }
124
 
127
 
125
   // 提交事件
128
   // 提交事件
128
     props.form.validateFields((err, values) => {
131
     props.form.validateFields((err, values) => {
129
       if (!err) {
132
       if (!err) {
130
         console.log('提交数据: ', values)
133
         console.log('提交数据: ', values)
131
-        getList({ pageNum: 1, pageSize: 10, ...values })
134
+        getList({ pageNum: 1, pageSize: 8, ...values })
132
       }
135
       }
133
     });
136
     });
134
   }
137
   }
135
 
138
 
136
-   //重置搜索
137
-   function handleReset() {
139
+  //重置搜索
140
+  function handleReset () {
138
     props.form.resetFields();
141
     props.form.resetFields();
139
   }
142
   }
140
 
143
 
184
           <Button type="primary" htmlType="submit" className={styles.searchBtn}>
187
           <Button type="primary" htmlType="submit" className={styles.searchBtn}>
185
             搜索
188
             搜索
186
           </Button>
189
           </Button>
187
-          
188
-   <Button style={{ marginLeft: 8 }} onClick={handleReset}>
189
-              重置
190
+
191
+          <Button style={{ marginLeft: 8 }} onClick={handleReset}>
192
+            重置
190
             </Button>
193
             </Button>
191
         </Form.Item>
194
         </Form.Item>
192
       </Form>
195
       </Form>
195
         {
198
         {
196
           tempData.map((item, index) => (
199
           tempData.map((item, index) => (
197
             <Col span={6}>
200
             <Col span={6}>
198
-              <CartBody data={item} onFresh={()=> getList({ pageNum: 1, pageSize: 10 })}/>
201
+              <CartBody data={item} onFresh={() => getList({ pageNum: 1, pageSize: 8 })} />
199
             </Col>
202
             </Col>
200
           ))
203
           ))
201
         }
204
         }
203
 
206
 
204
       {/* 分页  */}
207
       {/* 分页  */}
205
       <div style={{ display: 'flex', justifyContent: 'flex-end' }}>
208
       <div style={{ display: 'flex', justifyContent: 'flex-end' }}>
206
-        <Pagination showQuickJumper defaultCurrent={1} total={pageTotal} onChange={onChange} current={data.current}/>
209
+        <Pagination showQuickJumper defaultCurrent={1} pageSize={8} total={pageTotal} onChange={onChange} current={data.current}/>
207
       </div>
210
       </div>
208
     </>
211
     </>
209
   )
212
   )