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

1 line
14 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[86452],{85331:function(e,n,t){t.d(n,{Z:function(){return P}});var i=t(26801),r=t.n(i),a=t(11006),o=t.n(a),l=t(10574),s=t.n(l),d=t(93923),c=t.n(d),u=t(39343),p=t.n(u),f=t(27161),h=t.n(f),g=t(59301),m=t(48826),v=t(8591),x=t(15830),b=t(22211),y="colorBlue___UHzQq",w=t(14642),k=t.n(w),z=t(37712),S=["dispatch","user","setloading","uploading","setmd5List","content","shixunHomeworks","globalSetting"],j=m.Z.Dragger,$=15728640,P=(0,b.connect)((function(e){var n=e.loading,t=e.globalSetting,i=e.user,r=e.shixunHomeworks;return{globalSetting:t,loading:n.models.competitions,user:i,shixunHomeworks:r}}))((function(e){var n=e.dispatch,t=e.user,i=e.setloading,a=e.uploading,l=e.setmd5List,d=e.content,u=e.shixunHomeworks,f=e.globalSetting;h()(e,S);console.log(f,"globalSetting"),(0,g.useEffect)((function(){function e(){return(e=p()(s()().mark((function e(){var n,t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,x.ZP)((null==f||null===(n=f.setting)||void 0===n?void 0:n.bigfiles_upload)+"/file/filePatchMerge",{method:"post",body:u.actionTabs.params},!0,!0);case 2:"000000"===(t=e.sent).errorCode&&(P[0].file.percent=100,P[0].file.status="success",Z(c()(P)),i(100),v.ZP.info("上传成功"),l(null==t?void 0:t.data));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}"分片专用504"===u.actionTabs.key&&(n({type:"shixunHomeworks/setActionTabs",payload:{key:""}}),function(){e.apply(this,arguments)}())}),[u.actionTabs.key]);var m,b=(0,g.useState)([]),w=o()(b,2),P=w[0],Z=w[1],_=(0,g.useState)(0),M=o()(_,2),C=M[0],B=M[1],I=(0,g.useState)(!1),N=o()(I,2),O=N[0],H=N[1],T={onRemove:function(e){Z(c()(P.filter((function(n){return n.name!==e.name}))))},multiple:!0,fileList:null==P?void 0:P.map((function(e){return e.file})),customRequest:function(){},beforeUpload:(m=p()(s()().mark((function e(n){var t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=107374182400,!P.filter((function(e){return e.name===n.name})).length){e.next=4;break}return v.ZP.info("".concat(n.name,"已存在,请重新选择")),e.abrupt("return");case 4:if(!((null==n?void 0:n.size)>t)){e.next=7;break}return v.ZP.info("文件超过".concat(t/1024/1024/1024,"GB不符合上传要求")),e.abrupt("return",!1);case 7:return Z([{name:n.name,file:n}]),e.abrupt("return",!1);case 9:case"end":return e.stop()}}),e)}))),function(e){return m.apply(this,arguments)})};function E(){return(E=p()(s()().mark((function e(n,t){var r,a,o,d,u,p;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=D(n),e.next=3,(0,x.ZP)((null==f||null===(r=f.setting)||void 0===r?void 0:r.bigfiles_upload)+"/file/fileExists",{method:"get",params:{md5:u,size:n.size,dirName:t}},!1,!0);case 3:if(!((null==(p=e.sent)||null===(a=p.data)||void 0===a?void 0:a.length)>0&&1===(null==p||null===(o=p.data)||void 0===o||null===(o=o[0])||void 0===o?void 0:o.type))){e.next=11;break}return i(100),P[0].file.percent=100,P[0].file.status="success",Z(c()(P)),v.ZP.info("上传成功"),l(null==p?void 0:p.data),e.abrupt("return");case 11:if(!(p.data.length>0&&0===p.data[0].type)){e.next=14;break}return L(p.data[0].id,n,t),e.abrupt("return");case 14:(null==p||null===(d=p.data)||void 0===d?void 0:d.length)<=0&&W(u,n,t);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function W(e,n,t){return G.apply(this,arguments)}function G(){return G=p()(s()().mark((function e(n,t,i){var r,a,o,l;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,x.ZP)((null==f||null===(r=f.setting)||void 0===r?void 0:r.bigfiles_upload)+"/file/newFile",{method:"post",body:{name:t.name,md5:n,size:1,oldName:t.name,dirName:i}},!1,!0);case 2:(null==(o=e.sent)||null===(a=o.data)||void 0===a?void 0:a.length)>0&&L(null==o||null===(l=o.data)||void 0===l||null===(l=l[0])||void 0===l?void 0:l.id,t,i);case 4:case"end":return e.stop()}}),e)}))),G.apply(this,arguments)}function D(e){var n=new(k());if(!e.size)return n.appendBinary(e),n.end();if(e.size<2048)for(var t=Math.ceil(e.size/2),i=0;i<t;i++){var r=5*i,a=Math.min(e.size,r+2);n.appendBinary(e.slice(r,a))}else if(e.size<15728640&&e>2048)for(t=Math.ceil(e.size/2e3),i=0;i<t;i++){r=5*i,a=Math.min(e.size,r+2e3);n.appendBinary(e.slice(r,a))}else for(t=Math.ceil(e.size/$),i=0;i<t;i++){r=i*$,a=Math.min(e.size,r);n.appendBinary(e.slice(r,a))}return n.end()}function L(e,n,t){return A.apply(this,arguments)}function A(){return(A=p()(s()().mark((function e(n,t,i){var r,a;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}return e.abrupt("return");case 2:r=Math.ceil(t.size/$),a=0;case 4:if(!(a<r)){e.next=10;break}return e.next=7,F(n,t,a,r,i);case 7:a++,e.next=4;break;case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function F(e,n,t,i,r){if(!O){var a=t*$,o=Math.min(n.size,a+$),l=n.slice(a,o),d=new FileReader;d.readAsBinaryString(l),d.onload=function(){var a=p()(s()().mark((function a(o){var d,u,p,h,g;return s()().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return u=o.target.result,p=D(u),(h=new FormData).append("index",t),h.append("parent",e),h.append("md5",p),h.append("size",l.size),h.append("patch",l),h.append("dirName",r),h.append("name",n.name+"-patch-"+t),a.next=12,(0,x.ZP)((null==f||null===(d=f.setting)||void 0===d?void 0:d.bigfiles_upload)+"/file/filePatchUpload",{method:"post",body:h},!0,!0);case 12:if(g=a.sent,P[0].file.percent=0,P[0].file.status="uploading","000000"!==g.errorCode){a.next=25;break}return C++,B(C),Y(e,n,i,r),P[0].file.percent=C*$/n.size*100,P[0].file.status="uploading",Z(c()(P)),a.abrupt("return");case 25:v.ZP.info("上传分片失败"),H(!0);case 27:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}()}}function Y(e,n,t,i){return R.apply(this,arguments)}function R(){return(R=p()(s()().mark((function e(n,t,r,a){var o,u,p;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(C==r){e.next=2;break}return e.abrupt("return");case 2:return(u=new FormData).append("parent",n),u.append("size",t.size),u.append("dirName",a),u.append("type",d||0),e.next=9,(0,x.ZP)((null==f||null===(o=f.setting)||void 0===o?void 0:o.bigfiles_upload)+"/file/filePatchMerge",{method:"post",body:u},!0,!0);case 9:"000000"===(p=e.sent).errorCode?(P[0].file.percent=100,P[0].file.status="success",Z(c()(P)),i(100),v.ZP.info("上传成功"),l(null==p?void 0:p.data)):-1===p.status&&(Z([]),i(101));case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,g.useEffect)((function(){if(0===a){var e;if(B(0),H(!1),(null==P?void 0:P.length)<=0)return v.ZP.info("文件不能为空"),void i(101);!function(e,n){E.apply(this,arguments)}(null==P||null===(e=P[0])||void 0===e?void 0:e.file,t.userInfo.login)}}),[a]),(0,z.jsxs)(j,r()(r()({height:300},T),{},{children:[(0,z.jsx)("div",{children:(0,z.jsx)("i",{className:"iconfont icon-shangchuan font50 ".concat(y)})}),(0,z.jsxs)("div",{className:"font14 mt30",children:["拖拽文件或",(0,z.jsx)("span",{className:"".concat(y," ml5"),children:"点击此处上传"})]})]}))}))},86697:function(e,n,t){t.r(n),t.d(n,{default:function(){return C}});var i=t(10574),r=t.n(i),a=t(26801),o=t.n(a),l=t(39343),s=t.n(l),d=t(11006),c=t.n(d),u=t(59301),p=t(53877),f=t(99313),h=t(48826),g=t(3113),m=t(28103),v=t(72315),x=t(41867),b=t(43418),y=t(1056),w=t(378),k=t(22211),z=t(15830),S=t(9498),j=t.n(S),$="wrap___3BW9K",P="header___MCuDa",Z="title___FGsmi",_=t(85331),M=t(37712),C=(p.Z.Paragraph,f.Z.TabPane,h.Z.Dragger,(0,k.connect)((function(e){return{innovation:e.innovation}}))((function(e){e.dispatch;var n=(0,u.useState)({limit:10,page:1,tab:"public"}),t=c()(n,2),i=t[0],a=t[1],l=(0,u.useState)([]),d=c()(l,2),p=d[0],f=d[1],h=(0,u.useState)(!1),k=c()(h,2),S=k[0],C=k[1],B=(0,u.useState)(),I=c()(B,2),N=I[0],O=I[1],H=(0,u.useState)(""),T=c()(H,2),E=T[0],W=T[1];function G(){return D.apply(this,arguments)}function D(){return(D=s()(r()().mark((function e(){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,z.ZP)("/api/sci/projects/data_sets.json",{method:"get",params:i});case 2:n=e.sent,f(n);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function L(){return(L=s()(r()().mark((function e(n){var t,i,a,o,l;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,z.ZP)("/api/sci/projects/update_attachment.json",{method:"PUT",body:{md5:(null==n||null===(t=n[0])||void 0===t||null===(t=t.item)||void 0===t?void 0:t.md5)||(null==n||null===(i=n[0])||void 0===i?void 0:i.md5),filesize:(null==n||null===(a=n[0])||void 0===a||null===(a=a.item)||void 0===a?void 0:a.size)||(null==n||null===(o=n[0])||void 0===o?void 0:o.size),description:E}});case 2:0===(null==(l=e.sent)?void 0:l.status)&&(C(!1),G(),W(""));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,u.useEffect)((function(){G()}),[]),(0,M.jsxs)("div",{children:[(0,M.jsxs)("div",{className:P,children:[(0,M.jsx)("span",{className:Z,children:"公开数据集列表"}),(0,M.jsx)(g.ZP,{icon:(0,M.jsx)(w.Z,{}),type:"primary",onClick:function(){return C(!0)},children:"创建数据集"})]}),(0,M.jsx)(m.Z,{}),(0,M.jsx)(v.Z,{dataSource:null==p?void 0:p.data_sets,columns:[{title:"文件名",dataIndex:"filename",key:"filename",ellipsis:!0,width:"20%"},{title:"备注",dataIndex:"description",key:"description",ellipsis:!0,width:"40%"},{title:"创建时间",dataIndex:"created_on",key:"created_on",render:function(e){return j()(e).format("YYYY-MM-DD HH:mm")}},{title:"最后修改人",dataIndex:"author",key:"author"},{title:"大小",dataIndex:"filesize",key:"filesize"}],pagination:!1}),(0,M.jsx)(x.Z,{style:{textAlign:"center",marginTop:20},current:i.page,total:null==p?void 0:p.data_sets_count,pageSize:10,showSizeChanger:!1,hideOnSinglePage:!0,onChange:function(e){i.page=e,a(o()({},i)),G()}}),S&&(0,M.jsx)(b.Z,{title:"创建数据集",open:S,onCancel:function(){N<100?b.Z.confirm({title:"提示",content:"还有文件暂未上传,是否取消",okText:"确定",cancelText:"取消",onOk:function(){O(101),C(!1)}}):(W(""),C(!1))},okButtonProps:{loading:N<100},onOk:function(){O(0)},children:(0,M.jsxs)("div",{className:$,children:[(0,M.jsx)("label",{style:{color:"red"},children:"*"}),(0,M.jsx)("span",{children:"选择文件"})," ",(0,M.jsx)("span",{children:"(单个文件不能超过100GB)"}),(0,M.jsx)(_.Z,{setmd5List:function(e){return L.apply(this,arguments)},uploading:N,setloading:O,showmodal:S}),(0,M.jsx)("label",{children:"备注:"}),(0,M.jsx)(y.Z,{maxLength:100,value:E,onChange:function(e){W(e.target.value)},placeholder:"请填写备注信息"})]})})]})})))},28103:function(e,n,t){t.d(n,{Z:function(){return f}});var i=t(73287),r=t.n(i),a=t(59301),o=t(36355),l=t(17313),s=t(83116),d=t(37613);const c=e=>{const{componentCls:n,sizePaddingEdgeHorizontal:t,colorSplit:i,lineWidth:r,textPaddingInline:a,orientationMargin:o,verticalMarginInline:s}=e;return{[n]:Object.assign(Object.assign({},(0,l.Wf)(e)),{borderBlockStart:`${r}px solid ${i}`,"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:s,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:`${r}px solid ${i}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${e.dividerHorizontalGutterMargin}px 0`},[`&-horizontal${n}-with-text`]:{display:"flex",alignItems:"center",margin:`${e.dividerHorizontalWithTextGutterMargin}px 0`,color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${i}`,"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:`${r}px solid transparent`,borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},[`&-horizontal${n}-with-text-left`]:{"&::before":{width:100*o+"%"},"&::after":{width:100-100*o+"%"}},[`&-horizontal${n}-with-text-right`]:{"&::before":{width:100-100*o+"%"},"&::after":{width:100*o+"%"}},[`${n}-inner-text`]:{display:"inline-block",paddingBlock:0,paddingInline:a},"&-dashed":{background:"none",borderColor:i,borderStyle:"dashed",borderWidth:`${r}px 0 0`},[`&-horizontal${n}-with-text${n}-dashed`]:{"&::before, &::after":{borderStyle:"dashed none none"}},[`&-vertical${n}-dashed`]:{borderInlineStartWidth:r,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${n}-with-text`]:{color:e.colorText,fontWeight:"normal",fontSize:e.fontSize},[`&-horizontal${n}-with-text-left${n}-no-default-orientation-margin-left`]:{"&::before":{width:0},"&::after":{width:"100%"},[`${n}-inner-text`]:{paddingInlineStart:t}},[`&-horizontal${n}-with-text-right${n}-no-default-orientation-margin-right`]:{"&::before":{width:"100%"},"&::after":{width:0},[`${n}-inner-text`]:{paddingInlineEnd:t}}})}};var u=(0,s.Z)("Divider",(e=>{const n=(0,d.TS)(e,{dividerHorizontalWithTextGutterMargin:e.margin,dividerHorizontalGutterMargin:e.marginLG,sizePaddingEdgeHorizontal:0});return[c(n)]}),(e=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:e.marginXS}))),p=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)n.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(t[i[r]]=e[i[r]])}return t};var f=e=>{const{getPrefixCls:n,direction:t,divider:i}=a.useContext(o.E_),{prefixCls:l,type:s="horizontal",orientation:d="center",orientationMargin:c,className:f,rootClassName:h,children:g,dashed:m,plain:v,style:x}=e,b=p(e,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","plain","style"]),y=n("divider",l),[w,k]=u(y),z=d.length>0?`-${d}`:d,S=!!g,j="left"===d&&null!=c,$="right"===d&&null!=c,P=r()(y,null==i?void 0:i.className,k,`${y}-${s}`,{[`${y}-with-text`]:S,[`${y}-with-text${z}`]:S,[`${y}-dashed`]:!!m,[`${y}-plain`]:!!v,[`${y}-rtl`]:"rtl"===t,[`${y}-no-default-orientation-margin-left`]:j,[`${y}-no-default-orientation-margin-right`]:$},f,h),Z=a.useMemo((()=>"number"==typeof c?c:/^\d+$/.test(c)?Number(c):c),[c]),_=Object.assign(Object.assign({},j&&{marginLeft:Z}),$&&{marginRight:Z});return w(a.createElement("div",Object.assign({className:P,style:Object.assign(Object.assign({},null==i?void 0:i.style),x)},b,{role:"separator"}),g&&"vertical"!==s&&a.createElement("span",{className:`${y}-inner-text`,style:_},g)))}}}]);