Оптимизирована производительность React компонентов с помощью мемоизации

КРИТИЧНЫЕ КОМПОНЕНТЫ ОПТИМИЗИРОВАНЫ:
• AdminDashboard (346 kB) - добавлены React.memo, useCallback, useMemo
• SellerStatisticsDashboard (329 kB) - мемоизация кэша и callback функций
• CreateSupplyPage (276 kB) - оптимизированы вычисления и обработчики
• EmployeesDashboard (268 kB) - мемоизация списков и функций
• SalesTab + AdvertisingTab - React.memo обертка

ТЕХНИЧЕСКИЕ УЛУЧШЕНИЯ:
 React.memo() для предотвращения лишних рендеров
 useMemo() для тяжелых вычислений
 useCallback() для стабильных ссылок на функции
 Мемоизация фильтрации и сортировки списков
 Оптимизация пропсов в компонентах-контейнерах

РЕЗУЛЬТАТЫ:
• Все компоненты успешно компилируются
• Линтер проходит без критических ошибок
• Сохранена вся функциональность
• Улучшена производительность рендеринга
• Снижена нагрузка на React дерево

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Veronika Smirnova
2025-08-06 13:18:45 +03:00
parent ef5de31ce7
commit bf27f3ba29
317 changed files with 26722 additions and 38332 deletions

View File

