build
This commit is contained in:
parent
18595a4802
commit
45d9f22477
|
|
@ -11,16 +11,18 @@ function HeaderPage(props){
|
|||
const [ personList , setPersonList ] = useState(undefined);
|
||||
const [ newsList, setNewsList ] = useState(undefined);
|
||||
const { deptId } = props.match.params;
|
||||
const { data } = props;
|
||||
const { data,address } = props;
|
||||
|
||||
useEffect(()=>{
|
||||
getProjectList();
|
||||
getNewsList();
|
||||
getPersonList();
|
||||
},[])
|
||||
if(address){
|
||||
getProjectList();
|
||||
getNewsList();
|
||||
getPersonList();
|
||||
}
|
||||
},[address])
|
||||
|
||||
function getPersonList(){
|
||||
const url = `/zone/open/${deptId}/member/homePageList`;
|
||||
const url = `${address}/zone/open/${deptId}/member/homePageList`;
|
||||
axios.get(url).then(result=>{
|
||||
if(result){
|
||||
setPersonList(result.data.rows);
|
||||
|
|
@ -29,7 +31,7 @@ function HeaderPage(props){
|
|||
}
|
||||
|
||||
function getNewsList(){
|
||||
const url = `/cms/doc/open/zone/${deptId}/homePageDocList`;
|
||||
const url = `${address}/cms/doc/open/zone/${deptId}/homePageDocList`;
|
||||
axios.get(url).then(result=>{
|
||||
if(result){
|
||||
setNewsList(result.data.rows);
|
||||
|
|
@ -38,7 +40,7 @@ function HeaderPage(props){
|
|||
}
|
||||
|
||||
function getProjectList(){
|
||||
const url = `/zone/open/${deptId}/project/list`;
|
||||
const url = `${address}/zone/open/${deptId}/project/list`;
|
||||
axios.get(url,{params:{
|
||||
isHomepage:1
|
||||
}}).then(result=>{
|
||||
|
|
@ -49,28 +51,28 @@ function HeaderPage(props){
|
|||
}
|
||||
return(
|
||||
<div className="zone_box">
|
||||
<p className="in_title">{data && data.firstTitle}</p>
|
||||
<div className="boxmain zone_infos">
|
||||
{
|
||||
data &&
|
||||
<div className="zone_infos_desc">
|
||||
<p className="z_name">{data.introductionTitle}</p>
|
||||
<p className="z_desc task-hide-2">{data.introductionContent}</p>
|
||||
</div>
|
||||
}
|
||||
{
|
||||
data && data.introductionImage &&
|
||||
<img src={data.introductionImage} alt="" width="474px" height="277px"/>
|
||||
}
|
||||
</div>
|
||||
{data && <p className="in_title">{data.firstTitle}</p> }
|
||||
{
|
||||
data && (data.introductionTitle || data.introductionContent || data.introductionImage) &&
|
||||
<div className="boxmain zone_infos">
|
||||
<div className="zone_infos_desc">
|
||||
<p className="z_name">{data.introductionTitle}</p>
|
||||
<p className="z_desc task-hide-2">{data.introductionContent}</p>
|
||||
</div>
|
||||
{
|
||||
data.introductionImage &&
|
||||
<img src={data.introductionImage} alt="" width="474px" height="277px"/>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
<div className="zone_news">
|
||||
<p className="in_title mb40">新闻动态</p>
|
||||
{
|
||||
newsList && newsList.length>0 &&
|
||||
<div className="boxmain" style={{display:"flex"}}>
|
||||
<div className="zone_new_first">
|
||||
<img src={newsList[0].headImg || img1} alt="" height="302px" className="mb30"/>
|
||||
<p className="zone_n_title task-hide">{newsList[0].name}</p>
|
||||
<img src={newsList[0].headImg || img1} alt="" height="302px" style={{width:"100%",objectFit:"cover"}} className="mb30"/>
|
||||
<Link to={`/information/${deptId}/newdetail/${newsList[0].id}`} className="zone_n_title task-hide">{newsList[0].name}</Link>
|
||||
<p className="zone_n_desc task-hide-2">{newsList[0].summary}</p>
|
||||
<p className="font-13 mt10 flexCenter" style={{color:"#8d95a3"}}>
|
||||
<img src={shijian} alt="" className="mr3" />
|
||||
|
|
@ -113,7 +115,7 @@ function HeaderPage(props){
|
|||
<li>
|
||||
<div className="imgBox">{i.projectProperties && i.projectProperties.authorImageUrl && <img src={i.projectProperties.authorImageUrl} alt="" /> }</div>
|
||||
<div className="infoBox">
|
||||
<a onClick={()=>window.open(i.projectURL)} className="z_p_title">{i.projectProperties && i.projectProperties.name}</a>
|
||||
<a onClick={()=>window.open(i.projectURL)} className="z_p_title task-hide">{i.projectProperties && i.projectProperties.name}</a>
|
||||
<p className="z_p_desc task-hide-2">{i.projectProperties && i.projectProperties.description ? i.projectProperties.description : "暂无~"}</p>
|
||||
</div>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -18,18 +18,19 @@ function Main(props){
|
|||
const [ hotList , setHotList ] = useState(undefined);
|
||||
const [ isSpin , setIsSpin ] = useState(true);
|
||||
const { deptId } = props.match.params;
|
||||
const { address } = props;
|
||||
|
||||
|
||||
useEffect(()=>{
|
||||
if(deptId) {
|
||||
if(deptId && address) {
|
||||
setIsSpin(true);
|
||||
getMainList();
|
||||
getHotList();
|
||||
}
|
||||
},[deptId])
|
||||
},[deptId, address])
|
||||
|
||||
function getMainList(){
|
||||
const url = `/cms/doc/open/zone/${deptId}/docOverviewList`;
|
||||
const url = `${address}/cms/doc/open/zone/${deptId}/docOverviewList`;
|
||||
axios.get(url,{
|
||||
params:{
|
||||
pageSize:10,pageNum:1
|
||||
|
|
@ -43,7 +44,7 @@ function Main(props){
|
|||
}
|
||||
|
||||
function getHotList(){
|
||||
const url = `/cms/doc/open/zone/${deptId}/hotDocList`;
|
||||
const url = `${address}/cms/doc/open/zone/${deptId}/hotDocList`;
|
||||
axios.get(url,{
|
||||
params:{pageSize:15,pageNum:1}
|
||||
}).then(result=>{
|
||||
|
|
@ -56,21 +57,9 @@ function Main(props){
|
|||
function clickTab(k,idName){
|
||||
setKey(k);
|
||||
}
|
||||
// const hash = props.history.location.hash;
|
||||
|
||||
// useEffect(()=>{
|
||||
// if(hash){
|
||||
// setTimeout(()=>{
|
||||
// let top =document.documentElement.scrollTop;
|
||||
// console.log(document.documentElement.scrollTop);
|
||||
// window.scrollTo(0,top-120);
|
||||
// },50)
|
||||
// }
|
||||
// },[hash])
|
||||
|
||||
return(
|
||||
<div>
|
||||
{/* <Banner {...props}/> */}
|
||||
<div className="main_content">
|
||||
<div id={`main_card_item_1`} style={{opacity:"0"}}></div>
|
||||
<p className="in_title">领域资讯</p>
|
||||
|
|
@ -100,7 +89,7 @@ function Main(props){
|
|||
return(
|
||||
<div className="main_card radius4">
|
||||
<div className="guide">
|
||||
<span><span className="task-hide">{i.name}</span></span>
|
||||
<span className="task-hide">{i.name}</span>
|
||||
<Link className="flexCenter" to={`/information/${deptId}/news/${i.id}`}>更多<img src={guideArrow} alt="" width="14px"/></Link>
|
||||
</div>
|
||||
<div>
|
||||
|
|
@ -109,7 +98,7 @@ function Main(props){
|
|||
<React.Fragment>
|
||||
{i.cmsDocList.map((j,e)=>{
|
||||
return(
|
||||
<div className="main_card_item">
|
||||
<div className="main_card_item" onClick={()=>{props.history.push(`/information/${deptId}/newdetail/${j.id}`)}}>
|
||||
{e===0 &&
|
||||
(
|
||||
j.headImg ?
|
||||
|
|
|
|||
|
|
@ -10,15 +10,16 @@ function NewsDetail(props){
|
|||
const { deptId , id } = props.match.params;
|
||||
const [ detail , setDetail ] = useState(undefined);
|
||||
const [ cmsDir , setCmsDir ] = useState(undefined);
|
||||
const { address } = props;
|
||||
|
||||
useEffect(()=>{
|
||||
if(id){
|
||||
if(id && address){
|
||||
getDetails();
|
||||
}
|
||||
},[id])
|
||||
},[id,address])
|
||||
|
||||
function getDetails(){
|
||||
const url = `/cms/doc/open/${id}`;
|
||||
const url = `${address}/cms/doc/open/${id}`;
|
||||
axios.get(url).then(result=>{
|
||||
if(result){
|
||||
let data = result.data.data;
|
||||
|
|
|
|||
|
|
@ -20,13 +20,14 @@ function NewsList(props){
|
|||
const [ mainList , setMainList ] = useState(undefined);
|
||||
const [ details , setDetails ] = useState(undefined);
|
||||
const [ menuSpin , setMenuSpin ] = useState(true);
|
||||
const { address } = props;
|
||||
|
||||
|
||||
useEffect(()=>{
|
||||
if(deptId && cateId){
|
||||
if(deptId && cateId && address){
|
||||
getMainList();
|
||||
}
|
||||
},[deptId,cateId,pageNum])
|
||||
},[deptId,cateId,pageNum,address])
|
||||
|
||||
|
||||
|
||||
|
|
@ -41,7 +42,7 @@ function NewsList(props){
|
|||
},[deptId,cateId])
|
||||
|
||||
function getColumnDetail(){
|
||||
const url = `/cms/doc/open/dir/${cateId}`;
|
||||
const url = `${address}/cms/doc/open/dir/${cateId}`;
|
||||
axios.get(url).then(result=>{
|
||||
if(result){
|
||||
setDetails(result.data.data);
|
||||
|
|
@ -50,7 +51,7 @@ function NewsList(props){
|
|||
}
|
||||
|
||||
function getColumnList(){
|
||||
const url = `/cms/doc/open/zone/${deptId}/dirList`;
|
||||
const url = `${address}/cms/doc/open/zone/${deptId}/dirList`;
|
||||
axios.get(url).then(result=>{
|
||||
if(result){
|
||||
setColumnList(result.data.rows);
|
||||
|
|
@ -61,7 +62,7 @@ function NewsList(props){
|
|||
}
|
||||
|
||||
function getMainList(){
|
||||
const url = `/cms/doc/open/dir/${cateId}/docList`;
|
||||
const url = `${address}/cms/doc/open/dir/${cateId}/docList`;
|
||||
axios.get(url,{
|
||||
params:{
|
||||
pageNum,pageSize
|
||||
|
|
@ -75,7 +76,7 @@ function NewsList(props){
|
|||
}
|
||||
|
||||
function getHotList(){
|
||||
const url = `/cms/doc/open/dir/${cateId}/hotDocList`;
|
||||
const url = `${address}/cms/doc/open/dir/${cateId}/hotDocList`;
|
||||
axios.get(url,{
|
||||
params:{
|
||||
pageNum:1,pageSize:15
|
||||
|
|
@ -120,7 +121,7 @@ function NewsList(props){
|
|||
mainList && mainList.length>0 ?
|
||||
mainList.map((i,k)=>{
|
||||
return(
|
||||
<div className="main_card_item" key={k}>
|
||||
<div className="main_card_item" onClick={()=>{props.history.push(`/information/${deptId}/newdetail/${i.id}`)}} key={k}>
|
||||
{
|
||||
i.headImg ?
|
||||
<img src={i.headImg} alt=""/>
|
||||
|
|
|
|||
|
|
@ -18,22 +18,23 @@ function ProjectSource(props){
|
|||
const [ searchName , setSearchName ] = useState(undefined);
|
||||
const [ value , setValue ] = useState(undefined);
|
||||
const [ loading , setLoading ] = useState(false);
|
||||
const { address} = props;
|
||||
|
||||
useEffect(()=>{
|
||||
if(deptId){
|
||||
if(deptId && address){
|
||||
getTypeList();
|
||||
}
|
||||
},[deptId])
|
||||
},[deptId,address])
|
||||
|
||||
useEffect(()=>{
|
||||
if(deptId){
|
||||
if(deptId && address){
|
||||
setLoading(true);
|
||||
getLists();
|
||||
}
|
||||
},[deptId,typeId,page,searchName])
|
||||
},[deptId,address,typeId,page,searchName])
|
||||
|
||||
function getLists(){
|
||||
const url = `/zone/open/${deptId}/project/list`;
|
||||
const url = `${address}/zone/open/${deptId}/project/list`;
|
||||
axios.get(url,{
|
||||
params:{
|
||||
pageNum:page,
|
||||
|
|
@ -52,7 +53,7 @@ function ProjectSource(props){
|
|||
|
||||
|
||||
function getTypeList(){
|
||||
const url = `/zone/open/${deptId}/projectType/list`;
|
||||
const url = `${address}/zone/open/${deptId}/projectType/list`;
|
||||
axios.get(url).then(result=>{
|
||||
if(result){
|
||||
setTypeList(result.data.rows);
|
||||
|
|
|
|||
|
|
@ -9,16 +9,17 @@ function ZoneVIP(props){
|
|||
const { deptId } = props.match.params;
|
||||
const [ vipLists , setVIPLists ] = useState(undefined);
|
||||
const [ isSpin , setIsSpin ] = useState(true);
|
||||
const { address } = props;
|
||||
|
||||
useEffect(()=>{
|
||||
if(deptId){
|
||||
if(deptId && address){
|
||||
setIsSpin(true);
|
||||
getLists();
|
||||
}
|
||||
},[deptId])
|
||||
},[deptId , address])
|
||||
|
||||
function getLists(){
|
||||
const url = `/zone/open/${deptId}/member/overviewList`;
|
||||
const url = `${address}/zone/open/${deptId}/member/overviewList`;
|
||||
axios.get(url).then(response=>{
|
||||
if(response){
|
||||
setVIPLists(response.data.rows);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import Loadable from "react-loadable";
|
|||
import Loading from "../../Loading";
|
||||
import axios from 'axios';
|
||||
import PublicBanner from "./Component/publicBanner";
|
||||
import { isDev } from 'educoder';
|
||||
import './index.scss';
|
||||
|
||||
const VIP = Loadable({
|
||||
|
|
@ -40,37 +39,47 @@ const Main = Loadable({
|
|||
function Index(props){
|
||||
const [ data , setData ] = useState(undefined);
|
||||
const [ adminUrl , setAdminUrl ] = useState(undefined);
|
||||
const [ address , setAddress ] = useState("");
|
||||
const { deptId } = props.match.params;
|
||||
const isDev = window.location.port === '3007' || window.location.origin === "https://testforgeplus.trustie.net";
|
||||
console.log(isDev,window.location);
|
||||
|
||||
useEffect(()=>{
|
||||
axios.interceptors.request.use(
|
||||
config => {
|
||||
var localproxy = "https://testgetway.trustie.net";
|
||||
var proxy = "";
|
||||
let url = "/api" +config.url;
|
||||
if(isDev){
|
||||
url = localproxy + url ;
|
||||
}else{
|
||||
url = proxy + url;
|
||||
}
|
||||
config.url =url;
|
||||
return config;
|
||||
},
|
||||
err => {
|
||||
return Promise.reject(err);
|
||||
}
|
||||
)
|
||||
const isDev = window.location.port === '3007' || window.location.origin === "https://testforgeplus.trustie.net";
|
||||
console.log(isDev,window.location.hostname);
|
||||
if(isDev === true){
|
||||
setAddress("https://testgetway.trustie.net/api");
|
||||
}else{
|
||||
setAddress("https://gateway.gitlink.org.cn/api");
|
||||
}
|
||||
// axios.interceptors.request.use(
|
||||
// config => {
|
||||
// var localproxy = "https://testgetway.trustie.net";
|
||||
// var proxy = "";
|
||||
// let url = "/api" +config.url;
|
||||
// if(isDev){
|
||||
// url = localproxy + url ;
|
||||
// }else{
|
||||
// url = proxy + url;
|
||||
// }
|
||||
// config.url =url;
|
||||
// return config;
|
||||
// },
|
||||
// err => {
|
||||
// return Promise.reject(err);
|
||||
// }
|
||||
// )
|
||||
},[])
|
||||
|
||||
useEffect(()=>{
|
||||
if(deptId){
|
||||
if(deptId && address){
|
||||
getDetail();
|
||||
getAdminUrl();
|
||||
}
|
||||
},[deptId])
|
||||
},[deptId,address])
|
||||
|
||||
function getAdminUrl(){
|
||||
const url = `/zone/zoneDetail/${deptId}/checkZoneRole`;
|
||||
const url = `${address}/zone/zoneDetail/${deptId}/checkZoneRole`;
|
||||
axios.get(url).then(response=>{
|
||||
if(response && response.data.code === 200){
|
||||
setAdminUrl(response.data.data);
|
||||
|
|
@ -81,7 +90,7 @@ function Index(props){
|
|||
}
|
||||
|
||||
function getDetail(){
|
||||
const url = `/zone/open/${deptId}`;
|
||||
const url = `${address}/zone/open/${deptId}`;
|
||||
axios.get(url).then(result=>{
|
||||
if(result){
|
||||
let data = result.data.data;
|
||||
|
|
@ -92,42 +101,42 @@ function Index(props){
|
|||
}
|
||||
return(
|
||||
<div className="information_main">
|
||||
<PublicBanner {...props} data={data} adminUrl={adminUrl} />
|
||||
<PublicBanner {...props} data={data} adminUrl={adminUrl}/>
|
||||
<Switch>
|
||||
<Route
|
||||
path="/information/:deptId/news/:cateId"
|
||||
render={(p) => (
|
||||
<NewsList {...props} {...p}/>
|
||||
<NewsList {...props} {...p} address={address}/>
|
||||
)}
|
||||
></Route>
|
||||
<Route
|
||||
path="/information/:deptId/newdetail/:id"
|
||||
render={(p) => (
|
||||
<NewsDetail {...props} {...p}/>
|
||||
<NewsDetail {...props} {...p} address={address}/>
|
||||
)}
|
||||
></Route>
|
||||
<Route
|
||||
path="/information/:deptId/VIP"
|
||||
render={(p) => (
|
||||
<VIP {...props} {...p}/>
|
||||
<VIP {...props} {...p} address={address}/>
|
||||
)}
|
||||
></Route>
|
||||
<Route
|
||||
path="/information/:deptId/projects"
|
||||
render={(p) => (
|
||||
<ProjectSource {...props} {...p}/>
|
||||
<ProjectSource {...props} {...p} address={address}/>
|
||||
)}
|
||||
></Route>
|
||||
<Route
|
||||
path="/information/:deptId/news"
|
||||
render={(p) => (
|
||||
<Main {...props} {...p}/>
|
||||
<Main {...props} {...p} address={address}/>
|
||||
)}
|
||||
></Route>
|
||||
<Route
|
||||
path="/information/:deptId"
|
||||
render={(p) => (
|
||||
<HeaderPage {...props} {...p} data={data}/>
|
||||
<HeaderPage {...props} {...p} data={data} address={address}/>
|
||||
)}
|
||||
></Route>
|
||||
</Switch>
|
||||
|
|
|
|||
|
|
@ -176,6 +176,7 @@
|
|||
display: flex;
|
||||
padding:24px 0px;
|
||||
border-bottom: 1px solid rgba(170, 175, 190, 0.15);
|
||||
cursor: pointer;
|
||||
&:last-child{
|
||||
border-bottom: none;
|
||||
}
|
||||
|
|
@ -220,6 +221,9 @@
|
|||
display: block;
|
||||
line-height: 25px;
|
||||
word-break: break-all;
|
||||
&:hover{
|
||||
color: #466aff;
|
||||
}
|
||||
&.sub_i{
|
||||
padding-left: 18px;
|
||||
&::before{
|
||||
|
|
@ -244,14 +248,17 @@
|
|||
margin-bottom: 5px;
|
||||
&>span{
|
||||
display: block;
|
||||
width: 113px;
|
||||
width: auto;
|
||||
min-width: 112px;
|
||||
max-width: 480px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
padding-left: 9px;
|
||||
padding:0px 13px 0px 8px;
|
||||
color: #fff;
|
||||
font-size:17px;
|
||||
background-image: url(./img/guide.png);
|
||||
background-size: 100% 100%;
|
||||
background-repeat: no-repeat;
|
||||
span{
|
||||
display: block;
|
||||
max-width: 100px;
|
||||
|
|
@ -606,6 +613,7 @@
|
|||
font-size:17px;
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
display: block;
|
||||
&:hover{
|
||||
color: #466aff;
|
||||
}
|
||||
|
|
@ -647,6 +655,7 @@
|
|||
padding:30px;
|
||||
flex:1;
|
||||
border-radius: 4px;
|
||||
width: 0;
|
||||
}
|
||||
.zone_new_three{
|
||||
margin-left: 30px;
|
||||
|
|
@ -708,6 +717,7 @@
|
|||
}
|
||||
.infoBox{
|
||||
flex:1;
|
||||
width: 0;
|
||||
.z_p_title{
|
||||
font-weight:700;
|
||||
color:#1f2329;
|
||||
|
|
|
|||
Loading…
Reference in New Issue