Browse Source

接口提示语修改

dev
deartibers 2 years ago
parent
commit
a33a147572
  1. 10
      web/client/src/sections/install/actions/roles.js
  2. 8
      web/client/src/sections/install/components/adminModal.jsx
  3. 23
      web/client/src/sections/install/components/memberModal.jsx
  4. 7
      web/client/src/sections/install/containers/roles.jsx

10
web/client/src/sections/install/actions/roles.js

@ -27,8 +27,10 @@ export function getOrganizationUser (query) {//获取成员列表
} }
export function putOrganizationUser (data) {//更新成员状态 export function putOrganizationUser (data) {//更新成员状态
let pomsUserId = '' let pomsUserId = ''
let msg = ''
if (data) { if (data) {
pomsUserId = data.pomsUserId pomsUserId = data.pomsUserId
msg=data.msg
} }
return (dispatch) => return (dispatch) =>
basicAction({ basicAction({
@ -37,12 +39,16 @@ export function putOrganizationUser (data) {//更新成员状态
data, data,
actionType: "PUT_ORGANIZATIONUSER", actionType: "PUT_ORGANIZATIONUSER",
url: `${ApiTable.putOrganizationUser.replace("{pomsUserId}", pomsUserId)}`, url: `${ApiTable.putOrganizationUser.replace("{pomsUserId}", pomsUserId)}`,
msg: { option: "更新成员状态" }, //更新成员状态 msg: { option: msg }, //更新成员状态
reducer: {}, reducer: {},
}); });
} }
export function postOrganizationUser (data) {//添加/编辑成员 export function postOrganizationUser (data) {//添加/编辑成员
let msg = ''
if (data) {
msg=data.msg
}
return (dispatch) => return (dispatch) =>
basicAction({ basicAction({
type: "post", type: "post",
@ -50,7 +56,7 @@ export function postOrganizationUser (data) {//添加/编辑成员
data, data,
actionType: "POST_ORGANIZATION_USER", actionType: "POST_ORGANIZATION_USER",
url: `${ApiTable.postOrganizationUser}`, url: `${ApiTable.postOrganizationUser}`,
msg: { option: "添加/编辑成员" }, //添加/编辑成员 msg: { option: msg }, //添加/编辑成员
reducer: { name: "" }, reducer: { name: "" },
}); });
} }

8
web/client/src/sections/install/components/adminModal.jsx

@ -43,16 +43,16 @@ function adminModal (props) {
.then((values) => { .then((values) => {
if (adminEdit) { if (adminEdit) {
dispatch(install.deteleOrganizationAdmin(editObj.id)).then( dispatch(install.deteleOrganizationAdmin(editObj.id)).then(
dispatch(install.postOrganizationUser({ role: ['admin'], pepUserId: values.pepUserId })).then((res) => {//(PEP) dispatch(install.postOrganizationUser({ role: ['admin'], pepUserId: values.pepUserId, msg: '修改管理员' })).then((res) => {//(PEP)
if(res.success){ if (res.success) {
close(); close();
} }
}) })
) )
} }
else { else {
dispatch(install.postOrganizationUser({ role: ['admin'], pepUserId: values.pepUserId })).then((res) => {//(PEP) dispatch(install.postOrganizationUser({ role: ['admin'], pepUserId: values.pepUserId, msg: '新增管理员' })).then((res) => {//(PEP)
if(res.success){ if (res.success) {
close(); close();
} }
}) })

23
web/client/src/sections/install/components/memberModal.jsx

@ -57,15 +57,24 @@ function memberModal (props) {
form.current form.current
.validate() .validate()
.then((values) => { .then((values) => {
let roleArr=JSON.parse(JSON.stringify(values.role)) let roleArr = JSON.parse(JSON.stringify(values.role))
if (roleArr.indexOf('admin') != -1) { 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 () { function handleCancel () {

7
web/client/src/sections/install/containers/roles.jsx

@ -211,7 +211,7 @@ const Roles = (props) => {
theme="borderless" theme="borderless"
style={{ color: '#F31C1C' }} style={{ color: '#F31C1C' }}
onClick={() => { 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} showArrow={true}
position="topRight" position="topRight"
onConfirm={() => { onConfirm={() => {
dispatch(install.putOrganizationUser({ pomsUserId: row?.id, disabled: !row?.disabled })).then(() => { dispatch(install.putOrganizationUser({ pomsUserId: row?.id, disabled: !row?.disabled,msg:'更新成员状态' })).then(() => {
getUserList(); getUserList();
}) })
}} }}
@ -247,7 +247,7 @@ const Roles = (props) => {
showArrow={true} showArrow={true}
position="topRight" position="topRight"
onConfirm={() => { 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) { if (page.current > 0 && mylimits.current < 2) {
setQuery({ limit: 10, page: page.current - 1 }) setQuery({ limit: 10, page: page.current - 1 })
} else { } else {
@ -276,7 +276,6 @@ const Roles = (props) => {
dispatch(install.getOrganizationDeps()).then((res) => {//(PEP) dispatch(install.getOrganizationDeps()).then((res) => {//(PEP)
setPepList(res.payload.data) setPepList(res.payload.data)
}) })
getUserList()
}, []) }, [])
function getUserList () { function getUserList () {
let searchData = { ...query, role: roleChoose } let searchData = { ...query, role: roleChoose }

Loading…
Cancel
Save