|
|
@@ -6,15 +6,7 @@
|
|
|
</div>
|
|
|
<el-row :gutter="16">
|
|
|
<el-col :xs="12" :sm="8" :md="4" v-for="(card, idx) in statCards" :key="idx">
|
|
|
- <div class="stat-card" :class="'stat-' + card.color">
|
|
|
- <div class="stat-icon-wrap">
|
|
|
- <i :class="card.icon"></i>
|
|
|
- </div>
|
|
|
- <div class="stat-body">
|
|
|
- <div class="stat-value">{{ card.value }}</div>
|
|
|
- <div class="stat-label">{{ card.label }}</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <StatCard :label="card.label" :value="card.value" :icon="card.icon" :color="card.color" />
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-card>
|
|
|
@@ -55,15 +47,7 @@
|
|
|
<!-- 流量分析区块 -->
|
|
|
<el-row :gutter="16" class="section-row">
|
|
|
<el-col :xs="24" :md="6" v-for="(card, idx) in visitCards" :key="idx">
|
|
|
- <el-card class="stat-card" shadow="never">
|
|
|
- <div class="stat-icon-wrap" :class="'visit-' + card.color">
|
|
|
- <i :class="card.icon"></i>
|
|
|
- </div>
|
|
|
- <div class="stat-body">
|
|
|
- <div class="stat-value">{{ card.value }}</div>
|
|
|
- <div class="stat-label">{{ card.label }}</div>
|
|
|
- </div>
|
|
|
- </el-card>
|
|
|
+ <StatCard :label="card.label" :value="card.value" :icon="card.icon" :color="card.color" />
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
@@ -144,13 +128,13 @@
|
|
|
<el-table-column prop="title" label="任务名称" min-width="160" show-overflow-tooltip />
|
|
|
<el-table-column prop="type" label="类型" width="80">
|
|
|
<template slot-scope="{ row }">
|
|
|
- <el-tag :type="taskTypeTag(row.type)" size="mini">{{ row.type }}</el-tag>
|
|
|
+ <StatusTag :type="taskTypeTag(row.type)" :text="row.type" size="mini" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="points" label="积分" width="60" />
|
|
|
<el-table-column prop="status" label="状态" width="80">
|
|
|
<template slot-scope="{ row }">
|
|
|
- <el-tag :type="taskStatusTag(row.status)" size="mini">{{ taskStatusLabel(row.status) }}</el-tag>
|
|
|
+ <StatusTag :type="taskStatusTag(row.status)" :text="taskStatusLabel(row.status)" size="mini" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="创建时间" width="150">
|
|
|
@@ -406,12 +390,12 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
taskTypeTag(type) {
|
|
|
- const map = { daily: '', weekly: 'success', challenge: 'warning', custom: 'info' }
|
|
|
- return map[type] || ''
|
|
|
+ const map = { daily: 'primary', weekly: 'success', challenge: 'warning', custom: 'info' }
|
|
|
+ return map[type] || 'primary'
|
|
|
},
|
|
|
taskStatusTag(status) {
|
|
|
- const map = { pending: 'warning', approved: 'success', completed: '', rejected: 'danger' }
|
|
|
- return map[status] || 'info'
|
|
|
+ const map = { pending: 'warning', approved: 'success', completed: 'primary', rejected: 'danger' }
|
|
|
+ return map[status] || 'primary'
|
|
|
},
|
|
|
taskStatusLabel(status) {
|
|
|
const map = { pending: '待审核', approved: '已通过', completed: '已完成', rejected: '已拒绝' }
|
|
|
@@ -434,29 +418,6 @@ export default {
|
|
|
.section-card { margin-bottom: 0; }
|
|
|
.card-header { font-weight: 600; font-size: 15px; color: var(--adm-text-88); }
|
|
|
.card-header i { margin-right: 6px; }
|
|
|
-.stat-card {
|
|
|
- display: flex; align-items: center; padding: 16px 12px;
|
|
|
- background: var(--adm-bg-container); border-radius: 8px; border: 1px solid var(--adm-border-split);
|
|
|
- transition: all 0.25s ease; margin-bottom: 12px;
|
|
|
-}
|
|
|
-.stat-card:hover {
|
|
|
- transform: translateY(-2px);
|
|
|
- box-shadow: 0 4px 12px rgba(0,0,0,0.08);
|
|
|
-}
|
|
|
-.stat-icon-wrap {
|
|
|
- width: 44px; height: 44px; border-radius: 10px;
|
|
|
- display: flex; align-items: center; justify-content: center;
|
|
|
- font-size: 22px; margin-right: 12px; flex-shrink: 0;
|
|
|
-}
|
|
|
-.stat-orange .stat-icon-wrap { background: #FEF3C7; color: #F97316; }
|
|
|
-.stat-blue .stat-icon-wrap { background: #DBEAFE; color: var(--adm-primary); }
|
|
|
-.stat-cyan .stat-icon-wrap { background: #CFFAFE; color: #06B6D4; }
|
|
|
-.stat-green .stat-icon-wrap { background: #D1FAE5; color: var(--adm-success); }
|
|
|
-.stat-red .stat-icon-wrap { background: #FEE2E2; color: var(--adm-error); }
|
|
|
-.stat-purple .stat-icon-wrap { background: #EDE9FE; color: var(--adm-primary); }
|
|
|
-.stat-body { flex: 1; min-width: 0; }
|
|
|
-.stat-value { font-size: 24px; font-weight: 700; color: var(--adm-text-88); line-height: 1.2; }
|
|
|
-.stat-label { font-size: 13px; color: var(--adm-text-45); margin-top: 2px; }
|
|
|
.chart-card { min-height: 320px; }
|
|
|
.echarts-container { height: 260px; width: 100%; }
|
|
|
.revenue-card { min-height: 140px; }
|
|
|
@@ -488,8 +449,6 @@ export default {
|
|
|
.hot-empty { text-align: center; color: var(--adm-text-45); padding: 20px 0; font-size: 13px; }
|
|
|
@media (max-width: 768px) {
|
|
|
.dashboard-container { padding: 12px; }
|
|
|
- .stat-card { padding: 12px 10px; }
|
|
|
- .stat-value { font-size: 20px; }
|
|
|
.echarts-container { height: 200px; }
|
|
|
}
|
|
|
</style>
|