|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[10485],{40001:function(n,e,t){t.d(e,{Z:function(){return a}});var i=t(54476),s=t(59301),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},l=t(7657),o=function(n,e){return s.createElement(l.Z,(0,i.Z)({},n,{ref:e,icon:r}))};var a=s.forwardRef(o)},15277:function(n,e,t){t.d(e,{Z:function(){return a}});var i=t(54476),s=t(59301),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},l=t(7657),o=function(n,e){return s.createElement(l.Z,(0,i.Z)({},n,{ref:e,icon:r}))};var a=s.forwardRef(o)},33907:function(n,e,t){t.r(e),t.d(e,{default:function(){return E}});var i=t(7557),s=t.n(i),r=t(41498),l=t.n(r),o=t(82242),a=t.n(o),c=t(79800),u=t.n(c),d=t(39647),h=t.n(d),p=t(59301),f=t(64515),x=t(8591),m=t(95237),g=t(43604),j=t(54580),v=t(3113),y=t(71418),Z=t(30406),b="wrap___Z5mJ_",w="head___WiKNg",C=t(87281),k=t(51200),S=t(37712),_=["globalSetting","user","dispatch"],E=(0,f.connect)((function(n){return{user:n.user,globalSetting:n.globalSetting}}))((function(n){n.globalSetting,n.user,n.dispatch,h()(n,_);var e,t,i,r=(0,p.useState)([]),o=u()(r,2),c=o[0],d=o[1],E=(0,p.useState)(),N=u()(E,2),R=N[0],$=N[1],z=(0,p.useState)(!1),A=u()(z,2),M=A[0],P=A[1],F=(0,p.useState)(!1),I=u()(F,2),D=I[0],H=I[1],O={onRemove:function(){d([])},beforeUpload:function(n){if((null==n?void 0:n.size)>52428800)return x.ZP.info("文件超过50M,不符合上传要求"),!1;var e=[];return e.push(n),d([].concat(e)),!1},fileList:c,accept:".xls,.xlsx"};return(0,S.jsxs)("section",{className:b,children:[(0,S.jsxs)("div",{className:w,children:[(0,S.jsxs)("span",{onClick:function(){return f.history.push("/problems")},children:[(0,S.jsx)("i",{className:"iconfont icon-fanhui2"}),(0,S.jsx)("span",{className:"mr20",children:"返回"})]}),(0,S.jsx)("b",{children:"批量导入试题"})]}),(0,S.jsxs)("div",{className:"pr40 pl30 mt30",children:[(0,S.jsxs)(m.Z,{gutter:[16,16],children:[(0,S.jsx)(g.Z,{className:"font14",span:2,style:{height:"40px",lineHeight:"40px",textAlign:"end"},children:"文件上传:"}),(0,S.jsx)(g.Z,{children:(0,S.jsx)(j.Z,a()(a()({},O),{},{children:(0,S.jsx)(v.ZP,{ghost:!0,type:"primary",style:{width:96,height:40,borderRadius:4},children:"选择文件"})}))})]}),(0,S.jsxs)(m.Z,{gutter:[16,16],children:[(0,S.jsx)(g.Z,{span:2,className:"font14",style:{textAlign:"end"},children:"注意:"}),(0,S.jsx)(g.Z,{span:22,children:(0,S.jsxs)("span",{children:["1.仅支持上传.xlsx或.xls类型的文件。 ",(0,S.jsx)("br",{}),"2.需上传指定模板的文件。",(0,S.jsx)("span",{style:{cursor:"pointer",color:"#0152d9"},onClick:function(){(0,Z.FH)("",(0,Z.NY)({url:k.Z.API_SERVER+"/api/practices/down_template",query:{}}))},children:"下载导入模版"}),(0,S.jsx)("br",{}),"3.若直接上传修改后的失败文件,需要先将“失败原因”列删除。"]})})]}),(0,S.jsx)("div",{style:{display:"flex",justifyContent:"flex-end"},children:(0,S.jsx)(v.ZP,{type:"primary",style:{width:"116px",height:"40px",borderRadius:"4px"},onClick:l()(s()().mark((function n(){var e,t;return s()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!((null==c?void 0:c.length)<=0)){n.next=3;break}return x.ZP.info("请上传文件"),n.abrupt("return");case 3:return P(!1),H(!0),(e=new FormData).append("file",c[0]),n.next=9,(0,C.ZP)("/api/practices/file_import.json",{method:"post",body:e},!0);case 9:if(t=n.sent,H(!1),-1!==t.status){n.next=13;break}return n.abrupt("return");case 13:P(!0),$(t);case 15:case"end":return n.stop()}}),n)}))),children:"确认上传"})}),M&&!D&&(0,S.jsxs)("div",{children:[(0,S.jsx)("p",{style:{paddingLeft:15,fontSize:14},children:"上传结果"}),(0,S.jsxs)("div",{style:{fontSize:"16px",textAlign:"center",display:"flex"},children:[(0,S.jsxs)("span",{style:{flex:"1",lineHeight:"30px"},children:[" 本次上传 新增",(0,S.jsx)("span",{style:{color:"#FA6400"},children:null==R?void 0:R.success}),"条试题,上传成功",(0,S.jsx)("span",{style:{color:"#FA6400"},children:null==R?void 0:R.success}),"条数据",!(null==R||null===(e=R.fail)||void 0===e||!e.length)&&(0,S.jsxs)("span",{children:[",失败",(0,S.jsx)("span",{style:{color:"#FA6400"},children:null==R||null===(t=R.fail)||void 0===t?void 0:t.length}),"条数据"]})]}),!(null==R||null===(i=R.fail)||void 0===i||!i.length)&&(0,S.jsx)(v.ZP,{style:{height:"30px",width:"144px"},type:"primary",ghost:!0,onClick:function(){(0,Z.FH)("",(0,Z.NY)({url:k.Z.API_SERVER+(null==R?void 0:R.error_file),query:{}}))},children:"下载失败数据"})]})]}),(0,S.jsx)(y.Z,{tip:"上传中",style:{width:"100%",marginTop:26},spinning:D})]})]})}))},56762:function(n,e,t){t.d(e,{Z:function(){return s}});var i=t(59301);function s(){const[,n]=i.useReducer((n=>n+1),0);return n}},8378:function(n,e){e.Z=n=>({[n.componentCls]:{[`${n.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${n.motionDurationMid} ${n.motionEaseInOut},\n opacity ${n.motionDurationMid} ${n.motionEaseInOut} !important`}},[`${n.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${n.motionDurationMid} ${n.motionEaseInOut},\n opacity ${n.motionDurationMid} ${n.motionEaseInOut} !important`}}})}}]); |