From 0b75d8240ec69670ef4f8bd07009daf09bb9c90c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=80=D0=BE=D0=BB=D0=BE=D0=B2?= Date: Fri, 3 Sep 2021 15:29:54 +0500 Subject: [PATCH] WellOperation. Add default startDate, fix durationColumn render --- .../WellOperations/WellOperationsEditor.jsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/pages/WellOperations/WellOperationsEditor.jsx b/src/pages/WellOperations/WellOperationsEditor.jsx index 25daed9..6517219 100644 --- a/src/pages/WellOperations/WellOperationsEditor.jsx +++ b/src/pages/WellOperations/WellOperationsEditor.jsx @@ -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) =>
{value}
-}, numericColumnOptions) +} -const durationFormattedColumnOptions = Object.assign({ +const durationFormattedColumnOptions = { + ...numericColumnOptions, render:(value) =>
- {Number.isNaN(value.toFixed(2)) ? "-" : value.toFixed(2)} + {Number.isNaN(+value) ? "-" : value.toFixed(2)}
-}, 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:, - width:110, + width:160, render:(_, record)=>getByKeyOrReturnKey(dictionarySectionType, record.idWellSectionType) }), makeColumn('Операция','idCategory', { @@ -87,7 +88,8 @@ export const WellOperationsEditor = ({idWell, idType}) => { editable:true, width:200, input:, - sorter: makeDateSorter('startDate'), + initialValue:moment().format(), + sorter: makeDateSorter('startDate'), render:(_, record) =>
{moment.utc(record.startDate).local().format(format)}