diff --git a/src/views/DashboardProject/chatDashboard.js b/src/views/DashboardProject/chatDashboard.js index c69feb2..0a1ef3e 100644 --- a/src/views/DashboardProject/chatDashboard.js +++ b/src/views/DashboardProject/chatDashboard.js @@ -3,7 +3,7 @@ const ChatDashboard = () => { return (
-
COMUNICATION
+
Minutes of Meeting
@@ -12,7 +12,7 @@ const ChatDashboard = () => { Robert William
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore Read More...
14/01/22 14:21 @@ -25,7 +25,7 @@ const ChatDashboard = () => { Jennifer lawrence
- Curabitur lobortis tellus nibh, at tincidunt turpis viverra at. Integer aliquam in quam eu fringilla. Nullam eu mauris gravida + Curabitur lobortis tellus nibh, at tincidunt turpis viverra at. Integer aliquam in quam eu fringilla. Nullam eu mauris Read More...
14/01/22 10:20 diff --git a/src/views/DashboardProject/index.js b/src/views/DashboardProject/index.js index e84047c..a973d73 100644 --- a/src/views/DashboardProject/index.js +++ b/src/views/DashboardProject/index.js @@ -8,10 +8,10 @@ import ChatDashboard from './chatDashboard'; import axios from 'axios' import { NotificationContainer, NotificationManager } from 'react-notifications'; import { useParams } from 'react-router-dom'; +import { Badge } from 'reactstrap'; import { BASE_OSPRO } from '../../const/ApiConst'; -import { - formatThousand, -} from "../../const/CustomFunc"; +import {formatRibuanDecimal} from "../../const/CustomFunc"; +import ProgressBar from "./progressBar"; function BoxDashboard({ value, title, secondaryTitle, icon, bgColor }) { return ( @@ -25,7 +25,18 @@ function BoxDashboard({ value, title, secondaryTitle, icon, bgColor }) { ) } +function RenderHealthProject({params}){ + if (params == "on-budget") { + return (On Budget) + } else if (params == "warning") { + return (Warning) + } else { + return (Danger) + } +} + const DashboardProject = () => { + const { ID } = useParams(); const [STATUSPROJECT, SET_STATUSPROJECT] = useState([]) const [PROJECTMGR, SET_PROJECTMGR] = useState([]) @@ -38,9 +49,11 @@ const DashboardProject = () => { const [BCWP, SET_BCWP] = useState([]) const [ACWP, SET_ACWP] = useState([]) const [VARIANCE, SET_VARIANCE] = useState([]) + const [PROGRESS, SET_PROGRESS] = useState([]) const [BUDGET, SET_BUDGET] = useState([]) const [PROJECTNAME, SET_PROJECTNAME] = useState([]) const [CURRENCYSYMBOL, SET_CURRENCYSYMBOL] = useState([]) + const [BUDGETHEALTH, SET_BUDGETHEALTH] = useState([]) @@ -58,8 +71,8 @@ const DashboardProject = () => { if (result.data.code !== 200) { NotificationManager.error('Belum ada data proyek!', 'Failed'); } - let resData; - result.data.data.map(datas => resData = datas); + let resData = result.data.data; + // result.data.data.map(datas => resData = datas); SET_BUDGET(resData.rencana_biaya) SET_PROJECTMGR(resData.pm) SET_RO(resData.company) @@ -67,6 +80,9 @@ const DashboardProject = () => { SET_STARTDATE(resData.start) SET_BASELINEFINISHDATE(resData.finish) SET_CURRENCYSYMBOL(resData.currency_symbol) + SET_BUDGETHEALTH(resData.budget_health) + SET_ACWP(resData.actualCost) + SET_PROGRESS(resData.progress) } useEffect(() => { @@ -155,8 +171,8 @@ const DashboardProject = () => {
-
Budget To Date (BCWP)
-
Rp. 2.000.000.000
+
Budget Proyek
+
{`${formatRibuanDecimal(BUDGET)}`}
@@ -166,8 +182,8 @@ const DashboardProject = () => {
-
Actual To Date (ACWP)
-
Rp. 1.700.000.000
+
Actual Cost
+
{`${formatRibuanDecimal(ACWP)}`}
@@ -178,7 +194,7 @@ const DashboardProject = () => {
Variance
-
Rp. 300.000.000
+
{`${formatRibuanDecimal(BUDGET - ACWP)}`}
@@ -187,20 +203,24 @@ const DashboardProject = () => { - } - value={`${CURRENCYSYMBOL} ${formatThousand(BUDGET)}`} + value={`${CURRENCYSYMBOL} ${formatRibuanDecimal(BUDGET)}`} bgColor="#059669" - title="Budget" /> + title="Budget" /> */} +
+
+
Progress
+
+ +
HEALTH PROJECT
-
-
-
-
+
+
diff --git a/src/views/DashboardProject/progressBar.js b/src/views/DashboardProject/progressBar.js new file mode 100644 index 0000000..4eb2209 --- /dev/null +++ b/src/views/DashboardProject/progressBar.js @@ -0,0 +1,37 @@ +import React from "react"; + +const ProgressBar = (props) => { + const { bgcolor, completed } = props; + + const containerStyles = { + height: 25, + width: '100%', + backgroundColor: "#e0e0de", + borderRadius: 50, + margin: 0 + } + + const fillerStyles = { + height: '100%', + width: `${completed}%`, + backgroundColor: bgcolor, + borderRadius: 'inherit', + textAlign: 'right' + } + + const labelStyles = { + padding: 5, + color: 'white', + fontWeight: 'bold' + } + + return ( +
+
+ {`${completed}%`} +
+
+ ); + }; + + export default ProgressBar; \ No newline at end of file