From b3a57aab83e0e696707b1ffde99599c14b989b73 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期一, 23 九月 2024 10:26:00 +0800
Subject: [PATCH] #

---
 zy-acs-flow/src/page/bus/BusCreate.jsx |   90 ++++++++++++++++++++++++++++++++-------------
 1 files changed, 64 insertions(+), 26 deletions(-)

diff --git a/zy-acs-flow/src/page/bus/BusCreate.jsx b/zy-acs-flow/src/page/bus/BusCreate.jsx
index 1dc547e..f9f7af5 100644
--- a/zy-acs-flow/src/page/bus/BusCreate.jsx
+++ b/zy-acs-flow/src/page/bus/BusCreate.jsx
@@ -6,6 +6,7 @@
     NumberInput,
     BooleanInput,
     DateInput,
+    DateTimeInput,
     SaveButton,
     SelectInput,
     ReferenceInput,
@@ -17,6 +18,8 @@
     useNotify,
     Form,
     useCreateController,
+    ArrayInput,
+    SimpleFormIterator,
 } from 'react-admin';
 import {
     Dialog,
@@ -86,41 +89,76 @@
                             <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%'}>

--
Gitblit v1.9.1