forked from Gitlink/forgeplus-react
同上-修改细节
This commit is contained in:
parent
691ace31df
commit
6f8a8e099c
|
@ -1,7 +1,6 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import { AlignAJBottom , AlignCenter } from '../../Component/layout';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Spin } from 'antd';
|
||||
import axios from 'axios';
|
||||
|
||||
import Box from './ConcentrateBox';
|
||||
|
@ -9,11 +8,9 @@ import Box from './ConcentrateBox';
|
|||
function ConcentrateProject({userLogin,current}) {
|
||||
const [ list , setList ] = useState(undefined);
|
||||
const [ visible , setVisible ] = useState(false);
|
||||
const [ isSpin , setIsSpin ] = useState(false);
|
||||
const [ value , setValue ] = useState([]);
|
||||
|
||||
useEffect(()=>{
|
||||
setIsSpin(true);
|
||||
getList();
|
||||
},[])
|
||||
|
||||
|
@ -23,7 +20,6 @@ function ConcentrateProject({userLogin,current}) {
|
|||
if(result && result.data){
|
||||
let p = result.data.projects;
|
||||
setList(p);
|
||||
setIsSpin(false);
|
||||
if(p && p.length > 0){
|
||||
let array = p.map(i=>{
|
||||
return i.id
|
||||
|
@ -41,13 +37,12 @@ function ConcentrateProject({userLogin,current}) {
|
|||
}).then(result=>{
|
||||
if(result && result.data){
|
||||
setVisible(false);
|
||||
setIsSpin(true);
|
||||
getList();
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
return(
|
||||
<Spin spinning={isSpin}>
|
||||
<React.Fragment>
|
||||
<Box visible={visible} onCancel={()=>setVisible(false)} onSure={onSure} username={userLogin} choosed={value}/>
|
||||
{
|
||||
list && list.length>0 &&
|
||||
|
@ -80,7 +75,7 @@ function ConcentrateProject({userLogin,current}) {
|
|||
{
|
||||
list && list.length === 0 && current && <div className="ConcentrateTip"><i className="iconfont icon-tishi2"></i>你还没有设置精选项目,<a onClick={()=>setVisible(true)}>点击设置</a></div>
|
||||
}
|
||||
</Spin>
|
||||
</React.Fragment>
|
||||
)
|
||||
}
|
||||
export default ConcentrateProject;
|
Loading…
Reference in New Issue