function FilterByName(data, Name) { //data是json对象,Name是根据什么字段去重
var map = {},
dest = [];
for (var i = 0; i < data.length; i++) {
var ai = data[i];
if (i == 0) {
dest.push(ai);
} else {
var filterData = dest.filter(function (e) {
return e[Name] == ai[Name];
})
if (filterData.length == 0) {
dest.push(ai);
}
}
}
return dest;
}