From f423901fae0f29f2729ba4fe3aa2dad21b3a7448 Mon Sep 17 00:00:00 2001 From: Free-sss <630042479@qq.com> Date: Fri, 5 Sep 2025 14:27:29 +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:=20=E7=BB=9F=E4=B8=80=E5=B0=BA=E5=AF=B8?= =?UTF-8?q?=E5=B9=B6=E6=B7=BB=E5=8A=A0=E8=83=8C=E6=99=AF=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AirSupplySystem/config.ts | 20 ++++++++- .../AirSupplySystem/index.vue | 39 ++++++++++++++---- .../EnergyConsumptionTrend/config.ts | 15 +++++-- .../EnergyConsumptionTrend/index.vue | 36 ++++++++++++---- .../IntegratedEnergy/EnergyOverview/config.ts | 1 + .../IntegratedEnergy/EnergyOverview/index.vue | 41 ++++++++++++------- .../IntegratedEnergy/GasSystem/config.ts | 11 +++++ .../IntegratedEnergy/GasSystem/index.vue | 34 +++++++++++---- .../PowerSupplySystem/config.ts | 4 +- .../PowerSupplySystem/index.vue | 21 ++++++---- .../WaterSupplySystem/config.ts | 6 ++- .../WaterSupplySystem/index.vue | 22 ++++++---- 12 files changed, 188 insertions(+), 62 deletions(-) diff --git a/src/packages/components/Charts/IntegratedEnergy/AirSupplySystem/config.ts b/src/packages/components/Charts/IntegratedEnergy/AirSupplySystem/config.ts index 018f177..42b6ec2 100644 --- a/src/packages/components/Charts/IntegratedEnergy/AirSupplySystem/config.ts +++ b/src/packages/components/Charts/IntegratedEnergy/AirSupplySystem/config.ts @@ -4,11 +4,28 @@ import { CreateComponentType } from '@/packages/index.d' import cloneDeep from 'lodash/cloneDeep' import dataJson from './data.json' import * as echarts from 'echarts' - +import { chartInitConfig } from '@/settings/designSetting' export const includes = [] const otherOption = { sceneCode: '', unit: dataJson.unit, + titleText: '供风系统', + selectOptionMode: 4, // 0 无 1 平行按钮 2 下拉菜单 3 容器右上角按钮 4 下拉菜单和 容器右上角 + selectOptions: { + selectedValue: 'electricsupply', + dataset: [ + { label: '空压机站1', value: 'electricsupply' }, + { label: '空压机站2', value: 'watersupply' }, + { label: '数据数据', value: 'gassupply' } + ] + }, + inSelectOptions: { + selectedValue: 'kyjxx', + dataset: [ + { label: '空压机XX', value: 'kyjxx' }, + { label: '供风总量', value: 'airsupplySum' }, + ] + } } export const option = { ...otherOption, @@ -182,4 +199,5 @@ export default class Config extends PublicConfigClass implements CreateComponent public chartConfig = cloneDeep(AirSupplySystemConfig) // 图表配置项 public option = echartOptionProfixHandle(option, includes) + public attr = { ...chartInitConfig, x: 0, y: 0, w: 450, h: 320, zIndex: 1 } } diff --git a/src/packages/components/Charts/IntegratedEnergy/AirSupplySystem/index.vue b/src/packages/components/Charts/IntegratedEnergy/AirSupplySystem/index.vue index 602144e..6e69e42 100644 --- a/src/packages/components/Charts/IntegratedEnergy/AirSupplySystem/index.vue +++ b/src/packages/components/Charts/IntegratedEnergy/AirSupplySystem/index.vue @@ -1,12 +1,16 @@ @@ -23,6 +27,7 @@ import config, { includes } from './config' import { mergeTheme } from '@/packages/public/chart' import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' import { useChartDataFetch } from '@/hooks' +import Background from '../Background/index.vue' const props = defineProps({ themeSetting: { type: Object, @@ -39,6 +44,7 @@ const props = defineProps({ }) const initOptions = useCanvasInitOptions(props.chartConfig.option, props.themeSetting) + use([ CanvasRenderer, BarChart, @@ -55,6 +61,18 @@ const option = computed(() => { return mergeTheme(props.chartConfig.option, props.themeSetting, includes) }) +const titleText = computed(() => { + return props.chartConfig.option.titleText; +}); +const selectOptionMode = computed(() => { + return props.chartConfig.option.selectOptionMode; +}); +const selectOptions = computed(() => { + return props.chartConfig.option.selectOptions; +}); +const inSelectOptions = computed(() => { + return props.chartConfig.option.inSelectOptions; +}); watch( () => props.chartConfig.option.dataset, (newData: any) => { @@ -68,6 +86,13 @@ watch( const { vChartRef } = useChartDataFetch(props.chartConfig, useChartEditStore, (newData: any) => { props.chartConfig.option.dataset = newData }) +const handleHeaderSelectChange = (value: string) => { + console.log('模式1/2选中值:', value); +} +const handleInSelect = (value: string) => { + console.log('模式3选中值:', value); + +} onMounted(async () => { // 更新显示单位 diff --git a/src/packages/components/Charts/IntegratedEnergy/EnergyConsumptionTrend/config.ts b/src/packages/components/Charts/IntegratedEnergy/EnergyConsumptionTrend/config.ts index 12f35a3..7b57e55 100644 --- a/src/packages/components/Charts/IntegratedEnergy/EnergyConsumptionTrend/config.ts +++ b/src/packages/components/Charts/IntegratedEnergy/EnergyConsumptionTrend/config.ts @@ -4,14 +4,22 @@ import { CreateComponentType } from '@/packages/index.d' import cloneDeep from 'lodash/cloneDeep' import dataJson from './data.json' import * as echarts from 'echarts' - +import { chartInitConfig } from '@/settings/designSetting' export const includes = [] const otherOption = { sceneCode: '', - titleText:'能源趋势', + titleText: '能耗趋势', unit: dataJson.unit, + selectOptionMode: 1, // 0 无 1 平行按钮 2 下拉菜单 3 容器右上角按钮 4 下拉菜单和 容器右上角 + selectOptions: { + selectedValue: 'electricsupply', + dataset: [ + { label: '电力', value: 'electricsupply' }, + { label: '供水', value: 'watersupply' }, + { label: '燃气', value: 'gassupply' } + ] + } } - const option = { ...otherOption, dataset: dataJson, @@ -187,6 +195,7 @@ const option = { export default class Config extends PublicConfigClass implements CreateComponentType { public key: string = EnergyConsumptionTrendConfig.key public chartConfig = cloneDeep(EnergyConsumptionTrendConfig) + public attr = { ...chartInitConfig, x: 0, y: 0, w: 450, h: 320, zIndex: 1 } // 图表配置项 public option = echartOptionProfixHandle(option, includes) } diff --git a/src/packages/components/Charts/IntegratedEnergy/EnergyConsumptionTrend/index.vue b/src/packages/components/Charts/IntegratedEnergy/EnergyConsumptionTrend/index.vue index 021058e..8000eda 100644 --- a/src/packages/components/Charts/IntegratedEnergy/EnergyConsumptionTrend/index.vue +++ b/src/packages/components/Charts/IntegratedEnergy/EnergyConsumptionTrend/index.vue @@ -1,12 +1,16 @@ @@ -23,6 +27,7 @@ import config, { includes } from './config' import { mergeTheme } from '@/packages/public/chart' import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' import { useChartDataFetch } from '@/hooks' +import Background from '../Background/index.vue' const props = defineProps({ themeSetting: { type: Object, @@ -39,6 +44,7 @@ const props = defineProps({ }) const initOptions = useCanvasInitOptions(props.chartConfig.option, props.themeSetting) + use([ CanvasRenderer, BarChart, @@ -50,12 +56,23 @@ const replaceMergeArr = ref([]) const updataUnit = () => { option.value.title.text = '单位:' + option.value.unit; - } const option = computed(() => { return mergeTheme(props.chartConfig.option, props.themeSetting, includes) }) +const titleText = computed(() => { + return props.chartConfig.option.titleText; +}) +const selectOptionMode = computed(() => { + return props.chartConfig.option.selectOptionMode; +}); +const selectOptions = computed(() => { + return props.chartConfig.option.selectOptions; +}); +const inSelectOptions = computed(() => { + return props.chartConfig.option.inSelectOptions; +}); watch( () => props.chartConfig.option.dataset, (newData: any) => { @@ -69,6 +86,9 @@ watch( const { vChartRef } = useChartDataFetch(props.chartConfig, useChartEditStore, (newData: any) => { props.chartConfig.option.dataset = newData }) +const handleHeaderSelectChange = (value: string) => { + console.log('模式1/2选中值:', value); +} onMounted(async () => { // 更新显示单位 diff --git a/src/packages/components/Charts/IntegratedEnergy/EnergyOverview/config.ts b/src/packages/components/Charts/IntegratedEnergy/EnergyOverview/config.ts index 5a121cd..41335df 100644 --- a/src/packages/components/Charts/IntegratedEnergy/EnergyOverview/config.ts +++ b/src/packages/components/Charts/IntegratedEnergy/EnergyOverview/config.ts @@ -13,6 +13,7 @@ import dataJson from './data.json' const otherOption = { sceneCode: '', titleText: '能源总览', + gridItems: [ { icon: costIcon, diff --git a/src/packages/components/Charts/IntegratedEnergy/EnergyOverview/index.vue b/src/packages/components/Charts/IntegratedEnergy/EnergyOverview/index.vue index ddc1c7b..b45af10 100644 --- a/src/packages/components/Charts/IntegratedEnergy/EnergyOverview/index.vue +++ b/src/packages/components/Charts/IntegratedEnergy/EnergyOverview/index.vue @@ -1,22 +1,27 @@