|
|
@ -89,10 +89,11 @@ |
|
|
|
<el-col :span="14"> |
|
|
|
<el-col :span="14"> |
|
|
|
<el-card> |
|
|
|
<el-card> |
|
|
|
<div class="card-title">月销售趋势</div> |
|
|
|
<div class="card-title">月销售趋势</div> |
|
|
|
|
|
|
|
<div ref="chart" class="chart"></div> |
|
|
|
</el-card> |
|
|
|
</el-card> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="10" class="rank"> |
|
|
|
<el-col :span="10" class="rank"> |
|
|
|
<el-card> |
|
|
|
<el-card class="h-100"> |
|
|
|
<div class="top"> |
|
|
|
<div class="top"> |
|
|
|
<div class="card-title">商品销售TOP5</div> |
|
|
|
<div class="card-title">商品销售TOP5</div> |
|
|
|
<el-dropdown class="select-day"> |
|
|
|
<el-dropdown class="select-day"> |
|
|
@ -117,6 +118,15 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import * as echarts from 'echarts/core'; |
|
|
|
|
|
|
|
import { GridComponent, TooltipComponent } from 'echarts/components'; |
|
|
|
|
|
|
|
import { LineChart } from 'echarts/charts'; |
|
|
|
|
|
|
|
import { UniversalTransition } from 'echarts/features'; |
|
|
|
|
|
|
|
import { CanvasRenderer } from 'echarts/renderers'; |
|
|
|
|
|
|
|
echarts.use([GridComponent, TooltipComponent, LineChart, CanvasRenderer, UniversalTransition]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: "Index", |
|
|
|
name: "Index", |
|
|
|
data() { |
|
|
|
data() { |
|
|
@ -131,9 +141,42 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
mounted() { |
|
|
|
|
|
|
|
// this.$nextTick(() => { |
|
|
|
|
|
|
|
this.initChart() |
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
goTarget(href) { |
|
|
|
initChart() { |
|
|
|
window.open(href, "_blank"); |
|
|
|
let myChart = echarts.init(this.$refs.chart); |
|
|
|
|
|
|
|
let option; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
option = { |
|
|
|
|
|
|
|
xAxis: { |
|
|
|
|
|
|
|
type: 'category', |
|
|
|
|
|
|
|
data: Array.from(new Array(12).keys()).map(item => `${item + 1}月`) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
yAxis: { |
|
|
|
|
|
|
|
type: 'value' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
tooltip: { |
|
|
|
|
|
|
|
show: true, |
|
|
|
|
|
|
|
trigger: 'axis' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
series: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
data: Array.from(new Array(12).keys()).map(item => Math.round(Math.random() * 500)), |
|
|
|
|
|
|
|
type: 'line' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
data: Array.from(new Array(12).keys()).map(item => Math.round(Math.random() * 500)), |
|
|
|
|
|
|
|
type: 'line' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
option && myChart.setOption(option); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
@ -249,6 +292,10 @@ export default { |
|
|
|
&>.bottom { |
|
|
|
&>.bottom { |
|
|
|
margin-top: 10px; |
|
|
|
margin-top: 10px; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.h-100 { |
|
|
|
|
|
|
|
height: 100%; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
&>.rank { |
|
|
|
&>.rank { |
|
|
|
.top { |
|
|
|
.top { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
@ -260,6 +307,10 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.chart { |
|
|
|
|
|
|
|
height: 400px; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|