create.config.ts 1.18 KB
import { AttributeConfiguration } from '/@/views/rule/designer/src/components/AttributeConfiguration';
import { FormSchema, useComponentRegister } from '/@/components/Form';
import { RelationsQuery } from '/@/views/rule/designer/src/components/RelationsQuery';
import {
  RelatedAttributesFieldsEnum,
  RelatedAttributesFieldsNameEnum,
} from '../../../enum/formField/enrichment';

useComponentRegister('RelationsQuery', RelationsQuery);
useComponentRegister('AttributeConfiguration', AttributeConfiguration);

export const formSchemas: FormSchema[] = [
  {
    field: RelatedAttributesFieldsEnum.RELATIONS_QUERY,
    component: 'RelationsQuery',
    label: RelatedAttributesFieldsNameEnum.RELATIONS_QUERY,
    changeEvent: 'update:value',
    valueField: 'value',
    slot: RelatedAttributesFieldsEnum.RELATIONS_QUERY,
  },
  {
    field: RelatedAttributesFieldsEnum.TELEMETRY,
    component: 'Checkbox',
    label: '',
    renderComponentContent: () => ({
      default: () => RelatedAttributesFieldsNameEnum.TELEMETRY,
    }),
  },
  {
    field: RelatedAttributesFieldsEnum.ATTR_MAPPING,
    component: 'AttributeConfiguration',
    label: '',
    slot: RelatedAttributesFieldsEnum.ATTR_MAPPING,
  },
];