<!--
 * @Author: WangQiBiao
 * @Date: 2019-09-26 14:11:25
 * @LastEditors: MoZhuangRu
 * @LastEditTime: 2020-01-14 09:31:12
 * @Description:
 -->
<template>
  <div class="record">
    <div class="list">
      <div class="list-item shebei">
        <div class="logoWrp">
          <img class="list-item-logo" src="./images/2_ditu@3x.png" alt="">
          <img class="list-item-icon" src="./images/2_shb@3x.png" alt="">
        </div>
        <div class="list-item-desc">
          <span>{{equipment | numberFormat}}</span>
          <span class="desc-tips">次</span>
        </div>
        <div class="list-item-txt">设备巡检</div>
      </div>
      <div class="list-item anfang">
        <div class="logoWrp">
          <img class="list-item-logo" src="./images/2_ditu@3x.png" alt="">
          <img class="list-item-icon" src="./images/2_baoan@3x.png" alt="">
        </div>
        <div class="list-item-desc">
          <span>{{security | numberFormat}}</span>
          <span class="desc-tips">次</span>
        </div>
        <div class="list-item-txt">安防巡逻</div>
      </div>
      <div class="list-item baojie">
        <div class="logoWrp">
          <img class="list-item-logo" src="./images/2_ditu@3x.png" alt="">
          <img class="list-item-icon" src="./images/2_baojie@3x.png" alt="">
        </div>
        <div class="list-item-desc">
          <span>{{cleaning | numberFormat}}</span>
          <span class="desc-tips">次</span>
        </div>
        <div class="list-item-txt">保洁登记</div>
      </div>
      <div class="list-item renwu">
        <div class="logoWrp">
          <img class="list-item-logo" src="./images/2_ditu@3x.png" alt="">
          <img class="list-item-icon" src="./images/2_renwu@3x.png" alt="">
        </div>
        <div class="list-item-desc">
          <span>{{taskExecution | numberFormat}}</span>
          <span class="desc-tips">次</span>
        </div>
        <div class="list-item-txt">任务执行</div>
      </div>
    </div>
  </div>
</template>
<script>
import { api } from '@/api'

export default {
  data () {
    return {
      equipment: '',
      security: '',
      cleaning: '',
      taskExecution: ''
    }
  },
  mounted () {
    this.getAssetInfo()
  },
  methods: {
    getAssetInfo () {
      api.getAssetInfo().then(res => {
        res.data.data.forEach(item => {
          this[item.type] = item.total
        })
      })
    }
  }
}
</script>
<style lang="scss" scoped>
@import './index.scss';
</style>
