| | |
| | | NumberInput, |
| | | BooleanInput, |
| | | DateInput, |
| | | DateTimeInput, |
| | | SaveButton, |
| | | SelectInput, |
| | | ReferenceInput, |
| | |
| | | useNotify, |
| | | Form, |
| | | useCreateController, |
| | | ArrayInput, |
| | | SimpleFormIterator, |
| | | } from 'react-admin'; |
| | | import { |
| | | Dialog, |
| | |
| | | <Grid container rowSpacing={2} columnSpacing={2}> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.bus.uuid" |
| | | source="uuid" |
| | | parse={v => v} |
| | | autoFocus |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.bus.busNo" |
| | | source="busNo" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <ReferenceInput |
| | | source="busSts" |
| | | reference="busSts" |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.bus.busSts" |
| | | optionText="name" |
| | | filterToQuery={(val) => ({ name: val })} |
| | | /> |
| | | </ReferenceInput> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.bus.phase" |
| | | source="phase" |
| | | parse={v => v} |
| | | <DateTimeInput |
| | | label="table.field.bus.startTime" |
| | | source="startTime" |
| | | /> |
| | | </Grid> |
| | | |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <StatusSelectInput /> |
| | | <Grid item xs={12} display="flex" gap={1}> |
| | | <ArrayInput |
| | | source="taskList" |
| | | validate={[required()]} |
| | | > |
| | | <SimpleFormIterator fullWidth getItemLabel={index => `#${index + 1}`}> |
| | | <Box mt={1} /> |
| | | <Stack direction="row" spacing={2}> |
| | | <TextInput source="seqNum" /> |
| | | <NumberInput source="priority" defaultValue={1} /> |
| | | </Stack> |
| | | <Stack direction="row" spacing={2}> |
| | | <ReferenceInput |
| | | source="oriSta" |
| | | reference="sta" |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.task.oriSta" |
| | | optionText="staNo" |
| | | filterToQuery={(val) => ({ staNo: val })} |
| | | /> |
| | | </ReferenceInput> |
| | | <ReferenceInput |
| | | source="oriLoc" |
| | | reference="loc" |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.task.oriLoc" |
| | | optionText="locNo" |
| | | filterToQuery={(val) => ({ locNo: val })} |
| | | /> |
| | | </ReferenceInput> |
| | | </Stack> |
| | | <Stack direction="row" spacing={2}> |
| | | <ReferenceInput |
| | | source="destSta" |
| | | reference="sta" |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.task.destSta" |
| | | optionText="staNo" |
| | | filterToQuery={(val) => ({ staNo: val })} |
| | | /> |
| | | </ReferenceInput> |
| | | <ReferenceInput |
| | | source="destLoc" |
| | | reference="loc" |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.task.destLoc" |
| | | optionText="locNo" |
| | | filterToQuery={(val) => ({ locNo: val })} |
| | | /> |
| | | </ReferenceInput> |
| | | </Stack> |
| | | </SimpleFormIterator> |
| | | </ArrayInput> |
| | | </Grid> |
| | | <Grid item xs={12} display="flex" gap={1}> |
| | | <Stack direction="column" spacing={1} width={'100%'}> |