Added align: right to numeric EditableCells in Operations table

This commit is contained in:
KharchenkoVV 2021-09-01 11:58:50 +05:00
parent 0b18324a47
commit 75657398c6
2 changed files with 18 additions and 3 deletions

View File

@ -20,11 +20,18 @@ const basePageSize = 160;
const format='YYYY.MM.DD HH:mm'
const numericSortColumnOptions = Object.assign({
sorter: makeNumericSorter('wellDepth')
sorter: makeNumericSorter('wellDepth'),
render:(value) =>
<div className='text-align-r-container'>
<span>{value}</span>
</div>
}, numericColumnOptions)
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)
@ -81,7 +88,10 @@ export const WellOperationsEditor = ({idWell, idType}) => {
width:200,
input:<DatePickerWrapper/>,
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('Комментарий','comment', {editable:true, input:<TextArea/>}),

View File

@ -43,6 +43,11 @@ body {
vertical-align: center;
}
.text-align-r-container {
width: 100%;
text-align: right;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;