From 962ebdc440e3629be8d328a3cbef00334ba48bec Mon Sep 17 00:00:00 2001 From: Yusuf Date: Sat, 6 Aug 2022 00:00:05 +0700 Subject: [PATCH] wip --- src/views/DashboardPMOV1/index.js | 8 ++++--- src/views/DashboardPMOV1/tableDashboardv1.js | 22 ++++++++++++++++++-- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/views/DashboardPMOV1/index.js b/src/views/DashboardPMOV1/index.js index d59a248..36c41b9 100644 --- a/src/views/DashboardPMOV1/index.js +++ b/src/views/DashboardPMOV1/index.js @@ -62,6 +62,7 @@ const DashboardPM = () => { const [MANPOWERS, SET_MANPOWERS] = useState(0) const [PROJECTPHASES, SET_PROJECTPHASES] = useState([]) const [PROJECTSBYPHASE, SET_PROJECTSBYPHASE] = useState([]) + const [PROJECTSONDANGER, SET_PROJECTSONDANGER] = useState(0) const [PROJECTTYPES, SET_PROJECTTYPES] = useState([]) const [PROJECTSBYTYPE, SET_PROJECTSBYTYPE] = useState([]) @@ -87,6 +88,7 @@ const DashboardPM = () => { result.data.projectsByPhase != undefined ? SET_PROJECTSBYPHASE(result.data.projectsByPhase) : SET_PROJECTSBYPHASE([]) result.data.projectTypes != undefined ? SET_PROJECTTYPES(result.data.projectTypes) : SET_PROJECTTYPES([]) result.data.projectsByType != undefined ? SET_PROJECTSBYTYPE(result.data.projectsByType) : SET_PROJECTSBYTYPE([]) + result.data.projectsOnDanger != undefined ? SET_PROJECTSONDANGER(result.data.projectsOnDanger) : SET_PROJECTSONDANGER(0) } @@ -114,7 +116,7 @@ const DashboardPM = () => { { @@ -163,7 +165,7 @@ const DashboardPM = () => { - + diff --git a/src/views/DashboardPMOV1/tableDashboardv1.js b/src/views/DashboardPMOV1/tableDashboardv1.js index 6d3fb23..a212f2c 100644 --- a/src/views/DashboardPMOV1/tableDashboardv1.js +++ b/src/views/DashboardPMOV1/tableDashboardv1.js @@ -18,13 +18,16 @@ const TableDashboardV1 = () => { } } + const [MANPOWERS, SET_MANPOWERS] = useState(0) const [dataTable, setDataTable] = useState([]) + const getProjects = async () => { const URL = `${BASE_OSPRO}/api/project/list` const result = await axios.get(URL, HEADER).then(res => res).catch(err => err.response) - console.log("qqq", result) + if (result.data.code == 200) { setDataTable(result.data.data); + result.data.manpowers != undefined ? SET_MANPOWERS(result.data.manpowers) : SET_MANPOWERS(0) } } @@ -33,13 +36,28 @@ const TableDashboardV1 = () => { title: 'Project', dataIndex: 'nama', key: 'nama', - render: (text, record) => {text}, + render: (text, record) => + + {record.kode_sortname}
{text} + , + }, + { + title: 'Project Manager', + dataIndex: 'projectManager', + key: 'projectManager', }, { title: 'Planned Interval', dataIndex: 'plannedInterval', key: 'plannedInterval', }, + { + title: 'Manpower', + dataIndex: 'manpower', + render: (text) => { + return `${text}/${MANPOWERS}` + } + }, { title: 'Budget Project', dataIndex: 'plannedCost',