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.staSts$ === '无货')
|
return {
|
...style,
|
borderLeftColor: green[500],
|
borderLeftWidth: 5,
|
borderLeftStyle: 'solid',
|
};
|
if (record.staSts$ === '有货')
|
return {
|
...style,
|
borderLeftColor: blue[500],
|
borderLeftWidth: 5,
|
borderLeftStyle: 'solid',
|
};
|
if (record.staSts$ === '禁用')
|
return {
|
...style,
|
borderLeftColor: red[500],
|
borderLeftWidth: 5,
|
borderLeftStyle: 'solid',
|
};
|
if (record.staSts$ === '放货预约')
|
return {
|
...style,
|
borderLeftColor: orange[500],
|
borderLeftWidth: 5,
|
borderLeftStyle: 'solid',
|
};
|
if (record.staSts$ === '取货预约')
|
return {
|
...style,
|
borderLeftColor: orange[500],
|
borderLeftWidth: 5,
|
borderLeftStyle: 'solid',
|
};
|
if (record.staSts$ === '其他')
|
return {
|
...style,
|
borderLeftColor: grey[500],
|
borderLeftWidth: 5,
|
borderLeftStyle: 'solid',
|
};
|
return style;
|
};
|
|
export default rowSx;
|