← Back
Editing: RemoteDownload-BCfqHLBQ.js
import{y as R,av as x}from"./index-LQ-JIYiv.js?v=1774508183068";import{_ as M}from"./index.vue_vue_type_script_setup_true_lang-CwcqhoN-.js?v=1774508183068";import{g as U}from"./check-CNel7fTH.js?v=1774508183068";import{P as k,t as F}from"./FileIcon-MbTGjXAj.js?v=1774508183068";import{k as q,R as C,i as E,r as y,al as B,$ as N,a8 as T,a9 as s,_ as u,a0 as n,S as o,X as I}from"./vue-core-BlDeWrD6.js?v=1774508183068";import{a1 as P,b as S}from"./naive-ui-BjvXgNtF.js?v=1774508183068";import"./prismjs-BZPoR7_J.js?v=1774508183068";import"./copy-DTOfN-dY.js?v=1774508183068";const V={class:"p-20px pt-28px"},$={class:"w-320px"},j={class:"w-320px"},A={class:"w-320px"},W=q({__name:"RemoteDownload",setup(L,{expose:_}){const{t:l}=C(),d=E("fileStore"),{downloadFileFormData:e,currentPath:v}=d,r=y(!1),p=B("formRef"),c={url:{trigger:["input","blur"],validator:()=>e.value.url?U(e.value.url)?!0:new Error(l("file.remoteDownloadModal.validation.urlInvalid")):new Error(l("file.remoteDownloadModal.validation.urlRequired"))},path:{trigger:["input","blur"],validator:()=>e.value.path?!0:new Error(l("file.remoteDownloadModal.validation.pathRequired"))},filename:{trigger:["input","blur"],validator:()=>e.value.filename?!0:new Error(l("file.remoteDownloadModal.validation.filenameRequired"))}},w=i=>{const a=i.split("/").pop();e.value.filename=a||""},h=()=>{e.value.url="http://",e.value.path=v.value,e.value.filename=""};_({open(){h(),r.value=!0},close(){r.value=!1}});const b=async()=>{var i;await((i=p.value)==null?void 0:i.validate()),await x.post("/files?action=DownloadFile",{...e.value}),k(d),F(d)};return(i,a)=>{const f=S,m=P,g=M,D=R;return N(),T(D,{show:o(r),"onUpdate:show":a[3]||(a[3]=t=>I(r)?r.value=t:null),title:o(l)("file.remoteDownloadModal.title"),width:500,footer:!0,onConfirm:b},{default:s(()=>[u("div",V,[n(g,{ref_key:"formRef",ref:p,model:o(e),rules:c},{default:s(()=>[n(m,{label:o(l)("file.remoteDownloadModal.urlAddress"),path:"url"},{default:s(()=>[u("div",$,[n(f,{value:o(e).url,"onUpdate:value":[a[0]||(a[0]=t=>o(e).url=t),w]},null,8,["value"])])]),_:1},8,["label"]),n(m,{label:o(l)("file.remoteDownloadModal.downloadTo"),path:"path"},{default:s(()=>[u("div",j,[n(f,{value:o(e).path,"onUpdate:value":a[1]||(a[1]=t=>o(e).path=t)},null,8,["value"])])]),_:1},8,["label"]),n(m,{label:o(l)("file.remoteDownloadModal.fileName"),path:"filename"},{default:s(()=>[u("div",A,[n(f,{value:o(e).filename,"onUpdate:value":a[2]||(a[2]=t=>o(e).filename=t)},null,8,["value"])])]),_:1},8,["label"])]),_:1},8,["model"])])]),_:1},8,["show","title"])}}});export{W as default};
Save File
Cancel