333
schangxiang@126.com
2025-09-19 18966e02fb573c7e2bb0c6426ed792b38b910940
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<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>