|
|
@@ -20,9 +20,9 @@
|
|
|
|
|
|
<el-alert v-if="dashboardError" class="dashboard-error" :title="dashboardError" type="error" show-icon :closable="false"><el-button link type="primary" @click="load">重新加载</el-button></el-alert>
|
|
|
<div v-loading="dashboardLoading" class="chart-grid">
|
|
|
- <el-card shadow="never" class="water-panel trend-card"><template #header><div class="card-title"><span>报警趋势</span><span class="muted">近 {{ trendDays }} 天 · 四级报警</span></div></template><div ref="trendRef" class="chart" /></el-card>
|
|
|
- <el-card shadow="never" class="water-panel"><template #header><div class="card-title">报警分类占比</div></template><div ref="warningRef" class="chart chart--small" /></el-card>
|
|
|
- <el-card shadow="never" class="water-panel"><template #header><div class="card-title">设备分类占比</div></template><div ref="deviceRef" class="chart chart--small" /></el-card>
|
|
|
+ <el-card shadow="never" class="water-panel chart-card trend-card"><template #header><div class="card-title"><el-icon><TrendCharts /></el-icon><span>报警趋势</span><span class="muted chart-caption">近 {{ trendDays }} 天 · 四级报警</span></div></template><div ref="trendRef" class="chart" /></el-card>
|
|
|
+ <el-card shadow="never" class="water-panel chart-card"><template #header><div class="card-title"><el-icon><PieChart /></el-icon><span>报警分类占比</span></div></template><div ref="warningRef" class="chart chart--small" /></el-card>
|
|
|
+ <el-card shadow="never" class="water-panel chart-card"><template #header><div class="card-title"><el-icon><DataAnalysis /></el-icon><span>设备分类占比</span></div></template><div ref="deviceRef" class="chart chart--small" /></el-card>
|
|
|
</div>
|
|
|
|
|
|
<el-card shadow="never" class="filter-card water-panel"><template #header><div class="card-title"><el-icon><Search /></el-icon><span>报警台账筛选</span></div></template>
|
|
|
@@ -61,7 +61,7 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { computed, nextTick, onBeforeUnmount, onMounted, ref } from 'vue'
|
|
|
-import { BellFilled, Download, List, Monitor, Refresh, RefreshLeft, Search, View } from '@element-plus/icons-vue'
|
|
|
+import { BellFilled, DataAnalysis, Download, List, Monitor, PieChart, Refresh, RefreshLeft, Search, TrendCharts, View } from '@element-plus/icons-vue'
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
import { saveAs } from 'file-saver'
|
|
|
import * as echarts from 'echarts'
|
|
|
@@ -168,20 +168,70 @@ onBeforeUnmount(() => { ++loadGeneration; window.removeEventListener('resize', r
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
-.water-page { min-height: calc(100vh - 84px); padding: 20px; color: #1e293b; background: #f3f7fb; }
|
|
|
-.page-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:16px; }
|
|
|
-.page-title { display:flex; align-items:center; gap:12px; }
|
|
|
-.page-title-icon { display:grid; place-items:center; width:42px; height:42px; border-radius:8px; color:#fff; background:#2563eb; }
|
|
|
-.page-heading h2 { margin:0 0 4px; color:#172b4d; font-size:20px; }
|
|
|
-.heading-actions { display:flex; gap:8px; }
|
|
|
-.muted { color:#718096; font-size:13px; }
|
|
|
-.metric-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-bottom:16px; }
|
|
|
-.metric { display:flex; align-items:center; gap:12px; min-height:74px; padding:14px 16px; background:#fff; border:1px solid #e1ebf3; border-radius:8px; box-shadow:0 5px 16px rgba(28,75,110,.05); }
|
|
|
-.metric-icon { display:grid; place-items:center; flex:0 0 40px; width:40px; height:40px; border-radius:8px; font-size:20px; }
|
|
|
-.tone-blue { color:#2563eb; background:#e6f4ff; }.tone-orange { color:#d97706; background:#fff7ed; }.tone-cyan { color:#0891b2; background:#ecfeff; }.tone-green { color:#16a34a; background:#f0fdf4; }.tone-red { color:#dc2626; background:#fff1f2; }
|
|
|
-.metric-body { min-width:0; }.metric-body span { display:block; color:#718096; font-size:13px; }.metric-value { display:flex; align-items:baseline; gap:5px; }.metric-value strong { color:#17324d; font-size:24px; }.metric-value small { color:#94a3b8; }
|
|
|
-.chart-grid { display:grid; grid-template-columns:minmax(0,2fr) minmax(260px,1fr) minmax(260px,1fr); gap:12px; margin-bottom:16px; }.water-panel { overflow:hidden; border:1px solid #e1ebf3; border-radius:8px; box-shadow:0 5px 16px rgba(28,75,110,.05); }.chart { height:300px; }.chart--small { height:300px; }.trend-card :deep(.el-card__header), .water-panel :deep(.el-card__header) { padding:14px 16px; }.card-title { display:flex; align-items:center; justify-content:space-between; gap:8px; color:#17324d; font-weight:600; }
|
|
|
-.dashboard-error { margin-bottom:16px; }.filter-card { margin-bottom:16px; }.filter-card :deep(.el-form-item) { margin-top:8px; margin-bottom:8px; }.table-card :deep(.el-table) { --el-table-header-bg-color:#f8fafc; --el-table-row-hover-bg-color:#eff6ff; }.table-card :deep(.el-pagination) { justify-content:flex-end; margin-top:16px; }.table-toolbar { display:flex; justify-content:space-between; align-items:center; }
|
|
|
-@media (max-width:1000px) { .metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }.chart-grid { grid-template-columns:1fr; } }
|
|
|
-@media (max-width:650px) { .page-heading { align-items:flex-start; flex-direction:column; }.metric-grid { grid-template-columns:1fr; }.heading-actions { width:100%; }.heading-actions .el-button { flex:1; } }
|
|
|
+/* 仅在报警页作用域内复用管网数据统计分析的蓝白卡片语言,避免影响其他供水页面。 */
|
|
|
+.water-page {
|
|
|
+ min-height: calc(100vh - 84px);
|
|
|
+ padding: 20px;
|
|
|
+ color: #1e293b;
|
|
|
+ background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 45%, #eef2f7 100%);
|
|
|
+}
|
|
|
+.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
|
|
|
+.page-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
|
|
|
+.page-title-icon {
|
|
|
+ display: grid; place-items: center; flex: 0 0 42px;
|
|
|
+ width: 42px; height: 42px; border-radius: 8px; color: #fff;
|
|
|
+ background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
|
|
|
+ box-shadow: 0 8px 16px rgba(37, 99, 235, 0.2);
|
|
|
+}
|
|
|
+.page-heading h2 { margin: 0 0 4px; font-size: 20px; color: #1e293b; }
|
|
|
+.heading-actions { display: flex; align-items: center; gap: 12px; }
|
|
|
+.muted { color: #64748b; font-size: 13px; }
|
|
|
+
|
|
|
+.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
|
|
|
+.metric {
|
|
|
+ position: static; display: flex; align-items: center; gap: 14px;
|
|
|
+ min-width: 0; padding: 16px 18px; background: #fff;
|
|
|
+ border: 1px solid #e2e8f0; border-radius: 8px;
|
|
|
+ box-shadow: 0 6px 14px rgba(15, 23, 42, 0.04);
|
|
|
+}
|
|
|
+.metric-icon {
|
|
|
+ position: static; top: auto; left: auto; flex: 0 0 42px;
|
|
|
+ display: grid; place-items: center; width: 42px; height: 42px;
|
|
|
+ border-radius: 8px; font-size: 22px;
|
|
|
+}
|
|
|
+.tone-blue { color: #2563eb; background: linear-gradient(135deg, #dbeafe, #eff6ff); }
|
|
|
+.tone-red { color: #dc2626; background: linear-gradient(135deg, #fee2e2, #fff1f2); }
|
|
|
+.metric-body { min-width: 0; }
|
|
|
+.metric-body span { display: block; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #64748b; font-size: 13px; }
|
|
|
+.metric-value { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
|
|
|
+.metric-value strong { color: #1e293b; font-size: 24px; line-height: 1.2; }
|
|
|
+.metric-value small { margin-left: 0; color: #94a3b8; }
|
|
|
+
|
|
|
+.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
|
|
|
+.trend-card { grid-column: 1 / -1; }
|
|
|
+.water-panel { overflow: hidden; border: 1px solid #e2e8f0; border-radius: 8px; box-shadow: 0 6px 14px rgba(15, 23, 42, 0.04); }
|
|
|
+.chart { height: 320px; }
|
|
|
+.card-title { display: flex; align-items: center; justify-content: flex-start; gap: 8px; color: #1e293b; font-weight: 600; }
|
|
|
+.card-title .el-icon { color: #2563eb; font-size: 18px; }
|
|
|
+.chart-caption { margin-left: auto; font-weight: 400; }
|
|
|
+.chart-card :deep(.el-card__header), .filter-card :deep(.el-card__header), .table-card :deep(.el-card__header) {
|
|
|
+ padding: 14px 18px; border-bottom: 1px solid #e2e8f0;
|
|
|
+}
|
|
|
+.filter-card :deep(.el-card__header) { background: #fbfdff; }
|
|
|
+.dashboard-error, .filter-card { margin-bottom: 16px; }
|
|
|
+.filter-card :deep(.el-form-item) { margin: 8px 16px 8px 0; }
|
|
|
+.filter-card :deep(.el-form-item__label) { color: #475569; }
|
|
|
+.table-card :deep(.el-card__body) { padding-top: 0; }
|
|
|
+.table-card :deep(.el-table) { --el-table-border-color: #e2e8f0; --el-table-header-bg-color: #f8fafc; --el-table-header-text-color: #475569; --el-table-row-hover-bg-color: #eff6ff; }
|
|
|
+.table-card :deep(.el-pagination) { justify-content: flex-end; margin-top: 16px; }
|
|
|
+.table-toolbar { display: flex; align-items: center; gap: 10px; }
|
|
|
+@media (max-width: 1000px) { .chart-grid { grid-template-columns: 1fr; } }
|
|
|
+@media (max-width: 650px) {
|
|
|
+ .water-page { padding: 12px; }
|
|
|
+ .page-heading { align-items: flex-start; flex-direction: column; }
|
|
|
+ .metric-grid { grid-template-columns: 1fr; }
|
|
|
+ .heading-actions { width: 100%; }
|
|
|
+ .heading-actions .el-button { flex: 1; }
|
|
|
+ .chart-caption { margin-left: 0; }
|
|
|
+}
|
|
|
</style>
|