Newer
Older
CloudBrainNew / src / views / cityConstruction / components / construction / construction.vue
wangxitong on 29 Apr 2021 1 KB 0429 submit
<!--
 * @Description: 工地
 * @Author: 王晓颖
 * @Date: 2020-12-03 17:02:13
 -->
<template>
  <chart-layout title="工地建设" @click="getData">
    <div class="block-container">
      <div class="block" style="width:60%">
        <construction-state/>
      </div>
      <div class="block" style="flex:1">
        <construction-pie v-if="isShow"/>
        <construction-bar v-if = "!isShow"/>
      </div>
    </div>
    <corner1 slot="corner"/>
  </chart-layout>
</template>

<script>
import ConstructionState from './components/constructionState'
import ConstructionPie from './components/constructionPie'
import ConstructionBar from './components/constructionBar'

export default {
  name: 'construction',
  components: {ConstructionBar, ConstructionPie, ConstructionState},
  data () {
    return {
      compTimer: null,
      isShow: false
    }
  },
  created () {
    this.compChange()
  },
  methods: {
    compChange () {
      this.compTimer = setTimeout(() => {
        this.isShow = !this.isShow
        this.compChange()
      }, 10 * 1000)
    },
    getData () {
      // this.$refs.ecardEarth.getData()
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  .block-container{
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    box-sizing: border-box;
    padding: 0.04rem;
    /*padding:0.1rem;*/
    .block{
      height:100%;
      box-sizing: border-box;
    }
  }
</style>