import{_ as S}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 R}from"./certificate-6_B4mutd.js";import{d as V,bk as A,V as F,cq as H,r,Z as g,c as U,o as u,l as e,w as a,h as p,D as E,j as c,ap as I,p as l,A as n,ao as T,aq as $,a9 as j,i as z,F as G,ds as O,cr as W}from"./index-9PRMimni.js";import{g as Z}from"./base64-BbY-I90a.js";import{u as J}from"./useModal-CO65vga3.js";const P={key:0,class:"mb-4 ml-4"},Q=["href"],ie=V({__name:"History",setup(X,{expose:w}){const f=A(),{t}=F(),y=H(),b=r(),i=r([]),_=r(!1),k=r([]),q=r(window.innerHeight-315),N=r([{title:"No.",key:"num",width:60,render:(s,d)=>d+1},{title:t("hsqe.certificate.IssueDate"),key:"issuedDate",width:140},{title:t("hsqe.certificate.ExpireDate"),key:"expireDate",width:140},{title:t("hsqe.certificate.IssuedBy"),key:"issuedBy",width:140},{title:t("hsqe.Survey.EditBy"),key:"createByName",width:140},{title:t("hsqe.certificate.Attachment"),key:"attachment",width:140,render(s){return s.certificateHistoryAttachmentList.map(o=>g("div",{},[g("a",{onClick:()=>{const{previewUrl:h}=y;window.open(h+encodeURIComponent(Z.encode(o.fileUrl)),"_blank")}},{default:()=>o.originalFileName})]))}},{title:t("hsqe.Survey.updatedAt"),key:"createTime",width:140,render(s){return s.createTime.slice(0,10)}}]),[v,{openModal:B}]=J({title:t("hsqe.certificate.CertificateHistory"),width:1e3});async function C(s){i.value=await R(s),b.value=s,B()}return w({showModal:C}),(s,d)=>{const o=I,h=T,x=$,D=W,L=S;return u(),U(L,{ref:"modalRef",onRegister:e(v),class:"basicModal basicFormModal",showAction:!1},{default:a(()=>[e(i).length!==0?(u(),p("div",P,[c(h,{"label-placement":"left"},{default:a(()=>[c(o,null,{label:a(()=>[l(n(e(t)("hsqe.certificate.Vessel")),1)]),default:a(()=>[l(" "+n(e(f).getLocale=="en"?e(i)[0]?.shipNameEn:e(i)[0]?.shipName),1)]),_:1}),c(o,null,{label:a(()=>[l(n(e(t)("hsqe.certificate.type")),1)]),default:a(()=>[l(" "+n(e(i)[0].categoryName),1)]),_:1}),c(o,null,{label:a(()=>[l(n(e(t)("hsqe.certificate.Certificatename")),1)]),default:a(()=>[l(" "+n(e(f).getLocale=="en"?e(i)[0]?.englishName:e(i)[0]?.chineseName),1)]),_:1})]),_:1})])):E("",!0),c(x,{columns:e(N),data:e(i),pagination:!1,striped:"",height:e(q)},null,8,["columns","data","height"]),c(D,{show:e(_),"onUpdate:show":d[0]||(d[0]=m=>O(_)?_.value=m:null),class:"custom-card w-[800px]",preset:"card",title:e(t)("hsqe.certificate.Certificaturl"),size:"huge",bordered:!1,segmented:s.segmented},{default:a(()=>[(u(!0),p(G,null,j(e(k),(m,M)=>(u(),p("div",{class:"stock-nav-item ml-4 mb-1",key:M},[z("a",{href:m.fileUrl,target:"_blank"},n(m.fileName),9,Q)]))),128))]),_:1},8,["show","title","segmented"])]),_:1},8,["onRegister"])}}});export{ie as _};
