Browse Source

add dashboard pmo

pull/2/head
satori 2 years ago
parent
commit
3b6ca71202
  1. 5
      src/const/CustomFunc.js
  2. 26
      src/views/DashboardPMO/index.js

5
src/const/CustomFunc.js

@ -340,3 +340,8 @@ export const renderLabelStatus = (text) => {
}
return label;
}
export const formatRibuanDecimal = (n) => {
let parts=n.toString().split(".");
return "Rp. " + parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ".") + (parts[1] ? "," + parts[1] : "");
}

26
src/views/DashboardPMO/index.js

@ -11,7 +11,8 @@ import numeral from 'numeral';
import { Table, Tree, Row, Col, Space, Card} from 'antd';
import { Pie } from '@ant-design/plots';
import { NotificationContainer, NotificationManager } from 'react-notifications';
import { formatRupiah, DATE_TIME_FORMAT } from '../../const/CustomFunc.js';
import { formatRibuanDecimal, DATE_TIME_FORMAT } from '../../const/CustomFunc.js';
import { Badge } from 'reactstrap';
const token = localStorage.getItem("token")
const HEADER = {
@ -39,10 +40,6 @@ const Dashboard = () => {
NotificationManager.error('Belum ada data proyek!', 'Failed');
}
console.log("res ", result.data.data)
// const arr = result.data.data.map((res) => {
// console.log("insd", res)
// return res
// });
setDataTable(result.data.data);
}
@ -62,27 +59,33 @@ const Dashboard = () => {
title: 'Planned Cost',
dataIndex: 'plannedCost',
key: 'plannedCost',
render: (text) => <a>{ formatRibuanDecimal(text) }</a>,
},
{
title: 'Actual Cost',
dataIndex: 'actualCost',
key: 'actualCost',
render: (text) => <a>{ formatRibuanDecimal(text) }</a>,
},
{
title: 'Cost Variance',
dataIndex: 'costVariance',
key: 'costVariance',
render: (text) => <a>{ formatRibuanDecimal(text) }</a>,
},
{
title: 'Cost Health',
dataIndex: 'costHealth',
key: 'costHealth',
},
{
title: 'Schedule Health',
dataIndex: 'scheduleHealth',
key: 'scheduleHealth',
render: (text) => {
if(text == "on-budget") {
return <Badge color="success">On Budget</Badge>
} else if(text == "warning") {
return <Badge color="warning">Warning</Badge>
} else {
return <Badge color="danger">Danger</Badge>
}
}
},
{
title: 'Progress',
@ -136,7 +139,6 @@ const Dashboard = () => {
</Card>
</Col>
<Col span={6} >
<PieChart />
</Col>
</Row>
<Row gutter={[16, 16]}>

Loading…
Cancel
Save