import{r as w,V as P,bk as H,d as V,f as $,aw as E,c as b,o as m,X as G,w as i,i as h,j as v,h as M,cS as j,N as z,l as d,gU as R,A as _,cZ as L}from"./index-9PRMimni.js";import{B as W}from"./BasicForm-dL_oCSPM.js";import{f as T}from"./dateUtil-BtafrT1f.js";import{u as U}from"./useForm-CKmgcynv.js";const X=H(),{t:o}=P();console.log(X.getLocale);function Y(){const p=w(!1),y=w(!1);return{schemas:[{cardProps:{headerClass:"pl-0 pt-0",contentStyle:"padding: 10px 0 0px 0",contentClass:"pt-0",bordered:!1,hoverable:!1},columns:[{field:"actionTaken",component:"NInput",label:o("hsqe.nearMiss.ActionTaken"),componentProps:()=>({type:"textarea",disabled:p.value,maxlength:100,showCount:!0}),rules:[{required:!0,validator:(a,r)=>r!=null,message:`${o("hsqe.nearMiss.ActionTaken")} ${o("common.required")}`,trigger:["blur","change"]}],giProps:{span:3}},{field:"preventiveAction",component:"NInput",label:o("hsqe.nearMiss.PreventiveAction"),componentProps:()=>({type:"textarea",disabled:p.value,maxlength:300,showCount:!0}),rules:[{required:!0,validator:(a,r)=>r!=null,message:`${o("hsqe.nc.require")} ${o("common.required")}`,trigger:["blur","change"]}],giProps:{span:3}},{field:"masterDate",component:"NDatePicker",label:o("hsqe.nc.Date"),componentProps:()=>({disabled:!0,valueFormat:"yyyy-MM-dd HH:mm:ss",type:"datetime"})},{field:"masterSignature",slot:"master",label:o("hsqe.nearMiss.MasterSignature")}]},{cardProps:{headerClass:"pl-0 pt-0",contentStyle:"padding: 10px 0 0px 0",contentClass:"pt-0",bordered:!1,hoverable:!1},columns:[{field:"correction",component:"NInput",label:o("hsqe.nearMiss.TheCorrection"),componentProps:()=>({type:"textarea",disabled:!0,maxlength:300,showCount:!0}),giProps:{span:6}},{field:"suptDate",component:"NDatePicker",label:o("hsqe.nc.Date"),componentProps:()=>({disabled:!0,valueFormat:"yyyy-MM-dd HH:mm:ss",type:"date"})},{field:"suptSignature",slot:"marine",label:o("hsqe.nearMiss.MarineTech")}]}],methods:{setReadOnly:a=>{p.value=a},setReviewReadOnly:a=>{y.value=a}}}}const Z={class:"border-b border-[#E2E8F0E6] w-full"},J={class:"text-[clamp(1.1rem,1.5vw,1.25rem)] font-medium text-slate-700 text-left"},K={key:1},Q={key:1},ne=V({__name:"index",props:{btnsDisabled:{type:Object,default:()=>({export:!1,formApproval:!1,formReject:!1,formSave:!1,formSubmit:!0,submit:!1})}},emits:["getComData"],setup(p,{expose:y}){const f=$(),{t:g}=P(),a=L(),r=w(!1),{schemas:k,methods:S}=Y(),{setReadOnly:x,setReviewReadOnly:B}=S,[C,{getFieldsValue:O,setFieldsValue:I,submit:N}]=U({gridProps:{cols:6,xGap:15},collapsed:!1,collapsedRows:12,labelWidth:80,layout:"horizontal",submitButtonText:"sure",showActionButtonGroup:!1,showSubmitButton:!1,showResetButton:!1}),A=p;async function D(s){s&&(s.masterDate=s.masterDate?T(s.masterDate,"yyyy-MM-dd HH:mm:ss"):void 0,s.suptDate=s.suptDate?T(s.suptDate,"yyyy-MM-dd HH:mm:ss"):void 0,I(s)),f.query.type==="view"||A.btnsDisabled.formApproval?x(!0):x(!1),B(!0),f.query.isEdit||(r.value=!0)}async function F(s){const n=O(),l={rectifyTime:"",...n,deficiencyId:f.query.id};if("rectifyTime"in n&&n.rectifyTime){let u=new Date(n.rectifyTime),e=u.getMonth()+1;e=e<10?`0${e}`:e;let t=u.getDate();t=t<10?`0${t}`:t,n.rectifyTime==="undefined"?l.rectifyTime="":l.rectifyTime=u.getFullYear()+"-"+e+"-"+t+"T00:00:00"}let c=!0;return!await N()&&s?(c=!1,a.warning(g("hsqe.nc.actionVerification")),!1):(c=!0,{params:l,res:c})}return E(()=>{D()}),y({getData:F,initData:D}),(s,n)=>{const l=z,c=j,q=W,u=G;return m(),b(u,null,{default:i(()=>[h("div",null,[v(q,{group:d(k),onRegister:d(C)},{line:i(()=>n[0]||(n[0]=[h("div",{class:"w-full h-[1px]"},null,-1)])),preventiveLine:i(()=>[h("div",Z,[h("h2",J,_(d(g)("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.action.preventiveAction")),1)])]),master:i(({model:e,field:t})=>[e[t]&&e[t].indexOf("http")>-1?(m(),b(c,{key:0,width:"100",src:e[t],"preview-disabled":""},{error:i(()=>[v(l,{size:80,color:"lightGrey",component:d(R)},null,8,["component"])]),_:2},1032,["src"])):(m(),M("span",K,_(e[t]),1))]),marine:i(({model:e,field:t})=>[e[t]&&e[t].indexOf("http")>-1?(m(),b(c,{key:0,width:"100",src:e[t],"preview-disabled":""},{error:i(()=>[v(l,{size:80,color:"lightGrey",component:d(R)},null,8,["component"])]),_:2},1032,["src"])):(m(),M("span",Q,_(e[t]),1))]),_:1},8,["group","onRegister"])])]),_:1})}}});export{ne as _};
