(window.webpackJsonp=window.webpackJsonp||[]).push([[122],{Ohmc:function(i,d,t){i.exports=t.p+"static/certificate.fc32dc1b.jpg"},psBA:function(i,d,t){i.exports={wrp:"wrp___3usIQ",underline:"underline___2KCdI",win:"win___1riZg",desc:"desc___3KjjH"}},tYMO:function(i,d,t){"use strict";t.r(d);var z=t("+L6B"),R=t("2/Rp"),g=t("WmNS"),c=t.n(g),P=t("k1fw"),h=t("9og8"),O=t("tJVT"),b=t("PpiC"),o=t("q1tI"),_=t.n(o),M=t("9kvl"),j=t("1n7x"),C=t.n(j),B=t("1vsH"),L=t("xKgJ"),A=t("hJwl"),w=t("psBA"),n=t.n(w),T=function(l){var U=l.classroomList,J=l.dispatch,I=Object(b.a)(l,["classroomList","dispatch"]),K=Object(o.useState)(!1),y=Object(O.a)(K,2),W=y[0],E=y[1],F=Object(o.useState)(I.location.query),v=Object(O.a)(F,2),e=v[0],x=v[1],D=Object(o.useRef)(),H=[{name:"\u6700\u65B0",id:"created_at"},{name:"\u6700\u70ED",id:"visits"}];Object(o.useEffect)(function(){E(!0),Object(L.p)()&&!e.id&&E(!0),e.id&&N()},[]);var N=function(){var f=Object(h.a)(c.a.mark(function m(){var a;return c.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Object(A.u)(Object(P.a)({},e));case 2:a=r.sent,(a==null?void 0:a.status)===0&&(E(!0),e.school_name=a.data.school_name,e.user_name=a.data.username,e.student_id=a.data.student_id,e.win_type=a.data.competition_name,e.win=a.data.award_name,e.group=a.data.competition,e.suffix=a.data.identity,x(Object(P.a)({},e)));case 4:case"end":return r.stop()}},m)}));return function(){return f.apply(this,arguments)}}(),S=function(){var f=Object(h.a)(c.a.mark(function m(){var a,u,r;return c.a.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return a={margin:[20,0,0,0],filename:"11.pdf",enableLinks:!1,html2canvas:{scale:5,allowTaint:!1,useCORS:!0},jsPDF:{format:[1360,1010],orientation:"landscape",unit:"px"},image:{type:"jpeg",quality:.98}},u=C()().set(a).from(D.current).toPdf(),s.next=4,u.get("pdf");case 4:return u=s.sent,s.next=7,u.output("bloburl");case 7:r=s.sent,Object(B.o)("".concat(e.school_name,"_").concat(e.user_name,"_").concat(e.win,"_").concat(e.group,".pdf"),r);case 9:case"end":return s.stop()}},m)}));return function(){return f.apply(this,arguments)}}();return _.a.createElement("section",null,W&&_.a.createElement(_.a.Fragment,null,_.a.createElement("aside",{className:"tc mt10 mb30"},_.a.createElement(R.a,{size:"large",type:"primary",onClick:S},"\u5BFC\u51FA\u5956\u72B6")),_.a.createElement("aside",{className:"edu-container relative",style:{height:880,width:1e3}},_.a.createElement("aside",{ref:D,id:"reportElement",style:{width:1e3,position:"relative"}},_.a.createElement("aside",{className:n.a.wrp},_.a.createElement("aside",{className:"ml50"},_.a.createElement("div",null,_.a.createElement("span",{className:n.a.underline},e.school_name||"\u56FD\u9632\u79D1\u6280\u5927\u5B66"),_.a.createElement("span",{className:"ml20 mr20 ".concat(n.a.underline)},e.user_name||""),e.suffix,e.student_id&&e.type==2&&_.a.createElement("span",null,"\uFF0C\u5B66\u53F7",_.a.createElement("span",{className:"".concat(n.a.underline," ml20")},e.student_id))),_.a.createElement("div",{className:"mt10"},"\u8363\u83B7\uFF1A\u201C",e.win_type||"","\u201D\uFF08",e.group||"\u4EE3\u7801\u6807\u6CE8\u7EC4","\uFF09"),_.a.createElement("div",{className:n.a.win},e.win||"\u4E00\u7B49\u5956"),_.a.createElement("div",{className:n.a.desc},"\u7279\u53D1\u6B64\u8BC1\uFF0C\u4EE5\u8D44\u9F13\u52B1\u3002"))),_.a.createElement("img",{src:t("Ohmc"),style:{width:"100%"}})))))};d.default=Object(M.a)(function(p){var l=p.classroomList,U=p.user;return{classroomList:l,user:U}})(T)}}]);
