index-10f631dd.js 4.1 KB

1
  1. import{P as O,V as W}from"./vue3-pdf-embed-3a5703cb.js";import{b as G,f,r as I,o as v,c as y,a as o,i as t,w as n,j as s,F as D,p as K,s as Q,l as _,t as X,v as u,x as Y,m as Z,_ as tt,q as et,y as nt,z as ot}from"./index-e497b666.js";import{e as M,c as st}from"./Task-28f1f3c2.js";import{g as at,_ as lt}from"./Certificate-813c5f89.js";import{u as _t,_ as ct,a as it}from"./index-f2c1e765.js";import{_ as ut}from"./PageHeader-74caddbf.js";import{_ as rt}from"./Scrollbar-cb9be281.js";import{_ as dt}from"./Popconfirm-7119bd46.js";import{_ as pt}from"./Space-84278c21.js";import"./vue.runtime.esm-bundler-8d6a0dde.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(""),r=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|`,z()}catch(e){console.log(e)}},z=async()=>{try{const{data:e}=await M({T_task_id:m.T_task_id,T_pdf3:r.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),r.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=ut,i=Z,C=tt,j=dt,q=pt,E=lt,$=K,T=ct,F=it,L=et,R=rt,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,u(a.split("&")[2]),1),o("td",null,u(a.split("&")[3]),1),o("td",null,u(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(j,{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(()=>[_(u(s(r).T_name),1)]),_:1}),t(T,{label:"创建时间"},{default:n(()=>[_(u(s(r).CreateTime),1)]),_:1}),t(T,{label:"修改时间"},{default:n(()=>[_(u(s(r).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};