feat: 项目设置页面 只有组长和超管显示删除按钮

This commit is contained in:
wenbo.dong 2017-09-22 11:52:17 +08:00
parent 7abb6a0acb
commit dfeab09f83
3 changed files with 22 additions and 21 deletions

View File

@ -18,7 +18,7 @@ export default class Group extends Component {
const GroupContent = (
<Layout>
<Sider style={{ height: '100vh', marginLeft: '24px', marginTop: '24px' }} width={300}>
<Sider style={{ height: 'auto', marginLeft: '24px', marginTop: '24px' }} width={300}>
<div className="logo" />
<GroupList></GroupList>
</Sider>

View File

@ -83,7 +83,7 @@ class Interface extends Component {
// console.log(matchPath(this.props.location.pathname, contentRouter));
return (
<Layout style={{marginTop: '-24px'}}>
<Sider style={{ height: '100vh', marginLeft: '24px', marginTop: '24px' }} width={300}>
<Sider style={{ height: 'auto', marginLeft: '24px', marginTop: '24px' }} width={300}>
<div className="left-menu">
<Tabs type="card" activeKey={activeKey} onChange={this.onChange}>
<Tabs.TabPane tab="接口列表" key="api">

View File

@ -1,5 +1,5 @@
import React, { Component } from 'react'
import { Form, Input, Icon, Tooltip, Select, Button, Row, Col, message, Card, Radio, Alert, Modal, Popover, Tabs, Affix } from 'antd';
import { Form, Input, Icon, Tooltip, Select, Button, Row, Col, message, Card, Radio, Alert, Modal, Popover, Tabs } from 'antd';
import PropTypes from 'prop-types';
import { updateProject, delProject, getProjectMsg, upsetProject } from '../../../../reducer/modules/project';
import { fetchGroupMsg } from '../../../../reducer/modules/group';
@ -435,19 +435,25 @@ class ProjectMessage extends Component {
</FormItem>
</Form>
<FormItem
{...formItemLayout}
label="危险操作"
className="danger-container"
>
<Card noHovering={true} className="card-danger">
<div className="card-danger-content">
<h3>删除项目</h3>
<p>项目一旦删除将无法恢复数据请慎重操作</p>
</div>
<Button type="danger" ghost className="card-danger-btn" onClick={this.showConfirm}>删除</Button>
</Card>
</FormItem>
<div className="btnwrap-changeproject">
<Button className="m-btn btn-save" icon="save" type="primary" size="large" onClick={this.handleOk} > </Button>
</div>
{projectMsg.role === 'owner' || projectMsg.role === 'admin' ?
<FormItem
{...formItemLayout}
label="危险操作"
className="danger-container"
>
<Card noHovering={true} className="card-danger">
<div className="card-danger-content">
<h3>删除项目</h3>
<p>项目一旦删除将无法恢复数据请慎重操作</p>
</div>
<Button type="danger" ghost className="card-danger-btn" onClick={this.showConfirm}>删除</Button>
</Card>
</FormItem> : null}
</div>
</TabPane>
<TabPane tab="环境配置" key="2">
@ -464,11 +470,6 @@ class ProjectMessage extends Component {
</TabPane>
</Tabs>
<Affix offsetBottom={0}>
<div className="btnwrap-changeproject">
<Button className="m-btn btn-save" icon="save" type="primary" size="large" onClick={this.handleOk} > </Button>
</div>
</Affix>
</div>
)
}