import{B as e}from"./index85.js?v=20260328163632";import{l as a,dj as s,t as l,x as t,dK as r}from"./utils-lib.js?v=20260328163632";import{u as i,aC as o}from"./index115.js?v=20260328163632";import{k as u,r as n,O as p,c as m,o as d,V as v,_ as c,Y as _}from"./base-lib.js?v=20260328163632";import"./naive-ui.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";import"./index88.js?v=20260328163632";const f=u({__name:"index",setup(u,{expose:f}){const{dirPath:b}=i(),h=n({formAttrs:{labelWidth:100},formItems:[]}),j=n({label:a("URL地址"),children:[{type:"input",key:"url",attrs:{class:"!w-310px",placeholder:a("请输入URL"),onInput:e=>{w.value.file_name=e.split("/").pop()||""}}}]}),x=n({label:a("下载到"),ruleKey:"save_to",rules:[{required:!0,message:a("请输入下载到"),trigger:["blur","input"]}],children:[{type:"custom",key:"save_to",render:()=>p("div",null,[p(e,{modelValue:w.value.save_to,"onUpdate:modelValue":e=>w.value.save_to=e,onIconClick:()=>s({type:"dir",path:b.value,callback:e=>w.value.save_to=e}),placeholder:a("请输入下载到"),width:"270px",icon:"el-folder-opened"},null)])}]}),y=n({label:a("文件名"),ruleKey:"file_name",rules:[{required:!0,message:a("请输入文件名"),trigger:["blur","input"]}],children:[{type:"input",key:"file_name",attrs:{class:"!w-310px",placeholder:a("请输入文件名")}}]}),g=m((()=>(h.value.formItems=[j.value,x.value,y.value],h.value))),[k,w,I]=l(g);return d((()=>{Object.assign(w.value,{url:"http://",save_to:b.value,file_name:""})})),f({onConfirm:async()=>{await I.value.validate();return(await t({loading:a("正在下载，请稍后..."),request:r(w.value),message:!0,success:e=>{e.status&&o()}})).status}}),(e,a)=>(v(),c(_(k),{class:"p-20px"}))}});export{f as default};
