浏览代码

update

master
Soleilw 2 个月前
父节点
当前提交
045bdf3287

+ 1
- 1
dist/index.html 查看文件

@@ -8,6 +8,6 @@
</head>
<body>
<div id="root"></div>
<script src="/umi.369263b5.js"></script>
<script src="/umi.377af00d.js"></script>
</body>
</html>

+ 1
- 0
dist/p__Partner__Home__index.29cff192.async.js
文件差异内容过多而无法显示
查看文件


+ 0
- 1
dist/p__Partner__Home__index.6fcf72ff.async.js 查看文件

@@ -1 +0,0 @@
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[6438],{75270:function(E,t,e){e.r(t);var s=e(5574),a=e.n(s),l=e(67294),u=e(74453),d=e(21532),o=e(92398),_=e(85893),r=function(){var i=(0,l.useState)(!1),n=a()(i,2),P=n[0],c=n[1];return(0,_.jsx)(_.Fragment,{children:(0,_.jsx)(d.ZP,{theme:{token:{colorPrimary:"#19be6e"},components:{Button:{colorText:"#19be6e"}}},children:(0,_.jsx)(u._z,{header:{title:""},style:{minHeight:800},children:(0,_.jsx)(o.Z,{tabPosition:"left",destroyInactiveTabPane:!0,type:"card",items:[{key:"1",label:"\u5408\u4F5C\u4F19\u4F34\u4ECB\u7ECD",children:(0,_.jsx)("div",{children:"\u5408\u4F5C\u4F19\u4F34\u4ECB\u7ECD"})},{key:"2",label:"\u65B0\u95FB\u680F\u76EE",children:(0,_.jsx)("div",{children:"\u65B0\u95FB\u680F\u76EE"})},{key:"3",label:"\u6210\u679C\u8F6C\u5316",children:(0,_.jsx)("div",{children:"\u6210\u679C\u8F6C\u5316"})}]})})})})};t.default=r}}]);

+ 1
- 0
dist/p__ScienceTechnologyPark__Home__index.5e50cf2e.async.js
文件差异内容过多而无法显示
查看文件


+ 0
- 1
dist/p__ScienceTechnologyPark__Home__index.86070dd5.async.js
文件差异内容过多而无法显示
查看文件


dist/umi.377af00d.js
文件差异内容过多而无法显示
查看文件


+ 108
- 61
src/pages/Partner/Home/index.tsx 查看文件

@@ -1,23 +1,76 @@



import { useState, useEffect, useRef } from 'react';
import { ProList, PageContainer } from '@ant-design/pro-components';
import { ConfigProvider, Button, Flex, Input, Space, Image, Segmented, Row, Col, Tabs, Tag, Card, Avatar, Typography, Anchor } from 'antd';
import { SearchOutlined, EllipsisOutlined, ArrowRightOutlined, StarOutlined } from '@ant-design/icons';
import { ConfigProvider, Button, Flex, Input, Space, Image, Select, Row, Col, Tag, Card, Avatar, Typography } from 'antd';
import { SearchOutlined, FireOutlined, RightOutlined, StarOutlined } from '@ant-design/icons';
import { useModel, connect, history, Link } from 'umi';
import routes from './../../../../config/routes';
import { Imageprefix } from '@/constants';

import { GetCompanyFamousList } from '@/services/apis/company';

import { GetSectionList, GetArticleList, GetSectionDetailByCode } from '@/services/apis/information';


import TitleIndex from '@/components/Common/Title';
import EmptyResult from '@/components/Common/EmptyResult'


const HomeNewJob: React.FC = () => {
const [list, setList] = useState<object[]>([])
const [total, setTotal] = useState<number>(0)
const [page, setPage] = useState<number>(1)
const [pageSize, setPageSize] = useState<number>(12)


const [selectedTags, setSelectedTags] = useState<string[]>(['']);

useEffect(() => {
GetSectionDetailByCode({ code: 'KCYHZHB' }).then(res => {
setList(res.data.childs ? res.data.childs : [])
if (res.data.childs && res.data.childs.length > 0) {
setSelectedTags(res.data.childs[0].name)
}
})
}, []);
const handleChange = (tag: object, checked: boolean) => {
const nextSelectedTags = checked
? [tag.name]
: selectedTags.filter((t) => t !== tag.name);
setSelectedTags(nextSelectedTags);
if (tag.childs && tag.childs.length > 0) {
getIntroductionData(tag.childs)
getNewsData(tag.childs)
getConversionData(tag.childs)

}
};


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 HomePage: React.FC = () => {
const [expanded, setExpanded] = useState(false);
// const [conversionList, setConversionList] = useState<object | null>(null);

// const [selectedTags, setSelectedTags] = useState<string[]>([routes[2].routes[0].name]);
// const handleChange = (tag: string, checked: boolean) => {
// const nextSelectedTags = checked
// ? [...selectedTags, tag]
// : selectedTags.filter((t) => t !== tag);
// console.log('You are interested in: ', nextSelectedTags);
// setSelectedTags(nextSelectedTags);
// 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)
// };



return (
<>
<ConfigProvider
@@ -27,62 +80,56 @@ const HomePage: React.FC = () => {
},
components: {
Button: {
colorText: '#19be6e'
colorText: '#19be6e',

}
}
}}
>
{/* <Flex justify='center' align='center' style={{ background: '#ffffff', width: '100%' }}>
<Flex justify='space-between' align='center' style={{ width: '1152px' }}>
<Typography.Paragraph ellipsis={{
rows: 2, expandable: 'collapsible', expanded,
onExpand: (_, info) => setExpanded(info.expanded),
}}>
{
routes[2].routes?.map(item => (<>
<Tag.CheckableTag
key={item.name}
checked={selectedTags.includes(item.name)}
onChange={(checked) => handleChange(item.name, checked)}
style={{ marginBottom: 10, fontSize: 14, padding: 4 }}
>
{item.name}
</Tag.CheckableTag>
</>))
}
</Typography.Paragraph>
</Flex>
</Flex> */}
<PageContainer
header={{ title: '', }}
style={{ minHeight: 800 }}

>

<Tabs
tabPosition='left'
destroyInactiveTabPane={true}
type="card"
items={[{
key: '1',
label: '合作伙伴介绍',
children: <div>合作伙伴介绍</div>
},
{
key: '2',
label: '新闻栏目',
children: <div>新闻栏目</div>
}, {
key: '3',
label: '成果转化',
children: <div>成果转化</div>
}]}
/>
</PageContainer >
<Flex style={{ background: '#ffffff', padding: '20px', width: '100%' }}>
{
list && list.length > 0 && list.map((item, index) => (
<>
<Tag.CheckableTag
key={item.name}
checked={selectedTags.includes(item.name)}
onChange={(checked) => handleChange(item, checked)}
>
{item.name}
</Tag.CheckableTag>
</>
))
}
</Flex >
<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>


</PageContainer>


</ConfigProvider >

</>
);
};

export default HomePage;
export default HomeNewJob;


正在加载...
取消
保存