From 4ef9a5af4c2e9099e7ee2345fd94ed6e147bb101 Mon Sep 17 00:00:00 2001 From: Administrator Date: Thu, 4 Sep 2025 11:56:00 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A2=B3=E6=8E=92=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IntegratedEnergy/LineGradients/config.ts | 135 ++++++++++++++++++ .../IntegratedEnergy/LineGradients/config.vue | 95 ++++++++++++ .../IntegratedEnergy/LineGradients/data.json | 65 +++++++++ .../IntegratedEnergy/LineGradients/index.ts | 14 ++ .../IntegratedEnergy/LineGradients/index.vue | 86 +++++++++++ .../Charts/IntegratedEnergy/index.ts | 5 +- 6 files changed, 398 insertions(+), 2 deletions(-) create mode 100644 src/packages/components/Charts/IntegratedEnergy/LineGradients/config.ts create mode 100644 src/packages/components/Charts/IntegratedEnergy/LineGradients/config.vue create mode 100644 src/packages/components/Charts/IntegratedEnergy/LineGradients/data.json create mode 100644 src/packages/components/Charts/IntegratedEnergy/LineGradients/index.ts create mode 100644 src/packages/components/Charts/IntegratedEnergy/LineGradients/index.vue diff --git a/src/packages/components/Charts/IntegratedEnergy/LineGradients/config.ts b/src/packages/components/Charts/IntegratedEnergy/LineGradients/config.ts new file mode 100644 index 0000000..c221fd2 --- /dev/null +++ b/src/packages/components/Charts/IntegratedEnergy/LineGradients/config.ts @@ -0,0 +1,135 @@ +import { echartOptionProfixHandle, PublicConfigClass } from '@/packages/public' +import { LineGradientsConfig } from './index' +import { CreateComponentType } from '@/packages/index.d' +import { graphic } from 'echarts/core' +import { defaultTheme, chartColorsSearch } from '@/settings/chartThemes/index' +import cloneDeep from 'lodash/cloneDeep' +import dataJson from './data.json' + +export const includes = [ 'xAxis', 'yAxis', 'grid'] + +const option = { + legend: { + show: true, + top:'20', + right:'50', + itemStyle:{ + borderType: 'dotted' + }, + lineStyle: { + type:'dashed', + cap:'round', + opacity:0.9, + }, + // icon: 'rect', + data:[{ + name: '电', + // 强制设置图形为圆。 + icon: 'rect', + itemStyle:{ + color: 'rgba(12, 109, 196,1)' + }, + },{ + name: '燃气', + // 强制设置图形为圆。 + icon: 'rect', + itemStyle:{ + color: 'rgba(48, 189, 104,1)' + }, + }], + }, + tooltip: { + show: true, + trigger: 'axis', + axisPointer: { + type: 'line' + } + }, + xAxis: { + show: true, + type: 'category' + }, + yAxis: { + show: true, + type: 'value', + name: '单位:万/kwh2', + nameGap:30, + splitLine:{ + show: true, + lineStyle:{ + type: 'dashed', + opacity:0.5 + } + } + }, + dataset: { ...dataJson }, + series: [ + { + type: 'line', + smooth: true, + symbolSize: 0, //设定实心点的大小 + label: { + show: false, + position: 'top', + color: '#fff', + fontSize: 12 + }, + lineStyle: { + width: 3, + type: 'solid', + + color: 'rgba(12, 109, 196,1)' + }, + areaStyle: { + opacity: 0.8, + color: new graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 0, + color: chartColorsSearch[defaultTheme][3] + }, + { + offset: 1, + color: 'rgba(12, 57, 68,0.5)' + } + ]) + } + }, + { + type: 'line', + smooth: true, + symbolSize: 0, //设定实心点的大小 + label: { + show: false, + position: 'top', + color: '#fff', + fontSize: 12 + }, + lineStyle: { + width: 3, + type: 'solid', + join: 'round', + color: 'rgba(48, 189, 104,1)' + }, + areaStyle: { + opacity: 0.8, + color: new graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 0, + color: chartColorsSearch[defaultTheme][4] + }, + { + offset: 1, + color: 'rgba(8, 48, 85,0.5)' + } + ]) + } + } + ] +} + +export default class Config extends PublicConfigClass implements CreateComponentType { + public key: string = LineGradientsConfig.key + public chartConfig = cloneDeep(LineGradientsConfig) + // 图表配置项 + public option = echartOptionProfixHandle(option, includes) +} diff --git a/src/packages/components/Charts/IntegratedEnergy/LineGradients/config.vue b/src/packages/components/Charts/IntegratedEnergy/LineGradients/config.vue new file mode 100644 index 0000000..3b33266 --- /dev/null +++ b/src/packages/components/Charts/IntegratedEnergy/LineGradients/config.vue @@ -0,0 +1,95 @@ + + + diff --git a/src/packages/components/Charts/IntegratedEnergy/LineGradients/data.json b/src/packages/components/Charts/IntegratedEnergy/LineGradients/data.json new file mode 100644 index 0000000..8977344 --- /dev/null +++ b/src/packages/components/Charts/IntegratedEnergy/LineGradients/data.json @@ -0,0 +1,65 @@ +{ + "dimensions": ["月份", "电", "燃气"], + "source": [ + { + "月份": "1月", + "电": 120, + "燃气": 130 + }, + { + "月份": "2月", + "电": 200, + "燃气": 130 + }, + { + "月份": "3月", + "电": 150, + "燃气": 312 + }, + { + "月份": "4月", + "电": 80, + "燃气": 268 + }, + { + "月份": "5月", + "电": 70, + "燃气": 155 + }, + { + "月份": "6月", + "电": 110, + "燃气": 117 + }, + { + "月份": "7月", + "电": 130, + "燃气": 160 + }, + { + "月份": "8月", + "电": 130, + "燃气": 160 + }, + { + "月份": "9月", + "电": 130, + "燃气": 160 + }, + { + "月份": "10月", + "电": 130, + "燃气": 160 + }, + { + "月份": "11月", + "电": 130, + "燃气": 160 + }, + { + "月份": "12月", + "电": 130, + "燃气": 160 + } + ] +} diff --git a/src/packages/components/Charts/IntegratedEnergy/LineGradients/index.ts b/src/packages/components/Charts/IntegratedEnergy/LineGradients/index.ts new file mode 100644 index 0000000..95d463a --- /dev/null +++ b/src/packages/components/Charts/IntegratedEnergy/LineGradients/index.ts @@ -0,0 +1,14 @@ +import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' +import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' + +export const LineGradientsConfig: ConfigType = { + key: 'LineGradients', + chartKey: 'VLineGradients', + conKey: 'VCLineGradients', + title: '双折线渐变面积图', + category: ChatCategoryEnum.IntegratedEnergy, + categoryName: ChatCategoryEnumName.IntegratedEnergy, + package: PackagesCategoryEnum.CHARTS, + chartFrame: ChartFrameEnum.ECHARTS, + image: 'line_gradient.png' +} diff --git a/src/packages/components/Charts/IntegratedEnergy/LineGradients/index.vue b/src/packages/components/Charts/IntegratedEnergy/LineGradients/index.vue new file mode 100644 index 0000000..ea67334 --- /dev/null +++ b/src/packages/components/Charts/IntegratedEnergy/LineGradients/index.vue @@ -0,0 +1,86 @@ + + + diff --git a/src/packages/components/Charts/IntegratedEnergy/index.ts b/src/packages/components/Charts/IntegratedEnergy/index.ts index 342f65f..3487cae 100644 --- a/src/packages/components/Charts/IntegratedEnergy/index.ts +++ b/src/packages/components/Charts/IntegratedEnergy/index.ts @@ -6,10 +6,11 @@ import { WaterSupplySystemConfig } from "./WaterSupplySystem" import { AirSupplySystemConfig } from './AirSupplySystem' import { PowerSupplySystemConfig } from './PowerSupplySystem' import { GasSystemConfig } from './GasSystem' +import { LineGradientsConfig } from './LineGradients' export default [ EnergyOverviewConfig, EnergyConsumptionTrendConfig, ConsumptionProportionConfig, FeeOverviewConfig, WaterSupplySystemConfig, AirSupplySystemConfig, PowerSupplySystemConfig, - GasSystemConfig -] \ No newline at end of file + GasSystemConfig,LineGradientsConfig +]