You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Competitions__Exports__....

2 lines
9.9 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[120],{Ohmc:function(F,K,u){F.exports=u.p+"static/certificate.fc32dc1b.jpg"},psBA:function(F,K,u){F.exports={wrp:"wrp___3usIQ",underline:"underline___2KCdI",win:"win___1riZg",desc:"desc___3KjjH"}},tYMO:function(F,K,u){"use strict";u.r(K);var lt=u("+L6B"),X=u("2/Rp"),Q=u("k1fw"),$=u("9og8"),z=u("tJVT"),q=u("PpiC"),M=u("q1tI"),l=u.n(M),tt=u("9kvl"),et=u("1n7x"),rt=u.n(et),nt=u("1vsH"),at=u("xKgJ"),ot=u("hJwl"),it=u("psBA"),j=u.n(it);function C(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */C=function(){return _};var f,_={},I=Object.prototype,P=I.hasOwnProperty,D=Object.defineProperty||function(r,t,e){r[t]=e.value},T=typeof Symbol=="function"?Symbol:{},O=T.iterator||"@@iterator",k=T.asyncIterator||"@@asyncIterator",b=T.toStringTag||"@@toStringTag";function h(r,t,e){return Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{h({},"")}catch(r){h=function(e,n,o){return e[n]=o}}function A(r,t,e,n){var o=t&&t.prototype instanceof L?t:L,a=Object.create(o.prototype),c=new Y(n||[]);return D(a,"_invoke",{value:ut(r,e,c)}),a}function i(r,t,e){try{return{type:"normal",arg:r.call(t,e)}}catch(n){return{type:"throw",arg:n}}}_.wrap=A;var N="suspendedStart",W="suspendedYield",G="executing",x="completed",y={};function L(){}function E(){}function s(){}var g={};h(g,O,function(){return this});var v=Object.getPrototypeOf,B=v&&v(v(H([])));B&&B!==I&&P.call(B,O)&&(g=B);var m=s.prototype=L.prototype=Object.create(g);function V(r){["next","throw","return"].forEach(function(t){h(r,t,function(e){return this._invoke(t,e)})})}function S(r,t){function e(o,a,c,d){var p=i(r[o],r,a);if(p.type!=="throw"){var U=p.arg,w=U.value;return w&&typeof w=="object"&&P.call(w,"__await")?t.resolve(w.__await).then(function(R){e("next",R,c,d)},function(R){e("throw",R,c,d)}):t.resolve(w).then(function(R){U.value=R,c(U)},function(R){return e("throw",R,c,d)})}d(p.arg)}var n;D(this,"_invoke",{value:function(a,c){function d(){return new t(function(p,U){e(a,c,p,U)})}return n=n?n.then(d,d):d()}})}function ut(r,t,e){var n=N;return function(o,a){if(n===G)throw new Error("Generator is already running");if(n===x){if(o==="throw")throw a;return{value:f,done:!0}}for(e.method=o,e.arg=a;;){var c=e.delegate;if(c){var d=Z(c,e);if(d){if(d===y)continue;return d}}if(e.method==="next")e.sent=e._sent=e.arg;else if(e.method==="throw"){if(n===N)throw n=x,e.arg;e.dispatchException(e.arg)}else e.method==="return"&&e.abrupt("return",e.arg);n=G;var p=i(r,t,e);if(p.type==="normal"){if(n=e.done?x:W,p.arg===y)continue;return{value:p.arg,done:e.done}}p.type==="throw"&&(n=x,e.method="throw",e.arg=p.arg)}}}function Z(r,t){var e=t.method,n=r.iterator[e];if(n===f)return t.delegate=null,e==="throw"&&r.iterator.return&&(t.method="return",t.arg=f,Z(r,t),t.method==="throw")||e!=="return"&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+e+"' method")),y;var o=i(n,r.iterator,t.arg);if(o.type==="throw")return t.method="throw",t.arg=o.arg,t.delegate=null,y;var a=o.arg;return a?a.done?(t[r.resultName]=a.value,t.next=r.nextLoc,t.method!=="return"&&(t.method="next",t.arg=f),t.delegate=null,y):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,y)}function ct(r){var t={tryLoc:r[0]};1 in r&&(t.catchLoc=r[1]),2 in r&&(t.finallyLoc=r[2],t.afterLoc=r[3]),this.tryEntries.push(t)}function J(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function Y(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(ct,this),this.reset(!0)}function H(r){if(r||r===""){var t=r[O];if(t)return t.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var e=-1,n=function o(){for(;++e<r.length;)if(P.call(r,e))return o.value=r[e],o.done=!1,o;return o.value=f,o.done=!0,o};return n.next=n}}throw new TypeError(typeof r+" is not iterable")}return E.prototype=s,D(m,"constructor",{value:s,configurable:!0}),D(s,"constructor",{value:E,configurable:!0}),E.displayName=h(s,b,"GeneratorFunction"),_.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return!!t&&(t===E||(t.displayName||t.name)==="GeneratorFunction")},_.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,s):(r.__proto__=s,h(r,b,"GeneratorFunction")),r.prototype=Object.create(m),r},_.awrap=function(r){return{__await:r}},V(S.prototype),h(S.prototype,k,function(){return this}),_.AsyncIterator=S,_.async=function(r,t,e,n,o){o===void 0&&(o=Promise);var a=new S(A(r,t,e,n),o);return _.isGeneratorFunction(t)?a:a.next().then(function(c){return c.done?c.value:a.next()})},V(m),h(m,b,"Generator"),h(m,O,function(){return this}),h(m,"toString",function(){return"[object Generator]"}),_.keys=function(r){var t=Object(r),e=[];for(var n in t)e.push(n);return e.reverse(),function o(){for(;e.length;){var a=e.pop();if(a in t)return o.value=a,o.done=!1,o}return o.done=!0,o}},_.values=H,Y.prototype={constructor:Y,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=f,this.done=!1,this.delegate=null,this.method="next",this.arg=f,this.tryEntries.forEach(J),!t)for(var e in this)e.charAt(0)==="t"&&P.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=f)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(U,w){return c.type="throw",c.arg=t,e.next=U,w&&(e.method="next",e.arg=f),!!w}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if(a.tryLoc==="root")return n("end");if(a.tryLoc<=this.prev){var d=P.call(a,"catchLoc"),p=P.call(a,"finallyLoc");if(d&&p){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(d){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!p)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&P.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&(t==="break"||t==="continue")&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var c=a?a.completion:{};return c.type=t,c.arg=e,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(c)},complete:function(t,e){if(t.type==="throw")throw t.arg;return t.type==="break"||t.type==="continue"?this.next=t.arg:t.type==="return"?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):t.type==="normal"&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),J(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var o=n.completion;if(o.type==="throw"){var a=o.arg;J(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:H(t),resultName:e,nextLoc:n},this.method==="next"&&(this.arg=f),y}},_}var st=function(_){var I=_.classroomList,P=_.dispatch,D=Object(q.a)(_,["classroomList","dispatch"]),T=Object(M.useState)(!1),O=Object(z.a)(T,2),k=O[0],b=O[1],h=Object(M.useState)(D.location.query),A=Object(z.a)(h,2),i=A[0],N=A[1],W=Object(M.useRef)(),G=[{name:"\u6700\u65B0",id:"created_at"},{name:"\u6700\u70ED",id:"visits"}];Object(M.useEffect)(function(){b(!0),Object(at.o)()&&!i.id&&b(!0),i.id&&x()},[]);var x=function(){var L=Object($.a)(C().mark(function E(){var s;return C().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,Object(ot.u)(Object(Q.a)({},i));case 2:s=v.sent,(s==null?void 0:s.status)===0&&(b(!0),i.school_name=s.data.school_name,i.user_name=s.data.username,i.student_id=s.data.student_id,i.win_type=s.data.competition_name,i.win=s.data.award_name,i.group=s.data.competition,i.suffix=s.data.identity,N(Object(Q.a)({},i)));case 4:case"end":return v.stop()}},E)}));return function(){return L.apply(this,arguments)}}(),y=function(){var L=Object($.a)(C().mark(function E(){var s,g,v;return C().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return s={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}},g=rt()().set(s).from(W.current).toPdf(),m.next=4,g.get("pdf");case 4:return g=m.sent,m.next=7,g.output("bloburl");case 7:v=m.sent,Object(nt.s)("".concat(i.school_name,"_").concat(i.user_name,"_").concat(i.win,"_").concat(i.group,".pdf"),v);case 9:case"end":return m.stop()}},E)}));return function(){return L.apply(this,arguments)}}();return l.a.createElement("section",null,k&&l.a.createElement(l.a.Fragment,null,l.a.createElement("aside",{className:"tc mt10 mb30"},l.a.createElement(X.a,{size:"large",type:"primary",onClick:y},"\u5BFC\u51FA\u5956\u72B6")),l.a.createElement("aside",{className:"edu-container relative",style:{height:880,width:1e3}},l.a.createElement("aside",{ref:W,id:"reportElement",style:{width:1e3,position:"relative"}},l.a.createElement("aside",{className:j.a.wrp},l.a.createElement("aside",{className:"ml50"},l.a.createElement("div",null,l.a.createElement("span",{className:j.a.underline},i.school_name||"\u56FD\u9632\u79D1\u6280\u5927\u5B66"),l.a.createElement("span",{className:"ml20 mr20 ".concat(j.a.underline)},i.user_name||""),i.suffix,i.student_id&&i.type==2&&l.a.createElement("span",null,"\uFF0C\u5B66\u53F7",l.a.createElement("span",{className:"".concat(j.a.underline," ml20")},i.student_id))),l.a.createElement("div",{className:"mt10"},"\u8363\u83B7\uFF1A\u201C",i.win_type||"","\u201D\uFF08",i.group||"\u4EE3\u7801\u6807\u6CE8\u7EC4","\uFF09"),l.a.createElement("div",{className:j.a.win},i.win||"\u4E00\u7B49\u5956"),l.a.createElement("div",{className:j.a.desc},"\u7279\u53D1\u6B64\u8BC1\uFF0C\u4EE5\u8D44\u9F13\u52B1\u3002"))),l.a.createElement("img",{src:u("Ohmc"),style:{width:"100%"}})))))};K.default=Object(tt.a)(function(f){var _=f.classroomList,I=f.user;return{classroomList:_,user:I}})(st)}}]);