This commit is contained in:
caishi 2021-05-06 17:12:42 +08:00
parent 4c48b6c77a
commit 6a546c79e4
1 changed files with 27 additions and 15 deletions

View File

@ -43,7 +43,8 @@ class Index extends Component {
project_language_name: undefined, project_language_name: undefined,
project_category_name: undefined, project_category_name: undefined,
license_name: undefined, license_name: undefined,
ignore_name: undefined ignore_name: undefined,
descNum:0
} }
} }
componentDidMount = () => { componentDidMount = () => {
@ -254,6 +255,13 @@ class Index extends Component {
} }
} }
changeDesc=(e)=>{
let value = e.target.value;
this.setState({
descNum:value ? value.length :0
})
}
render() { render() {
const { getFieldDecorator } = this.props.form; const { getFieldDecorator } = this.props.form;
// 项目类型deposit-托管项目mirror-镜像项目 // 项目类型deposit-托管项目mirror-镜像项目
@ -273,7 +281,9 @@ class Index extends Component {
license_list, license_list,
ignore_list, ignore_list,
mirrorCheck mirrorCheck,
descNum
} = this.state; } = this.state;
return ( return (
<div className="main back-white" style={{padding:"0px",border:"none"}}> <div className="main back-white" style={{padding:"0px",border:"none"}}>
@ -364,18 +374,20 @@ class Index extends Component {
<Input placeholder="例如:团队协作方法与研究" maxLength={50}/> <Input placeholder="例如:团队协作方法与研究" maxLength={50}/>
)} )}
</Form.Item> </Form.Item>
<div className="pr">
<Form.Item <span className="toprightNum">{descNum}/200</span>
label="项目简介" <Form.Item
> label="项目简介"
{getFieldDecorator('description', { >
rules: [{ {getFieldDecorator('description', {
required: true, message: '请填写项目简介' rules: [{
}], required: true, message: '请填写项目简介'
})( }],
<Input.TextArea showCount placeholder="项目的介绍" autoSize={{ minRows: 2, maxRows: 6 }} maxLength={"200"}/> })(
)} <Input.TextArea maxLength={200} placeholder="项目的介绍" autoSize={{ minRows: 2, maxRows: 6 }} onChange={this.changeDesc}/>
</Form.Item> )}
</Form.Item>
</div>
<Form.Item <Form.Item
label="仓库名称" label="仓库名称"
> >
@ -384,7 +396,7 @@ class Index extends Component {
required: true, message: '请填写仓库名称' required: true, message: '请填写仓库名称'
}], }],
})( })(
<Input placeholder="仓库名称请使用与项目相关的英文关键字" maxLength={"100"}/> <Input placeholder="仓库名称请使用与项目相关的英文关键字" maxLength={100} />
)} )}
</Form.Item> </Form.Item>
<Form.Item <Form.Item