issue-字符限制

This commit is contained in:
caishi 2021-05-06 17:12:42 +08:00
parent c28ae9adb3
commit e7eceb5b23
11 changed files with 104 additions and 55 deletions

View File

@ -6702,4 +6702,10 @@ ul.count_ul li:not(:last-child):after {
} }
input.ant-input-lg::placeholder{ input.ant-input-lg::placeholder{
font-size: 14px !important; font-size: 14px !important;
}
.toprightNum{
position: absolute;
right: 0px;
top:4px;
color: #999;
} }

View File

@ -152,18 +152,18 @@ function DivertModal({form , visible , onSuccess , onCancel,owner,repo}){
</Form.Item> </Form.Item>
} }
<Form.Item label="仓库标识:"> <Form.Item label="仓库名称:">
{getFieldDecorator("identifier", {getFieldDecorator("identifier",
{ {
rules:[ rules:[
{required:true,message:"请输入仓库标识"}, {required:true,message:"请输入仓库名称"},
{ {
validator:checkIdentifier validator:checkIdentifier
} }
] ]
} }
)( )(
<Input placeholder="请输入仓库标识" autoComplete={"off"}/> <Input placeholder="请输入仓库名称" autoComplete={"off"}/>
)} )}
</Form.Item> </Form.Item>
</Form> </Form>

View File

@ -2,16 +2,14 @@ import React, { Component } from 'react';
import AccountProfile from "../../modules/user/AccountProfile"; import AccountProfile from "../../modules/user/AccountProfile";
import { getImageUrl } from 'educoder' import { getImageUrl } from 'educoder'
import axios from 'axios'; import axios from 'axios';
import { Modal, Input, message, notification , Dropdown , Menu ,Divider } from 'antd'; import { Modal, Input, message, notification , Dropdown , Menu } from 'antd';
import LoginDialog from '../../modules/login/LoginDialog'; import LoginDialog from '../../modules/login/LoginDialog';
import GotoQQgroup from '../../modal/GotoQQgroup' import GotoQQgroup from '../../modal/GotoQQgroup'
// import 'antd/lib/modal/style/index.css';
// import 'antd/lib/checkbox/style/index.css';
// import 'antd/lib/radio/style/index.css';
// import 'antd/lib/input/style/index.css';
import '../../modules/tpm/TPMIndex.css'; import '../../modules/tpm/TPMIndex.css';
import logo from '../../modules/tpm/images/logo.png'; import logo from '../../modules/tpm/images/logo.png';
import './header.scss'; import './header.scss';
const $ = window.$ const $ = window.$
// TODO 这部分脚本从公共脚本中直接调用 // TODO 这部分脚本从公共脚本中直接调用

View File

@ -5,7 +5,13 @@
background:#fff; background:#fff;
border-radius: 3px; border-radius: 3px;
.ant-menu-vertical > .ant-menu-item{ .ant-menu-vertical > .ant-menu-item{
border:none border:none;
height: 35px;
line-height: 35px;
margin:0px;
}
.ant-menu-vertical{
border:none;
} }
} }

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

View File

@ -320,7 +320,7 @@ class order_form extends Component {
message: "请填写易修标题", message: "请填写易修标题",
}, },
] ]
})(<Input placeholder="标题" size="large" />)} })(<Input placeholder="标题" size="large" maxLength={80}/>)}
</Form.Item> </Form.Item>
<div className="quillContent"> <div className="quillContent">
<MDEditor <MDEditor

View File

