Commit d7363ce2 authored by Maofei94's avatar Maofei94

Merge branch 'master' of g.civnet.cn:ReactWeb5/maintenance

parents 4d344e9e 9cc69699
Pipeline #21966 skipped with stages
...@@ -229,7 +229,11 @@ const SiteManage = props => { ...@@ -229,7 +229,11 @@ const SiteManage = props => {
dataList[index].isChecked = e.target.checked; dataList[index].isChecked = e.target.checked;
dataList[index].Users.forEach(item => { dataList[index].Users.forEach(item => {
item.isChecked = e.target.checked; item.isChecked = e.target.checked;
let delIndex = selectList.findIndex(
v => v.GroupId === dataList[index].GroupId && v.userID === item.userID,
);
if (e.target.checked) { if (e.target.checked) {
if (delIndex === -1) {
selectList.push({ selectList.push({
GroupId: dataList[index].GroupId, GroupId: dataList[index].GroupId,
GroupName: dataList[index].GroupName, GroupName: dataList[index].GroupName,
...@@ -238,8 +242,8 @@ const SiteManage = props => { ...@@ -238,8 +242,8 @@ const SiteManage = props => {
isChecked: dataList[index].isChecked, isChecked: dataList[index].isChecked,
}); });
} }
}
if (!e.target.checked) { if (!e.target.checked) {
let delIndex = selectList.findIndex(v => v.userID === item.userID);
selectList.splice(delIndex, 1); selectList.splice(delIndex, 1);
} }
}); });
...@@ -252,7 +256,9 @@ const SiteManage = props => { ...@@ -252,7 +256,9 @@ const SiteManage = props => {
dataList[index].Users[vIndex].isChecked = e.target.checked; dataList[index].Users[vIndex].isChecked = e.target.checked;
let checked = isAllChecked(index); let checked = isAllChecked(index);
let hasIndex = selectList.findIndex( let hasIndex = selectList.findIndex(
item => item.userID === dataList[index].Users[vIndex].userID, item =>
item.userID === dataList[index].Users[vIndex].userID &&
item.GroupId === dataList[index].GroupId,
); );
dataList[index].isChecked = checked; dataList[index].isChecked = checked;
if (hasIndex === -1) { if (hasIndex === -1) {
......
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