@ -1,4 +1,4 @@
import { gql } from "graphql-tag";
import { gql } from 'graphql-tag'
export const typeDefs = gql`
scalar DateTime
@ -8,10 +8,7 @@ export const typeDefs = gql`
organization(id: ID!): Organization
# Поиск организаций по типу для добавления в контрагенты
searchOrganizations(
type: OrganizationType
search: String
): [Organization!]!
searchOrganizations(type: OrganizationType, search: String): [Organization!]!
# Мои контрагенты
myCounterparties: [Organization!]!
@ -87,11 +84,7 @@ export const typeDefs = gql`
employee(id: ID!): Employee
# Табель сотрудника за месяц
employeeSchedule(
employeeId: ID!
year: Int!
month: Int!
): [EmployeeSchedule!]!
employeeSchedule(employeeId: ID!, year: Int!, month: Int!): [EmployeeSchedule!]!
# Публичные услуги контрагента (для фулфилмента)
counterpartyServices(organizationId: ID!): [Service!]!
@ -104,29 +97,19 @@ export const typeDefs = gql`
allUsers(search: String, limit: Int, offset: Int): UsersResponse!
# Wildberries статистика
getWildberriesStatistics(
period: String
startDate: String
endDate: String
): WildberriesStatisticsResponse!
getWildberriesStatistics(period: String, startDate: String, endDate: String): WildberriesStatisticsResponse!
# Отладка рекламы (временно)
debugWildberriesAdverts: DebugAdvertsResponse!
# Статистика кампаний Wildberries
getWildberriesCampaignStats(
input: WildberriesCampaignStatsInput!
): WildberriesCampaignStatsResponse!
getWildberriesCampaignStats(input: WildberriesCampaignStatsInput!): WildberriesCampaignStatsResponse!
# Список кампаний Wildberries
getWildberriesCampaignsList: WildberriesCampaignsListResponse!
# Заявки покупателей на возврат от Wildberries (для фулфилмента)
wbReturnClaims(
isArchive: Boolean!
limit: Int
offset: Int
): WbReturnClaimsResponse!
wbReturnClaims(isArchive: Boolean!, limit: Int, offset: Int): WbReturnClaimsResponse!
# Типы для внешней рекламы
getExternalAds(dateFrom: String!, dateTo: String!): ExternalAdsResponse!
@ -144,17 +127,13 @@ export const typeDefs = gql`
verifyInn(inn: String!): InnValidationResponse!
# Обновление профиля пользователя
updateUserProfile(
input: UpdateUserProfileInput!
): UpdateUserProfileResponse!
updateUserProfile(input: UpdateUserProfileInput!): UpdateUserProfileResponse!
# Обновление данных организации по ИНН
updateOrganizationByInn(inn: String!): UpdateOrganizationResponse!
# Регистрация организации
registerFulfillmentOrganization(
input: FulfillmentRegistrationInput!
): AuthResponse!
registerFulfillmentOrganization(input: FulfillmentRegistrationInput!): AuthResponse!
registerSellerOrganization(input: SellerRegistrationInput!): AuthResponse!
# Работа с API ключами
@ -165,28 +144,14 @@ export const typeDefs = gql`
logout: Boolean!
# Работа с контрагентами
sendCounterpartyRequest(
organizationId: ID!
message: String
): CounterpartyRequestResponse!
respondToCounterpartyRequest(
requestId: ID!
accept: Boolean!
): CounterpartyRequestResponse!
sendCounterpartyRequest(organizationId: ID!, message: String): CounterpartyRequestResponse!
respondToCounterpartyRequest(requestId: ID!, accept: Boolean!): CounterpartyRequestResponse!
cancelCounterpartyRequest(requestId: ID!): Boolean!
removeCounterparty(organizationId: ID!): Boolean!
# Работа с сообщениями
sendMessage(
receiverOrganizationId: ID!
content: String
type: MessageType = TEXT
): MessageResponse!
sendVoiceMessage(
receiverOrganizationId: ID!
voiceUrl: String!
voiceDuration: Int!
): MessageResponse!
sendMessage(receiverOrganizationId: ID!, content: String, type: MessageType = TEXT): MessageResponse!
sendVoiceMessage(receiverOrganizationId: ID!, voiceUrl: String!, voiceDuration: Int!): MessageResponse!
sendImageMessage(
receiverOrganizationId: ID!
fileUrl: String!
@ -218,17 +183,10 @@ export const typeDefs = gql`
# Заказы поставок расходников
createSupplyOrder(input: SupplyOrderInput!): SupplyOrderResponse!
updateSupplyOrderStatus(
id: ID!
status: SupplyOrderStatus!
): SupplyOrderResponse!
updateSupplyOrderStatus(id: ID!, status: SupplyOrderStatus!): SupplyOrderResponse!
# Назначение логистики фулфилментом
assignLogisticsToSupply(
supplyOrderId: ID!
logisticsPartnerId: ID!
responsibleId: ID
): SupplyOrderResponse!
assignLogisticsToSupply(supplyOrderId: ID!, logisticsPartnerId: ID!, responsibleId: ID): SupplyOrderResponse!
# Действия поставщика
supplierApproveOrder(id: ID!): SupplyOrderResponse!
@ -253,17 +211,10 @@ export const typeDefs = gql`
deleteProduct(id: ID!): Boolean!
# Валидация и управление остатками товаров
checkArticleUniqueness(
article: String!
excludeId: ID
): ArticleUniquenessResponse!
checkArticleUniqueness(article: String!, excludeId: ID): ArticleUniquenessResponse!
reserveProductStock(productId: ID!, quantity: Int!): ProductStockResponse!
releaseProductReserve(productId: ID!, quantity: Int!): ProductStockResponse!
updateProductInTransit(
productId: ID!
quantity: Int!
operation: String!
): ProductStockResponse!
updateProductInTransit(productId: ID!, quantity: Int!, operation: String!): ProductStockResponse!
# Работа с категориями
createCategory(input: CategoryInput!): CategoryResponse!
@ -287,19 +238,12 @@ export const typeDefs = gql`
updateEmployeeSchedule(input: UpdateScheduleInput!): Boolean!
# Работа с поставками Wildberries
createWildberriesSupply(
input: CreateWildberriesSupplyInput!
): WildberriesSupplyResponse!
updateWildberriesSupply(
id: ID!
input: UpdateWildberriesSupplyInput!
): WildberriesSupplyResponse!
createWildberriesSupply(input: CreateWildberriesSupplyInput!): WildberriesSupplyResponse!
updateWildberriesSupply(id: ID!, input: UpdateWildberriesSupplyInput!): WildberriesSupplyResponse!
deleteWildberriesSupply(id: ID!): Boolean!
# Работа с поставщиками для поставок
createSupplySupplier(
input: CreateSupplySupplierInput!
): SupplySupplierResponse!
createSupplySupplier(input: CreateSupplySupplierInput!): SupplySupplierResponse!
# Админ мутации
adminLogin(username: String!, password: String!): AdminAuthResponse!
@ -1341,9 +1285,7 @@ export const typeDefs = gql`
}
extend type Mutation {
saveWBWarehouseCache(
input: WBWarehouseCacheInput!
): WBWarehouseCacheResponse!
saveWBWarehouseCache(input: WBWarehouseCacheInput!): WBWarehouseCacheResponse!
}
# Типы для заявок на возврат WB
@ -1398,4 +1340,4 @@ export const typeDefs = gql`
extend type Query {
fulfillmentWarehouseStats: FulfillmentWarehouseStats!
}
`;
`