2025-09-01 23:52:03 +08:00
|
|
|
import { PublicConfigClass } from '@/packages/public'
|
|
|
|
import { CreateComponentType } from '@/packages/index.d'
|
|
|
|
import { EnergyOverviewConfig } from './index'
|
|
|
|
import cloneDeep from 'lodash/cloneDeep'
|
|
|
|
import { chartInitConfig } from '@/settings/designSetting'
|
2025-09-03 11:27:20 +08:00
|
|
|
|
2025-09-01 23:52:03 +08:00
|
|
|
//导入数据
|
2025-09-03 11:27:20 +08:00
|
|
|
import costIcon from './assets/cost.svg'
|
2025-09-01 23:52:03 +08:00
|
|
|
import dataJson from './data.json'
|
2025-09-03 11:27:20 +08:00
|
|
|
const otherOption = {
|
|
|
|
gridItems: [
|
|
|
|
{
|
|
|
|
icon: costIcon,
|
|
|
|
label: '费用',
|
|
|
|
field: 'cost',
|
|
|
|
unit: '单位',
|
|
|
|
valueClass: 'value-cost'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
icon: costIcon,
|
|
|
|
label: '市电',
|
|
|
|
field: 'mainsElectricity',
|
|
|
|
unit: '单位',
|
|
|
|
valueClass: 'value-electricity'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
icon: costIcon,
|
|
|
|
label: '供水',
|
|
|
|
field: 'waterSupply',
|
|
|
|
unit: '单位',
|
|
|
|
valueClass: 'value-water'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
icon: costIcon,
|
|
|
|
label: '燃气',
|
|
|
|
field: 'gasSupply',
|
|
|
|
unit: '单位',
|
|
|
|
valueClass: 'value-gas'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
2025-09-01 23:52:03 +08:00
|
|
|
export const option = {
|
2025-09-03 11:27:20 +08:00
|
|
|
...otherOption,
|
2025-09-01 23:52:03 +08:00
|
|
|
dataset: dataJson
|
|
|
|
}
|
|
|
|
|
|
|
|
export default class Config extends PublicConfigClass implements CreateComponentType {
|
|
|
|
public key = EnergyOverviewConfig.key
|
|
|
|
public chartConfig = cloneDeep(EnergyOverviewConfig)
|
|
|
|
public option = cloneDeep(option)
|
2025-09-03 11:27:20 +08:00
|
|
|
public attr = { ...chartInitConfig, x: 0, y: 0, w: 889, h: 267, zIndex: 1 }
|
2025-09-01 23:52:03 +08:00
|
|
|
}
|