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__....

1 line
9.8 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[120],{Ohmc:function(t,e,r){t.exports=r.p+"static/certificate.fc32dc1b.jpg"},psBA:function(t,e,r){t.exports={wrp:"wrp___3usIQ",underline:"underline___2KCdI",win:"win___1riZg",desc:"desc___3KjjH"}},tYMO:function(t,e,r){"use strict";r.r(e);r("+L6B");var n=r("2/Rp"),a=r("k1fw"),o=r("9og8"),i=r("tJVT"),c=r("PpiC"),s=r("q1tI"),u=r.n(s),l=r("9kvl"),f=r("1n7x"),h=r.n(f),p=r("1vsH"),d=r("xKgJ"),m=r("hJwl"),y=r("psBA"),v=r.n(y);function g(){g=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,i=Object.create(o.prototype),c=new G(n||[]);return a(i,"_invoke",{value:N(t,r,c)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",m="completed",y={};function v(){}function w(){}function b(){}var _={};u(_,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(T([])));x&&x!==r&&n.call(x,i)&&(_=x);var L=b.prototype=v.prototype=Object.create(_);function j(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(a,o,i,c){var s=f(t[a],t,o);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(l).then((function(t){u.value=t,i(u)}),(function(t){return r("throw",t,i,c)}))}c(s.arg)}var o;a(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,a){r(t,n,e,a)}))}return o=o?o.then(a,a):a()}})}function N(e,r,n){var a=h;return function(o,i){if(a===d)throw new Error("Generator is already running");if(a===m){if("throw"===o)throw i;return{value:t,done:!0}}for(n.method=o,n.arg=i;;){var c=n.delegate;if(c){var s=k(c,n);if(s){if(s===y)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=d;var u=f(e,r,n);if("normal"===u.type){if(a=n.done?m:p,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(a=m,n.method="throw",n.arg=u.arg)}}}function k(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var o=f(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(typeof e+" is not iterable")}return w.prototype=b,a(L,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:w,configurable:!0}),w.displayName=u(b,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,s,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},j(O.prototype),u(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new O(l(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},j(L),u(L,s,"Generator"),u(L,i,(function(){return this})),u(L,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,G.prototype={constructor:G,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(S),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return c.type="throw",c.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;S(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}var w=function(t){t.classroomList,t.dispatch;var e=Object(c["a"])(t,["classroomList","dispatch"]),l=Object(s["useState"])(!1),f=Object(i["a"])(l,2),y=f[0],w=f[1],b=Object(s["useState"])(e.location.query),_=Object(i["a"])(b,2),E=_[0],x=_[1],L=Object(s["useRef"])();Object(s["useEffect"])((function(){w(!0),Object(d["o"])()&&!E.id&&w(!0),E.id&&j()}),[]);var j=function(){var t=Object(o["a"])(g().mark((function t(){var e;return g().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(m["u"])(Object(a["a"])({},E));case 2:e=t.sent,0===(null===e||void 0===e?void 0:e.status)&&(w(!0),E.school_name=e.data.school_name,E.user_name=e.data.username,E.student_id=e.data.student_id,E.win_type=e.data.competition_name,E.win=e.data.award_name,E.group=e.data.competition,E.suffix=e.data.identity,x(Object(a["a"])({},E)));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),O=function(){var t=Object(o["a"])(g().mark((function t(){var e,r,n;return g().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e={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}},r=h()().set(e).from(L.current).toPdf(),t.next=4,r.get("pdf");case 4:return r=t.sent,t.next=7,r.output("bloburl");case 7:n=t.sent,Object(p["s"])("".concat(E.school_name,"_").concat(E.user_name,"_").concat(E.win,"_").concat(E.group,".pdf"),n);case 9:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return u.a.createElement("section",null,y&&u.a.createElement(u.a.Fragment,null,u.a.createElement("aside",{className:"tc mt10 mb30"},u.a.createElement(n["a"],{size:"large",type:"primary",onClick:O},"\u5bfc\u51fa\u5956\u72b6")),u.a.createElement("aside",{className:"edu-container relative",style:{height:880,width:1e3}},u.a.createElement("aside",{ref:L,id:"reportElement",style:{width:1e3,position:"relative"}},u.a.createElement("aside",{className:v.a.wrp},u.a.createElement("aside",{className:"ml50"},u.a.createElement("div",null,u.a.createElement("span",{className:v.a.underline},E.school_name||"\u56fd\u9632\u79d1\u6280\u5927\u5b66"),u.a.createElement("span",{className:"ml20 mr20 ".concat(v.a.underline)},E.user_name||""),E.suffix,E.student_id&&2==E.type&&u.a.createElement("span",null,"\uff0c\u5b66\u53f7",u.a.createElement("span",{className:"".concat(v.a.underline," ml20")},E.student_id))),u.a.createElement("div",{className:"mt10"},"\u8363\u83b7\uff1a\u201c",E.win_type||"","\u201d\uff08",E.group||"\u4ee3\u7801\u6807\u6ce8\u7ec4","\uff09"),u.a.createElement("div",{className:v.a.win},E.win||"\u4e00\u7b49\u5956"),u.a.createElement("div",{className:v.a.desc},"\u7279\u53d1\u6b64\u8bc1\uff0c\u4ee5\u8d44\u9f13\u52b1\u3002"))),u.a.createElement("img",{src:r("Ohmc"),style:{width:"100%"}})))))};e["default"]=Object(l["a"])((function(t){var e=t.classroomList,r=t.user;return{classroomList:e,user:r}}))(w)}}]);