import{_ as e}from"./index.js?v=1763625242172";import{_ as a}from"./index.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import{gu as l,bf as o}from"./page_layout.js?v=1763625242172";import{b as t,g as r}from"./index39.js?v=1763625242172";import{k as i,P as u,i as s,r as n,av as d,R as p,a2 as m,a3 as v,U as f,X as _,V as w,aj as c}from"./vue.js?v=1763625242172";import{au as h,dP as j}from"./naive.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";import"./public.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 b={class:"p-20px pt-28px"},g={class:"w-320px"},x={class:"w-320px"},D={class:"w-320px"},M=i({__name:"RemoteDownload",setup(i,{expose:M}){const{t:R}=u(),y=s("fileStore"),{downloadFileFormData:U,currentPath:E}=y,q=n(!1),F=d("formRef"),P={url:{trigger:["input","blur"],validator:()=>U.value.url?!!l(U.value.url)||new Error(R("file.remoteDownloadModal.validation.urlInvalid")):new Error(R("file.remoteDownloadModal.validation.urlRequired"))},path:{trigger:["input","blur"],validator:()=>!!U.value.path||new Error(R("file.remoteDownloadModal.validation.pathRequired"))},filename:{trigger:["input","blur"],validator:()=>!!U.value.filename||new Error(R("file.remoteDownloadModal.validation.filenameRequired"))}},k=e=>{const a=e.split("/").pop();U.value.filename=a||""};M({open(){U.value.url="http://",U.value.path=E.value,U.value.filename="",q.value=!0},close(){q.value=!1}});const A=async()=>{var e;await(null==(e=F.value)?void 0:e.validate()),await o.post("/files?action=DownloadFile",{...U.value}),t(y),r(y)};return(l,o)=>{const t=h,r=j,i=a,u=e;return p(),m(u,{show:w(q),"onUpdate:show":o[3]||(o[3]=e=>c(q)?q.value=e:null),title:w(R)("file.remoteDownloadModal.title"),width:500,footer:!0,onConfirm:A},{default:v((()=>[f("div",b,[_(i,{ref_key:"formRef",ref:F,model:w(U),rules:P},{default:v((()=>[_(r,{label:w(R)("file.remoteDownloadModal.urlAddress"),path:"url"},{default:v((()=>[f("div",g,[_(t,{value:w(U).url,"onUpdate:value":[o[0]||(o[0]=e=>w(U).url=e),k]},null,8,["value"])])])),_:1},8,["label"]),_(r,{label:w(R)("file.remoteDownloadModal.downloadTo"),path:"path"},{default:v((()=>[f("div",x,[_(t,{value:w(U).path,"onUpdate:value":o[1]||(o[1]=e=>w(U).path=e)},null,8,["value"])])])),_:1},8,["label"]),_(r,{label:w(R)("file.remoteDownloadModal.fileName"),path:"filename"},{default:v((()=>[f("div",D,[_(t,{value:w(U).filename,"onUpdate:value":o[2]||(o[2]=e=>w(U).filename=e)},null,8,["value"])])])),_:1},8,["label"])])),_:1},8,["model"])])])),_:1},8,["show","title"])}}});export{M as default};
