diff --git a/src/libs/ht.js b/src/libs/ht.js index 67d7b0e..a599317 100644 --- a/src/libs/ht.js +++ b/src/libs/ht.js @@ -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;