<template>
  <Container name="能源监控" size="large" style="">
    <TimePrompt class="timeShow" :timestr="timestr" />
    <div class="chart" style="height: 370px; margin-top: 8px;">
      <EnergeMonitoringChart @emitFun='dateUpdate'/>
    </div>
  </Container>
</template>
<script>
import Container from '../components/Container.vue';
import EnergeMonitoringChart from '../components/EnergeMonitoringChart';
import TimePrompt from '../components/TimePrompt';
import { switchShowTime } from '../utils'
export default {
  name: 'EnergyMonitoring',
  components: { Container, EnergeMonitoringChart, TimePrompt },
  data() {
    return {
      timestr: ''
    }
  },
  mounted() {
    this.timestr = switchShowTime('日')
  },
  methods: {
    // 数据更新
    dateUpdate() {
      this.timestr = switchShowTime('日')
    }
  }
}
</script>
<style lang='scss' scoped>
.timeShow {
  position: absolute;
  top: 18px;
  left: 170px;
}
.timeToggle {
  position: absolute;
  right: 20px;
  top: 30px;
}
</style>