import{l as e,K as a,N as s,t,v as l,x as r,dI as p,M as i}from"./utils-lib.js?v=20260328163632";import{u as o,s as u}from"./index115.js?v=20260328163632";import{h as m}from"./useMethod6.js?v=20260328163632";import{k as n,r as d,O as c,j as f,o as v,V as x,W as b,Y as y}from"./base-lib.js?v=20260328163632";import{au as j,k as h,l as w}from"./naive-ui.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";import"./index88.js?v=20260328163632";const g={class:"p-20px"},k=n({__name:"index",props:{compData:{default:{fileItem:{}}}},setup(n,{expose:k}){const _=n,{refreshFilesList:I}=o(),D=d({label:e("分享名称"),ruleKey:"ps",rules:[a({message:e("请输入分享名称"),trigger:["blur","input"]})],children:[{type:"input",key:"ps",attrs:{class:"!w-260px",placeholder:e("请输入分享名称")}}]}),C=d({label:e("有效期"),children:[{type:"custom",key:"expire",render:()=>c(w,{value:W.value.expire,"onUpdate:value":e=>W.value.expire=e},{default:()=>[c(j,{class:"!gap-30px"},{default:()=>[c(h,{value:24},{default:()=>[f(" "),e("1天")]}),c(h,{value:168},{default:()=>[f(" "),e("7天")]}),c(h,{value:1130800},{default:()=>[f(" "),e("永久")]})]})]})}]}),K=d({label:e("提取码"),children:[{type:"input",key:"password",attrs:{class:"!w-200px mr-10px",placeholder:e("为空则不设置提取码")}},{type:"button",key:"passwordBtn",attrs:{type:"primary",buttonText:e("随机"),onClick:()=>{W.value.password=s(6)}}}]}),M=d({formAttrs:{labelWidth:"100px"},formItems:[D.value,C.value,K.value]}),[O,W,q]=t(M);return v((()=>{Object.assign(W.value,{ps:_.compData.fileItem.name,expire:24,password:""})})),k({onConfirm:async a=>{await q.value.validate(),await r({loading:e("正在生成分享链接，请稍后..."),request:p({...W.value,filename:_.compData.fileItem.path}),success:s=>{s.status?(i.success(e("分享成功")),u(s.data),a()):i.error(s.msg),I()}})}}),(e,a)=>(x(),b("div",g,[c(y(O)),c(y(l),{options:y(m)},null,8,["options"])]))}});export{k as default};
