From 0a292d40e536c7d0dfad9334a1f3c84dac5b1acf Mon Sep 17 00:00:00 2001 From: Free-sss <630042479@qq.com> Date: Wed, 3 Sep 2025 21:17:52 +0800 Subject: [PATCH] =?UTF-8?q?feat=E3=80=90=E8=83=BD=E6=BA=90=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E3=80=91=EF=BC=9A=E5=AE=8C=E5=96=84=E4=BE=9B=E6=B0=B4?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=98=BE=E7=A4=BA=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AirSupplySystem/config.ts | 169 +++++++++++- .../AirSupplySystem/index.vue | 201 ++------------ .../EnergyConsumptionTrend/config.ts | 3 +- .../EnergyConsumptionTrend/config.vue | 2 +- .../EnergyConsumptionTrend/data.json | 3 +- .../WaterSupplySystem/config.ts | 249 +++++++++++++----- .../WaterSupplySystem/index.vue | 194 ++------------ 7 files changed, 389 insertions(+), 432 deletions(-) diff --git a/src/packages/components/Charts/IntegratedEnergy/AirSupplySystem/config.ts b/src/packages/components/Charts/IntegratedEnergy/AirSupplySystem/config.ts index a73730e..09d8dce 100644 --- a/src/packages/components/Charts/IntegratedEnergy/AirSupplySystem/config.ts +++ b/src/packages/components/Charts/IntegratedEnergy/AirSupplySystem/config.ts @@ -6,8 +6,175 @@ import dataJson from './data.json' import * as echarts from 'echarts' export const includes = [] +const otherOption = { + secneID: '', + unit: dataJson.unit, +} +export const option = { + ...otherOption, + // 添加标题配置 + title: { + text: '单位:' + otherOption.unit, + left: '2%', + top: '2%', + textStyle: { + fontSize: 12, + color: 'rgba(255, 255, 255, 0.7)', + fontWeight: 'normal' + } + }, + // 提示框配置 + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'shadow' + }, + backgroundColor: 'rgba(0, 0, 0, 0.8)', + borderColor: '#00ffff', + textStyle: { + color: '#ffffff' + } + }, + dataset: dataJson, + // 网格配置 + grid: { + left: '3%', + right: '4%', + bottom: '3%', + top: '15%', + containLabel: true + }, -const option = { + // X轴配置 + xAxis: { + type: 'category', + axisLine: { + lineStyle: { + color: 'rgba(255, 255, 255, 0.1)', + } + }, + axisTick: { + show: false + }, + // + axisLabel: { + color: '#eee', + interval: 0, + fontSize: 9, + margin: 20 + } + + }, + + // Y轴配置 + yAxis: { + type: 'value', + min: 0, + interval: 25, + axisLine: { + show: false, + lineStyle: { + color: 'rgba(255, 255, 255, 0.1)', + } + }, + axisTick: { + show: false + }, + axisLabel: { + color: 'rgba(255, 255, 255, 0.8)', + formatter: '{value}' + }, + splitLine: { + lineStyle: { + color: 'rgba(255, 255, 255, 0.1)', + type: 'dashed' + } + } + }, + + // 数据系列配置 + series: [{ + name: '左侧', + tooltip: { + show: false + }, + type: 'bar', + barWidth: 8, + itemStyle: { + normal: { + color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [{ + offset: 0, + color: "rgba(26,102,255,0)" // 0% 处的颜色 + }, { + offset: 1, + color: "#22bef5", // 100% 处的颜色 + }], false) + } + }, + barGap: 0, + + }, + { + name: '右侧', + type: 'bar', + barWidth: 8, + itemStyle: { + normal: { + color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [{ + offset: 0, + color: "rgba(51,153,255,0)" // 0% 处的颜色 + }, { + offset: 1, + color: "#22bef5", // 100% 处的颜色 + }], false) + } + }, + barGap: 0 + }, { + name: '顶部', + type: 'pictorialBar', + symbol: 'diamond', + symbolSize: ['16', '9'], + symbolPosition: 'end', + symbolOffset: ['', '-50%'], + itemStyle: { + color: '#44D5FC' + }, + z: 3 + + } + ], + + // 图形元素配置 + graphic: [{ + // 左侧阴影效果 + type: 'rect', + left: 0, + top: '15%', + width: '25%', + bottom: '3%', + style: { + fill: new echarts.graphic.LinearGradient(0, 0, 1, 0, [ + { offset: 0, color: 'rgba(0, 0, 0, 0.8)' }, // 更强的左侧阴影 + { offset: 1, color: 'rgba(0, 0, 0, 0)' } + ]) + }, + z: -1 + }, { + // 底部阴影效果 + type: 'rect', + left: '3%', + right: '4%', + bottom: '0', + height: '10%', + style: { + fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { offset: 0, color: 'rgba(0, 0, 0, 0)' }, + { offset: 1, color: 'rgba(0, 0, 0, 0.6)' } // 底部阴影 + ]) + }, + z: -1 + }] }; export default class Config extends PublicConfigClass implements CreateComponentType { diff --git a/src/packages/components/Charts/IntegratedEnergy/AirSupplySystem/index.vue b/src/packages/components/Charts/IntegratedEnergy/AirSupplySystem/index.vue index 4bd9c15..602144e 100644 --- a/src/packages/components/Charts/IntegratedEnergy/AirSupplySystem/index.vue +++ b/src/packages/components/Charts/IntegratedEnergy/AirSupplySystem/index.vue @@ -1,18 +1,17 @@ diff --git a/src/packages/components/Charts/IntegratedEnergy/EnergyConsumptionTrend/config.ts b/src/packages/components/Charts/IntegratedEnergy/EnergyConsumptionTrend/config.ts index fe70cfa..1ecfcb1 100644 --- a/src/packages/components/Charts/IntegratedEnergy/EnergyConsumptionTrend/config.ts +++ b/src/packages/components/Charts/IntegratedEnergy/EnergyConsumptionTrend/config.ts @@ -7,7 +7,8 @@ import * as echarts from 'echarts' export const includes = [] const otherOption = { - unit: '万kwh', + secneID:'', + unit: dataJson.unit, } const option = { diff --git a/src/packages/components/Charts/IntegratedEnergy/EnergyConsumptionTrend/config.vue b/src/packages/components/Charts/IntegratedEnergy/EnergyConsumptionTrend/config.vue index 9bcaaeb..4c6f38a 100644 --- a/src/packages/components/Charts/IntegratedEnergy/EnergyConsumptionTrend/config.vue +++ b/src/packages/components/Charts/IntegratedEnergy/EnergyConsumptionTrend/config.vue @@ -1,5 +1,5 @@