| | |
| | | if (id === undefined || id === null || id === '') { |
| | | return '-'; |
| | | } |
| | | return map?.[id] || id; |
| | | return map?.[id] || '-'; |
| | | }; |
| | | |
| | | const formatReserveType = (value, translate) => |
| | |
| | | import MyField from "../components/MyField"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | import rowSx from "./rowSx"; |
| | | |
| | | const TYPE_FILTER_CHOICES = [ |
| | | { id: 'IN', name: 'page.sta.enums.type.in' }, |
| | |
| | | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, |
| | | |
| | | // <TextInput source="uuid" label="table.field.staReserve.uuid" />, |
| | | <ReferenceInput source="staId" label="table.field.staReserve.staId" reference="sta"> |
| | | <ReferenceInput source="staId" label="table.field.staReserve.staId" reference="sta" alwaysOn> |
| | | <AutocompleteInput label="table.field.staReserve.staId" optionText="staNo" filterToQuery={(val) => ({ staNo: val })} /> |
| | | </ReferenceInput>, |
| | | <ReferenceInput source="taskId" label="table.field.staReserve.taskId" reference="task"> |
| | |
| | | rowClick={(id, resource, record) => false} |
| | | expand={false} |
| | | expandSingle={true} |
| | | rowSx={rowSx(drawerVal || null)} |
| | | omit={['id', 'uuid', 'reason' |
| | | , 'uniqKey', 'name', 'segmentId' |
| | | , 'statusBool', 'updateBy', 'updateTime', 'createBy', 'memo']} |
| New file |
| | |
| | | import deepPurple from '@mui/material/colors/deepPurple'; |
| | | import teal from '@mui/material/colors/teal'; |
| | | import lightBlue from '@mui/material/colors/lightBlue'; |
| | | 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.type === 'IN') |
| | | return { |
| | | ...style, |
| | | borderLeftColor: teal[500], |
| | | borderLeftWidth: 5, |
| | | borderLeftStyle: 'solid', |
| | | }; |
| | | if (record.type === 'OUT') |
| | | return { |
| | | ...style, |
| | | borderLeftColor: lightBlue[500], |
| | | borderLeftWidth: 5, |
| | | borderLeftStyle: 'solid', |
| | | }; |
| | | if (record.statusBool) |
| | | return { |
| | | ...style, |
| | | borderLeftColor: grey[500], |
| | | borderLeftWidth: 5, |
| | | borderLeftStyle: 'solid', |
| | | }; |
| | | return style; |
| | | }; |
| | | |
| | | export default rowSx; |