From 38b041cfa5a32bbdf0ca77bbe7665b6247ffd0a7 Mon Sep 17 00:00:00 2001 From: popovspiridon99 Date: Fri, 14 Nov 2025 17:15:39 +0900 Subject: [PATCH] update MapComponent + ObjectParameters --- client/src/components/map/MapComponent.tsx | 13 ++- .../map/ObjectParameters/ObjectParameters.tsx | 109 +++++++++++++++++- 2 files changed, 115 insertions(+), 7 deletions(-) diff --git a/client/src/components/map/MapComponent.tsx b/client/src/components/map/MapComponent.tsx index f0bb98f..948592d 100644 --- a/client/src/components/map/MapComponent.tsx +++ b/client/src/components/map/MapComponent.tsx @@ -68,11 +68,11 @@ const MapComponent = ({ { title: 'Неразмещенные', value: 'unplaced', view: <> }, { title: 'Другие', value: 'other', view: <> }, ] - const paramsPane: ITabsPane[] = [ - { title: 'История изменений', value: 'history', view: <> }, - { title: 'Параметры', value: 'parameters', view: }, - { title: 'Вычисляемые', value: 'calculated', view: <> } - ] + // const paramsPane: ITabsPane[] = [ + // { title: 'История изменений', value: 'history', view: <> }, + // { title: 'Параметры', value: 'parameters', view: }, + // { title: 'Вычисляемые', value: 'calculated', view: <> } + // ] // Map const mapElement = useRef(null) @@ -519,7 +519,8 @@ const MapComponent = ({ - + + {/* */} {!!selectedRegion && !!selectedDistrict && !!selectedYear && diff --git a/client/src/components/map/ObjectParameters/ObjectParameters.tsx b/client/src/components/map/ObjectParameters/ObjectParameters.tsx index f63bbab..1e0ecc7 100644 --- a/client/src/components/map/ObjectParameters/ObjectParameters.tsx +++ b/client/src/components/map/ObjectParameters/ObjectParameters.tsx @@ -4,7 +4,8 @@ import useSWR from 'swr'; import { BASE_URL } from '../../../constants'; import { fetcher } from '../../../http/axiosInstance'; import { useObjectsStore } from '../../../store/objects'; -import { Spinner, Table, TableBody, TableHeader, TableHeaderCell, TableRow } from '@fluentui/react-components'; +import { Spinner, Tab, Table, TableBody, TableHeader, TableHeaderCell, TableRow, TabList, Text } from '@fluentui/react-components'; +import { useState } from 'react'; const ObjectParameters = ({ map_id @@ -23,6 +24,112 @@ const ObjectParameters = ({ } ) + const [selectedTab, setSelectedTab] = useState('parameters') + + return ( +
+
+ setSelectedTab(data.value)}> + + {'История изменений'} + + + + {'Параметры'} + + + + {'Вычисляемые'} + + +
+ + +
+ {(valuesValidating) && ( +
+ +
+ )} + +
+ +
+ +
+ + + + Параметр + + Значение + + + + + {Array.isArray(valuesData) && + valuesData.filter((param: IObjectParam) => param.format !== 'calculate').map((param: IObjectParam) => ( + <> + + + )) + } + +
+
+ +
+ + + + Параметр + + Значение + + + + + {Array.isArray(valuesData) && + valuesData.filter((param: IObjectParam) => param.format === 'calculate').map((param: IObjectParam) => ( + <> + + + )) + } + +
+
+
+
+ ) + return (
{(valuesValidating) && (