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 : 3.15.138.214
(window.webpackJsonp=window.webpackJsonp||[]).push([[136],{1108:function(e,t,n){"use strict";n.r(t);var a=n(0),c=n(2),r=n(41),o=n.n(r),i=n(3),s=n(68),l=n(99),u=n(100),d=n(102),m=n(101),b=n(103),p=n(1),f=n.n(p),h=n(1139),g=n(1106),v=n(272),E=n(1098),C=n(1100),j=n(104),O=n(266),w=n(269),y=n(23),S=(n(463),n(270)),k=n(858),x=function(e){function t(){return Object(l.a)(this,t),Object(d.a)(this,Object(m.a)(t).apply(this,arguments))}return Object(b.a)(t,e),Object(u.a)(t,[{key:"render",value:function(){var e=this.props.degrees.map(function(e,t){return{key:t,value:e.fdegree,text:"".concat(e.fdegree," - ").concat(e.fdescpn)}});return f.a.createElement(E.a.Field,null,f.a.createElement("label",null,"Degree"),f.a.createElement(C.a,{fluid:!0,search:!0,selection:!0,name:"fdegree",value:this.props.frmdegree,onChange:this.props.changeDegree,placeholder:"Select Degree",options:e}))}}]),t}(p.Component),D=n(1101),A=function(e){function t(){return Object(l.a)(this,t),Object(d.a)(this,Object(m.a)(t).apply(this,arguments))}return Object(b.a)(t,e),Object(u.a)(t,[{key:"render",value:function(){var e=this,t=this.props.opt_subjects,n=this.props.combsubs,a=t.map(function(e,t){return{key:t,value:e.fsubcode,text:"".concat(e.fsubcode," - ").concat(e.fsubname)}}),c=[];return n.map(function(t,n){c.push(f.a.createElement(D.a.Row,{key:n},f.a.createElement(D.a.Cell,{textAlign:"center"},n+1),f.a.createElement(D.a.Cell,{textAlign:"center",singleLine:!0},f.a.createElement(C.a,{fluid:!0,search:!0,selection:!0,id:n,name:"fsubcode",value:t.fsubcode,onChange:function(a,c){return e.props.changeSub(c,t,n)},placeholder:"Sub. Code",options:a})),f.a.createElement(D.a.Cell,{textAlign:"center"},f.a.createElement("div",{className:"ui checkbox"},f.a.createElement("input",{type:"checkbox",name:"fdeleted",value:t.fdeleted,onChange:function(a){return e.props.deleteRow(a,t,n)},checked:"true"==t.fdeleted?"checked":null}),f.a.createElement("label",null," ")))))}),f.a.createElement(D.a,{celled:!0},f.a.createElement(D.a.Header,null,f.a.createElement(D.a.Row,null,f.a.createElement(D.a.HeaderCell,{colSpan:"3"},f.a.createElement("div",{style:{display:"flex",width:"100%"}},"Combination Subjects",f.a.createElement("div",{className:"ml-auto"},f.a.createElement(g.a,{basic:!0,color:"blue",content:"Add",icon:"plus",onClick:this.props.addSub,size:"mini"}))))),f.a.createElement(D.a.Row,null,f.a.createElement(D.a.HeaderCell,{style:{width:"5%"},singleLine:!0,textAlign:"center"},"Sl. No."),f.a.createElement(D.a.HeaderCell,{textAlign:"center"},"Subject"),f.a.createElement(D.a.HeaderCell,{style:{width:"5%"},singleLine:!0,textAlign:"center"},"Del."))),f.a.createElement(D.a.Body,null,c))}}]),t}(p.Component),R=n(271),_=function(e){function t(){var e,n;Object(l.a)(this,t);for(var r=arguments.length,u=new Array(r),b=0;b<r;b++)u[b]=arguments[b];return(n=Object(d.a)(this,(e=Object(m.a)(t)).call.apply(e,[this].concat(u)))).state={frmSubmit:!1},n.changeDegree=function(){var e=Object(s.a)(o.a.mark(function e(t,a){var c;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.props.fetchComb(a.value);case 2:n.props.changeComb((c={},Object(i.a)(c,a.name,a.value),Object(i.a)(c,"fcombcode",""),Object(i.a)(c,"fcombdesc",""),c));case 3:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}(),n.changeComb=function(){var e=Object(s.a)(o.a.mark(function e(t,a){var c;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===(c=n.props.combination.combs.filter(function(e,t){return e.fcombcode==a.value.toUpperCase()})[0])?n.setState({comb:{fcombcode:a.value,fcombdesc:""}}):n.setState({comb:c}),n.props.changeComb(c),e.next=5,n.props.fetchCombSub(a.value);case 5:n.setState({frmSubmit:!0});case 6:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}(),n.handleAddition=function(){var e=Object(s.a)(o.a.mark(function e(t,a){var r,s;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=a.name,s=a.value,n.props.changeComb({combs:[].concat(Object(c.a)(n.props.combination.combs),[{fcombcode:s,fcombdesc:""}]),fcombcode:s,fcombdesc:""}),n.props.changeComb(Object(i.a)({},r,s));case 3:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}(),n.handleChange=function(e,t){n.props.changeComb(Object(i.a)({},t.name,t.value))},n.changeCombsub=function(e,t,c){var r=n.props.combination.combsubs.map(function(t,n){return c===n?Object(a.a)({},t,Object(i.a)({},e.name,e.value)):t});n.props.changeComb({combsubs:r})},n.deletesub=function(e,t,c){var r=n.props.combination.combsubs.map(function(t,n){return c===n?Object(a.a)({},t,Object(i.a)({},e.target.name,e.target.checked)):t});n.props.changeComb({combsubs:r})},n.addsubs=function(){var e=n.props.combination.combsubs;if(""!==e[e.length-1].fsubcode)n.props.addCombSub();else{n.props.showError({header:"Error",content:"Select the subject"})}},n.handleSave=Object(s.a)(o.a.mark(function e(){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.props.saveCombination();case 2:n.handleCancel();case 3:case"end":return e.stop()}},e)})),n.handleCancel=function(){n.props.cancelComb(),n.setState({frmSubmit:!1})},n.deleteComb=Object(s.a)(o.a.mark(function e(){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.props.deleteCombination();case 2:n.handleCancel();case 3:case"end":return e.stop()}},e)})),n.handleReport=function(){var e=n.props.combination.fdegree;if(""!==e)window.open(R.c+"degreeWiseCombinationList&univcode="+n.props.user.fcuruniv+"&fdegree="+e,"_blank");else{n.props.showError({header:"Error",content:"Select Degree."})}},n}return Object(b.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){this.props.fetchDegrees(this.props.user.fdeggrp)}},{key:"componentWillUnmount",value:function(){this.handleCancel()}},{key:"render",value:function(){var e=Object(S.i)(),t=this.props.combination,n=t.fdegree,a=t.combs,c=t.fcombcode,r=t.fcombdesc,o=t.combsubs,i=t.optsubs,s=a.map(function(e,t){return{key:t,value:e.fcombcode,text:e.fcombcode}});return f.a.createElement("div",{className:"animated fadeIn"},f.a.createElement(h.a,{fluid:!0},f.a.createElement(h.a.Content,null,f.a.createElement(h.a.Header,{style:{display:"flex"}},f.a.createElement("h4",null,"Combination"),f.a.createElement("div",{className:"ml-auto"},f.a.createElement(g.a,{basic:!0,color:"green",content:"Save",onClick:this.handleSave,icon:"save",disabled:!this.state.frmSubmit}),f.a.createElement(g.a,{basic:!0,color:"red",content:"Delete",icon:"trash",onClick:this.deleteComb,disabled:!this.state.frmSubmit}),f.a.createElement(g.a,{basic:!0,color:"blue",content:"Report",onClick:this.handleReport,icon:"file"}),f.a.createElement(g.a,{basic:!0,color:"black",icon:"ban",onClick:this.handleCancel,content:"Cancel"}),f.a.createElement(k.a,{to:"/dashboard"},f.a.createElement(g.a,{basic:!0,color:"red",content:"Exit",icon:"home"})))),f.a.createElement(v.a,null),f.a.createElement(h.a.Description,{style:{height:"".concat(e,"px"),overflowY:"auto"}},f.a.createElement(E.a,null,f.a.createElement(E.a.Group,{style:{margin:"0em 0em 0.51em"}},f.a.createElement(E.a.Field,{width:"12"},f.a.createElement(x,{frmdegree:n,degrees:this.props.degrees,changeDegree:this.changeDegree}))),f.a.createElement(E.a.Group,{style:{margin:"0em 0em 0.51em"}},f.a.createElement(E.a.Field,{width:4},f.a.createElement("label",null,"Comb. Code"),f.a.createElement(C.a,{size:"mini",fluid:!0,search:!0,selection:!0,value:c,name:"fcombcode",onChange:this.changeComb,allowAdditions:!0,onAddItem:this.handleAddition,placeholder:"Comb. Code",disabled:this.state.frmSubmit,openOnFocus:!1,options:s,selectOnBlur:!1})),f.a.createElement(E.a.Field,{width:8},f.a.createElement(E.a.Input,{placeholder:"Description",value:r,label:"Description",name:"fcombdesc",onChange:this.handleChange})))),this.state.frmSubmit?f.a.createElement("div",null,f.a.createElement(v.a,null),f.a.createElement(A,{opt_subjects:i,combsubs:o,changeSub:this.changeCombsub,deleteRow:this.deletesub,addSub:this.addsubs})):null))))}}]),t}(f.a.Component);t.default=Object(j.b)(function(e){return{combination:e.combination,deggrp:e.deggrp,degrees:e.degrees,user:e.user}},{fetchDegrees:O.k,fetchComb:function(e){return function(){var t=Object(s.a)(o.a.mark(function t(n,a){var c,r,i,s;return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return c=a(),t.next=3,w.a.get("/app.php",{params:{a:"getCombinations",deg:e,univcode:c.univ.funivcode}});case 3:"object"!==typeof(r=t.sent).data?(i={header:"Error",content:"Something went wrong"},n(Object(O.w)(i))):0===r.data.error_code?n({type:y.d,payload:r.data}):(s={header:"Error",content:r.data.data.msg},n(Object(O.w)(s)));case 5:case"end":return t.stop()}},t)}));return function(e,n){return t.apply(this,arguments)}}()},fetchCombSub:function(e){return function(){var t=Object(s.a)(o.a.mark(function t(n,a){var c,r,i,s;return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return c=a(),n({type:"SET_LOADER"}),t.next=4,w.a.get("/app.php",{params:{a:"getCombinationSubjects",deg:c.combination.fdegree,combcode:e,univcode:c.univ.funivcode}});case 4:r=t.sent,n({type:"UNSET_LOADER"}),"object"!==typeof r.data?(i={header:"Error",content:"Something went wrong"},n(Object(O.w)(i))):0===r.data.error_code?n({type:y.e,payload:r.data}):(s={header:"Error",content:r.data.data.msg},n(Object(O.w)(s)));case 7:case"end":return t.stop()}},t)}));return function(e,n){return t.apply(this,arguments)}}()},changeComb:function(e){return{type:y.c,payload:e}},addCombSub:function(){return{type:y.a}},showError:O.w,cancelComb:function(){return{type:y.b}},saveCombination:function(){return function(){var e=Object(s.a)(o.a.mark(function e(t,n){var a,c,r,i,s;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=n(),t({type:"SET_LOADER"}),e.next=4,w.a.post("/app.php?a=saveCombination&univcode="+a.univ.funivcode,{comb:{fdegree:a.combination.fdegree,fcombcode:a.combination.fcombcode,fcombdesc:a.combination.fcombdesc,combsubs:a.combination.combsubs}});case 4:c=e.sent,t({type:"UNSET_LOADER"}),"object"!==typeof c.data?(r={header:"Error",content:"Something went wrong"},t(Object(O.w)(r))):-1===c.data.error_code?(i={header:"Error",content:c.data.data.msg},t(Object(O.w)(i))):(s={header:"Success",content:c.data.data.msg},t(Object(O.w)(s)));case 7:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}()},deleteCombination:function(){return function(){var e=Object(s.a)(o.a.mark(function e(t,n){var a,c,r,i,s;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=n(),t({type:"SET_LOADER"}),e.next=4,w.a.post("/app.php?a=deleteCombination&univcode="+a.univ.funivcode,{comb:{fdegree:a.combination.fdegree,fcombcode:a.combination.fcombcode}});case 4:c=e.sent,t({type:"UNSET_LOADER"}),"object"!==typeof c.data?(r={header:"Error",content:"Something went wrong"},t(Object(O.w)(r))):-1===c.data.error_code?(i={header:"Error",content:c.data.data.msg},t(Object(O.w)(i))):(s={header:"Success",content:c.data.data.msg},t(Object(O.w)(s)));case 7:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}()}})(_)},272:function(e,t,n){"use strict";var a=n(268),c=n.n(a),r=n(265),o=n.n(r),i=n(1),s=n.n(i),l=n(333),u=n(551),d=n(549),m=n(267);function b(e){var t=e.children,n=e.className,a=e.clearing,r=e.content,i=e.fitted,p=e.hidden,f=e.horizontal,h=e.inverted,g=e.section,v=e.vertical,E=o()("ui",Object(l.a)(a,"clearing"),Object(l.a)(i,"fitted"),Object(l.a)(p,"hidden"),Object(l.a)(f,"horizontal"),Object(l.a)(h,"inverted"),Object(l.a)(g,"section"),Object(l.a)(v,"vertical"),"divider",n),C=Object(u.a)(b,e),j=Object(d.a)(b,e);return s.a.createElement(j,c()({},C,{className:E}),m.a.isNil(t)?r:t)}b.handledProps=["as","children","className","clearing","content","fitted","hidden","horizontal","inverted","section","vertical"],b.propTypes={},t.a=b},463:function(e,t){}}]);
//# sourceMappingURL=136.b475a93c.chunk.js.map
|