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