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 l,d as V,f as y,r as C,c as F,o as N,w as O,j,l as r}from"./index-9PRMimni.js";import{n as q}from"./riskAssessment-BQgT9XET.js";import{u as P}from"./useModal-CO65vga3.js";import"./Render.vue_vue_type_script_lang-DKUYY0Zw.js";import"./SingleImageUpload-CNx4b9eC.js";import"./ImageUpload.vue_vue_type_style_index_0_scoped_cb086928_lang-D-28kXvw.js";import"./componentSetting-DVhNDBTO.js";import"./ImageUpload-DUsnro3W.js";import"./vuedraggable.umd-Co2xEC3p.js";import"./BasicUpload.vue_vue_type_style_index_0_scoped_a4d0e930_lang-DxRbtP01.js";import"./tabsView-BXskTdVh.js";import"./BasicForm.vue_vue_type_style_index_0_scoped_b9e995ec_lang-CEvcLwxD.js";import"./propTypes-CebMRUpe.js";import"./BasicSelect-C_uwzMkE.js";import"./BasicSelect.vue_vue_type_style_index_0_scoped_772d51cc_lang-Brp6PjEU.js";import"./dictionary-BRse4lkf.js";import"./index-DkvzUEqh.js";import"./index-kKnqLkWM.js";import"./AutoComplete-Dv1Bqed4.js";import"./TreeSelect-BZh2DeCh.js";import"./usePageCache-DluHn7Yy.js";const{t:n}=l();function G(){return{schemas:[{field:"name",component:"NInput",label:n("Risk Name"),componentProps:{disabled:!1},rules:[{required:!0,validator:(i,o)=>o!=null,message:n("common.inputText")+" "+n("hsqe.cdi.inspectionId"),trigger:["blur","change"]}]}]}}const co=V({__name:"Modal",emits:["success","changeResult"],setup(p,{expose:i,emit:o}){const u=o,{t:e}=l(),{schemas:d}=G(),f=y(),t=C(""),[h,{openModal:_,closeModal:g,setProps:b,setSubLoading:x}]=P({title:e("common.addText"),subBtuText:e("common.okText"),cancelText:e("common.cancelText"),width:650}),[M,{submit:m,getFieldsValue:R}]=v({schemas:d,labelWidth:"auto",layout:"horizontal",gridProps:{cols:1,xGap:15},showActionButtonGroup:!1});async function k(s){t.value=s,_()}async function w(){if(!await m())return;let c={...R(),projectId:f.query.projectId,baseId:t.value!==""?t.value:void 0},a=await q(c);x(!1),g(),u("success",a)}function I(){}return i({showModal:k,setProps:b,submit:m}),(s,c)=>{const a=B;return N(),F(a,{ref:"modalRef",onRegister:r(h),class:"basicModal basicFormModal",onOnOk:w,onOnClose:I},{default:O(()=>[j(r(T),{onRegister:r(M),"label-placement":"top"},null,8,["onRegister"])]),_:1},8,["onRegister"])}}});export{co as default};
