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 : 18.118.30.153
(window.webpackJsonp=window.webpackJsonp||[]).push([[157],{1119:function(e,t,a){"use strict";a.r(t);var r=a(2),n=a(41),c=a.n(n),l=a(68),o=a(99),d=a(100),s=a(102),i=a(101),u=a(103),p=a(1),f=a.n(p),m=a(1139),g=a(1106),h=a(272),E=a(1098),y=a(104),b=a(858),v=a(266),D=a(269),w=a(288),O=a(3),x=a(0),S=a(309),j=a(1101),k=a(273),M=a.n(k),R=function(e){function t(){var e,a;Object(o.a)(this,t);for(var r=arguments.length,n=new Array(r),c=0;c<r;c++)n[c]=arguments[c];return(a=Object(s.a)(this,(e=Object(i.a)(t)).call.apply(e,[this].concat(n)))).state={datecode:"",date:"",del:!1,datemaster:[{fdatecode:"",fdate:"",fdeleted:!1}],error:!1,errorMessage:""},a.changeCell=function(e,t,r){var n={};n="fdatecode"===e.target.name?Object(x.a)({},t,Object(O.a)({},e.target.name,e.target.value.toUpperCase())):Object(x.a)({},t,Object(O.a)({},e.target.name,e.target.value)),a.props.changeDateMaster(n,r)},a.deleteRow=function(e,t,r){var n=Object(x.a)({},t,Object(O.a)({},e.target.name,e.target.checked));a.props.changeDateMaster(n,r)},a.addRow=function(){var e=a.state.datemaster.length-1,t=a.state.datemaster[e];if(""!==t.fdatecode&&""!==t.fdate){var r=!1;if(a.state.datemaster.map(function(a,n){a.fdatecode===t.fdatecode&&e!==n&&(r=!0)}),r){a.props.showError({header:"Error",content:"Duplicate datecode. Enter valid datecode."})}else{a.props.addDateMaster({fdatecode:"",fdate:"",fdeleted:!1})}}else{a.props.showError({header:"Error",content:"Date code and date cannot be blank"})}},a}return Object(u.a)(t,e),Object(d.a)(t,[{key:"componentDidMount",value:function(){this.setState({datemaster:Object(r.a)(this.props.dateMaster)}),this.props.onRef(this)}},{key:"componentDidUpdate",value:function(e){this.props.dateMaster!==e.dateMaster&&this.setState({datemaster:Object(r.a)(this.props.dateMaster)})}},{key:"render",value:function(){var e=this,t=this.state,a=t.datemaster,r=t.error,n=t.errorMessage,c=a.length,l={n:"[0-1]",m:"[0-9]",e:"[0-3]",d:"[0-9]",z:"[1-2]",y:"[0-9]"};return f.a.createElement("div",{className:"ui mini form"},r?f.a.createElement(S.a,{negative:!0},f.a.createElement(S.a.Header,null," ",n," ")):null,f.a.createElement("br",null),f.a.createElement(j.a,{celled:!0,style:{fontSize:"1.2536em"}},f.a.createElement(j.a.Header,null,f.a.createElement(j.a.Row,null,f.a.createElement(j.a.HeaderCell,{style:{width:"5%"},singleLine:!0,textAlign:"center"},"Sl. No."),f.a.createElement(j.a.HeaderCell,{style:{width:"20%"},textAlign:"center"},"Date Code"),f.a.createElement(j.a.HeaderCell,{textAlign:"center"},"Date"),f.a.createElement(j.a.HeaderCell,{style:{width:"10%"},textAlign:"center"},"Del"))),f.a.createElement(j.a.Body,null,a.map(function(t,a){return f.a.createElement(j.a.Row,{key:a},f.a.createElement(j.a.Cell,{textAlign:"center"},a+1),f.a.createElement(j.a.Cell,{textAlign:"center",singleLine:!0},f.a.createElement("input",{style:{textAlign:"center"},minLength:"3",maxLength:"3",className:"field",type:"text",name:"fdatecode",id:a,value:t.fdatecode,onChange:function(r){return e.changeCell(r,t,a)}})),f.a.createElement(j.a.Cell,null,f.a.createElement(M.a,{type:"text",formatChars:l,mask:"ed/nm/zyyy",value:t.fdate,name:"fdate",id:"date"+a,onChange:function(r){return e.changeCell(r,t,a)}})),f.a.createElement(j.a.Cell,{textAlign:"center"},c==a+1?f.a.createElement("div",{className:"ui checkbox"},f.a.createElement("input",{type:"checkbox",onKeyDown:function(t){t.preventDefault(),9===t.keyCode&&e.addRow()},name:"fdeleted",value:t.fdeleted,onChange:function(r){return e.deleteRow(r,t,a)},checked:"true"==t.fdeleted?"checked":null}),f.a.createElement("label",null," ")):f.a.createElement("div",{className:"ui checkbox"},f.a.createElement("input",{type:"checkbox",name:"fdeleted",value:t.fdeleted,onChange:function(r){return e.deleteRow(r,t,a)},checked:"true"==t.fdeleted?"checked":null}),f.a.createElement("label",null," "))))}))))}}]),t}(p.Component),C=Object(y.b)(function(e){return{dateMaster:e.dateMaster}},{addDateMaster:function(e){return{type:"ADD_DATE_MASTER",payload:e}},changeDateMaster:function(e,t){return{type:"CHANGE_DATE_MASTER",payload:{el:e,i:t}}},showError:v.w})(R),A=function(e){function t(){var e,a;Object(o.a)(this,t);for(var r=arguments.length,n=new Array(r),d=0;d<r;d++)n[d]=arguments[d];return(a=Object(s.a)(this,(e=Object(i.a)(t)).call.apply(e,[this].concat(n)))).state={deggrp:[],fdeggrp:"",fyear:"",fexamtype:"",fexamdate:"",frmSubmit:!0,open:!0},a.cancel=function(){a.setState({fdeggrp:"",fyear:"",fexamtype:"",fexamdate:"",frmSubmit:!1}),a.props.deleteDateMaster()},a.changeDeggrp=function(e,t){console.log(t.value);var r=a.props.deggrp.filter(function(e,a){return e.fdeggrp===t.value})[0];console.log("Arun Kumar:....",r),a.setState({fyear:r.fyear,fexamtype:r.fexamtype,fexamdate:r.fexamdate,fdeggrp:r.fdeggrp,frmSubmit:!1})},a.addRow=function(e,t){a.datetable.addRowbtn(e,t)},a.handleSave=Object(l.a)(c.a.mark(function e(){var t;return c.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.props.dateMaster.filter(function(e,t){if(""!==e.fdatecode&&""!==e.fdate)return e}),e.next=3,a.props.insertUpdateDateMaster(t,a.state.fdeggrp);case 3:a.cancel();case 4:case"end":return e.stop()}},e)})),a.renderHeader=function(){return f.a.createElement(m.a.Header,{style:{display:"flex"}},f.a.createElement("h3",null,"Date Master"),f.a.createElement("div",{className:"ml-auto"},f.a.createElement(g.a,{disabled:!a.state.frmSubmit,basic:!0,color:"blue",content:"Add",onClick:a.addRow,icon:"plus"}),f.a.createElement(g.a,{disabled:!a.state.frmSubmit,basic:!0,color:"green",content:"Save",onClick:a.handleSave,icon:"save"}),f.a.createElement(g.a,{basic:!0,onClick:a.cancel,color:"black",icon:"ban",content:"Cancel"}),f.a.createElement(b.a,{to:"/dashboard"},f.a.createElement(g.a,{basic:!0,color:"red",content:"Exit",icon:"home"}))))},a}return Object(u.a)(t,e),Object(d.a)(t,[{key:"componentDidMount",value:function(){var e=Object(l.a)(c.a.mark(function e(){return c.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.props.fetchDegGrp();case 2:return e.next=4,this.props.getDateMaster(this.props.user.fdeggrp);case 4:this.setState({frmSubmit:!0});case 5:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"componentDidUpdate",value:function(e){this.props.deggrp!==e.deggrp&&this.setState({deggrp:Object(r.a)(this.props.deggrp)})}},{key:"render",value:function(){var e=this,t=this.state,a=t.fdeggrp,r=t.frmSubmit,n=t.fyear,c=t.fexamtype,l=t.fexamdate;t.open;return f.a.createElement("div",{className:"animated fadeIn"},f.a.createElement(m.a,{fluid:!0},f.a.createElement(m.a.Content,null,this.renderHeader(),f.a.createElement(h.a,null),f.a.createElement(m.a.Description,{style:{height:"72vh",overflowY:"auto"}},f.a.createElement("div",{className:"col-md-6"},f.a.createElement(E.a,null,f.a.createElement(w.a,{pdeggrp:{fdeggrp:a,fyear:n,fexamtype:c,fexamdate:l},changeDeggrp:this.changeDeggrp}),f.a.createElement(g.a,{color:"blue",onClick:function(){if(""!=a)e.props.getDateMaster(a),e.setState({frmSubmit:!0});else{e.props.showError({header:"Error",content:"Select degree group"})}}},"Submit"))),f.a.createElement("div",{className:"col-md-6"},r?f.a.createElement(C,{onRef:function(t){return e.datetable=t}}):null)))))}}]),t}(p.Component);t.default=Object(y.b)(function(e){return{deggrp:e.deggrp,dateMaster:e.dateMaster,user:e.user}},{fetchDegGrp:v.j,getDateMaster:function(e){return function(){var t=Object(l.a)(c.a.mark(function t(a,r){var n,l;return c.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=r(),a({type:"SET_LOADER"}),t.next=4,D.a.get("/app.php",{params:{a:"getDateMaster",deggrp:e,univcode:n.univ.funivcode}});case 4:l=t.sent,a({type:"UNSET_LOADER"}),"object"!==typeof l.data?a({type:"SET_ERROR",payload:{error_code:-1,data:{msg:"Something went wrong"},status:"failure"}}):0===l.data.error_code?a({type:"FETCH_DATE_MASTER",payload:l.data}):a({type:"SET_ERROR",payload:l.data});case 7:case"end":return t.stop()}},t)}));return function(e,a){return t.apply(this,arguments)}}()},insertUpdateDateMaster:function(e,t){return function(){var a=Object(l.a)(c.a.mark(function a(r,n){var l,o;return c.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return l=n(),r({type:"SET_LOADER"}),a.next=4,D.a.post("/app.php?a=insertUpdateDateMaster&univcode="+l.univ.funivcode,{data:{fdeggrp:t,univcode:l.univ.funivcode,newDM:e,user:l.user}});case 4:o=a.sent,r({type:"UNSET_LOADER"}),"object"!==typeof o.data?r({type:"SET_ERROR",payload:{error_code:-1,data:{msg:"Something went wrong"},status:"failure"}}):r({type:"SET_ERROR",payload:o.data});case 7:case"end":return a.stop()}},a)}));return function(e,t){return a.apply(this,arguments)}}()},deleteDateMaster:function(){return{type:"DELETE_DATE_MASTER"}},showError:v.w})(A)},288:function(e,t,a){"use strict";var r=a(41),n=a.n(r),c=a(68),l=a(99),o=a(100),d=a(102),s=a(101),i=a(103),u=a(1),p=a.n(u),f=a(104),m=a(1098),g=a(1100),h=a(266),E=function(e){function t(){return Object(l.a)(this,t),Object(d.a)(this,Object(s.a)(t).apply(this,arguments))}return Object(i.a)(t,e),Object(o.a)(t,[{key:"componentDidMount",value:function(){var e=Object(c.a)(n.a.mark(function e(){return n.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this.props.deggrp.map(function(e,t){return{key:t,value:e.fdeggrp,text:"".concat(e.fdeggrp," - ").concat(e.fdescpn)}});console.log(this.props.pdeggrp);var t=this.props.pdeggrp,a=t.fdeggrp,r=t.fyear,n=t.fexamtype,c=t.fexamdate;return p.a.createElement("div",null,p.a.createElement(m.a.Field,null,p.a.createElement("label",null,"Degree Group"),p.a.createElement(g.a,{size:"mini",fluid:!0,search:!0,selection:!0,value:a,onChange:this.props.changeDeggrp,placeholder:"Select Degree Group",disabled:this.props.disabled,openOnFocus:!1,options:e,selectOnBlur:!1})),p.a.createElement(m.a.Group,null,p.a.createElement(m.a.Input,{placeholder:"Year",value:r,width:4,label:"Year",readOnly:!0}),p.a.createElement(m.a.Input,{placeholder:"Type",value:n,width:3,label:"Type",readOnly:!0}),p.a.createElement(m.a.Input,{placeholder:"Exam Date",label:"Exam Date",width:10,value:c,readOnly:!0})))}}]),t}(u.Component);t.a=Object(f.b)(function(e){return{deggrp:e.deggrp,user:e.user}},{fetchDegGrp:h.j})(E)}}]);
//# sourceMappingURL=157.f193b4ca.chunk.js.map
|