diff --git a/src/packages/components/Charts/IntegratedEnergy/GasSystem/config.ts b/src/packages/components/Charts/IntegratedEnergy/GasSystem/config.ts new file mode 100644 index 0000000..92e4180 --- /dev/null +++ b/src/packages/components/Charts/IntegratedEnergy/GasSystem/config.ts @@ -0,0 +1,157 @@ +import { echartOptionProfixHandle, PublicConfigClass } from '@/packages/public' +import { GasSystemConfig } from './index' +import { CreateComponentType } from '@/packages/index.d' +import cloneDeep from 'lodash/cloneDeep' +import * as echarts from 'echarts' +import dataJson from './data.json' + +export const includes = [] +const otherOption = { + secneID: '', + titleText: '燃气系统', + unit: dataJson.unit, +} + +const option = { + ...otherOption, + dataset: dataJson, + // 添加标题配置 + title: { + text: '单位:' + otherOption.unit, + left: '2%', + top: '2%', + textStyle: { + fontSize: 12, + color: 'rgba(255, 255, 255, 0.7)', + fontWeight: 'normal' + } + }, + // 提示框配置 + tooltip: { + trigger: 'axis', + // formatter: function (params) { + // let param = params[0]; + // return `${param.name}: ${param.value.value}`; + // }, + axisPointer: { + type: 'line', + lineStyle: { + color: 'rgba(58, 160, 255, 1)', + type: 'solid' + } + } + }, + // 网格配置 + grid: { + left: '3%', + right: '4%', + bottom: '3%', + top: '15%', + containLabel: true + }, + + // X轴配置 + xAxis: { + type: 'category', + boundaryGap: false, + 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: true, + 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: 'solid' + } + } + }, + + // 数据系列配置 + series: [ + { + name: '值', + type: 'line', + smooth: true, + symbol: 'none', // 默认不显示点 + symbolSize: 8, + lineStyle: { + width: 2, + color: { + type: 'linear', + x: 0, + y: 0, + x2: 1, + y2: 0, + colorStops: [ + { offset: 0, color: 'rgba(58, 160, 255, 1)' }, + { offset: 1, color: 'rgba(127, 216, 255, 1)' } + ] + } + }, + emphasis: { + focus: 'series', + symbol: 'circle', // 鼠标悬停时显示圆点 + symbolSize: 8, + itemStyle: { + color: 'rgba(58, 160, 255, 1)', + borderColor: 'rgba(255, 255, 255, 0.8)', + borderWidth: 2 + } + }, + areaStyle: { + color: { + type: 'linear', + x: 0, + y: 0, + x2: 0, + y2: 1, + colorStops: [ + { offset: 0, color: 'rgba(53, 192, 227,1)' }, + { offset: 0.4, color: 'rgba(49, 175, 255, 0.8)' }, + { offset: 1, color: 'rgba(58, 160, 255, 0.05)' } + ] + } + } + } + ], + +}; + +export default class Config extends PublicConfigClass implements CreateComponentType { + public key: string = GasSystemConfig.key + public chartConfig = cloneDeep(GasSystemConfig) + // 图表配置项 + public option = echartOptionProfixHandle(option, includes) +} diff --git a/src/packages/components/Charts/IntegratedEnergy/GasSystem/config.vue b/src/packages/components/Charts/IntegratedEnergy/GasSystem/config.vue new file mode 100644 index 0000000..4c6f38a --- /dev/null +++ b/src/packages/components/Charts/IntegratedEnergy/GasSystem/config.vue @@ -0,0 +1,16 @@ + + diff --git a/src/packages/components/Charts/IntegratedEnergy/GasSystem/data.json b/src/packages/components/Charts/IntegratedEnergy/GasSystem/data.json new file mode 100644 index 0000000..a1cf92f --- /dev/null +++ b/src/packages/components/Charts/IntegratedEnergy/GasSystem/data.json @@ -0,0 +1,57 @@ +{ + "dimensions": [ + "month", + "value" + ], + "source": [ + { + "month": "1月", + "value": 25 + }, + { + "month": "2月", + "value": 34 + }, + { + "month": "3月", + "value": 50 + }, + { + "month": "4月", + "value": 68 + }, + { + "month": "5月", + "value": 55 + }, + { + "month": "6月", + "value": 45 + }, + { + "month": "7月", + "value": 95 + }, + { + "month": "8月", + "value": 40 + }, + { + "month": "9月", + "value": 52 + }, + { + "month": "10月", + "value": 80 + }, + { + "month": "11月", + "value": 60 + }, + { + "month": "12月", + "value": 75 + } + ], + "unit": "万kwh" +} \ No newline at end of file diff --git a/src/packages/components/Charts/IntegratedEnergy/GasSystem/index.ts b/src/packages/components/Charts/IntegratedEnergy/GasSystem/index.ts new file mode 100644 index 0000000..e142876 --- /dev/null +++ b/src/packages/components/Charts/IntegratedEnergy/GasSystem/index.ts @@ -0,0 +1,14 @@ +import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' +import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' + +export const GasSystemConfig: ConfigType = { + key: 'GasSystem', + chartKey: 'VGasSystem', + conKey: 'VCGasSystem', + title: '燃气系统', + category: ChatCategoryEnum.IntegratedEnergy, + categoryName: ChatCategoryEnumName.IntegratedEnergy, + package: PackagesCategoryEnum.CHARTS, + chartFrame: ChartFrameEnum.ECHARTS, + image: 'GasSystem.png' +} \ No newline at end of file diff --git a/src/packages/components/Charts/IntegratedEnergy/GasSystem/index.vue b/src/packages/components/Charts/IntegratedEnergy/GasSystem/index.vue new file mode 100644 index 0000000..5289f36 --- /dev/null +++ b/src/packages/components/Charts/IntegratedEnergy/GasSystem/index.vue @@ -0,0 +1,93 @@ + + + + + \ No newline at end of file