Commit ff88bc28 authored by xiexiuxing's avatar xiexiuxing

🐞 fix: 业务员回现

parent 7ccd0e08
......@@ -158,9 +158,12 @@ const MemberDetail: React.FC<{}> = () => {
menuId: node ? node.id : nodeRecord.id,
...params,
});
console.log(data, 'data')
if (!isAdd && data.orgIds) {
let plateformTreeDataList = mapkey(plateformTreeData, data.orgIds)
console.log(plateformTreeData, 'plateformTreeData');
console.log(data.orgIds, 'data.orgIds');
let plateformTreeDataList = mapkey(plateformTreeData, data.orgIds, [])
console.log(plateformTreeDataList)
setplateformTreeList(plateformTreeDataList)
}
setButtonAuth(node.id, data);
......@@ -388,8 +391,7 @@ const MemberDetail: React.FC<{}> = () => {
</Space>
);
const mapkey = (plateformTreeData: any, selectKeys: any) => {
let plateformTreeDataList = [];
const mapkey = (plateformTreeData: any, selectKeys: any, plateformTreeDataList = []) => {
plateformTreeData.map((item: any) => {
if (selectKeys.includes(item.id)) {
plateformTreeDataList.push(
......@@ -398,13 +400,14 @@ const MemberDetail: React.FC<{}> = () => {
title: item.title
}
)
if (item.children) {
const arr = mapkey(item.children, selectKeys)
plateformTreeDataList = [...plateformTreeDataList, ...arr];
if (item.children.length > 0) {
const arr = mapkey(item.children, selectKeys, plateformTreeDataList)
plateformTreeDataList = [...arr];
}
} else {
const arr = mapkey(item.children, selectKeys, plateformTreeDataList)
plateformTreeDataList = [...arr];
}
})
return plateformTreeDataList
}
......@@ -422,7 +425,10 @@ const MemberDetail: React.FC<{}> = () => {
{ orgIds: selectKeys },
),
});
let plateformTreeDataList = mapkey(plateformTreeData, selectKeys)
console.log(plateformTreeData, 'plateformTreeData');
console.log(selectKeys, 'selectKeys');
let plateformTreeDataList = mapkey(plateformTreeData, selectKeys, [])
console.log(plateformTreeDataList)
setplateformTreeList(plateformTreeDataList)
// console.log(plateformTreeDataList, 'plateformTreeData')
setOrgModalVisible(false);
......
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