From 85d633de7cc9b21810c12b8f5e14eb86565bd7ae Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期四, 10 四月 2025 11:16:06 +0800 Subject: [PATCH] 规则编码优化 --- rsf-admin/src/page/system/serialRule/SerialRuleEdit.jsx | 156 +++++++++++++++++++++++++--------------------------- 1 files changed, 75 insertions(+), 81 deletions(-) diff --git a/rsf-admin/src/page/system/serialRule/SerialRuleEdit.jsx b/rsf-admin/src/page/system/serialRule/SerialRuleEdit.jsx index 4440c43..53cf77d 100644 --- a/rsf-admin/src/page/system/serialRule/SerialRuleEdit.jsx +++ b/rsf-admin/src/page/system/serialRule/SerialRuleEdit.jsx @@ -28,12 +28,13 @@ import CustomerTopToolBar from "../../components/EditTopToolBar"; import MemoInput from "../../components/MemoInput"; import StatusSelectInput from "../../components/StatusSelectInput"; +import SerialRuleItemList from "./SerialRuleItemList"; const FormToolbar = () => { const { getValues } = useFormContext(); return ( - <Toolbar sx={{ justifyContent: 'space-between' }}> + <Toolbar sx={{ justifyContent: 'end' }}> <SaveButton /> <DeleteButton mutationMode="optimistic" /> </Toolbar> @@ -44,89 +45,82 @@ const translate = useTranslate(); return ( - <Edit - redirect="list" - mutationMode={EDIT_MODE} - actions={<CustomerTopToolBar />} - aside={<EditBaseAside />} - > - <SimpleForm - shouldUnregister - warnWhenUnsavedChanges - toolbar={<FormToolbar />} - mode="onTouched" - defaultValues={{}} - // validate={(values) => { }} + <> + <Edit + redirect="list" + mutationMode={EDIT_MODE} + actions={<CustomerTopToolBar />} + aside={<EditBaseAside />} > - <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}> - <Grid item xs={12} md={8}> - <Typography variant="h6" gutterBottom> - {translate('common.edit.title.main')} - </Typography> - <Stack direction='row' gap={2}> - <TextInput - label="table.field.serialRule.code" - source="code" - parse={v => v} - autoFocus - /> - </Stack> - <Stack direction='row' gap={2}> - <TextInput - label="table.field.serialRule.name" - source="name" - parse={v => v} - /> - </Stack> - <Stack direction='row' gap={2}> - <TextInput - label="table.field.serialRule.delimit" - source="delimit" - parse={v => v} - /> - </Stack> - <Stack direction='row' gap={2}> - <TextInput - label="table.field.serialRule.reset" - source="reset" - parse={v => v} - validate={required()} - /> - </Stack> - <Stack direction='row' gap={2}> - <TextInput - label="table.field.serialRule.resetDep" - source="resetDep" - parse={v => v} - /> - </Stack> - <Stack direction='row' gap={2}> - <TextInput - label="table.field.serialRule.currValue" - source="currValue" - parse={v => v} - /> - </Stack> - <Stack direction='row' gap={2}> - <TextInput - label="table.field.serialRule.lastCode" - source="lastCode" - parse={v => v} - /> - </Stack> + <SimpleForm + shouldUnregister + warnWhenUnsavedChanges + toolbar={<FormToolbar />} + mode="onTouched" + defaultValues={{}} + // validate={(values) => { }} + > + <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}> + <Grid item xs={12} md={8}> + <Typography variant="h6" gutterBottom> + {translate('common.edit.title.main')} + </Typography> + <Stack direction='row' gap={2}> + <TextInput + label="table.field.serialRule.code" + source="code" + parse={v => v} + readOnly + /> + <TextInput + label="table.field.serialRule.name" + source="name" + parse={v => v} + /> + <TextInput + label="table.field.serialRule.delimit" + source="delimit" + parse={v => v} + /> + </Stack> + <Stack direction='row' gap={2}> + <TextInput + label="table.field.serialRule.reset" + source="reset" + parse={v => v} + validate={required()} + /> + <TextInput + label="table.field.serialRule.resetDep" + source="resetDep" + parse={v => v} + /> + <TextInput + label="table.field.serialRule.currValue" + source="currValue" + parse={v => v} + /> + <TextInput + label="table.field.serialRule.lastCode" + source="lastCode" + parse={v => v} + /> + </Stack> + </Grid> + <Grid item xs={12} md={4}> + <Typography variant="h6" gutterBottom> + {translate('common.edit.title.common')} + </Typography> + <StatusSelectInput /> + <Box mt="2em" /> + <MemoInput /> + </Grid> </Grid> - <Grid item xs={12} md={4}> - <Typography variant="h6" gutterBottom> - {translate('common.edit.title.common')} - </Typography> - <StatusSelectInput /> - <Box mt="2em" /> - <MemoInput /> - </Grid> - </Grid> - </SimpleForm> - </Edit > + </SimpleForm> + </Edit > + <SerialRuleItemList></SerialRuleItemList> + </> ) } -- Gitblit v1.9.1