"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[3577],{3577:(e,t,s)=>{s.r(t),s.d(t,{default:()=>T});s(84391),s(98672);var a=s(65043),o=s(28114),r=s(45897),i=s(45499),d=s(91162),n=s(88943),l=s(26715),c=s(46789),p=s(40264),u=s(4710),h=s(94444),x=s(73216),f=s(10159),m=s(14556),g=s(33611),v=s(2448),D=s(70579);(0,g.RT)("Ngo9BigBOggjHTQxAR8/V1NBaF1cXmhPYVppR2Nbe052flVCalxXVAciSV9jS3pTc0RjWXlcdHBXRWVbVw==");const T=()=>{const e=(0,a.useRef)(null),t=(0,x.zy)(),s=(0,m.wA)(),g=(0,m.d4)((e=>e.civil.getCivilProjectActivityGanttChart)),[T,k]=(0,a.useState)([]),[b,j]=(0,a.useState)(""),[E,S]=(0,a.useState)(!1),[w,y]=(0,a.useState)({x:0,y:0});(0,a.useEffect)((()=>{null!==g&&void 0!==g&&g.data&&k(null===g||void 0===g?void 0:g.data)}),[g]),(0,a.useEffect)((()=>{var e;if(null!==t&&void 0!==t&&null!==(e=t.state)&&void 0!==e&&e.fromProjectSchedule){var a,o;const e={projectPlanID:null!==t&&void 0!==t&&null!==(a=t.state)&&void 0!==a&&a.fromProjectSchedule?null===(o=t.state.projectRowDataObj)||void 0===o?void 0:o.id:"",processPlanID:"",taskID:"",status:"",processID:"",statusID:"",sortOrder:"",generalSearch:"",iDisplayStart:0,iDisplayLength:-1};s((0,f.xvp)(e))}return()=>{s((0,f.tb5)({}))}}),[null===t||void 0===t?void 0:t.state]);const I=e=>{const t=e.data;console.log("Mouse over task: ",t),t.isCritical&&(j(`\n        <strong>Item Name:</strong> ${t.taskName}<br />\n        <strong>Start Date:</strong> ${(0,v.oB)(t.startDate)}<br />\n        <strong>Duration:</strong> ${t.planned_duration}<br />\n        <strong>Progress:</strong> ${t.progress}%\n      `),S(!0))},P=()=>{S(!1)},N=e=>{y({x:e.clientX,y:e.clientY})};return(0,D.jsx)("div",{className:"control-pane",children:(0,D.jsxs)("div",{className:"control-section",children:[(0,D.jsxs)(o.e,{id:"GanttExport",ref:e,dataSource:T,treeColumnIndex:1,taskFields:{id:"taskID",name:"taskName",startDate:"startDate",endDate:"endDate",planned_duration:"planned_duration",progress:"progress",dependency:"predecessor",child:"subtasks"},labelSettings:{leftLabel:"taskName"},allowPdfExport:!0,toolbarClick:(async t=>{if("GanttExport_pdfexport"===t.item.id){const t={fitToWidthSettings:{isFitToWidth:!1},columns:[{field:"taskID",headerText:"ID",width:80},{field:"taskName",headerText:"Task Name",width:250},{field:"startDate",headerText:"Start Date",width:150},{field:"planned_duration",headerText:"Duration",width:100},{field:"progress",headerText:"Progress",width:100},{field:"predecessor",headerText:"Predecessor",width:100}]};await e.current.pdfExport(t)}}).bind(void 0),enableCriticalPath:!0,toolbar:["ExpandAll","CollapseAll","CriticalPath","ZoomIn","ZoomOut","ZoomToFit","PdfExport"],tooltipSettings:{showTooltip:!1},allowResizing:!0,splitterSettings:{position:"40%"},taskbarHeight:20,rowDataBound:e=>{const t=e.row;t.addEventListener("mouseover",(t=>I(e))),t.addEventListener("mousemove",N),t.addEventListener("mouseout",P)},actionComplete:t=>{"criticalPath"===t.requestType&&setTimeout((()=>{document.querySelectorAll(".e-critical-taskbar").forEach((t=>{t.addEventListener("mouseover",(s=>{const a=e.current.getTaskData(t.getAttribute("data-taskid"));I({data:a})})),t.addEventListener("mousemove",N),t.addEventListener("mouseout",P)}))}),0)},children:[(0,D.jsxs)(r.r,{children:[(0,D.jsx)(r.e,{field:"taskID",width:"80"}),(0,D.jsx)(r.e,{field:"taskName",headerText:"Item Name",width:"250",minWidth:"300",clipMode:"EllipsisWithTooltip"}),(0,D.jsx)(r.e,{field:"startDate",headerText:"Start Date"}),(0,D.jsx)(r.e,{field:"planned_duration",headerText:"Duration",clipMode:"EllipsisWithTooltip"}),(0,D.jsx)(r.e,{field:"progress",headerText:"Progress",clipMode:"EllipsisWithTooltip"}),(0,D.jsx)(r.e,{field:"predecessor",headerText:"Dependency",clipMode:"EllipsisWithTooltip"})]}),(0,D.jsx)(i.y_,{services:[d.L,n.f,l.b,c.M,p.q,u.r,h.X]})]}),E&&(0,D.jsx)("div",{className:"custom-tooltip",style:{position:"fixed",top:w.y+10,left:w.x+10,backgroundColor:"#fff",padding:"8px",border:"1px solid #ccc",borderRadius:"4px",zIndex:1e3,pointerEvents:"none"},dangerouslySetInnerHTML:{__html:b}})]})})}},98672:()=>{}}]);
//# sourceMappingURL=3577.6ca9791e.chunk.js.map