<template>
|
<div class="chart-wrapper">
|
<div class="haocai-title">运单数量统计分析</div>
|
<bar-chart ref="barchartInfo" :xaxis-array="barXaxisArray" :series="barSeries" />
|
</div>
|
</template>
|
|
<script>
|
import BarChart from "../components/BarChart";
|
|
export default {
|
components: {
|
BarChart
|
},
|
data() {
|
return {
|
barXaxisArray: [],
|
barSeries: [{ name: "", data: [] }]
|
};
|
},
|
mounted() {
|
this.getHistogramNumStatistics();
|
},
|
methods: {
|
getHistogramNumStatistics() {
|
var the = this;
|
const url = "/api/dashboard/tms/getHistogramNumStatistics";
|
const params = {};
|
var callback = res => {
|
if (res.result) {
|
this.barXaxisArray = [];
|
this.barSeries = [{ name: "", data: [] }];
|
this.HistogramNumList = res.data;
|
this.barSeries[0].name = "运单数";
|
this.HistogramNumList.forEach(row => {
|
this.barXaxisArray.push(row.year + "-" + row.month);
|
this.barSeries[0].data.push(row.count);
|
});
|
window.setTimeout(function() {
|
the.$refs.barchartInfo.initChart();
|
}, 10);
|
}
|
};
|
this.common.ajax(url, params, callback, true);
|
}
|
}
|
};
|
</script>
|
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
.chart-wrapper {
|
background: #fff;
|
padding: 16px 16px;
|
margin-bottom: 10px;
|
.haocai-title {
|
text-align: center;
|
color: #888;
|
font-size: 18px;
|
}
|
}
|
</style>
|