|
@@ -1,21 +1,49 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
- <div>
|
|
|
- <span>欢迎 【{{ userInfo.userName || 'undefind' }}】 进入管理系统</span>
|
|
|
-
|
|
|
- <!-- 阿里巴巴云的新增图标使用 -->
|
|
|
- <icon-font class="iconFont" type="icon-lunwentimu" />
|
|
|
- </div>
|
|
|
+ <a-spin :spinning="loading">
|
|
|
+ <!-- 基础数据展示 -->
|
|
|
+ <div class="count-basic-data">
|
|
|
+ <div
|
|
|
+ class="count-basic-data-item"
|
|
|
+ v-for="(item, index) in basicList"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ <div class="count-basic-data-item-main">
|
|
|
+ <div class="count-basic-data-item-title">{{ item.title }}</div>
|
|
|
+ <div class="count-basic-data-item-count">
|
|
|
+ {{ item.count | formatNumberToDollar }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="count-basic-data-item-up">
|
|
|
+ <div class="count-basic-data-item-title">{{ item.upTitle }}</div>
|
|
|
+ <div class="count-basic-data-item-up-count">
|
|
|
+ {{ item.monthUp | formatNumberToDollar }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 柱状图 -->
|
|
|
+ <div class="common-card a-card-margin-top">
|
|
|
+ <EchartsBar :barData="barData" width="100%" height="400px" />
|
|
|
+ </div>
|
|
|
+ </a-spin>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { mapGetters } from 'vuex';
|
|
|
+import EchartsBar from '@/components/echarts/EchartsBar';
|
|
|
export default {
|
|
|
props: {},
|
|
|
- components: {},
|
|
|
+ components: {
|
|
|
+ EchartsBar,
|
|
|
+ },
|
|
|
data() {
|
|
|
- return {};
|
|
|
+ return {
|
|
|
+ loading: false, // 是否显示加载动画
|
|
|
+ basicList: [], // 基础数据列表
|
|
|
+ barData: [], // 统计图数据
|
|
|
+ };
|
|
|
},
|
|
|
created() {
|
|
|
this.initDataFun(); // 初始化数据
|
|
@@ -28,17 +56,89 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
// 初始化数据
|
|
|
- initDataFun() {},
|
|
|
+ initDataFun() {
|
|
|
+ this.basicList = [
|
|
|
+ {
|
|
|
+ title: '文章总数',
|
|
|
+ count: 126560,
|
|
|
+ upTitle: '本月新增',
|
|
|
+ monthUp: 160,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '题目总数',
|
|
|
+ count: 126560,
|
|
|
+ upTitle: '本月新增',
|
|
|
+ monthUp: 160,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '考试总数',
|
|
|
+ count: 126560,
|
|
|
+ upTitle: '本月新增',
|
|
|
+ monthUp: 160,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ this.barData = {
|
|
|
+ xAxis: {
|
|
|
+ data: ['期中考试', '期末考试', '7月', '8月', '9月', '10月'],
|
|
|
+ }, // x轴数据
|
|
|
+ series: {
|
|
|
+ name: ['期中考试', '期末考试', '7月', '8月', '9月', '10月'],
|
|
|
+ data: [1, 2, 3, 4, 5, 6],
|
|
|
+ }, // 移入提示数据
|
|
|
+ };
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
+@import '~@/styles/common/variable.less';
|
|
|
.app-container {
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- align-items: center;
|
|
|
- background-color: aliceblue;
|
|
|
- font-size: 60px;
|
|
|
+ overflow: auto;
|
|
|
+ .count-basic-data {
|
|
|
+ display: flex;
|
|
|
+ .count-basic-data-item {
|
|
|
+ width: 264px;
|
|
|
+ height: 188px;
|
|
|
+ margin-right: @paddingMarginVal;
|
|
|
+ padding: @paddingMarginVal;
|
|
|
+ background-color: @mainColorWhite;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-between;
|
|
|
+ .count-basic-data-item-title {
|
|
|
+ font-size: 14px;
|
|
|
+ color: @mainColorBlack45;
|
|
|
+ flex-wrap: nowrap;
|
|
|
+ white-space: nowrap;
|
|
|
+ }
|
|
|
+ .count-basic-data-item-main {
|
|
|
+ width: 100%;
|
|
|
+ .count-basic-data-item-title {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ .count-basic-data-item-count {
|
|
|
+ width: 100%;
|
|
|
+ font-size: 30px;
|
|
|
+ color: @mainColorBlack85;
|
|
|
+ word-break: break-all;
|
|
|
+ word-wrap: break-word;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .count-basic-data-item-up {
|
|
|
+ padding-top: 10px;
|
|
|
+ border-top: 1px solid @mainColorBorder;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ .count-basic-data-item-title {
|
|
|
+ margin-right: @paddingMarginVal;
|
|
|
+ }
|
|
|
+ .count-basic-data-item-up-count {
|
|
|
+ font-size: 20px;
|
|
|
+ color: @mainColorBlack85;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|