const aaa= {
"code": 0,
"msg": null,
"data": {
"10": [
{
"deploymentEnvironment": "备份;灾备;开发",
"childNum": "1",
"gradeProtection": "等保一级",
"systemType": "自建",
"sysTemName": "test"
},
{
"deploymentEnvironment": "开发;灾备",
"childNum": "1",
"gradeProtection": "等保三级",
"systemType": "自建",
"sysTemName": "主系统11"
},
{
"deploymentEnvironment": "备份",
"childNum": "1",
"gradeProtection": "等保一级",
"systemType": "统建",
"sysTemName": "主系统"
}
],
"13": [
{
"deploymentEnvironment": "测试;开发",
"childNum": "2",
"gradeProtection": "等保四级",
"systemType": "自建",
"sysTemName": "海油测试4-子系统3"
},
{
"deploymentEnvironment": "备份;开发;测试",
"childNum": "2",
"gradeProtection": "等保一级",
"systemType": "统建",
"sysTemName": "主系统test"
}
],
"systemCount": 10,
"noRelationAssets": 4,
"9Num": 1,
"10Num": 3,
"13Num": 2,
"11Num": 4,
"12Num": 0
}
}
a(aaa.data);
function a(aaa){
var data = aaa;
var obj = {
生产系统类: '9',
办公系统类: '10',
经营管理类: '11',
基础设施及网络安全类: '12',
公众平台类: '13'
}
var systemData = [];
for(let objKey in obj){
var objValue = obj[objKey];
var meta = data[objValue];
if(meta){
var systemDataItem = {};
systemDataItem.title = objKey;
var list = [];
meta.forEach(item =>{
var listItem = {};
listItem.title = item.sysTemName;
var tags = item.deploymentEnvironment.split(";")
tags.push(item.gradeProtection);
tags.push(item.systemType);
listItem.tags = tags;
list.push(listItem);
})
systemDataItem.list = list;
systemData.push(systemDataItem);
}
}
console.log(systemData)
}
console