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