| | |
| | | <!-- 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 |
| | |
| | | </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: '/statistics/case' |
| | | path: '/statics/caseStatistics' |
| | | }, |
| | | { |
| | | title: '捐献器官统计', |
| | | desc: '器官获取、移植数量统计', |
| | | icon: 'el-icon-s-claim', |
| | | color: '#67C23A', |
| | | path: '/statistics/organ' |
| | | path: '/statics/organstatistics' |
| | | }, |
| | | { |
| | | title: '获取率统计', |
| | | desc: '捐献获取率、器官弃用率分析', |
| | | icon: 'el-icon-s-flag', |
| | | color: '#E6A23C', |
| | | path: '/statistics/rate' |
| | | path: '/statics/statisticsStatistics' |
| | | }, |
| | | { |
| | | title: '捐献意愿统计', |
| | | desc: '捐献意愿趋势与分布分析', |
| | | icon: 'el-icon-star-on', |
| | | color: '#F56C6C', |
| | | path: '/statistics/willingness' |
| | | path: '/statics/donorstatistics' |
| | | }, |
| | | { |
| | | title: '捐献者分析', |
| | |
| | | }; |
| | | }, |
| | | methods: { |
| | | handleModeChange(val) { |
| | | setStatisticsMock(val); |
| | | }, |
| | | goToPage(path) { |
| | | this.$router.push(path); |
| | | } |
| | |
| | | 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; |