@ -24,6 +24,7 @@ export default Form.create()(
const [check_box, setCheckBox] = useState(false); const [check_box, setCheckBox] = useState(false);
const [switch_box, setSwtichBox] = useState([]); const [switch_box, setSwtichBox] = useState([]);
const [onwers, setOnwers] = useState(false); const [onwers, setOnwers] = useState(false);
const [ descNum , setDescNum ] = useState(0);
const [switch_box_code, setSwtichBoxCode] = useState(false); const [switch_box_code, setSwtichBoxCode] = useState(false);
const [switch_box_pull, setSwtichBoxPull] = useState(false); const [switch_box_pull, setSwtichBoxPull] = useState(false);
const [switch_box_issue, setSwtichBoxIssue] = useState(false); const [switch_box_issue, setSwtichBoxIssue] = useState(false);
@ -39,6 +40,7 @@ export default Form.create()(
setFieldsValue({ setFieldsValue({
...GroupDetail ...GroupDetail
}) })
setDescNum(GroupDetail.description ? GroupDetail.description.length : 0);
} }
}, [GroupDetail]) }, [GroupDetail])
@ -171,14 +173,19 @@ export default Form.create()(
[{ required: true, message: "请输入团队名称" }], [{ required: true, message: "请输入团队名称" }],
<Input placeholder="请输入团队名称"/>, true <Input placeholder="请输入团队名称"/>, true
)} )}
{helper( <div className="pr">
<span className="mb5">团队描述<span className="color-grey-8">(描述团队的目的或作用)</span></span>, <span className="toprightNum">{descNum}/200</span>
"description", {helper(
[], <span className="mb5">团队描述<span className="color-grey-8">(描述团队的目的或作用)</span></span>,
<TextArea "description",
placeholder="请输入团队描述" [],
/> <TextArea
)} placeholder="请输入团队描述"
maxLength={200}
onChange={(e)=>{setDescNum(e.target.value ? e.target.value.length :0)}}
/>
)}
</div>
{helper( {helper(
'项目权限:', '项目权限:',

View File

@ -9,6 +9,8 @@ export default Form.create()(
forwardRef(({ form , showNotification , history })=>{ forwardRef(({ form , showNotification , history })=>{
const [ image , setImage ] = useState(undefined); const [ image , setImage ] = useState(undefined);
const [ imageFlag , setImageFlag] = useState(false); const [ imageFlag , setImageFlag] = useState(false);
const [ descNum ,setDescNum ] = useState(0);
const { getFieldDecorator, validateFields , setFieldsValue } = form; const { getFieldDecorator, validateFields , setFieldsValue } = form;
const radioStyle = { const radioStyle = {
display: 'block', display: 'block',
@ -86,7 +88,7 @@ export default Form.create()(
], ],
<Input <Input
addonBefore={`https://`+ port ? `${hostname}:${port}/organize`:`${hostname}/organize`} addonBefore={`https://`+ port ? `${hostname}:${port}/organize`:`${hostname}/organize`}
placeholder="组织账号" placeholder="组织账号" maxLength={100}
/> />
)} )}
{helper( {helper(
@ -94,24 +96,28 @@ export default Form.create()(
"nickname", "nickname",
[{ required: true, message: "请输入组织名称" }], [{ required: true, message: "请输入组织名称" }],
<Input <Input
placeholder="请输入组织名称" placeholder="请输入组织名称" maxLength={100}
/> />
)} )}
<div className="pr">
<span className="toprightNum">{descNum}/200</span>
{helper(
'组织描述',
"description",
[{ required: true, message: "请输入组织描述" }],
<Input.TextArea
autoSize={{ minRows: 3, maxRows: 5 }}
placeholder="请输入组织描述" maxLength={200}
onChange={(e)=>{setDescNum(e.target.value ? e.target.value.length :0)}}
/>
)}
</div>
{helper(
'组织描述',
"description",
[{ required: true, message: "请输入组织描述" }],
<Input.TextArea
autoSize={{ minRows: 3, maxRows: 5 }}
placeholder="请输入组织描述"
/>
)}
{helper( {helper(
'所在地区', '所在地区',
"location", "location",
[], [],
<Input placeholder="请输入地址"/>,false <Input placeholder="请输入地址" maxLength={50}/>,false
)} )}
{helper( {helper(
'可见性', '可见性',

View File

@ -25,6 +25,7 @@ export default Form.create()(
const [ password , setPassword ] = useState(undefined); const [ password , setPassword ] = useState(undefined);
const [ passwordFlag , setPasswordFlag ] = useState(false); const [ passwordFlag , setPasswordFlag ] = useState(false);
const [ visible , setVisible ] = useState(false); const [ visible , setVisible ] = useState(false);
const [ descNum , setDescNum ] = useState(0);
const { getFieldDecorator , validateFields , setFieldsValue } = form; const { getFieldDecorator , validateFields , setFieldsValue } = form;
useEffect(()=>{ useEffect(()=>{
@ -33,6 +34,7 @@ export default Form.create()(
...organizeDetail ...organizeDetail
}) })
setImage(organizeDetail.avatar_url); setImage(organizeDetail.avatar_url);
setDescNum(organizeDetail.description ? organizeDetail.description.length : 0);
} }
},[organizeDetail]) },[organizeDetail])
@ -119,20 +121,27 @@ export default Form.create()(
validator:checkname validator:checkname
} }
], ],
<Input placeholder="请输入组织账号" disabled/>,true <Input placeholder="请输入组织账号" maxLength={100} disabled/>,true
)} )}
{helper( {helper(
"组织名称:", "组织名称:",
"nickname", "nickname",
[{ required: true, message: "请输入组织名称" }], [{ required: true, message: "请输入组织名称" }],
<Input placeholder="请输入组织名称" />,true <Input placeholder="请输入组织名称" maxLength={100}/>,true
)}
{helper(
"组织描述:",
"description",
[],
<TextArea placeholder="请输入组织名称" />
)} )}
<div className="pr">
<span className="toprightNum">{descNum}/200</span>
{helper(
"组织描述:",
"description",
[],
<TextArea
placeholder="请输入组织名称"
maxLength={200}
onChange={(e)=>{setDescNum(e.target.value ? e.target.value.length :0)}}
/>
)}
</div>
{helper( {helper(
"官方网站:", "官方网站:",
"website", "website",

View File

@ -29,7 +29,7 @@ $flex:flex;
& > div{ & > div{
margin-bottom: 20px; margin-bottom: 20px;
display: $flex; display: $flex;
align-items: flex-start; align-items: center;
padding:20px 25px; padding:20px 25px;
background-color:rgba(250,250,250,1); background-color:rgba(250,250,250,1);
.imgBox{ .imgBox{
@ -52,6 +52,11 @@ $flex:flex;
font-size: 12px; font-size: 12px;
color: #888; color: #888;
margin-top: 3px; margin-top: 3px;
margin-bottom: 0px;
}
.teamdesc{
word-break: break-all;
line-height: 20px;
} }
} }
.infosType{ .infosType{

View File

@ -7,7 +7,7 @@ function TeamItem({item,history}){
<div className="imgBox"><img alt="" src={getImageUrl(`/${item.avatar_url}`)}/></div> <div className="imgBox"><img alt="" src={getImageUrl(`/${item.avatar_url}`)}/></div>
<div style={{flex:'1'}}> <div style={{flex:'1'}}>
<span className="mb5 font-18 color-grey-3 task-hide">{item.name}</span> <span className="mb5 font-18 color-grey-3 task-hide">{item.name}</span>
<div className="task-hide-2"> <div className="task-hide-2 teamdesc">
{item.description} {item.description}
</div> </div>
<p className="item-news"> <p className="item-news">