Merge branch 'feature_router' of https://git.trustie.net/Gitlink/forgeplus-react into feature_router

This commit is contained in:
何童崇 2021-09-03 11:37:08 +08:00
commit f6a0c3b33f
12 changed files with 57 additions and 21 deletions

View File

@ -25,7 +25,7 @@ if (isDev) {
}
debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' :
window.location.search.indexOf('debug=s') !== -1 ? 'student' :
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin'
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'student'
}
window._debugType = debugType;
export function initAxiosInterceptors(props) {

View File

@ -3,6 +3,7 @@ import Modals from '../PublicModal/Index';
import { Button } from 'antd';
import axios from 'axios';
import ProfileImg from './images/profile.png';
import './Index.scss';
function ProfileModal({visible,onCancel,history}) {
@ -57,7 +58,7 @@ function ProfileModal({visible,onCancel,history}) {
}
>
<div className="contents">
<i className="iconfont icon-gerenziliao1 font-44" style={{color:"#466AFF"}}></i>
<img src={ProfileImg} alt=""/>
{
addMemberCheck ?
<p>目标用户个人资料不完整需提醒目标用户补充资料后以进行后续操作</p>

View File

@ -3,8 +3,9 @@
align-items: center;
justify-content: center;
margin:10px auto 0px;
i{
img{
margin-right: 13px;
width: 44px;
}
p{
line-height: 29px;

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

@ -269,7 +269,7 @@ class NewHeader extends Component {
)
})
}
<li><Link to={`/settings/SSH`}>设置</Link></li>
<li><Link to={`/settings/profile`}>设置</Link></li>
<Menu.Item><a onClick={() => this.educoderloginysl()}>退出</a></Menu.Item>
</Menu>
)

View File

@ -39,14 +39,14 @@ function Index(props){
<img src={getImageUrl(`/${current_user && current_user.image_url}`)} alt=""/>
<span>{current_user && current_user.username}</span>
</div>
<ul className="securityUl">
<li>安全设置</li>
<li className={pathname.indexOf("/settings/SSH")>-1 ?"active":""}><Link to={`/settings/SSH`}><i className="iconfont icon-xuanzhongssh_icon mr5 font-14"></i>SSH密钥</Link></li>
</ul>
<ul className="securityUl">
<li>个人信息</li>
<li className={pathname.indexOf("/settings/profile")>-1 ?"active":""}><Link to={`/settings/profile`}><i className="iconfont icon-gerenziliao mr5 font-14"></i>基本资料</Link></li>
</ul>
<ul className="securityUl">
<li>安全设置</li>
<li className={pathname.indexOf("/settings/SSH")>-1 ?"active":""}><Link to={`/settings/SSH`}><i className="iconfont icon-xuanzhongssh_icon mr5 font-14"></i>SSH密钥</Link></li>
</ul>
</div>
<LongWidth>
<Gap>

View File

@ -3,7 +3,7 @@ import axios from "axios";
import { Button } from "antd";
import "./list.css";
function FocusButton({is_watch , fontClass, starText, is_block , id , successFunc}){
function FocusButton({is_watch , fontClass, starText, is_block , id , successFunc,notReset}){
const [ isSpin , setIsSpin ] = useState(false);
const [ watchFlag , setWatchFlag ] = useState(is_watch);
// 关注和取消关注
@ -19,7 +19,8 @@ function FocusButton({is_watch , fontClass, starText, is_block , id , successFun
}).then((result) => {
if (result && result.data.status === 0) {
successFunc && successFunc();
if(!flag){
console.log(notReset);
if(notReset){
setWatchFlag(!watchFlag);
}
}

View File

@ -6,7 +6,8 @@ import { Button } from "antd";
import "./list.css";
class UserList extends Component {
renderList = (users, userClass, current_user, type_title , successFunc) => {
renderList = (users, userClass, current_user, type_title , successFunc , notReset) => {
console.log("user:",notReset)
if (users && users.length > 0) {
return users.map((item, key) => {
return (
@ -43,7 +44,7 @@ class UserList extends Component {
current_user && current_user.login === item.login ?
<Button type="default">当前用户</Button>
:
<FocusButton is_watch={item.is_watch} id={item.login} successFunc={successFunc}/>
<FocusButton is_watch={item.is_watch} notReset={notReset} id={item.login} successFunc={successFunc}/>
}
</div>
</div>
@ -53,9 +54,9 @@ class UserList extends Component {
}
}
render() {
const { users, userClass, current_user , type_title , successFunc } = this.props;
const { users, userClass, current_user , type_title , successFunc , notReset } = this.props;
return (
this.renderList(users, userClass, current_user, type_title , successFunc)
this.renderList(users, userClass, current_user, type_title , successFunc , notReset)
);
}
}

View File

@ -2,10 +2,11 @@ import React, { useEffect, useState } from 'react';
import { Modal , Checkbox , Spin , Input } from 'antd';
import Axios from 'axios';
import { Link } from 'react-router-dom';
import CheckProfile from '../../Component/ProfileModal/Profile';
const { Search } = Input;
const limit = 20;
function ConcentrateBox({ visible , onCancel , onSure , username , choosed }) {
function ConcentrateBox({ visible , onCancel , onSure , username , choosed , history , showCompeleteDialog , completeProfile }) {
const [ page , setPage ]= useState(1);
const [ total , setTotal ]= useState(0);
const [ pageSize , setPageSize ] = useState(false);
@ -164,7 +165,16 @@ function ConcentrateBox({ visible , onCancel , onSure , username , choosed }) {
</Checkbox.Group>
</div>
{ total > limit && page < pageSize && <div className="morelist" onClick={()=>setPage(page+1)}>查看更多</div> }
{ (list && list.length === 0) && (copyList && copyList.length === 0) && <div style={{textAlign:"center"}}>您还没有公开的{search && `${search}`}项目先去<Link to={`/projects/deposit/new`} className="color-blue">新建项目</Link></div> }
{
(list && list.length === 0) && (copyList && copyList.length === 0) &&
<div style={{textAlign:"center"}}>您还没有公开的{search && `${search}`}项目先去
<CheckProfile
showCompeleteDialog={showCompeleteDialog}
completeProfile={completeProfile}
sureFunc={()=>{history.push(`/projects/deposit/new`)}}
className="color-blue">新建项目</CheckProfile>
</div>
}
</Spin>
</Modal>
)

View File

@ -4,7 +4,7 @@ import { Link } from 'react-router-dom';
import axios from 'axios';
import Box from './ConcentrateBox';
function ConcentrateProject({userLogin,current}) {
function ConcentrateProject({userLogin,current,showCompeleteDialog,completeProfile}) {
const [ list , setList ] = useState(undefined);
const [ visible , setVisible ] = useState(false);
const [ value , setValue ] = useState([]);
@ -45,7 +45,15 @@ function ConcentrateProject({userLogin,current}) {
}
return(
<React.Fragment>
<Box visible={visible} onCancel={()=>setVisible(false)} onSure={onSure} username={userLogin} choosed={value}/>
<Box
visible={visible}
onCancel={()=>setVisible(false)}
onSure={onSure}
username={userLogin}
choosed={value}
completeProfile={completeProfile}
showCompeleteDialog={showCompeleteDialog}
/>
{
list && list.length>0 &&
<div className="concentrate">

View File

@ -99,7 +99,11 @@ function Index(props) {
return(
<div>
<div>
<ConcentrateProject userLogin={username} current={current_user && (current_user.login === username)}/>
<ConcentrateProject
{...props}
userLogin={username}
current={current_user && (current_user.login === username)}
/>
</div>
<div className="recentStatic">
<p className="font-18 mb15">近期活动统计</p>

View File

@ -91,7 +91,10 @@ class CommonList extends Component {
<Spin spinning={isSpin}>
<div className="minH-670">
<div className="grid-item pb20 bbt">
<h3 style={{marginBottom:"0px"}}><Link to={`/${login}`} ><i className="iconfont icon-zuojiantou color-grey-9 font-16 mr8"></i></Link>{userType === "watch_users" ? `${title_type}` : `${title_type}`}</h3>
<h3 style={{marginBottom:"0px"}}>
<Link to={`/${login}`} ><i className="iconfont icon-zuojiantou color-grey-9 font-16 mr8"></i></Link>
{userType === "watch_users" ? `${title_type}关注的` : `关注${title_type}`}
</h3>
<div className="text-right">
<Search
placeholder="输入名称进行搜索"
@ -107,7 +110,14 @@ class CommonList extends Component {
{users && users.length > 0 ? (
<div className="w-100 inline-block">
<UserList users={users} userClass={"w-33"} type_title={'关注列表'} current_user={current_user} successFunc={this.successFunc}></UserList>
<UserList
users={users}
userClass={"w-33"}
type_title={'关注列表'}
current_user={current_user}
successFunc={this.successFunc}
notReset={userType === "watch_users"?false:true}
/>
</div>
) : (
<Nodata _html={`暂时没有数据~`} />