<template>
  <div>
    <titlesection title="今日车流量"></titlesection>
    <lineChart :chart-data="lineChartData" class="flexfm inout-wrap" >
    </lineChart>
  </div>
</template>

<script>
import titlesection from '../components/titlesection'
import lineChart from '../components/lineChart'
import { dayAddress } from '../api/api'

export default {
  name: 'vehiclesection',
  components: {
    titlesection,
    lineChart
  },
  data() {
    return {
      lineChartData: {},
      dzNum: '23454',
      ydpNum: '4454'
    }
  },
  created() {
    this.getList()
  },
  methods: {
    getList() {
      dayAddress({
        orgIds: this.GLOBAL.paramsvariables
      }).then((response)=>{
        const data = response.data.data
        let xData = [], indata = [], outdata = []
        for (let i=0;i<data.length;i++){
          xData.push(data[i].queryDate)
          indata.push(data[i].inNum)
          outdata.push(data[i].outNum)
        }
        this.lineChartData = {
          xData: xData,
          yData: {
            indata:indata,
            outdata:outdata,
          },
          legendData: ['出场','进场']
        }
      })
    },
  }
}
</script>

<style lang="scss"  scoped>
  .inout-wrap{
    display: flex;

  }
</style>
