<Autocomplete
sx={{ width: '400px', alignSelf: 'center', marginTop: '16px' }}
disablePortal
id='equip_type'
options={partList}
getOptionLabel={(option: any) => option.part_name}
onInputChange={(event: any, newValue: string | null) => {
//按照名称查找ID
const item = partList.filter((it: any) => it['part_name'] === newValue);
if (item.length > 0) {
partIdRef.current = item[0].id;
}
}}
renderInput={(params) => <MuiTextField {...params} label='部位类型' />}
/>
const partIdRef = useRef<number>();