fix: 数据透视: 目的地国家/城市 空值 不省略

main
Lei OT 3 months ago
parent 1f5d6a9047
commit 5f7a942842

@ -332,7 +332,7 @@ export const pivotBy = (_data, [rows, columns, date]) => {
// 数组的字段值, 拆分处理
if (groupbyKeys.includes('destinationCountry')) {
data = data.reduce((r, v, i) => {
const vjson = isEmpty(v.destinationCountry) ? [] : v.destinationCountry;
const vjson = isEmpty(v.destinationCountry) ? [""] : v.destinationCountry;
const xv = (vjson).reduce((rv, cv, vi) => {
rv.push({...v, destinationCountry: cv, key: vi === 0 ? v.key : `${v.key}@${cv}`});
return rv;
@ -344,7 +344,7 @@ export const pivotBy = (_data, [rows, columns, date]) => {
}
if (groupbyKeys.includes('destinations')) {
data = data.reduce((r, v, i) => {
const vjson = isEmpty(v.destinations) ? [] : v.destinations;
const vjson = isEmpty(v.destinations) ? [""] : v.destinations;
const xv = (vjson).reduce((rv, cv, vi) => {
rv.push({...v, destinations: cv, key: vi === 0 ? v.key : `${v.key}@${cv}`});
return rv;

Loading…
Cancel
Save