Browse Source

'用户管理UI'

release_0.0.1
‘lijianhao’ 3 years ago
parent
commit
272132bc43
  1. 8
      web/client/src/sections/organization/actions/user.js
  2. 34
      web/client/src/sections/organization/containers/user.js
  3. 18
      web/client/src/sections/organization/nav-item.js
  4. 20
      web/client/src/utils/webapi.js

8
web/client/src/sections/organization/actions/user.js

@ -36,23 +36,23 @@ export function createUser(data) {
});
}
export function updateUser(id, data) {
export function updateUser(userId, data) {
return dispatch => basicAction({
type: 'put',
data,
dispatch: dispatch,
actionType: 'UPDATE_DEPARTMENT_USER',
url: ApiTable.updateUser.replace('{id}', id),
url: ApiTable.updateUser.replace('{userId}', userId),
msg: { option: '修改用户' },
});
}
export function delUser(ids) {
export function delUser(userIds) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
actionType: 'DEL_DEPARTMENT_USER',
url: ApiTable.delUser.replace('{ids}', ids),
url: ApiTable.delUser.replace('{userIds}', userIds),
msg: { option: '删除用户' },
});
}

34
web/client/src/sections/organization/containers/user.js

@ -54,7 +54,25 @@ const UserManage = (props) => {
dataIndex: 'action',
render: (dom, record) => {
return record.username == 'SuperAdmin' ? '' : [
// return record.username == 'SuperAdmin' ? '' : [
// <Button type="link" onClick={() => { openModal('edit', record) }}>编辑</Button>,
// <Popconfirm
// title="确认删除?"
// onConfirm={() => {
// delUsers([record.id])
// }}
// >
// <Button type="link">删除</Button>
// </Popconfirm>,
// <Button
// type="link"
// onClick={() => {
// setModalRecord(record);
// setPwdModalVisible(true);
// }}
// >重置密码</Button>
// ]
return [
<Button type="link" onClick={() => { openModal('edit', record) }}>编辑</Button>,
<Popconfirm
title="确认删除?"
@ -131,7 +149,14 @@ const UserManage = (props) => {
<Spin spinning={loading} /* style={{ height: "calc(100vh - 70px)" }} */>
<Row gutter={16} /* style={{ overflow: "scroll" }} */>
<Col flex="260px" style={{ height: '100%' }}>
<Card title="部门" bordered={false} bodyStyle={{ padding: 8, paddingTop: 24, }}>
<Card bordered={false} bodyStyle={{ padding: 8, paddingTop: 24, }}>
<Button
type="primary"
key="primary"
style={{ marginLeft: 50 }}
onClick={() => openModal('create')}
>新建部门</Button>
{
depMessage.length ?
<Tree
@ -150,13 +175,14 @@ const UserManage = (props) => {
key: 'id',
children: 'subordinate'
}}
style={{ paddingTop: 20 }}
/> : ''
}
</Card>
</Col>
<Col /* flex="auto" */ style={{ width: "calc(100% - 260px)", height: '100%', display: "black" }}>
<Card title="用户" bordered={false} height={clientHeight} bodyStyle={{ padding: 8, paddingTop: 24, overflow: "hidden", width: "100%" }}>
<Card bordered={false} height={clientHeight} bodyStyle={{ padding: 8, paddingTop: 24, overflow: "hidden", width: "100%" }}>
<ProTable
columns={columns}
dataSource={depUser}
@ -184,7 +210,7 @@ const UserManage = (props) => {
style={{ marginRight: 10 }}
onClick={() => openModal('create')}
>新建用户</Button>
<Button style={{ marginRight: 10 }} onClick={() => { dispatch(getDepUser(depSelectedKeys[0])); }}>刷新</Button>
{/* <Button style={{ marginRight: 10 }} onClick={() => { dispatch(getDepUser(depSelectedKeys[0])); }}>刷新</Button> */}
<Popconfirm title="确认删除?" onConfirm={() => { delUsers(rowSelected, 'batch') }}>
<Button>批量删除</Button>
</Popconfirm>

18
web/client/src/sections/organization/nav-item.js

@ -9,18 +9,18 @@ import { push } from 'react-router-redux';
const SubMenu = Menu.SubMenu;
export function getNavItem(user, dispatch) {
if (!Func.isAuthorized("ORG_MANAGE")) {
return null
}
// console.log(!Func.isAuthorized("ORG_MANAGE"));
if (user.type != 1 && user.type != 2 && user.type != 3) {
dispatch(push('/fillion/infor'));
return null
}
// if (!Func.isAuthorized("ORG_MANAGE")) {
// return null
// }
// // console.log(!Func.isAuthorized("ORG_MANAGE"));
// if (user.type != 1 && user.type != 2 && user.type != 3) {
// dispatch(push('/fillion/infor'));
// return null
// }
return (
<SubMenu key="organization" icon={<SettingOutlined />} title={'授权管理'}>
{Func.isAuthorized("ORG_MEMBER") && <Menu.Item key="userManage">
{ <Menu.Item key="userManage">
<Link to="/organization/user">用户管理</Link>
</Menu.Item>
}

20
web/client/src/utils/webapi.js

@ -7,13 +7,19 @@ export const ApiTable = {
getEnterprisesMembers: 'enterprises/{enterpriseId}/members',
//组织管理-用户管理
getDepMessage: 'organization/department',
getDepUser: 'organization/department/{depId}/user',
createUser: 'organization/department/user',
updateUser: 'organization/department/user/{id}',
delUser: 'organization/department/user/{ids}',
resetPwd: '/organization/department/user/resetPwd/{id}',
//组织管理-用户管理-部门
    getDepMessage: 'department',
    createMessage: 'department',
    updateDepMessage: 'department',
    delDepMessage: 'department/{depId}',
    //组织管理-用户管理-用户
    getDepUser: 'department/{depId}/user',
    createUser: 'department/user',
    updateUser: 'department/user/{userId}',
    delUser: 'department/user/{userIds}',
    resetPwd: '/organization/department/user/resetPwd/{id}',
//用户权限
getResource: 'resource',

Loading…
Cancel
Save