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