| import green from '@mui/material/colors/green'; | 
| import orange from '@mui/material/colors/orange'; | 
| import red from '@mui/material/colors/red'; | 
| import blue from '@mui/material/colors/blue'; | 
| import grey from '@mui/material/colors/grey'; | 
|   | 
| const rowSx = (selectedRow) => (record) => { | 
|     let style = {}; | 
|     if (!record) { | 
|         return style; | 
|     } | 
|     if (selectedRow && selectedRow.id === record.id) { | 
|         style = { | 
|             ...style, | 
|             backgroundColor: 'action.selected', | 
|         }; | 
|     } | 
|     if (record.locSts$ === '空闲') | 
|         return { | 
|             ...style, | 
|             borderLeftColor: green[500], | 
|             borderLeftWidth: 5, | 
|             borderLeftStyle: 'solid', | 
|         }; | 
|     if (record.locSts$ === '在库') | 
|         return { | 
|             ...style, | 
|             borderLeftColor: blue[500], | 
|             borderLeftWidth: 5, | 
|             borderLeftStyle: 'solid', | 
|         }; | 
|     if (record.locSts$ === '禁用') | 
|         return { | 
|             ...style, | 
|             borderLeftColor: red[500], | 
|             borderLeftWidth: 5, | 
|             borderLeftStyle: 'solid', | 
|         }; | 
|     if (record.locSts$ === '入库预约') | 
|         return { | 
|             ...style, | 
|             borderLeftColor: orange[500], | 
|             borderLeftWidth: 5, | 
|             borderLeftStyle: 'solid', | 
|         }; | 
|     if (record.locSts$ === '出库预约') | 
|         return { | 
|             ...style, | 
|             borderLeftColor: orange[500], | 
|             borderLeftWidth: 5, | 
|             borderLeftStyle: 'solid', | 
|         }; | 
|     if (record.locSts$ === '其他') | 
|         return { | 
|             ...style, | 
|             borderLeftColor: grey[500], | 
|             borderLeftWidth: 5, | 
|             borderLeftStyle: 'solid', | 
|         }; | 
|     return style; | 
| }; | 
|   | 
| export default rowSx; |