feat: 类目管理
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import type { ProFormColumnsType } from '@ant-design/pro-components';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Button, type ColProps, Drawer, Space } from 'antd';
|
||||
import type { FormInstance } from 'antd/lib';
|
||||
import type { ProFormColumnsType } from "@ant-design/pro-components";
|
||||
import { BetaSchemaForm } from "@ant-design/pro-components";
|
||||
import { Button, type ColProps, Drawer, Space } from "antd";
|
||||
import type { FormInstance } from "antd/lib";
|
||||
import React, {
|
||||
Children,
|
||||
cloneElement,
|
||||
forwardRef,
|
||||
useImperativeHandle,
|
||||
} from 'react';
|
||||
} from "react";
|
||||
|
||||
interface ConfigurableDrawerFormProps {
|
||||
title?: string;
|
||||
@@ -17,9 +17,9 @@ interface ConfigurableDrawerFormProps {
|
||||
width?: number | string;
|
||||
labelCol?: ColProps;
|
||||
wrapperCol?: ColProps;
|
||||
footer: React.ReactNode;
|
||||
footer?: React.ReactNode;
|
||||
children?: React.ReactNode;
|
||||
bodyStyle: React.CSSProperties;
|
||||
bodyStyle?: React.CSSProperties;
|
||||
}
|
||||
|
||||
export interface ConfigurableDrawerFormRef {
|
||||
@@ -33,7 +33,7 @@ const ConfigurableDrawerForm = forwardRef<
|
||||
>(
|
||||
(
|
||||
{
|
||||
title = '表单',
|
||||
title = "表单",
|
||||
labelCol = { span: 4 },
|
||||
wrapperCol = { span: 20 },
|
||||
columns,
|
||||
@@ -44,7 +44,7 @@ const ConfigurableDrawerForm = forwardRef<
|
||||
children,
|
||||
bodyStyle = {},
|
||||
},
|
||||
ref,
|
||||
ref
|
||||
) => {
|
||||
const [open, setOpen] = React.useState(false);
|
||||
const [formData, setFormData] = React.useState(initialValues || {});
|
||||
@@ -56,7 +56,7 @@ const ConfigurableDrawerForm = forwardRef<
|
||||
if (data) {
|
||||
setFormData(data);
|
||||
}
|
||||
console.log('open');
|
||||
console.log("open");
|
||||
setOpen(true);
|
||||
},
|
||||
close: () => setOpen(false),
|
||||
@@ -96,12 +96,12 @@ const ConfigurableDrawerForm = forwardRef<
|
||||
title={title}
|
||||
styles={{
|
||||
header: {
|
||||
textAlign: 'left',
|
||||
position: 'relative',
|
||||
textAlign: "left",
|
||||
position: "relative",
|
||||
},
|
||||
body: {
|
||||
background: 'var(--ant-background-color)',
|
||||
padding: 'var(--ant-padding-lg)',
|
||||
background: "var(--ant-background-color)",
|
||||
padding: "var(--ant-padding-lg)",
|
||||
...bodyStyle,
|
||||
},
|
||||
}}
|
||||
@@ -111,7 +111,7 @@ const ConfigurableDrawerForm = forwardRef<
|
||||
onClose={() => setOpen(false)}
|
||||
width={width}
|
||||
footer={
|
||||
<Space style={{ width: '100%', justifyContent: 'end' }}>
|
||||
<Space style={{ width: "100%", justifyContent: "end" }}>
|
||||
{footer ? (
|
||||
footer
|
||||
) : (
|
||||
@@ -142,7 +142,7 @@ const ConfigurableDrawerForm = forwardRef<
|
||||
)}
|
||||
</Drawer>
|
||||
);
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
export default ConfigurableDrawerForm;
|
||||
|
||||
Reference in New Issue
Block a user