config.ts
1.4 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 { RectFlowmeteConfig } from '.';
import {
ConfigType,
CreateComponentType,
PublicComponentOptions,
PublicPresetOptions,
} from '/@/views/visual/packages/index.type';
import { PublicConfigClass, componentInitConfig } from '/@/views/visual/packages/publicConfig';
import { ComponentConfigFieldEnum } from '/@/views/visual/packages/enum';
export const option: PublicPresetOptions = {
[ComponentConfigFieldEnum.SHOW_DEVICE_NAME]: false,
[ComponentConfigFieldEnum.SHOW_TIME]: false,
[ComponentConfigFieldEnum.UNIT]: 'm',
[ComponentConfigFieldEnum.MAX_NUMBER]: 100,
[ComponentConfigFieldEnum.FONT_SIZE]: 14,
[ComponentConfigFieldEnum.VALUE_SIZE]: 20,
[ComponentConfigFieldEnum.FLOWMETER_CONFIG]: {
[ComponentConfigFieldEnum.BACKGROUND_COLOR]: '#8badcb',
[ComponentConfigFieldEnum.WAVE_FIRST]: '#4579e2',
[ComponentConfigFieldEnum.WAVE_SECOND]: '#3461c1',
[ComponentConfigFieldEnum.WAVE_THIRD]: '#2d55aa',
},
};
export default class Config extends PublicConfigClass implements CreateComponentType {
public key: string = RectFlowmeteConfig.key;
public attr = { ...componentInitConfig };
public componentConfig: ConfigType = cloneDeep(RectFlowmeteConfig);
public persetOption = cloneDeep(option);
public option: PublicComponentOptions;
constructor(option: PublicComponentOptions) {
super();
this.option = { ...option };
}
}