|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const SerialRuleEdit = () => { | 
|---|
|  |  |  | const translate = useTranslate(); | 
|---|
|  |  |  | const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_task_reset_type')) || []; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | <> | 
|---|
|  |  |  | 
|---|
|  |  |  | defaultValues={{}} | 
|---|
|  |  |  | // validate={(values) => { }} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}> | 
|---|
|  |  |  | <Grid item xs={12} md={8}> | 
|---|
|  |  |  | <Grid container width={{ xs: '100%', xl: '90%' }} rowSpacing={3} columnSpacing={3}> | 
|---|
|  |  |  | <Grid item xs={16} md={10}> | 
|---|
|  |  |  | <Typography variant="h6" gutterBottom> | 
|---|
|  |  |  | {translate('common.edit.title.main')} | 
|---|
|  |  |  | </Typography> | 
|---|
|  |  |  | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | <AutocompleteInput | 
|---|
|  |  |  | choices={dicts} | 
|---|
|  |  |  | optionText="label" | 
|---|
|  |  |  | label="table.field.serialRule.reset" | 
|---|
|  |  |  | source="reset" | 
|---|
|  |  |  | optionValue="value" | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | validate={required()} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | validate={[required()]} /> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.serialRule.resetDep" | 
|---|
|  |  |  | source="resetDep" | 
|---|
|  |  |  | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </Grid> | 
|---|
|  |  |  | <Grid item xs={12} md={4}> | 
|---|
|  |  |  | <Grid item xs={8} md={2}> | 
|---|
|  |  |  | <Typography variant="h6" gutterBottom> | 
|---|
|  |  |  | {translate('common.edit.title.common')} | 
|---|
|  |  |  | </Typography> | 
|---|