config.ts
1.11 KB
import cloneDeep from 'lodash-es/cloneDeep';
import { SwitchListConfig } 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 = {
  multipleDataSourceComponent: true,
  [ComponentConfigFieldEnum.ICON]: 'shuiwen',
  [ComponentConfigFieldEnum.ICON_COLOR]: '#377DFF',
  [ComponentConfigFieldEnum.SHOW_DEVICE_NAME]: false,
  [ComponentConfigFieldEnum.FONT_SIZE]: 14,
  [ComponentConfigFieldEnum.PASS_WORD]: '',
};
export default class Config extends PublicConfigClass implements CreateComponentType {
  public key: string = SwitchListConfig.key;
  public attr = { ...componentInitConfig };
  public componentConfig: ConfigType = cloneDeep(SwitchListConfig);
  public persetOption = cloneDeep(option);
  public option: PublicComponentOptions;
  constructor(option: PublicComponentOptions) {
    super();
    this.option = { ...option };
  }
}