/*collection+json 格式转化*/
function getEntity(data) {
var mod = {};
if(data.data) {
for(var i = 0; i < data.data.length; i++) {
var properti = data.data[i];
mod[properti.name] = properti.value;
}
} else {
mod = null;
}
return mod;
}
function getList(data) {
var entitys = data.collection.items;
var list = [];
for(var i = 0; i < entitys.length; i++) {
var entity = getEntity(entitys[i]);
if(entity == null || entity == {}) continue;
list.push(getEntity(entitys[i]));
}
return list;
}
时间: 2024-10-11 09:59:51