<template>
  <el-alert title="任务统计" type="info" v-loading="loading">
    今日完成：{{ brief.task.todayCompleted | dv }}
  </el-alert>
</template>

<script>
import { getBrief } from '@/api/dashboard/dashboard'
import { BriefKeys } from '@/utils/enums'

export default {
  name: 'TaskStatistics',
  data() {
    return {
      loading: false,
      brief: {
        task: {}
      }
    }
  },
  created() {
    this.getBrief()
  },
  methods: {
    getBrief() {
      this.loading = true
      getBrief({ keys: [
        BriefKeys.TASK_TODAY_COMPLETED,
      ]}).then(res => {
        if (res.code === 200 && res.data) {
          this.brief = res.data
        }
      }).finally(() => {
        this.loading = false
      })
    }
  }
}
</script>

<style lang="scss" scoped>

</style>