added company group table #31

Merged
aep merged 13 commits from feat/legalEntities into test 2026-10-19 10:35:19 +03:00
6 changed files with 44 additions and 49 deletions
Showing only changes of commit 5b13b74a7a - Show all commits

View File

@ -1,4 +1,4 @@
import { useCallback, useMemo, useRef, useState } from "react";
import { useCallback, useMemo, useRef, useState } from 'react';
type Options = {
/** высота одного элемента в px (фиксированная) */
@ -17,18 +17,13 @@ export function useVirtualList<T>(items: T[], options: Options) {
const totalHeight = items.length * itemHeight;
const startIndex = Math.max(
0,
Math.floor(scrollTop / itemHeight) - overscan,
);
const startIndex = Math.max(0, Math.floor(scrollTop / itemHeight) - overscan);
const endIndex = Math.min(
items.length,
Math.ceil((scrollTop + containerHeight) / itemHeight) + overscan,
);
const endIndex = Math.min(items.length, Math.ceil((scrollTop + containerHeight) / itemHeight) + overscan);
const visibleItems = useMemo(
() => items.slice(startIndex, endIndex).map((item, i) => ({
() =>
items.slice(startIndex, endIndex).map((item, i) => ({
item,
index: startIndex + i,
})),

View File

@ -243,7 +243,7 @@ export function CatalogueJurTable({ outside_group, tabsComponent }: CatalogueJur
<ColumnSettings defs={catalogueJurConfig.columns} visibleKeys={visibleKeys} onChange={setVisibleKeys} />
</Space>
</Space>
{(relatedGroupFilter?.id && !outside_group) && (
{relatedGroupFilter?.id && !outside_group && (
<div
style={{
display: 'flex',

View File

@ -1,10 +1,10 @@
import { useEffect, useMemo, useState } from 'react';
import { Input, List, Spin, Empty, Typography, Tag } from 'antd';
import { FolderOpenOutlined, SearchOutlined } from '@ant-design/icons';
import { useAppDispatch, useAppSelector } from '../../store/store';
import { getCompanyGroupsThunk } from '../../store/slices/companyGroupsSlice/thunks';
import { setActiveCompanyGroup } from '../../store/slices/companyGroupsSlice/companyGroupsSlice';
import { Empty, Input, List, Spin, Tag, Typography } from 'antd';
import { useEffect, useMemo, useState } from 'react';
import { useVirtualList } from '../../hooks/useVirtualList';
import { setActiveCompanyGroup } from '../../store/slices/companyGroupsSlice/companyGroupsSlice';
import { getCompanyGroupsThunk } from '../../store/slices/companyGroupsSlice/thunks';
import { useAppDispatch, useAppSelector } from '../../store/store';
const { Text } = Typography;