分支设置

This commit is contained in:
caishi 2020-11-30 16:14:55 +08:00
parent 06f0c53d3b
commit 2ba469f210
2 changed files with 14 additions and 7 deletions

View File

@ -13,14 +13,16 @@ const Div = styled.div`
`;
export default Form.create()(
forwardRef(({ form, match, history }) => {
const [list, setList] = useState(undefined);
const [ pullMember, setPullMember ] = useState(undefined);
const [ pushMember, setPushMember ] = useState(undefined);
const { projectsId, owner } = match.params;
const { getFieldDecorator, validateFields } = form;
useEffect(() => {
const url = `/${owner}/${projectsId}/collaborators.json`;
axios.get(url).then((result) => {
setList(result.data.members);
setPullMember(result.data.members);
setPushMember(result.data.members);
})
.catch((error) => {});
}, []);
@ -38,6 +40,7 @@ export default Form.create()(
})
);
}
function saveBranchRule() {
validateFields((error, values) => {
if (!error) {
@ -45,6 +48,10 @@ export default Form.create()(
});
}
function changePull(e){
console.log("dddd",e);
}
const helper = useCallback(
(label, name, rules, widget, className, isRequired) => (
<div className={className}>
@ -77,7 +84,7 @@ export default Form.create()(
[{ required: true, message: "请选择可推送代码成员" }],
<Select placeholder="请选择仓库成员">
<Option value="0">请选择仓库成员</Option>
{getMember(list)}
{getMember(pushMember)}
</Select>,
"setSelectWidth"
)}
@ -85,9 +92,9 @@ export default Form.create()(
"可合并Pull Request成员",
"pullmember",
[{ required: true, message: "请选择可合并Pull Request成员" }],
<Select placeholder="请选择仓库成员">
<Select showSearch placeholder="请选择仓库成员" onChange={changePull}>
<Option value="0">请选择仓库成员</Option>
{getMember(list)}
{getMember(pullMember)}
</Select>,
"setSelectWidth"
)}

View File

@ -65,7 +65,7 @@ class Index extends Component {
</Link>
</p>
</li>
<li
{/* <li
className={
pathname.indexOf("setting/branch") > -1 ? "active" : ""
}
@ -76,7 +76,7 @@ class Index extends Component {
分支设置
</Link>
</p>
</li>
</li> */}
<li
className={pathname.indexOf("setting/tags") > -1 ? "active" : ""}
>