form-meta.tsx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
  3. * SPDX-License-Identifier: MIT
  4. */
  5. import { FormMeta, FormRenderProps } from '@flowgram.ai/free-layout-editor';
  6. import { DisplayOutputs } from '@flowgram.ai/form-materials';
  7. import { Divider } from '@douyinfe/semi-ui';
  8. import { FormHeader, FormContent } from '../../form-components';
  9. import { {NODE_NAME}NodeJSON } from './types';
  10. import { CustomComponent } from './components/custom-component';
  11. import { defaultFormMeta } from '../default-form-meta';
  12. /**
  13. * 表单渲染组件
  14. */
  15. export const FormRender = ({ form }: FormRenderProps<{NODE_NAME}NodeJSON>) => (
  16. <>
  17. <FormHeader />
  18. <FormContent>
  19. {/* TODO: 添加自定义组件 */}
  20. <CustomComponent />
  21. <Divider />
  22. {/* 显示节点输出 */}
  23. <DisplayOutputs displayFromScope />
  24. </FormContent>
  25. </>
  26. );
  27. /**
  28. * 表单配置
  29. */
  30. export const formMeta: FormMeta = {
  31. render: (props) => <FormRender {...props} />,
  32. effect: defaultFormMeta.effect,
  33. plugins: [
  34. // TODO: 根据需要添加插件
  35. // createInferInputsPlugin({ sourceKey: 'xxxValues', targetKey: 'xxx' }),
  36. ],
  37. };