import{C as e}from"./CalcVerify.js?v=1763625242172";import{m as a,bf as s,p as t}from"./page_layout.js?v=1763625242172";import{g as l}from"./index39.js?v=1763625242172";import{aC as i,dm as o}from"./naive.js?v=1763625242172";import{k as n,i as r,r as c,R as u,a2 as p,a3 as f,U as d,a4 as m,V as v,X as y,j as _,S as g,aj as h}from"./vue.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";import"./public.js?v=1763625242172";import"./index.js?v=1763625242172";import"./soft2.js?v=1763625242172";import"./soft.js?v=1763625242172";import"./site.js?v=1763625242172";import"./file2.js?v=1763625242172";import"./index.vue_vue_type_script_setup_true_lang7.js?v=1763625242172";const j={class:"header-tit single-line-ellipsis"},w={key:0,class:"del-modal-wrapper"},b={key:1,class:"del-modal-wrapper"},x={class:"text-[#f0a020]"},k={class:"modal-footer-btns"},C=t(n({__name:"Del",setup(t,{expose:n}){const C=r("fileStore"),{choosedKeys:D,fileList:R,fileRecycle:F,currentPath:O}=C,S=c(!1),P=c({}),V=c([]),q=c("Delete file"),U=c();async function B(){if(1==D.value.length){const e=R.value.find((e=>e.nm==D.value[0]));await async function(e){const t=a.loading("Files are being deleted. Please wait");try{S.value=!1,0==(await s.post("/files?action=DeleteFile",{path:e},{requestOptions:{isOriginalResult:!0}})).message.status?a.success("Files deleted successfully"):a.error("Files failed to delete")}catch(l){console.warn(l)}finally{t.close()}}(e.path)}D.value.length>1&&await async function(e,a){await s.post("/files?action=SetBatchData",{data:JSON.stringify(e),type:4,path:a},{requestOptions:{loading:"正在批量删除中，请稍候...",successMessage:!0}}),S.value=!1}(D.value,O.value)}async function H(){F.value||U.value.validate()?(await B(),l(C)):a.warning("Please enter the correct verification number")}return n({open(){if(S.value=!0,1==D.value.length){const e=R.value.find((e=>e.nm==D.value[0]));P.value=e,q.value="Delete file [".concat(P.value.nm,"]")}else V.value=R.value.filter((e=>D.value.includes(e.nm)))},close(){S.value=!1}}),(a,s)=>{const t=i,l=o;return u(),p(l,{preset:"card",draggable:"","close-on-esc":!1,"mask-closable":!1,class:"w-170",segmented:"",show:v(S),"onUpdate:show":s[1]||(s[1]=e=>h(S)?S.value=e:null)},{header:f((()=>[d("div",j,m(v(q)),1)])),footer:f((()=>[d("div",k,[y(t,{onClick:s[0]||(s[0]=e=>S.value=!1)},{default:f((()=>s[5]||(s[5]=[_("cancel")]))),_:1,__:[5]}),y(t,{type:"primary",onClick:H},{default:f((()=>s[6]||(s[6]=[_("confirm")]))),_:1,__:[6]})])])),default:f((()=>[v(F)?(u(),g("div",b,[s[3]||(s[3]=_(" Confirm delete folder ")),d("span",x,m(v(P).path?"[".concat(v(P).path,"]"):""),1),s[4]||(s[4]=_(" ,it will move to recycle bin after delete, continue? "))])):(u(),g("div",w,[s[2]||(s[2]=d("div",{class:"text-red-5 mb-15px text-14px"}," Recycle bin is not currently open, delete file cannot be restored after, continue? ",-1)),y(e,{ref_key:"calcVertifyRef",ref:U},null,512)]))])),_:1},8,["show"])}}}),[["__scopeId","data-v-9d32222b"]]);export{C as default};
