WellOperation. Add default startDate, fix durationColumn render

This commit is contained in:
Фролов 2021-09-03 15:29:54 +05:00
parent 0b377d11c6
commit 0b75d8240e

View File

@ -19,21 +19,22 @@ const { TextArea } = Input;
const basePageSize = 160;
const format='YYYY.MM.DD HH:mm'
const numericSortColumnOptions = Object.assign({
const numericSortColumnOptions = {
...numericColumnOptions,
sorter: makeNumericSorter('wellDepth'),
render:(value) =>
<div className='text-align-r-container'>
<span>{value}</span>
</div>
}, numericColumnOptions)
}
const durationFormattedColumnOptions = Object.assign({
const durationFormattedColumnOptions = {
...numericColumnOptions,
render:(value) =>
<div className='text-align-r-container'>
<span>{Number.isNaN(value.toFixed(2)) ? "-" : value.toFixed(2)}</span>
<span>{Number.isNaN(+value) ? "-" : value.toFixed(2)}</span>
</div>
}, numericColumnOptions)
}
export const WellOperationsEditor = ({idWell, idType}) => {
const [pageNumAndPageSize, setPageNumAndPageSize] = useState({current:1, pageSize:basePageSize})
@ -72,7 +73,7 @@ export const WellOperationsEditor = ({idWell, idType}) => {
makeColumn('Конструкция секции','idWellSectionType', {
editable:true,
input:<SelectFromDictionary dictionary={dictionarySectionType}/>,
width:110,
width:160,
render:(_, record)=>getByKeyOrReturnKey(dictionarySectionType, record.idWellSectionType)
}),
makeColumn('Операция','idCategory', {
@ -87,6 +88,7 @@ export const WellOperationsEditor = ({idWell, idType}) => {
editable:true,
width:200,
input:<DatePickerWrapper/>,
initialValue:moment().format(),
sorter: makeDateSorter('startDate'),
render:(_, record) =>
<div className={'text-align-r-container'}>