feat: PieChart data ploted from backend
parent
5e81f02116
commit
76929c41ec
|
@ -72,7 +72,7 @@ const PieChart = ({ data = dataExample }) => {
|
||||||
return (
|
return (
|
||||||
<Box width="100%" height="100%" position="relative" display="flex">
|
<Box width="100%" height="100%" position="relative" display="flex">
|
||||||
<Box sx={{ position: "absolute" }}>
|
<Box sx={{ position: "absolute" }}>
|
||||||
<Title>Tickets Status</Title>
|
<Title>Tickets status de encerramento</Title>
|
||||||
</Box>
|
</Box>
|
||||||
<Box
|
<Box
|
||||||
component="ul"
|
component="ul"
|
||||||
|
|
|
@ -258,7 +258,7 @@ const Dashboard = () => {
|
||||||
const [usersOnlineInfo, dispatch] = useReducer(reducer, [])
|
const [usersOnlineInfo, dispatch] = useReducer(reducer, [])
|
||||||
const [ticketStatusChange, setStatus] = useState()
|
const [ticketStatusChange, setStatus] = useState()
|
||||||
const [ticketsStatus, setTicktsStatus] = useState({ open: 0, openAll: 0, pending: 0, closed: 0 })
|
const [ticketsStatus, setTicktsStatus] = useState({ open: 0, openAll: 0, pending: 0, closed: 0 })
|
||||||
|
const [ticketStatusChatEnd, setTicketStatusChatEnd] = useState([])
|
||||||
const { user } = useContext(AuthContext)
|
const { user } = useContext(AuthContext)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -289,10 +289,15 @@ const Dashboard = () => {
|
||||||
params: { userId: null, startDate: dateToday, endDate: dateToday },
|
params: { userId: null, startDate: dateToday, endDate: dateToday },
|
||||||
})
|
})
|
||||||
|
|
||||||
// console.log('data.data: ', data.usersProfile)
|
|
||||||
|
|
||||||
dispatch({ type: "RESET" })
|
dispatch({ type: "RESET" })
|
||||||
dispatch({ type: "LOAD_QUERY", payload: data.usersProfile })
|
dispatch({ type: "LOAD_QUERY", payload: data.usersProfile })
|
||||||
|
|
||||||
|
const { data: ticketStatusChatEndData } = await api.get("/reports/count/statusChatEnd", {
|
||||||
|
params: { startDate: '2024-03-21', endDate: '2024-03-28' },
|
||||||
|
})
|
||||||
|
|
||||||
|
setTicketStatusChatEnd(ticketStatusChatEndData.reportStatusChatEnd)
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -506,7 +511,7 @@ const Dashboard = () => {
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} sm={12} md={6} lg={6}>
|
<Grid item xs={12} sm={12} md={6} lg={6}>
|
||||||
<Paper className={classes.fixedHeightPaper} variant="outlined">
|
<Paper className={classes.fixedHeightPaper} variant="outlined">
|
||||||
<PieChart data={[]} />
|
<PieChart data={ticketStatusChatEnd} />
|
||||||
</Paper>
|
</Paper>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
Loading…
Reference in New Issue