Browse Source

Merge branch 'dev' of https://gitea.anxinyun.cn/gao.zhiyuan/Highways4Good into dev

release_0.0.1
巴林闲侠 3 years ago
parent
commit
6babf2ffd8
  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({ return dispatch => basicAction({
type: 'put', type: 'put',
data, data,
dispatch: dispatch, dispatch: dispatch,
actionType: 'UPDATE_DEPARTMENT_USER', actionType: 'UPDATE_DEPARTMENT_USER',
url: ApiTable.updateUser.replace('{id}', id), url: ApiTable.updateUser.replace('{userId}', userId),
msg: { option: '修改用户' }, msg: { option: '修改用户' },
}); });
} }
export function delUser(ids) { export function delUser(userIds) {
return dispatch => basicAction({ return dispatch => basicAction({
type: 'del', type: 'del',
dispatch: dispatch, dispatch: dispatch,
actionType: 'DEL_DEPARTMENT_USER', actionType: 'DEL_DEPARTMENT_USER',
url: ApiTable.delUser.replace('{ids}', ids), url: ApiTable.delUser.replace('{userIds}', userIds),
msg: { option: '删除用户' }, msg: { option: '删除用户' },
}); });
} }

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

@ -54,7 +54,25 @@ const UserManage = (props) => {
dataIndex: 'action', dataIndex: 'action',
render: (dom, record) => { 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>, <Button type="link" onClick={() => { openModal('edit', record) }}>编辑</Button>,
<Popconfirm <Popconfirm
title="确认删除?" title="确认删除?"
@ -131,7 +149,14 @@ const UserManage = (props) => {
<Spin spinning={loading} /* style={{ height: "calc(100vh - 70px)" }} */> <Spin spinning={loading} /* style={{ height: "calc(100vh - 70px)" }} */>
<Row gutter={16} /* style={{ overflow: "scroll" }} */> <Row gutter={16} /* style={{ overflow: "scroll" }} */>
<Col flex="260px" style={{ height: '100%' }}> <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 ? depMessage.length ?
<Tree <Tree
@ -150,13 +175,14 @@ const UserManage = (props) => {
key: 'id', key: 'id',
children: 'subordinate' children: 'subordinate'
}} }}
style={{ paddingTop: 20 }}
/> : '' /> : ''
} }
</Card> </Card>
</Col> </Col>
<Col /* flex="auto" */ style={{ width: "calc(100% - 260px)", height: '100%', display: "black" }}> <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 <ProTable
columns={columns} columns={columns}
dataSource={depUser} dataSource={depUser}
@ -184,7 +210,7 @@ const UserManage = (props) => {
style={{ marginRight: 10 }} style={{ marginRight: 10 }}
onClick={() => openModal('create')} onClick={() => openModal('create')}
>新建用户</Button> >新建用户</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') }}> <Popconfirm title="确认删除?" onConfirm={() => { delUsers(rowSelected, 'batch') }}>
<Button>批量删除</Button> <Button>批量删除</Button>
</Popconfirm> </Popconfirm>

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

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

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

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

Loading…
Cancel
Save