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{V as c,d as T,c as F,o as N,l as a,w as S,j as y,ac as I,cZ as P}from"./index-9PRMimni.js";import{i as q}from"./storageLocation-CpgPSQOH.js";import{u as v}from"./useForm-CKmgcynv.js";import{u as V}from"./useModal-CO65vga3.js";const{t:o}=c(),A=()=>({schemas:[{field:"shipId",hidden:!0},{field:"warehouseType",label:o("storageLocation.storageLocation"),component:"BasicSelect",componentProps:{block:!0,cacheKey:"storage_location_category"},rules:[{required:!0,message:o("storageLocation.storageLocationRequired"),trigger:"blur"}]},{field:"warehouseName",label:o("storageLocation.storageLocationName"),component:"NInput",componentProps:{},rules:[{required:!0,message:o("storageLocation.storageLocationNameRequired"),trigger:"blur"}]},{field:"remark",label:o("storageLocation.remark"),component:"NInput",componentProps:{}}]}),z=T({__name:"Modal",emits:["success"],setup(n,{expose:r,emit:i}){const l=i,{t:s}=c(),m=P(),{schemas:u}=A(),[d,{getFieldsValue:p,setFieldsValue:g,validate:f}]=v({gridProps:{cols:"1",xGap:"15"},labelWidth:80,schemas:u,showAdvancedButton:!1}),[h,{openModal:_,closeModal:b,setProps:L,setSubLoading:t}]=V({title:s("storageLocation.addStorageLocation"),subBtuText:s("common.saveText"),cancelText:s("common.cancelText"),width:450});function w(e){_(),console.log(e),I(()=>{g({shipId:e})})}async function x(){f().then(async()=>{const e=p();await q(e),t(!1),m.success(s("common.optionsAddSuccessText")),l("success"),b()}).catch(()=>{t(!1)})}return r({showModal:w,setProps:L}),(e,O)=>{const B=k,M=R;return N(),F(M,{ref:"modalRef",onRegister:a(h),class:"basicModal basicFormModal",onOnOk:x},{default:S(()=>[y(B,{onRegister:a(d),showActionButtonGroup:!1,showSubmitButton:!1,showResetButton:!1,ref:"formRef"},null,8,["onRegister"])]),_:1},8,["onRegister"])}}});export{z as _};
