Merge pull request 'issue修改' (#43) from caishi/forgeplus-react:feature_router into feature_router

This commit is contained in:
jasder 2021-09-03 16:08:12 +08:00
commit 03a8e79382
8 changed files with 23 additions and 11 deletions

View File

@ -260,7 +260,7 @@ class NewHeader extends Component {
return( return(
<Menu className="currentMenu"> <Menu className="currentMenu">
<Menu.Item> <Menu.Item>
<span title={current_user && current_user.username}>{current_user && current_user.username}</span> <span className="currentName" title={current_user && current_user.username}>{current_user && current_user.username}</span>
</Menu.Item> </Menu.Item>
{ {
personal && personal.length > 0 && personal.map((item,key)=>{ personal && personal.length > 0 && personal.map((item,key)=>{

View File

@ -30,6 +30,13 @@
width: 120px; width: 120px;
text-align: center; text-align: center;
padding:0px; padding:0px;
.currentName{
padding:0px 8px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
display: block;
}
li{ li{
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;

View File

@ -1,5 +1,4 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import { Menu, Input , Spin, Pagination , Popover , Select } from 'antd'; import { Menu, Input , Spin, Pagination , Popover , Select } from 'antd';
import Slider from "react-slick"; import Slider from "react-slick";
import { getImageUrl } from 'educoder'; import { getImageUrl } from 'educoder';
@ -13,6 +12,8 @@ import axios from 'axios';
import img_new from '../Images/new.png'; import img_new from '../Images/new.png';
import img_array from '../Images/array.png'; import img_array from '../Images/array.png';
import banner from '../Images/banner_list.jpg'; import banner from '../Images/banner_list.jpg';
import CheckProfile from '../Component/ProfileModal/Profile';
const Search = Input.Search; const Search = Input.Search;
class Index extends Component { class Index extends Component {
@ -255,8 +256,12 @@ class Index extends Component {
newItem = ()=>{ newItem = ()=>{
return( return(
<Menu> <Menu>
<Menu.Item key="created_mirror"><Link to={`/projects/mirror/new`}>新建镜像项目</Link></Menu.Item> <Menu.Item key="created_mirror">
<Menu.Item key="created_deposit"><Link to={`/projects/deposit/new`}>新建托管项目</Link></Menu.Item> <CheckProfile {...this.props} sureFunc={()=>{this.props.history.push('/projects/mirror/new')}}>新建镜像项目</CheckProfile>
</Menu.Item>
<Menu.Item key="created_deposit">
<CheckProfile {...this.props} sureFunc={()=>{this.props.history.push('/projects/deposit/new')}}>新建托管项目</CheckProfile>
</Menu.Item>
</Menu> </Menu>
) )
} }

View File

@ -19,7 +19,6 @@ function FocusButton({is_watch , fontClass, starText, is_block , id , successFun
}).then((result) => { }).then((result) => {
if (result && result.data.status === 0) { if (result && result.data.status === 0) {
successFunc && successFunc(); successFunc && successFunc();
console.log(notReset);
if(notReset){ if(notReset){
setWatchFlag(!watchFlag); setWatchFlag(!watchFlag);
} }

View File

@ -7,7 +7,6 @@ import "./list.css";
class UserList extends Component { class UserList extends Component {
renderList = (users, userClass, current_user, type_title , successFunc , notReset) => { renderList = (users, userClass, current_user, type_title , successFunc , notReset) => {
console.log("user:",notReset)
if (users && users.length > 0) { if (users && users.length > 0) {
return users.map((item, key) => { return users.map((item, key) => {
return ( return (
@ -54,9 +53,9 @@ class UserList extends Component {
} }
} }
render() { render() {
const { users, userClass, current_user , type_title , successFunc , notReset } = this.props; const { users, userClass, current_user , type_title , successFunc , notReset , title_type } = this.props;
return ( return (
this.renderList(users, userClass, current_user, type_title , successFunc , notReset) this.renderList(users, userClass, current_user, type_title , successFunc , notReset , title_type)
); );
} }
} }

View File

@ -243,6 +243,7 @@ class Infos extends Component {
id={user.login} id={user.login}
fontClass={"font-14 ml5"} fontClass={"font-14 ml5"}
starText={"关注TA"} starText={"关注TA"}
notReset={true}
/> />
</div> </div>
)} )}

View File

@ -15,7 +15,7 @@ function Team(props){
const [ sort_direction , setSort_direction ] = useState("asc"); const [ sort_direction , setSort_direction ] = useState("asc");
const [ sort_by ,setSort_by ] = useState("created_at"); const [ sort_by ,setSort_by ] = useState("created_at");
const [ search ,setSearch ] = useState(undefined); const [ search ,setSearch ] = useState(undefined);
const { checkIfLogin , showLoginDialog } = props; const { checkIfLogin , showLoginDialog , current_user } = props;
const { username } = props.match.params; const { username } = props.match.params;
useEffect(()=>{ useEffect(()=>{
if(username){ if(username){
@ -57,7 +57,7 @@ function Team(props){
</div> </div>
<p> <p>
{ {
checkIfLogin() && current_user && current_user.login === username &&
<CheckProfile {...props} sureFunc={()=>{props.history.push('/organize/new')}}><i className="iconfont icon-xinjian1 mr3 font-14"></i>新建组织</CheckProfile> <CheckProfile {...props} sureFunc={()=>{props.history.push('/organize/new')}}><i className="iconfont icon-xinjian1 mr3 font-14"></i>新建组织</CheckProfile>
} }
<Dropdown overlay={menu}> <Dropdown overlay={menu}>

View File

@ -116,7 +116,8 @@ class CommonList extends Component {
type_title={'关注列表'} type_title={'关注列表'}
current_user={current_user} current_user={current_user}
successFunc={this.successFunc} successFunc={this.successFunc}
notReset={userType === "watch_users"?false:true} notReset={(userType === "watch_users" && title_type === "我") ? false : true}
title_type={title_type}
/> />
</div> </div>
) : ( ) : (