diff --git a/src/components/formFields/importSubform/index.less b/src/components/formFields/importSubform/index.less new file mode 100644 index 0000000000000000000000000000000000000000..f465c351b5faffeb873daefcf5d4b42118a528a0 --- /dev/null +++ b/src/components/formFields/importSubform/index.less @@ -0,0 +1,33 @@ +.ccms-antd-mini-form-import_subform, .ccms-antd-mini-form-group { + margin-bottom: 0 !important; + + &>:global(.ant-form-item-label) { + width: calc(100% + 16px) !important; + max-width: calc(100% + 16px) !important; + margin-left: -8px !important; + padding: 2px 8px !important; + flex: 0 0 auto !important; + background-color: #00000008 !important; + } + &>:global(.ant-form-item-control) { + margin-left: -8px !important; + margin-right: -8px !important; + padding: 8px !important; + max-width: calc(100% + 16px) !important; + background-color: #00000004 !important; + } + &>:global(.ant-form-item-control):first-child { + padding-top: 0 !important; + background-color: #00000000 !important; + } +} + +.ccms-antd-mini-form-form, .ccms-antd-mini-form-object { + &>:global(.ant-form-item-control) { + &>:global(.ant-form-item-control-input) { + &>:global(.ant-form-item-control-input-content) { + min-height: 24px !important; + } + } + } +} \ No newline at end of file diff --git a/src/components/formFields/importSubform/index.tsx b/src/components/formFields/importSubform/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..488cb731f3f4b1cbb9839b449f3870eb7161d035 --- /dev/null +++ b/src/components/formFields/importSubform/index.tsx @@ -0,0 +1,61 @@ +import React from "react"; +import { ImportSubformField } from 'ccms'; +import { IImportSubformField, ImportSubformFieldConfig } from "ccms/dist/src/components/formFields/importSubform"; +import { IFormItem } from "ccms/dist/src/steps/form"; +import { Form } from "antd" +import { FormItemProps } from "antd/lib/form"; +import getALLComponents from '../' +import styles from './index.less' +import InterfaceHelper from "../../../util/interface"; + +export const PropsType = (props: ImportSubformFieldConfig) => { }; + +export default class ImportSubformFieldComponent extends ImportSubformField { + getALLComponents = (type: any) => getALLComponents[type] + + interfaceHelper = new InterfaceHelper() + + renderComponent = (props: IImportSubformField) => { + const { + children + } = props + return ( +
+ {children} +
+ ) + } + + renderItemComponent = (props: IFormItem) => { + const { + label, + visitable, + status, + message, + fieldType, + children + } = props + + const formItemLayout: FormItemProps = { labelAlign: 'left' } + if (fieldType === 'form' || fieldType === 'group' || fieldType === 'object' || fieldType === 'import_subform') { + formItemLayout.labelCol = { span: 24 } + formItemLayout.wrapperCol = { span: 24 } + } else { + formItemLayout.labelCol = { span: 6 } + formItemLayout.wrapperCol = { span: 18 } + } + + return ( + + {children} + + ) + } +} \ No newline at end of file diff --git a/src/components/formFields/index.tsx b/src/components/formFields/index.tsx index c75524d85d7b4bcfd65126c53b4734086fe5bf66..c68c04efeee7b917777e77fd1615fdd5bb2ad94e 100644 --- a/src/components/formFields/index.tsx +++ b/src/components/formFields/index.tsx @@ -17,6 +17,7 @@ import HiddenField from './hidden' import TabsField from './tabs' import MultipleTextField from './multipleText' import CustomField from './custom' +import ImportSubformField from './importSubform' export default { text: TextField, @@ -37,5 +38,6 @@ export default { hidden: HiddenField, tabs: TabsField, multiple_text: MultipleTextField, - custom: CustomField + custom: CustomField, + import_subform: ImportSubformField }