форматирование
This commit is contained in:
parent
ce539c4f35
commit
0ccb515054
@ -13,7 +13,7 @@ export async function fetchCompanyGroups(params: GetCompanyGroupsPropsI): Promis
|
|||||||
const page = await api.get<Page<ICompanyGroupOut>>('/directories/company-groups', {
|
const page = await api.get<Page<ICompanyGroupOut>>('/directories/company-groups', {
|
||||||
limit: CG_PAGE,
|
limit: CG_PAGE,
|
||||||
offset: offset,
|
offset: offset,
|
||||||
...params,
|
...params,
|
||||||
});
|
});
|
||||||
all.push(...page.items);
|
all.push(...page.items);
|
||||||
if (all.length >= page.total || page.items.length === 0) {
|
if (all.length >= page.total || page.items.length === 0) {
|
||||||
|
|||||||
@ -21,7 +21,7 @@ export interface ICatalogueJur {
|
|||||||
name: string;
|
name: string;
|
||||||
is_head_office: boolean;
|
is_head_office: boolean;
|
||||||
};
|
};
|
||||||
regional_name?:string;
|
regional_name?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type KindType = 'gsk' | 'gsz';
|
export type KindType = 'gsk' | 'gsz';
|
||||||
|
|||||||
@ -6,7 +6,7 @@ export interface ICompanyGroupOut {
|
|||||||
base_regional_office_id: string | null;
|
base_regional_office_id: string | null;
|
||||||
base_regional_office: { id: string; name: string; is_head_office: boolean } | null;
|
base_regional_office: { id: string; name: string; is_head_office: boolean } | null;
|
||||||
legal_entities_count: number;
|
legal_entities_count: number;
|
||||||
is_archived:boolean;
|
is_archived: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Строка таблицы ГК: имя филиала плоским полем — по нему работают поиск и фильтры GenericTable. */
|
/** Строка таблицы ГК: имя филиала плоским полем — по нему работают поиск и фильтры GenericTable. */
|
||||||
|
|||||||
@ -17,7 +17,7 @@ export const ArchiveCompanyGroupModal: React.FC<Props> = ({ open, onCancel, onOk
|
|||||||
onOk={onOk}
|
onOk={onOk}
|
||||||
okText='Подтвердить'
|
okText='Подтвердить'
|
||||||
cancelText='Отмена'
|
cancelText='Отмена'
|
||||||
okButtonProps={isArchived ? undefined : { danger: true }}
|
okButtonProps={isArchived ? undefined : { danger: true }}
|
||||||
confirmLoading={loading}
|
confirmLoading={loading}
|
||||||
centered>
|
centered>
|
||||||
<p style={{ margin: 0, color: '#595959' }}>Группа компании будет {isArchived ? 'разархивированна' : 'архивированна'}</p>
|
<p style={{ margin: 0, color: '#595959' }}>Группа компании будет {isArchived ? 'разархивированна' : 'архивированна'}</p>
|
||||||
|
|||||||
@ -55,7 +55,7 @@ export function CatalogueJurTable({ outside_group, tabsComponent }: CatalogueJur
|
|||||||
const isGettingArchiveCompany = useAppSelector((state) => state.company_groups.isGettingArchive);
|
const isGettingArchiveCompany = useAppSelector((state) => state.company_groups.isGettingArchive);
|
||||||
|
|
||||||
const filterdData = useMemo(() => {
|
const filterdData = useMemo(() => {
|
||||||
let newData = rawRows
|
let newData = rawRows;
|
||||||
if (relatedGroupFilter?.id && !outside_group) {
|
if (relatedGroupFilter?.id && !outside_group) {
|
||||||
newData = rawRows?.filter((row) => {
|
newData = rawRows?.filter((row) => {
|
||||||
return row?.memberships?.some((member) => member.related_group_id === relatedGroupFilter.id);
|
return row?.memberships?.some((member) => member.related_group_id === relatedGroupFilter.id);
|
||||||
@ -69,7 +69,7 @@ export function CatalogueJurTable({ outside_group, tabsComponent }: CatalogueJur
|
|||||||
useTableFilters<ICatalogueJur>();
|
useTableFilters<ICatalogueJur>();
|
||||||
// single filtered array — title count and table share it
|
// single filtered array — title count and table share it
|
||||||
const { rows } = useFilteredRows(filterdData, catalogueJurConfig, rawQuery, columnFilters, sort);
|
const { rows } = useFilteredRows(filterdData, catalogueJurConfig, rawQuery, columnFilters, sort);
|
||||||
|
|
||||||
function getCatalogueJur() {
|
function getCatalogueJur() {
|
||||||
dispatch(
|
dispatch(
|
||||||
getCatalogueJurThunk({
|
getCatalogueJurThunk({
|
||||||
|
|||||||
@ -31,7 +31,7 @@ export const CompanyGroupsList = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
dispatch(getCompanyGroupsThunk({is_archived:isGettingArchiveCompany}));
|
dispatch(getCompanyGroupsThunk({ is_archived: isGettingArchiveCompany }));
|
||||||
}, [dispatch, isGettingArchiveCompany]);
|
}, [dispatch, isGettingArchiveCompany]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -66,7 +66,7 @@ export const CompanyGroupsList = () => {
|
|||||||
value={query}
|
value={query}
|
||||||
onChange={(e) => setQuery(e.target.value)}
|
onChange={(e) => setQuery(e.target.value)}
|
||||||
/>
|
/>
|
||||||
<Checkbox checked={isGettingArchiveCompany} onChange={(e) =>dispatch(setIsGettingArchive(e.target.checked))}>
|
<Checkbox checked={isGettingArchiveCompany} onChange={(e) => dispatch(setIsGettingArchive(e.target.checked))}>
|
||||||
Архив
|
Архив
|
||||||
</Checkbox>
|
</Checkbox>
|
||||||
</Space>
|
</Space>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user