create.config.ts
1.35 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
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 { useRuleChainI18n } from '../../../hook/useRuleChainI18n';
const { tLabel } = useRuleChainI18n('enrichment', 'relatedAttributes');
export enum RelatedAttributesFieldsEnum {
  RELATIONS_QUERY = 'relationsQuery',
  ATTR_MAPPING = 'attrMapping',
  TELEMETRY = 'telemetry',
}
useComponentRegister('RelationsQuery', RelationsQuery);
useComponentRegister('AttributeConfiguration', AttributeConfiguration);
export const formSchemas: FormSchema[] = [
  {
    field: RelatedAttributesFieldsEnum.RELATIONS_QUERY,
    component: 'RelationsQuery',
    label: tLabel(RelatedAttributesFieldsEnum.RELATIONS_QUERY),
    changeEvent: 'update:value',
    valueField: 'value',
    slot: RelatedAttributesFieldsEnum.RELATIONS_QUERY,
  },
  {
    field: RelatedAttributesFieldsEnum.TELEMETRY,
    component: 'Checkbox',
    label: '',
    renderComponentContent: () => ({
      default: () => tLabel(RelatedAttributesFieldsEnum.TELEMETRY),
    }),
  },
  {
    field: RelatedAttributesFieldsEnum.ATTR_MAPPING,
    component: 'AttributeConfiguration',
    label: '',
    slot: RelatedAttributesFieldsEnum.ATTR_MAPPING,
  },
];