import{_ as R}from"./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";import"./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";import{B as k}from"./BasicForm-dL_oCSPM.js";import{c as C}from"./vesselsCertificate-Hd_5oIk8.js";import{V as n,bk as B,d as T,c as b,o as y,l as a,w as M,j as v,cZ as O,ac as F}from"./index-9PRMimni.js";import{u as S}from"./useForm-CKmgcynv.js";import{u as V}from"./useModal-CO65vga3.js";B();const{t:o}=n();function P(){return[{field:"id",hidden:!0},{field:"remark",component:"NInput",label:o("vesselsCertificate.cancellationRemark"),giProps:{span:3},componentProps:{placeholder:o("vesselsCertificate.cancellationRemark"),type:"textarea",showCount:!0,maxlength:100,autosize:{minRows:3,maxRows:3}},rules:[{required:!0,message:o("vesselsCertificate.cancellationRemarkRequired")}]}]}const Z=T({__name:"index",emits:["refresh"],setup(q,{expose:c,emit:r}){const{t:s}=n(),i=O(),l=r,[m,{submit:u,setFieldsValue:f}]=S({schemas:P(),layout:"horizontal",gridProps:{cols:3}}),[p,{openModal:d,closeModal:h,setSubLoading:t}]=V({title:s("vesselsCertificate.cancelTitle"),subBtuText:s("common.confirmText"),cancelText:s("common.cancelText"),width:600});async function _(){try{const e=await u();if(!e){t(!1);return}await C({...e}),i.success(s("vesselsCertificate.cancelSuccessText")),t(!1),l("refresh"),h()}catch{t(!1)}}async function g({record:e}){d(),await F(),f({id:e.id})}return c({handleOpenModal:g}),(e,z)=>{const x=k,w=R;return y(),b(w,{onRegister:a(p),"show-icon":"",type:"warning",onOnOk:_},{default:M(()=>[v(x,{onRegister:a(m),showActionButtonGroup:!1},null,8,["onRegister"])]),_:1},8,["onRegister"])}}});export{Z as _};
