3.10 工程代码同步master

This commit is contained in:
jl-zhoujl2
2022-03-10 14:24:13 +08:00
parent 41ab55a4ac
commit 62f6b07ee2
914 changed files with 143121 additions and 29110 deletions

37
src/utils/comFormItem.tsx Normal file
View File

@ -0,0 +1,37 @@
import { DatePicker, Form, Input, Radio } from 'antd';
import React from 'react';
const FormItem = Form.Item;
const { TextArea } = Input;
//Input
export function returnInput(name: any, label: string, edit: boolean, rules?: any, width?: any) {
return (
<FormItem name={name} label={label} rules={rules}>
<Input bordered={edit} readOnly={!edit} style={{ width: width }} />
</FormItem>
)
}
//TextArea
export function returnArea(name: any, edit: boolean, label?: string,) {
const wrapperCol = { offset: label == undefined ? 6 : 0, span: 14 };
return (
<FormItem name={name} label={label} wrapperCol={wrapperCol}>
<TextArea bordered={edit} readOnly={!edit} />
</FormItem>
)
}
//DatePicker
export function returnDatePicker(name: any, label: string, edit: boolean,) {
return (
<FormItem name={name} label={label}>
<DatePicker showNow={false} showTime format="YYYY-MM-DD HH:mm:ss" bordered={edit} disabled={!edit} />
</FormItem>
)
}
// //RadioGroup
// export function returnRadioGroup(name: any, label: string, options: any, value: any, edit: boolean, onChange:()=>void) {
// return (
// <FormItem name={name} label={label}>
// <Radio.Group disabled={!edit} options={options} value={value} onChange={(e) => onChange(e, name)} />
// </FormItem>
// )
// }