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: