组织团队-新增一个团队标识

This commit is contained in:
caishi 2021-04-19 11:53:19 +08:00
parent 3702d1c1a5
commit 91ac6c2357
3 changed files with 26 additions and 4 deletions

View File

@ -101,7 +101,7 @@ export default ((props) => {
group ?
<div>
<AlignCenterBetween>
<span className="color-grey-3">{group.name}</span>
<span className="color-grey-3">{group.nickname}</span>
{group.is_member && !group.is_admin ?
<Popconfirm
title="确认离开团队吗?"

View File

@ -137,6 +137,17 @@ export default Form.create()(
history.push(`/organize/${OIdentifier}`);
}
}
function checkname(rule, value, callback){
if(!value){
callback();
}
if(value && !value.match(/^[a-zA-Z][a-zA-Z\d]{3,14}$/)){
callback("只能使用英文字母和数字以字母开头长度为4到15个字符");
}
callback();
}
return (
<Spin spinning={isSpin}>
<WhiteBack className="mb30" style={{border:groupId?"none":"1px solid #eee"}}>
@ -144,10 +155,21 @@ export default Form.create()(
<Div>
<Form>
{helper(
'团队名称',
'团队标识',
"name",
[
{ required: true, message: "请输入团队标识" },
{
validator:checkname
}
],
<Input placeholder="请输入团队标识" disabled={onwers}/>, true
)}
{helper(
'团队名称:',
"nickname",
[{ required: true, message: "请输入团队名称" }],
<Input placeholder="请输入团队名称" disabled={onwers}/>, true
<Input placeholder="请输入团队名称"/>, true
)}
{helper(
<span className="mb5">团队描述<span className="color-grey-8">(描述团队的目的或作用)</span></span>,

View File

@ -75,7 +75,7 @@ function TeamGroupItems({organizeDetail,limit, count , history}){
return(
<div key={key}>
<p className="g-head">
<Link to={`/organize/${organizeDetail.name}/group/${item.id}`} className="color-grey-3 font-16">{item.name}</Link>
<Link to={`/organize/${organizeDetail.name}/group/${item.id}`} className="color-grey-3 font-16">{item.nickname}</Link>
<span>
{ item.is_admin && item.authorize!=="owner" && <Popconfirm title={`确定解散团队${item.name}?`} okText="是" cancelText="否" onConfirm={()=>disMissGroup(item.id)}><a className="color-red">解散团队</a></Popconfirm>}
{ item.is_member && <LeaveTeam className="ml15" teamID={item.id} onOk={outTeam}/>}