config.ts
1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import cloneDeep from 'lodash-es/cloneDeep';
import { StatisticsComponent4Config } from '.';
import {
  ConfigType,
  CreateComponentType,
  PublicComponentOptions,
  PublicPresetOptions,
} from '../../../index.type';
import { PublicConfigClass, componentInitConfig } from '../../../publicConfig';
import { ComponentConfigFieldEnum } from '../../../enum';
export enum Gradient {
  FIRST = 'first',
  SECOND = 'second',
}
export enum GradientColor {
  FIRST = '#07ffd6',
  SECOND = '#5eff10',
}
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 = StatisticsComponent4Config.key;
  public attr = { ...componentInitConfig };
  public componentConfig: ConfigType = cloneDeep(StatisticsComponent4Config);
  public persetOption = cloneDeep(option);
  public option: PublicComponentOptions;
  constructor(option: PublicComponentOptions) {
    super();
    this.option = { ...option };
  }
}