<template>
  <div>
    <div v-show="!drillshow">
      <!--用户数量-->
      <user-number v-ref:usernumbers class="border usernumber" :f_filiale="f_filiale" v-bind:increaseuser="increaseuser"
                   v-on:drill="listenToUserNumber" v-on:drilldata="listenToData"></user-number>
      <!--主要用户展示-->
      <user-gas v-ref:usergas class="border usergas" :f_filiale="f_filiale" :listenheight="listenheight"
                v-on:drill="listenToUserNumber" v-on:drilldata="listenToData"></user-gas>
      <!--用户数量增长情况-->
      <user-increase v-ref:userincrease class="border userincrease" :f_filiale="f_filiale" :listenheight="listenheight"></user-increase>
      <!--销售额往年同比分析-->
      <sale-proportion v-ref:saleproportion class="border saleproportion" :f_filiale="f_filiale"
                       :listenheight="listenheight"></sale-proportion>
      <!--报建用户分布-->
      <my-inspec-distri v-ref:inspecdistri class="border inspecdistri" :f_filiale="f_filiale" :listenheight="listenheight"></my-inspec-distri>
      <fmy-inspec-distri v-ref:inspecdistri class="border inspecdistri2" :f_filiale="f_filiale" :listenheight="listenheight"></fmy-inspec-distri>
      <!--用气分布图-->
      <gas-distri v-ref:gasdistri class="border gasdistri" :f_filiale="f_filiale" :listenheight="listenheight"></gas-distri>
    </div>
    <drill-data v-show="drillshow" :parenttitle="title" :idname="idname" :childname="childname"
                :drillshow="drillshow" :echartsdata="childdata" :initdatatr="initdatatr" class="drill"></drill-data>
  </div>
</template>

<script>
  export default {
    name: "UseHome",
    props: {
      drillshow: Boolean,
      f_filiale: String,
      pageshow: {
        home: Boolean,
        user: Boolean,
        services: Boolean,
        safe: Boolean,
        monitor: Boolean,
        net: Boolean,
      },
    },
    data() {
      return {
        increaseuser: 0,
        title: {pagename: '用户', pagetitle: 'user', pagechildrenname: ''},
        idname: '',
        childname: '',
        childdata: '',
        listenheight: '',
        loaddata: 0,
        initdatatr: {},
      }
    },
    methods: {
      listenToUserNumber(idname, childname, pagename, initdatatr) {
        return
        this.drillshow = true
        this.idname = idname
        this.childname = childname
        this.title.pagechildrenname = pagename
        this.initdatatr = initdatatr
      },
      listenToData(param) {
        this.childdata = param
      },
    },
    watch: {
      'loaddata'(val) {
      console.log(this.loaddata,'加载次数')
        if (this.loaddata >= 6) {
          this.$parent.initdatashow = false
        }
      }
    },
    ready() {
      // this.listenheight=0
      // console.log(this.listenheight,'000')
    }

  }
</script>

<style scoped>
  /*边框样式*/
  .border {
    padding-top: 0.4%;
    background: linear-gradient(#6fd9d0, #6fd9d0) left top,
    linear-gradient(#6fd9d0, #6fd9d0) left top,
    linear-gradient(#6fd9d0, #6fd9d0) right top,
    linear-gradient(#6fd9d0, #6fd9d0) right top,
    linear-gradient(#6fd9d0, #6fd9d0) left bottom,
    linear-gradient(#6fd9d0, #6fd9d0) left bottom,
    linear-gradient(#6fd9d0, #6fd9d0) right bottom,
    linear-gradient(#6fd9d0, #6fd9d0) right bottom;
    background-repeat: no-repeat;
    background-size: 1.5px 11px, 11px 1.5px;
    background-color: rgba(1, 207, 242, 0.05);
  }

  /*用户数量图样式*/
  .usernumber {
    position: absolute;
    left: 2%;
    width: 31%;
    height: 55%;
  }

  /*大用户气量*/
  .usergas {
    position: absolute;
    top:57%;
    left: 2%;
    width: 31%;
    height: 37%;
  }

  /*用户增长*/
  .userincrease {
    position: absolute;
    left: 34%;
    width: 32%;
    height: 40%;
  }

  /*销售往年同比*/
  .saleproportion {
    position: absolute;
    top:42%;
    left: 67%;
    width:31%;
    height: 52%;
  }

  /*报建用户*/
  .inspecdistri {
    position: absolute;
    top:42%;
    left: 34%;
    width: 32%;
    height: 25%;
  }
  .inspecdistri2 {
    position: absolute;
    top:69%;
    left: 34%;
    width: 32%;
    height: 25%;
  }

  /*用气分布*/
  .gasdistri {
    position: absolute;
    left: 67%;
    width:31%;
    height: 40%;
  }

  .drill {
    padding-top: 1%;
    width: 100%;
    height: 100%;
  }
</style>
