已开通工作台的组织隐藏用户以及团队管理入口
This commit is contained in:
parent
333aa7904d
commit
8bfe95b2e3
|
|
@ -3,7 +3,7 @@ import { Link } from 'react-router-dom';
|
|||
|
||||
/**
|
||||
* nav:{list:[],active:0} */
|
||||
export default(({ header , nav })=>{
|
||||
export default(({ header , nav, history })=>{
|
||||
return(
|
||||
<ul className="list-l-Menu">
|
||||
{header}
|
||||
|
|
@ -13,11 +13,11 @@ export default(({ header , nav })=>{
|
|||
return(
|
||||
!item.hide &&<li key={key} className={nav.active === key?"active":''}>
|
||||
<p>
|
||||
<Link to={item.href}>
|
||||
<a onClick={()=>{ item.href.indexOf("https") !== -1 ? window.location.href = item.href : history.push(item.href)}}>
|
||||
{item.icon && <i className={`iconfont ${item.icon || 'icon-huabanfuben'} font-18 mr10`}></i>}
|
||||
{item.img && <img src={item.img} alt="" width="20px" className="mr10"/>}
|
||||
{item.name}
|
||||
</Link>
|
||||
</a>
|
||||
</p>
|
||||
</li>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React from 'react';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
|
||||
import { Route, Switch } from "react-router-dom";
|
||||
import Loadable from "react-loadable";
|
||||
|
|
@ -9,6 +9,8 @@ import { CNotificationHOC } from "../../modules/courses/common/CNotificationHOC"
|
|||
import { TPMIndexHOC } from "../../modules/tpm/TPMIndexHOC";
|
||||
import '../css/index.scss';
|
||||
import './Index.scss';
|
||||
import { checkOpenedEnterprise } from '../Information/api';
|
||||
import axios from 'axios';
|
||||
|
||||
const GroupNew = Loadable({
|
||||
loader: () => import("./Group/GroupNew"),
|
||||
|
|
@ -41,6 +43,33 @@ const ProjectDetail = Loadable({
|
|||
});
|
||||
export default withRouter(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(
|
||||
((props)=>{
|
||||
const OIdentifier = props.match.params.OIdentifier;
|
||||
const [ organizeDetail , setOrganizeDetail ] = useState(undefined);
|
||||
const [ enterpriseOpenInfo, setEnterpriseOpenInfo] = useState(false);
|
||||
useEffect(()=>{
|
||||
if(OIdentifier){
|
||||
getDetail(OIdentifier);
|
||||
}
|
||||
},[OIdentifier]);
|
||||
|
||||
function getDetail(identifier) {
|
||||
const url = `/organizations/${identifier}.json`;
|
||||
axios.get(url).then(result=>{
|
||||
if(result && result.data){
|
||||
setOrganizeDetail(result.data);
|
||||
const {id} = result.data;
|
||||
checkOrgOpenEnterprise(id)
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
function checkOrgOpenEnterprise(orgId){
|
||||
checkOpenedEnterprise(orgId).then(res=>{
|
||||
if(res && res.data.code === 200){
|
||||
setEnterpriseOpenInfo(res.data.data)
|
||||
}
|
||||
})
|
||||
}
|
||||
return (
|
||||
<div className="newMain">
|
||||
<Switch>
|
||||
|
|
@ -83,7 +112,7 @@ export default withRouter(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(
|
|||
<Route
|
||||
path="/:OIdentifier/members"
|
||||
render={(p) => {
|
||||
return <TeamDetailIndex {...props} {...p}/>
|
||||
return <TeamDetailIndex {...props} {...p} enterpriseOpened = {enterpriseOpenInfo && enterpriseOpenInfo.isOpen}/>
|
||||
}}
|
||||
></Route>
|
||||
|
||||
|
|
@ -91,7 +120,7 @@ export default withRouter(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(
|
|||
<Route
|
||||
path="/:OIdentifier/setting"
|
||||
render={(p) => (
|
||||
<TeamDetailIndex {...props} {...p}/>
|
||||
<TeamDetailIndex {...props} {...p} enterpriseOpened = {enterpriseOpenInfo && enterpriseOpenInfo.isOpen}/>
|
||||
)}
|
||||
></Route>
|
||||
|
||||
|
|
@ -115,7 +144,7 @@ export default withRouter(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(
|
|||
<Route
|
||||
path="/:OIdentifier"
|
||||
render={(p) => (
|
||||
<DetailIndex {...props} {...p}/>
|
||||
<DetailIndex {...props} {...p} organizeDetail={organizeDetail} enterpriseOpenInfo={enterpriseOpenInfo}/>
|
||||
)}
|
||||
></Route>
|
||||
</Switch>
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@
|
|||
width: 1200px;
|
||||
margin:0px auto;
|
||||
padding-top: 40px;
|
||||
min-height: 72vh;
|
||||
.list-l{
|
||||
background-color: #fff;
|
||||
// background-image: url('./images/left-bc.png');
|
||||
|
|
@ -223,6 +224,7 @@
|
|||
}
|
||||
.box{
|
||||
background:rgba(255,255,255,1);
|
||||
// min-height: 500px;
|
||||
.head{
|
||||
padding:25px 0px 15px;
|
||||
display: flex;
|
||||
|
|
@ -554,6 +556,7 @@
|
|||
}
|
||||
}
|
||||
.overviewcontent{
|
||||
min-height: 514px;
|
||||
.concentrateUl li{
|
||||
border-color:#cddbeb!important;
|
||||
border-radius:4px;
|
||||
|
|
|
|||
|
|
@ -23,37 +23,11 @@ function List(props){
|
|||
const [ search , setSearch ] = useState(undefined);
|
||||
const [ page , setPage ] = useState(1);
|
||||
const [ sortBy , setSortBy ] = useState("updated_on");
|
||||
const [ organizeDetail , setOrganizeDetail ] = useState(undefined);
|
||||
const [ mode , setMode ] = useState("overview");
|
||||
const [ enterpriseOpenInfo, setEnterpriseOpenInfo] = useState(false);
|
||||
|
||||
const OIdentifier = props.match.params.OIdentifier;
|
||||
const { current_user } = props;
|
||||
const { current_user, organizeDetail, enterpriseOpenInfo } = props;
|
||||
|
||||
useEffect(()=>{
|
||||
if(OIdentifier){
|
||||
getDetail(OIdentifier);
|
||||
}
|
||||
},[OIdentifier]);
|
||||
|
||||
function getDetail(id) {
|
||||
const url = `/organizations/${id}.json`;
|
||||
axios.get(url).then(result=>{
|
||||
if(result && result.data){
|
||||
setOrganizeDetail(result.data);
|
||||
const {id} = result.data;
|
||||
checkOrgOpenEnterprise(id)
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
function checkOrgOpenEnterprise(orgId){
|
||||
checkOpenedEnterprise(orgId).then(res=>{
|
||||
if(res && res.data.code === 200){
|
||||
setEnterpriseOpenInfo(res.data.data)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
useEffect(()=>{
|
||||
if(organizeDetail){
|
||||
|
|
@ -243,6 +217,7 @@ function List(props){
|
|||
showCompeleteDialog={props.showCompeleteDialog}
|
||||
completeProfile={props.completeProfile}
|
||||
history={props.history}
|
||||
enterpriseOpened = {enterpriseOpenInfo.isOpen}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ const Img = styled.img`{
|
|||
height:45px;
|
||||
margin-right:12px;
|
||||
}`
|
||||
function RightBox({ OIdentifier , history , admin , showCompeleteDialog ,completeProfile }) {
|
||||
function RightBox({ OIdentifier , history , admin , showCompeleteDialog ,completeProfile, enterpriseOpened }) {
|
||||
const [ languageData, setLanguageData ] = useState(undefined);
|
||||
const [ memberData, setMemberData ] = useState(undefined);
|
||||
const [ groupData, setGroupData ] = useState(undefined);
|
||||
|
|
@ -148,7 +148,7 @@ function RightBox({ OIdentifier , history , admin , showCompeleteDialog ,complet
|
|||
</Box>
|
||||
:""
|
||||
}
|
||||
<Box
|
||||
{!enterpriseOpened && <Box
|
||||
name="组织团队"
|
||||
count={groupData && groupData.total_count}
|
||||
icon={<i className="iconfont icon-zuzhituandui font-17 mr8"></i>}
|
||||
|
|
@ -187,7 +187,7 @@ function RightBox({ OIdentifier , history , admin , showCompeleteDialog ,complet
|
|||
})}
|
||||
</React.Fragment>:<Nodata _html="暂无团队" small/>
|
||||
}
|
||||
</Box>
|
||||
</Box>}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ const CLANew = Loadable({
|
|||
export default (( props )=>{
|
||||
const pathname = props.location.pathname;
|
||||
const OIdentifier = props.match.params.OIdentifier;
|
||||
const {organizeDetail} = props;
|
||||
const {organizeDetail, enterpriseOpened} = props;
|
||||
useEffect(()=>{
|
||||
if(organizeDetail){
|
||||
const {nickname} = organizeDetail;
|
||||
|
|
@ -68,8 +68,8 @@ export default (( props )=>{
|
|||
const array = {list:[
|
||||
{name:'基本设置',icon:"icon-base",href:`/${OIdentifier}/setting`},
|
||||
{name:'组织首页管理',icon:"icon-huabanfuben",href:`/${OIdentifier}/setting/index`},
|
||||
{name:'组织成员管理',icon:"icon-zuzhichengyuan",href:`/${OIdentifier}/setting/member`},
|
||||
{name:'组织团队管理',icon:"icon-zuzhixiangmu",href:`/${OIdentifier}/setting/group`},
|
||||
{name:'组织成员管理',icon:"icon-zuzhichengyuan",href: enterpriseOpened ? `https://testpm.trustie.net/${OIdentifier}/members` : `/${OIdentifier}/setting/member`},
|
||||
{name:'组织团队管理',icon:"icon-zuzhixiangmu",href:`/${OIdentifier}/setting/group`, hide: enterpriseOpened},
|
||||
// {name:'管理web钩子',icon:"icon-zhongqingdianxinicon10",href:`/${OIdentifier}/setting/hooks`}
|
||||
{name:'CLA管理',img:claIcon,href:`/${OIdentifier}/setting/agreement`,hide:organizeDetail && !organizeDetail.enabling_cla}
|
||||
],
|
||||
|
|
@ -78,7 +78,7 @@ export default (( props )=>{
|
|||
return(
|
||||
<Box>
|
||||
<Short>
|
||||
<Setnav header={<Title>组织设置</Title>} nav={array}></Setnav>
|
||||
<Setnav header={<Title>组织设置</Title>} nav={array} history={props.history}></Setnav>
|
||||
</Short>
|
||||
<Long>
|
||||
<Gap >
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ const Enterprise = Loadable({
|
|||
function Detail(props){
|
||||
const OIdentifier = props.match.params.OIdentifier;
|
||||
const pathname = props.location.pathname;
|
||||
const {enterpriseOpened} = props;
|
||||
|
||||
const [ detail , setDetail ] = useState(undefined);
|
||||
const [ flag , setFlag ] = useState(true);
|
||||
|
|
@ -91,7 +92,7 @@ function Detail(props){
|
|||
title={detail.nickname}
|
||||
desc={!buttonflag && detail.description}
|
||||
img={detail.avatar_url}
|
||||
rightBtn={buttonflag &&
|
||||
rightBtn={buttonflag && !enterpriseOpened &&
|
||||
<span className="subNavs">
|
||||
<Link to={`/${OIdentifier}/members`} className={pathname ===`/${OIdentifier}/members` ? "active":""}><span>组织成员</span>{detail.num_users && <lable>{detail.num_users}</lable>}</Link>
|
||||
<Link to={`/${OIdentifier}/teams`} className={pathname ===`/${OIdentifier}/teams` ? "active":""}><span>组织团队</span>{detail.num_teams &&<lable>{detail.num_teams}</lable>}</Link>
|
||||
|
|
@ -138,7 +139,7 @@ function Detail(props){
|
|||
<Route
|
||||
path="/:OIdentifier/setting"
|
||||
render={(p) => {
|
||||
return <Setting {...props} {...p} organizeDetail={detail} updateFunc={updateDetail}/>
|
||||
return <Setting {...props} {...p} organizeDetail={detail} updateFunc={updateDetail} enterpriseOpened={enterpriseOpened}/>
|
||||
}}
|
||||
></Route>
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { Pagination , Spin } from 'antd';
|
|||
import AddMemberBox from './Component/AddMemberBox';
|
||||
|
||||
const limit = 16;
|
||||
function TeamMember({organizeDetail,current_user,history,match}){
|
||||
function TeamMember({organizeDetail,current_user,history,match,enterpriseOpened}){
|
||||
const OIdentifier = match.params.OIdentifier;
|
||||
const [ page , setPage ] = useState(1);
|
||||
const [ total , setTotal ] = useState(0);
|
||||
|
|
@ -46,7 +46,7 @@ function TeamMember({organizeDetail,current_user,history,match}){
|
|||
<WhiteBack style={{marginBottom:"30px",border:'1px solid #eee'}}>
|
||||
<Banner>组织成员
|
||||
{
|
||||
organizeDetail && organizeDetail.is_admin &&
|
||||
!enterpriseOpened && organizeDetail && organizeDetail.is_admin &&
|
||||
<AddMemberBox
|
||||
className="addMemberBtn"
|
||||
orzId={organizeDetail && organizeDetail.id}
|
||||
|
|
|
|||
Loading…
Reference in New Issue