Newer
Older
CloudBrainNew / src / views / cityConstruction / cityConstructionRight.vue
StephanieGitHub on 4 Feb 2021 3 KB first commit
<!--
 * @Description: 社会民生右半
 * @Author: 王晓颖
 * @Date: 2020-09-04 13:59:13
 -->
<template>
  <div class="chart-container">
    <div class="right">
      <div class="modular">
        <div class="modular-row-100">
          <!--左66%-->
          <div class="modular-col-50 modular-padding-right">
            <!--上50%,项目概况-->
            <div class="modular-row-60">
              <project-introduce/>
            </div>
            <!--中33%-->
            <div class="modular-row-30">
              <construction-people-state/>
              <!--<ecard-introduce/>-->
            </div>
            <!--下33%-->
            <!--<div class="modular-row-30">-->
              <!--<div class="modular-col-50 modular-padding-right">-->
                <!--&lt;!&ndash;<park-occupy/>&ndash;&gt;-->
              <!--</div>-->
              <!--<div class="modular-col-50">-->
                <!--&lt;!&ndash;<park-income/>&ndash;&gt;-->
              <!--</div>-->
            <!--</div>-->

          </div><!-- .col50 over-->
          <!--右33%-->
          <div class="modular-col-50">
            <div class="modular-row-30">
              <!--项目投资-->
              <project-investment/>
            </div>
            <div class="modular-row-30">
              <construction/>
            </div>
            <div class="modular-row-30">
              <construction-watch/>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>

import ProjectIntroduce from './components/projects/projectIntroduce'
import ProjectInvestment from './components/projects/projectInvestment'
import Construction from './components/construction/construction'
import ConstructionWatch from './components/construction/constructionWatch'
import ConstructionPeopleState from './components/construction/constructionPeopleState'
export default {
  name: 'CityConstructionRight',
  components: {
    ConstructionPeopleState,
    ConstructionWatch,
    Construction,
    ProjectInvestment,
    ProjectIntroduce
  },
  data () {
    return {
      currentComp: 0, // 人口组件
      currentComps: ['case-all', 'traffic-all'],
      compsTimer: null
    }
  },
  mounted () {
    // this.countdown()
  },
  methods: {
    // 交通、社会治理面板切换
    compChange () {
      this.compsTimer = setTimeout(() => {
        const max = this.currentComps.length - 1
        if (this.currentComp < max) {
          this.currentComp++
        } else {
          this.currentComp = 0
        }
        this.compChange()
      }, 20000)
    },
    // 停止切换人口组件
    stopCompChange () {
      clearInterval(this.compsTimer)
      this.compsTimer = null
    }
  },
  beforeDestroy () {
    this.stopCompChange()
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  .chart-container{
    position: absolute;
    padding: 0 0.1rem 0.1rem 0.3rem;
    top:0;
    right:0.2rem;
    width: 30%;
    height:100%;
    display: flex;
    z-index: 20;
    justify-content: space-between;
    background: transparent;
    .right{
      width:100%;
      height:100%;
      display: flex;
      justify-content: center;
    }

  }
</style>