forked from ddrilling/asb_cloud_front
Added align: right to numeric EditableCells in Operations table
This commit is contained in:
parent
0b18324a47
commit
75657398c6
@ -20,11 +20,18 @@ const basePageSize = 160;
|
|||||||
const format='YYYY.MM.DD HH:mm'
|
const format='YYYY.MM.DD HH:mm'
|
||||||
|
|
||||||
const numericSortColumnOptions = Object.assign({
|
const numericSortColumnOptions = Object.assign({
|
||||||
sorter: makeNumericSorter('wellDepth')
|
sorter: makeNumericSorter('wellDepth'),
|
||||||
|
render:(value) =>
|
||||||
|
<div className='text-align-r-container'>
|
||||||
|
<span>{value}</span>
|
||||||
|
</div>
|
||||||
}, numericColumnOptions)
|
}, numericColumnOptions)
|
||||||
|
|
||||||
const durationFormattedColumnOptions = Object.assign({
|
const durationFormattedColumnOptions = Object.assign({
|
||||||
render:(value) => Number.isNaN(value.toFixed(2)) ? "-" : value.toFixed(2)
|
render:(value) =>
|
||||||
|
<div className='text-align-r-container'>
|
||||||
|
<span>{Number.isNaN(value.toFixed(2)) ? "-" : value.toFixed(2)}</span>
|
||||||
|
</div>
|
||||||
}, numericColumnOptions)
|
}, numericColumnOptions)
|
||||||
|
|
||||||
|
|
||||||
@ -81,7 +88,10 @@ export const WellOperationsEditor = ({idWell, idType}) => {
|
|||||||
width:200,
|
width:200,
|
||||||
input:<DatePickerWrapper/>,
|
input:<DatePickerWrapper/>,
|
||||||
sorter: makeDateSorter('startDate'),
|
sorter: makeDateSorter('startDate'),
|
||||||
render:(_, record) => moment.utc(record.startDate).local().format(format)
|
render:(_, record) =>
|
||||||
|
<div className={'text-align-r-container'}>
|
||||||
|
<span>{moment.utc(record.startDate).local().format(format)}</span>
|
||||||
|
</div>
|
||||||
}),
|
}),
|
||||||
makeColumn('Часы','durationHours', durationFormattedColumnOptions),
|
makeColumn('Часы','durationHours', durationFormattedColumnOptions),
|
||||||
makeColumn('Комментарий','comment', {editable:true, input:<TextArea/>}),
|
makeColumn('Комментарий','comment', {editable:true, input:<TextArea/>}),
|
||||||
|
@ -43,6 +43,11 @@ body {
|
|||||||
vertical-align: center;
|
vertical-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.text-align-r-container {
|
||||||
|
width: 100%;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
code {
|
code {
|
||||||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
|
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
|
||||||
monospace;
|
monospace;
|
||||||
|
Loading…
Reference in New Issue
Block a user