config.ts
1.27 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
import cloneDeep from 'lodash-es/cloneDeep';
import { LateralNumericalControlConfig } from '.';
import {
ConfigType,
CreateComponentType,
PublicComponentOptions,
PublicPresetOptions,
} from '/@/views/visual/packages/index.type';
import { PublicConfigClass, componentInitConfig } from '/@/views/visual/packages/publicConfig';
import { ComponentConfigFieldEnum } from '../../../enum';
export const option: PublicPresetOptions = {
[ComponentConfigFieldEnum.SHOW_DEVICE_NAME]: false,
[ComponentConfigFieldEnum.CONTROL_BAR_COLOR]: '#0072ff',
[ComponentConfigFieldEnum.FONT_COLOR]: '#000000',
[ComponentConfigFieldEnum.TEXT_COLOR]: '#000000',
[ComponentConfigFieldEnum.MIN_NUMBER]: 0,
[ComponentConfigFieldEnum.MAX_NUMBER]: 100,
[ComponentConfigFieldEnum.FONT_SIZE]: 14,
[ComponentConfigFieldEnum.VALUE_SIZE]: 20,
};
export default class Config extends PublicConfigClass implements CreateComponentType {
public key: string = LateralNumericalControlConfig.key;
public attr = { ...componentInitConfig };
public componentConfig: ConfigType = cloneDeep(LateralNumericalControlConfig);
public persetOption = cloneDeep(option);
public option: PublicComponentOptions;
constructor(option: PublicComponentOptions) {
super();
this.option = { ...option };
}
}