|
|
|
|
@ -497,6 +497,7 @@ class CustomerStore {
|
|
|
|
|
// },
|
|
|
|
|
pivotResult: [],
|
|
|
|
|
countrySummary: [],
|
|
|
|
|
citySummary: [],
|
|
|
|
|
filterColValues: [],
|
|
|
|
|
rawDataArr: [],
|
|
|
|
|
};
|
|
|
|
|
@ -576,7 +577,7 @@ class CustomerStore {
|
|
|
|
|
// 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', allRows);
|
|
|
|
|
// 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');
|
|
|
|
|
@ -635,6 +636,53 @@ class CustomerStore {
|
|
|
|
|
|
|
|
|
|
this.sales_regular_data.countrySummary = [aseanSummary, eurusdSummary];
|
|
|
|
|
}
|
|
|
|
|
if (pivotRow === 'destinations') {
|
|
|
|
|
const city1 = ['昆明','大理','丽江','中甸','德钦','西双版纳','普洱','泸沽湖','腾冲'];
|
|
|
|
|
const [city11, city12] = [
|
|
|
|
|
pivot1.filter((ele) => city1.includes(ele.destinations)),
|
|
|
|
|
pivot2.filter((ele) => city1.includes(ele.destinations)),
|
|
|
|
|
];
|
|
|
|
|
const city1Summary = calcSummaryRow(city11, city12);
|
|
|
|
|
city1Summary.key = '云南';
|
|
|
|
|
city1Summary.destinations = '云南';
|
|
|
|
|
|
|
|
|
|
const city2 = ['上海','苏州','杭州','黄山','婺源','上饶','景德镇'];
|
|
|
|
|
const [city21, city22] = [
|
|
|
|
|
pivot1.filter((ele) => city2.includes(ele.destinations)),
|
|
|
|
|
pivot2.filter((ele) => city2.includes(ele.destinations)),
|
|
|
|
|
];
|
|
|
|
|
const city2Summary = calcSummaryRow(city21, city22);
|
|
|
|
|
city2Summary.key = '华东';
|
|
|
|
|
city2Summary.destinations = '华东';
|
|
|
|
|
|
|
|
|
|
const city3 = ['乌鲁木齐','喀什','伊宁','昭苏','霍城','那拉提','喀纳斯','禾木','布尔津','吐鲁番','库尔勒','赛里木湖','和田','库车'];
|
|
|
|
|
const [city31, city32] = [
|
|
|
|
|
pivot1.filter((ele) => city3.includes(ele.destinations)),
|
|
|
|
|
pivot2.filter((ele) => city3.includes(ele.destinations)),
|
|
|
|
|
];
|
|
|
|
|
const city3Summary = calcSummaryRow(city31, city32);
|
|
|
|
|
city3Summary.key = '新疆';
|
|
|
|
|
city3Summary.destinations = '新疆';
|
|
|
|
|
const city4 = ['拉萨','江孜','林芝','鲁朗','巴松措','然乌','波密','日喀则','定日','泽当','塔钦'];
|
|
|
|
|
const [city41, city42] = [
|
|
|
|
|
pivot1.filter((ele) => city4.includes(ele.destinations)),
|
|
|
|
|
pivot2.filter((ele) => city4.includes(ele.destinations)),
|
|
|
|
|
];
|
|
|
|
|
const city4Summary = calcSummaryRow(city41, city42);
|
|
|
|
|
city4Summary.key = '西藏';
|
|
|
|
|
city4Summary.destinations = '西藏';
|
|
|
|
|
|
|
|
|
|
const city5 = ['贵阳','安顺','黄果树','榕江','从江','毕节','织金','铜仁','梵净山','荔波','平塘','兴义'];
|
|
|
|
|
const [city51, city52] = [
|
|
|
|
|
pivot1.filter((ele) => city5.includes(ele.destinations)),
|
|
|
|
|
pivot2.filter((ele) => city5.includes(ele.destinations)),
|
|
|
|
|
];
|
|
|
|
|
const city5Summary = calcSummaryRow(city51, city52);
|
|
|
|
|
city5Summary.key = '贵州';
|
|
|
|
|
city5Summary.destinations = '贵州';
|
|
|
|
|
|
|
|
|
|
this.sales_regular_data.citySummary = [city1Summary, city2Summary, city3Summary, city4Summary, city5Summary];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.sales_regular_data.pivotResult = pivotResultWithCompare;
|
|
|
|
|
this.sales_regular_data.filterColValues = filterColValues;
|
|
|
|
|
|