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

修改角色管理默认分组名称

parent 5cb40867
Pipeline #44240 skipped with stages
...@@ -75,22 +75,28 @@ const EditForm = props => { ...@@ -75,22 +75,28 @@ const EditForm = props => {
}); });
}); });
let data = new Set(); let data = new Set();
let datalist = [];
info.map(item => { info.map(item => {
if (item.isChecked == true) { if (item.isChecked == true) {
data.add(item.groupName); data.add(item.groupName);
} }
}); });
list.map((k, i) => {
k.list.map(p => {
datalist.push(p.related);
});
});
if (data.size == info.length) { if (data.size == info.length) {
setChoo(true); setChoo(true);
setIndeterminateAll(false);
} else { } else {
setChoo(false); setChoo(false);
if (listData.indexOf(true) != -1) {
setIndeterminateAll(true);
}
} }
if (data.size == 0) { if (datalist.indexOf(true) == -1) {
setIndeterminateAll(false);
} else if (datalist.indexOf(false) == -1) {
setIndeterminateAll(false); setIndeterminateAll(false);
} else {
setIndeterminateAll(true);
} }
setIndeterminate(chooseData); setIndeterminate(chooseData);
} }
...@@ -161,7 +167,9 @@ const EditForm = props => { ...@@ -161,7 +167,9 @@ const EditForm = props => {
} }
}); });
list.map((k, i) => { list.map((k, i) => {
data.push(list[i].isChecked); k.list.map(p => {
data.push(p.related);
});
}); });
if (data.indexOf(true) == -1) { if (data.indexOf(true) == -1) {
setIndeterminateAll(false); setIndeterminateAll(false);
......
...@@ -131,22 +131,16 @@ const SiteManage = () => { ...@@ -131,22 +131,16 @@ const SiteManage = () => {
res.data.roleList.map((i, j) => { res.data.roleList.map((i, j) => {
console.log(i); console.log(i);
if (i.child.length == 0) { if (i.child.length == 0) {
let childData = { visibleTitle: '默认分组', roleList: [] }; let childData = { visibleTitle: '系统分组', roleList: [] };
childData.visibleValue = i.visibleValue; childData.visibleValue = i.visibleValue;
i.child.push(childData); i.child.push(childData);
} else { } else {
let arr = []; let arr = [];
i.child.map(k => { i.child.map(k => {
arr.push(k.visibleTitle); arr.push(k.visibleTitle);
// if (k.visibleTitle != '默认分组') {
// console.log(11);
// let childData = { visibleTitle: '默认分组', roleList: [] };
// childData.visibleValue = i.visibleValue;
// i.child.push(childData);
// }
}); });
if (arr.indexOf('默认分组') == -1) { if (arr.indexOf('系统分组') == -1) {
let childData = { visibleTitle: '默认分组', roleList: [] }; let childData = { visibleTitle: '系统分组', roleList: [] };
childData.visibleValue = i.visibleValue; childData.visibleValue = i.visibleValue;
i.child.push(childData); i.child.push(childData);
} }
...@@ -311,7 +305,7 @@ const SiteManage = () => { ...@@ -311,7 +305,7 @@ const SiteManage = () => {
/> />
</Tooltip> </Tooltip>
)} )}
{i.groupflag && i.groupflag != '默认分组' && ( {i.groupflag && i.groupflag != '系统分组' && (
<Tooltip title="编辑分组" className={styles.fs}> <Tooltip title="编辑分组" className={styles.fs}>
<EditOutlined <EditOutlined
style={{ fontSize: '16px', color: '#1890FF' }} style={{ fontSize: '16px', color: '#1890FF' }}
...@@ -376,7 +370,7 @@ const SiteManage = () => { ...@@ -376,7 +370,7 @@ const SiteManage = () => {
/> />
</Tooltip> </Tooltip>
)} )}
{itemRole.groupflag && itemRole.groupflag != '默认分组' && ( {itemRole.groupflag && itemRole.groupflag != '系统分组' && (
<Tooltip title="编辑分组" className={styles.fs}> <Tooltip title="编辑分组" className={styles.fs}>
<EditOutlined <EditOutlined
style={{ fontSize: '16px', color: '#1890FF' }} style={{ fontSize: '16px', color: '#1890FF' }}
...@@ -425,7 +419,7 @@ const SiteManage = () => { ...@@ -425,7 +419,7 @@ const SiteManage = () => {
/> />
</Tooltip> </Tooltip>
)} )}
{item.groupflag && item.groupflag != '默认分组' && ( {item.groupflag && item.groupflag != '系统分组' && (
<Tooltip title="编辑分组" className={styles.fs}> <Tooltip title="编辑分组" className={styles.fs}>
<EditOutlined <EditOutlined
style={{ fontSize: '16px', color: '#1890FF' }} style={{ fontSize: '16px', color: '#1890FF' }}
...@@ -461,19 +455,16 @@ const SiteManage = () => { ...@@ -461,19 +455,16 @@ const SiteManage = () => {
}; };
// 编辑分组 // 编辑分组
const editorGroup = (e, record) => { const editorGroup = (e, record) => {
console.log(record, '1212');
e.stopPropagation(); e.stopPropagation();
setItemObj(record); setItemObj(record);
setGroupVisible(true); setGroupVisible(true);
}; };
// 新增角色 // 新增角色
const addsUser = (e, record) => { const addsUser = (e, record) => {
console.log(e); if (record.visibleTitle == '系统分组') {
console.log(record);
if (record.visibleTitle == '默认分组') {
message.warn({ message.warn({
duration: 5, duration: 5,
content: '默认分组下的角色不能被关联', content: '系统分组下的角色不能被关联',
}); });
} }
e.stopPropagation(); e.stopPropagation();
......
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