|
@@ -7,6 +7,7 @@ import { connect } from 'dva'
|
|
|
import './userGroupManagement.less'
|
|
import './userGroupManagement.less'
|
|
|
import DetailBox from './userGroupDetailBox'
|
|
import DetailBox from './userGroupDetailBox'
|
|
|
import AddMemberBox from '../common/selectUserBox/selectUserBox'
|
|
import AddMemberBox from '../common/selectUserBox/selectUserBox'
|
|
|
|
|
+import DeleteBox from '../common/deleteBox/deleteBox'
|
|
|
const { Sider, Content } = Layout
|
|
const { Sider, Content } = Layout
|
|
|
const { Search } = Input
|
|
const { Search } = Input
|
|
|
|
|
|
|
@@ -69,7 +70,7 @@ class UserGroupManagement extends React.Component {
|
|
|
render() {
|
|
render() {
|
|
|
const { userGroup, dispatch } = this.props;
|
|
const { userGroup, dispatch } = this.props;
|
|
|
const { selectedGroup } = userGroup;
|
|
const { selectedGroup } = userGroup;
|
|
|
- const { tableBodyHeight, pageSize } = this.state;
|
|
|
|
|
|
|
+ const { tableBodyHeight, pageSize, visibleDeleteBox } = this.state;
|
|
|
|
|
|
|
|
const reg = new RegExp('([+ \\- & | ! ( ) { } \\[ \\] ^ \" ~ * ? : ( ) \/])', 'g'); // 需要转义的字符
|
|
const reg = new RegExp('([+ \\- & | ! ( ) { } \\[ \\] ^ \" ~ * ? : ( ) \/])', 'g'); // 需要转义的字符
|
|
|
let filterLabel = (userGroup.filterLabel || '').replace(new RegExp('(\\\\)', 'g'), '\\$1').replace(reg, '\\$1'); // 添加转义符号
|
|
let filterLabel = (userGroup.filterLabel || '').replace(new RegExp('(\\\\)', 'g'), '\\$1').replace(reg, '\\$1'); // 添加转义符号
|
|
@@ -140,10 +141,23 @@ class UserGroupManagement extends React.Component {
|
|
|
<div className='groupname'>
|
|
<div className='groupname'>
|
|
|
<span>{selectedGroup ? selectedGroup.name : ''}</span>
|
|
<span>{selectedGroup ? selectedGroup.name : ''}</span>
|
|
|
{selectedGroup && <Button className='delete-btn' onClick={() => {
|
|
{selectedGroup && <Button className='delete-btn' onClick={() => {
|
|
|
- dispatch({ type: 'userGroup/remoteDelete', group: selectedGroup });
|
|
|
|
|
|
|
+ this.setState({
|
|
|
|
|
+ visibleDeleteBox: true
|
|
|
|
|
+ })
|
|
|
}}>
|
|
}}>
|
|
|
<Icon type="delete" />删除用户组
|
|
<Icon type="delete" />删除用户组
|
|
|
</Button>}
|
|
</Button>}
|
|
|
|
|
+ {visibleDeleteBox && <DeleteBox
|
|
|
|
|
+ visibleBox={visibleDeleteBox}
|
|
|
|
|
+ text={`确定要删除用户组【${selectedGroup.name}】吗?`}
|
|
|
|
|
+ hideBox={() => {
|
|
|
|
|
+ this.setState({
|
|
|
|
|
+ visibleDeleteBox: false
|
|
|
|
|
+ })
|
|
|
|
|
+ }}
|
|
|
|
|
+ okHandler={() =>{
|
|
|
|
|
+ dispatch({ type: 'userGroup/remoteDelete', group: selectedGroup });
|
|
|
|
|
+ }} />}
|
|
|
{selectedGroup && <Button className='edit-btn' onClick={() => {this.showDetailBox('modify')}}>
|
|
{selectedGroup && <Button className='edit-btn' onClick={() => {this.showDetailBox('modify')}}>
|
|
|
<Icon type="edit" />编辑用户组
|
|
<Icon type="edit" />编辑用户组
|
|
|
</Button>}
|
|
</Button>}
|