import{P as O,V as W}from"./vue3-pdf-embed-7218e977.js";import{n as G,b as f,r as I,o as v,c as y,a as o,f as t,w as n,g as s,F as D,l as K,p as Q,i as _,q as X,t as r,s as Y,j as Z,_ as tt,m as et,v as nt,x as ot}from"./index-bb1600c6.js";import{e as M,a as st}from"./Task-1669c287.js";import{g as at,_ as lt}from"./Certificate-e8c83fb1.js";import{u as _t}from"./index-c989a1ed.js";import{_ as ct}from"./PageHeader-30187700.js";import{_ as it,a as rt}from"./vue.runtime.esm-bundler-fa263698.js";import{_ as ut}from"./Scrollbar-175ce688.js";import{_ as dt}from"./Popconfirm-868a37b3.js";import{_ as pt}from"./Space-6807f258.js";import"./get-slot-1efb97e5.js";const ft={class:"h-full flex flex-col gap-y-3"},mt={class:"flex-1 grid grid-cols-2 gap-x-3"},gt={class:"flex flex-col gap-y-3"},ht={class:"self-end"},Tt=o("thead",null,[o("tr",null,[o("th",null,"布局编号"),o("th",null,"设备编号"),o("th",null,"证书有效期"),o("th",null,"备注"),o("th",null,"操作")])],-1),kt={class:"flex flex-col gap-y-3"},vt={class:"flex justify-end"},Nt={__name:"index",setup(yt){const{height:P}=_t(),m=window.sessionStorage.getItem("task")?JSON.parse(window.sessionStorage.getItem("task")):{},w=G(),x=f(null),b=f(""),u=f({}),p=f([]),d=I({title:"",showModal:!1}),c=I({T_sn:null,T_pdf3:""}),S=()=>{x.value.print()},V=e=>{b.value=e.split("&")[0]},N=async e=>{try{const l=p.value.filter(i=>i!==e),{data:h}=await M({T_task_id:m.T_task_id,T_pdf3:l.join("|")});w.success(h.Msg),g()}catch(l){console.log(l)}},B=()=>{d.title="添加设备",d.showModal=!0},U=async()=>{try{const{data:e}=await at({T_sn:c.T_sn});c.T_pdf3=`${e.Data.T_pdf}&${e.Data.Id}&${e.Data.T_Certificate_sn}&${e.Data.T_failure_time}&1|`,j()}catch(e){console.log(e)}},j=async()=>{try{const{data:e}=await M({T_task_id:m.T_task_id,T_pdf3:u.value.T_pdf3+c.T_pdf3});w.success(e.Msg),g()}catch(e){console.log(e)}},g=async()=>{try{const{data:e}=await st({T_task_id:m.T_task_id});console.log(e),u.value=e.Data||{},p.value=e.Data.T_pdf3.split("|").filter(l=>l),console.log(p.value)}catch(e){console.log(e)}};return g(),(e,l)=>{const h=ct,i=Z,C=tt,z=dt,q=pt,E=lt,$=K,T=it,F=rt,L=et,R=ut,A=nt,H=ot,J=Q;return v(),y(D,null,[o("div",ft,[t(h,{onBack:e.$router.back},{title:n(()=>[_(" 校准证书 ")]),_:1},8,["onBack"]),o("div",mt,[t($,null,{default:n(()=>[o("div",gt,[o("div",ht,[t(i,{type:"primary",onClick:B},{default:n(()=>[_("添加")]),_:1})]),t(E,{bordered:!1},{default:n(()=>[Tt,o("tbody",null,[(v(!0),y(D,null,X(s(p),a=>(v(),y("tr",{key:a},[o("td",null,[t(C,{value:a.split("&")[1],"onUpdate:value":k=>a.split("&")[1]=k,type:"text"},null,8,["value","onUpdate:value"])]),o("td",null,r(a.split("&")[2]),1),o("td",null,r(a.split("&")[3]),1),o("td",null,r(a.split("&")[4]),1),o("td",null,[t(q,null,{default:n(()=>[t(i,{type:"primary",onClick:k=>V(a)},{default:n(()=>[_("查看")]),_:2},1032,["onClick"]),t(z,{onPositiveClick:k=>N(a)},{trigger:n(()=>[t(i,{type:"error"},{default:n(()=>[_("删除")]),_:1})]),default:n(()=>[_(" 是否确认删除？ ")]),_:2},1032,["onPositiveClick"])]),_:2},1024)])]))),128))])]),_:1})])]),_:1}),t($,null,{default:n(()=>[o("div",kt,[t(F,{bordered:""},{default:n(()=>[t(T,{label:"报告名称"},{default:n(()=>[_(r(s(u).T_name),1)]),_:1}),t(T,{label:"创建时间"},{default:n(()=>[_(r(s(u).CreateTime),1)]),_:1}),t(T,{label:"修改时间"},{default:n(()=>[_(r(s(u).UpdateTime),1)]),_:1})]),_:1}),o("div",vt,[t(i,{text:"",style:{"font-size":"24px"},onClick:S},{default:n(()=>[t(L,null,{default:n(()=>[t(s(O))]),_:1})]),_:1})]),t(R,{style:Y({maxHeight:`${s(P)-380}px`}),trigger:"none"},{default:n(()=>[t(s(W),{ref_key:"pdfRef",ref:x,source:s(b)},null,8,["source"])]),_:1},8,["style"])])]),_:1})])]),t(J,{"show-icon":!1,show:s(d).showModal,"onUpdate:show":l[1]||(l[1]=a=>s(d).showModal=a),preset:"dialog",title:s(d).title,"positive-text":"确认","negative-text":"取消",onPositiveClick:U},{default:n(()=>[t(H,{model:s(c),"label-width":"auto","show-require-mark":""},{default:n(()=>[t(A,{label:"SN",path:"T_sn"},{default:n(()=>[t(C,{value:s(c).T_sn,"onUpdate:value":l[0]||(l[0]=a=>s(c).T_sn=a)},null,8,["value"])]),_:1})]),_:1},8,["model"])]),_:1},8,["show","title"])],64)}}};export{Nt as default};
