</head> | </head> | ||||
<body> | <body> | ||||
<div id="root"></div> | <div id="root"></div> | ||||
<script src="/umi.377af00d.js"></script> | |||||
<script src="/umi.e7cc0b41.js"></script> | |||||
</body> | </body> | ||||
</html> | </html> |
interface TitleProps { | interface TitleProps { | ||||
title: any, | title: any, | ||||
link: any, | link: any, | ||||
hasMore: boolean | |||||
} | } | ||||
const TitleIndex: React.FC<TitleProps> = ({ title, link }) => { | |||||
const TitleIndex: React.FC<TitleProps> = ({ title, link, hasMore }) => { | |||||
return ( | return ( | ||||
<> | <> | ||||
<ConfigProvider | <ConfigProvider | ||||
}}> | }}> | ||||
</div> | </div> | ||||
</Flex> | </Flex> | ||||
<Flex justify='flex-end' style={{ | |||||
}}> | |||||
<Button size='small' shape="round"> | |||||
<Link to={{ pathname: link }} style={{ fontWeight: 'bold', color: '#000000' }}> | |||||
更多 | |||||
</Link> | |||||
</Button> | |||||
</Flex> | |||||
{ | |||||
hasMore && <> | |||||
<Flex justify='flex-end' style={{ | |||||
}}> | |||||
<Button size='small' shape="round"> | |||||
<Link to={{ pathname: link }} style={{ fontWeight: 'bold', color: '#000000' }}> | |||||
更多 | |||||
</Link> | |||||
</Button> | |||||
</Flex> | |||||
</> | |||||
} | |||||
</Flex> | </Flex> | ||||
</ConfigProvider> | </ConfigProvider> | ||||
import { useState, useEffect, useRef } from 'react'; | |||||
import { ProList, PageContainer } from '@ant-design/pro-components'; | |||||
import { ConfigProvider, Button, Flex, Input, Space, Tabs, Tooltip, Row, Col, Pagination, Tag, Image, Affix, Typography, Anchor } from 'antd'; | |||||
import { SearchOutlined, LikeOutlined, ArrowRightOutlined, RightOutlined } from '@ant-design/icons'; | |||||
import { useModel, connect, history, Link } from 'umi'; | |||||
import { Imageprefix } from '@/constants/index' | |||||
import { GetSectionList, GetArticleList, GetSectionDetailByCode } from '@/services/apis/information'; | |||||
import TitleIndex from '@/components/Common/Title'; | |||||
import EmptyResult from '@/components/Common/EmptyResult' | |||||
interface TitleProps { | |||||
id: any, | |||||
} | |||||
const PartnerNews: React.FC<TitleProps> = ({ id }: any) => { | |||||
const [list, setList] = useState<object[]>([]) | |||||
const [total, setTotal] = useState<number>(0) | |||||
const [page, setPage] = useState<number>(1) | |||||
const [pageSize, setPageSize] = useState<number>(7) | |||||
useEffect(() => { | |||||
if (id) { | |||||
GetArticleList({ page: 1, pagesize: 10, section_id: id }).then(res => { | |||||
setList(res.data.articles && res.data.articles.length > 0 ? res.data.articles : []) | |||||
setTotal(res.data.total) | |||||
}) | |||||
} | |||||
}, [id]); | |||||
return ( | |||||
<> | |||||
<ConfigProvider | |||||
theme={{ | |||||
token: { | |||||
colorPrimary: '#19be6e', | |||||
}, | |||||
components: { | |||||
Button: { | |||||
colorText: '#19be6e' | |||||
} | |||||
} | |||||
}} | |||||
> | |||||
<div style={{ minHeight: 300 }}> | |||||
<Space direction='vertical' size={10} style={{ width: '100%' }}> | |||||
{ | |||||
list && list.length > 0 && list.map((item, index) => ( | |||||
<> | |||||
<Link to={{ pathname: `/sciencetechnologypark/information/detail?id=${item.id}` }} target='_blank'> | |||||
<Flex justify='space-between' align='center' style={{ width: '100%', padding: '16px', color: '#000000', background: '#ffffff', borderRadius: 8, cursor: 'pointer' }}> | |||||
<Space size={20}> | |||||
<Image src={`${Imageprefix}${item.cover_img}`} width={100} height={100}></Image> | |||||
<h3>{item.title}</h3> | |||||
</Space> | |||||
<Space size={20}> | |||||
<div> | |||||
{item.updated_at} | |||||
</div> | |||||
<RightOutlined /> | |||||
</Space> | |||||
</Flex> | |||||
</Link> | |||||
</> | |||||
)) | |||||
} | |||||
{ | |||||
!list || list.length == 0 && <Flex justify='center' align='center' style={{ padding: '16px', borderRadius: 8, cursor: 'pointer' }}> | |||||
<EmptyResult description="暂无数据" /> | |||||
</Flex> | |||||
} | |||||
</Space> | |||||
<Flex justify='center' align='center' style={{ margin: '40px 0' }}> | |||||
<Pagination | |||||
hideOnSinglePage | |||||
total={total} | |||||
showTotal={(total) => `总共${total}条`} | |||||
current={page} | |||||
pageSize={pageSize} | |||||
pageSizeOptions={['12', '24', '36']} | |||||
onChange={(page, pageSize) => { | |||||
setPage(page) | |||||
setPageSize(pageSize) | |||||
GetArticleList({ page: 1, pagesize: 10, section_id: id }).then(res => { | |||||
setList(res.data.articles && res.data.articles.length > 0 ? res.data.articles : []) | |||||
setTotal(res.data.total) | |||||
}) | |||||
}} | |||||
/> | |||||
</Flex> | |||||
</div> | |||||
</ConfigProvider > | |||||
</> | |||||
); | |||||
}; | |||||
export default PartnerNews; |
import { useState, useEffect, useRef } from 'react'; | |||||
import { useModel, connect, history, Link } from 'umi'; | |||||
import { ConfigProvider, Button, Flex, Input, Space, Image, Select, Row, Col, Carousel, Tag, Card, Avatar, Typography } from 'antd'; | |||||
import { Imageprefix } from '@/constants/index' | |||||
import he from 'he'; | |||||
import { GetSectionList, GetArticleList, GetArticleDetail, GetSectionDetailByCode } from '@/services/apis/information'; | |||||
import EmptyResult from '@/components/Common/EmptyResult' | |||||
interface TitleProps { | |||||
id: any, | |||||
} | |||||
const ScienceTechnologyParkHomeIntroduction: React.FC<TitleProps> = ({ id }: any) => { | |||||
const [detail, setDetail] = useState<object | null>(null) | |||||
useEffect(() => { | |||||
console.log(id) | |||||
if (id) { | |||||
GetArticleList({ page: 1, pagesize: 10, section_id: id }).then(res => { | |||||
if (res.data.articles && res.data.articles.length > 0) { | |||||
GetArticleDetail({ id: res.data.articles[0].id }).then(res => { | |||||
setDetail(res.data) | |||||
}) | |||||
} | |||||
}) | |||||
} | |||||
}, [id]); | |||||
return ( | |||||
<> | |||||
<ConfigProvider | |||||
theme={{ | |||||
token: { | |||||
colorPrimary: '#19be6e', | |||||
}, | |||||
components: { | |||||
Button: { | |||||
colorText: '#19be6e' | |||||
} | |||||
} | |||||
}} | |||||
> | |||||
{ | |||||
detail && | |||||
<div style={{ minHeight: 300, background: '#f2f2f2', borderRadius: 8, padding: 20, lineHeight: 2 }}> | |||||
<div dangerouslySetInnerHTML={{ __html: he.decode(detail.content) }} /> | |||||
</div> | |||||
} | |||||
{ | |||||
!detail && < Flex justify='center' align='center' style={{ padding: '16px', borderRadius: 8, cursor: 'pointer' }}> | |||||
<EmptyResult description="暂无数据" /> | |||||
</Flex> | |||||
} | |||||
</ConfigProvider > | |||||
</> | |||||
); | |||||
}; | |||||
export default ScienceTechnologyParkHomeIntroduction; | |||||
import { useState, useEffect, useRef } from 'react'; | |||||
import { ProList, PageContainer } from '@ant-design/pro-components'; | |||||
import { ConfigProvider, Button, Flex, Input, Space, Tabs, Tooltip, Row, Col, Pagination, Tag, Image, Affix, Typography, Anchor } from 'antd'; | |||||
import { SearchOutlined, LikeOutlined, ArrowRightOutlined, RightOutlined } from '@ant-design/icons'; | |||||
import { useModel, connect, history, Link } from 'umi'; | |||||
import { Imageprefix } from '@/constants/index' | |||||
import { GetSectionList, GetArticleList, GetSectionDetailByCode } from '@/services/apis/information'; | |||||
import TitleIndex from '@/components/Common/Title'; | |||||
import EmptyResult from '@/components/Common/EmptyResult' | |||||
interface TitleProps { | |||||
id: any, | |||||
} | |||||
const PartnerNews: React.FC<TitleProps> = ({ id }: any) => { | |||||
const [list, setList] = useState<object[]>([]) | |||||
const [total, setTotal] = useState<number>(0) | |||||
const [page, setPage] = useState<number>(1) | |||||
const [pageSize, setPageSize] = useState<number>(7) | |||||
useEffect(() => { | |||||
if (id) { | |||||
GetArticleList({ page: 1, pagesize: 10, section_id: id }).then(res => { | |||||
setList(res.data.articles && res.data.articles.length > 0 ? res.data.articles : []) | |||||
setTotal(res.data.total) | |||||
}) | |||||
} | |||||
}, [id]); | |||||
return ( | |||||
<> | |||||
<ConfigProvider | |||||
theme={{ | |||||
token: { | |||||
colorPrimary: '#19be6e', | |||||
}, | |||||
components: { | |||||
Button: { | |||||
colorText: '#19be6e' | |||||
} | |||||
} | |||||
}} | |||||
> | |||||
<div style={{ minHeight: 300 }}> | |||||
<Space direction='vertical' size={10} style={{ width: '100%' }}> | |||||
{ | |||||
list && list.length > 0 && list.map((item, index) => ( | |||||
<> | |||||
<Link to={{ pathname: `/sciencetechnologypark/information/detail?id=${item.id}` }} target='_blank'> | |||||
<Flex justify='space-between' align='center' style={{ width: '100%', padding: '16px', color: '#000000', background: '#ffffff', borderRadius: 8, cursor: 'pointer' }}> | |||||
<Space size={20}> | |||||
<Image src={`${Imageprefix}${item.cover_img}`} width={100} height={100}></Image> | |||||
<h3>{item.title}</h3> | |||||
</Space> | |||||
<Space size={20}> | |||||
<div> | |||||
{item.updated_at} | |||||
</div> | |||||
<RightOutlined /> | |||||
</Space> | |||||
</Flex> | |||||
</Link> | |||||
</> | |||||
)) | |||||
} | |||||
{ | |||||
!list || list.length == 0 && <Flex justify='center' align='center' style={{ padding: '16px', borderRadius: 8, cursor: 'pointer' }}> | |||||
<EmptyResult description="暂无数据" /> | |||||
</Flex> | |||||
} | |||||
</Space> | |||||
<Flex justify='center' align='center' style={{ margin: '40px 0' }}> | |||||
<Pagination | |||||
hideOnSinglePage | |||||
total={total} | |||||
showTotal={(total) => `总共${total}条`} | |||||
current={page} | |||||
pageSize={pageSize} | |||||
pageSizeOptions={['12', '24', '36']} | |||||
onChange={(page, pageSize) => { | |||||
setPage(page) | |||||
setPageSize(pageSize) | |||||
GetArticleList({ page: 1, pagesize: 10, section_id: id }).then(res => { | |||||
setList(res.data.articles && res.data.articles.length > 0 ? res.data.articles : []) | |||||
setTotal(res.data.total) | |||||
}) | |||||
}} | |||||
/> | |||||
</Flex> | |||||
</div> | |||||
</ConfigProvider > | |||||
</> | |||||
); | |||||
}; | |||||
export default PartnerNews; |
import TitleIndex from '@/components/Common/Title'; | import TitleIndex from '@/components/Common/Title'; | ||||
import EmptyResult from '@/components/Common/EmptyResult' | import EmptyResult from '@/components/Common/EmptyResult' | ||||
import PartnerIntroduction from '@/components/Partner/Introduction' | |||||
import PartnerNews from '@/components/Partner/News' | |||||
import PartnerConversion from '@/components/Partner/Conversion' | |||||
const HomeNewJob: React.FC = () => { | const HomeNewJob: React.FC = () => { | ||||
const [list, setList] = useState<object[]>([]) | const [list, setList] = useState<object[]>([]) | ||||
const [total, setTotal] = useState<number>(0) | |||||
const [page, setPage] = useState<number>(1) | |||||
const [pageSize, setPageSize] = useState<number>(12) | |||||
const [introductionSectionId, setIntroductionSectionId] = useState<number>() | |||||
const [newsSectionId, setNewsSectionId] = useState<number>() | |||||
const [conversionSectionId, setConversionSectionId] = useState<number>() | |||||
const [selectedTags, setSelectedTags] = useState<string[]>(['']); | const [selectedTags, setSelectedTags] = useState<string[]>(['']); | ||||
setList(res.data.childs ? res.data.childs : []) | setList(res.data.childs ? res.data.childs : []) | ||||
if (res.data.childs && res.data.childs.length > 0) { | if (res.data.childs && res.data.childs.length > 0) { | ||||
setSelectedTags(res.data.childs[0].name) | setSelectedTags(res.data.childs[0].name) | ||||
setIntroductionSectionId(res.data.childs[0].childs[0].id) | |||||
setNewsSectionId(res.data.childs[0].childs[1].id) | |||||
setConversionSectionId(res.data.childs[0].childs[2].id) | |||||
} | } | ||||
}) | }) | ||||
}, []); | }, []); | ||||
const handleChange = (tag: object, checked: boolean) => { | |||||
const handleChange = async (tag: object, checked: boolean) => { | |||||
const nextSelectedTags = checked | const nextSelectedTags = checked | ||||
? [tag.name] | ? [tag.name] | ||||
: selectedTags.filter((t) => t !== tag.name); | : selectedTags.filter((t) => t !== tag.name); | ||||
setSelectedTags(nextSelectedTags); | setSelectedTags(nextSelectedTags); | ||||
if (tag.childs && tag.childs.length > 0) { | if (tag.childs && tag.childs.length > 0) { | ||||
getIntroductionData(tag.childs) | |||||
getNewsData(tag.childs) | |||||
getConversionData(tag.childs) | |||||
console.log(tag.childs[0].id) | |||||
setIntroductionSectionId(tag.childs[0] && tag.childs[0].id ? tag.childs[0].id : 0) | |||||
setNewsSectionId(tag.childs[1] && tag.childs[1].id ? tag.childs[1].id : 0) | |||||
setConversionSectionId(tag.childs[2] && tag.childs[2].id ? tag.childs[2].id : 0) | |||||
} | } | ||||
}; | |||||
const [introduction, setIntroduction] = useState<object | null>(null); | |||||
// const getIntroductionData = async (value) => { | |||||
// let res = await GetArticleList({ section_id: value[0].id }) | |||||
// setIntroduction(res.data.articles && res.data.articles.length > 0 ? res.data.articles[0].content : null) | |||||
// }; | |||||
// const [newsList, setNewsList] = useState<object | null>(null); | |||||
// const getNewsData = async (value) => { | |||||
// let res = await GetArticleList({ section_id: value[0].id }) | |||||
// setNewsList(res.data.articles && res.data.articles.length > 0 ? res.data.articles[0].content : null) | |||||
// }; | |||||
// const [conversionList, setConversionList] = useState<object | null>(null); | |||||
// const getConversionData = async (value) => { | |||||
// let res = await GetArticleList({ section_id: value[0].id }) | |||||
// setConversionList(res.data.articles && res.data.articles.length > 0 ? res.data.articles[0].content : null) | |||||
// }; | |||||
}; | |||||
} | } | ||||
</Flex > | </Flex > | ||||
<PageContainer header={{ title: '' }} style={{ minHeight: 1000 }}> | <PageContainer header={{ title: '' }} style={{ minHeight: 1000 }}> | ||||
<TitleIndex title="合作伙伴简介" link="/sciencetechnologypark/news"></TitleIndex> | |||||
{ | |||||
introduction && <> | |||||
<div style={{ minHeight: 300, background: '#f2f2f2', borderRadius: 8, padding: 20, lineHeight: 2 }}> | |||||
<div dangerouslySetInnerHTML={{ __html: he.decode(introduction) }} /> | |||||
</div> | |||||
</> | |||||
} | |||||
{ | |||||
!introduction && <Flex justify='center' align='center' style={{ padding: '16px', borderRadius: 8, cursor: 'pointer' }}> | |||||
<EmptyResult description="暂无数据" /> | |||||
</Flex> | |||||
} | |||||
<TitleIndex title="新闻栏目" link="/sciencetechnologypark/news"></TitleIndex> | |||||
<TitleIndex title="成果转化" link="/sciencetechnologypark/news"></TitleIndex> | |||||
<TitleIndex title="合作伙伴简介" link='' hasMore={false}></TitleIndex> | |||||
<PartnerIntroduction id={introductionSectionId}></PartnerIntroduction> | |||||
<TitleIndex title="新闻栏目" link='' hasMore={false}></TitleIndex> | |||||
<PartnerNews id={newsSectionId}></PartnerNews> | |||||
<TitleIndex title="成果转化" link='' hasMore={false}></TitleIndex> | |||||
<PartnerConversion id={conversionSectionId}></PartnerConversion> | |||||
</PageContainer> | </PageContainer> | ||||