forked from Gitlink/forgeplus-react
处理issue
This commit is contained in:
parent
0730396cc9
commit
43865206d6
|
|
@ -37,10 +37,13 @@ function UpdateDescModal({form , visible , onCancel , onOk,desc,website,lesson_u
|
|||
// 校验项目标签
|
||||
function checkTopics(rule, value, callback){
|
||||
const boolLength = value.filter(item=>item.length > 20);
|
||||
const bool = value.filter(item=>!/^(?![-])[a-zA-Z0-9\u4e00-\u9fa5\\-]+$/.test(item));
|
||||
if(value.length > 5){
|
||||
callback("最多创建5个标签");
|
||||
}else if(boolLength.length){
|
||||
callback("每个标签最多支持20个汉字");
|
||||
}else if(bool.length){
|
||||
callback("标签名只允许包含中文、字母、数字或者中划线(-), 不能以中划线开头");
|
||||
}
|
||||
callback();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import Nodata from '../Nodata';
|
|||
const Option = Select.Option;
|
||||
|
||||
export default withRouter((CNotificationHOC()(SnackbarHOC()(TPMIndexHOC((props) => {
|
||||
console.log('props', props);
|
||||
const {match:{params:{name, id}}, current_user:{user_id}} = props;
|
||||
const [languageList, setLanguageList] = useState(undefined);
|
||||
const [languageId, setLanguageId] = useState(undefined);
|
||||
|
|
@ -44,7 +43,6 @@ export default withRouter((CNotificationHOC()(SnackbarHOC()(TPMIndexHOC((props)
|
|||
}
|
||||
}).then((result) => {
|
||||
if (result) {
|
||||
console.log('result', result);
|
||||
setProjectsList(result.data.projects);
|
||||
setTotal(result.data.total_count);
|
||||
}
|
||||
|
|
@ -57,7 +55,7 @@ export default withRouter((CNotificationHOC()(SnackbarHOC()(TPMIndexHOC((props)
|
|||
<div className='topicRepoList pb50'>
|
||||
<h2 className='mt30 pl15'>#{decodeURIComponent(name)}</h2>
|
||||
<div className='flexBoxTopic topicRepoHead'>
|
||||
<span>平台共6个项目与此标签相匹配</span>
|
||||
<span>平台共{total}个公开项目与此标签相匹配</span>
|
||||
<div>
|
||||
<Select defaultValue={0} showSearch placeholder="请选择语言" style={{minWidth:"104px", marginRight: '20px'}} onChange={(value)=>{setLanguageId(value)}} optionFilterProp="children" filterOption={(input,option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}>
|
||||
<Option key={0} value={0}>全部语言</Option>
|
||||
|
|
@ -79,7 +77,7 @@ export default withRouter((CNotificationHOC()(SnackbarHOC()(TPMIndexHOC((props)
|
|||
</div>
|
||||
</div>
|
||||
{/* 无数据 */}
|
||||
{projectsList && projectsList.length === 0 && <Nodata _html="暂无数据"/>}
|
||||
{projectsList && projectsList.length === 0 && <div className='repoByTopicNodata'><Nodata _html="暂无数据"/></div>}
|
||||
{/* 项目列表 */}
|
||||
{projectsList && projectsList.length>0 && projectsList.map(i=>{
|
||||
return <div key={i.id} className='flexBoxTopic repoTopic'>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
.topicRepoList{
|
||||
width: 900px;
|
||||
margin: 0 auto;
|
||||
min-height: 700px;
|
||||
.flexBoxTopic{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
@ -92,4 +93,7 @@
|
|||
.pagTopic{
|
||||
text-align: center;
|
||||
}
|
||||
.repoByTopicNodata .none_panels{
|
||||
min-height: 520px;
|
||||
}
|
||||
}
|
||||
|
|
@ -132,7 +132,7 @@
|
|||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
&>.none_panels{
|
||||
margin: 0 auto;
|
||||
margin: 125px auto;
|
||||
}
|
||||
.botLoading{
|
||||
margin: 200px auto;
|
||||
|
|
|
|||
Loading…
Reference in New Issue