BuildingStatic.jsx 1.1KB

1234567891011121314151617181920212223242526272829303132333435
  1. import React, { useEffect, useState } from 'react'
  2. import { Row, Col, Statistic, Icon, Spin } from 'antd'
  3. import { apis, fetch } from '@/utils/request'
  4. const getHouseVerified = fetch(apis.dashboard.houseVerified)
  5. export default props => {
  6. const [loading, setLoading] = useState({})
  7. const [data, setData] = useState({})
  8. useEffect(() => {
  9. setLoading(true)
  10. getHouseVerified().then(res => {
  11. setData(res)
  12. setLoading(false)
  13. }).catch(e => console.error(e) || setLoading(false))
  14. }, [])
  15. return (
  16. <Spin spinning={loading}>
  17. <Row gutter={16}>
  18. <Col span={4}>
  19. {/* <Statistic title={<div><Icon type="bell" style={{fontSize: '1.2em'}} /> 工单 </div>} value={112893} /> */}
  20. </Col>
  21. <Col span={10}>
  22. <Statistic title={<div><Icon type="home" style={{fontSize: '1.2em'}} /> 已认证(户) </div>} value={data.valid} />
  23. </Col>
  24. <Col span={10}>
  25. <Statistic title={<div><Icon type="home" style={{fontSize: '1.2em'}} /> 未认证(户) </div>} value={data.total - data.valid} />
  26. </Col>
  27. </Row>
  28. </Spin>
  29. )
  30. }