import{i as e,t}from"./react-B8IZ02wI.js";import{t as n}from"./button-DqbiydrF.js";import{i as r}from"./DocPrintSheet-nXlmIVdf.js";import{x as i}from"./authStore-BvQBJ9ky.js";import{kn as a,lt as o,n as s}from"./index-Bg7bo8aA.js";import{t as c}from"./HandoverDocView-AB21e79B.js";var l=e(t(),1),u=s();function d(){let{id:e}=a(),[t,s]=(0,l.useState)(null),[d,f]=(0,l.useState)(!0);return(0,l.useEffect)(()=>{document.body.classList.add(`print-document-body`);let e=document.title;return document.title=`数字资产离职交割单`,()=>{document.body.classList.remove(`print-document-body`),document.title=e}},[]),(0,l.useEffect)(()=>{e&&i.handover(Number(e)).then(e=>s({...e.data,isDraft:!1})).finally(()=>f(!1))},[e]),d?(0,u.jsx)(`div`,{className:`print-document-root`,children:(0,u.jsx)(o,{style:{display:`block`,margin:`80px auto`}})}):t?(0,u.jsxs)(`div`,{className:`print-document-root`,style:{maxWidth:900,margin:`0 auto`,padding:24,background:`#fff`},children:[(0,u.jsx)(`div`,{className:`no-print`,style:{marginBottom:16,textAlign:`right`},children:(0,u.jsx)(n,{type:`primary`,icon:(0,u.jsx)(r,{}),onClick:()=>window.print(),children:`打印 / 另存为 PDF`})}),(0,u.jsx)(c,{doc:t})]}):(0,u.jsx)(`div`,{className:`print-document-root`,style:{padding:24},children:`交割单不存在`})}export{d as default};