config.ts
1.22 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
import cloneDeep from 'lodash-es/cloneDeep';
import { SwitchStatusConfig } 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.ICON]: 'dianyuandianya',
[ComponentConfigFieldEnum.ICON_COLOR]: '#ffa621',
[ComponentConfigFieldEnum.ICON_CLOSE]: 'dianyuandianya',
[ComponentConfigFieldEnum.ICON_COLOR_CLOSE]: '#CCCCCC',
[ComponentConfigFieldEnum.SHOW_DEVICE_NAME]: false,
[ComponentConfigFieldEnum.SHOW_TIME]: false,
[ComponentConfigFieldEnum.FONT_SIZE]: 14,
};
export default class Config extends PublicConfigClass implements CreateComponentType {
public key: string = SwitchStatusConfig.key;
public attr = { ...componentInitConfig };
public componentConfig: ConfigType = cloneDeep(SwitchStatusConfig);
public persetOption = cloneDeep(option);
public option: PublicComponentOptions;
constructor(option: PublicComponentOptions) {
super();
this.option = { ...option };
}
}