|
|
|
@ -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]}> |
|
|
|
|