| | |
| | | |
| | | const fetchAreaNames = async () => { |
| | | if (!record?.containerTypes || record.containerTypes.length === 0) return; |
| | | |
| | | |
| | | setLoading(true); |
| | | try { |
| | | try { |
| | | const res = await request.post(`/dictData/many/${record.containerTypes$.join(',')}`); |
| | | if (res?.data?.code === 200) { |
| | | setAreaNames(res.data.data || []); |
| | |
| | | }; |
| | | |
| | | React.useEffect(() => { |
| | | if (record?.containerTypes && record.containerTypes.length > 0) { |
| | | if (record?.containerTypes && record.containerTypes.length > 0) { |
| | | fetchAreaNames(); |
| | | } |
| | | }, [record]); |
| | | }, [record]); |
| | | |
| | | if (loading) { |
| | | return <CircularProgress size={20} />; |
| | |
| | | |
| | | return ( |
| | | <> |
| | | <Stack |
| | | direction="row" |
| | | gap={1} |
| | | flexWrap="wrap" |
| | | <Stack |
| | | direction="row" |
| | | gap={1} |
| | | flexWrap="wrap" |
| | | onClick={handleOpen} |
| | | sx={{ cursor: 'pointer' }} |
| | | > |
| | |
| | | )} |
| | | </Stack> |
| | | |
| | | <Dialog |
| | | open={open} |
| | | <Dialog |
| | | open={open} |
| | | onClose={handleClose} |
| | | maxWidth="md" |
| | | fullWidth |