feat: update eslint & prettier rules

This commit is contained in:
HYana
2025-04-30 17:36:46 +08:00
parent d4af2d4326
commit 460e065eed
53 changed files with 2241 additions and 2102 deletions
@@ -1,38 +1,30 @@
import {Form, Input, InputNumber, Select, Switch} from "antd";
import {DynamicFormItemType, IDynamicFormItemConfig} from "@/app/home/components/dynamic-form/DynamicFormItemConfig";
import { Form, Input, InputNumber, Select, Switch } from 'antd';
import {
DynamicFormItemType,
IDynamicFormItemConfig,
} from '@/app/home/components/dynamic-form/DynamicFormItemConfig';
export default function DynamicFormItemComponent({
config
config,
}: {
config: IDynamicFormItemConfig
config: IDynamicFormItemConfig;
}) {
return (
<Form.Item
label={config.label.zh_CN}
name={config.name}
rules={[{required: config.required, message: "该项为必填项哦~"}]}
initialValue={config.default}
>
{
config.type === DynamicFormItemType.INT &&
<InputNumber/>
}
return (
<Form.Item
label={config.label.zh_CN}
name={config.name}
rules={[{ required: config.required, message: '该项为必填项哦~' }]}
initialValue={config.default}
>
{config.type === DynamicFormItemType.INT && <InputNumber />}
{
config.type === DynamicFormItemType.STRING &&
<Input/>
}
{config.type === DynamicFormItemType.STRING && <Input />}
{
config.type === DynamicFormItemType.BOOLEAN &&
<Switch defaultChecked/>
}
{config.type === DynamicFormItemType.BOOLEAN && <Switch defaultChecked />}
{
config.type === DynamicFormItemType.STRING_ARRAY &&
<Select options={[]}/>
}
</Form.Item>
)
}
{config.type === DynamicFormItemType.STRING_ARRAY && (
<Select options={[]} />
)}
</Form.Item>
);
}