<template>
  <div id="statistics-info"  :class="leftShowType=='Statistics'?'inShow':'outShow'">
    <div class="statistics-content">
      <div class="statistics-title">
        <span>
          统计信息
        </span>
      </div>
      <el-divider></el-divider>
      <div class="top-area">
        <div class="top-title">
          <div class="single-title-left">
            <img src="../../../assets/imgs/mainPage/地下管线管理.png" alt="">
            <span>地下管线</span>
          </div>
          <div class="single-title-right">
           <span>管线长度(公里)</span>
         </div>
        </div>
        <div class="top-content">
         <div class="single-content" v-for="(item,index) in backgroundList" :key="index">
           <div class="part-content">
             <span>{{item.name}}</span>
           </div>
           <div class="part-content">
             <span>{{item.value}}</span>
           </div>
         </div>
        </div>
      </div>
      <div class="top-area">
        <div class="top-title">
          <div class="single-title-left">
            <img src="../../../assets/imgs/mainPage/建筑.png" alt="">
            <span>地下构筑物</span>
          </div>
          <div class="single-title-right">
            <span>数量</span>
          </div>
        </div>
        <div class="top-content">
          <div class="single-content" v-for="(item,index) in buildingList" :key="index">
            <div class="part-content">
              <span>{{item.name}}</span>
            </div>
            <div class="part-content">
              <span>{{item.value}}</span>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="statistics-button" @click="changeStatisticsStatus">
      <img :src="imgSrc()" class="button-img" />
    </div>
  </div>
</template>

<script>
export default {
  name: "StatisticsInfo",
  data(){
    return{
      backgroundList:[
        {
          name:'电力',
          value:'25581'
        },
        {
          name:'通信',
          value:'32635'
        },
        {
          name:'给水',
          value:'12802'
        },
        {
          name:'排水',
          value:'20582'
        },
        {
          name:'燃气',
          value:'8103'
        },
        {
          name:'热力',
          value:'83'
        },
        {
          name:'工业',
          value:'438'
        },
        {
          name:'长输管线',
          value:'442'
        },
        {
          name:'其他',
          value:'128'
        },
        {
          name:'总计',
          value:'100794'
        },
      ],
      buildingList:[
        {
          name:'地下构筑物（个）',
          value:'5673'
        },
        {
          name:'地下交通车站（个）',
          value:'360'
        },
        {
          name:'地下交通区间（公里）',
          value:'665'
        },
        {
          name:'越江隧道（条）',
          value:'16'
        },
        {
          name:'高架道路桩基（公里）',
          value:'383'
        },
      ]
    }
  },
  props:{
    leftShowType:{

    }
  },
  methods:{
    imgSrc(){
      if(this.leftShowType=='Statistics'){
        return require('../../../assets/imgs/mainPage/jiantou_left.png')
      }else{
        return require('../../../assets/imgs/mainPage/jiantou_right.png')
      }
    },
    changeStatisticsStatus(){
      if(this.leftShowType =='Statistics'){
        this.$emit('setLeftShow','')
      }else{
        this.$emit('setLeftShow','Statistics')
      }
    }
  }
}
</script>

<style scoped lang="scss">
#statistics-info{
  ::v-deep{
    .el-divider--horizontal{
      margin:8px 0;
      background: 0 0;
      border-top:1px dashed #56afe8;
    }
  }
  position: absolute;
  left:0;
  top:120px;
  z-index: 1;
  text-align: center;
  width: 510px;
  @media screen and(max-height: 980px){
    height: 650px;
  }
  @media screen and(min-height: 980px){
    height: 805px;
  }
  background: url("../../../assets/imgs/mainPage/左侧背景.png") no-repeat;
  background-size: 100% 100%;
  .statistics-content{
    width: 98%;
    height: 98%;
    padding-left: 1%;
    padding-top: 1%;
    display: flex;
    flex-direction: column;
    color: white;
    align-items: center;
    .statistics-title{
      height: 40px;
      display: flex;
      justify-content: center;
      align-items: center;

      >span{
      }
    }
    .top-area{
      width: 100%;
      display: flex;
      flex-direction: column;
      padding:15px;
      .top-title{
        display: flex;
       // line-height: 40px;
        .single-title-left{
          width: 50%;
          display: flex;
          >img{
            padding-left: 60px;
          }
          >span{
            padding-left: 14px;
            font-size:16px;
            font-weight: 600;
            color: #58b1e9;
          }
        }
        .single-title-right{
          width: 50%;
          display: flex;
          >span{
            padding-left: 48px;
            font-size:16px;
            font-weight: 600;
            color: #58b1e9;
          }
        }
      }
      .top-content{
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-end;
        .single-content{
          width:80%;
          display: flex;
          .part-content{
            width: 50%;
            display: flex;
            justify-content: flex-start;
            font-size: 16px;
            line-height: 30px;
            opacity: 0.9;
          }
        }
      }
    }
  }
  .statistics-button{
    position: absolute;
    right: -26px;
    top:82px;
    width: 26px;
    height: 57px;
    background:url("../../../assets/imgs/mainPage/left_small.png") no-repeat;
    background-size: 100% 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    .button-img{
      width: 9px;
      height: 26px;

    }
  }
}
.inShow{
  transition-property: transform;
  transition-duration:1s;
}
.outShow{
  transition-property: transform;
  transition-duration:1s;
  transform: translateX(-510px);
}
</style>
