From e81cde166cc2be054f53575fba697527d151f338 Mon Sep 17 00:00:00 2001 From: Mikhail Chechnev Date: Tue, 17 Sep 2024 21:36:38 +0300 Subject: [PATCH] =?UTF-8?q?WEB=20APP:=20P8PGantt=20-=20=D0=B0=D0=B2=D1=82?= =?UTF-8?q?=D0=BE=D0=BC=D0=B0=D1=82=D0=B8=D1=87=D0=B5=D1=81=D0=BA=D0=B8?= =?UTF-8?q?=D0=B9=20=D1=80=D0=B0=D1=81=D1=87=D0=B5=D1=82=20=D0=B2=D1=8B?= =?UTF-8?q?=D1=81=D0=BE=D1=82=D1=8B=20=D0=B4=D0=B8=D0=B0=D0=B3=D1=80=D0=B0?= =?UTF-8?q?=D0=BC=D0=BC=D1=8B,=20=D0=B2=D0=BE=D0=B7=D0=BC=D0=BE=D0=B6?= =?UTF-8?q?=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20=D0=B7=D0=B0=D0=B4=D0=B0=D1=82?= =?UTF-8?q?=D1=8C=20=D1=81=D1=82=D0=B8=D0=BB=D1=8C=20=D0=BA=D0=BE=D0=BD?= =?UTF-8?q?=D1=82=D0=B5=D0=B9=D0=BD=D0=B5=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/p8p_gantt.js | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/app/components/p8p_gantt.js b/app/components/p8p_gantt.js index 6c562b2..9a4c48e 100644 --- a/app/components/p8p_gantt.js +++ b/app/components/p8p_gantt.js @@ -78,10 +78,22 @@ const P8P_GANTT_TASK_COLOR_SHAPE = PropTypes.shape({ desc: PropTypes.string.isRequired }); +//Высота заголовка +const TITLE_HEIGHT = "44px"; + +//Высота панели масштабирования +const ZOOM_HEIGHT = "56px"; + //Стили const STYLES = { TASK_EDITOR_CONTENT: { minWidth: 400, overflowX: "auto" }, - TASK_EDITOR_LIST: { width: "100%", minWidth: 300, maxWidth: 700, bgcolor: "background.paper" } + TASK_EDITOR_LIST: { width: "100%", minWidth: 300, maxWidth: 700, bgcolor: "background.paper" }, + GANTT_TITLE: { height: TITLE_HEIGHT }, + GANTT_ZOOM: { height: ZOOM_HEIGHT }, + GANTT: (noData, title, zoomBar) => ({ + height: `calc(100% - ${zoomBar ? ZOOM_HEIGHT : "0px"} - ${title ? TITLE_HEIGHT : "0px"})`, + display: noData ? "none" : "" + }) }; //-------------------------------- @@ -318,7 +330,7 @@ P8PGanttTaskEditor.propTypes = { //Диаграмма Ганта const P8PGantt = ({ - height, + containerStyle, title, titleStyle, onTitleClick, @@ -408,10 +420,16 @@ const P8PGantt = ({ //Генерация содержимого return ( -
+
{state.gantt && state.noData ? : null} {state.gantt && !state.noData && title ? ( - + {onTitleClick ? ( onTitleClick()}> {title} @@ -422,7 +440,7 @@ const P8PGantt = ({ ) : null} {state.gantt && !state.noData && zoomBar ? ( - + handleZoomChange(-1)} disabled={state.zoom == 0}> zoom_in @@ -450,7 +468,7 @@ const P8PGantt = ({ cancelBtnCaption={cancelTaskEditorBtnCaption} /> ) : null} -
+
@@ -459,7 +477,7 @@ const P8PGantt = ({ //Контроль свойств - Диаграмма Ганта P8PGantt.propTypes = { - height: PropTypes.string.isRequired, + containerStyle: PropTypes.object, title: PropTypes.string, titleStyle: PropTypes.object, onTitleClick: PropTypes.func,