<template>
  <moduleEnclosure title="近30天累计工单统计">
    <div class="all-container">
      <div class="table-container">
        <div class="th row">
          <div>订单类型</div>
          <div>数量</div>
          <div>占比</div>
        </div>
        <div class="td row">
          <div>累计安装台数</div>
          <div>{{ statsData.azgd || 0 }}</div>
          <div>{{ statsData.azgdzb || 0 }}%</div>
        </div>
        <div class="td row">
          <div>累计维修台数</div>
          <div>{{ statsData.wxgd || 0 }}</div>
          <div>{{ statsData.wxgdzb || 0 }}%</div>
        </div>
        <div class="td row">
          <div>累计清洗台数</div>
          <div>{{ statsData.qxgd || 0 }}</div>
          <div>{{ statsData.qxgdzb || 0 }}%</div>
        </div>
        <!-- <div class="td row">
          <div>增值服务工单</div>
          <div>{{ statsData.zzgd || 0 }}</div>
          <div>{{ statsData.zzgdzb || 0 }}%</div>
        </div>
        <div class="td row">
          <div>维保工程工单</div>
          <div>{{ statsData.wbgd || 0 }}</div>
          <div>{{ statsData.wbgdzb || 0 }}%</div>
        </div> -->
      </div>
    </div>
  </moduleEnclosure>
</template>

<script>
import moduleEnclosure from '@/components/moduleEnclosure.vue'
import { getWorkorderStats } from '@/api/bigView.js'

export default {
  components: {
    moduleEnclosure
  },
  data() {
    return {
      statsData: {}
    }
  },

  mounted() {
    this.getData()
  },

  beforeUnmount() {},

  methods: {
    getData() {
      getWorkorderStats().then(res => {
        this.statsData = res.data
      })
    }
  }
}
</script>

<style scoped lang="scss">
.all-container {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding-top: 12px;
  position: relative;
}
.table-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  .row {
    display: flex;
    align-items: center;
    &.th {
      font-weight: bold;
      color: #26a3ce;
    }
    &.td {
      color: #ffffff;
      div:last-child {
        color: #e4f824;
      }
      div:nth-child(1) {
        font-size: 12px;
      }
    }
    div {
      flex: 1;
      font-size: 14px;
      &:nth-child(2) {
        text-align: center;
      }
      &:nth-child(3) {
        text-align: right;
      }
    }
  }
}
</style>
