Fixiaobai
2023-10-13 e8308ddac0ba4a1f406e8f63d7e6b6f2541cb770
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<template>
  <div id="app">
    <basic-container>
      <el-row type="flex" class="row-bg">
        <el-col :span="12">
          <v-chart class="my-chart" :options="bar"/>
          <pie-detail>
          </pie-detail>
        </el-col>
        <el-col :span="12">
          <div class="statement" style="float:right;width: 600px;margin-right:10px">
            <statement-detail></statement-detail>
          </div>
        </el-col>
      </el-row>
    </basic-container>
  </div>
</template>
<script>
  import ECharts from "vue-echarts/components/ECharts";
  import "echarts/lib/chart/bar";
  import {fetchPictureList} from "../../../api/warehouse/scrapmain";
  import PieDetail from './pie'
  import StatementDetail from './statement'
 
  export default {
    name: "App",
    components: {
      "v-chart": ECharts,
      PieDetail,
      StatementDetail
    },
    data: function () {
      return {
        bar: {
          title: {},
          legend: {},
          tooltip: {},
          dataset: {
            source: []
          },
          xAxis: {type: 'category'},
          yAxis: {},
          series: [
            {label: {normal: {show: true, position: 'top', formatter: '1月'}}, type: 'bar'},
            {label: {normal: {show: true, position: 'top', formatter: '2月'}}, type: 'bar'},
            {label: {normal: {show: true, position: 'top', formatter: '3月'}}, type: 'bar'},
            {label: {normal: {show: true, position: 'top', formatter: '4月'}}, type: 'bar'},
            {label: {normal: {show: true, position: 'top', formatter: '5月'}}, type: 'bar'},
            {label: {normal: {show: true, position: 'top', formatter: '6月'}}, type: 'bar'},
            {label: {normal: {show: true, position: 'top', formatter: '7月'}}, type: 'bar'},
            {label: {normal: {show: true, position: 'top', formatter: '8月'}}, type: 'bar'},
            {label: {normal: {show: true, position: 'top', formatter: '9月'}}, type: 'bar'},
            {label: {normal: {show: true, position: 'top', formatter: '10月'}}, type: 'bar'},
            {label: {normal: {show: true, position: 'top', formatter: '11月'}}, type: 'bar'},
            {label: {normal: {show: true, position: 'top', formatter: '12月'}}, type: 'bar'},
 
          ]
        }
      };
    },
    created() {
      this.getDataList()
    },
    methods: {
      // 获取数据列表
      getDataList() {
        fetchPictureList(Object.assign({
            dateTimeFilters: JSON.stringify(this.dateTimeFilters),
          },
          this.queryForm
        )).then(response => {
          this.bar.dataset.source = response.data.data[0].scrapList
        })
      }
    }
  };
</script>
<style>
  .my-chart {
    width: 900px;
    height: 400px;
  }
 
</style>