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 @@