From 272132bc43ee056448675e9062ae0adbbaa1ea3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98lijianhao=E2=80=99?= Date: Thu, 21 Jul 2022 10:28:10 +0800 Subject: [PATCH] =?UTF-8?q?'=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86UI'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/sections/organization/actions/user.js | 8 ++--- .../sections/organization/containers/user.js | 34 ++++++++++++++++--- .../src/sections/organization/nav-item.js | 18 +++++----- web/client/src/utils/webapi.js | 20 +++++++---- 4 files changed, 56 insertions(+), 24 deletions(-) diff --git a/web/client/src/sections/organization/actions/user.js b/web/client/src/sections/organization/actions/user.js index e24913a4..b9eed02b 100644 --- a/web/client/src/sections/organization/actions/user.js +++ b/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: '删除用户' }, }); } diff --git a/web/client/src/sections/organization/containers/user.js b/web/client/src/sections/organization/containers/user.js index ea4e9993..da407ee2 100644 --- a/web/client/src/sections/organization/containers/user.js +++ b/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' ? '' : [ + // , + // { + // delUsers([record.id]) + // }} + // > + // + // , + // + // ] + return [ , { - + + + { depMessage.length ? { key: 'id', children: 'subordinate' }} + style={{ paddingTop: 20 }} /> : '' } - + { style={{ marginRight: 10 }} onClick={() => openModal('create')} >新建用户 - + {/* */} { delUsers(rowSelected, 'batch') }}> diff --git a/web/client/src/sections/organization/nav-item.js b/web/client/src/sections/organization/nav-item.js index 8970b8ee..25c094d5 100644 --- a/web/client/src/sections/organization/nav-item.js +++ b/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 ( } title={'授权管理'}> - {Func.isAuthorized("ORG_MEMBER") && + { 用户管理 } diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js index 25e9f3b4..1f6a90bf 100644 --- a/web/client/src/utils/webapi.js +++ b/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',