From aceedd8dee352bbdbea3df9d12ef04fd3712af15 Mon Sep 17 00:00:00 2001 From: ts_salikhov Date: Tue, 23 Aug 2022 15:55:48 +0400 Subject: [PATCH 1/3] =?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 | 31 ++++++++++++++++++++---------- src/pages/Measure/index.jsx | 15 +++++++++++++++ src/pages/Measure/nnbData.js | 2 +- 4 files changed, 39 insertions(+), 13 deletions(-) diff --git a/src/pages/Measure/MeasureTable.jsx b/src/pages/Measure/MeasureTable.jsx index 810c4bf..9ba5ac7 100755 --- a/src/pages/Measure/MeasureTable.jsx +++ b/src/pages/Measure/MeasureTable.jsx @@ -134,7 +134,7 @@ export const MeasureTable = memo(({ group, updateMeasuresFunc, additionalButtons -
+
{data.map((item, index) => (
- +
diff --git a/src/pages/Measure/View.jsx b/src/pages/Measure/View.jsx index f7213e8..cf3911e 100755 --- a/src/pages/Measure/View.jsx +++ b/src/pages/Measure/View.jsx @@ -6,18 +6,29 @@ import { Grid, GridItem } from '@components/Grid' import '@styles/index.css' import '@styles/measure.css' -const colsCount = 3 - -export const View = memo(({ columns, item }) => !item || !columns?.length ? ( +export const View = memo(({ columns, item, rowsInColumn }) => { + let rowPosition = 0 + let columnPosition = 1 + return !item || !columns?.length ? ( ) : ( - {columns.map((column, i) => ( + {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} @@ -25,8 +36,8 @@ export const View = memo(({ columns, item }) => !item || !columns?.length ? ( @@ -45,6 +56,6 @@ export const View = memo(({ columns, item }) => !item || !columns?.length ? ( )} - ))} + )})} -)) +)}) diff --git a/src/pages/Measure/index.jsx b/src/pages/Measure/index.jsx index e6b4590..6449b4d 100755 --- a/src/pages/Measure/index.jsx +++ b/src/pages/Measure/index.jsx @@ -20,16 +20,31 @@ 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 : (