From cacacd174940b1d155789d4ef6ab1b1af7ba473f Mon Sep 17 00:00:00 2001 From: goodm2ice Date: Mon, 28 Mar 2022 11:19:25 +0500 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B0=20?= =?UTF-8?q?=D1=81=20=D0=B8=D1=81=D1=87=D0=B5=D0=B7=D0=BD=D0=BE=D0=B2=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=D0=BC=20=D1=81=D1=82=D0=BE=D0=BB=D0=B1=D1=86?= =?UTF-8?q?=D0=B0=20"=D0=A7=D0=B0=D1=81=D1=8B"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WellOperations/WellOperationsEditor.jsx | 65 ++++++------------- 1 file changed, 19 insertions(+), 46 deletions(-) diff --git a/src/pages/WellOperations/WellOperationsEditor.jsx b/src/pages/WellOperations/WellOperationsEditor.jsx index 9ea77c4..49da840 100644 --- a/src/pages/WellOperations/WellOperationsEditor.jsx +++ b/src/pages/WellOperations/WellOperationsEditor.jsx @@ -27,8 +27,9 @@ const basePageSize = 160 const dayRender = makeNumericRender(2) const dayWithoutNptRender = (_, row) => dayRender((row.day ?? 0) - (row.nptHours ?? 0) / 24) -const defaultColumns = [ - makeSelectColumn('Конструкция секции', 'idWellSectionType', [], undefined, { +const generateColumns = (showNpt = false, categories = [], sectionTypes = []) => [ + makeSelectColumn('Конструкция секции', 'idWellSectionType', sectionTypes, undefined, { + sorter: makeNumericSorter('idWellSectionType'), editable: true, width: 160, formItemRules: [() => ({ @@ -39,7 +40,11 @@ const defaultColumns = [ } })], }), - makeSelectColumn('Операция', 'idCategory', [], undefined, { editable: true, width: 200 }), + makeSelectColumn('Операция', 'idCategory', categories, undefined, { + sorter: makeNumericSorter('idCategory'), + editable: true, + width: 200, + }), makeTextColumn('Доп. инфо', 'categoryInfo', null, null, null, { editable: true, width: 300, input: