const list = [
{ fileName: "1.png", nodeId: "bidding-project-apply" ,name:null},
{ fileName: "2.png", nodeId: "bidding-project-apply" ,name:null},
{ fileName: "3.png", nodeId: "bidding-it-risk" ,name:null},
{ fileName: "2.png", nodeId: "bidding-it-risk" ,name:null},
{ fileName: "4.png", nodeId: "bidding-reported-material" ,name:null},
{ fileName: "5.png", nodeId: "bidding-bid-opening-evaluation" ,name:'附件1'},
{ fileName: "6.png", nodeId: "bidding-bid-opening-evaluation",name:'附件2' },
{ fileName: "7.png", nodeId: "bidding-bid-opening-evaluation" ,name:'附件3'}
]
原数组改成下面的对象
obj = {
'bidding-bid-opening-evaluation': {
'附件1': [
{ fileName: "5.png", nodeId: "bidding-bid-opening-evaluation", name: '附件1' }
],
'附件2': [
{ fileName: "6.png", nodeId: "bidding-bid-opening-evaluation", name: '附件2' },
],
'附件3': [
{ fileName: "7.png", nodeId: "bidding-bid-opening-evaluation", name: '附件3' }
]
},
'bidding-it-risk': {
'fileList': [
{ fileName: "3.png", nodeId: "bidding-it-risk", name: null },
{ fileName: "2.png", nodeId: "bidding-it-risk", name: null }
]
},
'bidding-project-apply': {
'fileList': [
{ fileName: "1.png", nodeId: "bidding-project-apply", name: null },
{ fileName: "2.png", nodeId: "bidding-project-apply", name: null }
]
},
'bidding-reported-material': {
'fileList': [
{ fileName: "4.png", nodeId: "bidding-reported-material", name: null }
]
}
}
这种怎么改造好?