diff --git a/src/forge/Team/Group/Setting/GroupMemberSetting.jsx b/src/forge/Team/Group/Setting/GroupMemberSetting.jsx index 10914346..cfa2c5e8 100644 --- a/src/forge/Team/Group/Setting/GroupMemberSetting.jsx +++ b/src/forge/Team/Group/Setting/GroupMemberSetting.jsx @@ -1,15 +1,16 @@ import React, { useState, useEffect } from 'react'; import { WhiteBack , FlexAJ } from '../../../Component/layout'; -import { Menu, Table, Pagination, Icon, Tooltip, Popconfirm, Dropdown, Spin } from 'antd'; -import Sort from '../../../Component/Sort'; +import { Table, Pagination , Popconfirm , Spin } from 'antd'; import Title from '../../../Component/Title'; import Search from '../../../Component/Search'; import AddMember from '../../../Component/AddMember'; +import './setting.scss'; import styled from 'styled-components'; import { getImageUrl } from 'educoder'; import axios from 'axios'; import { Link } from 'react-router-dom'; + const Img = styled.img`{ width:30px; height:30px; diff --git a/src/forge/Team/Group/Setting/setting.scss b/src/forge/Team/Group/Setting/setting.scss new file mode 100644 index 00000000..8145c0e7 --- /dev/null +++ b/src/forge/Team/Group/Setting/setting.scss @@ -0,0 +1,5 @@ + +.ant-btn.ant-input-search-button{ + margin-top: -1px; + margin-right: -1px; +} \ No newline at end of file diff --git a/src/forge/Team/Index.scss b/src/forge/Team/Index.scss index 56569e28..99af33af 100644 --- a/src/forge/Team/Index.scss +++ b/src/forge/Team/Index.scss @@ -360,5 +360,5 @@ } } .hide{ - display: none; + display: hidden; } \ No newline at end of file diff --git a/src/forge/Team/TeamGroupItems.jsx b/src/forge/Team/TeamGroupItems.jsx index 27147d12..fe73c505 100644 --- a/src/forge/Team/TeamGroupItems.jsx +++ b/src/forge/Team/TeamGroupItems.jsx @@ -19,7 +19,7 @@ const ImgContent = styled.img`{ }` function TeamGroupItems({organizeDetail,limit, count , history}){ const [ page , setPage ] = useState(1); - const [ isSpin , setIsSpin ] = useState(false); + const [ isSpin , setIsSpin ] = useState(true); const [ total , setTotal ] = useState(0); const [ list , setList ] = useState(undefined); @@ -30,6 +30,7 @@ function TeamGroupItems({organizeDetail,limit, count , history}){ },[organizeDetail]); function getData(){ + setIsSpin(true); const url = `/organizations/${organizeDetail.id}/teams.json`; axios.get(url,{ params:{ page ,limit} @@ -43,7 +44,6 @@ function TeamGroupItems({organizeDetail,limit, count , history}){ } // 离开团队 function outTeam(id){ - setIsSpin(true); const url = `/organizations/${organizeDetail.id}/teams/${id}/team_users/quit.json`; axios.delete(url).then(result =>{ if(result && result.data){ @@ -57,7 +57,6 @@ function TeamGroupItems({organizeDetail,limit, count , history}){ } // 解散团队 function disMissGroup(id){ - setIsSpin(true); const url = `/organizations/${organizeDetail.id}/teams/${id}.json`; axios.delete(url).then(result=>{ if(result && result.data){ @@ -67,51 +66,53 @@ function TeamGroupItems({organizeDetail,limit, count , history}){ } return( - { - list && list.length > 0 ? -
+
{ - list.map((item,key)=>{ - return( -
-

- {item.name} - - { item.is_admin && item.authorize!=="owner" && disMissGroup(item.id)}>解散团队} - { item.is_member && } - { item.is_admin && toGroupSetting(item.id)}>团队设置 } - -

-
- { - item.users && item.users.map((i,k)=>{ - return( - k < count ? - : - k === count ? - - :"" - ) - }) - } -
-

- {item.num_users} 名成员 - {item.num_projects} 个项目 -

-
- ) - }) + list && list.length > 0 && +
+ { + list.map((item,key)=>{ + return( +
+

+ {item.name} + + { item.is_admin && item.authorize!=="owner" && disMissGroup(item.id)}>解散团队} + { item.is_member && } + { item.is_admin && toGroupSetting(item.id)}>团队设置 } + +

+
+ { + item.users && item.users.map((i,k)=>{ + return( + k < count ? + : + k === count ? + + :"" + ) + }) + } +
+

+ {item.num_users} 名成员 + {item.num_projects} 个项目 +

+
+ ) + }) + } +
+ } + { list && list.length > 0 && } + { + total > limit && +
+ setPage(page)}/> +
}
- : - } - { - total > limit && -
- setPage(page)}/> -
- } ) } diff --git a/src/forge/Team/TeamMember.jsx b/src/forge/Team/TeamMember.jsx index 74555d2b..63aa515a 100644 --- a/src/forge/Team/TeamMember.jsx +++ b/src/forge/Team/TeamMember.jsx @@ -3,12 +3,13 @@ import { Banner , WhiteBack } from '../Component/layout'; import Cards from '../Component/MemberCards'; import axios from 'axios'; import Nodata from '../Nodata'; -import { Pagination } from 'antd'; +import { Pagination , Spin } from 'antd'; const limit = 15; function TeamMember({organizeDetail,current_user}){ const [ page , setPage ] = useState(1); const [ total , setTotal ] = useState(0); + const [ isSpin , setIsSpin ] = useState(true); const [ list , setList ] = useState(undefined); useEffect(()=>{ @@ -18,6 +19,7 @@ function TeamMember({organizeDetail,current_user}){ },[organizeDetail,page]); function getData(){ + setIsSpin(true); const url = `/organizations/${organizeDetail.id}/organization_users.json`; axios.get(url,{ page,limit @@ -25,6 +27,7 @@ function TeamMember({organizeDetail,current_user}){ if(result && result.data){ setList(result.data.organization_users); setTotal(result.data.total_count); + setIsSpin(false); } }) } @@ -32,28 +35,32 @@ function TeamMember({organizeDetail,current_user}){ return( 组织成员 - { - list && list.length > 0 ? -
+ +
{ - list.map((item,key)=>{ - return( - item.user && - ) - }) + list && list.length > 0 && +
+ { + list.map((item,key)=>{ + return( + item.user && + ) + }) + } +
} + { list && list.length === 0 && }
- : - } +
{ total >limit &&