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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. import { useState, useEffect, useRef } from 'react';
  2. import { ProList, PageContainer } from '@ant-design/pro-components';
  3. import { ConfigProvider, Button, Flex, Input, Space, Image, Row, Col, Carousel, Tag, Card, Avatar, Typography, Anchor, List, Result, Divider, Descriptions } from 'antd';
  4. import { PhoneOutlined, MailOutlined, EnvironmentOutlined, ArrowRightOutlined, FireOutlined, StarOutlined, PayCircleOutlined } from '@ant-design/icons';
  5. import { useSearchParams, connect, history, Link } from 'umi';
  6. import { Imageprefix } from '@/constants/index'
  7. import { GetCompanyInfo } from '@/services/apis/company';
  8. import { GetJobCompanyjobs } from '@/services/apis/post';
  9. import EmptyResult from '@/components/Common/EmptyResult'
  10. import CommonJob from '@/components/Common/Job'
  11. const HomePage: React.FC = () => {
  12. const [searchParams] = useSearchParams();
  13. const [current, setCurrent] = useState(1)
  14. const [detail, setDetail] = useState(null)
  15. const [list, setList] = useState<object[]>([])
  16. const [total, setTotal] = useState<number>(0)
  17. const [page, setPage] = useState<number>(1)
  18. const [pageSize, setPageSize] = useState<number>(3)
  19. const [positionList, setPositionList] = useState<any[]>([]);
  20. const [loginHeight, setLoginHeight] = useState<number>(3) // 获取登录的高度
  21. useEffect(() => {
  22. GetCompanyInfo({ id: searchParams.get('id') }).then(res => {
  23. setDetail(res.data)
  24. })
  25. GetJobCompanyjobs({ company_id: searchParams.get('id') }).then(res => {
  26. setList(res.data.jobs)
  27. })
  28. }, []);
  29. return (
  30. <>
  31. <ConfigProvider
  32. theme={{
  33. token: {
  34. colorPrimary: '#19be6e',
  35. },
  36. components: {
  37. Button: {
  38. colorText: '#19be6e'
  39. }
  40. }
  41. }}
  42. >
  43. <PageContainer
  44. header={{ title: '' }}
  45. >
  46. {
  47. detail &&
  48. <>
  49. <Space direction='vertical' size={30} style={{ minHeight: 800 }}>
  50. <Space direction='vertical' size={30}>
  51. <Flex justify='space-between' align='center' style={{ padding: 20, borderRadius: 8, background: '#ffffff' }}>
  52. <Space direction='vertical' size={30}>
  53. <Space size={20}>
  54. <Image src={detail.photo ? `${Imageprefix}${detail.photo}` : '/images/onlylogo.jpg'} width={48} height={48}></Image>
  55. <Space direction='vertical'>
  56. <Typography.Title level={4}>{detail.full_name}</Typography.Title>
  57. <div> 成立日期:{detail.situation.establishment_date}</div>
  58. </Space>
  59. </Space>
  60. <Descriptions>
  61. <Descriptions.Item label="社会统一信用代码" >{detail.registration_number}</Descriptions.Item>
  62. <Descriptions.Item label="企业性质" >{detail.situation.nature_text}</Descriptions.Item>
  63. <Descriptions.Item label="所属行业" >{detail.situation.industry_text}</Descriptions.Item>
  64. <Descriptions.Item label="企业规模" >{detail.situation.scale_text}</Descriptions.Item>
  65. </Descriptions>
  66. </Space>
  67. </Flex>
  68. <Row style={{ background: '#ffffff', borderRadius: 8, padding: 20 }}>
  69. <Col span={18}>
  70. <Space direction='vertical' style={{ width: '90%' }}>
  71. <Space direction='vertical' style={{ width: '90%', minHeight: 200 }}>
  72. <Typography.Title level={5}>企业介绍</Typography.Title>
  73. <Typography.Paragraph>
  74. <div dangerouslySetInnerHTML={{ __html: detail.introduction }} />
  75. </Typography.Paragraph>
  76. </Space>
  77. <Space direction='vertical' style={{ width: '90%', minHeight: 200 }}>
  78. <Typography.Title level={5}>企业地址</Typography.Title>
  79. <Typography.Paragraph>
  80. <Space direction='vertical'>
  81. <Space>{detail.detail_address} </Space>
  82. {/* <Image src='/images/bg1.jpg'></Image> */}
  83. </Space>
  84. </Typography.Paragraph>
  85. </Space>
  86. </Space>
  87. </Col>
  88. <Col span={6}>
  89. <Space direction='vertical' style={{ width: '100%' }}>
  90. <Typography.Title level={5}>联系方式</Typography.Title>
  91. <Descriptions>
  92. <Descriptions.Item label="企业邮箱" span={24}>{detail.email ? detail.email : '未公开'}</Descriptions.Item>
  93. <Descriptions.Item label="企业官网" span={24} >{detail.website ? detail.website : '未公开'}</Descriptions.Item>
  94. <Descriptions.Item label="企业传真" span={24} >{detail.fax ? detail.fax : '未公开'}</Descriptions.Item>
  95. </Descriptions>
  96. </Space>
  97. </Col>
  98. <Col span={24}>
  99. <Space direction='vertical' style={{ width: '100%' }}>
  100. <Typography.Title level={5}>在招职位</Typography.Title>
  101. <div style={{ background: '#f5f5f5', padding: 20, borderRadius: 8 }}>
  102. <Row gutter={[10, 10]} style={{ width: '100%' }}>
  103. <Col span={24}>
  104. {
  105. list && list.length > 0 && list.map((item: any, index: number) => (
  106. <>
  107. <CommonJob item={item}></CommonJob>
  108. </>
  109. ))
  110. }
  111. {
  112. !list || list.length == 0 && <EmptyResult description="没有找到符合条件的职位" />
  113. }
  114. </Col>
  115. </Row>
  116. </div>
  117. </Space>
  118. </Col>
  119. </Row>
  120. </Space>
  121. </Space>
  122. {/* <Space direction='vertical' size={60} style={{ margin: '40px 0', width: '100%' }}>
  123. <Card
  124. style={{
  125. border: 'none'
  126. }}
  127. title={
  128. <>
  129. <Space>
  130. <Image src={detail.photo ? detail.photo : '/images/onlylogo.jpg'} width={48} height={48}></Image>
  131. <Typography.Title level={4}>{detail.full_name}</Typography.Title>
  132. </Space>
  133. </>
  134. }
  135. extra={<>
  136. <Space>
  137. <Button type='primary' onClick={() => {
  138. setList([])
  139. setCurrent(1)
  140. }}>企业详情</Button>
  141. <Button type='primary' onClick={() => {
  142. GetJobCompanyjobs({ company_id: searchParams.get('id') }).then(res => {
  143. setList(res.data.jobs)
  144. })
  145. setCurrent(2)
  146. }}>在招职位</Button>
  147. </Space>
  148. </>}
  149. styles={{
  150. header: {
  151. borderBottom: 'none'
  152. },
  153. title: {
  154. fontSize: '14px'
  155. },
  156. }}>
  157. {current === 1 ? <>
  158. <Row gutter={[20, 10]} style={{ minHeight: '600px', width: '100%' }}>
  159. <Col span={16}>
  160. <Space direction='vertical'>
  161. <Space direction='vertical'>
  162. <Typography.Title level={5}>企业介绍</Typography.Title>
  163. <Typography.Paragraph>
  164. <div dangerouslySetInnerHTML={{ __html: detail.introduction }} />
  165. </Typography.Paragraph>
  166. </Space>
  167. <Space direction='vertical'>
  168. <Typography.Title level={5}>企业相册</Typography.Title>
  169. <Typography.Paragraph>
  170. In the process of internal desktop applications development, many different design specs and
  171. implementations would be involved, which might cause designers and developers difficulties and
  172. duplication and reduce the efficiency of development.
  173. </Typography.Paragraph>
  174. </Space>
  175. <Space direction='vertical'>
  176. <Typography.Title level={5}>企业地址</Typography.Title>
  177. <Typography.Paragraph>
  178. <Space direction='vertical'>
  179. <Space>{detail.detail_address} <Link to='/'>导航</Link></Space>
  180. <Image src='/images/bg1.jpg'></Image>
  181. </Space>
  182. </Typography.Paragraph>
  183. </Space>
  184. </Space>
  185. </Col>
  186. <Col span={8}>
  187. <Space direction='vertical' size={30} style={{ width: '100%' }}>
  188. <Card bordered={false} style={{ boxShadow: '0 2px 20px #edfff3', borderRadius: '8px' }}>
  189. <Descriptions>
  190. <Descriptions.Item label="社会统一信用代码" span={24}>{detail.registration_number}</Descriptions.Item>
  191. <Descriptions.Item label="企业邮箱" span={24}>{detail.email ? detail.email : '未公开'}</Descriptions.Item>
  192. <Descriptions.Item label="企业官网" span={24}>{detail.website ? detail.website : '未公开'}</Descriptions.Item>
  193. <Descriptions.Item label="企业传真" span={24}>{detail.fax ? detail.fax : '未公开'}</Descriptions.Item>
  194. </Descriptions>
  195. </Card>
  196. <Card bordered={false} style={{ boxShadow: '0 2px 20px #edfff3', borderRadius: '8px' }}>
  197. <Descriptions>
  198. <Descriptions.Item label="注册日期" span={24}>{detail.situation.establishment_date}</Descriptions.Item>
  199. <Descriptions.Item label="企业性质" span={24}>{detail.situation.nature_text}</Descriptions.Item>
  200. <Descriptions.Item label="所属行业" span={24}>{detail.situation.industry_text}</Descriptions.Item>
  201. <Descriptions.Item label="企业规模" span={24}>{detail.situation.scale_text}</Descriptions.Item>
  202. </Descriptions>
  203. </Card>
  204. <Card
  205. bordered={false}
  206. title="联系方式"
  207. actions={[
  208. <PhoneOutlined style={{ color: '#19be6e' }} />
  209. ]}
  210. style={{ border: '1px solid #edfff3', borderRadius: '8px' }}>
  211. <Card.Meta
  212. avatar={<Image src={detail.photo ? detail.photo : '/images/onlylogo.jpg'} width={48} height={48}></Image>}
  213. title={detail.contact}
  214. description={detail.phone}
  215. />
  216. </Card>
  217. </Space>
  218. </Col>
  219. </Row>
  220. </> : <>
  221. 在招岗位
  222. {
  223. list.length > 0 && <>
  224. <div style={{ minHeight: 700 }}>
  225. <Row gutter={[10, 10]} style={{ marginBottom: 40, margin: '40px 0', width: '100%' }}>
  226. {
  227. list.length > 0 && list.map((item: any, index: number) => (
  228. <>
  229. <Col span={8}>
  230. <Card size="small"
  231. title={
  232. <>
  233. <Link to={{ pathname: `/job/detail?id=${item.id}` }} target="_blank" style={{ color: '#000000', fontSize: 16, marginRight: 10 }}>
  234. {item.name}
  235. </Link>
  236. {item.urgent === 1 && <Tag icon={<FireOutlined />} bordered={false} color="#f50">急招</Tag>}
  237. </>
  238. }
  239. extra={<StarOutlined />}
  240. styles={{
  241. header: {
  242. borderBottom: 'none'
  243. },
  244. title: {
  245. fontSize: '14px'
  246. },
  247. }}>
  248. <Space size={0}>
  249. <Tag>{item.experience_text ? item.experience_text : '经验不限'}</Tag>
  250. <Tag> {item.school_degree_text ? item.school_degree_text : '学历不限'}</Tag>
  251. <Tag> {item.profelevel_text ? item.profelevel_text : '职称不限'}</Tag>
  252. </Space>
  253. <Card.Meta
  254. style={{ marginTop: 20 }}
  255. avatar={<Avatar src="/images/onlylogo.jpg" style={{ width: 48, height: 48 }} />}
  256. title={<Link to={{ pathname: `/job/detail?id=${item.id}` }} target="_blank" style={{ color: '#000000', fontSize: '12px' }}>
  257. {item.full_name}
  258. </Link>}
  259. description={<><div style={{ fontSize: '12px' }}>{item.locations ? item.locations[0].name : '未知地址'}</div></>}
  260. />
  261. </Card>
  262. </Col>
  263. </>
  264. ))
  265. }
  266. </Row>
  267. </div>
  268. </>
  269. }
  270. </>}
  271. </Card>
  272. </Space> */}
  273. </>
  274. }
  275. </PageContainer >
  276. </ConfigProvider >
  277. </>
  278. );
  279. };
  280. export default HomePage;