import{l as e,a9 as a,Y as t,t as s,v as l,z as o,x as r,dw as i,M as n,_ as p}from"./utils-lib.js?v=20260328163632";import{u}from"./index115.js?v=20260328163632";import{h as c}from"./useMethod6.js?v=20260328163632";import{B as d,g as v}from"./naive-ui.js?v=20260328163632";import{k as m,r as y,c as f,O as x,an as k,o as w,V as b,W as h,Y as g}from"./base-lib.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";import"./index88.js?v=20260328163632";const j={class:"p-20px"},_=p(m({__name:"detail",props:{compData:{default:{}}},setup(p,{expose:m}){var _;const q=p,{refreshFilesList:D}=u(),C=y((null==(_=q.compData)?void 0:_.downinfo)||q.compData),I={labelStyle:"min-width: 100px"},z=y({label:e("分享名称"),attrs:I,children:[{type:"input",key:"ps",attrs:{class:"!w-300px",readonly:!0}}]}),B=f((()=>({label:e("分享外链"),attrs:I,children:[{type:"input",key:"link",attrs:{class:"!w-300px mr-10px",readonly:!0}},{type:"custom",key:"copy",render:()=>x(d,{type:"primary",onClick:()=>{a({value:F.value.link})}},{default:()=>[x("i",{class:"svgtofont-icon-copy text-white text-14px"},null)]})},{type:"custom",key:"copy",render:()=>x(v,{class:"item",trigger:"hover",placement:"top-start"},{default:()=>x(k("bt-qrcode"),{value:F.value.qrcode,size:110,class:"p-[8px]"},null),trigger:()=>x(d,{class:"ml-10px",type:"primary"},{default:()=>[x("i",{class:"svgtofont-el-qrcode text-white text-1.4rem"},null)]})})}]}))),M=f((()=>({label:e("提取码"),attrs:I,children:[{type:"input",key:"code",attrs:{class:"!w-240px mr-10px",readonly:!0}},{type:"button",key:"codeBtn",attrs:{type:"primary",class:"share-copy-btn",title:e("复制链接及提取码"),buttonText:e("复制链接及提取码"),onClick:()=>{a({value:"链接：".concat(F.value.link," 提取码：").concat(F.value.code)})}}}]}))),O=f((()=>({label:e("过期时间"),attrs:I,children:[{type:"custom",key:"expire",render:()=>x("div",null,[t(F.value.time)])}]}))),W=y({formAttrs:{labelWidth:"auto"},formItems:[]}),Y=f((()=>{var e;return W.value.formItems=[z.value,B.value,...(null==(e=C.value)?void 0:e.password)?[M.value]:[],O.value],W.value})),[A,F,H]=s(Y);return w((()=>{var e;C.value=(null==(e=q.compData)?void 0:e.downinfo)||q.compData,Object.assign(F.value,{ps:C.value.ps,link:location.origin+"/down/"+C.value.token,code:C.value.password||"",time:C.value.expire,qrcode:location.origin+"/down/"+C.value.token+"?fname="+C.value.ps+"&down=true"})})),m({onConfirm:async a=>{await o({title:e("取消分享【{0}】",[F.value.ps]),content:e("您真的要取消分享【{0}】吗？",[F.value.ps])}),await r({loading:e("正在关闭分享链接，请稍后..."),request:i({id:C.value.id}),success:e=>{var t;n.request(e),e.status&&a(),D(),(null==(t=C.value)?void 0:t.refresh)&&C.value.refresh()}})}}),(e,a)=>(b(),h("div",j,[x(g(A)),x(g(l),{options:g(c)},null,8,["options"])]))}}),[["__scopeId","data-v-9d966069"]]);export{_ as default};
