create.config.ts 736 Bytes
import { h } from 'vue';
import { FormSchema } from '/@/components/Form';
import { useRuleChainI18n } from '../../../hook/useRuleChainI18n';

const { tLabel, t } = useRuleChainI18n('action', 'saveEvent');

export enum SaveEventFieldsEnum {
  CONFIGURATION = 'CONFIGURATION',
}

export const formSchemas: FormSchema[] = [
  {
    field: 'content',
    label: '',
    component: 'Input',
    renderColContent: () =>
      h(
        'div',
        { style: { color: 'red' } },
        t('rule.chain.action.saveEvent.fields.configurationDesc')
      ),
  },
  {
    field: SaveEventFieldsEnum.CONFIGURATION,
    component: 'JSONEditor',
    label: tLabel('configuration'),
    valueField: 'value',
    changeEvent: 'update:value',
  },
];