forked from ddrilling/asb_cloud_front
WellOperation. Add default startDate, fix durationColumn render
This commit is contained in:
parent
0b377d11c6
commit
0b75d8240e
@ -19,21 +19,22 @@ const { TextArea } = Input;
|
|||||||
const basePageSize = 160;
|
const basePageSize = 160;
|
||||||
const format='YYYY.MM.DD HH:mm'
|
const format='YYYY.MM.DD HH:mm'
|
||||||
|
|
||||||
const numericSortColumnOptions = Object.assign({
|
const numericSortColumnOptions = {
|
||||||
|
...numericColumnOptions,
|
||||||
sorter: makeNumericSorter('wellDepth'),
|
sorter: makeNumericSorter('wellDepth'),
|
||||||
render:(value) =>
|
render:(value) =>
|
||||||
<div className='text-align-r-container'>
|
<div className='text-align-r-container'>
|
||||||
<span>{value}</span>
|
<span>{value}</span>
|
||||||
</div>
|
</div>
|
||||||
}, numericColumnOptions)
|
}
|
||||||
|
|
||||||
const durationFormattedColumnOptions = Object.assign({
|
const durationFormattedColumnOptions = {
|
||||||
|
...numericColumnOptions,
|
||||||
render:(value) =>
|
render:(value) =>
|
||||||
<div className='text-align-r-container'>
|
<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>
|
</div>
|
||||||
}, numericColumnOptions)
|
}
|
||||||
|
|
||||||
|
|
||||||
export const WellOperationsEditor = ({idWell, idType}) => {
|
export const WellOperationsEditor = ({idWell, idType}) => {
|
||||||
const [pageNumAndPageSize, setPageNumAndPageSize] = useState({current:1, pageSize:basePageSize})
|
const [pageNumAndPageSize, setPageNumAndPageSize] = useState({current:1, pageSize:basePageSize})
|
||||||
@ -72,7 +73,7 @@ export const WellOperationsEditor = ({idWell, idType}) => {
|
|||||||
makeColumn('Конструкция секции','idWellSectionType', {
|
makeColumn('Конструкция секции','idWellSectionType', {
|
||||||
editable:true,
|
editable:true,
|
||||||
input:<SelectFromDictionary dictionary={dictionarySectionType}/>,
|
input:<SelectFromDictionary dictionary={dictionarySectionType}/>,
|
||||||
width:110,
|
width:160,
|
||||||
render:(_, record)=>getByKeyOrReturnKey(dictionarySectionType, record.idWellSectionType)
|
render:(_, record)=>getByKeyOrReturnKey(dictionarySectionType, record.idWellSectionType)
|
||||||
}),
|
}),
|
||||||
makeColumn('Операция','idCategory', {
|
makeColumn('Операция','idCategory', {
|
||||||
@ -87,7 +88,8 @@ export const WellOperationsEditor = ({idWell, idType}) => {
|
|||||||
editable:true,
|
editable:true,
|
||||||
width:200,
|
width:200,
|
||||||
input:<DatePickerWrapper/>,
|
input:<DatePickerWrapper/>,
|
||||||
sorter: makeDateSorter('startDate'),
|
initialValue:moment().format(),
|
||||||
|
sorter: makeDateSorter('startDate'),
|
||||||
render:(_, record) =>
|
render:(_, record) =>
|
||||||
<div className={'text-align-r-container'}>
|
<div className={'text-align-r-container'}>
|
||||||
<span>{moment.utc(record.startDate).local().format(format)}</span>
|
<span>{moment.utc(record.startDate).local().format(format)}</span>
|
||||||
|
Loading…
Reference in New Issue
Block a user