From 08b82b9ea3020218fa77a1aa0603d6af3f7a5107 Mon Sep 17 00:00:00 2001 From: "MSI\\2Fi" Date: Fri, 30 Aug 2024 17:40:52 +0800 Subject: [PATCH] no message --- .../ResourceOverconsumptionReport.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/ResourceOverconsumptionReport/ResourceOverconsumptionReport.tsx b/src/components/ResourceOverconsumptionReport/ResourceOverconsumptionReport.tsx index b75505c..afb0ff8 100644 --- a/src/components/ResourceOverconsumptionReport/ResourceOverconsumptionReport.tsx +++ b/src/components/ResourceOverconsumptionReport/ResourceOverconsumptionReport.tsx @@ -84,14 +84,17 @@ return ( lowerLimit: 0.9 } if (query.team.length > 0 && query.team.toLocaleLowerCase() !== "all") { - // index = teamCombo.findIndex(team => team === query.team) + index = teamCombo.findIndex(team => team === query.team) // console.log(index) // console.log(teamCombo) - // console.log(team) + const sortedTeam = team.sort((a, b) => a.code.localeCompare(b.code)) + // console.log(sortedTeam) + const sortedId = sortedTeam[index].id + // console.log(sortedId) // console.log(team.find(team => query.team === `${team.code} - Team ${team.staffName}`)?.id) - const teamId = team.find(team => query.team === `${team.code} - Team ${team.staffName}`)?.id - // postData.teamId = team.sort()[index].id - postData.teamId = teamId + // const teamId = team.find(team => query.team === `${team.code} - Team ${team.staffName}`)?.id + postData.teamId = sortedId + // postData.teamId = teamId } if (Boolean(query.lowerLimit)) { postData.lowerLimit = query.lowerLimit/100