选择标签

This commit is contained in:
caishi 2020-05-28 15:18:57 +08:00
parent bedb5448a6
commit 8b80d60996
4 changed files with 25 additions and 20 deletions

View File

@ -283,7 +283,7 @@ class CoderRootDirectory extends Component{
dataIndex: 'name',
width:"30%",
render: (text,item) => (
<a onClick={()=>this.goToSubRoot(item.path)}>
<a onClick={()=>this.goToSubRoot(item.path)} className="ml12">
<i className={ item.type === "file" ? "iconfont icon-wenjia font-15 color-green-file mr5":"iconfont icon-wenjianjia1 color-green-file font-15 mr5"}></i>{text}
</a>
),
@ -297,8 +297,9 @@ class CoderRootDirectory extends Component{
},{
dataIndex:"commit",
width:"10%",
className:"edu-txt-right",
render:(text,item)=>(
item.commit && item.commit.time_from_now ? <a title={item.commit.created_at} style={{cursor:"default",color:"#888"}}>{item.commit.time_from_now}</a> :""
item.commit && item.commit.time_from_now ? <a title={item.commit.created_at} className="mr12" style={{cursor:"default",color:"#888"}}>{item.commit.time_from_now}</a> :""
)
}
];

View File

@ -408,7 +408,7 @@
}
.wrap-commit-table .ant-table-title{
background-color: rgba(241,248,255,1);
padding: 13px 8px!important;
padding: 13px 16px!important;
}
.commitKey{
border:1px solid #FD7700;

View File

@ -23,15 +23,8 @@ export default Form.create()(
const [desc, setDesc] = useState(null);
const [fileList, setFileList] = useState(undefined);
const [attachment, setAttachment] = useState(undefined);
const [options , setOptions] = useState(undefined);
const SelectDiv = styled.div`
display: flex;
align-item: center;
margin-bottom: 5px;
& .ant-row {
margin-bottom: 0px;
}
`;
const Span = styled.span`
margin: 0px 15px;
color: #bbb;
@ -68,6 +61,7 @@ export default Form.create()(
.then(result => {
if (result) {
setTagList(result.data);
setOptions(renderTagList(result.data));
}
})
.catch(error => {
@ -88,10 +82,6 @@ export default Form.create()(
return array || undefined;
}
}
function changeT(value) {
// let l = tagList.filter(item => item.name.indexOf(value) > -1);
// setTagList(l);
}
function submit() {
validateFields((err, value) => {
if (versionId) {
@ -137,23 +127,29 @@ export default Form.create()(
),
[]
);
//
function changeAuto(value){
let l = tagList.filter(item=>item.name.indexOf(value) > -1);
setOptions(renderTagList(l));
}
return (
<div className="main df">
<Form className="versionForm">
<div>
<p className="font-16 color-grey-3 mb15">创建发行版</p>
<div>
<SelectDiv>
<div className="itemInline">
{helper(
"",
"tag_name",
[{ required: true, message: "请输入获取或选择一个标签" }],
<AutoComplete
placeholder="标记一个版本"
dataSource={renderTagList(tagList)}
onChange={changeT}
onChange={changeAuto}
style={{ width: "200px" }}
></AutoComplete>
>
{options}
</AutoComplete>
)}
<Span>@</Span>
{helper(
@ -168,7 +164,7 @@ export default Form.create()(
{renderTagList(branchList)}
</Select>
)}
</SelectDiv>
</div>
<p className="font-13 color-grey-8">
选择一个已经存在的标签或者在发布时新建一个标签
</p>

View File

@ -194,4 +194,12 @@
display: flex;
height: 20px;
align-items: center;
}
.itemInline{
display: flex;
align-item: center;
margin-bottom: 5px;
}
.itemInline .ant-row{
margin-bottom: 0px;
}