Commit 856e5a81 authored by 皮倩雯's avatar 皮倩雯

fix: '修改关联权限站点配置显示错误问题'

parent 7e522935
Pipeline #82900 failed with stages
...@@ -219,6 +219,7 @@ const RelateRoleModal = props => { ...@@ -219,6 +219,7 @@ const RelateRoleModal = props => {
mult={mult} mult={mult}
OUName={role.visibleTitle} OUName={role.visibleTitle}
getValueCallback={getRoleValueCallback} getValueCallback={getRoleValueCallback}
tab="roles"
/> />
))} ))}
</div> </div>
...@@ -234,6 +235,7 @@ const RelateRoleModal = props => { ...@@ -234,6 +235,7 @@ const RelateRoleModal = props => {
mult={mult} mult={mult}
OUName={station.visibleTitle} OUName={station.visibleTitle}
getValueCallback={getStationValueCallback} getValueCallback={getStationValueCallback}
tab="sites"
/> />
))} ))}
</div> </div>
......
...@@ -14,6 +14,7 @@ const ListCardItem = props => { ...@@ -14,6 +14,7 @@ const ListCardItem = props => {
multiRoleList, multiRoleList,
multistationList, multistationList,
mult, mult,
tab,
} = props; } = props;
const [indeterminate, setIndeterminate] = useState(false); const [indeterminate, setIndeterminate] = useState(false);
const [allChecked, setAllChecked] = useState(false); // 全选状态 const [allChecked, setAllChecked] = useState(false); // 全选状态
...@@ -29,13 +30,7 @@ const ListCardItem = props => { ...@@ -29,13 +30,7 @@ const ListCardItem = props => {
userList.map((item, index) => { userList.map((item, index) => {
let obj = { ...item }; let obj = { ...item };
obj.label = ( obj.label = (
<span <span className={searchWord && obj.userName.includes(searchWord) ? styles.isSearch : ''}>
className={
searchWord && obj.userName.includes(searchWord)
? styles.isSearch
: ''
}
>
{obj.userName || obj.roleName || obj.stationName} {obj.userName || obj.roleName || obj.stationName}
</span> </span>
); );
...@@ -47,8 +42,6 @@ const ListCardItem = props => { ...@@ -47,8 +42,6 @@ const ListCardItem = props => {
useEffect(() => { useEffect(() => {
if (mult == 'Yes') { if (mult == 'Yes') {
console.log(multiRoleList);
console.log(multistationList);
let arr2 = []; let arr2 = [];
if (multiRoleList != undefined) { if (multiRoleList != undefined) {
multiRoleList.map((item, index) => { multiRoleList.map((item, index) => {
...@@ -60,10 +53,6 @@ const ListCardItem = props => { ...@@ -60,10 +53,6 @@ const ListCardItem = props => {
arr2.push(item1); arr2.push(item1);
}); });
} }
console.log(arr2);
console.log(userList);
console.log(itemid);
// 勾选展示 // 勾选展示
let flag = 0; let flag = 0;
let aa = []; let aa = [];
...@@ -81,9 +70,6 @@ const ListCardItem = props => { ...@@ -81,9 +70,6 @@ const ListCardItem = props => {
} }
} }
}); });
console.log(aa);
console.log(userList.length);
console.log(flag);
if (flag == userList.length) { if (flag == userList.length) {
setIndeterminate(false); setIndeterminate(false);
setAllChecked(true); setAllChecked(true);
...@@ -137,11 +123,17 @@ const ListCardItem = props => { ...@@ -137,11 +123,17 @@ const ListCardItem = props => {
if (defaultList.length === 0) { if (defaultList.length === 0) {
return null; return null;
} }
const getName = val => {
if (val === 'sites') {
return '所有站点';
}
return '所有角色';
};
return ( return (
<div <div
style={{ style={{
display: display: OUName === '运维管理' && authority !== 'super' ? 'none' : 'block',
OUName === '运维管理' && authority !== 'super' ? 'none' : 'block',
}} }}
> >
<div className={`${styles.divBox}`}> <div className={`${styles.divBox}`}>
...@@ -153,7 +145,7 @@ const ListCardItem = props => { ...@@ -153,7 +145,7 @@ const ListCardItem = props => {
handleAllChecked(e); handleAllChecked(e);
}} }}
> >
{OUName === '所有系统' ? '所有角色' : OUName} {OUName === '所有系统' ? getName(tab) : OUName}
</Checkbox> </Checkbox>
</div> </div>
<div <div
......
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