Iniit
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
.gantt-container {
|
||||
width: auto;
|
||||
margin: 10px auto;
|
||||
}
|
||||
|
||||
.chart-controls {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.chart-controls > p {
|
||||
font-size: 1.2rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.chart-label {
|
||||
font-size: 1.5rem;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.gantt-container .popup-wrapper {
|
||||
width: 300px;
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
/*.popup-wrapper {
|
||||
border: 1px solid black;
|
||||
background-color: #F4F5F6;
|
||||
}*/
|
||||
@@ -0,0 +1,133 @@
|
||||
.gantt .grid-background {
|
||||
fill: none;
|
||||
}
|
||||
.gantt .grid-header {
|
||||
fill: #ffffff;
|
||||
stroke: #e0e0e0;
|
||||
stroke-width: 1.4;
|
||||
}
|
||||
.gantt .grid-row {
|
||||
fill: #ffffff;
|
||||
}
|
||||
.gantt .grid-row:nth-child(even) {
|
||||
fill: #f5f5f5;
|
||||
}
|
||||
.gantt .row-line {
|
||||
stroke: #ebeff2;
|
||||
}
|
||||
.gantt .tick {
|
||||
stroke: #e0e0e0;
|
||||
stroke-width: 0.2;
|
||||
}
|
||||
.gantt .tick.thick {
|
||||
stroke-width: 0.4;
|
||||
}
|
||||
.gantt .today-highlight {
|
||||
fill: #fcf8e3;
|
||||
opacity: 0.5;
|
||||
}
|
||||
.gantt .arrow {
|
||||
fill: none;
|
||||
stroke: #666;
|
||||
stroke-width: 1.4;
|
||||
}
|
||||
.gantt .bar {
|
||||
fill: #b8c2cc;
|
||||
stroke: #8D99A6;
|
||||
stroke-width: 0;
|
||||
transition: stroke-width 0.3s ease;
|
||||
user-select: none;
|
||||
}
|
||||
.gantt .bar-progress {
|
||||
fill: #a3a3ff;
|
||||
}
|
||||
.gantt .bar-invalid {
|
||||
fill: transparent;
|
||||
stroke: #8D99A6;
|
||||
stroke-width: 1;
|
||||
stroke-dasharray: 5;
|
||||
}
|
||||
.gantt .bar-invalid ~ .bar-label {
|
||||
fill: #555;
|
||||
}
|
||||
.gantt .bar-label {
|
||||
fill: #fff;
|
||||
dominant-baseline: central;
|
||||
text-anchor: middle;
|
||||
font-size: 12px;
|
||||
font-weight: lighter;
|
||||
}
|
||||
.gantt .bar-label.big {
|
||||
fill: #555;
|
||||
text-anchor: start;
|
||||
}
|
||||
.gantt .handle {
|
||||
fill: #ddd;
|
||||
cursor: ew-resize;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
.gantt .bar-wrapper {
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
}
|
||||
.gantt .bar-wrapper:hover .bar {
|
||||
fill: #a9b5c1;
|
||||
}
|
||||
.gantt .bar-wrapper:hover .bar-progress {
|
||||
fill: #8a8aff;
|
||||
}
|
||||
.gantt .bar-wrapper:hover .handle {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
.gantt .bar-wrapper.active .bar {
|
||||
fill: #a9b5c1;
|
||||
}
|
||||
.gantt .bar-wrapper.active .bar-progress {
|
||||
fill: #8a8aff;
|
||||
}
|
||||
.gantt .lower-text, .gantt .upper-text {
|
||||
font-size: 12px;
|
||||
text-anchor: middle;
|
||||
}
|
||||
.gantt .upper-text {
|
||||
fill: #555;
|
||||
}
|
||||
.gantt .lower-text {
|
||||
fill: #333;
|
||||
}
|
||||
.gantt .hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.gantt-container {
|
||||
position: relative;
|
||||
overflow: auto;
|
||||
font-size: 12px;
|
||||
}
|
||||
.gantt-container .popup-wrapper {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
padding: 0;
|
||||
color: #959da5;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.gantt-container .popup-wrapper .title {
|
||||
border-bottom: 3px solid #a3a3ff;
|
||||
padding: 10px;
|
||||
}
|
||||
.gantt-container .popup-wrapper .subtitle {
|
||||
padding: 10px;
|
||||
color: #dfe2e5;
|
||||
}
|
||||
.gantt-container .popup-wrapper .pointer {
|
||||
position: absolute;
|
||||
height: 5px;
|
||||
margin: 0 0 0 -5px;
|
||||
border: 5px solid transparent;
|
||||
border-top-color: rgba(0, 0, 0, 0.8);
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,76 @@
|
||||
loadganttchart = {
|
||||
load_ganttchart(tasks, elem, popuphtml_ins) {
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFiles(["libs/frappe-gantt/js/frappe-gantt.min.js"], function () {
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadCssFiles(["libs/frappe-gantt/css/frappe-gantt.min.css", "libs/frappe-gantt/css/frappe-gantt-custom.css", "libs/frappe-gantt/css/frappe-gantt.css"], function () {
|
||||
let html = `<svg id="gantt" class=""></svg>
|
||||
<div class="chart-controls ma-20">
|
||||
<p class="hidden">Change Chart Timescale</p>
|
||||
<div class="button-cont TimeScale_Cls">
|
||||
<button id="day-btn" class="bg-primary">
|
||||
Day
|
||||
</button>
|
||||
|
||||
<button id="week-btn">
|
||||
Week
|
||||
</button>
|
||||
|
||||
<button id="month-btn">
|
||||
Month
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<p class="chart-label hidden"> Timescale: <span id="current-timescale">Day</span> </p>`;
|
||||
$(elem).append(html);
|
||||
let ganttChart = eval(`new Gantt("#gantt", tasks, {
|
||||
on_click: function (task) {
|
||||
//alert(task);
|
||||
},
|
||||
on_date_change: function(task, start, end) {
|
||||
//alert(task + "," + start + "," + end);
|
||||
},
|
||||
on_progress_change: function(task, progress) {
|
||||
//alert(task + "," + progress);
|
||||
},
|
||||
on_view_change: function(mode) {
|
||||
//alert(mode);
|
||||
},
|
||||
custom_popup_html: function(task) {
|
||||
//return Bizgaze.Apps.Transact.Controls.WorkOrderItems.Instance().getPopUpHtml(task);
|
||||
if(popuphtml_ins == "")
|
||||
{
|
||||
return loadganttchart.getpopuphtml(task);
|
||||
}
|
||||
else
|
||||
{
|
||||
return eval(popuphtml_ins);
|
||||
}
|
||||
}
|
||||
}
|
||||
)`);
|
||||
$(".chart-controls #day-btn").on("click", () => {
|
||||
ganttChart.change_view_mode("Day");
|
||||
$(".TimeScale_Cls").find("button").removeClass("bg-primary");
|
||||
$(".TimeScale_Cls").find("#day-btn").addClass("bg-primary");
|
||||
});
|
||||
$(".chart-controls #week-btn").on("click", () => {
|
||||
ganttChart.change_view_mode("Week");
|
||||
$(".TimeScale_Cls").find("button").removeClass("bg-primary");
|
||||
$(".TimeScale_Cls").find("#week-btn").addClass("bg-primary");
|
||||
});
|
||||
$(".chart-controls #month-btn").on("click", () => {
|
||||
ganttChart.change_view_mode("Month");
|
||||
$(".TimeScale_Cls").find("button").removeClass("bg-primary");
|
||||
$(".TimeScale_Cls").find("#month-btn").addClass("bg-primary");
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
getpopuphtml(task) {
|
||||
return `<div class="details-container bg-light pa-5 text-left" style="border:2px solid black">
|
||||
<h5>${task.name}</h5>
|
||||
<p>Task Started on: ${task._start.getDate()}</p>
|
||||
<p>Expected to finish by ${task._end.getDate()}</p>
|
||||
<p>${task.progress}% completed!</p>
|
||||
</div>`;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user