Commit c45f3976 authored by 皮倩雯's avatar 皮倩雯

角色管理界面优化

parent d280daa4
Pipeline #59967 waiting for manual action with stages
...@@ -20,6 +20,7 @@ const CardCheck = props => { ...@@ -20,6 +20,7 @@ const CardCheck = props => {
} }
}, [delFlag]); }, [delFlag]);
useEffect(() => { useEffect(() => {
console.log(cardMsg);
setPlainOptions(cardMsg.plainOptions); setPlainOptions(cardMsg.plainOptions);
setCheckedList(cardMsg.checkedList); setCheckedList(cardMsg.checkedList);
setIndeterminate(cardMsg.indeterminate); setIndeterminate(cardMsg.indeterminate);
...@@ -83,7 +84,7 @@ const CardCheck = props => { ...@@ -83,7 +84,7 @@ const CardCheck = props => {
onChange={e => onCheckAllChange(e)} onChange={e => onCheckAllChange(e)}
checked={checkAll} checked={checkAll}
> >
{cardMsg.groupName} {cardMsg.level}
</Checkbox> </Checkbox>
</div> </div>
<div className={styles.bottomCheckbox}> <div className={styles.bottomCheckbox}>
......
...@@ -75,6 +75,7 @@ const NewSelectUser = props => { ...@@ -75,6 +75,7 @@ const NewSelectUser = props => {
label: val.userName, label: val.userName,
value: val.userId, value: val.userId,
groupName: item.groupName, groupName: item.groupName,
level: item.level,
}; };
}); });
if (checkedList.length === options.length && checkedList.length > 0) { if (checkedList.length === options.length && checkedList.length > 0) {
...@@ -85,6 +86,7 @@ const NewSelectUser = props => { ...@@ -85,6 +86,7 @@ const NewSelectUser = props => {
} }
return { return {
groupName: item.groupName, groupName: item.groupName,
level: item.level,
groupId: item.groupId, groupId: item.groupId,
indeterminate, indeterminate,
checkAll, checkAll,
...@@ -160,6 +162,7 @@ const NewSelectUser = props => { ...@@ -160,6 +162,7 @@ const NewSelectUser = props => {
label: val.userName, label: val.userName,
value: val.userId, value: val.userId,
groupName: item.groupName, groupName: item.groupName,
level: item.level,
}; };
}); });
if (checkedList.length === options.length && checkedList.length > 0) { if (checkedList.length === options.length && checkedList.length > 0) {
...@@ -170,6 +173,7 @@ const NewSelectUser = props => { ...@@ -170,6 +173,7 @@ const NewSelectUser = props => {
} }
return { return {
groupName: item.groupName, groupName: item.groupName,
level: item.level,
groupId: item.groupId, groupId: item.groupId,
indeterminate, indeterminate,
checkAll, checkAll,
...@@ -230,7 +234,6 @@ const NewSelectUser = props => { ...@@ -230,7 +234,6 @@ const NewSelectUser = props => {
), ),
}, },
]; ];
console.log(allList, 'allList');
return ( return (
<> <>
{/* <Modal {/* <Modal
...@@ -297,6 +300,7 @@ const NewSelectUser = props => { ...@@ -297,6 +300,7 @@ const NewSelectUser = props => {
total={total} total={total}
showTotal={(totals, range) => `第${range[0]}-${range[1]} 条/共 ${totals} 条`} showTotal={(totals, range) => `第${range[0]}-${range[1]} 条/共 ${totals} 条`}
defaultPageSize={pageSize} defaultPageSize={pageSize}
pageSizeOptions={[10, 20]}
defaultCurrent={1} defaultCurrent={1}
current={currentPage} current={currentPage}
onChange={paginationChange} onChange={paginationChange}
......
...@@ -17,6 +17,7 @@ const SelectUser = props => { ...@@ -17,6 +17,7 @@ const SelectUser = props => {
const [searchName, setSearchName] = useState(); const [searchName, setSearchName] = useState();
const [deleKey, setDeleKey] = useState(); // 删除用户的key值 const [deleKey, setDeleKey] = useState(); // 删除用户的key值
const [delFlag, setDelFlag] = useState(0); // 删除标识每次删除后加一 const [delFlag, setDelFlag] = useState(0); // 删除标识每次删除后加一
useEffect(() => { useEffect(() => {
if (visible) { if (visible) {
setCurrentPage(1); setCurrentPage(1);
...@@ -52,7 +53,6 @@ const SelectUser = props => { ...@@ -52,7 +53,6 @@ const SelectUser = props => {
}); });
setLoading(true); setLoading(true);
Promise.all([p1, p2]).then(res => { Promise.all([p1, p2]).then(res => {
setLoading(false);
if (res[0].code === 0 && res[1].code === 0) { if (res[0].code === 0 && res[1].code === 0) {
setTotal(res[1].data.count); setTotal(res[1].data.count);
let listCheck = res[0].data.map(item => ({ let listCheck = res[0].data.map(item => ({
...@@ -76,7 +76,7 @@ const SelectUser = props => { ...@@ -76,7 +76,7 @@ const SelectUser = props => {
return { return {
label: val.userName, label: val.userName,
value: val.userId, value: val.userId,
groupName: item.groupName, groupName: item.level,
}; };
}); });
if (checkedList.length === options.length && checkedList.length > 0) { if (checkedList.length === options.length && checkedList.length > 0) {
...@@ -85,8 +85,9 @@ const SelectUser = props => { ...@@ -85,8 +85,9 @@ const SelectUser = props => {
if (checkedList.length < options.length && checkedList.length > 0) { if (checkedList.length < options.length && checkedList.length > 0) {
indeterminate = true; indeterminate = true;
} }
console.log(item.level);
return { return {
groupName: item.groupName, groupName: item.level,
groupId: item.groupId, groupId: item.groupId,
indeterminate, indeterminate,
checkAll, checkAll,
...@@ -94,7 +95,9 @@ const SelectUser = props => { ...@@ -94,7 +95,9 @@ const SelectUser = props => {
plainOptions: options, plainOptions: options,
}; };
}); });
console.log(list);
setAllist(list); setAllist(list);
setLoading(false);
} else if (res[0].code !== 0) { } else if (res[0].code !== 0) {
message.error(res[0].msg); message.error(res[0].msg);
} else { } else {
...@@ -161,7 +164,7 @@ const SelectUser = props => { ...@@ -161,7 +164,7 @@ const SelectUser = props => {
return { return {
label: val.userName, label: val.userName,
value: val.userId, value: val.userId,
groupName: item.groupName, groupName: item.level,
}; };
}); });
if (checkedList.length === options.length && checkedList.length > 0) { if (checkedList.length === options.length && checkedList.length > 0) {
...@@ -170,8 +173,9 @@ const SelectUser = props => { ...@@ -170,8 +173,9 @@ const SelectUser = props => {
if (checkedList.length < options.length && checkedList.length > 0) { if (checkedList.length < options.length && checkedList.length > 0) {
indeterminate = true; indeterminate = true;
} }
console.log(item.level);
return { return {
groupName: item.groupName, groupName: item.level,
groupId: item.groupId, groupId: item.groupId,
indeterminate, indeterminate,
checkAll, checkAll,
...@@ -179,6 +183,7 @@ const SelectUser = props => { ...@@ -179,6 +183,7 @@ const SelectUser = props => {
plainOptions: options, plainOptions: options,
}; };
}); });
console.log(list);
setAllist(list); setAllist(list);
} else { } else {
message.error(res.msg); message.error(res.msg);
...@@ -207,8 +212,8 @@ const SelectUser = props => { ...@@ -207,8 +212,8 @@ const SelectUser = props => {
}, },
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Tooltip placement="topLeft" title={`${record.label}(${record.groupName})`}> <Tooltip placement="topLeft" title={`${record.label}(${record.level})`}>
{record.label}({record.groupName}) {record.label}({record.level})
</Tooltip> </Tooltip>
</span> </span>
), ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment