config.ts
1.02 KB
import cloneDeep from 'lodash-es/cloneDeep';
import { StatisticsComponent3Config } from '.';
import {
ConfigType,
CreateComponentType,
PublicComponentOptions,
PublicPresetOptions,
} from '../../../index.type';
import { PublicConfigClass, componentInitConfig } from '../../../publicConfig';
import { ComponentConfigFieldEnum } from '../../../enum';
export const option: PublicPresetOptions = {
multipleDataSourceComponent: true,
[ComponentConfigFieldEnum.FONT_COLOR]: '#FD7347',
[ComponentConfigFieldEnum.SHOW_DEVICE_NAME]: false,
[ComponentConfigFieldEnum.UNIT]: '℃',
};
export default class Config extends PublicConfigClass implements CreateComponentType {
public key: string = StatisticsComponent3Config.key;
public attr = { ...componentInitConfig };
public componentConfig: ConfigType = cloneDeep(StatisticsComponent3Config);
public persetOption = cloneDeep(option);
public option: PublicComponentOptions;
constructor(option: PublicComponentOptions) {
super();
this.option = { ...option };
}
}