System.register(["./base-lib-legacy.js?v=1761009159","./utils-lib-legacy.js?v=1761009159","./__commonjsHelpers__-legacy.js?v=1761009159"],function(e,t){"use strict";var n,a,u,r,o,l,i,s,c,f,p,m,d,_,v,h,w,g,b,y,x,k,D,z,j,q,C,O;return{setters:[function(e){n=e.c,a=e.aA,u=e.r,r=e.g,o=e.V,l=e.o,i=e.w,s=e.v,c=e.x,f=e.e,p=e.B,m=e.C,d=e.y,_=e.z,v=e.A,h=e.F,w=e.N,g=e.I,b=e.J,y=e.G,x=e.b3,k=e.aw,D=e.b5,z=e.ax,j=e.ay},function(e){q=e.fS,C=e.x,O=e.b},null],execute:function(){var t={class:"p-[2rem]"},E={class:"h-[40rem] border border-lighter mt-[1rem]"},I={class:"ml-[0.5rem]"},S={class:"mt-8px leading-8 text-small list-disc ml-2rem"};e("default",n({__name:"upload",props:{compData:{default:function(){return{path:"",size:100,uploadData:function(){return{multiple:!0,limit:1e3}},refreshEvent:function(){}}}}},setup:function(e,n){var A=n.expose,F=O(),B=e,G=a("popupSetFooter"),H=a("buttonText"),J=a("popupClose"),M=!0,N=u(),T=u([]),V=r(function(){return B.compData.uploadData.accept||o([".json"].join(","))}),K=r(function(){return B.compData.uploadData.multiple}),L=r(function(){return B.compData.uploadData.limit}),P={"x-http-token":window.vite_public_request_token},Q=q(),R=window.location.protocol+"//"+window.location.host+"/files?action=upload",U=l({f_size:0,f_path:B.compData.path,f_name:"",f_start:0,request_time:Q.request_time,request_token:Q.request_token}),W=function(){F.success("导入成功"),B.compData.refreshEvent&&B.compData.refreshEvent(T.value,J)},X=function(e,t,n){n.push(t),F.error("导入失败")},Y=function(e){U.f_size=e.size,U.f_name=e.name,U.f_start=0},Z=function(e,t){var n=e.name.substring(e.name.lastIndexOf(".")+1),a=V.value;if(-1===a.indexOf(n))return!1;T.value=t.filter(function(e){var t=e.name.substring(e.name.lastIndexOf(".")+1);return-1!==a.indexOf(t)})||[]},$=function(e,t,n){U.f_start=e.percent,T.value=n.map(function(n){return n.uid===t.uid&&(n.percentage=e.percent),n})};return i(function(){return T.value.length},function(e){if(0!==e){for(var t=["success","fail","ready"],n=0;n<T.value.length;n++)if(!t.includes(T.value[n].status))return void G(!1);T.value.some(function(e){return"success"!==e.status})&&(H.value=M?"开始上传":"重新上传",G(!0))}else G(!1)}),A({onConfirm:function(){T.value.map(function(e){"success"!==e.status&&(e.status="ready")}),M=!1,N.value.submit(),G(!1)}}),function(e,n){var a=y,u=x,r=k,o=D,l=z,i=j;return s(),c("div",t,[f(u,{class:"upload-demo",ref_key:"upload",ref:N,name:"blob",data:d(U),action:R,headers:P,accept:d(V),limit:d(L),multiple:d(K),"show-file-list":!1,"auto-upload":!1,"file-list":d(T),"on-error":X,"on-success":W,"on-progress":$,"on-change":Z,"before-upload":Y},{default:p(function(){return[f(a,{type:"primary"},{default:p(function(){return n[0]||(n[0]=[m("选择文件",-1)])}),_:1,__:[0]})]}),_:1},8,["data","accept","limit","multiple","file-list"]),_("div",E,[f(i,{height:"400",data:d(T)},{empty:p(function(){return[f(l,{description:"只支持'".concat(d(V),"'文件格式导入")},null,8,["description"])]}),default:p(function(){return[f(r,{prop:"name","show-overflow-tooltip":!0,label:"名称"},{default:p(function(e){return[n[1]||(n[1]=_("i",{class:"text-supplement svgtofont-el-document"},null,-1)),_("span",I,v(e.row.name),1)]}),_:1}),f(r,{prop:"name",label:"是否成功",width:"300"},{default:p(function(e){return["success"===e.row.status?(s(),c(h,{key:0},[m("上传成功！")],64)):"fail"===e.row.status?(s(),c(h,{key:1},[m("上传失败!")],64)):"ready"===e.row.status?(s(),c(h,{key:2},[m("等待上传")],64)):(s(),w(o,{key:3,percentage:Math.floor(e.row.percentage)},null,8,["percentage"]))]}),_:1}),f(r,{width:"120",prop:"size",label:"大小"},{default:p(function(e){return[m(v(d(C)(e.row.size)),1)]}),_:1}),f(r,{prop:"name",width:"180",align:"right","show-overflow-tooltip":!0,label:"操作"},{default:p(function(e){return[g(f(a,{type:"text",size:"small",onClick:function(t){return n=e.row,void(T.value=T.value.filter(function(e){return e.name!==n.name}));var n}},{default:p(function(){return n[2]||(n[2]=[m("删除",-1)])}),_:2,__:[2]},1032,["onClick"]),[[b,"ready"===e.row.status||"fail"===e.row.status]])]}),_:1})]}),_:1},8,["data"])]),_("ul",S,[_("li",null,"仅支持"+v(d(V)),1)])])}}}))}}});
