|  |  |  | 
|---|
|  |  |  | import MemoInput from "../../components/MemoInput"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const SerialRuleItemCreate = (props) => { | 
|---|
|  |  |  | const { open, setOpen } = props; | 
|---|
|  |  |  | const { open, setOpen, record } = props; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const translate = useTranslate(); | 
|---|
|  |  |  | const notify = useNotify(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_rule_item_type')) || []; | 
|---|
|  |  |  | const handleClose = (event, reason) => { | 
|---|
|  |  |  | if (reason !== "backdropClick") { | 
|---|
|  |  |  | setOpen(false); | 
|---|
|  |  |  | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | <> | 
|---|
|  |  |  | <CreateBase | 
|---|
|  |  |  | resource="serialRuleItem" | 
|---|
|  |  |  | record={{}} | 
|---|
|  |  |  | transform={(data) => { | 
|---|
|  |  |  | return data; | 
|---|
|  |  |  | 
|---|
|  |  |  | <NumberInput | 
|---|
|  |  |  | label="table.field.serialRuleItem.ruleId" | 
|---|
|  |  |  | source="ruleId" | 
|---|
|  |  |  | autoFocus | 
|---|
|  |  |  | defaultValue={record?.id} | 
|---|
|  |  |  | readOnly | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Grid> | 
|---|
|  |  |  | <Grid item xs={6} display="flex" gap={1}> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | <AutocompleteInput | 
|---|
|  |  |  | choices={dicts} | 
|---|
|  |  |  | optionText="label" | 
|---|
|  |  |  | label="table.field.serialRuleItem.wkType" | 
|---|
|  |  |  | source="wkType" | 
|---|
|  |  |  | optionValue="value" | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | validate={[required()]} /> | 
|---|
|  |  |  | </Grid> | 
|---|
|  |  |  | <Grid item xs={6} display="flex" gap={1}> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | 
|---|
|  |  |  | <NumberInput | 
|---|
|  |  |  | label="table.field.serialRuleItem.lenStr" | 
|---|
|  |  |  | source="lenStr" | 
|---|
|  |  |  | validate={required()} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Grid> | 
|---|
|  |  |  | <Grid item xs={6} display="flex" gap={1}> | 
|---|
|  |  |  | <NumberInput | 
|---|
|  |  |  | label="table.field.serialRuleItem.sort" | 
|---|
|  |  |  | source="sort" | 
|---|
|  |  |  | validate={required()} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Grid> | 
|---|
|  |  |  |  | 
|---|