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,17 +229,21 @@ const SiteManage = props => { ...@@ -229,17 +229,21 @@ 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) {
selectList.push({ if (delIndex === -1) {
GroupId: dataList[index].GroupId, selectList.push({
GroupName: dataList[index].GroupName, GroupId: dataList[index].GroupId,
userName: item.userName, GroupName: dataList[index].GroupName,
userID: item.userID, userName: item.userName,
isChecked: dataList[index].isChecked, userID: item.userID,
}); 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