From 96f53da02033c8c3f8f7773360d5269c6189ab59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A2=D0=B8=D0=BC=D1=83=D1=80=20=D0=93=D0=BE=D1=80=D0=BE?= =?UTF-8?q?=D0=B4=D0=B5=D1=86=D0=BA=D0=B8=D0=B9?= Date: Mon, 12 Oct 2026 15:05:42 +0500 Subject: [PATCH] =?UTF-8?q?feat:=20=D1=81=D1=82=D0=BE=D0=BB=D0=B1=D0=B5?= =?UTF-8?q?=D1=86=20=C2=AB=D0=94=D0=B0=D1=82=D0=B0=20=D0=B2=D1=8B=D1=85?= =?UTF-8?q?=D0=BE=D0=B4=D0=B0=C2=BB=20=D0=B2=20=D1=80=D0=B0=D0=B7=D0=B4?= =?UTF-8?q?=D0=B5=D0=BB=D0=B0=D1=85=20=D0=BF=D1=80=D0=B8=20=D1=84=D0=B8?= =?UTF-8?q?=D0=BB=D1=8C=D1=82=D1=80=D0=B5=20=D0=BF=D0=BE=20=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=BE=D1=87=D0=B5=D0=BC=D1=83=20=D0=BC=D0=B5=D1=81=D1=82?= =?UTF-8?q?=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Раньше дата выхода показывалась только во «Все заявки». Теперь — в любом разделе (Мои заявки, очереди), когда фильтр по типу оставляет только заявки на организацию рабочего места. Co-Authored-By: Claude Opus 5.5 (1M context) --- .../features/myRequests/RequestsTableView.tsx | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/webparts/requestPortal/features/myRequests/RequestsTableView.tsx b/src/webparts/requestPortal/features/myRequests/RequestsTableView.tsx index 1927a7e..831a8f3 100644 --- a/src/webparts/requestPortal/features/myRequests/RequestsTableView.tsx +++ b/src/webparts/requestPortal/features/myRequests/RequestsTableView.tsx @@ -143,7 +143,7 @@ interface ITableColumns { assignee: boolean; /** Колонка «Исполнено» — кто из исполнителей уже выполнил (см. showsExecuted). */ executed: boolean; - /** Колонка «Дата выхода» — только «Все заявки» по организации рабочего места. */ + /** Колонка «Дата выхода» — только таблица из заявок на организацию рабочего места (см. showsStartDate). */ startDate?: boolean; /** Заголовок колонки с комментарием; undefined — колонки нет. */ commentLabel?: string; @@ -178,9 +178,15 @@ function showsExecuted(view: ListView, statusFilter: string): boolean { return true; } -/** Дата выхода сотрудника есть только у заявки на организацию рабочего места, и показываем её во «Все заявки». */ -function showsStartDate(view: ListView, type: IRequestType | undefined): boolean { - return view === 'all' && type?.pageUrl === WORKPLACE_SETUP_FORM_ID; +/** + * Дата выхода сотрудника есть только у заявки на организацию рабочего места. + * Показываем её, когда таблица целиком из таких заявок: «Все заявки» этого типа + * или любой раздел с фильтром по этому типу. Без фильтра типы вперемешку — + * колонка была бы почти пустой. + */ +function showsStartDate(view: ListView, allRequestsType: IRequestType | undefined, filteredType: IRequestType | undefined): boolean { + const tableType = view === 'all' ? allRequestsType : filteredType; + return tableType?.pageUrl === WORKPLACE_SETUP_FORM_ID; } function columnsFor(view: ListView, statusFilter: string, startDate = false): ITableColumns { @@ -194,15 +200,15 @@ function columnsFor(view: ListView, statusFilter: string, startDate = false): IT ? 'Причина возврата' : undefined; - if (view === 'approvals' || view === 'execution') return { author: true, status: false, assignee, executed }; - if (view === 'rework') return { author: false, status: false, assignee, executed, commentLabel }; - if (view === 'own:created') return { author: false, status: !statusFilter, assignee, executed, commentLabel }; + if (view === 'approvals' || view === 'execution') return { author: true, status: false, assignee, executed, startDate }; + if (view === 'rework') return { author: false, status: false, assignee, executed, startDate, commentLabel }; + if (view === 'own:created') return { author: false, status: !statusFilter, assignee, executed, startDate, commentLabel }; // 'all' — заявки всех авторов вперемешку, поэтому нужны и автор, и статус. if (view === 'all') return { author: true, status: true, assignee, executed, startDate }; // История решений: заявка чужая, поэтому нужен автор. Статус — только если он // не предопределён самой вкладкой («Отклонённые мной» — это всегда «Отклонено», // а вот у согласованных/выполненных заявка могла уйти дальше по маршруту). - return { author: true, status: !decisionStatus, assignee, executed, commentLabel }; + return { author: true, status: !decisionStatus, assignee, executed, startDate, commentLabel }; } export interface IRequestsTableViewProps { @@ -494,6 +500,8 @@ export const RequestsTableView: React.FC = ({ }); const { localFilters, sort, isRefined } = refinement; const refinementSig = refinement.signature; + const filteredType = types?.find((t) => t.id === localFilters.typeId); + const withStartDate = showsStartDate(view, allRequestsType, filteredType); // Полный список раздела для режима с фильтрами — последний загруженный. // Листание страниц и смена фильтра его переиспользуют (заново по сети не @@ -664,7 +672,7 @@ export const RequestsTableView: React.FC = ({ decisionStatus ? hydrateDecisionComments(context, types, result.rows, decisionStatus) : undefined, showsAssignee(view, statusFilter) ? hydrateCurrentAssignees(context, types, result.rows) : undefined, showsExecuted(view, statusFilter) ? hydrateExecutedSteps(context, types, result.rows) : undefined, - showsStartDate(view, allRequestsType) ? hydrateStartDates(context, result.rows) : undefined, + withStartDate ? hydrateStartDates(context, result.rows) : undefined, ]); return result; }; @@ -850,7 +858,7 @@ export const RequestsTableView: React.FC = ({ rows={visible} view={view} statusFilter={statusFilter} - withStartDate={showsStartDate(view, allRequestsType)} + withStartDate={withStartDate} sort={sort} onSort={refinement.onSort} onOpen={onOpen}