<template>
  <div class="full-w-h d-trafficIndex">
    <div class="indexI">
      服务水平：{{indexData.serviceLevel }}
    </div>
    <div class="indexI">
      平均运行速度：{{indexData.speed }}km/h
    </div>
    <div class="indexI">
      路口饱和度：{{indexData.sturation }}%
    </div>
    <div class="indexI">
      平均停车次数：{{indexData.crossStopTimes }}
    </div>
    <div class="indexI">
      小时流量：{{indexData.hourFlow  }}pcu/h
    </div>
    <div class="indexI">
      最大排队长度：{{indexData.crossQueueLength}}m
    </div>
  </div>
</template>

<script>
import {api_abnormalCrossDetail} from "@/common/api/homepageSignal";

export default {
  name:'trafficIndex',
  props:['crossData'],
  data(){
    return{
      indexData:{}
    }
  },
  computed:{
    crossId(){
      return this.crossData.id
    },
    crossName(){
      return this.crossData.name
    }
  },
  mounted(){
    this.getData()
  },
  methods:{
    getData(){
      api_abnormalCrossDetail({crossId:this.crossId}).then(res=>{
        console.log('交通指标',res)
        this.indexData = res.data.content
      })
    }
  }

}
</script>

<style lang="less" scoped>
.d-trafficIndex{
  display: flex;
  flex-wrap: wrap;
  font-size: 14px;
  padding-left: 20px;
  color: rgba(169, 194, 216, 1);
  .indexI{
    width: 50%;
    height: 33.3%;
    display: flex;
    align-items: center;
  }
}
</style>