成员邀请静态页面

This commit is contained in:
谢思 2022-06-16 17:32:47 +08:00
parent 202ffd1a62
commit c30e229f73
6 changed files with 92 additions and 25 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 || 'student'
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin'
}
window._debugType = debugType;
export function initAxiosInterceptors(props) {

View File

@ -4,9 +4,10 @@ import AddMember from '../Component/AddMember';
import AddGroup from '../Component/AddGroup';
import Member from './CollaboratorMember';
import Group from './CollaboratorGroup';
import MemberByLink from './CollaboratorMemberByLink';
function Collaborator(props){
const [ nav , setNav] = useState("1");
const [ nav , setNav] = useState("3");
const [ newId , setNewId] = useState(undefined);
const [ newIdFlag , setNewIdFlag ] = useState(false);
const [ addOperation , setAddOperation] = useState(true);
@ -23,11 +24,10 @@ function Collaborator(props){
setNewGroupId(id);
}
return (
<WhiteBack>
<div className="flex-a-center baseForm bbr">
{
{/* {
author && author.type === "Organization" ?
<span>
<span style={{cursor:"pointer"}} className={nav === "1" ? "font-18 text-black color-blue":"font-18 text-black"} onClick={()=>{setNav("1");setNewId(undefined)}}>协作者管理</span>
@ -35,22 +35,26 @@ function Collaborator(props){
</span>
:
<span className="font-18 text-black">协作者管理</span>
}
} */}
<span>
<span style={{cursor:"pointer"}} className={nav === "1" ? "font-15 text-black color-blue":"font-15 text-black"} onClick={()=>{setNav("1");setNewId(undefined)}}>协作者管理</span>
<span style={{cursor:"pointer"}} className={nav === "3" ? "font-15 text-black color-blue ml30":"font-15 text-black ml30"} onClick={()=>{setNav("3");}}>邀请成员</span>
{author && author.type === "Organization" && <span style={{cursor:"pointer"}} className={nav === "2" ? "font-15 text-black ml30 color-blue":"font-15 text-black ml30"} onClick={()=>{setNav("2");setNewId(undefined);setNewGroupId(undefined)}}>团队管理</span>}
</span>
{
nav === "1" &&
(nav === "1" || nav === "3") &&
<AddMember getID={getID} login showNotification={props.showNotification}/>
}
{
(nav !== "1" && addOperation) &&
(nav === "2" && addOperation) &&
<AddGroup getGroupID={getGroupID} organizeId={owner}/>
}
</div>
<div>
{
nav === "1" ?
<Member newId={newId} flag={newIdFlag} projectsId={projectsId} owner={owner} project_id={props.project_id} author={props.projectDetail && props.projectDetail.author} showNotification={props.showNotification}/>
:
<Group setAddOperation={setAddOperation} owner={owner} projectsId={projectsId} newGroupId={newGroupId}/>
nav === "1" ? <Member newId={newId} flag={newIdFlag} projectsId={projectsId} owner={owner} project_id={props.project_id} author={props.projectDetail && props.projectDetail.author} showNotification={props.showNotification}/>
: nav === "2" ? <Group setAddOperation={setAddOperation} owner={owner} projectsId={projectsId} newGroupId={newGroupId}/>
: <MemberByLink newId={newId} flag={newIdFlag} projectsId={projectsId} owner={owner} project_id={props.project_id} author={props.projectDetail && props.projectDetail.author} showNotification={props.showNotification}/>
}
</div>
</WhiteBack>

View File

@ -0,0 +1,38 @@
import React, { useEffect, useState , useImperativeHandle , forwardRef } from 'react';
import { Select, Checkbox, Button , Input , Spin , Table , Tooltip , Pagination , Popconfirm } from "antd";
import axios from 'axios';
import NoneData from "../Nodata";
import { Link } from "react-router-dom";
import { getImageUrl } from "educoder";
const { Search } = Input;
const LIMIT = 15;
const optionList = [
{value: "manager",name: "管理员 - 拥有仓库设置功能、代码库读、写操作权限"},
{value: "developer",name: "开发人员 - 拥有代码库读、写操作权限"},
{value: "reporter",name: "报告者 - 拥有代码库读操作权限"}
];
function CollaboratorMemberByLink({projectsId,owner,project_id,author,showNotification,newId,flag}){
return(
<div className='addMemByLinkBox'>
<div className='font-16 mt20 mb5'>请选择邀请用户权限</div>
<Select className='selectBox' defaultValue="developer">
{optionList.map(item=>{
return <Select.Option value={item.value}>{item.name}</Select.Option>
})}
</Select>
<Checkbox className='font-15 checkBox'>是否需要管理员审核</Checkbox>
<div className='font-16 mt10 mb5'>邀请链接</div>
<Input addonAfter={<Button type='primary'>复制链接</Button>} className='linkBox'/>
<div className='tipBox mt20'>
<div>: </div>
<div className='ml5'>
1管理员可通过分享邀请链接的方式邀请其他成员加入项目<br/>
2若已勾选管理员审核选项用户接收邀请后管理员可在个人主页中待办事项窗口审核成员审核信息若不需要管理员审核成员接收邀请后将直接加入项目
</div>
</div>
</div>
)
}
export default forwardRef(CollaboratorMemberByLink);

View File

@ -57,7 +57,7 @@ class Index extends Component {
<li className={flag ? "active" : ""}>
<p>
<Link to={`/${owner}/${projectsId}/settings`} className="w-100">
<i className="iconfont icon-huabanfuben font-18 mr10"></i>
<i className="iconfont icon-huabanfuben font-15 mr10"></i>
</Link>
</p>
</li>
@ -68,7 +68,7 @@ class Index extends Component {
>
<p>
<Link to={`/${owner}/${projectsId}/settings/collaborators`} className="w-100">
<i className="iconfont icon-chengyuan font-18 mr10"></i>
<i className="iconfont icon-chengyuan font-15 mr10"></i>
协作者管理
</Link>
</p>
@ -80,7 +80,7 @@ class Index extends Component {
>
<p>
<Link to={`/${owner}/${projectsId}/settings/webhooks`} className="w-100">
<i className="iconfont icon-a-xuanzhongwebhookicon font-18 mr10 color-grey-9"></i>
<i className="iconfont icon-a-xuanzhongwebhookicon font-15 mr10 color-grey-9"></i>
网络钩子
</Link>
</p>
@ -92,7 +92,7 @@ class Index extends Component {
>
<p>
<Link to={`/${owner}/${projectsId}/settings/branches`} className="w-100">
<i className="iconfont icon-fenzhi font-20 mr10"></i>
<i className="iconfont icon-fenzhi font-15 mr10"></i>
分支设置
</Link>
</p>
@ -102,7 +102,7 @@ class Index extends Component {
>
<p>
<Link to={`/${owner}/${projectsId}/settings/labels`} className="w-100">
<i className="iconfont icon-xiangmubiaoqian font-18 mr10 color-grey-6"></i>
<i className="iconfont icon-xiangmubiaoqian font-15 mr10 color-grey-6"></i>
项目标记
</Link>
</p>

View File

@ -23,7 +23,7 @@
content: '';
}
.baseForm{
padding:15px 30px!important;
padding:15px 0!important;
}
.collaboratorList{
min-height: 400px;
@ -243,4 +243,31 @@
&>div:last-child{
border-bottom: none;
}
}
.addMemByLinkBox{
color:#202d40;
.selectBox {
width: 55%;
display: block;
margin-bottom: 8px;
}
.checkBox{
color:#151d40;
}
.tipBox{
background-color:rgba(199, 209, 255, 0.17);
color:#7e849e;
padding: 20px 150px 20px 25px;
display: flex;
}
.linkBox{
width: 55%;
.ant-input-group-addon{
padding: 0;
}
.ant-btn{
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
}
}

View File

@ -225,21 +225,20 @@ form{
margin-bottom: 12px;
border-radius:2px;
background-color: #fff;
// box-shadow: 0px 0px 2px rgba(0,0,0,0.2);
padding: 20px 0;
border:1px solid rgba(79, 108, 188, 0.21);
&>li{
font-size: 1rem;
padding:0px 0px 0px 20px;
font-size: 15px;
padding:0px 0px 0px 25px;
box-sizing: border-box;
color: #333;
position: relative;
& > p{
height: 62px;
line-height: 62px;
height: 49px;
width: 100%;
border-bottom: 1px solid #eee;
display: flex;
justify-content: space-between;
align-items: center;
cursor: pointer;
padding-right: 20px;
margin:0px;
@ -264,10 +263,9 @@ form{
& li.active::before{
position: absolute;
left: 0px;
top: 15px;
width: 6px;
content: '';
height: 33px;
height: 100%;
// background: #4CACFF;
background: $primary-color;
}