From 2a6e27f1c0064690d6fc6ab137d64c02fc0742da Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期一, 16 六月 2025 16:16:09 +0800
Subject: [PATCH] 1
---
zy-acs-flow/src/page/sta/StaCreate.jsx | 59 ++++++++++++++++++++++++++++++++++-------------------------
1 files changed, 34 insertions(+), 25 deletions(-)
diff --git a/zy-acs-flow/src/page/sta/StaCreate.jsx b/zy-acs-flow/src/page/sta/StaCreate.jsx
index 4e923b1..8cc6844 100644
--- a/zy-acs-flow/src/page/sta/StaCreate.jsx
+++ b/zy-acs-flow/src/page/sta/StaCreate.jsx
@@ -48,8 +48,8 @@
notify('common.response.success');
};
- const handleError = async (data) => {
- notify('common.response.fail');
+ const handleError = async (error) => {
+ notify(error.message || 'common.response.fail', { type: 'error', messageArgs: { _: error.message } });
};
return (
@@ -85,14 +85,6 @@
<DialogContent>
<Grid container rowSpacing={2} columnSpacing={2}>
<Grid item xs={6} display="flex" gap={1}>
- <TextInput
- label="table.field.sta.uuid"
- source="uuid"
- parse={v => v}
- autoFocus
- />
- </Grid>
- <Grid item xs={6} display="flex" gap={1}>
<ReferenceInput
source="zoneId"
reference="zone"
@@ -100,24 +92,35 @@
<AutocompleteInput
label="table.field.sta.zoneId"
optionText="name"
+ filterToQuery={(val) => ({ name: val })}
+ validate={required()}
/>
</ReferenceInput>
</Grid>
+ {/* <Grid item xs={6} display="flex" gap={1}>
+ <TextInput
+ label="table.field.sta.uuid"
+ source="uuid"
+ parse={v => v}
+ autoFocus
+ />
+ </Grid> */}
<Grid item xs={6} display="flex" gap={1}>
<TextInput
label="table.field.sta.staNo"
source="staNo"
parse={v => v}
+ validate={required()}
/>
</Grid>
- <Grid item xs={6} display="flex" gap={1}>
+ {/* <Grid item xs={6} display="flex" gap={1}>
<TextInput
label="table.field.sta.name"
source="name"
parse={v => v}
/>
- </Grid>
- <Grid item xs={6} display="flex" gap={1}>
+ </Grid> */}
+ {/* <Grid item xs={6} display="flex" gap={1}>
<ReferenceInput
source="staType"
reference="staType"
@@ -125,10 +128,11 @@
<AutocompleteInput
label="table.field.sta.staType"
optionText="name"
+ filterToQuery={(val) => ({ name: val })}
validate={required()}
/>
</ReferenceInput>
- </Grid>
+ </Grid> */}
<Grid item xs={6} display="flex" gap={1}>
<ReferenceInput
source="code"
@@ -136,7 +140,9 @@
>
<AutocompleteInput
label="table.field.sta.code"
- optionText="uuid"
+ optionText="data"
+ filterToQuery={(val) => ({ data: val })}
+ validate={required()}
/>
</ReferenceInput>
</Grid>
@@ -144,43 +150,44 @@
<NumberInput
label="table.field.sta.offset"
source="offset"
+ validate={required()}
/>
</Grid>
- <Grid item xs={6} display="flex" gap={1}>
+ {/* <Grid item xs={6} display="flex" gap={1}>
<TextInput
label="table.field.sta.autoing"
source="autoing"
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.sta.loading"
source="loading"
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.sta.inEnable"
source="inEnable"
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.sta.outEnable"
source="outEnable"
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.sta.zpallet"
source="zpallet"
parse={v => v}
/>
- </Grid>
+ </Grid> */}
<Grid item xs={6} display="flex" gap={1}>
<ReferenceInput
source="staSts"
@@ -189,6 +196,8 @@
<AutocompleteInput
label="table.field.sta.staSts"
optionText="name"
+ filterToQuery={(val) => ({ name: val })}
+ validate={required()}
/>
</ReferenceInput>
</Grid>
--
Gitblit v1.9.1