From 3cd51d1c72cc37af696a3c3ae46d6bcde36489df Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Mon, 7 Jun 2021 11:13:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9-=E4=B8=AA=E4=BA=BA=E4=B8=BB?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Head/Header.js | 2 +- src/forge/Main/CoderRootBranch.js | 2 +- src/forge/users/Echart/Calendar.jsx | 3 ++- .../users/GeneralView/ConcentrateBox.jsx | 24 +++++++++++++------ src/forge/users/GeneralView/Index.scss | 2 +- src/forge/users/Infos.js | 2 +- src/forge/users/Material/Base.jsx | 2 +- src/forge/users/Material/Index.jsx | 2 +- 8 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/forge/Head/Header.js b/src/forge/Head/Header.js index 4d55f824c..71cb0b506 100644 --- a/src/forge/Head/Header.js +++ b/src/forge/Head/Header.js @@ -559,7 +559,7 @@ class NewHeader extends Component { :
- + diff --git a/src/forge/Main/CoderRootBranch.js b/src/forge/Main/CoderRootBranch.js index 94411defa..5e9a84ca0 100644 --- a/src/forge/Main/CoderRootBranch.js +++ b/src/forge/Main/CoderRootBranch.js @@ -40,7 +40,7 @@ export default ((props)=>{

- 创建合并请求 + 创建合并请求 diff --git a/src/forge/users/Echart/Calendar.jsx b/src/forge/users/Echart/Calendar.jsx index d0816ccca..743a0a551 100644 --- a/src/forge/users/Echart/Calendar.jsx +++ b/src/forge/users/Echart/Calendar.jsx @@ -74,7 +74,7 @@ function Calendar({ userLogin , time , chooseTime }) { var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-'; var D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate(); return Y+M+D; - } + } function Init(data,max) { var huan_val = document.getElementById("Calendar"); @@ -137,6 +137,7 @@ function Calendar({ userLogin , time , chooseTime }) { }); } + return(
) diff --git a/src/forge/users/GeneralView/ConcentrateBox.jsx b/src/forge/users/GeneralView/ConcentrateBox.jsx index bd0b04dba..0ec8d9c66 100644 --- a/src/forge/users/GeneralView/ConcentrateBox.jsx +++ b/src/forge/users/GeneralView/ConcentrateBox.jsx @@ -15,14 +15,13 @@ function ConcentrateBox({ visible , onCancel , onSure , username , choosed }) { const [ value , setValue ]= useState([]); const [ isSpin , setIsSpin ]= useState(true); const [ disable , setDisable ] = useState(false); - const [ loadCount , setLoadCount ]= useState(0); useEffect(()=>{ - if(visible && loadCount === 0){ - setLoadCount(loadCount+1); + if(visible){ setIsSpin(true); getProjectList(); } + setSearch(undefined); },[visible]) useEffect(()=>{ @@ -57,15 +56,16 @@ function ConcentrateBox({ visible , onCancel , onSure , username , choosed }) { const url = `/users/${username}/projects.json`; Axios.get(url,{ params:{ - page:p,limit,is_public: "public",search:s + page:p,limit,is_public: "public",search:s,choosed } }).then(result=>{ if(result && result.data){ - let e = mergeArrayMerge(list,result.data.projects); + let e = page > 1 ? mergeArrayMerge(list,result.data.projects) : result.data.projects; setTotal(result.data.count); - setList(page > 1 ? e : result.data.projects); + setList(e); setIsSpin(false); + // 查看更多需要页数 let s = parseInt(result.data.count/limit,0); let y = result.data.count%limit; setPageSize(y>0?s+1:s); @@ -91,13 +91,21 @@ function ConcentrateBox({ visible , onCancel , onSure , username , choosed }) { setValue([]); } - function chooseProject(e) { + function chooseProject(e,p) { setValue(e); } // 搜索 function onSearch(params) { + setPage(1); + setList([]); setSearch(params); + // if(params){ + // setValueCopy(value); + // }else{ + // setValue(valueCopy); + // setValueCopy([]); + // } } return( @@ -120,6 +128,8 @@ function ConcentrateBox({ visible , onCancel , onSure , username , choosed }) { onSearch={onSearch} enterButton="搜索" allowClear + value={search} + onChange={(e)=>setSearch(e.target.value)} />
diff --git a/src/forge/users/GeneralView/Index.scss b/src/forge/users/GeneralView/Index.scss index 74ca9d783..e79f68580 100644 --- a/src/forge/users/GeneralView/Index.scss +++ b/src/forge/users/GeneralView/Index.scss @@ -45,7 +45,7 @@ } } .ConcentrateTip{ - margin:20px 30px 0px; + margin:20px 20px 0px; padding:5px 20px; border:1px solid rgb(248, 56, 56); border-radius: 4px; diff --git a/src/forge/users/Infos.js b/src/forge/users/Infos.js index 6317bff59..4d77ff103 100644 --- a/src/forge/users/Infos.js +++ b/src/forge/users/Infos.js @@ -79,7 +79,7 @@ class Infos extends Component { this.setState({menuKey:"1",route_type:undefined}); }else if(pathname.indexOf(`/users/${username}/projects`)>-1){ this.setState({menuKey:"2",route_type:undefined}); - }else if(pathname === `/users/${username}/notice`){ + }else if(pathname.indexOf(`/users/${username}/notice`)>-1){ this.setState({menuKey:"3",route_type:undefined}); }else if(pathname.indexOf(`/users/${username}/devops`)>-1){ this.setState({menuKey:"4",route_type:undefined}); diff --git a/src/forge/users/Material/Base.jsx b/src/forge/users/Material/Base.jsx index 7a2001116..d573c796f 100644 --- a/src/forge/users/Material/Base.jsx +++ b/src/forge/users/Material/Base.jsx @@ -55,7 +55,7 @@ export default Form.create()( {getFieldDecorator("email",{ rules:[{required:true,message:"请输入邮箱账号"}] })( - + )} diff --git a/src/forge/users/Material/Index.jsx b/src/forge/users/Material/Index.jsx index 3e24b0b90..ee0f4eec8 100644 --- a/src/forge/users/Material/Index.jsx +++ b/src/forge/users/Material/Index.jsx @@ -33,7 +33,7 @@ function Index(props){
基本资料 - 密码管理 + {/* 密码管理 */}
{