|
|
|
@ -34,7 +34,6 @@ function BoxDashboard({ value, title, secondaryTitle, icon, bgColor }) {
|
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// pardon this, i've no time
|
|
|
|
|
function BoxDashboardNoIcon({ value, title, secondaryTitle, bgColor }) { |
|
|
|
|
return ( |
|
|
|
|
<> |
|
|
|
@ -61,6 +60,9 @@ const DashboardPM = () => {
|
|
|
|
|
const [PROJECTACTUALCOSTTOTAL, SET_PROJECTACTUALCOSTTOTAL] = useState(0) |
|
|
|
|
const [PROJECTCOSTTOTAL, SET_PROJECTCOSTTOTAL] = useState(0) |
|
|
|
|
const [TOTALREVENUE, SET_TOTALREVENUE] = useState(0) |
|
|
|
|
const [MANPOWERS, SET_MANPOWERS] = useState(0) |
|
|
|
|
const [PROJECTPHASES, SET_PROJECTPHASES] = useState([]) |
|
|
|
|
const [PROJECTSBYPHASE, SET_PROJECTSBYPHASE] = useState([]) |
|
|
|
|
|
|
|
|
|
const token = localStorage.getItem("token") |
|
|
|
|
const HEADER = { |
|
|
|
@ -78,6 +80,10 @@ const DashboardPM = () => {
|
|
|
|
|
result.data.totalActualCost != undefined ? SET_PROJECTCOSTTOTAL(result.data.totalActualCost) : SET_PROJECTCOSTTOTAL(0) |
|
|
|
|
result.data.totalPlannedCost != undefined ? SET_PROJECTBUDGETTOTAL(result.data.totalPlannedCost) : SET_PROJECTBUDGETTOTAL(0) |
|
|
|
|
result.data.totalRevenue != undefined ? SET_TOTALREVENUE(result.data.totalRevenue) : SET_TOTALREVENUE(0) |
|
|
|
|
result.data.manpowers != undefined ? SET_MANPOWERS(result.data.manpowers) : SET_MANPOWERS(0) |
|
|
|
|
result.data.projectPhases != undefined ? SET_PROJECTPHASES(result.data.projectPhases) : SET_PROJECTPHASES([]) |
|
|
|
|
result.data.projectsByPhase != undefined ? SET_PROJECTSBYPHASE(result.data.projectsByPhase) : SET_PROJECTSBYPHASE([]) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
@ -95,34 +101,42 @@ const DashboardPM = () => {
|
|
|
|
|
lg: 32, |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
<Col span={6} style={{ margin: '' }}> |
|
|
|
|
<Col span={4} style={{ margin: '' }}> |
|
|
|
|
<BoxDashboard |
|
|
|
|
icon={<i style={{ color: '#fff' }} class="zmdi zmdi-calendar-note zmdi-hc-2x"></i>} |
|
|
|
|
value={PROJECTCOUNT} |
|
|
|
|
bgColor="#0287c7" |
|
|
|
|
title="Projects" |
|
|
|
|
/> |
|
|
|
|
</Col> |
|
|
|
|
<Col span={5} style={{ margin: '' }}> |
|
|
|
|
<BoxDashboard |
|
|
|
|
icon={<i style={{ color: '#fff' }} class="zmdi zmdi-money zmdi-hc-4x"></i>} |
|
|
|
|
icon={<i style={{ color: '#fff' }} class="zmdi zmdi-money zmdi-hc-2x"></i>} |
|
|
|
|
value={`${formatRibuanDecimal(PROJECTBUDGETTOTAL)}`} |
|
|
|
|
bgColor="#077857" |
|
|
|
|
bgColor="#cf6102" |
|
|
|
|
title="Budget" |
|
|
|
|
/> |
|
|
|
|
</Col> |
|
|
|
|
<Col span={6} style={{ margin: '' }}> |
|
|
|
|
<Col span={5} style={{ margin: '' }}> |
|
|
|
|
<BoxDashboard |
|
|
|
|
icon={<i style={{ color: '#fff' }} class="zmdi zmdi-money zmdi-hc-4x"></i>} |
|
|
|
|
icon={<i style={{ color: '#fff' }} class="zmdi zmdi-money zmdi-hc-2x"></i>} |
|
|
|
|
value={`${formatRibuanDecimal(PROJECTCOSTTOTAL)}`} |
|
|
|
|
bgColor="#077857" |
|
|
|
|
bgColor="#f51d1d" |
|
|
|
|
title="Spent on Projects" |
|
|
|
|
/> |
|
|
|
|
</Col> |
|
|
|
|
<Col span={6} style={{ margin: '' }}> |
|
|
|
|
<Col span={5} style={{ margin: '' }}> |
|
|
|
|
<BoxDashboard |
|
|
|
|
icon={<i style={{ color: '#fff' }} class="zmdi zmdi-money zmdi-hc-4x"></i>} |
|
|
|
|
icon={<i style={{ color: '#fff' }} class="zmdi zmdi-money zmdi-hc-2x"></i>} |
|
|
|
|
value={`${formatRibuanDecimal(TOTALREVENUE)}`} |
|
|
|
|
bgColor="#077857" |
|
|
|
|
title="Revenue" |
|
|
|
|
/> |
|
|
|
|
</Col> |
|
|
|
|
<Col span={6} style={{ margin: '' }}> |
|
|
|
|
<Col span={4} style={{ margin: '' }}> |
|
|
|
|
<BoxDashboard |
|
|
|
|
icon={<i style={{ color: '#fff' }} class="zmdi zmdi-accounts-alt zmdi-hc-4x"></i>} |
|
|
|
|
value="-" |
|
|
|
|
icon={<i style={{ color: '#fff' }} class="zmdi zmdi-accounts-alt zmdi-hc-2x"></i>} |
|
|
|
|
value={MANPOWERS} |
|
|
|
|
bgColor="#0287c7" |
|
|
|
|
title="Manpowers" |
|
|
|
|
/> |
|
|
|
@ -134,6 +148,12 @@ const DashboardPM = () => {
|
|
|
|
|
<Panel key="1"> |
|
|
|
|
<Row style={{ margin: '15px 10px 0px 0px' }}> |
|
|
|
|
<Col span={8} > |
|
|
|
|
<Row> |
|
|
|
|
<Col span={24}> |
|
|
|
|
<h6 class="text-center">Car Management</h6> |
|
|
|
|
<h6 class="text-center">Total Vehicles: -</h6> |
|
|
|
|
</Col> |
|
|
|
|
</Row> |
|
|
|
|
<Row |
|
|
|
|
gutter={{ |
|
|
|
|
xs: 8, |
|
|
|
@ -145,15 +165,15 @@ const DashboardPM = () => {
|
|
|
|
|
<Col span={12}> |
|
|
|
|
<BoxDashboardNoIcon |
|
|
|
|
value="-" |
|
|
|
|
bgColor="#077857" |
|
|
|
|
title="Active / Standby" |
|
|
|
|
bgColor="#5e5c70" |
|
|
|
|
title="On Duty" |
|
|
|
|
/> |
|
|
|
|
</Col> |
|
|
|
|
<Col span={12}> |
|
|
|
|
<BoxDashboardNoIcon |
|
|
|
|
value="-" |
|
|
|
|
bgColor="#077857" |
|
|
|
|
title="Need Maintenance" |
|
|
|
|
bgColor="#5e5c70" |
|
|
|
|
title="At Pool" |
|
|
|
|
/> |
|
|
|
|
</Col> |
|
|
|
|
</Row> |
|
|
|
@ -167,7 +187,7 @@ const DashboardPM = () => {
|
|
|
|
|
> |
|
|
|
|
<Col span={12}> |
|
|
|
|
<BoxDashboardNoIcon |
|
|
|
|
bgColor="#077857" |
|
|
|
|
bgColor="#5e5c70" |
|
|
|
|
title="" |
|
|
|
|
value={<i style={{ color: '#fff' }} class="zmdi zmdi-truck zmdi-hc-2x"></i>} |
|
|
|
|
/> |
|
|
|
@ -175,14 +195,14 @@ const DashboardPM = () => {
|
|
|
|
|
<Col span={12}> |
|
|
|
|
<BoxDashboardNoIcon |
|
|
|
|
value="-" |
|
|
|
|
bgColor="#077857" |
|
|
|
|
bgColor="#5e5c70" |
|
|
|
|
title="On Maintenance" |
|
|
|
|
/> |
|
|
|
|
</Col> |
|
|
|
|
</Row> |
|
|
|
|
</Col> |
|
|
|
|
<Col span={8}> |
|
|
|
|
<ProjectPhaseChart /> |
|
|
|
|
<ProjectPhaseChart projectPhases={PROJECTPHASES} projectsByPhase={PROJECTSBYPHASE} /> |
|
|
|
|
</Col> |
|
|
|
|
<Col span={8}> |
|
|
|
|
<ProjectTypeChart /> |
|
|
|
|