var map = {},
jobarr = [];
for (var i = 0; i < jobs.length; i++) {
var ai = jobs[i];
if (!map[ai.dep]) {
jobarr.push({
dep: ai.dep,
item: [ai]
});
map[ai.dep] = ai;
} else {
for (var j = 0; j < jobarr.length; j++) {
var dj = jobarr[j];
if (dj.dep == ai.dep) {
dj.item.push(ai);
break;
}
}
}
}