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.36e...

1 line
12 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[112],{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"),d=n("9kvl"),m=n("CpkQ"),g=n.n(m),v=n("wyMu"),y=n.n(v);n("YQfW");function x(){x=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(N){l=function(t,e,n){return t[e]=n}}function u(t,e,n,a){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),c=new j(a||[]);return r(i,"_invoke",{value:w(t,n,c)}),i}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(N){return{type:"throw",arg:N}}}t.wrap=u;var p={};function f(){}function h(){}function d(){}var m={};l(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==e&&n.call(v,o)&&(m=v);var y=d.prototype=f.prototype=Object.create(m);function b(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function a(r,o,i,c){var l=s(t[r],t,o);if("throw"!==l.type){var u=l.arg,p=u.value;return p&&"object"==typeof p&&n.call(p,"__await")?e.resolve(p.__await).then((function(t){a("next",t,i,c)}),(function(t){a("throw",t,i,c)})):e.resolve(p).then((function(t){u.value=t,i(u)}),(function(t){return a("throw",t,i,c)}))}c(l.arg)}var o;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){a(t,n,e,r)}))}return o=o?o.then(r,r):r()}})}function w(t,e,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return k()}for(n.method=a,n.arg=o;;){var i=n.delegate;if(i){var c=E(i,n);if(c){if(c===p)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===p)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function E(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var a=s(r,t.iterator,e.arg);if("throw"===a.type)return e.method="throw",e.arg=a.arg,e.delegate=null,p;var o=a.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function L(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 O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,a=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=d,r(y,"constructor",{value:d,configurable:!0}),r(d,"constructor",{value:h,configurable:!0}),h.displayName=l(d,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,l(t,c,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},b(_.prototype),l(_.prototype,i,(function(){return this})),t.AsyncIterator=_,t.async=function(e,n,r,a,o){void 0===o&&(o=Promise);var i=new _(u(e,n,r,a),o);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),t.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}},t.values=S,j.prototype={constructor:j,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(O),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return i.type="throw",i.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.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,p):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),p},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),O(n),p}},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;O(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},t}var b=function(t){t.globalSetting,t.loading;var e=t.dispatch,n=(Object(u["a"])(t,["globalSetting","loading","dispatch"]),Object(s["useState"])()),d=Object(l["a"])(n,2),m=d[0],v=d[1],b=Object(s["useState"])(),_=Object(l["a"])(b,2),w=_[0],E=_[1],L=Object(s["useState"])(),O=Object(l["a"])(L,2),j=O[0],S=O[1],k=Object(s["useState"])(""),N=Object(l["a"])(k,2),T=N[0],C=(N[1],Object(s["useRef"])(null)),G=Object(s["useState"])(""),P=Object(l["a"])(G,2),F=P[0],I=P[1],U=Object(f["m"])(),D=U.identifier,A=U.Teannameid,R=Object(f["k"])();function Y(){S(C.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(w){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:w,image:F?C.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"),R.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);I("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=v,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&&E(n.data.name);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)},m&&m.name,m&&m.sub_title?m.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:g.a.Selecttext},"\u7f16\u8f91\u6218\u961f"),p.a.createElement("div",{className:g.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:w,maxLength:60,addonAfter:String(w&&w.length)+"/60",onChange:function(t){return E(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"}},j?p.a.createElement("img",{className:g.a.Spanradius,src:j}):T?p.a.createElement("img",{className:g.a.Spanradius}):p.a.createElement("div",{className:g.a.Spanradius},w&&w.length>2?w&&w.substring(0,2):w),p.a.createElement(y.a,{style:{width:"320px",height:"320px",marginLeft:"30px",background:"#EEEEEE"},src:F,guides:!1,ref:C,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(d["a"])((function(t){var e=t.loading,n=t.globalSetting;return{globalSetting:n,loading:e.models.competitions}}))(b)}}]);