张雄 3 years ago
parent d7ac709874
commit 579e1e2abe

@ -47,6 +47,9 @@ export default function createOpt(dx,ds) {
color: "#fff", color: "#fff",
}, },
}, },
nameTextStyle: {
width: 160
},
data: dx, data: dx,
}, },
yAxis: { yAxis: {

@ -58,7 +58,7 @@ export default {
iPageIndex: 1, iPageIndex: 1,
}, },
selTime: [], selTime: [],
time: '地区销量排行榜', time: '城市销量排行榜',
tValue: 0, tValue: 0,
btnTimes: ['省份销量','城市销量'], btnTimes: ['省份销量','城市销量'],
activeIndex: 0, activeIndex: 0,

@ -31,7 +31,7 @@ export default {
name: 'HistorySale', name: 'HistorySale',
data() { data() {
return { return {
time: '中国汽车销量', time: '历史销量',
form: { form: {
token: '', token: '',
sTimeType: 4, sTimeType: 4,
@ -87,7 +87,21 @@ export default {
let obj = Object.assign({},this.form); let obj = Object.assign({},this.form);
getCheZhuCarSalesCompared(obj).then(res => { getCheZhuCarSalesCompared(obj).then(res => {
let data = res.data; let data = res.data;
this.tbData = data; let tbData = [];
let totalVal = 0;
data.forEach(ele => {
let obj = {
compared: ele.compared,
salescount: ele.salescount,
sourcetime: ele.sourcetime.slice(0,7)
}
tbData.push(obj)
totalVal = totalVal + ele.salescount * 1;
})
this.totalVal = totalVal;
this.avgVal = parseInt(totalVal / data.length);
this.total = data.length;
this.tbData = tbData;
}) })
}, },
// //
@ -108,14 +122,21 @@ export default {
} }
getCheZhuCarSalesCompared(obj).then(res => { getCheZhuCarSalesCompared(obj).then(res => {
let data = res.data; let data = res.data;
let tbData = [];
let totalVal = 0; let totalVal = 0;
data.forEach(ele => { data.forEach(ele => {
let obj = {
compared: ele.compared,
salescount: ele.salescount,
sourcetime: ele.sourcetime.slice(0,7)
}
tbData.push(obj)
totalVal = totalVal + ele.salescount * 1; totalVal = totalVal + ele.salescount * 1;
}) })
this.totalVal = totalVal; this.totalVal = totalVal;
this.avgVal = parseInt(totalVal / data.length); this.avgVal = parseInt(totalVal / data.length);
this.total = data.length; this.total = data.length;
this.tbData = data; this.tbData = tbData;
}) })
}); });
}, },

Loading…
Cancel
Save