diff --git a/src/forge/Component/Cards.jsx b/src/forge/Component/Cards.jsx
index f98a834ef..7f080d035 100644
--- a/src/forge/Component/Cards.jsx
+++ b/src/forge/Component/Cards.jsx
@@ -1,5 +1,6 @@
import React from 'react';
import { getImageUrl } from 'educoder';
+import { Link } from 'react-router-dom';
import './Component.scss';
function Cards({img , title, desc , rightBtn}){
@@ -8,7 +9,7 @@ function Cards({img , title, desc , rightBtn}){
})
- {title}
+ {title}
{rightBtn}
diff --git a/src/forge/Component/Component.scss b/src/forge/Component/Component.scss
index c846cf2c4..b8c6e02d1 100644
--- a/src/forge/Component/Component.scss
+++ b/src/forge/Component/Component.scss
@@ -42,7 +42,7 @@ li.ant-menu-item{
align-items: center;
height: 22px;
line-height: 22px;;
- &>span{
+ &>a{
font-size:18px ;
color: #333;
}
diff --git a/src/forge/Component/layout.jsx b/src/forge/Component/layout.jsx
index 1630fc8b5..443e9b36a 100644
--- a/src/forge/Component/layout.jsx
+++ b/src/forge/Component/layout.jsx
@@ -158,7 +158,7 @@ export const Content = styled.div`{
}`
export const GroupProjectBackgroup = styled.div`{
background:#fafafa;
- padding: 30px;
+ padding:20px 30px;
width:100%;
}`
diff --git a/src/forge/Team/Group/Setting/GroupMemberSetting.jsx b/src/forge/Team/Group/Setting/GroupMemberSetting.jsx
index e0f40b08d..f14b65755 100644
--- a/src/forge/Team/Group/Setting/GroupMemberSetting.jsx
+++ b/src/forge/Team/Group/Setting/GroupMemberSetting.jsx
@@ -276,9 +276,9 @@ export default ((props) => {
return (
-
+
- 组织成员管理
+ 团队成员管理
+ 添加用户
diff --git a/src/forge/Team/Group/Setting/GroupProjectSetting.jsx b/src/forge/Team/Group/Setting/GroupProjectSetting.jsx
index 3abc4b557..d2c1c539f 100644
--- a/src/forge/Team/Group/Setting/GroupProjectSetting.jsx
+++ b/src/forge/Team/Group/Setting/GroupProjectSetting.jsx
@@ -138,7 +138,7 @@ function GroupProjectSetting(props) {
-
+
{/* 组织团队 */}
{
return
}}
diff --git a/src/forge/Team/Setting/TeamSettingGroup.jsx b/src/forge/Team/Setting/TeamSettingGroup.jsx
index 530eb1040..4fd31a503 100644
--- a/src/forge/Team/Setting/TeamSettingGroup.jsx
+++ b/src/forge/Team/Setting/TeamSettingGroup.jsx
@@ -2,6 +2,7 @@ import React , { useEffect , useState } from 'react';
import { WhiteBack , Banner , Blueline } from '../../Component/layout';
import styled from 'styled-components';
import Axios from 'axios';
+import { Pagination , Popconfirm } from 'antd';
import { getImageUrl } from 'educoder';
const SpanName = styled.span`{
@@ -28,7 +29,7 @@ const ImgContent = styled.img`{
margin:5px 20px 5px 0px;
}`
const limit = 8;
-function TeamSettingGroup({organizeDetail}){
+function TeamSettingGroup({organizeDetail,history}){
const [ list ,setList ] = useState(undefined);
const [ page ,setPage ] = useState(1);
const [ total ,setTotal ] = useState(0);
@@ -54,6 +55,21 @@ function TeamSettingGroup({organizeDetail}){
}).catch(error=>{})
}
+ // 当前用户离开团队
+ function removeMember(teamid){
+ const url = `/organizations/${organizeDetail.id}/teams/${teamid}/team_users/quit.json`;
+ Axios.delete(url).then(result=>{
+ if(result && result.data){
+ getData();
+ }
+ }).catch(error=>{})
+ }
+
+ // 团队设置
+ function toGroupSetting(id){
+ history.push(`/organize/${organizeDetail && organizeDetail.name}/group/${id}/setting`);
+ }
+
return(
组织团队管理
@@ -67,15 +83,17 @@ function TeamSettingGroup({organizeDetail}){
{item.name}
- { item.is_member && 离开团队 }
- { item.isAdmin && 团队设置 }
+ { item.is_member && !item.is_admin &&
+ removeMember(item.id)}>离开团队
+ }
+ { item.is_admin && toGroupSetting(item.id)}>团队设置 }
{
- item.user && item.user.map((i,k)=>{
+ item.users && item.users.map((i,k)=>{
return(
-
+
)
})
}
@@ -91,6 +109,12 @@ function TeamSettingGroup({organizeDetail}){
:""
}
+ {
+ total > limit &&
+
+ }
)
}
diff --git a/src/forge/Team/Sub/Detail.jsx b/src/forge/Team/Sub/Detail.jsx
index 9168653af..28be9d58a 100644
--- a/src/forge/Team/Sub/Detail.jsx
+++ b/src/forge/Team/Sub/Detail.jsx
@@ -27,6 +27,8 @@ function Detail(props){
if(pathname){
if(pathname.indexOf("/setting") && pathname.indexOf("/organize")){
setFlag(false);
+ }else{
+ setFlag(true);
}
}
},[pathname])
@@ -47,12 +49,15 @@ function Detail(props){
}
return(
-
设置}
- />
+ {
+ detail &&
+ 设置}
+ />
+ }
{
+ const OIdentifier = props.match.params.OIdentifier;
+ const groupId = props.match.params.groupId;
+ const pathname = props.location.pathname;
+
+ const [ detail , setDetail ] = useState(undefined);
+ const [ flag , setFlag ] = useState(false);
+
+
+ // 设置页面:顶部不需要设置按钮了
+ useEffect(()=>{
+ if(pathname){
+ if(pathname.indexOf(`/organize/${OIdentifier}/group/${groupId}/setting`)>-1){
+ setFlag(false);
+ }else{
+ setFlag(true);
+ }
+ }
+ },[pathname])
+
+ useEffect(()=>{
+ if(OIdentifier){
+ getDetail(OIdentifier);
+ }
+ },[OIdentifier]);
+
+ function getDetail(id) {
+ const url = `/organizations/${id}.json`;
+ axios.get(url).then(result=>{
+ if(result && result.data){
+ setDetail(result.data);
+ }
+ }).catch(error=>{})
+ }
return(
-
- 组织成员13
- 组织团队13
-
- }
- img={`https://dss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=4193840146,2109186388&fm=26&gp=0.jpg`}
- />
+ {
+ detail &&
+
+ 组织成员{detail.num_users && {detail.num_users}}
+ 组织团队{detail.num_teams &&{detail.num_teams}}
+
+ }
+ img={detail.avatar_url}
+ desc={!flag && detail.description}
+ />
+ }
{/* 组织团队-设置 */}