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__Update.a7a...

1 line
12 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[122],{CpkQ:function(t,e,n){t.exports={flex_box_center:"flex_box_center___1TLor",flex_space_between:"flex_space_between___2oHSZ",flex_box_vertical_center:"flex_box_vertical_center___1GsMX",flex_box_center_end:"flex_box_center_end___dUr0S",flex_box_column:"flex_box_column___15YZP",Selecttext:"Selecttext___1ucPb",Updatecount:"Updatecount___t5g1H",Spanradius:"Spanradius___F7XLb"}},jmm4:function(t,e,n){"use strict";n.r(e);n("+L6B");var r=n("2/Rp"),a=(n("5NDa"),n("5rEg")),o=(n("sPJy"),n("bE4q")),i=(n("miYZ"),n("tsqr")),c=n("9og8"),l=n("tJVT"),u=n("PpiC"),s=n("q1tI"),p=n.n(s),f=n("Ty5D"),h=n("55Ip"),m=n("9kvl"),d=n("CpkQ"),y=n.n(d),g=n("wyMu"),v=n.n(g),b=(n("YQfW"),n("m3rI"));function x(){x=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var o=e&&e.prototype instanceof g?e:g,i=Object.create(o.prototype),c=new G(r||[]);return a(i,"_invoke",{value:S(t,n,c)}),i}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var f="suspendedStart",h="suspendedYield",m="executing",d="completed",y={};function g(){}function v(){}function b(){}var _={};u(_,i,(function(){return this}));var w=Object.getPrototypeOf,E=w&&w(w(I([])));E&&E!==n&&r.call(E,i)&&(_=E);var L=b.prototype=g.prototype=Object.create(_);function O(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function n(a,o,i,c){var l=p(t[a],t,o);if("throw"!==l.type){var u=l.arg,s=u.value;return s&&"object"==typeof s&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,i,c)}),(function(t){n("throw",t,i,c)})):e.resolve(s).then((function(t){u.value=t,i(u)}),(function(t){return n("throw",t,i,c)}))}c(l.arg)}var o;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function S(e,n,r){var a=f;return function(o,i){if(a===m)throw new Error("Generator is already running");if(a===d){if("throw"===o)throw i;return{value:t,done:!0}}for(r.method=o,r.arg=i;;){var c=r.delegate;if(c){var l=k(c,r);if(l){if(l===y)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===f)throw a=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=m;var u=p(e,n,r);if("normal"===u.type){if(a=r.done?d:h,u.arg===y)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(a=d,r.method="throw",r.arg=u.arg)}}}function k(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,k(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var o=p(a,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,y;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function T(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 N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(e){if(e||""===e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(typeof e+" is not iterable")}return v.prototype=b,a(L,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:v,configurable:!0}),v.displayName=u(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,l,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},O(j.prototype),u(j.prototype,c,(function(){return this})),e.AsyncIterator=j,e.async=function(t,n,r,a,o){void 0===o&&(o=Promise);var i=new j(s(t,n,r,a),o);return e.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},O(L),u(L,l,"Generator"),u(L,i,(function(){return this})),u(L,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=I,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(N),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=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 n=this;function a(r,a){return c.type="throw",c.arg=e,n.next=r,a&&(n.method="next",n.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 l=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(l&&u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(l){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 n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.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 n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),N(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 r=n.completion;if("throw"===r.type){var a=r.arg;N(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}var _=function(t){t.globalSetting,t.loading;var e=t.dispatch,n=(Object(u["a"])(t,["globalSetting","loading","dispatch"]),Object(s["useState"])()),m=Object(l["a"])(n,2),d=m[0],g=m[1],_=Object(s["useState"])(),w=Object(l["a"])(_,2),E=w[0],L=w[1],O=Object(s["useState"])(),j=Object(l["a"])(O,2),S=j[0],k=j[1],T=Object(s["useState"])(""),N=Object(l["a"])(T,2),G=N[0],I=(N[1],Object(s["useRef"])(null)),C=Object(s["useState"])(""),P=Object(l["a"])(C,2),F=P[0],R=P[1],U=Object(f["m"])(),D=U.identifier,A=U.Teannameid,M=Object(f["k"])();function Y(){k(I.current.getCroppedCanvas().toDataURL())}function B(){return H.apply(this,arguments)}function H(){return H=Object(c["a"])(x().mark((function t(){var n;return x().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(E){t.next=3;break}return i["b"].info("\u961f\u4f0d\u540d\u4e0d\u80fd\u4e3a\u7a7a"),t.abrupt("return");case 3:return t.next=5,e({type:"competitions/UpTeam",payload:{identifier:D,Teannameid:A,name:E,image:F?I.current.getCroppedCanvas().toDataURL("image/jpeg"):void 0}});case 5:n=t.sent,0===(null===n||void 0===n?void 0:n.status)&&(i["b"].info("\u4fee\u6539\u6210\u529f"),M.push("/competitions/index/".concat(D,"/enroll")));case 7:case"end":return t.stop()}}),t)}))),H.apply(this,arguments)}function J(t){var e=t.target.files[0];if(e&&e.size>2097152)i["b"].info("\u4ec5\u652f\u6301\u6587\u4ef6\u5927\u5c0f\u5c0f\u4e8e2M\u7684\u6587\u4ef6");else{var n=new FileReader;n.readAsBinaryString(e),n.onload=function(){var t=btoa(n.result);R("data:".concat(e.type,";base64,").concat(t))},n.onerror=function(){}}}return Object(s["useEffect"])((function(){function t(){return n.apply(this,arguments)}function n(){return n=Object(c["a"])(x().mark((function t(){var n;return x().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.t0=g,t.next=3,e({type:"competitions/getHeader",payload:{identifier:D}});case 3:return t.t1=t.sent,(0,t.t0)(t.t1),t.next=7,e({type:"competitions/getTeamDetail",payload:{identifier:D,Teannameid:A}});case 7:n=t.sent,n&&(L(n.data.name),R("".concat(b["a"].IMG_SERVER,"/").concat(n.data.team_log)));case 9:case"end":return t.stop()}}),t)}))),n.apply(this,arguments)}D&&t()}),[D]),p.a.createElement("div",{className:"edu-container minH500"},p.a.createElement(o["a"],{className:"mt10",separator:">"},p.a.createElement(o["a"].Item,null,p.a.createElement(h["Link"],{to:"/competitions/index"},"\u5728\u7ebf\u7ade\u8d5b")),p.a.createElement(o["a"].Item,null,p.a.createElement(h["Link"],{to:"/competitions/index/".concat(D)},d&&d.name,d&&d.sub_title?d.sub_title:null)),p.a.createElement(o["a"].Item,null,p.a.createElement(h["Link"],{to:"/competitions/index/".concat(D,"/enroll")},"\u62a5\u540d")),p.a.createElement(o["a"].Item,null,"\u7f16\u8f91\u6218\u961f\u4fe1\u606f")),p.a.createElement("div",{className:y.a.Selecttext},"\u7f16\u8f91\u6218\u961f"),p.a.createElement("div",{className:y.a.Updatecount},p.a.createElement("span",{style:{fontSize:"14px",color:"#F73737"}},"*"),"\u961f\u540d\uff1a",p.a.createElement("p",{style:{marginTop:"15px",marginLeft:"8px",width:"544px"}},p.a.createElement(a["a"],{placeholder:"\u8bf7\u8f93\u5165\u961f\u540d",value:E,maxLength:60,addonAfter:String(E&&E.length)+"/60",onChange:function(t){return L(t.target.value)}})),p.a.createElement("p",{style:{marginTop:"15px",marginLeft:"8px",width:"544px"}},p.a.createElement("span",null,"LOGO\uff1a"),p.a.createElement("label",{id:"uploadBtn",style:{color:"#4DACFF",cursor:"pointer"}},p.a.createElement("input",{type:"file",className:"sr-only",id:"inputImage",name:"file",accept:"image/*",onChange:J,style:{display:"none"}}),"\u4e0a\u4f20LOGO"),"\xa0",p.a.createElement("span",null,"(\u652f\u6301jpg\u3001gif\u3001png\u683c\u5f0f\u7684\u56fe\u7247\uff0c\u5efa\u8bae\u6587\u4ef6\u5c0f\u4e8e2M)")),p.a.createElement("div",{style:{marginTop:"15px",marginLeft:"8px",display:"flex"}},S?p.a.createElement("img",{className:y.a.Spanradius,src:S}):G?p.a.createElement("img",{className:y.a.Spanradius}):p.a.createElement("div",{className:y.a.Spanradius},E&&E.length>2?E&&E.substring(0,2):E),p.a.createElement(v.a,{style:{width:"320px",height:"320px",marginLeft:"30px",background:"#EEEEEE"},src:F,guides:!1,ref:I,crop:Y}))),p.a.createElement("div",{style:{marginTop:"15px",marginBottom:"15px"}},p.a.createElement(r["a"],{type:"primary",onClick:function(){return B()}},"\u786e\u5b9a"),p.a.createElement(r["a"],{style:{marginLeft:"15px"}},p.a.createElement(h["Link"],{to:"/competitions/index/".concat(D,"/enroll")},"\u53d6\u6d88"))))};e["default"]=Object(m["a"])((function(t){var e=t.loading,n=t.globalSetting;return{globalSetting:n,loading:e.models.competitions}}))(_)}}]);