diff --git a/web/client/src/sections/install/actions/roles.js b/web/client/src/sections/install/actions/roles.js index 20c078d..3ff9be4 100644 --- a/web/client/src/sections/install/actions/roles.js +++ b/web/client/src/sections/install/actions/roles.js @@ -27,8 +27,10 @@ export function getOrganizationUser (query) {//获取成员列表 } export function putOrganizationUser (data) {//更新成员状态 let pomsUserId = '' + let msg = '' if (data) { pomsUserId = data.pomsUserId + msg=data.msg } return (dispatch) => basicAction({ @@ -37,12 +39,16 @@ export function putOrganizationUser (data) {//更新成员状态 data, actionType: "PUT_ORGANIZATIONUSER", url: `${ApiTable.putOrganizationUser.replace("{pomsUserId}", pomsUserId)}`, - msg: { option: "更新成员状态" }, //更新成员状态 + msg: { option: msg }, //更新成员状态 reducer: {}, }); } export function postOrganizationUser (data) {//添加/编辑成员 + let msg = '' + if (data) { + msg=data.msg + } return (dispatch) => basicAction({ type: "post", @@ -50,7 +56,7 @@ export function postOrganizationUser (data) {//添加/编辑成员 data, actionType: "POST_ORGANIZATION_USER", url: `${ApiTable.postOrganizationUser}`, - msg: { option: "添加/编辑成员" }, //添加/编辑成员 + msg: { option: msg }, //添加/编辑成员 reducer: { name: "" }, }); } diff --git a/web/client/src/sections/install/components/adminModal.jsx b/web/client/src/sections/install/components/adminModal.jsx index b219735..a6a8729 100644 --- a/web/client/src/sections/install/components/adminModal.jsx +++ b/web/client/src/sections/install/components/adminModal.jsx @@ -43,16 +43,16 @@ function adminModal (props) { .then((values) => { if (adminEdit) { dispatch(install.deteleOrganizationAdmin(editObj.id)).then( - dispatch(install.postOrganizationUser({ role: ['admin'], pepUserId: values.pepUserId })).then((res) => {//获取项企(PEP)全部部门及其下用户 - if(res.success){ + dispatch(install.postOrganizationUser({ role: ['admin'], pepUserId: values.pepUserId, msg: '修改管理员' })).then((res) => {//获取项企(PEP)全部部门及其下用户 + if (res.success) { close(); } }) ) } else { - dispatch(install.postOrganizationUser({ role: ['admin'], pepUserId: values.pepUserId })).then((res) => {//获取项企(PEP)全部部门及其下用户 - if(res.success){ + dispatch(install.postOrganizationUser({ role: ['admin'], pepUserId: values.pepUserId, msg: '新增管理员' })).then((res) => {//获取项企(PEP)全部部门及其下用户 + if (res.success) { close(); } }) diff --git a/web/client/src/sections/install/components/memberModal.jsx b/web/client/src/sections/install/components/memberModal.jsx index c3e9393..f5542d0 100644 --- a/web/client/src/sections/install/components/memberModal.jsx +++ b/web/client/src/sections/install/components/memberModal.jsx @@ -57,15 +57,24 @@ function memberModal (props) { form.current .validate() .then((values) => { - let roleArr=JSON.parse(JSON.stringify(values.role)) + let roleArr = JSON.parse(JSON.stringify(values.role)) if (roleArr.indexOf('admin') != -1) { - roleArr.splice(roleArr.indexOf('admin'),1) + roleArr.splice(roleArr.indexOf('admin'), 1) + } + if (memberEdit) { + dispatch(install.postOrganizationUser({ role: roleArr, pepUserId: values.pepUserId, msg: '修改成员' })).then((res) => {//获取项企(PEP)全部部门及其下用户 + if (res.success) { + close(); + } + }) + } + else{ + dispatch(install.postOrganizationUser({ role: roleArr, pepUserId: values.pepUserId, msg: '新增成员' })).then((res) => {//获取项企(PEP)全部部门及其下用户 + if (res.success) { + close(); + } + }) } - dispatch(install.postOrganizationUser({ role: roleArr, pepUserId: values.pepUserId })).then((res) => {//获取项企(PEP)全部部门及其下用户 - if(res.success){ - close(); - } - }) }) } function handleCancel () { diff --git a/web/client/src/sections/install/containers/roles.jsx b/web/client/src/sections/install/containers/roles.jsx index 84f175c..b391a03 100644 --- a/web/client/src/sections/install/containers/roles.jsx +++ b/web/client/src/sections/install/containers/roles.jsx @@ -211,7 +211,7 @@ const Roles = (props) => { theme="borderless" style={{ color: '#F31C1C' }} onClick={() => { - dispatch(install.putOrganizationUser({ pomsUserId: row?.id, disabled: !row?.disabled })).then(() => getUserList()) + dispatch(install.putOrganizationUser({ pomsUserId: row?.id, disabled: !row?.disabled,msg:'更新成员状态' })).then(() => getUserList()) }} > 已禁用 @@ -223,7 +223,7 @@ const Roles = (props) => { showArrow={true} position="topRight" onConfirm={() => { - dispatch(install.putOrganizationUser({ pomsUserId: row?.id, disabled: !row?.disabled })).then(() => { + dispatch(install.putOrganizationUser({ pomsUserId: row?.id, disabled: !row?.disabled,msg:'更新成员状态' })).then(() => { getUserList(); }) }} @@ -247,7 +247,7 @@ const Roles = (props) => { showArrow={true} position="topRight" onConfirm={() => { - dispatch(install.putOrganizationUser({ pomsUserId: row?.id, deleted: true })).then(() => { + dispatch(install.putOrganizationUser({ pomsUserId: row?.id, deleted: true,msg:'删除成员' })).then(() => { if (page.current > 0 && mylimits.current < 2) { setQuery({ limit: 10, page: page.current - 1 }) } else { @@ -276,7 +276,6 @@ const Roles = (props) => { dispatch(install.getOrganizationDeps()).then((res) => {//获取项企(PEP)全部部门及其下用户 setPepList(res.payload.data) }) - getUserList() }, []) function getUserList () { let searchData = { ...query, role: roleChoose }