Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 13.59.67.189
import{x as h,r as s,y as j,t as e,D as y,L as d,B as n,T as b,O as C,M as D,v as T,E as l}from"./index-DfEK0E8g.js";import{g as I}from"./TemplateCode-us5Sna_0.js";import{g as i,s as c}from"./datatable-CGnYKdpq.js";import{p as R}from"./sem-DLpF_ddZ.js";import{S as m}from"./index-Fh5tF1lB.js";import{R as v}from"./HomeOutlined-CZtKeVIo.js";import{F as S}from"./Table-ieolh-q0.js";import{R as k}from"./EditOutlined-DXSew4Ci.js";import{R as w}from"./FilePdfOutlined-Dt_qgPGy.js";import{R as A}from"./DeleteOutlined-I01v22fA.js";import"./index-CoCZOPj_.js";import"./index-BT78X51v.js";import"./index-C3842RPj.js";import"./responsiveObserver-D7cmz6KF.js";const E=a=>{s.useState(""),j();const[p,f]=s.useState([]);s.useEffect(()=>{a.getTempCodeDet()},[]),s.useEffect(()=>{f(a.tempData)},[a.tempData]);const g=[{title:"Sl. No.",dataIndex:"fslno",align:"center",width:"4rem"},{title:e.jsx("div",{style:{textAlign:"center"},children:"Template Code"}),dataIndex:"ftempcode",...i("ftempcode","tempcode"),sorter:(o,t)=>c(o,t,"ftempcode"),align:"center"},{title:e.jsx("div",{style:{textAlign:"center"},children:"Template Name"}),dataIndex:"ftempname",...i("ftempname","tempname"),sorter:(o,t)=>c(o,t,"ftempname")},{title:e.jsx("div",{style:{textAlign:"center"},children:"Template Description"}),dataIndex:"ftempdesc",...i("ftempdesc","temp desc."),sorter:(o,t)=>c(o,t,"ftempdesc")},{title:"Action",render:(o,t)=>e.jsxs(m,{children:[e.jsx(d,{to:`/qpsettings/edit/edit/${t.ftempcode}`,children:e.jsxs(n,{size:"medium",style:{background:"green",color:"#fff"},children:[e.jsx(k,{})," Edit"]})}),e.jsxs(n,{size:"medium",style:{background:"#2185d0",color:"#fff"},onClick:()=>x(t.ftempcode),children:[e.jsx(w,{})," Report"]}),e.jsxs(n,{size:"medium",style:{background:"#db2828",color:"#fff"},onClick:()=>u(t.ftempcode),children:[e.jsx(A,{})," Delete"]})]}),align:"center"}],x=async o=>{let t=localStorage.getItem("dbname");window.open(C+"/app.php?a=QPPatternDet&db="+t+"&univcode="+a.funivcode+"&tempcode="+o)},u=async o=>{let t=localStorage.getItem("dbname");D.confirm({title:"Warning",content:"Do you want delete?",okButtonProps:{style:{backgroundColor:"#8231d3",borderColor:"#8231d3"}},onOk(){T.post("app.php?a=deleteTemplateCode&db="+t+"&univcode="+a.funivcode+"&tempcode="+o).then(r=>{if(typeof r.data!="object"){l("Error","Something went wrong, Please try again later");return}else if(r.data.error_code==0){l("success",r.data.data.msg),a.getTempCodeDet();return}}).catch(r=>console.log(r))},onCancel(){console.log("Cancelled")}})};return e.jsx(y,{style:{margin:"6rem 10px 10px"},title:e.jsx("h6",{children:"QP Template"}),extra:e.jsxs(m,{children:[e.jsx(d,{to:"/qpsettings/edit/add/''",children:e.jsxs(n,{type:"primary",style:{backgroundColor:"green"},children:[e.jsx(b,{}),"Add"]})}),e.jsx(d,{to:"/dashboard",children:e.jsxs(n,{type:"primary",danger:!0,children:[e.jsx(v,{})," Exit"]})})]}),children:e.jsx(S,{dataSource:p,columns:g,scroll:{x:1300,y:500},bordered:!0,size:"small",pagination:R})})},P=a=>({funivcode:a.loginfo.userData.funivcode,tempData:a.tempDet}),J=h(P,{getTempCodeDet:I})(E);export{J as default};
|