Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. import { useState, useEffect, useRef } from 'react';
  2. import { ProList, PageContainer } from '@ant-design/pro-components';
  3. import { ConfigProvider, Button, Flex, Input, Space, Image, Select, Row, Col, Pagination, Tag, Card, Divider, Typography, Anchor } from 'antd';
  4. import { SearchOutlined, LikeOutlined, ArrowRightOutlined, StarOutlined } from '@ant-design/icons';
  5. import { useModel, connect, history, Link, useSearchParams } from 'umi';
  6. import SearchFilter from '@/components/Talent/Search/Filter/Company';
  7. import SearchJob from '@/components/Talent/Search/Company/index';
  8. import { Imageprefix } from '@/constants/index'
  9. import { PostCompanySearch } from '@/services/apis/company';
  10. import { GetAdvertscheduleList } from '@/services/apis/advertschedule';
  11. import EmptyResult from '@/components/Common/EmptyResult'
  12. import CommonJob from '@/components/Common/Job'
  13. import './index.less'
  14. const HomePage: React.FC = () => {
  15. const [searchParams, setSearchParams] = useSearchParams();
  16. const [list, setList] = useState<object[]>([])
  17. const [advertscheduleList, setAdvertscheduleList] = useState<object[]>([])
  18. const [search, setSearch] = useState<object | null>(null)
  19. const [total, setTotal] = useState<number>(0)
  20. const [page, setPage] = useState<number>(1)
  21. const [pagesize, setPageSize] = useState<number>(18)
  22. useEffect(() => {
  23. GetAdvertscheduleList({ page: 1, pagesize: 4, code: 'wzsylbt' }).then(res => {
  24. setAdvertscheduleList(res.data.advertschedules)
  25. })
  26. }, []);
  27. // useEffect(() => {
  28. // PostJobSearch({
  29. // page: 1,
  30. // pagesize: 12,
  31. // sort: 'updated_at',
  32. // sortby: 'desc'
  33. // }).then(res => {
  34. // setList(res.data.jobs)
  35. // getTotal(res.data.total)
  36. // })
  37. // }, []);
  38. const getSearchParams = async (value) => {
  39. setPage(value.page)
  40. setPageSize(value.pagesize)
  41. let res = await PostCompanySearch(value ? value : {
  42. page: page,
  43. pagesize: pagesize,
  44. sort: 'updated_at',
  45. sortby: 'desc',
  46. })
  47. setList(res.data.list)
  48. getTotal(res.data.total)
  49. }
  50. const getTotal = (value) => {
  51. setTotal(value)
  52. }
  53. return (
  54. <>
  55. <ConfigProvider
  56. theme={{
  57. token: {
  58. colorPrimary: '#19be6e',
  59. },
  60. components: {
  61. Button: {
  62. colorText: '#19be6e'
  63. }
  64. }
  65. }}
  66. >
  67. <Space direction='vertical' size={30} style={{ minHeight: '800px' }}>
  68. <SearchFilter getSearchParams={getSearchParams}
  69. famous={searchParams.get('famous') ? searchParams.get('famous') : 0}
  70. probation={searchParams.get('probation') ? searchParams.get('probation') : 0}
  71. page={page}
  72. pagesize={pagesize}></SearchFilter>
  73. <Row gutter={[16, 16]}>
  74. <Col span={18}>
  75. <Row gutter={[16, 16]}>
  76. {
  77. list && list.length > 0 && list.map((item: any, index: number) => (
  78. <>
  79. <Col span={8}>
  80. <Link to={{ pathname: `/talent/company/detail?id=${item.id}` }} target="_blank" style={{ width: '100%' }}>
  81. <Flex vertical align='center' justify='center' className='company-item'>
  82. <Image src={item.photo ? `${Imageprefix}${item.photo}` : '/images/logo.jpg'} preview={false} width={100} height={100} style={{ borderRadius: '4px', objectFit: 'contain' }}></Image>
  83. <Typography.Paragraph
  84. ellipsis={{ rows: 1 }}
  85. style={{ fontSize: 16, textAlign: 'center', whiteSpace: 'nowrap', marginTop: 8, width: '100%' }}
  86. >
  87. {item.full_name}
  88. </Typography.Paragraph>
  89. <Typography.Paragraph
  90. ellipsis={{ rows: 1 }}
  91. style={{ fontSize: 12, color: '#999', textAlign: 'center', whiteSpace: 'nowrap', width: '100%' }}
  92. >
  93. {item.nature_text ? item.nature_text : '性质不限'}
  94. {item.industry_text ? <><Divider type='vertical' />{item.industry_text}</> : <><Divider type='vertical' />行业不限</>}
  95. {item.scale_text ? <><Divider type='vertical' />{item.scale_text}</> : <><Divider type='vertical' />规模不限</>}
  96. </Typography.Paragraph>
  97. </Flex >
  98. </Link>
  99. </Col>
  100. </>
  101. ))
  102. }
  103. </Row>
  104. {
  105. !list || list.length == 0 && <EmptyResult description="没有找到符合条件的企业" />
  106. }
  107. <Flex justify='center' align='center' style={{ margin: '40px 0' }}>
  108. <Pagination
  109. hideOnSinglePage
  110. total={total}
  111. showTotal={(total) => `总共${total}条`}
  112. current={page}
  113. pageSize={pagesize}
  114. pageSizeOptions={['12', '24', '36']}
  115. onChange={(page, pageSize) => {
  116. setPage(page)
  117. setPageSize(pageSize)
  118. }}
  119. />
  120. </Flex>
  121. </Col>
  122. <Col span={6}>
  123. {
  124. advertscheduleList && advertscheduleList.length && advertscheduleList.map((item, index) => (
  125. <div style={{ borderRadius: 8, marginBottom: 20 }}>
  126. <div style={{
  127. width: '100%',
  128. position: 'relative',
  129. paddingTop: '56.25%', /* 16:9 的比例 */
  130. overflow: 'hidden'
  131. }}>
  132. <Link to={{ pathname: item.target_url }} target='_blank'>
  133. <img src={Imageprefix + item.image_url} style={{
  134. position: 'absolute',
  135. top: 0,
  136. left: 0,
  137. width: '100%',
  138. height: '100%',
  139. borderRadius: 8
  140. }} />
  141. </Link>
  142. </div>
  143. </div>
  144. ))
  145. }
  146. </Col>
  147. </Row>
  148. </Space>
  149. </ConfigProvider >
  150. </>
  151. );
  152. };
  153. export default HomePage;