This commit is contained in:
caishi 2021-06-08 14:56:00 +08:00
parent ff7d191011
commit a257d832cb
7 changed files with 21 additions and 12 deletions

View File

@ -564,7 +564,7 @@ class NewHeader extends Component {
</img>
</a>
<ul className="edu-menu-list" style={{ top: '60px', textAlign: 'center' }}>
<li className="bor-bottom-greyE" style={{cursor:"default",background:"#fff"}}>{this.props.current_user.username}</li>
<li className="bor-bottom-greyE task-hide" title={this.props.current_user.username} style={{cursor:"default",background:"#fff"}}>{this.props.current_user.username}</li>
{
settings && settings.personal && settings.personal.length > 0 && settings.personal.map((item,key)=>{
return(

View File

@ -2,7 +2,6 @@ import React, { useEffect, useState } from 'react';
import { Modal , Checkbox , Spin , Input } from 'antd';
import Axios from 'axios';
import { Link } from 'react-router-dom';
import { values } from 'lodash';
const { Search } = Input;
const limit = 20;

View File

@ -30,6 +30,9 @@ function ConcentrateProject({userLogin,current}) {
}
function onSure(is_pinned_project_ids) {
if(is_pinned_project_ids && is_pinned_project_ids.length===0){
setValue([]);
}
const url = `/users/${userLogin}/is_pinned_projects/pin.json`;
axios.post(url,{
is_pinned_project_ids

View File

@ -183,11 +183,17 @@ class Infos extends Component {
this.props.history.push(`/users/${user && user.login}/organizes`)
}
resetUser=()=>{
const { resetUserInfo } = this.props;
this.fetchUser();
resetUserInfo && resetUserInfo();
}
render() {
const { current_user, mygetHelmetapi } = this.props;
const { current_user, mygetHelmetapi , resetUserInfo } = this.props;
const { username } = this.props.match.params;
const { user, isSpin, project_type, route_type , undo_events , undo_messages , menuKey } = this.state;
return (
<div className="newMain clearfix">
<Spin spinning={isSpin}>
@ -336,7 +342,7 @@ class Infos extends Component {
<Route
path="/users/:username/info"
render={() => {
return <UpdateInfo {...this.props} {...this.state} resetUser={this.fetchUser}/>;
return <UpdateInfo {...this.props} {...this.state} resetUser={this.resetUser}/>;
}}
></Route>
<Route

View File

@ -10,15 +10,16 @@ export default Form.create()(
forwardRef((props)=>{
const { getFieldDecorator, validateFields , setFieldsValue } = props && props.form;
const { username } = props && props.match && props.match.params;
const { user , resetUser } = props;
const { user , resetUser , current_user } = props;
useEffect(()=>{
if(user && user.login){
if(current_user && current_user.login){
setFieldsValue({
...user,
location:user.province && [user.province,user.city]
...current_user,
location:current_user.province && [current_user.province,current_user.city]
})
}
},[user])
},[current_user])
function submit() {
validateFields((error,values)=>{

View File

@ -1,7 +1,6 @@
import React , { useEffect , useState } from 'react';
import { Dropdown, Menu , Pagination } from 'antd';
import { Link } from 'react-router-dom';
import Search from '../Component/Search';
import Item from './Team-item';
import Nodata from '../Nodata';
@ -15,7 +14,7 @@ function Team(props){
const [ sort_direction , setSort_direction ] = useState("asc");
const [ sort_by ,setSort_by ] = useState("created_at");
const [ search ,setSearch ] = useState(undefined);
console.log(props);
const { username } = props.match.params;
useEffect(()=>{
if(username){

View File

@ -209,6 +209,7 @@ export function TPMIndexHOC(WrappedComponent) {
const common = {
showLoginDialog: this.showLoginDialog,
checkIfLogin: this.checkIfLogin,
resetUserInfo:this.fetchUsers
};
return (
<div className="indexHOC">