"use strict";(self.webpackChunkwheelsmart_admin_react=self.webpackChunkwheelsmart_admin_react||[]).push([[8853],{18853:(e,a,t)=>{t.r(a),t.d(a,{default:()=>k});var s=t(65043),i=t(68493),n=t(5835),r=t(47419),l=t(11645),c=t(26655),d=t(5397),o=t(83003),m=t(60273),h=t(16876),p=t(20541),u=t(68149),j=t(5709),g=t(47196),x=t(94406),A=t(89421),y=t(64124),v=t(11670),f=(t(30657),t(72517),t(44474),t(53623),t(55881),t(70579));const{Dragger:F}=v.A,{Option:w}=x.A;const b=function(){const e=(0,o.wA)(),a=(0,o.d4)((e=>e.masters.jattuactivity.rowdata)),t=(0,o.d4)((e=>e.masters.jattuactivity.model)),c=(0,o.d4)((e=>e.masters.jattuactivity.loading)),[d]=i.A.useForm(),m=()=>a.id&&0!==a.id?(0,f.jsx)(s.Fragment,{children:(0,f.jsx)(A.A,{type:"primary",onClick:()=>{d.submit()},block:!0,children:"Update"})}):(0,f.jsx)(s.Fragment,{children:(0,f.jsx)(A.A,{type:"primary",block:!0,loading:c,onClick:()=>{c||d.submit()},children:"Add"})}),h=()=>{d.resetFields(),e((0,j.q2)(!1))},p=()=>(0,f.jsx)(s.Fragment,{children:(0,f.jsx)(A.A,{onClick:()=>{d.resetFields(),h()},type:"primary",block:!0,ghost:!0,children:"Cancel"})}),x=(0,f.jsxs)("h5",{className:"modal-title",children:[a.id&&0!==a.id?"Update":"Add"," Jattu Activity"]});return(0,f.jsx)(y.A,{visible:t,title:x,onCancel:()=>{h()},className:"hp-modal-p-24",footer:(0,f.jsxs)(r.A,{justify:"center",children:[(0,f.jsx)(l.A,{span:12,className:"hp-pr-4",children:(0,f.jsx)(p,{})}),(0,f.jsx)(l.A,{span:12,className:"hp-pl-4",children:(0,f.jsx)(m,{})})]}),centered:!0,closeIcon:(0,f.jsx)(g.dCQ,{className:"remix-icon text-color-black-100",size:24}),width:800,children:(0,f.jsx)(r.A,{children:(0,f.jsx)(l.A,{span:24,children:(0,f.jsx)(i.A,{layout:"vertical",form:d,autoComplete:"off",onFinish:()=>{a.id||(async()=>{const a={id:0,...await d.validateFields()};try{await e((0,u.xY)(a)),e((0,u.IF)({page:1,search:"",page_size:10})),e((0,j.q2)(!1)),d.resetFields()}catch(t){console.error("Error adding plant:",t)}})()},children:(0,f.jsx)(r.A,{gutter:[12,12],children:(0,f.jsx)(l.A,{span:24,md:12,children:(0,f.jsx)(i.A.Item,{label:"Name:",name:"name",rules:[{required:!0,message:"Please Input Jattu Activity Name"}],hasFeedback:!0,children:(0,f.jsx)(n.A,{id:"name",name:"name",style:{width:"100%"},placeholder:"Name",value:a.name,onChange:a=>{e((0,j.O2)({key:"name",value:a.target.value}))}})})})})})})})})};const k=function(){const e=(0,o.wA)(),a=(0,m.MD)("masters","jattuactivity").jattuActivitylist,t=((0,o.d4)((e=>e.masters.jattuactivity.noofpages)),(0,o.d4)((e=>e.masters.jattuactivity.listCount))),g=(0,o.d4)((e=>e.masters.jattuactivity.jattuActivityParams)),x=(0,o.d4)((e=>e.masters.jattuactivity.loading)),[A]=((0,o.d4)((e=>e.system.userAccessList)),i.A.useForm()),y=(0,o.d4)((e=>e.masters.jattuactivity.model));(0,s.useEffect)((()=>{e((0,u.IF)({page:1,search:"",page_size:10}))}),[]);const v=[{title:"S.No",dataIndex:"index",width:"5%"},{title:"Name",render:e=>(0,f.jsx)("span",{children:e.name}),filterMode:"tree",filterSearch:!0,width:"30%"}],F=null===a||void 0===a?void 0:a.map(((e,a)=>({...e,index:(g.page-1)*g.page_size+a+1})));console.log("data",F);const{Search:w}=n.A;return(0,f.jsxs)(r.A,{gutter:[12,12],className:"hp-mt-32",children:[(0,f.jsx)(h.A,{prefix:"Masters",postfix:"jattuactivity",pageTitle:"Jattu Activity",goBack:!0,addModelTile:"Add Jattu Activity",setIsModalVisible:a=>{e((0,j.q2)(a))},isModalVisible:y}),(0,f.jsx)(l.A,{span:24,children:(0,f.jsxs)(c.A,{children:[(0,f.jsxs)(r.A,{children:[(0,f.jsx)(l.A,{span:12,xs:24,sm:24,md:12,className:"hp-mb-12",children:(0,f.jsx)(w,{placeholder:"Search...",allowClear:!0,onChange:a=>{""==a.target.value&&(e((0,u.IF)({...g,page:1,search:""})),e((0,j.sG)({...g,page:1,search:""})))},onSearch:a=>{var t;t=a,e((0,j.sG)({...g,page:1,search:t})),e((0,u.IF)({...g,page:1,search:t}))}})}),(0,f.jsx)(l.A,{span:24,children:(0,f.jsx)(d.A,{tip:"Loading...",spinning:x,delay:500,children:(0,f.jsx)(p.A,{page:g.page,count:t,pageSize:g.page_size,columns:v,data:F,loading:x,onPageChange:function(a,t){e((0,j.sG)({...g,page_size:t,page:0==a?1:a})),e((0,u.IF)({...g,page_size:t,page:0==a?1:a}))},showTotal:function(e){return"Total "+e+" items"},scroll:!0})})})]}),(0,f.jsx)(b,{})]})})]})}}}]);
//# sourceMappingURL=8853.6c2452b1.chunk.js.map