Merge branch 'gitlink_ssr_head' of https://gitlink.org.cn/Gitlink/forgeplus-react into pre_gitlink_ssr
This commit is contained in:
commit
55bd79d245
|
@ -10,6 +10,7 @@ import "slick-carousel/slick/slick.css";
|
|||
import "slick-carousel/slick/slick-theme.css";
|
||||
import Slider from "react-slick";
|
||||
import RightContent from "./rightContent";
|
||||
import { getNewsAllList } from '../../../Information/api';
|
||||
|
||||
// let focuseWorkList = [
|
||||
// {
|
||||
|
@ -68,19 +69,32 @@ const setting = {
|
|||
};
|
||||
|
||||
function Home(props) {
|
||||
const { newsList,timeObj,dayMap,weekMap,monthMap,weatherObj,currentMonth } = props;
|
||||
const {id, newsList,timeObj,dayMap,weekMap,monthMap,weatherObj,currentMonth } = props;
|
||||
const [firstNews, setFirstNews] = useState({});
|
||||
const [focuseWorkList, setFocuseWorkList] = useState([]);
|
||||
const rightContentDom = React.useRef(null)
|
||||
|
||||
// const [focuseWorkList, setFocuseWorkList] = useState([]);
|
||||
useEffect(()=>{
|
||||
let timer = null
|
||||
if(id){
|
||||
getNewsList()
|
||||
timer = setInterval(()=>{
|
||||
getNewsList()
|
||||
},Number(localStorage.getItem('apiTime')) || 300000)
|
||||
return () =>{
|
||||
clearInterval(timer)
|
||||
}
|
||||
}
|
||||
},[id])
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (newsList && newsList.length) {
|
||||
// //重点工作
|
||||
function getNewsList() {
|
||||
getNewsAllList(id).then(result => {
|
||||
if (result && result.data.rows && result.data.rows.length) {
|
||||
let rows = result.data.rows;
|
||||
// //重点工作
|
||||
let allList = [];
|
||||
newsList.map((item) => {
|
||||
rows.map((item) => {
|
||||
if (item.name === "开源中心要闻") {
|
||||
item.cmsDocList.map((item) => {
|
||||
allList.push(item);
|
||||
|
@ -114,9 +128,9 @@ function Home(props) {
|
|||
}
|
||||
});
|
||||
setFocuseWorkList(finalList);
|
||||
}
|
||||
}, newsList);
|
||||
|
||||
}
|
||||
}).catch(error => { })
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="home-wrap">
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.project-wrap {
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
overflow-x: scroll;
|
||||
// overflow-x: scroll;
|
||||
background-image: url(../../img/bj2.png);
|
||||
background-size: 100% 100%;
|
||||
display: flex;
|
||||
|
|
|
@ -6,7 +6,7 @@ import { withRouter } from "react-router";
|
|||
import { ImageLayerOfCommentHOC } from "../../modules/page/layers/ImageLayerOfCommentHOC";
|
||||
import Home from './components/Home/index'
|
||||
import ProjectStatus from './components/ProjectStatus/index'
|
||||
import { getNewsAllList, getMainInfos } from '../Information/api';
|
||||
import { getMainInfos } from '../Information/api';
|
||||
import next from "./img/next.png";
|
||||
import Slider from "react-slick";
|
||||
import './index.scss';
|
||||
|
@ -69,27 +69,6 @@ function Index(props){
|
|||
};
|
||||
},[])
|
||||
|
||||
useEffect(()=>{
|
||||
let timer = null
|
||||
if(id){
|
||||
getNewsList()
|
||||
timer = setInterval(()=>{
|
||||
getNewsList()
|
||||
},Number(localStorage.getItem('apiTime')) || 300000)
|
||||
return () =>{
|
||||
clearInterval(timer)
|
||||
}
|
||||
}
|
||||
},[id])
|
||||
|
||||
function getNewsList() {
|
||||
getNewsAllList(id).then(result => {
|
||||
if (result) {
|
||||
let rows = result.data.rows;
|
||||
setNewsList(rows);
|
||||
}
|
||||
}).catch(error => { })
|
||||
}
|
||||
|
||||
function getId(){
|
||||
getMainInfos('xjykyzx').then(result=>{
|
||||
|
@ -198,7 +177,7 @@ function Index(props){
|
|||
|
||||
return (<div className="softFc-wrap">
|
||||
<Slider {...setting} >
|
||||
<Home newsList={newsList} timeObj={timeObj} dayMap={dayMap} weekMap={weekMap} monthMap={monthMap} weatherObj={weatherObj} currentMonth={currentMonth} key="home" ref={homeDom}/>
|
||||
<Home id={id} newsList={newsList} timeObj={timeObj} dayMap={dayMap} weekMap={weekMap} monthMap={monthMap} weatherObj={weatherObj} currentMonth={currentMonth} key="home" ref={homeDom}/>
|
||||
<ProjectStatus key="project" ref={proDom} projectList={projectList}/>
|
||||
</Slider>
|
||||
</div>)
|
||||
|
|
Loading…
Reference in New Issue