import{_ as B}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 T}from"./BasicForm-dL_oCSPM.js";import{u as v}from"./useForm-CKmgcynv.js";import{V as m,d as V,f as y,r as C,c as F,o as N,l as n,w as O,j}from"./index-9PRMimni.js";import{n as q}from"./riskAssessment-BQgT9XET.js";import{u as P}from"./useModal-CO65vga3.js";const{t:c}=m();function G(){return{schemas:[{field:"name",component:"NInput",label:c("Risk Name"),componentProps:{disabled:!1},rules:[{required:!0,validator:(r,e)=>e!=null,message:c("common.inputText")+" "+c("hsqe.cdi.inspectionId"),trigger:["blur","change"]}]}]}}const E=V({__name:"Modal",emits:["success","changeResult"],setup(u,{expose:r,emit:e}){const d=e,{t:o}=m(),{schemas:p}=G(),f=y(),s=C(""),[h,{openModal:_,closeModal:g,setProps:b,setSubLoading:x}]=P({title:o("common.addText"),subBtuText:o("common.okText"),cancelText:o("common.cancelText"),width:650}),[M,{submit:l,getFieldsValue:R}]=v({schemas:p,labelWidth:"auto",layout:"horizontal",gridProps:{cols:1,xGap:15},showActionButtonGroup:!1});async function k(t){s.value=t,_()}async function w(){if(!await l())return;let i={...R(),projectId:f.query.projectId,baseId:s.value!==""?s.value:void 0},a=await q(i);x(!1),g(),d("success",a)}function I(){}return r({showModal:k,setProps:b,submit:l}),(t,i)=>{const a=B;return N(),F(a,{ref:"modalRef",onRegister:n(h),class:"basicModal basicFormModal",onOnOk:w,onOnClose:I},{default:O(()=>[j(n(T),{onRegister:n(M),"label-placement":"top"},null,8,["onRegister"])]),_:1},8,["onRegister"])}}});export{E as _};
