您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

index.tsx 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. import { useState, useEffect, useRef } from 'react';
  2. import { Link } from '@umijs/max';
  3. import { ProList, ProConfigProvider, ProFormCaptcha, ProFormCheckbox, ProFormText, setAlpha, ProForm, ProFormDependency } from '@ant-design/pro-components';
  4. import { PhoneOutlined, MailOutlined, EnvironmentOutlined, ArrowRightOutlined, FireOutlined, StarOutlined, PayCircleOutlined } from '@ant-design/icons';
  5. import { Space, Tabs, Avatar, Row, Col, Image, message, Card, ConfigProvider, Affix, Tag, Tooltip, Pagination, Flex, Descriptions, Button, Divider } from 'antd';
  6. import { Imageprefix } from '@/constants/index'
  7. import { PostCompanySearch } from '@/services/apis/company';
  8. import { GetAdvertscheduleList } from '@/services/apis/advertschedule';
  9. import EmptyResult from '@/components/Common/EmptyResult'
  10. import CommonJob from '@/components/Common/Job'
  11. interface SearchJobProps {
  12. getTotal: (value: number) => void,
  13. searchParams: any,
  14. }
  15. const SearchJob: React.FC<SearchJobProps> = ({ searchParams, getTotal }: any) => {
  16. const [list, setList] = useState<object[]>([])
  17. const [advertscheduleList, setAdvertscheduleList] = useState<object[]>([])
  18. useEffect(() => {
  19. GetAdvertscheduleList({ page: 1, pagesize: 4, code: 'wzsylbt' }).then(res => {
  20. setAdvertscheduleList(res.data.advertschedules)
  21. })
  22. }, []);
  23. useEffect(() => {
  24. PostCompanySearch(searchParams).then(res => {
  25. setList(res.data.jobs)
  26. getTotal(res.data.total)
  27. })
  28. }, [searchParams]);
  29. return (
  30. <>
  31. <ConfigProvider theme={{
  32. token: {
  33. colorPrimary: '#19be6e',
  34. }, components: {
  35. List: {
  36. headerBg: '#ffffff',
  37. }
  38. },
  39. }}>
  40. <Row gutter={[16, 16]}>
  41. <Col span={18}>
  42. {
  43. list.length > 0 && list.map((item: any, index: number) => (
  44. <>
  45. <CommonJob item={item}></CommonJob>
  46. </>
  47. ))
  48. }
  49. {
  50. !list || list.length == 0 && <EmptyResult description="没有找到符合条件的职位" />
  51. }
  52. </Col>
  53. <Col span={6}>
  54. {
  55. advertscheduleList && advertscheduleList.length && advertscheduleList.map((item, index) => (
  56. <div style={{ borderRadius: 8, marginBottom: 20 }}>
  57. <div style={{
  58. width: '100%',
  59. position: 'relative',
  60. paddingTop: '56.25%', /* 16:9 的比例 */
  61. overflow: 'hidden'
  62. }}>
  63. <Link to={{ pathname: item.target_url }} target='_blank'>
  64. <img src={Imageprefix + item.image_url} style={{
  65. position: 'absolute',
  66. top: 0,
  67. left: 0,
  68. width: '100%',
  69. height: '100%',
  70. borderRadius: 8
  71. }} />
  72. </Link>
  73. </div>
  74. </div>
  75. ))
  76. }
  77. </Col>
  78. </Row>
  79. {/* <Flex justify='center' align='center' style={{ margin: '40px 0' }}>
  80. <Pagination
  81. hideOnSinglePage
  82. total={total}
  83. showTotal={(total) => `总共${total}条`}
  84. current={page}
  85. pageSize={pageSize}
  86. pageSizeOptions={['12', '24', '36']}
  87. onChange={(page, pageSize) => {
  88. setPage(page)
  89. setPageSize(pageSize)
  90. GetJobseekerRecommendJob({ page: page, pagesize: pageSize, sortby: 'desc' }).then((res: any) => {
  91. setList(res.data.jobs ? res.data.jobs : [{}, {}])
  92. setTotal(res.data.total)
  93. })
  94. }}
  95. />
  96. </Flex> */}
  97. </ConfigProvider>
  98. </>
  99. );
  100. };
  101. export default SearchJob;