From b754cb954343c852eb2c59623e4bdb71dea386df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9E=D1=81=D1=8C=D0=BC=D0=B0=D0=BA=D0=BE=D0=B2=20=D0=94?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=81?= Date: Fri, 28 Feb 2020 18:40:57 +0300 Subject: [PATCH] text rename / reworked short name funct --- .../components/RejectTasks/RejectTasks.tsx | 47 ++++++++----------- .../SummaryGlobalComponent.tsx | 9 +++- .../components/SummaryWebPart.tsx | 2 +- .../TaskStatusesChart/TaskStatusesChart.tsx | 2 +- .../components/TrafficLight/TrafficLight.tsx | 4 +- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/webparts/summaryWebPart/components/RejectTasks/RejectTasks.tsx b/src/webparts/summaryWebPart/components/RejectTasks/RejectTasks.tsx index 751a7af..edd40cc 100644 --- a/src/webparts/summaryWebPart/components/RejectTasks/RejectTasks.tsx +++ b/src/webparts/summaryWebPart/components/RejectTasks/RejectTasks.tsx @@ -31,9 +31,20 @@ export default class DeviationTaskTable extends React.Component ) } + + public converToShortFIO = (fio: string) => { + let result = ''; + const splitedFIO = fio.split(' '); + + if (splitedFIO.length < 3) { + result = `${splitedFIO[0]} ${splitedFIO[1][0].toUpperCase()}.` + } else { + result = `${splitedFIO[0]} ${splitedFIO[1][0].toUpperCase()}. ${splitedFIO[2][0].toUpperCase()}.` + } + return result; + } private _renderBodyTable(structureData:any): JSX.Element { - var structureTable = [] //В этом массив пушиться вся структура таблицы (tr td) // Прохожусь по всему приходящему массиву. Через функции _cell() и _customCell пушу ячеейки в structureTable. Так же в этой фунции определяться rowSpan и сокращаеться value до ФИО @@ -54,20 +65,11 @@ export default class DeviationTaskTable extends React.Component diff --git a/src/webparts/summaryWebPart/components/SummaryGlobalComponent/SummaryGlobalComponent.tsx b/src/webparts/summaryWebPart/components/SummaryGlobalComponent/SummaryGlobalComponent.tsx index 094a195..7bd1ab7 100644 --- a/src/webparts/summaryWebPart/components/SummaryGlobalComponent/SummaryGlobalComponent.tsx +++ b/src/webparts/summaryWebPart/components/SummaryGlobalComponent/SummaryGlobalComponent.tsx @@ -17,6 +17,13 @@ export interface IComponentProps { export default class SummaryGlobalComponent extends React.Component { + componentDidMount() { + let stl = document.createElement('link'); + stl.setAttribute('rel', 'stylesheet'); + stl.setAttribute('href', '/Style%20Library/summaryStyles.css'); + document.documentElement.appendChild(stl); + } + public render(): React.ReactElement { const { data, rowsOrder, context } = this.props; @@ -37,7 +44,7 @@ export default class SummaryGlobalComponent extends React.Component

ЗАДАЧИ С ОТКЛОНЕНИЕМ

-
+
diff --git a/src/webparts/summaryWebPart/components/SummaryWebPart.tsx b/src/webparts/summaryWebPart/components/SummaryWebPart.tsx index c225412..c44bb8c 100644 --- a/src/webparts/summaryWebPart/components/SummaryWebPart.tsx +++ b/src/webparts/summaryWebPart/components/SummaryWebPart.tsx @@ -51,7 +51,7 @@ export default class SummaryWebPart extends React.Component { const { taskStats } = this.props; - let chartTitle = 'Текущee состояние проекта (всего задач: '+( Number(taskStats.exec) + Number(taskStats.plan) + Number(taskStats.compl))+' шт.)' + let chartTitle = 'Всего задач по проекту: '+( Number(taskStats.exec) + Number(taskStats.plan) + Number(taskStats.compl))+' шт.' return (

{chartTitle}

diff --git a/src/webparts/summaryWebPart/components/TrafficLight/TrafficLight.tsx b/src/webparts/summaryWebPart/components/TrafficLight/TrafficLight.tsx index 8b0da5f..1bfd2dc 100644 --- a/src/webparts/summaryWebPart/components/TrafficLight/TrafficLight.tsx +++ b/src/webparts/summaryWebPart/components/TrafficLight/TrafficLight.tsx @@ -35,7 +35,7 @@ export default class TrafficLight extends React.Component { result.push( { key: index, - fieldName: "Срок", + fieldName: "Длительность", status: statuses.term }); ++index; @@ -156,7 +156,7 @@ export default class TrafficLight extends React.Component { }, { key: "column4", - name: "Актуальный статус", + name: "Статус выполнения", fieldName: "allTasks", minWidth: 110, maxWidth: 110