<template>
  <div>
      <div class="col-sm-12 " style="height: 100%;margin-left: 1%">
        <div class="background-content-img scade-box col-sm-12 col-md-12" >
          <div class="flex-row">
            <div class="flex col-sm-4" style="padding-left: 5%; padding-top: 4%;" >
              <div class="flex">
                <div class="flex-row"> <span class="font-14-medium">总管网公里数</span></div>
                <div class="flex-row">  <p style="color:#8969ff"><span class="scada-font-title">{{ mileageItems.total }}</span></p></div>
              </div>
              <div class="flex">
                <div class="flex-row"> <span class="font-14-medium">中压管网公里数</span></div>
                <div class="flex-row"> <p style="color:#00f6ff"><span class="scada-font-title">{{ mileageItems.zy }}</span></p></div>
              </div>

            </div>
            <div class="flex col-sm-4" style="padding-left: 5%; padding-top: 4%;" >
              <div class="flex">
                <div class="flex-row"> <span class="font-14-medium">高压管网公里数</span></div>
                <p style="color:#f27c79"><span class="scada-font-title">{{ mileageItems.gy }}</span></p>
              </div>
              <div class="flex">
                <!--                <div class="flex-row"> <span class="font-14-medium">总管网公里数</span></div>-->
                <!--                <div class="flex-row">  <p style="color:#8969ff"><span class="scada-font-title">{{ mileageItems.total }}</span></p></div>-->
              </div>

            </div>
            <div class="flex col-sm-4" style="padding-left: 5%; padding-top: 4%;" >
              <div class="flex">
                <div class="flex-row"> <span class="font-14-medium">次高压管网公里数</span></div>
                <div class="flex-row"><p style="color:#d5a329"><span class="scada-font-title">{{ mileageItems.cgy }}</span></p></div>
              </div>
              <div class="flex">
                <div class="flex-row"> <span class="font-14-medium">低压管网公里数</span></div>
                <div class="flex-row"><p style="color:#0a9aff"><span class="scada-font-title">{{ mileageItems.dy }}</span></p></div>
              </div>

            </div>
          </div>
        </div>
        <div class="col-sm-12  content-box" style="height: 48%;margin: 1%;width:95%">
          <div class="flex-row scada-title" style="border:1px solid #227ad8;height: 12%" >
            <span class="font-14-medium1 flex-2">时间</span>
            <span class="font-14-medium1 flex-2">截止当前月年销气量(万方)</span>
            <span class="font-14-medium1 flex-2">同比</span>
          </div>
          <div class="flex-row scada-title" style="background:rgba(1,44,69,1)" v-for="item in items">
            <span  class="font-16 flex-1">{{item.ssn}}</span>
            <span  class="font-16 flex-1">{{item.sbsjfl}}</span>
            <span  class="font-16 flex-1">{{item.tb}}%</span>
          </div>
        </div>
      </div>
  </div>
</template>
<script>
import {HttpResetClass} from 'vue-client'
export default {
  name: 'scada',
  data () {
    return {
      items:[],
      mileageItems:{}
    }
  },
  methods: {
    async getdata(){
      let http = new HttpResetClass()
      await http.load('post','api/af-revenue/sql/getDapingSalesVolumeTable',{data:{}},{rejectMsg: null, resolveMsg: null}).then((res)=>{
        console.log('往期同比~~~~~~~~~~~~~~~',res)
        this.items = res.data
      })
      await http.load('post','api/af-revenue/sql/getDapingPipeNetwork',{data:{}},{rejectMsg: null, resolveMsg: null}).then((res)=>{
        console.log('公里数~~~~~~~~~~~~~~~',res)
        console.log(res.data)
        let info = {
            gy :res.data[0].gy  ,
            total :res.data[0].total  ,
            cgy :res.data[0].cgy  ,
            dy :res.data[0].dy ,
            zy :res.data[0].zy
        }
        console.log(info)
        this.mileageItems= info
        console.log(this.mileageItems)

      })
    }
  },
  ready () {
    this.getdata()
    // setInterval(this.getdata, 3600000)
    // let http = new HttpResetClass()
    // http.load('post','api/af-revenue/sql/getLargeScreen',{data:{}}).then((res)=>{
    //   this.items = res.data
    // })

  }
}
</script>

<style scoped>
@media screen and (max-width: 1920px) {
  .scada-title {
    justify-content: space-around;
    flex-direction: row;
    height: auto;
  }

  .scade-box {
    width: 95%;
    height: 40%;
    margin: inherit;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .scada-font-title {
    margin-right: 1em;
    font-family: tRends;
    font-size: 25px;
    font-weight: normal;
    font-stretch: normal;
    line-height: 30px;
    letter-spacing: 0px;
  }

  .font-14 {
    font-size: 14px;
    font-family: tRends;
  }

  .font-14-medium {
    color: #ffffff;
    line-height: 7px;
    font-size: 14px;
    font-family: font-pingfang-medium;
  }
  .font-14-medium1{
    color: #ffffff;
    line-height: 18px;
    font-size: 14px;
    font-family: font-pingfang-medium;
  }
  .font-16 {
    font-family: pFBold;
    font-size: 16px;
    font-weight: normal;
    font-stretch: normal;
    line-height: 30px;
    letter-spacing: 0px;
    color: #00f6ff;
  }

  .font-14 {
    font-size: 14px;
    color: white
  }

  .flex-1 {
    flex: 1;
    text-align: center;
  }

  .content-box {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
  }
}
@media screen and (max-width: 1440px) {
  .scada-title {
    justify-content: space-around;
    flex-direction: row;
    height: auto;
  }

  .scade-box {
    width: 95%;
    height: 40%;
    margin: inherit;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .scada-font-title {
    margin-right: 1em;
    font-family: tRends;
    font-size: 16px;
    font-weight: normal;
    font-stretch: normal;
    line-height: 30px;
    letter-spacing: 0px;
  }

  .font-14 {
    font-size: 12px;
    font-family: tRends;
  }

  .font-14-medium {
    color: #ffffff;
    line-height: 7px;
    font-size: 12px;
    font-family: font-pingfang-medium;
  }
  .font-14-medium1{
    color: #ffffff;
    line-height: 18px;
    font-size: 14px;
    font-family: font-pingfang-medium;
  }
  .font-16 {
    font-family: pFBold;
    font-size: 12px;
    font-weight: normal;
    font-stretch: normal;
    line-height: 30px;
    letter-spacing: 0px;
    color: #00f6ff;
  }

  .font-14 {
    font-size: 12px;
    color: white
  }

  .flex-1 {
    flex: 1;
    text-align: center;
  }

  .content-box {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
  }
}
</style>
