import{i as e,t}from"./react-B8IZ02wI.js";import{E as n}from"./authStore-BvQBJ9ky.js";import{ct as r,n as i,pt as a,st as o,ut as s}from"./index-Bg7bo8aA.js";var c=e(t(),1),l=i();function u({open:e,resourceType:t,resourceId:i,resourceLabel:u,onClose:d,onSuccess:f}){let[p]=a.useForm(),[m,h]=(0,c.useState)(!1);return(0,l.jsxs)(o,{title:`移入回收站`,open:e,onCancel:d,onOk:()=>p.submit(),confirmLoading:m,okText:`确认删除`,okButtonProps:{danger:!0},destroyOnHidden:!0,children:[u&&(0,l.jsxs)(`p`,{style:{marginBottom:12,color:`#6b7280`},children:[`即将删除：`,(0,l.jsx)(`b`,{children:u})]}),(0,l.jsx)(`p`,{style:{marginBottom:16,fontSize:13,color:`#9ca3af`},children:`删除后数据将进入回收站，可撤销恢复。仅超级管理员可永久删除。`}),(0,l.jsx)(a,{form:p,layout:`vertical`,onFinish:async e=>{h(!0);try{await n.trash({resource_type:t,resource_id:i,reason:e.reason}),r.success(`已移入回收站`),p.resetFields(),f(),d()}catch(e){r.error(e instanceof Error?e.message:`删除失败`)}finally{h(!1)}},children:(0,l.jsx)(a.Item,{name:`reason`,label:`删除原因`,rules:[{required:!0,message:`请填写删除原因`}],children:(0,l.jsx)(s.TextArea,{rows:3,placeholder:`请说明删除原因...`,maxLength:500,showCount:!0})})})]})}export{u as t};