Newer
Older
securityFront / src / views / ctrl / statCharts / inOutToday.vue
<template>
  <ve-ring :data="chartData" :settings="settings" />
</template>

<script>
import { inOutToday } from '@/api/statistics'

export default {
  name: 'InOutToday',
  data() {
    return {
      chartData: {
        columns: ['name', 'count'],
        rows: [
          { count: 4, name: '内部人员' },
          { count: 1, name: '来访人员' },
          { count: 2, name: '内部车辆' },
          { count: 1, name: '来访车辆' }
        ]
      },
      settings: {
        radius: [60, 100]
      }
    }
  },
  activated() {
    this.fetchData()
  },
  methods: {
    fetchData() {
      inOutToday().then(response => {
        if (response.code === 200) {
          if (response.data.length > 0) {
            this.chartData.rows = response.data
          }
        }
      })
    }
  }
}
</script>

<style scoped>

</style>