Browse Source

Merge pull request 'dev-wahyun' (#1) from dev-wahyun into master

Reviewed-on: #1
Dev-Fuad
farhantock 4 months ago
parent
commit
85329eb399
  1. 13
      edit-mode/function/function.js
  2. 9
      edit-mode/function/ganttConfig.js
  3. 1
      edit-mode/index.html

13
edit-mode/function/function.js

@ -314,16 +314,17 @@ function formatReplaceTitikRibuan(param) {
} }
function formatDate(params) { function formatDate(params) {
const months = [
'January', 'February', 'March', 'April', 'May', 'June',
'July', 'August', 'September', 'October', 'November', 'December'
];
let today = new Date(params); let today = new Date(params);
let yyyy = today.getFullYear(); let yyyy = today.getFullYear();
let mm = today.getMonth() + 1; // Months start at 0! let mm = today.getMonth(); // Bulan dimulai dari 0!
let dd = today.getDate(); let dd = today.getDate();
if (dd < 10) dd = '0' + dd; return `${dd} ${months[mm]} ${yyyy}`;
if (mm < 10) mm = '0' + mm;
today = dd + '/' + mm + '/' + yyyy;
return today;
} }
function roundToTwo(num) { function roundToTwo(num) {

9
edit-mode/function/ganttConfig.js

@ -7,6 +7,7 @@ const role_name = getUrlParameter("role_name");
const company_id = getUrlParameter("company_id"); const company_id = getUrlParameter("company_id");
const company_name = getUrlParameter("company_name"); const company_name = getUrlParameter("company_name");
const base_url_image = `https://project-api.ospro.id/assets/${company_name}/`; const base_url_image = `https://project-api.ospro.id/assets/${company_name}/`;
const ganttName = getUrlParameter("gantt_name");
// const base_url_image = `http://localhost:8444/generic-ospro-backend/assets/${company_name}/`; // const base_url_image = `http://localhost:8444/generic-ospro-backend/assets/${company_name}/`;
const adwIntegrationUrl = "https://adw-api.ospro.id/api"; const adwIntegrationUrl = "https://adw-api.ospro.id/api";
@ -190,7 +191,7 @@ const editor = {
cost: { type: "number", map_to: "rencana_biaya", min: 0 }, cost: { type: "number", map_to: "rencana_biaya", min: 0 },
costActual: { type: "number", map_to: "biaya_actual", min: 0 }, costActual: { type: "number", map_to: "biaya_actual", min: 0 },
status: { type: "text", map_to: "status" }, status: { type: "text", map_to: "status" },
job_count: { type: "number", map_to: "jumlah_pekerjaan", min: 0 }, // job_count: { type: "number", map_to: "jumlah_pekerjaan", min: 0 },
job_unit: { type: "text", map_to: "satuan", min: 0 }, job_unit: { type: "text", map_to: "satuan", min: 0 },
bobot_planning: { type: "number", map_to: "bobot_planning", min: 0 }, bobot_planning: { type: "number", map_to: "bobot_planning", min: 0 },
human_resource: (`<div data-toggle="modal" data-target="#modal-hr"> human_resource: (`<div data-toggle="modal" data-target="#modal-hr">
@ -521,7 +522,7 @@ var allColumns = [
return roundToTwo(actual); return roundToTwo(actual);
}, resize: true }, resize: true
}, },
{ name: "jumlah_pekerjaan", label: "Volume Plan", align: "center", min_width: 100, resize: true, editor: editor.job_count }, // { name: "jumlah_pekerjaan", label: "Volume Plan", align: "center", min_width: 100, resize: true, editor: editor.job_count },
{ {
name: "jobs_done", label: "Report", align: "center", min_width: 100, resize: true, template: function (text) { name: "jobs_done", label: "Report", align: "center", min_width: 100, resize: true, template: function (text) {
if (text.type == "project" || text.type == "milestone" || text.type == "header") { if (text.type == "project" || text.type == "milestone" || text.type == "header") {
@ -586,7 +587,7 @@ let columnShows = {
baseline_progress: false, baseline_progress: false,
progress: true, progress: true,
progress_actual: true, progress_actual: true,
jumlah_pekerjaan: true, // jumlah_pekerjaan: true,
jobs_done: true, jobs_done: true,
satuan: false, satuan: false,
predecessor: false, predecessor: false,
@ -614,7 +615,7 @@ gantt.config.columns = createColumnsConfig({
baseline_progress: true, baseline_progress: true,
progress: true, progress: true,
progress_actual: true, progress_actual: true,
jumlah_pekerjaan: true, // jumlah_pekerjaan: true,
jobs_done: true, jobs_done: true,
satuan: true, satuan: true,
predecessor: true, predecessor: true,

1
edit-mode/index.html

@ -933,6 +933,7 @@
<script src="function/activityLocation.js"></script> <script src="function/activityLocation.js"></script>
<script> <script>
var button = document.getElementById("fullscreen_button"); var button = document.getElementById("fullscreen_button");
document.getElementById("project-name-header").textContent = ganttName;
button.addEventListener("click", function () { button.addEventListener("click", function () {
if (!gantt.getState().fullscreen) { if (!gantt.getState().fullscreen) {
gantt.expand(); gantt.expand();

Loading…
Cancel
Save