|  |  | 
 |  |  |     }; | 
 |  |  |  | 
 |  |  |     const handleSubmit = () => { | 
 |  |  |         setOpen(false); | 
 |  |  |         refresh(); | 
 |  |  |         const selectedData = selectedRows.map(id => tableData.find(row => row.id === id)); | 
 |  |  |         setData(selectedData); | 
 |  |  |  | 
 |  |  |         const value = selectedData.map((el => { | 
 |  |  |             return { | 
 |  |  |                 matnrId: el.id, | 
 |  |  |                 maktx: el.name, | 
 |  |  |                 stockUnit: el.stockUnit || '', | 
 |  |  |                 purUnit: el.purchaseUnit || '', | 
 |  |  |             } | 
 |  |  |         })) | 
 |  |  |         setData(value); | 
 |  |  |         setOpen(false); | 
 |  |  |         // refresh(); | 
 |  |  |     }; | 
 |  |  |  | 
 |  |  |     const getData = async () => { | 
 |  |  |         const res = await request.post(`/matnr/page`, { | 
 |  |  |             pageSize: 99 | 
 |  |  |             ...formData, | 
 |  |  |             pageSize: 199 | 
 |  |  |         }); | 
 |  |  |         if (res?.data?.code === 200) { | 
 |  |  |             setTableData(res.data.data.records); | 
 |  |  | 
 |  |  |     }, []); | 
 |  |  |  | 
 |  |  |     const handleSearch = () => { | 
 |  |  |         // 这里可以添加搜索逻辑 | 
 |  |  |         getData() | 
 |  |  |     }; | 
 |  |  |  | 
 |  |  |     return ( | 
 |  |  | 
 |  |  |             <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}> | 
 |  |  |                 <Box sx={{ width: '100%', display: 'flex', justifyContent: 'space-between' }}> | 
 |  |  |                     <Button onClick={handleSubmit} variant="contained" startIcon={<SaveIcon />}> | 
 |  |  |                         确认 | 
 |  |  |                         {translate('toolbar.confirm')} | 
 |  |  |                     </Button> | 
 |  |  |                 </Box> | 
 |  |  |             </DialogActions> | 
 |  |  | 
 |  |  |     ]; | 
 |  |  |  | 
 |  |  |     const handleSelectionChange = (ids) => { | 
 |  |  |         const selectedData = ids.map((id) => tableData.find((row) => row.id === id)); | 
 |  |  |         // setSelectedRows(selectedData); | 
 |  |  |         // setSelectedRows(ids); | 
 |  |  |         console.log(selectedData) | 
 |  |  |         setSelectedRows(ids) | 
 |  |  |  | 
 |  |  |     }; | 
 |  |  |  | 
 |  |  |     return ( | 
 |  |  | 
 |  |  |                 disableColumnMenu={true} | 
 |  |  |                 disableColumnSorting | 
 |  |  |                 disableMultipleColumnsSorting | 
 |  |  |                 autoPageSize | 
 |  |  |                 columnBufferPx={100} | 
 |  |  |             /> | 
 |  |  |         </div> | 
 |  |  |     ); |