|
|
|
@ -37,7 +37,8 @@ |
|
|
|
<!-- <a-range-picker class="picker"/> --> |
|
|
|
</div> |
|
|
|
<a-tab-pane loading="true" tab="销售额" key="1"> |
|
|
|
<schart class="schart" canvasId="bar" :options="options1"></schart> |
|
|
|
<!-- <schart class="schart" canvasId="bar" :options="options1"></schart> --> |
|
|
|
<div id="main" style="width: 100%; " class="schart"></div> |
|
|
|
</a-tab-pane> |
|
|
|
<!-- <a-tab-pane tab="访问量" key="2"> |
|
|
|
<schart class="schart" canvasId="bar" :options="options1"></schart> |
|
|
|
@ -136,6 +137,10 @@ export default { |
|
|
|
active1:'year', |
|
|
|
options1: { |
|
|
|
type: 'bar', |
|
|
|
showValue:false, |
|
|
|
legend:{ |
|
|
|
display:true |
|
|
|
}, |
|
|
|
// title: { |
|
|
|
// text: '最近一周各品类销售图' |
|
|
|
// }, |
|
|
|
@ -150,10 +155,10 @@ export default { |
|
|
|
label: '百货', |
|
|
|
data: [164, 178, 190, 135, 160] |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '食品', |
|
|
|
data: [144, 198, 150, 235, 120] |
|
|
|
} |
|
|
|
// { |
|
|
|
// label: '食品', |
|
|
|
// data: [144, 198, 150, 235, 120] |
|
|
|
// } |
|
|
|
] |
|
|
|
}, |
|
|
|
} |
|
|
|
@ -164,7 +169,32 @@ export default { |
|
|
|
created(){ |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
// this.drawChart(); |
|
|
|
}, |
|
|
|
methods:{ |
|
|
|
drawChart() { |
|
|
|
// 基于准备好的dom,初始化echarts实例 这个和上面的main对应 |
|
|
|
let myChart = this.$echarts.init(document.getElementById("main")); |
|
|
|
// 指定图表的配置项和数据 |
|
|
|
let option = { |
|
|
|
// title: { |
|
|
|
// text: "ECharts 入门示例", |
|
|
|
// }, |
|
|
|
color: ['#4A90E2','#F5A623',], |
|
|
|
tooltip: {}, |
|
|
|
legend: { |
|
|
|
data: ["订单金额总额",'标的价款总额'], |
|
|
|
}, |
|
|
|
xAxis: { |
|
|
|
data: this.options1.labels, |
|
|
|
}, |
|
|
|
yAxis: {}, |
|
|
|
series: this.options1.datasets |
|
|
|
}; |
|
|
|
// 使用刚指定的配置项和数据显示图表。 |
|
|
|
myChart.setOption(option); |
|
|
|
}, |
|
|
|
changeTiem(time,type){ |
|
|
|
if(type==1){ |
|
|
|
this.query.rightDate=time |
|
|
|
@ -196,8 +226,14 @@ export default { |
|
|
|
} |
|
|
|
this.rankList=res.data.entrust_ranking |
|
|
|
this.rankList1=res.data.entrust_sale_ranking |
|
|
|
// let type={type:'bar'} |
|
|
|
res.data.treeMap.map(item=>{ |
|
|
|
item.type='bar' |
|
|
|
item.name=item.label |
|
|
|
}) |
|
|
|
this.options1.datasets=res.data.treeMap |
|
|
|
this.options1.labels=res.data.label |
|
|
|
this.drawChart() |
|
|
|
}else{ |
|
|
|
this.$message.error(res.msg); |
|
|
|
} |
|
|
|
|