WXL
2026-09-17 3df460667d74868d0a54fce12d5e881bbd6c0c1a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<!-- src/views/statistics/index.vue -->
<template>
  <div class="statistics-home">
    <el-card class="mode-card" shadow="never">
      <div class="mode-bar">
        <span class="mode-label">统计数据源:</span>
        <el-switch
          v-model="useMock"
          active-text="模拟数据"
          inactive-text="真实接口"
          active-color="#E6A23C"
          inactive-color="#409EFF"
          @change="handleModeChange"
        />
        <span class="mode-tip">切换后进入各统计页面生效(模拟数据用于演示,真实接口读取后端)</span>
      </div>
    </el-card>
 
    <el-row :gutter="20">
      <el-col :span="6" v-for="item in menuList" :key="item.path">
        <el-card
          class="stat-card"
          shadow="hover"
          @click.native="goToPage(item.path)"
        >
          <div class="card-content">
            <div class="card-icon" :style="{ backgroundColor: item.color }">
              <i :class="item.icon"></i>
            </div>
            <div class="card-info">
              <h3>{{ item.title }}</h3>
              <p>{{ item.desc }}</p>
            </div>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>
 
<script>
import { isStatisticsMock, setStatisticsMock } from '@/utils/statisticsMode';
 
export default {
  name: 'StatisticsHome',
  data() {
    return {
      useMock: isStatisticsMock(),
      menuList: [
        {
          title: '案例统计',
          desc: '地区、月份维度的案例统计分析',
          icon: 'el-icon-s-data',
          color: '#409EFF',
          path: '/statics/caseStatistics'
        },
        {
          title: '捐献器官统计',
          desc: '器官获取、移植数量统计',
          icon: 'el-icon-s-claim',
          color: '#67C23A',
          path: '/statics/organstatistics'
        },
        {
          title: '获取率统计',
          desc: '捐献获取率、器官弃用率分析',
          icon: 'el-icon-s-flag',
          color: '#E6A23C',
          path: '/statics/statisticsStatistics'
        },
        {
          title: '捐献意愿统计',
          desc: '捐献意愿趋势与分布分析',
          icon: 'el-icon-star-on',
          color: '#F56C6C',
          path: '/statics/donorstatistics'
        },
        {
          title: '捐献者分析',
          desc: '多维度捐献者特征分析',
          icon: 'el-icon-user',
          color: '#909399',
          path: '/statistics/donor'
        },
        {
          title: '器官获取利用',
          desc: '器官获取利用效率分析',
          icon: 'el-icon-setting',
          color: '#9966CC',
          path: '/statistics/utilization'
        }
      ]
    };
  },
  methods: {
    handleModeChange(val) {
      setStatisticsMock(val);
    },
    goToPage(path) {
      this.$router.push(path);
    }
  }
};
</script>
 
<style scoped>
.statistics-home {
  padding: 20px;
}
 
.mode-card {
  margin-bottom: 20px;
}
 
.mode-bar {
  display: flex;
  align-items: center;
}
 
.mode-label {
  font-size: 14px;
  color: #303133;
  margin-right: 10px;
}
 
.mode-tip {
  margin-left: 16px;
  font-size: 12px;
  color: #909399;
}
 
.stat-card {
  cursor: pointer;
  margin-bottom: 20px;
  transition: all 0.3s;
}
 
.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}
 
.card-content {
  display: flex;
  align-items: center;
  padding: 10px 0;
}
 
.card-icon {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20px;
}
 
.card-icon i {
  font-size: 30px;
  color: white;
}
 
.card-info h3 {
  margin: 0 0 8px 0;
  color: #303133;
  font-size: 18px;
}
 
.card-info p {
  margin: 0;
  color: #909399;
  font-size: 13px;
  line-height: 1.5;
}
</style>