<!-- * @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-60 modular-padding-right"> <div class="modular-row-60"> <enterprise/> </div> <div class="modular-row-30"> <building/> </div> </div> <!--右33%--> <div class="modular-col-30"> <expense/> </div> </div> </div> </div> </div> </template> <script> import Enterprise from './components/enterprise/enterprise' import Commercial from './components/commercial/commercial' import Daily from './components/daily/daily' import Expense from "./components/expense/expense"; import Structure from "./components/structure/structure"; import Building from "./components/building/building"; import Assets from "./components/assets/assets"; export default { name: 'industrialEconomyRight', components: { Assets, Expense, Building, Structure, Daily, Enterprise, Commercial }, 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>