<template>
  <div class="content">
    <div class="content-left">
      <DataViewLeft />
    </div>
    <div class="content-center">
      <div class="quantity-overview">
        <div class="quantity-overview-item">
          <div>今日总查获数</div>
          <div style="font-size: 26px;">{{ infoNumber.total }}</div>
        </div>
        <div class="quantity-overview-item">
          <div>今日移交公安</div>
          <div style="font-size: 26px;">{{ infoNumber.policeTotal }}</div>
        </div>
        <div class="quantity-overview-item">
          <div>今日隐匿携带</div>
          <div style="font-size: 26px;">{{ infoNumber.concealTotal }}</div>
        </div>
      </div>
      <ChannelsAndPersonnel />
    </div>
    <div class="content-right">
      <ClassTaskCompletionRank />
      <DepartmentalTaskCompletionRank />
      <PersonalTaskCompletionRank />
    </div>
  </div>
</template>

<script setup>
import {
  DataViewLeft,
  ChannelsAndPersonnel,
  ClassTaskCompletionRank,
  DepartmentalTaskCompletionRank,
  PersonalTaskCompletionRank
} from '../pageItems';
import { getTotalSome } from '@/api/item/items'
import { onMounted } from 'vue';
import moment from 'moment'
import { useTimeOut } from '../pageItems/useTimeOut'
const infoNumber = ref({})
useTimeOut(() => {
  getTotalSome({
    startDate: moment().format('YYYY-MM-DD'),
    endDate: moment().format('YYYY-MM-DD'),
  }).then(res => {
    infoNumber.value = res.data
  })
})
</script>

<style lang="scss" scoped>
.content {
  display: flex;
  width: 100%;
  height: 100%;
  column-gap: 10px;
  overflow: hidden;

  .content-left {
    width: 30%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    &>*:nth-child(1) {
      width: 100%;
      height: 50%;
    }

    &>*:nth-child(2) {
      width: 100%;
      height: 50%;
    }

    &>*:nth-child(3) {
      width: 100%;
      height: 32%;
    }
  }

  .content-center {
    flex: 1;
    min-width: 780px;
    height: 100%;
    display: flex;
    flex-direction: column;
    row-gap: 10px;
    overflow: hidden;

    .public-inheritance-style {
      width: 100%;
      display: flex;
      column-gap: 10px;
    }

    .quantity-overview {
      @extend .public-inheritance-style;
      height: 140px;
      color: #fff;
      font-size: 20px;
      display: flex;
      column-gap: 25px;
      padding: 20px 20px 10px;
      box-sizing: border-box;

      .quantity-overview-item {
        flex: 1;
        height: 100%;
        background: #051E40;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        row-gap: 10px;
        border-radius: 5px;
        font-weight: bold;
      }
    }
  }

  .content-right {
    width: 30%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    &>*:nth-child(1) {
      width: 100%;
      height: 36%;
    }

    &>*:nth-child(2) {
      width: 100%;
      height: 32%;
    }

    &>*:nth-child(3) {
      width: 100%;
      height: 32%;
    }
  }
}
</style>