<template>
  <div class="databoard-container">
    <div class="headeer">
      <div class="money">
        <el-tag size="medium" class="tag" type="info">当前余额：0元</el-tag>
      </div>
    </div>

    <div class="footer">
      <div class="top">
        <span>近6个月的信息</span>
        <span class="el-icon-s-promotion" />
      </div>
      <div ref="echartsBox" class="echartsBox" />
    </div>
  </div>
</template>

<script>
import * as echarts from 'echarts'

export default {
  name: 'Workbench',

  data() {
    return {
      note: ''
    }
  },

  watch: {
    note() {
      this.myChart.setOption({
        xAxis: {
          type: 'category',
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
          type: 'value'
        },
        series: [
          {
            data: [820, 932, 901, 934, 1290, 1330, 1320],
            type: 'line',
            smooth: true
          }
        ]
      })
    }
  },

  created() {
    setTimeout(() => {
      this.note = 1
    }, 500)
  },

  mounted() {
    this.myChart = echarts.init(this.$refs.echartsBox)
  }
}
</script>

<style scoped lang="scss">
  .databoard-container {

    .headeer {
    margin-bottom: 25px;

    .money {
      height: 30px;

      .tag {
        display: inline-block;
        height: 30px;
        font-size: 20px;
      }
    }
  }
    .footer {
      height: 100%;

      .top {
        display: flex;
        padding: 0 5px;
        justify-content: space-between;
        font-size: 28px;
        border-bottom: 3px solid #ccc;
      }

      .echartsBox {
        margin-top: 10px;
        height: 500px;
      }
    }
  }

</style>
