<template>
  <div class="app-container home">
    <el-row :gutter="20" class="title">
      文件分发平台
    </el-row>
    <el-divider/>
    <el-card shadow="hover" :style="{ height: '80px' }">
      <el-row :gutter="20" align="middle">
        <!-- 我的文件 -->
        <el-col :span="6" style="display: flex; justify-content: center; align-items: center">
          <el-statistic :value="fileNumber">
            <template #title>
              <div style="display: inline-flex; align-items: center">
                <span style="font-weight: bold; font-size: 20px;">我的文件</span>
              </div>
            </template>
          </el-statistic>
        </el-col>
        <!-- 我的推送 -->
        <el-col :span="6" style="display: flex; justify-content: center; align-items: center">
          <el-statistic :value="pushNumber">
            <template #title>
              <div style="display: inline-flex; align-items: center">
                <span style="font-weight: bold; font-size: 20px;">我的推送</span>
              </div>
            </template>
          </el-statistic>
        </el-col>
        <!-- 我的接收 -->
        <el-col :span="6" style="display: flex; justify-content: center; align-items: center">
          <el-statistic :value="receiveNumber">
            <template #title>
              <div style="display: inline-flex; align-items: center">
                <span style="font-weight: bold; font-size: 20px;">我的接收</span>
              </div>
            </template>
          </el-statistic>
        </el-col>
        <!-- 未读推送 -->
        <el-col :span="6" style="display: flex; justify-content: center; align-items: center">
          <el-statistic :value="unreadNumber">
            <template #title>
              <div style="display: inline-flex; align-items: center">
                <span style="font-weight: bold; font-size: 20px;">未读接收</span>
              </div>
            </template>
          </el-statistic>
        </el-col>
      </el-row>
    </el-card>
  </div>
</template>

<script>
import {listInfo, numberCount} from "@/api/iit/file";

export default {
  name: "Index",
  data() {
    return {
      // 版本号
      version: "3.8.9",
      fileNumber: null,
      pushNumber: null,
      receiveNumber: null,
      unreadNumber: null
    };
  },
  methods: {
    getNumberCount() {
      numberCount().then(response => {
        this.fileNumber = response.data.fileNumber;
        this.pushNumber = response.data.pushNumber;
        this.receiveNumber = response.data.receiveNumber;
        this.unreadNumber = response.data.unreadNumber;
      });
    },
    goTarget(href) {
      window.open(href, "_blank");
    }
  },
  created() {
    this.getNumberCount();
  }
};
</script>

<style scoped lang="scss">
.home {
  blockquote {
    padding: 10px 20px;
    margin: 0 0 20px;
    font-size: 17.5px;
    border-left: 5px solid #eee;
  }
  hr {
    margin-top: 20px;
    margin-bottom: 20px;
    border: 0;
    border-top: 1px solid #eee;
  }
  .col-item {
    margin-bottom: 20px;
  }

  ul {
    padding: 0;
    margin: 0;
  }

  font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  color: #676a6c;
  overflow-x: hidden;

  ul {
    list-style-type: none;
  }

  h4 {
    margin-top: 0px;
  }

  h2 {
    margin-top: 10px;
    font-size: 26px;
    font-weight: 100;
  }

  p {
    margin-top: 10px;

    b {
      font-weight: 700;
    }
  }

  .update-log {
    ol {
      display: block;
      list-style-type: decimal;
      margin-block-start: 1em;
      margin-block-end: 1em;
      margin-inline-start: 0;
      margin-inline-end: 0;
      padding-inline-start: 40px;
    }
  }
}
.title {
  text-align: center; /* 居中 */
  font-size: 24px; /* 增大字体 */
  font-weight: bold; /* 加粗 */
}
</style>

