This commit is contained in:
caishi 2021-02-22 10:17:52 +08:00
parent b4a608bcc3
commit 518d341ed5
5 changed files with 28 additions and 14 deletions

View File

@ -19,7 +19,7 @@ export default (({fork,parise})=>{
}`;
const SpanStyleparise = styled.span`{
display:flex;
align-item:center;
align-items:center;
margin-left:30px;
padding:0px 12px;
border-radius:13px;

View File

@ -325,7 +325,7 @@ class order extends Component {
deletedetail = (id) => {
const { projectsId , owner } = this.props.match.params;
const url = `/projects/${owner}/${projectsId}/issues/${id}.json`;
const url = `/${owner}/${projectsId}/issues/${id}.json`;
axios.delete(url, {
data: {
project_id: projectsId,

View File

@ -21,8 +21,9 @@ export default Form.create()(
forwardRef(({ form , match, showNotification, history, GroupDetail }) => {
const [isSpin, setIsSpin] = useState(false);
const [check_box, setGroupDetail] = useState(false);
const [check_box, setCheckBox] = useState(false);
const [switch_box, setSwtichBox] = useState([]);
const [onwers, setOnwers] = useState(false);
const [switch_box_code, setSwtichBoxCode] = useState(false);
const [switch_box_pull, setSwtichBoxPull] = useState(false);
const [switch_box_issue, setSwtichBoxIssue] = useState(false);
@ -32,7 +33,8 @@ export default Form.create()(
useEffect(() => {
if (GroupDetail) {
setGroupDetail(GroupDetail.can_create_org_project)
setOnwers(GroupDetail.authorize === "owner");
setCheckBox(GroupDetail.can_create_org_project)
setSwtichBox(GroupDetail.units)
setFieldsValue({
...GroupDetail
@ -50,13 +52,13 @@ export default Form.create()(
}, [switch_box])
const helper = useCallback(
(label, name, rules, widget, isRequired, mbValue) => (
<React.Fragment>
<span className={isRequired ? "required" : ""}>{label}</span>
(label, name, rules, widget, isRequired, mbValue,className) => (
<div className={className}>
<span className={isRequired ? `required` : ``}>{label}</span>
<Form.Item style={{ marginBottom: `${mbValue}px` || "20px" }}>
{getFieldDecorator(name, { rules, validateFirst: true })(widget)}
</Form.Item>
</React.Fragment>
</div>
),
[]
);
@ -92,7 +94,7 @@ export default Form.create()(
}
function change_check_box_status() {
setGroupDetail(!check_box)
setCheckBox(!check_box)
}
function switch_checked(code) {
@ -145,7 +147,7 @@ export default Form.create()(
'团队名称:',
"name",
[{ required: true, message: "请输入团队名称" }],
<Input placeholder="请输入团队名称" />, true
<Input placeholder="请输入团队名称" disabled={onwers}/>, true
)}
{helper(
<span className="mb5">团队描述<span className="color-grey-8">(描述团队的目的或作用)</span></span>,
@ -155,6 +157,7 @@ export default Form.create()(
placeholder="请输入团队描述"
/>
)}
{helper(
'项目权限:',
"includes_all_project",
@ -162,23 +165,23 @@ export default Form.create()(
<Radio.Group>
<Radio value={false} style={addStyle}>指定项目<span className="color-grey-8 ml10">(团队成员将只能访问添加到团队的项目 选择此项 <span className="color-grey-3">将不会</span> 自动删除已经添加的项目)</span></Radio>
<Radio value={true} style={OptionStyle}>所有项目<span className="color-grey-8 ml10">(团队可以访问所有项目选择此选项将 <span className="color-grey-3">添加所有现有的</span> 项目到指定团队)</span></Radio>
</Radio.Group>, false, 0
</Radio.Group>, false, 0,onwers ? "hide":""
)}
{helper(
'',
"can_create_org_project",
[],
<Checkbox checked={check_box} onChange={change_check_box_status} style={OptionStyle}>新建项目<span className="color-grey-8 ml10">(成员可以在组织中新建项目创建者将自动获得新建的项目的管理员权限)</span></Checkbox>, false
<Checkbox checked={check_box} onChange={change_check_box_status} style={OptionStyle}>新建项目<span className="color-grey-8 ml10">(成员可以在组织中新建项目创建者将自动获得新建的项目的管理员权限)</span></Checkbox>, false, 20,onwers ? "hide":""
)}
{helper(
'权限:',
'版本库权限:',
"authorize",
[],
<Radio.Group>
<Radio value="read" style={addStyle}>读取权限<span className="color-grey-8 ml10">(成员可以查看和克隆团队项目)</span></Radio>
<Radio value="write" style={addStyle}>写入权限<span className="color-grey-8 ml10">(成员可以查看和推送提交到团队项目)</span></Radio>
<Radio value="admin" style={OptionStyle}>管理员权限<span className="color-grey-8 ml10">(成员可以拉取和推送到团队项目同时可以添加协作者)</span></Radio>
</Radio.Group>, false
</Radio.Group>, false, 20,onwers ? "hide":""
)}
</Form>
{/* <p className="required">访</p>

View File

@ -63,6 +63,10 @@
line-height: 30px;
padding:0px 10px;
}
.ant-btn.ant-input-search-button{
margin-top: -1px;
margin-right: -1px;
}
}
.team{
padding:0px 32px;
@ -355,3 +359,6 @@
border-bottom: 1px solid #eee;
}
}
.hide{
display: none;
}

View File

@ -19,6 +19,10 @@ $flex:flex;
display: $flex;
align-items: center;
}
.ant-btn.ant-input-search-button{
margin-top: -1px;
margin-right: -1px;
}
}
.contentBox{
padding:20px 40px 0px 40px;