<template>
  <div class="manage-home">
    <!--导航栏-->
    <div class="manage-navigation">
      <div class="navigation-title" @click="showpro=!showpro"><div class="navigation-date">{{date}}</div></div>
<!--      <div class="safe-manage" @click=goto()>安全服务平台</div>-->
    </div>
    <!--&lt;!&ndash;正文&ndash;&gt;-->
    <div class="manage-text">
      <!--1-->
      <text-user class="text-user" v-ref:textuser></text-user>
      <text-shanximap class="text-shanximap" v-ref:textshanximap></text-shanximap>
      <text-sellgas class="text-sellgas" v-ref:textsellgas></text-sellgas>
      <text-totalsellgas class="text-totalsellgas" v-ref:texttotalsellgas></text-totalsellgas>
      <text-childsellgas class="text-childsellgas" v-ref:textchildsellgas></text-childsellgas>
      <text-profit class="text-profit" style="margin-top: 4%;" v-ref:textprofit :showpro="showpro" ></text-profit>


        <!--用气分布图-->
        <gas-distri class="text-gas" v-ref:textgas  class="" :listenheight="listenheight"></gas-distri>
<!--        &lt;!&ndash;客户满意度统计&ndash;&gt;-->
        <contentment class="text-contentment" v-ref:textcontentment></contentment>

    </div>
    <!--<loading v-if="initdatashow"></loading>-->
<!--    <loading v-if="initdatashow"  :backurl="backurl"></loading>-->
  </div>
</template>

<script>
  import * as Util from '../../../../stores/Util'
  import * as DataSql from '../../../../stores/DataSql'
  import co from 'co'

  export default {
    title: "经营管控",
    props: {
      homeflag:Boolean,
    },
    data() {
      return {
        backurl:'../../../../static/ManageHomePic/加载数据1.gif',
        date:'',   //获取当前时间
        initdatashow:true,
        showpro:true,
        loadnum:0
      }
    },
    methods: {
      // 定时获取时间
     getdate(){
       var self=this
       setInterval(() => {
         self.date=Util.toStandardTimeString()
       }, 1000)
     },
      goto(){
        this.$parent.homeflag=false
      },
        //刷新数据
        resize() {
         console.log(this,'ssad')
          // var con=['text-user','text-shanximap','text-sellgas','text-totalsellgas','text-childsellgas',
          //     'text-profit', 'text-gas', 'text-contentment']
            console.log(this)
            console.log(this.$refs.textsellgas)
            this.$refs.textuser.resize()
            this.$refs.textshanximap.resize()

            this.$refs.textsellgas.resize()
            this.$refs.texttotalsellgas.resize()
            this.$refs.textchildsellgas.resize()
            this.$refs.textprofit.resize()
            this.$refs.textgas.resize()
            this.$refs.textcontentment.resize()
        },
    },
    watch: {
     'loadnum'(){
         console.log(this.loadnum,'加载完成')
         if(this.loadnum==8){
             this.initdatashow=false
         }
         if(this.loadnum==1000){
             this.loadnum==10
         }
     }
    },
    ready() {
     this.getdate()
        var self=this
        setInterval(function () {
            self.resize()
        },60000)
    }
  }
</script>
<style scoped>
.text-gas{
  position: absolute;
  background-image: url('/static/NewManageHome/分公司年度购进量.png');
  background-repeat: no-repeat;
  background-size: 100% 100%;
  top: 36%;
  left: 70%;
  width: 28%;
  height: 24%;
  text-align: center;
  padding-top: 7px;
}

.text-contentment{
  position: absolute;
  background-image: url('/static/NewManageHome/总公司销售趋势.png');
  background-repeat: no-repeat;
  background-size: 100% 100%;
  top: 62%;
  left: 70%;
  width: 28%;
  height: 36%;
  text-align: center;
  padding-top: 7px;
}
</style>
