import{_ as e}from"./index.js?v=1764830988434";import{_ as a}from"./index.vue_vue_type_script_setup_true_lang.js?v=1764830988434";import{gn as l,aD as o}from"./page_layout.js?v=1764830988434";import{b as t,g as r}from"./index37.js?v=1764830988434";import{k as i,P as s,i as u,r as n,av as d,a2 as p,V as m,a3 as v,S as f,W as _,U as w,ak as c}from"./vue.js?v=1764830988434";import{dR as h,au as j}from"./naive.js?v=1764830988434";import"./common.js?v=1764830988434";import"./__commonjsHelpers__.js?v=1764830988434";import"./public.js?v=1764830988434";import"./soft2.js?v=1764830988434";import"./soft.js?v=1764830988434";import"./site.js?v=1764830988434";import"./file2.js?v=1764830988434";import"./index.vue_vue_type_script_setup_true_lang7.js?v=1764830988434";const D={class:"p-20px pt-28px"},b={class:"w-320px"},g={class:"w-320px"},x={class:"w-320px"},M=i({__name:"RemoteDownload",setup(i,{expose:M}){const{t:R}=s(),y=u("fileStore"),{downloadFileFormData:U,currentPath:E}=y,k=n(!1),q=d("formRef"),F={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"))}},P=e=>{const a=e.split("/").pop();U.value.filename=a||""};M({open(){U.value.url="http://",U.value.path=E.value,U.value.filename="",k.value=!0},close(){k.value=!1}});const S=async()=>{var e;await(null==(e=q.value)?void 0:e.validate()),await o.post("/files?action=DownloadFile",{...U.value}),t(y),r(y)};return(l,o)=>{const t=j,r=h,i=a,s=e;return m(),p(s,{show:w(k),"onUpdate:show":o[3]||(o[3]=e=>c(k)?k.value=e:null),title:w(R)("file.remoteDownloadModal.title"),width:500,footer:!0,onConfirm:S},{default:v(()=>[f("div",D,[_(i,{ref_key:"formRef",ref:q,model:w(U),rules:F},{default:v(()=>[_(r,{label:w(R)("file.remoteDownloadModal.urlAddress"),path:"url"},{default:v(()=>[f("div",b,[_(t,{value:w(U).url,"onUpdate:value":[o[0]||(o[0]=e=>w(U).url=e),P]},null,8,["value"])])]),_:1},8,["label"]),_(r,{label:w(R)("file.remoteDownloadModal.downloadTo"),path:"path"},{default:v(()=>[f("div",g,[_(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",x,[_(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};
