From fbe86e23f6965a1d07943294c9b86e880f1de774 Mon Sep 17 00:00:00 2001 From: ts_salikhov Date: Mon, 5 Sep 2022 14:51:43 +0400 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=BE=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=D1=82=D1=80=D0=BE=D0=BA=20?= =?UTF-8?q?=D0=B2=20=D1=82=D0=B0=D0=B1=D0=BB=D0=B8=D1=86=D0=B0=D1=85=20?= =?UTF-8?q?=D0=B2=D0=BE=20=D0=B2=D0=BA=D0=BB=D0=B0=D0=B4=D0=BA=D0=B5=20?= =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D1=80=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Measure/MeasureTable.jsx | 4 +- src/pages/Measure/View.jsx | 87 ++++++++++++-------------- src/pages/Measure/drillingFluidData.js | 62 +++++++++--------- src/pages/Measure/index.jsx | 15 ----- src/pages/Measure/mudDiagramData.js | 50 ++++++++------- src/pages/Measure/nnbData.js | 40 +++++++----- 6 files changed, 127 insertions(+), 131 deletions(-) diff --git a/src/pages/Measure/MeasureTable.jsx b/src/pages/Measure/MeasureTable.jsx index 9ba5ac7..bd4087b 100755 --- a/src/pages/Measure/MeasureTable.jsx +++ b/src/pages/Measure/MeasureTable.jsx @@ -21,7 +21,7 @@ import '@styles/index.css' import '@styles/measure.css' const createEditingColumns = (cols, renderDelegate) => - cols.map(col => ({ render: renderDelegate, ...col })) + cols.map(col => col.map(col => ({ render: renderDelegate, ...col }))) const disabled = !hasPermission('Measure.edit') @@ -156,7 +156,7 @@ export const MeasureTable = memo(({ group, updateMeasuresFunc, additionalButtons
- +
diff --git a/src/pages/Measure/View.jsx b/src/pages/Measure/View.jsx index cf3911e..e87fd96 100755 --- a/src/pages/Measure/View.jsx +++ b/src/pages/Measure/View.jsx @@ -6,56 +6,49 @@ import { Grid, GridItem } from '@components/Grid' import '@styles/index.css' import '@styles/measure.css' -export const View = memo(({ columns, item, rowsInColumn }) => { - let rowPosition = 0 - let columnPosition = 1 - return !item || !columns?.length ? ( +export const View = memo(({ columns, item }) => !item || !columns?.length ? ( ) : ( - {columns.map((column, i) => { - if (i === rowsInColumn.first) { - columnPosition = 3 - rowPosition = 0 - } else if (i === rowsInColumn.second) { - columnPosition = 5 - rowPosition = 0 - } - rowPosition++ - - return ( - - - {column.title} - - - - {column.render ? ( - { + let rowPosition = 0 + let columnPosition = 1 + j * 2 + return cols.map((column) => { + rowPosition++ + return ( + + - {column.render(item[column.dataIndex])} - - ) : ( -

- {item[column.dataIndex]} -

- )} -
-
- )})} + {column.title} + + + + {column.render ? ( + + {column.render(item[column.dataIndex])} + + ) : ( +

+ {item[column.dataIndex]} +

+ )} +
+ + )}) + }).flat()}
-)}) +)) diff --git a/src/pages/Measure/drillingFluidData.js b/src/pages/Measure/drillingFluidData.js index 938ec99..123479d 100755 --- a/src/pages/Measure/drillingFluidData.js +++ b/src/pages/Measure/drillingFluidData.js @@ -3,34 +3,40 @@ import { makeColumn } from '@components/Table' import { numericColumnOptions, textColumnOptions } from './columnsCommon' export const columnsDrillingFluid = [ - makeColumn('Наименование', 'name', textColumnOptions), - makeColumn('Температура, °C', 'temperature', numericColumnOptions), - makeColumn('Плотность, г/см³', 'density', numericColumnOptions), - makeColumn('Усл. вязкость, сек', 'conditionalViscosity', numericColumnOptions), - makeColumn('R300', 'r300', numericColumnOptions), - makeColumn('R600', 'r600', numericColumnOptions), - makeColumn('R3/R6', 'r3r6', numericColumnOptions), - makeColumn('ДНС, дПа', 'dnsDpa', numericColumnOptions), - makeColumn('Пластич. вязкость, сПз', 'plasticViscocity', numericColumnOptions), - makeColumn('СНС, дПа', 'snsDpa', numericColumnOptions), - makeColumn('R3/R6 49С', 'r3r649С', numericColumnOptions), - makeColumn('ДНС 49С, дПа', 'dns49Cdpa', numericColumnOptions), - makeColumn('Пластич. вязкость 49С, сПз', 'plasticViscocity49c', numericColumnOptions), - makeColumn('СНС 49С, дПа', 'sns49Cdpa', numericColumnOptions), - makeColumn('МВТ, кг/м³', 'mbt', numericColumnOptions), - makeColumn('Песок, %', 'sand', numericColumnOptions), - makeColumn('Фильтрация, см³/30мин', 'filtering', numericColumnOptions), - makeColumn('Корка, мм', 'crust', numericColumnOptions), - makeColumn('KTK', 'ktk', numericColumnOptions), - makeColumn('pH', 'ph', numericColumnOptions), - makeColumn('Жесткость, мг/л', 'hardness', numericColumnOptions), - makeColumn('Хлориды, мг/л', 'chlorides', numericColumnOptions), - makeColumn('PF', 'pf', numericColumnOptions), - makeColumn('Mf', 'mf', numericColumnOptions), - makeColumn('Pm', 'pm', numericColumnOptions), - makeColumn('Твердая фаза раствора, %', 'fluidSolidPhase', numericColumnOptions), - makeColumn('Смазка, %', 'grease', numericColumnOptions), - makeColumn('Карбонат кальция, кг/м³', 'calciumCarbonate', numericColumnOptions), + [ + makeColumn('Наименование', 'name', textColumnOptions), + makeColumn('Температура, °C', 'temperature', numericColumnOptions), + makeColumn('Плотность, г/см³', 'density', numericColumnOptions), + makeColumn('Усл. вязкость, сек', 'conditionalViscosity', numericColumnOptions), + makeColumn('R300', 'r300', numericColumnOptions), + makeColumn('R600', 'r600', numericColumnOptions), + makeColumn('R3/R6', 'r3r6', numericColumnOptions), + makeColumn('ДНС, дПа', 'dnsDpa', numericColumnOptions), + makeColumn('Пластич. вязкость, сПз', 'plasticViscocity', numericColumnOptions), + makeColumn('СНС, дПа', 'snsDpa', numericColumnOptions), + ], + [ + makeColumn('R3/R6 49С', 'r3r649С', numericColumnOptions), + makeColumn('ДНС 49С, дПа', 'dns49Cdpa', numericColumnOptions), + makeColumn('Пластич. вязкость 49С, сПз', 'plasticViscocity49c', numericColumnOptions), + makeColumn('СНС 49С, дПа', 'sns49Cdpa', numericColumnOptions), + makeColumn('МВТ, кг/м³', 'mbt', numericColumnOptions), + makeColumn('Песок, %', 'sand', numericColumnOptions), + makeColumn('Фильтрация, см³/30мин', 'filtering', numericColumnOptions), + makeColumn('Корка, мм', 'crust', numericColumnOptions), + makeColumn('KTK', 'ktk', numericColumnOptions), + ], + [ + makeColumn('pH', 'ph', numericColumnOptions), + makeColumn('Жесткость, мг/л', 'hardness', numericColumnOptions), + makeColumn('Хлориды, мг/л', 'chlorides', numericColumnOptions), + makeColumn('PF', 'pf', numericColumnOptions), + makeColumn('Mf', 'mf', numericColumnOptions), + makeColumn('Pm', 'pm', numericColumnOptions), + makeColumn('Твердая фаза раствора, %', 'fluidSolidPhase', numericColumnOptions), + makeColumn('Смазка, %', 'grease', numericColumnOptions), + makeColumn('Карбонат кальция, кг/м³', 'calciumCarbonate', numericColumnOptions), + ], ] export const drillingFluidDefaultData = { diff --git a/src/pages/Measure/index.jsx b/src/pages/Measure/index.jsx index 6449b4d..e6b4590 100755 --- a/src/pages/Measure/index.jsx +++ b/src/pages/Measure/index.jsx @@ -20,31 +20,16 @@ const defaultData = [ title: 'Замер бурового раствора', columns: columnsDrillingFluid, defaultValue: drillingFluidDefaultData, - rowsInColumn: { - first: 10, - second: 19, - third: 28, - }, }, { idCategory: 2, title: 'Шламограмма', columns: columnsMudDiagram, defaultValue: mudDiagramDefaultData, - rowsInColumn: { - first: 6, - second: 15, - third: 22, - }, }, { idCategory: 3, title: 'ННБ', columns: columnsNnb, defaultValue: nnbDefaultData, - rowsInColumn: { - first: 6, - second: 12, - third: 17, - }, additionalButtons: (group, idx, onClick) => (isEditing) => isEditing ? null : (