<template>
  <div class="full-width full-height block flex-center">
    <div class="flex box">
      <img class="ico1 ml-5" src="@/assets/biz-img/ico1.png" />
      <div class="ml-5 lin" />
      <div class="ml-5 block">
        <div class="title flex flex-center-between">
          <div class="ml-5">项目云累计项目数</div>
          <div class="mr-5">今日新增</div>
        </div>
        <div class="mt-5 flex flex-center-between">
          <div class="ml-5 bold number flex">
            {{ data.projectCount }}
            <div class="flex flex-center unit">个</div>
          </div>
          <div class="mr-5 bold xz-number flex">
            {{ data.todayAddProjectCount }}
            <div class="flex flex-center unit">个</div>
          </div>
        </div>
      </div>
    </div>
    <div class="flex box">
      <img class="ico1 ml-5" src="@/assets/biz-img/ico6.png" />
      <div class="ml-5 lin" />
      <div class="ml-5 block">
        <div class="title flex flex-center-between">
          <div class="ml-5">项目云累计任务数量</div>
          <div class="mr-5">今日完成</div>
        </div>
        <div class="mt-5 flex flex-center-between">
          <div class="ml-5 bold number flex">
            {{ data.taskCount }}
            <div class="flex flex-center unit">个</div>
          </div>
          <div class="mr-5 bold xz-number flex">
            {{ data.todayAddTaskCount }}
            <div class="flex flex-center unit">个</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      data: {
        projectCount: 112,
        todayAddProjectCount: 0,
        taskCount: 412,
        todayAddTaskCount: 6
      }
    }
  },
  mounted() {},
  created() {
    this.getProjectCount()
    this.timingAcquisition()
  },

  methods: {
    timingAcquisition() {
      setInterval(() => {
        this.getProjectCount()
      }, 90000)
    },
    getProjectCount() {
      this.$api.biz.getProjectCount().then(res => {
        if (res.code === 200) {
          this.data = res.data
        }
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.ico1 {
  height: 80px;
  width: 80px;
}
.lin {
  background: #258e9b;
  width: 5px;
  height: 70%;
  border-radius: 10px;
}
.box {
  align-items: center;
  border: 1px solid #1b6ad2;
  width: 90%;
  height: 35%;
  margin: 5%;
}
.title {
  width: 300px;
  height: 40px;
  color: white;
  background-size: 100% 100%;
  background-image: url('@/assets/biz-img/jb.png');
}
.number {
  font-size: 26px;
  color: #f3a845;
}
.xz-number {
  font-size: 26px;
  color: #05f1dd;
}
.unit {
  color: #3caaff;
  font-size: 20px;
  margin-left: 5px;
}
</style>
