梵
const allPubs = rows.reduce((ac, item) => {
const idx = ac.findIndex((x) => x.publicationName === item.publicationName);
console.log("IDX", idx);
if (idx === -1) {
ac.push(item);
} else {
ac[idx].publicationQty += item.publicationQty;
}
return ac;
}, []);
const sortedRows = orderBy(allPubs, ["publicationQty"], ["desc"]);