From 17b92e9b60dda6dcc20c748046a5ff3c3958d52e Mon Sep 17 00:00:00 2001
From: wangrong <wangrong@shsening.com>
Date: 星期五, 28 八月 2026 16:19:11 +0800
Subject: [PATCH] 增加首页大屏显示
---
src/modules/report/views/screen/carbon.vue | 27 ++++++++++++++++-----------
1 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/src/modules/report/views/screen/carbon.vue b/src/modules/report/views/screen/carbon.vue
index 0d2b026..13110a8 100644
--- a/src/modules/report/views/screen/carbon.vue
+++ b/src/modules/report/views/screen/carbon.vue
@@ -2,18 +2,18 @@
<div class="screen-page">
<el-row :gutter="10" class="kpi-row">
<el-col v-for="item in kpis" :key="item.label" :lg="4" :sm="12" :xs="24">
- <kpi-card v-bind="item" />
+ <kpi-card v-bind="item" :demo="isDemoField(item.field)" />
</el-col>
</el-row>
<el-row :gutter="10" class="mid-row">
<el-col :lg="14" :xs="24">
- <panel-card title="纰冲噺鎺掕秼鍔�" sub="浠婃棩鐪嬭繎 7 鏃ワ紱骞磋鍥炬寜鏈堬紝鍏朵綑鎸夋棩">
+ <panel-card title="纰冲噺鎺掕秼鍔�" sub="浠婃棩鐪嬭繎 7 鏃ワ紱骞磋鍥炬寜鏈堬紝鍏朵綑鎸夋棩" :demo="carbonTrendDemo">
<v-chart :option="trendOption" autoresize class="chart" />
</panel-card>
</el-col>
<el-col :lg="10" :xs="24">
- <panel-card title="纰冲噺鎺掓潵婧�" sub="鎸夊彲鍥炴敹瀛愮被鎷嗗垎">
+ <panel-card title="纰冲噺鎺掓潵婧�" sub="鎸夊彲鍥炴敹瀛愮被鎷嗗垎" :demo="isDemoSection('recycleItems')">
<v-chart :option="sourceOption" autoresize class="chart" />
</panel-card>
</el-col>
@@ -21,7 +21,7 @@
<el-row :gutter="10">
<el-col :lg="16" :xs="24">
- <panel-card title="鏈勾搴︽湀搴︾⒊鍑忔帓" sub="鏃ヨ〃 carbonTotal 鍗曚綅 kgCO鈧俥锛屽睍绀烘椂 梅1000 涓哄惃">
+ <panel-card title="鏈勾搴︽湀搴︾⒊鍑忔帓" sub="鏃ヨ〃 carbonTotal 鍗曚綅 kgCO鈧俥锛屽睍绀烘椂 梅1000 涓哄惃" :demo="isDemoSection('yearCarbon')">
<v-chart :option="yearOption" autoresize class="chart" />
</panel-card>
</el-col>
@@ -47,20 +47,25 @@
import { computed } from 'vue';
import KpiCard from '../../components/kpi-card.vue';
import PanelCard from '../../components/panel-card.vue';
-import { useChartTheme, useScreenData } from '../../hooks/use-screen';
+import { useChartTheme, useScreenData, useScreenFieldSource } from '../../hooks/use-screen';
const { data, timeRange } = useScreenData();
+const { isDemoField, isDemoSection } = useScreenFieldSource();
const { textColor, mutedColor, splitColor, primary, baseGrid, axisStyle, tooltip } = useChartTheme();
const kpis = computed(() => [
- { label: '绱纰冲噺鎺�', value: data.value.kpis.totalCarbonTon, suffix: '鍚–O鈧俥', fixed: 1 },
- { label: '鏈勾搴︾⒊鍑忔帓', value: data.value.kpis.yearCarbonTon, suffix: '鍚–O鈧俥', fixed: 1 },
- { label: '鏈尯闂寸⒊鍑忔帓', value: data.value.kpis.periodCarbonTon, suffix: '鍚–O鈧俥', fixed: 2 },
- { label: '绱璧勬簮鍥炴敹', value: data.value.kpis.totalWeightTon, suffix: '鍚�', fixed: 1 },
- { label: '绱鍙備笌甯堢敓', value: data.value.kpis.totalParticipants, suffix: '浜�', fixed: 0 },
- { label: '绱鐜繚琛屼负', value: data.value.kpis.greenActions, suffix: '娆�', fixed: 0 }
+ { field: 'kpis.totalCarbonTon', label: '绱纰冲噺鎺�', value: data.value.kpis.totalCarbonTon, suffix: '鍚–O鈧俥', fixed: 1 },
+ { field: 'kpis.yearCarbonTon', label: '鏈勾搴︾⒊鍑忔帓', value: data.value.kpis.yearCarbonTon, suffix: '鍚–O鈧俥', fixed: 1 },
+ { field: 'kpis.periodCarbonTon', label: '鏈尯闂寸⒊鍑忔帓', value: data.value.kpis.periodCarbonTon, suffix: '鍚–O鈧俥', fixed: 2 },
+ { field: 'kpis.totalWeightTon', label: '绱璧勬簮鍥炴敹', value: data.value.kpis.totalWeightTon, suffix: '鍚�', fixed: 1 },
+ { field: 'kpis.totalParticipants', label: '绱鍙備笌甯堢敓', value: data.value.kpis.totalParticipants, suffix: '浜�', fixed: 0 },
+ { field: 'kpis.greenActions', label: '绱鐜繚琛屼负', value: data.value.kpis.greenActions, suffix: '娆�', fixed: 0 }
]);
+const carbonTrendDemo = computed(() =>
+ timeRange.value === 'year' ? isDemoSection('yearCarbon') : isDemoSection('trend')
+);
+
const trendOption = computed(() => {
const isYear = timeRange.value === 'year';
return {
--
Gitblit v1.9.1