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

2 lines
4.9 KiB

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[5650],{78560:function(k,b,a){a.r(b),a.d(b,{default:function(){return j}});var e=a(59301),p=a(63144),g={flex_box_center:"flex_box_center___DHrsr",flex_space_between:"flex_space_between___VeuX0",flex_box_vertical_center:"flex_box_vertical_center___gw9oR",flex_box_center_end:"flex_box_center_end___DyeB2",flex_box_column:"flex_box_column___b77m0",Selecttext:"Selecttext___F1tf1",Updatecount:"Updatecount___VMhwg",Spanradius:"Spanradius___FVSCg"},Z=a(33555),J=a(46911),h=a(8591),v=a(66104),B=a(98135),_=a(3113),I=a(46961),N=a(15826),D=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,U=Object.prototype.propertyIsEnumerable,$=(n,r)=>{var o={};for(var l in n)R.call(n,l)&&r.indexOf(l)<0&&(o[l]=n[l]);if(n!=null&&D)for(var l of D(n))r.indexOf(l)<0&&U.call(n,l)&&(o[l]=n[l]);return o},S=(n,r,o)=>new Promise((l,f)=>{var C=t=>{try{F(o.next(t))}catch(E){f(E)}},c=t=>{try{F(o.throw(t))}catch(E){f(E)}},F=t=>t.done?l(t.value):Promise.resolve(t.value).then(C,c);F((o=o.apply(n,r)).next())});const T=n=>{var r=n,{globalSetting:o,loading:l,dispatch:f}=r,C=$(r,["globalSetting","loading","dispatch"]);const[c,F]=(0,e.useState)(),[t,E]=(0,e.useState)(),[A,w]=(0,e.useState)(),[H,K]=(0,e.useState)(""),x=(0,e.useRef)(null),[M,L]=(0,e.useState)(""),{identifier:s,Teannameid:O}=(0,p.useParams)(),[Q,V]=(0,e.useState)("");(0,e.useEffect)(()=>{function m(){return S(this,null,function*(){var u,i,y,P;F(yield f({type:"competitions/getHeader",payload:{identifier:s}}));let d=yield f({type:"competitions/getTeamDetail",payload:{identifier:s,Teannameid:O}});d&&(E((u=d==null?void 0:d.data)==null?void 0:u.name),L(`${(i=I.Z)==null?void 0:i.IMG_SERVER}/${(y=d==null?void 0:d.data)==null?void 0:y.team_log}`),V((P=d==null?void 0:d.data)==null?void 0:P.team_log))})}s&&m()},[s]),(0,e.useEffect)(()=>{(0,N.Dk)("\u5728\u7EBF\u7ADE\u8D5B")});function G(){w(x.current.getCroppedCanvas().toDataURL())}function z(){return S(this,null,function*(){var m,u;if(!t){h.ZP.info("\u961F\u4F0D\u540D\u4E0D\u80FD\u4E3A\u7A7A");return}let i=yield f({type:"competitions/UpTeam",payload:{identifier:s,Teannameid:O,name:t,image:((u=(m=x==null?void 0:x.current)==null?void 0:m.getCroppedCanvas())==null?void 0:u.toDataURL("image/jpeg"))||""}});(i==null?void 0:i.status)===0&&(h.ZP.info("\u4FEE\u6539\u6210\u529F"),p.history.push(`/competitions/${s}/detail/enroll`))})}function X(m){const u=m.target.files[0];if(u&&u.size>2*1024*1024){h.ZP.info("\u4EC5\u652F\u6301\u6587\u4EF6\u5927\u5C0F\u5C0F\u4E8E2M\u7684\u6587\u4EF6");return}var i=new FileReader;i.readAsBinaryString(u),i.onload=()=>{let y=btoa(i.result);L(`data:${u.type};base64,${y}`)},i.onerror=function(){}}return e.createElement("div",{className:"edu-container minH500"},e.createElement(v.Z,{className:"mt10",separator:">"},e.createElement(v.Z.Item,null,e.createElement(p.Link,{to:"/competitions/index"},"\u5728\u7EBF\u7ADE\u8D5B")),e.createElement(v.Z.Item,null,e.createElement(p.Link,{to:`/competitions/${s}/`},c&&c.name,c&&c.sub_title?"-"+c&&c.sub_title:null)),e.createElement(v.Z.Item,null,e.createElement(p.Link,{to:`/competitions/${s}/detail/enroll`},"\u62A5\u540D")),e.createElement(v.Z.Item,null,"\u7F16\u8F91\u6218\u961F\u4FE1\u606F")),e.createElement("div",{className:g.Selecttext},"\u7F16\u8F91\u6218\u961F"),e.createElement("div",{className:g.Updatecount},e.createElement("span",{style:{fontSize:"14px",color:"#F73737"}},"*"),"\u961F\u540D\uFF1A",e.createElement("p",{style:{marginTop:"15px",marginLeft:"8px",width:"544px"}},e.createElement(B.default,{placeholder:"\u8BF7\u8F93\u5165\u961F\u540D",value:t,maxLength:60,addonAfter:t!=null&&t.length?String(t&&t.length)+"/60":"0/60",onChange:m=>E(m.target.value)})),e.createElement("p",{style:{marginTop:"15px",marginLeft:"8px",width:"544px"}},e.createElement("span",null,"LOGO\uFF1A"),e.createElement("label",{id:"uploadBtn",style:{color:"#4DACFF",cursor:"pointer"}},e.createElement("input",{type:"file",className:"sr-only",id:"inputImage",name:"file",accept:"image/*",onChange:X,style:{display:"none"}}),"\u4E0A\u4F20LOGO"),"\xA0",e.createElement("span",null,"(\u652F\u6301jpg\u3001gif\u3001png\u683C\u5F0F\u7684\u56FE\u7247\uFF0C\u5EFA\u8BAE\u6587\u4EF6\u5C0F\u4E8E2M)")),e.createElement("div",{style:{marginTop:"15px",marginLeft:"8px",display:"flex"}},A?e.createElement("img",{className:g.Spanradius,src:A}):H?e.createElement("img",{className:g.Spanradius}):e.createElement("div",{className:g.Spanradius},t&&t.length>2?t&&t.substring(0,2):t),e.createElement(Z.Z,{style:{width:"320px",height:"320px",marginLeft:"30px",background:"#EEEEEE"},src:M,guides:!1,ref:x,crop:G}))),e.createElement("div",{style:{marginTop:"15px",marginBottom:"15px"}},e.createElement(_.ZP,{type:"primary",onClick:()=>z()},"\u786E\u5B9A"),e.createElement(_.ZP,{style:{marginLeft:"15px"}},e.createElement(p.Link,{to:`/competitions/${s}/detail/enroll`},"\u53D6\u6D88"))))};var j=(0,p.connect)(({loading:n,globalSetting:r})=>({globalSetting:r,loading:n.models.competitions}))(T)}}]);