diff --git a/src/forge/Component/Cards.jsx b/src/forge/Component/Cards.jsx index 7f080d03..1c9706c3 100644 --- a/src/forge/Component/Cards.jsx +++ b/src/forge/Component/Cards.jsx @@ -3,13 +3,13 @@ import { getImageUrl } from 'educoder'; import { Link } from 'react-router-dom'; import './Component.scss'; -function Cards({img , title, desc , rightBtn}){ +function Cards({img , title, desc , rightBtn , src}){ return(
-
+ {img &&
}

- {title} + {title} {rightBtn}

diff --git a/src/forge/Component/Component.scss b/src/forge/Component/Component.scss index b8c6e02d..7f0d62f7 100644 --- a/src/forge/Component/Component.scss +++ b/src/forge/Component/Component.scss @@ -19,6 +19,7 @@ li.ant-menu-item{ padding:20px 34px; background-color: #fff; margin-bottom:18px; + min-height: 130px; .img{ margin-right: 20px; width: 190px; diff --git a/src/forge/Team/Index.jsx b/src/forge/Team/Index.jsx index 197dbc66..727c472a 100644 --- a/src/forge/Team/Index.jsx +++ b/src/forge/Team/Index.jsx @@ -10,6 +10,7 @@ import { TPMIndexHOC } from "../../modules/tpm/TPMIndexHOC"; import '../css/index.scss'; +import Detail from './Sub/Detail'; const New = Loadable({ loader: () => import("./New"), @@ -28,18 +29,25 @@ export default withRouter(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC( return (
- {/* 组织团队 */} + {/* 组织团队-子级(不包含组织团队列表) */} + { + return + }} + > + {/* 组织团队-子级(包含组织团队列表) */} { - return + return }} > {/* 组织成员 */} { - return + return }} > {/* 新建组织 */} diff --git a/src/forge/Team/Setting/TeamSettingCommon.jsx b/src/forge/Team/Setting/TeamSettingCommon.jsx index 37e975fc..294293a2 100644 --- a/src/forge/Team/Setting/TeamSettingCommon.jsx +++ b/src/forge/Team/Setting/TeamSettingCommon.jsx @@ -17,7 +17,7 @@ const radioStyle = { lineHeight: '30px', }; export default Form.create()( - forwardRef(({ form , organizeDetail , showNotification , history , current_user })=>{ + forwardRef(({ form , organizeDetail , showNotification , history , current_user , updateFunc })=>{ const [ image , setImage ] = useState(undefined); const [ imageFlag , setImageFlag ] = useState(false); const [ password , setPassword ] = useState(undefined); @@ -55,7 +55,11 @@ export default Form.create()( }).then(result=>{ if(result && result.data){ showNotification("组织信息更新成功!"); - history.push(`/organize/${values.name}/setting`); + if(values.name !== organizeDetail.name){ + console.log("false111"); + history.push(`/organize/${values.name}/setting`); + } + updateFunc && updateFunc(values.name,values.description); } }).catch(error=>{}) } diff --git a/src/forge/Team/Sub/Detail.jsx b/src/forge/Team/Sub/Detail.jsx index 28be9d58..cae64e76 100644 --- a/src/forge/Team/Sub/Detail.jsx +++ b/src/forge/Team/Sub/Detail.jsx @@ -7,6 +7,14 @@ import Cards from '../../Component/Cards'; import axios from 'axios'; import '../Index.scss'; +const Group = Loadable({ + loader: () => import("../TeamGroup"), + loading: Loading, +}); +const Member = Loadable({ + loader: () => import("../TeamMember"), + loading: Loading, +}); const DetailIndex = Loadable({ loader: () => import("../List"), loading: Loading, @@ -25,7 +33,7 @@ function Detail(props){ // 设置页面:顶部不需要设置按钮了 useEffect(()=>{ if(pathname){ - if(pathname.indexOf("/setting") && pathname.indexOf("/organize")){ + if(pathname.indexOf("/setting")>-1 && pathname.indexOf("/organize")>-1){ setFlag(false); }else{ setFlag(true); @@ -47,11 +55,19 @@ function Detail(props){ } }).catch(error=>{}) } + + function updateDetail(name,desc){ + let d = detail; + d.name = name; + d.description = desc; + setDetail(d); + } return(
{ detail && } + + {/* 组织成员 */} + { + return + }} + > + {/* 组织团队 */} + { + return + }} + > { - return + return }} > import("../Group/GroupNew"), loading: Loading, }); -const Group = Loadable({ - loader: () => import("../TeamGroup"), - loading: Loading, -}); -const Member = Loadable({ - loader: () => import("../TeamMember"), - loading: Loading, -}); const GroupDetails = Loadable({ loader: () => import("../Group/GroupDetails"), loading: Loading, @@ -50,13 +41,13 @@ export default ((props)=>{ },[pathname]) useEffect(()=>{ - if(OIdentifier){ - getDetail(OIdentifier); + if(OIdentifier && groupId){ + getDetail(OIdentifier,groupId); } - },[OIdentifier]); + },[OIdentifier,groupId]); - function getDetail(id) { - const url = `/organizations/${id}.json`; + function getDetail(id,gId) { + const url = `/organizations/${id}/teams/${gId}.json`; axios.get(url).then(result=>{ if(result && result.data){ setDetail(result.data); @@ -64,10 +55,17 @@ export default ((props)=>{ }).catch(error=>{}) } return( -
+
+
+ + {OIdentifier} + + {detail && detail.name} +
{ detail && @@ -75,7 +73,6 @@ export default ((props)=>{ 组织团队{detail.num_teams &&{detail.num_teams}} } - img={detail.avatar_url} desc={!flag && detail.description} /> } @@ -87,34 +84,20 @@ export default ((props)=>{ return }} > - {/* 组织-新建团队 */} + {/* 组织团队-新建 */} { return }} > - {/* 组织团队-成员 */} + {/* 组织团队-详情 */} { return }} > - {/* 组织成员 */} - { - return - }} - > - {/* 组织团队 */} - { - return - }} - >
)