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