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

2 lines
4.8 KiB

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[485],{96642:function(J,h,n){n.r(h),n.d(h,{default:function(){return V}});var e=n(59301),x=n(63144),y=n(8591),g=n(95237),E=n(43604),O=n(46651),v=n(3113),R=n(71418),f=n(15826),A={flex_box_center:"flex_box_center___Rx_bl",flex_space_between:"flex_space_between___pf3DK",flex_box_vertical_center:"flex_box_vertical_center___C2f9B",flex_box_center_end:"flex_box_center_end___Pmdn_",flex_box_column:"flex_box_column___RduTL",wrap:"wrap___Z5mJ_",head:"head___WiKNg"},w=n(76265),C=n(46961),j=Object.defineProperty,p=Object.getOwnPropertySymbols,_=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable,B=(t,u,l)=>u in t?j(t,u,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[u]=l,I=(t,u)=>{for(var l in u||(u={}))_.call(u,l)&&B(t,l,u[l]);if(p)for(var l of p(u))D.call(u,l)&&B(t,l,u[l]);return t},L=(t,u)=>{var l={};for(var a in t)_.call(t,a)&&u.indexOf(a)<0&&(l[a]=t[a]);if(t!=null&&p)for(var a of p(t))u.indexOf(a)<0&&D.call(t,a)&&(l[a]=t[a]);return l},H=(t,u,l)=>new Promise((a,F)=>{var P=s=>{try{i(l.next(s))}catch(o){F(o)}},m=s=>{try{i(l.throw(s))}catch(o){F(o)}},i=s=>s.done?a(s.value):Promise.resolve(s.value).then(P,m);i((l=l.apply(t,u)).next())});const z=t=>{var u=t,{globalSetting:l,user:a,dispatch:F}=u,P=L(u,["globalSetting","user","dispatch"]),m,i,s;const[o,b]=(0,e.useState)([]),[r,K]=(0,e.useState)(),[T,Z]=(0,e.useState)(!1),[S,N]=(0,e.useState)(!1),Y={onRemove:()=>{b([])},beforeUpload:c=>{if((c==null?void 0:c.size)>1024*1024*50)return y.ZP.info("\u6587\u4EF6\u8D85\u8FC750M\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42"),!1;let d=[];return d.push(c),b([...d]),!1},fileList:o,accept:".xls,.xlsx"};return e.createElement("section",{className:A.wrap},e.createElement("div",{className:A.head},e.createElement("span",{onClick:()=>x.history.push("/problems")},e.createElement("i",{className:"iconfont icon-fanhui2"}),e.createElement("span",{className:"mr20"},"\u8FD4\u56DE")),e.createElement("b",null,"\u6279\u91CF\u5BFC\u5165\u8BD5\u9898")),e.createElement("div",{className:"pr40 pl30 mt30"},e.createElement(g.Z,{gutter:[16,16]},e.createElement(E.Z,{className:"font14",span:2,style:{height:"40px",lineHeight:"40px",textAlign:"end"}},"\u6587\u4EF6\u4E0A\u4F20\uFF1A"),e.createElement(E.Z,null,e.createElement(O.default,I({},Y),e.createElement(v.ZP,{ghost:!0,type:"primary",style:{width:96,height:40,borderRadius:4}},"\u9009\u62E9\u6587\u4EF6")))),e.createElement(g.Z,{gutter:[16,16]},e.createElement(E.Z,{span:2,className:"font14",style:{textAlign:"end"}},"\u6CE8\u610F\uFF1A"),e.createElement(E.Z,{span:22},e.createElement("span",null,"1.\u4EC5\u652F\u6301\u4E0A\u4F20.xlsx\u6216.xls\u7C7B\u578B\u7684\u6587\u4EF6\u3002 ",e.createElement("br",null),"2.\u9700\u4E0A\u4F20\u6307\u5B9A\u6A21\u677F\u7684\u6587\u4EF6\u3002",e.createElement("span",{style:{cursor:"pointer",color:"#0152d9"},onClick:()=>{(0,f.FH)("",(0,f.NY)({url:C.Z.API_SERVER+"/api/practices/down_template",query:{}}))}},"\u4E0B\u8F7D\u5BFC\u5165\u6A21\u7248"),e.createElement("br",null),"3.\u82E5\u76F4\u63A5\u4E0A\u4F20\u4FEE\u6539\u540E\u7684\u5931\u8D25\u6587\u4EF6\uFF0C\u9700\u8981\u5148\u5C06\u201C\u5931\u8D25\u539F\u56E0\u201D\u5217\u5220\u9664\u3002"))),e.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},e.createElement(v.ZP,{type:"primary",style:{width:"116px",height:"40px",borderRadius:"4px"},onClick:()=>H(void 0,null,function*(){if((o==null?void 0:o.length)<=0){y.ZP.info("\u8BF7\u4E0A\u4F20\u6587\u4EF6");return}Z(!1),N(!0);const c=new FormData;c.append("file",o[0]);const d=yield(0,w.ZP)("/api/practices/file_import.json",{method:"post",body:c},!0);N(!1),d.status!==-1&&(Z(!0),K(d))})},"\u786E\u8BA4\u4E0A\u4F20")),T&&!S&&e.createElement("div",null,e.createElement("p",{style:{paddingLeft:15,fontSize:14}},"\u4E0A\u4F20\u7ED3\u679C"),e.createElement("div",{style:{fontSize:"16px",textAlign:"center",display:"flex"}},e.createElement("span",{style:{flex:"1",lineHeight:"30px"}}," \u672C\u6B21\u4E0A\u4F20 \u65B0\u589E",e.createElement("span",{style:{color:"#FA6400"}},r==null?void 0:r.success),"\u6761\u8BD5\u9898\uFF0C\u4E0A\u4F20\u6210\u529F",e.createElement("span",{style:{color:"#FA6400"}},r==null?void 0:r.success),"\u6761\u6570\u636E",!!((m=r==null?void 0:r.fail)!=null&&m.length)&&e.createElement("span",null,"\uFF0C\u5931\u8D25",e.createElement("span",{style:{color:"#FA6400"}},(i=r==null?void 0:r.fail)==null?void 0:i.length),"\u6761\u6570\u636E")),!!((s=r==null?void 0:r.fail)!=null&&s.length)&&e.createElement(v.ZP,{style:{height:"30px",width:"144px"},type:"primary",ghost:!0,onClick:()=>{(0,f.FH)("",(0,f.NY)({url:C.Z.API_SERVER+(r==null?void 0:r.error_file),query:{}}))}},"\u4E0B\u8F7D\u5931\u8D25\u6570\u636E"))),e.createElement(R.Z,{tip:"\u4E0A\u4F20\u4E2D",style:{width:"100%",marginTop:26},spinning:S})))};var V=(0,x.connect)(({user:t,globalSetting:u})=>({user:t,globalSetting:u}))(z)}}]);