| | |
| | | useDataProvider, |
| | | useNotify, |
| | | Form, |
| | | SelectArrayInput, |
| | | useCreateController, |
| | | } from 'react-admin'; |
| | | import { |
| | |
| | | |
| | | const LocCreate = (props) => { |
| | | const { open, setOpen } = props; |
| | | const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_loc_type')) || []; |
| | | |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.loc.type" |
| | | {/* <ReferenceInput |
| | | source="type" |
| | | reference="dictData" |
| | | filter={{ dictTypeCode: 'sys_loc_type' }} |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.loc.type" |
| | | optionText="label" |
| | | optionValue="value" |
| | | parse={v => v} |
| | | validate={[required()]} |
| | | /> |
| | | </ReferenceInput> */} |
| | | {/* <AutocompleteInput |
| | | choices={dicts} |
| | | source="type" |
| | | optionText="label" |
| | | label="table.field.loc.type" |
| | | optionValue="value" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | validate={[required()]} |
| | | /> */} |
| | | <ReferenceArrayInput source="typeIds" reference="locType" > |
| | | <SelectArrayInput label="table.field.loc.type" /> |
| | | </ReferenceArrayInput> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | {/* <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.loc.name" |
| | | source="name" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | </Grid> */} |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.loc.flagLogic" |
| | |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | {/* <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.loc.unit" |
| | | source="unit" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | </Grid> */} |
| | | {/* <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.loc.size" |
| | | source="size" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> */} |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.loc.length" |
| | | source="length" |
| | | validate={required()} |
| | | /> |
| | | <NumberInput |
| | | label="table.field.loc.width" |
| | | source="width" |
| | | validate={required()} |
| | | /> |
| | | <NumberInput |
| | | label="table.field.loc.height" |
| | | source="height" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.loc.row" |
| | | source="lrow" |
| | | source="row" |
| | | validate={required()} |
| | | /> |
| | | <NumberInput |