|
|
@ -40,7 +40,7 @@ function memberModal (props) { |
|
|
|
]); //权限配置 |
|
|
|
//初始化 |
|
|
|
useEffect(() => { |
|
|
|
if(editObj.id){ |
|
|
|
if (editObj.id) { |
|
|
|
let departmentList = [] |
|
|
|
for (let i = 0; i < pepList.length; i++) { |
|
|
|
if (pepList[i].id == editObj.departments[0].id) { |
|
|
@ -58,7 +58,9 @@ function memberModal (props) { |
|
|
|
.validate() |
|
|
|
.then((values) => { |
|
|
|
dispatch(install.postOrganizationUser({ role: values.role, pepUserId: values.pepUserId })).then((res) => {//获取项企(PEP)全部部门及其下用户 |
|
|
|
if(res.success){ |
|
|
|
close(); |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
@ -88,15 +90,23 @@ function memberModal (props) { |
|
|
|
labelAlign="right" |
|
|
|
labelWidth="90px" |
|
|
|
onValueChange={(values, field) => { |
|
|
|
for(var key in field){ |
|
|
|
if(key=='department'){ |
|
|
|
for (var key in field) { |
|
|
|
if (key == 'department') { |
|
|
|
if (values.department >= 0) { |
|
|
|
let departmentList = [] |
|
|
|
for (let i = 0; i < pepList.length; i++) { |
|
|
|
if (pepList[i].id == values.department) { |
|
|
|
departmentList = pepList[i].users |
|
|
|
} |
|
|
|
} |
|
|
|
setPeopleList(departmentList) |
|
|
|
setDisablePeople(false) |
|
|
|
setPeopleList(pepList[values.department].users) |
|
|
|
form.current.setValue('pepUserId', undefined); |
|
|
|
} |
|
|
|
else { |
|
|
|
setPeopleList([]) |
|
|
|
setDisablePeople(true) |
|
|
|
form.current.setValue('pepUserId', undefined); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -118,7 +128,7 @@ function memberModal (props) { |
|
|
|
{ |
|
|
|
pepList.map((item, index) => { |
|
|
|
return ( |
|
|
|
<Form.Select.Option key={item.id} value={index}> |
|
|
|
<Form.Select.Option key={item.id} value={item.id}> |
|
|
|
{item.name} |
|
|
|
</Form.Select.Option> |
|
|
|
) |
|
|
@ -134,7 +144,7 @@ function memberModal (props) { |
|
|
|
style={{ width: 417 }} |
|
|
|
rules={[{ required: true, message: "请选择人员" }]} |
|
|
|
showClear |
|
|
|
initValue={editObj.id || ""} |
|
|
|
initValue={editObj.pepUserId || ""} |
|
|
|
disabled={disablePeople} |
|
|
|
> |
|
|
|
{ |
|
|
@ -153,7 +163,7 @@ function memberModal (props) { |
|
|
|
field="role" |
|
|
|
label='权限配置:' |
|
|
|
showClear |
|
|
|
initValue={editObj.role||[]} |
|
|
|
initValue={editObj.role || []} |
|
|
|
> |
|
|
|
{ |
|
|
|
jurisdiction.map((item, index) => { |
|
|
|