You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.tsx 6.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. import { useState, useEffect, useRef } from 'react';
  2. import { ProList, PageContainer } from '@ant-design/pro-components';
  3. import { ConfigProvider, Button, Flex, Input, Space, Image, Pagination, Row, Col, Divider, Tag, Card, Avatar, Typography } from 'antd';
  4. import { EllipsisOutlined, FireOutlined, EnvironmentOutlined, RightOutlined, StarOutlined } from '@ant-design/icons';
  5. import { useModel, connect, history, Link } from 'umi';
  6. import { PostJobSearch } from '@/services/apis/post';
  7. import CommonJob from '@/components/Common/Job'
  8. const HomeNewJob: React.FC = () => {
  9. const [list, setList] = useState<object[]>([])
  10. const [total, setTotal] = useState<number>(0)
  11. const [page, setPage] = useState<number>(1)
  12. const [pageSize, setPageSize] = useState<number>(12)
  13. useEffect(() => {
  14. PostJobSearch({ page: 1, pagesize: 6 }).then(res => {
  15. setList(res.data.jobs)
  16. })
  17. }, []);
  18. return (
  19. <>
  20. <ConfigProvider
  21. theme={{
  22. token: {
  23. colorPrimary: '#19be6e',
  24. },
  25. components: {
  26. Button: {
  27. colorText: '#19be6e'
  28. }
  29. }
  30. }}
  31. >
  32. <Space direction='vertical' size={20} style={{ width: '1152px' }}>
  33. {/* <Flex justify='center' align='center'>
  34. <Typography.Title level={2}>热门职位</Typography.Title>
  35. </Flex> */}
  36. {/* <Divider orientation="left" orientationMargin="0"><Typography.Title level={2}>热门职位</Typography.Title></Divider> */}
  37. <Row gutter={[10, 10]}>
  38. {
  39. list.length > 0 && list.map((item: any, index: number) => (
  40. <>
  41. <Col span={24}>
  42. <CommonJob item={item}></CommonJob>
  43. </Col>
  44. </>
  45. ))
  46. }
  47. </Row>
  48. <Flex justify='center' align='center'>
  49. <Space>
  50. <Link to={{ pathname: '/talent/search' }}>
  51. <Button icon={<RightOutlined />} iconPosition='end'>更多职位</Button>
  52. </Link>
  53. </Space>
  54. </Flex>
  55. </Space>
  56. </ConfigProvider >
  57. </>
  58. );
  59. };
  60. export default HomeNewJob;
  61. {/* <ProList
  62. ghost
  63. grid={{ gutter: 20, column: 2 }}
  64. rowKey="id"
  65. dataSource={list}
  66. request={async (params = {} as Record<string, any>) =>
  67. PostJobSearch({
  68. page: 1,
  69. pagesize: 2,
  70. sort: 'id',
  71. sortby: 'desc',
  72. }).then(res => {
  73. setList(res.data.jobs)
  74. setTotal(res.data.total)
  75. })
  76. }
  77. showActions="hover"
  78. metas={{
  79. title: {
  80. dataIndex: 'name'
  81. },
  82. subTitle: {
  83. },
  84. actions: {
  85. render: () => [<StarOutlined />]
  86. },
  87. content: {
  88. render: (text, row) => {
  89. return (
  90. <>
  91. <Space direction='vertical' style={{ marginBottom: 10 }}>
  92. <Space size={4}>
  93. <Tag>
  94. {row.experience_text ? row.experience_text : '经验不限'}
  95. </Tag>
  96. <Tag>
  97. {row.school_degree_text ? row.school_degree_text : '学历不限'}
  98. </Tag>
  99. <Tag>
  100. {row.profelevel_text ? '职称不限' : '职称不限'}
  101. </Tag>
  102. </Space>
  103. <Space size={10}>
  104. <Avatar src="/images/onlylogo.jpg" style={{ width: 48, height: 48 }} />
  105. <Space direction='vertical' style={{ height: 48 }}>
  106. <Link to='/'>{row.full_name}</Link>
  107. <div style={{fontSize: 12}}>{row.locations ? row.locations[0].name : '未知地址'}</div>
  108. </Space>
  109. </Space>
  110. </Space>
  111. </>
  112. )
  113. }
  114. }
  115. }}
  116. /> */}