import{a as y}from"./dateUtil-BtafrT1f.js";import{V as d,bk as h,Z as s,ae as c}from"./index-9PRMimni.js";function f(i){return i=i.replace("#",""),i.length===3&&(i=i.split("").map(o=>o+o).join("")),i.toUpperCase()}function u(i,o=1){if(!i)return"";const a=f(i),l=Math.round(Math.max(0,Math.min(1,o))*255).toString(16).padStart(2,"0").toUpperCase();return`#${a}${l}`}const p=h(),{t:e}=d();function m(i={}){const o=(t,n)=>{const r={excellent:"#3FC33F",good:"#1DCCB7",pass:"#9463E2",poor:"#D24C4C"};return r[t]?s(c,{color:{color:u(r[t],.12),borderColor:u(r[t],.5),textColor:u(r[t],1)}},n):n},a=[{key:1,value:e("hsqe.auditInspection.qualitySafetyInspection.reportStatusList.inProgress"),color:{color:"rgba(23,182,235,0.12)",textColor:"#17B6EB",borderColor:"rgba(23,182,235,0.5)"}},{key:2,value:e("hsqe.auditInspection.qualitySafetyInspection.reportStatusList.inProgress"),color:{color:"rgba(23,182,235,0.12)",textColor:"#17B6EB",borderColor:"rgba(23,182,235,0.5)"}},{key:3,value:e("hsqe.auditInspection.qualitySafetyInspection.reportStatusList.completed"),color:{color:"rgba(63,195,63,0.12)",textColor:"#3FC33F",borderColor:"rgba(63,195,63,0.5)"}}],l=[{title:e("hsqe.planner.no"),key:"num",width:80,render:(t,n)=>n+1},{title:e("hsqe.auditInspection.qualitySafetyInspection.reportNo"),key:"reportNum",width:150},{title:e("hsqe.auditInspection.qualitySafetyInspection.vessel"),key:p.getLocale==="en"?"shipNameEn":"shipName",width:150},{title:e("hsqe.auditInspection.qualitySafetyInspection.reportBy"),key:"reportBy",width:150},{title:e("hsqe.auditInspection.qualitySafetyInspection.totalScore"),key:"allTotalScore",width:150,render(t){return t.allTotalScore?s(c,{type:"info"},t.allTotalScore):""}},{title:e("hsqe.auditInspection.qualitySafetyInspection.overallRating"),key:"allRating",width:150,render:t=>o(t.allRatingCode,p.getLocale==="en"?t.allEnRating:t.allRating)},{title:e("hsqe.auditInspection.qualitySafetyInspection.reportDate"),key:"create_time",width:150},{title:e("hsqe.auditInspection.qualitySafetyInspection.visitDate"),key:"visitDate",width:150},{title:e("hsqe.auditInspection.qualitySafetyInspection.reportStatus"),key:"approveStatus",width:150,render(t){return s(c,{color:a.find(n=>n.key===t.approveStatus)?.color},{default:()=>a.find(n=>n.key===t.approveStatus)?.value})}}];return{deficiencyColumns:[{title:e("hsqe.planner.no"),key:"num",width:80,render:(t,n)=>n+1},{title:e("hsqe.auditInspection.qualitySafetyInspection.rectificationContent"),key:"basicDescription",width:150},{title:e("hsqe.auditInspection.qualitySafetyInspection.rectificationPhoto"),key:"deficiencyPhotoUrl",width:150,render:t=>t.deficiencyPhotoUrl?s("img",{style:{width:"30px",height:"30px"},src:t.deficiencyPhotoUrl,onClick:()=>{i?.handlePreviewImage(t.deficiencyPhotoUrl)}}):""},{title:e("hsqe.auditInspection.qualitySafetyInspection.rectificationSuggestDate"),key:"expirationTime",width:150,render:t=>y(t.expirationTime)},{title:e("hsqe.auditInspection.qualitySafetyInspection.rectificationActualDate"),key:"rectifyTime",width:150,render:t=>t?.rectifyTime?y(t.rectifyTime):""},{title:e("hsqe.auditInspection.qualitySafetyInspection.correctDescription"),key:"correctFeedback",width:150},{title:e("hsqe.auditInspection.qualitySafetyInspection.primaryCause"),key:"rootCause",width:150},{title:e("hsqe.auditInspection.qualitySafetyInspection.rectificationSupervisorFeedback"),key:"status",width:150,render:t=>p.getLocale==="en"?t.dispStatusEnglish:t.dispStatus}],columns:l,renderScoreStatusFunc:o}}export{m as c};
