<template>
  <div id="card-2">
    <el-row>
      <el-col :span="24" class="main">
        <div id="card_two" style="width: 100%; height: 17vw"></div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import * as echarts from 'echarts';
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  name: 'index',
  props: {},
  components: {},
  data: function () {
    return {};
  },
  computed: {
    ...mapState(['user']),
  },
  mounted() {
    this.getEchartData();
  },
  created() {},
  methods: {
    getEchartData() {
      var chartDom = document.getElementById('card_two');
      var myChart = echarts.init(chartDom);
      var option;

      option = {
        title: {
          text: '本周售后数',
        },
        color: '#FF7F50',
        tooltip: {
          trigger: 'axis',
        },
        xAxis: {
          type: 'category',
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
        },
        yAxis: {
          type: 'value',
        },
        series: [
          {
            data: [120, 200, 150, 80, 70, 110, 130],
            type: 'bar',
          },
        ],
      };

      option && myChart.setOption(option);
    },
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
  watch: {
    test: {
      deep: true,
      immediate: true,
      handler(val) {},
    },
  },
};
</script>

<style lang="less" scoped></style>
