import{l as I}from"./template-rpthWlT9.js";import{g as u}from"./helper-DAsjAERN.js";import g from"./ExportTable-DVFKlzsK.js";import{d as k,V as C,a as R,a4 as V,aw as A,h as i,o,i as a,A as r,l as f,F as _,a9 as b,j as L,v as D}from"./index-9PRMimni.js";import"./index-kKnqLkWM.js";function x(d=[]){return d.map(e=>({label:e.name??e.label,value:e.id??e.value,labelEn:e.nameEn??e.labelEn,subList:e.children??e.subList??[],type:e.type}))}const E={class:"border-b-[1px] border-solid border-[#000] pt-[25px] pb-[35px]"},j={class:"text-[18px] text-[#191919] inline-block mb-[17px] font-semibold"},q={class:"flex flex-col gap-y-[28px]"},B={class:"flex flex-col gap-y-[17px] font-semibold"},N={class:"text-[16px] text-[#000]"},T={class:"flex flex-col gap-y-4 mt-[17px]"},F={class:"flex items-center gap-x-[8px] mb-[11px]"},M={class:"text-[14px] text-[#404040]"},O=k({__name:"index",props:{causeData:{}},setup(d){const{t:e}=C(),c=R({substandard_acts:[],substandard_condition:[],personal_factors:[],job_factors:[]}),y={deficiency_substandard_acts:"substandard_acts",deficiency_substandard_conditions:"substandard_condition",deficiency_personal_factors:"personal_factors",deficiency_job_factor:"job_factors"},h=V(()=>[{title:e("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.causeAnalysis.cause"),key:"causeId",align:"left",width:240,ellipsis:!1,render:s=>{const t=y[s.causeType];if(!t)return"";const n=c[t]?.find(l=>l.value===s.causeId);return s.causeId&&(s.deficiencyChangeList=x(n?.subList||[])),u(n)}},{title:e("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.causeAnalysis.subCause"),key:"subCauseId",width:240,render:s=>{const t=s?.deficiencyChangeList?.find(n=>n.value===s?.subCauseId);return u(t)}},{title:e("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.causeAnalysis.remark"),key:"remark"}]);async function m(){const s=await I({});for(const t in c)c[t]=x(s[t])}return A(()=>{m()}),(s,t)=>(o(),i("div",E,[a("label",j,r(f(e)("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.causeAnalysis.analysis")),1),a("main",q,[(o(!0),i(_,null,b(s.causeData,(n,l)=>(o(),i("div",{key:l},[a("header",B,[a("label",N,r(n.title),1)]),a("main",T,[(o(!0),i(_,null,b(n.data,(p,v)=>(o(),i("div",{key:v},[a("div",F,[t[0]||(t[0]=a("div",{class:"h-[14px] border-l-[4px] border-l-[#195cf1]"},null,-1)),a("label",M,r(p.title),1)]),L(g,{columns:f(h),data:p.data},null,8,["columns","data"])]))),128))])]))),128))])]))}}),H=D(O,[["__scopeId","data-v-5de03fc1"]]);export{H as default};
