From 51cb9770ae8761235b6e706da109612ae847049b Mon Sep 17 00:00:00 2001 From: farhantock Date: Mon, 11 Dec 2023 12:49:20 +0700 Subject: [PATCH 1/4] delete unused --- .../CreatedProyek/.DialogHierarchy.js.swp | Bin 16384 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/views/SimproV2/CreatedProyek/.DialogHierarchy.js.swp diff --git a/src/views/SimproV2/CreatedProyek/.DialogHierarchy.js.swp b/src/views/SimproV2/CreatedProyek/.DialogHierarchy.js.swp deleted file mode 100644 index 426e022212eed132edc77a6f21437bfbeb612060..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16384 zcmeI3Ta08y8OP7UdVv+?qVWl=Z7$t|J>9dbZpd!;;LOe}(`Ij(ncYPv>r73b>gmIt zKBsd|^;~Gi1!IC5^??VF;Db+S;w38h01tqX$b&{Cga-m4K4C-+L6I1P;=eBERGl+D z%U~ov&>em|-Bn*zef52H{mx-|>~!N8xv8?x!RKs9$Y{LCm9GlY3!MZSv7p6b76HZZ(dY)m4wJ#nm~l zgA%9rR}V*wa^{|l!VPw=I^|J6T$%AuP1I~}RBnrRq{L8YXo2^l1$w+Sdedd6KDB?} znCSksg}vmeD^I-_Eivr#&;mmX3@tFUz|aCi3k)qVw7}2;?^z4*?#0e|^!_4k0j~e< z%Kd#yf0BSe@;8zDx6WVH?I?gp{_fio6!1Mp){{Q4h9OrJZ3@YFX@cM@x=W+09a1r>)WsY+moCKc$ zZ+ysceg*CY9dH~R0MGAnoF9O1gRg-_Z~%;fGWaC81iWym<2(p@;AXH3{NfVF*#P^% zKR)O4um%>u888Aq z241_^ah?OufZu^1gCBwW!8+g|2A=~5z%^hO_!s>3CU_n^3VseA2HyY+;0!noMu70` zKa)U>8DnJY$7_*N%qj21q+Tb5xYum5I4+EkzC(z7Rf9DBFlOrAiz89kxrGLtlX_BY zgw)3&4CzfkNX+<&E(^4L7%BPE-f(N;2nwhsc(}6SCv7BUL>pG^hqh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o9V5 Date: Mon, 11 Dec 2023 12:50:43 +0700 Subject: [PATCH 2/4] add calculate progress --- src/const/ApiConst.js | 5 ++++ .../SimproV2/CreatedProyek/DialogHierarchy.js | 29 +++++++++++++++---- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/src/const/ApiConst.js b/src/const/ApiConst.js index c13daa3..5552366 100644 --- a/src/const/ApiConst.js +++ b/src/const/ApiConst.js @@ -727,6 +727,11 @@ export const HIERARCHY_FTTH_DELETE = (id) => { export const HIERARCHY_FTTH_TREE = (id) => { return `${BASE_SIMPRO_LUMEN}/hierarchy-ftths/tree/${id}`; }; + +export const HIERARCHY_FTTH_COUNT_TREE = (id) => { + return `${BASE_SIMPRO_LUMEN}/hierarchy-ftths/count-tree/${id}`; +}; + export const WAYPOINT_SEARCH = `${BASE_SIMPRO_LUMEN}/waypoint/search`; export const IMAGE_UPLOAD = `${BASE_SIMPRO_LUMEN}/image/upload`; diff --git a/src/views/SimproV2/CreatedProyek/DialogHierarchy.js b/src/views/SimproV2/CreatedProyek/DialogHierarchy.js index 2bb089d..563d14d 100644 --- a/src/views/SimproV2/CreatedProyek/DialogHierarchy.js +++ b/src/views/SimproV2/CreatedProyek/DialogHierarchy.js @@ -5,7 +5,7 @@ import { Space, Table, Tooltip, Spin } from 'antd'; import 'antd/dist/antd.css'; import moment from 'moment'; import SweetAlert from 'react-bootstrap-sweetalert'; -import { HIERARCHY_FTTH_DELETE, HIERARCHY_FTTH_TREE, VERSION_GANTT_SEARCH, HIERARCHY_FTTH_ADD, USER_LIST } from '../../../const/ApiConst'; +import { HIERARCHY_FTTH_DELETE, HIERARCHY_FTTH_TREE, HIERARCHY_FTTH_COUNT_TREE, HIERARCHY_FTTH_ADD, USER_LIST } from '../../../const/ApiConst'; import axios from "../../../const/interceptorApi" import { NotificationContainer, NotificationManager } from 'react-notifications'; import DialogUserGantt from './DialogUserGantt'; @@ -13,11 +13,8 @@ import DialogForm from './DialogFormHierarchy' import DialogFormGantt from './DialogFormGantt'; import DialogGantt from './DialogGantt'; import { useTranslation } from 'react-i18next'; -import { async } from '@dabeng/react-orgchart'; -import { Link } from 'react-router-dom'; -import { use } from 'i18next'; import _ from 'lodash'; -const DialogHierarchy = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName }) => { +const DialogHierarchy = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName, dataViewStartDate }) => { const token = localStorage.getItem("token") const HEADER = { headers: { @@ -98,6 +95,22 @@ const DialogHierarchy = ({ openDialog, closeDialog, toggleDialog, idTask, proyek setOpenDialogFormGantt(true) } + const handleHitungProgress = async (id) => { + const url = HIERARCHY_FTTH_COUNT_TREE(id) + const result = await axios + .get(url, HEADER) + .then(res => res) + .catch((error) => error.response); + + if (result && result.status == 200) { + setLoading(false); + } else { + setLoading(false); + NotificationManager.error(`Data gagal dihitung silahkan coba lagi!`, 'Failed!!'); + } + } + + const handleViewGant = (id, name) => { setParentId(id) setParentName(name) @@ -196,11 +209,14 @@ const DialogHierarchy = ({ openDialog, closeDialog, toggleDialog, idTask, proyek {" "} + + + {" "} {" "} {text.dataGantt && ( - + )} , @@ -320,6 +336,7 @@ const DialogHierarchy = ({ openDialog, closeDialog, toggleDialog, idTask, proyek hierarchyName={parentName} idTask={idTask} openDialogHierarchy={openDialog} + dataViewStartDate={dataViewStartDate} /> Date: Mon, 11 Dec 2023 12:51:00 +0700 Subject: [PATCH 3/4] search gantt --- .../SimproV2/CreatedProyek/DialogGantt.js | 84 +++++++++---------- 1 file changed, 39 insertions(+), 45 deletions(-) diff --git a/src/views/SimproV2/CreatedProyek/DialogGantt.js b/src/views/SimproV2/CreatedProyek/DialogGantt.js index 27e0380..738a075 100644 --- a/src/views/SimproV2/CreatedProyek/DialogGantt.js +++ b/src/views/SimproV2/CreatedProyek/DialogGantt.js @@ -1,19 +1,19 @@ import React, { useEffect, useState, useMemo } from 'react' -import { Modal, ModalHeader, ModalBody, ModalFooter, Breadcrumb, BreadcrumbItem } from 'reactstrap'; +import { Modal, ModalHeader, ModalBody, Col, Row, Breadcrumb, BreadcrumbItem } from 'reactstrap'; import { Button } from 'reactstrap'; -import { Table, Tooltip, Spin } from 'antd'; +import { Select, Table, Tooltip, Spin } from 'antd'; import 'antd/dist/antd.css'; import moment from 'moment'; import SweetAlert from 'react-bootstrap-sweetalert'; -import { VERSION_GANTT_DELETE, VERSION_GANTT_SEARCH, USER_LIST } from '../../../const/ApiConst'; +import { VERSION_GANTT_DELETE, VERSION_GANTT_SEARCH } from '../../../const/ApiConst'; import axios from "../../../const/interceptorApi" import { NotificationContainer, NotificationManager } from 'react-notifications'; import DialogForm from './DialogFormGantt'; import DialogUserGantt from './DialogUserGantt'; - import { Link } from 'react-router-dom'; -const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName, hierarchyId, hierarchyName, openDialogHierarchy, isLogin, token, role_id, user_id }) => { +const { Option } = Select +const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName, hierarchyId, hierarchyName, openDialogHierarchy, isLogin, token, role_id, user_id, dataViewStartDate }) => { if (role_id && user_id && token && isLogin) { role_id = role_id; user_id = user_id; @@ -38,10 +38,10 @@ const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName const [alertDelete, setAlertDelete] = useState(false) const [idDelete, setIdDelete] = useState(0) const [idGantt, setIdGantt] = useState(0) - const [humanResource, setHumanResource] = useState([]) const [dataEdit, setDataEdit] = useState([]) const [typeDialog, setTypeDialog] = useState('') const [loading, setLoading] = useState(true); + const [searchGantt, setSearchGantt] = useState(null); useEffect(() => { if (openDialog && hierarchyId > 0 || idTask > 0 && !openDialogHierarchy) { @@ -51,33 +51,7 @@ const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName if (!openDialog) { setDataGantt([]); } - }, [hierarchyId, idTask, openDialog]) - - const getDataHumanResource = async () => { - const result = await axios - .get(USER_LIST, HEADER) - .then(res => res) - .catch((error) => error.response); - - if (result && result.status == 200) { - setTransferUser(result.data.data); - } else { - - } - } - - const setTransferUser = (data) => { - const finalData = [] - data.map((val, index) => { - let data = { - key: val.id, - title: val.name - } - finalData.push(data) - }); - setHumanResource(finalData) - } - + }, [hierarchyId, idTask, openDialog, searchGantt]) const getdataGantt = async () => { let payload; @@ -85,7 +59,8 @@ const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName payload = { "select": ["id", "name_version", "calculation_type", "description", "created_at", "progress"], "columns": [ - { "name": "hierarchy_ftth_id", "logic_operator": "=", "value": hierarchyId, "operator": "AND" } + { "name": "hierarchy_ftth_id", "logic_operator": "=", "value": hierarchyId, "operator": "AND" }, + { "name": "id", "logic_operator": "=", "value": searchGantt, "operator": "AND" } ], "orders": { "columns": ["name_version"], "ascending": true } } @@ -93,7 +68,8 @@ const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName payload = { "select": ["id", "name_version", "calculation_type", "description", "created_at", "progress"], "columns": [ - { "name": "proyek_id", "logic_operator": "=", "value": idTask, "operator": "AND" } + { "name": "proyek_id", "logic_operator": "=", "value": idTask, "operator": "AND" }, + { "name": "id", "logic_operator": "=", "value": searchGantt, "operator": "AND" } ], "orders": { "columns": ["name_version"], "ascending": true }, } @@ -168,6 +144,7 @@ const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName token: token, role_id: role_id, user_id: user_id, + dataViewStartDate: dataViewStartDate } }}> @@ -262,17 +239,36 @@ const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName <> - {hierarchyName ? + {hierarchyName ? ( Project {hierarchyName} - : -
Gantt Project {proyekName}
- } - {!hierarchyId && (<> - + ) : ( +
Gantt Project {proyekName}
+ )} + + + {!hierarchyId && ( + )} +
@@ -281,10 +277,8 @@ const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName
- {/* - - */} -
+ + Date: Mon, 11 Dec 2023 12:51:26 +0700 Subject: [PATCH 4/4] remove unused --- src/views/SimproV2/CreatedProyek/DialogInitDocument.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/SimproV2/CreatedProyek/DialogInitDocument.js b/src/views/SimproV2/CreatedProyek/DialogInitDocument.js index 34ab19f..038708e 100644 --- a/src/views/SimproV2/CreatedProyek/DialogInitDocument.js +++ b/src/views/SimproV2/CreatedProyek/DialogInitDocument.js @@ -150,11 +150,11 @@ const DialogInitialDocument = ({ openDialog, closeDialog, toggleDialog, idTypePr render: (text, record) => <> - + {" "} - + {" "} - + ,