forked from CITKParus/P8-Panels
ЦИТК-784 (Добавлена возможность работы с цветом прогресса, градиентная заливка легенды)
This commit is contained in:
parent
72958217b3
commit
de4fb84a7f
@ -59,7 +59,8 @@ const P8P_GANTT_TASK_SHAPE = PropTypes.shape({
|
|||||||
readOnlyDates: PropTypes.bool,
|
readOnlyDates: PropTypes.bool,
|
||||||
readOnlyProgress: PropTypes.bool,
|
readOnlyProgress: PropTypes.bool,
|
||||||
bgColor: PropTypes.string,
|
bgColor: PropTypes.string,
|
||||||
textColor: PropTypes.string
|
textColor: PropTypes.string,
|
||||||
|
bgProgressColor: PropTypes.string
|
||||||
});
|
});
|
||||||
|
|
||||||
//Структура динамического атрибута задачи
|
//Структура динамического атрибута задачи
|
||||||
@ -72,6 +73,7 @@ const P8P_GANTT_TASK_ATTRIBUTE_SHAPE = PropTypes.shape({
|
|||||||
const P8P_GANTT_TASK_COLOR_SHAPE = PropTypes.shape({
|
const P8P_GANTT_TASK_COLOR_SHAPE = PropTypes.shape({
|
||||||
bgColor: PropTypes.string,
|
bgColor: PropTypes.string,
|
||||||
textColor: PropTypes.string,
|
textColor: PropTypes.string,
|
||||||
|
bgProgressColor: PropTypes.string,
|
||||||
desc: PropTypes.string.isRequired
|
desc: PropTypes.string.isRequired
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -126,14 +128,24 @@ const P8PGanttTaskEditor = ({
|
|||||||
//Описание легенды для задачи
|
//Описание легенды для задачи
|
||||||
let legend = null;
|
let legend = null;
|
||||||
if (Array.isArray(taskColors)) {
|
if (Array.isArray(taskColors)) {
|
||||||
const colorDesc = taskColors.find(color => task.bgColor === color.bgColor && task.textColor === color.textColor);
|
const colorDesc = taskColors.find(
|
||||||
|
color => task.bgColor === color.bgColor && task.textColor === color.textColor && task.bgProgressColor === color.bgProgressColor
|
||||||
|
);
|
||||||
if (colorDesc)
|
if (colorDesc)
|
||||||
legend = (
|
legend = (
|
||||||
<ListItemText
|
<ListItemText
|
||||||
secondaryTypographyProps={{
|
secondaryTypographyProps={{
|
||||||
p: 1,
|
p: 1,
|
||||||
sx: {
|
sx: {
|
||||||
...(colorDesc.bgColor ? { backgroundColor: colorDesc.bgColor } : {}),
|
...(colorDesc.bgProgressColor
|
||||||
|
? {
|
||||||
|
background: `linear-gradient(to right, ${colorDesc.bgProgressColor} ,${
|
||||||
|
colorDesc.bgColor ? colorDesc.bgColor : "transparent"
|
||||||
|
})}`
|
||||||
|
}
|
||||||
|
: colorDesc.bgColor
|
||||||
|
? { backgroundColor: colorDesc.bgColor }
|
||||||
|
: {}),
|
||||||
...(colorDesc.textColor ? { color: colorDesc.textColor } : {})
|
...(colorDesc.textColor ? { color: colorDesc.textColor } : {})
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
@ -2019,6 +2019,9 @@ text="Формат data_grid и gant как в chart"
|
|||||||
if (RGANTT.RTASK_COLORS(I).STEXT_COLOR is not null) then
|
if (RGANTT.RTASK_COLORS(I).STEXT_COLOR is not null) then
|
||||||
PKG_XFAST.ATTR(SNAME => SRESP_ATTR_TASK_TEXT_COLOR, SVALUE => RGANTT.RTASK_COLORS(I).STEXT_COLOR);
|
PKG_XFAST.ATTR(SNAME => SRESP_ATTR_TASK_TEXT_COLOR, SVALUE => RGANTT.RTASK_COLORS(I).STEXT_COLOR);
|
||||||
end if;
|
end if;
|
||||||
|
if (RGANTT.RTASK_COLORS(I).SBG_PROGRESS_COLOR is not null) then
|
||||||
|
PKG_XFAST.ATTR(SNAME => SRESP_ATTR_TASK_BG_PRG_COLOR, SVALUE => RGANTT.RTASK_COLORS(I).SBG_PROGRESS_COLOR);
|
||||||
|
end if;
|
||||||
PKG_XFAST.ATTR(SNAME => SRESP_ATTR_DESC, SVALUE => RGANTT.RTASK_COLORS(I).SDESC);
|
PKG_XFAST.ATTR(SNAME => SRESP_ATTR_DESC, SVALUE => RGANTT.RTASK_COLORS(I).SDESC);
|
||||||
/* Закрываем описание цвета задачи */
|
/* Закрываем описание цвета задачи */
|
||||||
PKG_XFAST.UP();
|
PKG_XFAST.UP();
|
||||||
|
@ -473,6 +473,9 @@ var Gantt = (function () {
|
|||||||
class: 'bar-progress',
|
class: 'bar-progress',
|
||||||
append_to: this.bar_group,
|
append_to: this.bar_group,
|
||||||
});
|
});
|
||||||
|
//ЦИТК
|
||||||
|
if (this.task.bgProgressColor) this.$bar_progress.style.fill = this.task.bgProgressColor;
|
||||||
|
//ЦИТК
|
||||||
|
|
||||||
animateSVG(this.$bar_progress, 'width', 0, this.progress_width);
|
animateSVG(this.$bar_progress, 'width', 0, this.progress_width);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user