Parcourir la source

bug fix

tags/Baseline_30082024_FRONTEND_UAT
Mac\David il y a 1 an
Parent
révision
c1418a423d
2 fichiers modifiés avec 26 ajouts et 7 suppressions
  1. +1
    -1
      src/components/ProgressByTeam/ProgressByTeam.tsx
  2. +25
    -6
      src/components/StaffUtilization/StaffUtilization.tsx

+ 1
- 1
src/components/ProgressByTeam/ProgressByTeam.tsx Voir le fichier

@@ -95,7 +95,7 @@ const ProgressByTeam: React.FC = () => {
const manhourConsumptionPercentage = [] const manhourConsumptionPercentage = []
for (let i = 0; i < teamProjectResult.length; i++){ for (let i = 0; i < teamProjectResult.length; i++){
teamProjectResult[i].color = color[i] teamProjectResult[i].color = color[i]
projectNo.push(teamProjectResult[i].projectNo)
projectNo.push(teamProjectResult[i].projectCode)
manhourConsumptionPercentage.push(teamProjectResult[i].manhourConsumptionPercentage) manhourConsumptionPercentage.push(teamProjectResult[i].manhourConsumptionPercentage)
} }
setChartProjectName(projectNo) setChartProjectName(projectNo)


+ 25
- 6
src/components/StaffUtilization/StaffUtilization.tsx Voir le fichier

@@ -326,7 +326,7 @@ const StaffUtilization: React.FC<Props> = ({ abilities, staff }) => {
const result = new Array(weeklyPlannedList[0].length).fill(0); const result = new Array(weeklyPlannedList[0].length).fill(0);
for (const arr of weeklyPlannedList) { for (const arr of weeklyPlannedList) {
for (let i = 0; i < arr.length; i++) { for (let i = 0; i < arr.length; i++) {
result[i] += arr[i];
result[i] = Number((result[i] + arr[i]).toFixed(2));
if (chartMax < result[i]) { if (chartMax < result[i]) {
chartMax = result[i] chartMax = result[i]
} }
@@ -334,7 +334,11 @@ const StaffUtilization: React.FC<Props> = ({ abilities, staff }) => {
} }
setTeamTotalManhoursSpentPlanData(result) setTeamTotalManhoursSpentPlanData(result)
} }
}
else {
const result = new Array(weekDates.length).fill(0);
setTeamTotalManhoursSpentPlanData(result)
}
}
setTeamTotalManhoursSpentActualData(weeklyActualList); setTeamTotalManhoursSpentActualData(weeklyActualList);
setTotalManHoursMaxValue(chartMax) setTotalManHoursMaxValue(chartMax)
} }
@@ -369,14 +373,17 @@ const StaffUtilization: React.FC<Props> = ({ abilities, staff }) => {
const result = new Array(weeklyPlannedList[0].length).fill(0); const result = new Array(weeklyPlannedList[0].length).fill(0);
for (const arr of weeklyPlannedList) { for (const arr of weeklyPlannedList) {
for (let i = 0; i < arr.length; i++) { for (let i = 0; i < arr.length; i++) {
result[i] += arr[i];
result[i] = Number((result[i] + arr[i]).toFixed(2));
if (chartMax < result[i]) { if (chartMax < result[i]) {
chartMax = result[i] chartMax = result[i]
} }
} }
} }
setTeamTotalManhoursSpentPlanData(result) setTeamTotalManhoursSpentPlanData(result)
}
} else {
const result = new Array(weekDates.length).fill(0);
setTeamTotalManhoursSpentPlanData(result)
}
} }
setTeamTotalManhoursSpentActualData(weeklyActualList); setTeamTotalManhoursSpentActualData(weeklyActualList);
setTotalManHoursMaxValue(chartMax) setTotalManHoursMaxValue(chartMax)
@@ -567,7 +574,7 @@ const StaffUtilization: React.FC<Props> = ({ abilities, staff }) => {
result.push(manhoursResult[i].manhours) result.push(manhoursResult[i].manhours)
projectCodeList.push(manhoursResult[i].projectNo) projectCodeList.push(manhoursResult[i].projectNo)
projectList.push(manhoursResult[i].projectName) projectList.push(manhoursResult[i].projectName)
percentageList.push(manhoursResult[i].percentage)
percentageList.push(manhoursResult[i].manhours)
} }
setIndividualManhoursMaxValue(maxValue) setIndividualManhoursMaxValue(maxValue)
setIndividualStaffProjectList(projectList) setIndividualStaffProjectList(projectList)
@@ -599,7 +606,7 @@ const StaffUtilization: React.FC<Props> = ({ abilities, staff }) => {
result.push(manhoursResult[i].manhours) result.push(manhoursResult[i].manhours)
projectCodeList.push(manhoursResult[i].projectNo) projectCodeList.push(manhoursResult[i].projectNo)
projectList.push(manhoursResult[i].projectName) projectList.push(manhoursResult[i].projectName)
percentageList.push(manhoursResult[i].percentage)
percentageList.push(manhoursResult[i].manhours)
} }
setIndividualManhoursMaxValue(maxValue) setIndividualManhoursMaxValue(maxValue)
setIndividualStaffProjectList(projectList) setIndividualStaffProjectList(projectList)
@@ -756,6 +763,13 @@ const StaffUtilization: React.FC<Props> = ({ abilities, staff }) => {
]; ];


const options: ApexOptions = { const options: ApexOptions = {
tooltip: {
y: {
formatter: function (val) {
return val.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
}
}
},
chart: { chart: {
height: 350, height: 350,
type: "line", type: "line",
@@ -783,6 +797,11 @@ const StaffUtilization: React.FC<Props> = ({ abilities, staff }) => {
min: 0, min: 0,
max: totalManHoursMaxValue, max: totalManHoursMaxValue,
tickAmount: 5, tickAmount: 5,
labels: {
formatter: function (val) {
return val.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })
}
}
}, },
], ],
grid: { grid: {


Chargement…
Annuler
Enregistrer