|
|
|
|
@ -652,17 +652,21 @@ class CustomerStore {
|
|
|
|
|
return { filterHasOld };
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
regular_data_pivot = (pivotRow, pivotCol) => {
|
|
|
|
|
regular_data_pivot = (_pivotRow, pivotCol) => {
|
|
|
|
|
const pivotRow = _pivotRow === 'countryFChina' ? 'country' : _pivotRow;
|
|
|
|
|
// console.clear();
|
|
|
|
|
// this.sales_regular_data.rawData;
|
|
|
|
|
// console.log('regular_data_pivot -------------------------------------------------------------- rawData 000 ', toJS(this.sales_regular_data.rawData));
|
|
|
|
|
// console.log('regular_data_pivot -------------------------------------------------------------- rawData 000 ', toJS(this.sales_regular_data.rawDataArr));
|
|
|
|
|
// console.log('regular_data_pivot ---- ', pivotRow, pivotCol);
|
|
|
|
|
const [result1, result2] = this.sales_regular_data.rawDataArr;
|
|
|
|
|
// const allRows = Array.from(new Set([...result1.filterHasOld.map(row=>row[pivotRow]), ...result2.filterHasOld.map(row=>row[pivotRow])]));
|
|
|
|
|
// console.log(' ------ allRows', result1, result2);
|
|
|
|
|
const [{ pivotResult: pivot1, rowValues: rowValues1 }, { pivotResult: pivot2, rowValues: rowValues2 }] = [result1, result2].map((_result) => {
|
|
|
|
|
const dataColField = pivotCol.replace('_txt', '');
|
|
|
|
|
const rawData = pivotCol === 'hasOld' ? _result.filterHasOld : _result.filterHasOld.filter((ele) => ele[dataColField] === '1');
|
|
|
|
|
let rawData = pivotCol === 'hasOld' ? _result.filterHasOld : _result.filterHasOld.filter((ele) => ele[dataColField] === '1');
|
|
|
|
|
if (_pivotRow === 'countryFChina') {
|
|
|
|
|
rawData = rawData.filter(ele => ele.travelMotivation_china === '华裔');
|
|
|
|
|
}
|
|
|
|
|
const {
|
|
|
|
|
data: pivotResult,
|
|
|
|
|
columnValues: [[rowValues], columnsKeys, dateKeys],
|
|
|
|
|
|