12 |
- import{d as Te,f as h,b as le,o as _,c as d,i as o,w as t,l as i,j as p,m as y,a as $,F as N,t as se,A as D,v as j,k as G,r as H,B as ce,L as pe,C as de,h as fe,x as ve,D as me,s as ye,E as Z,G as ee,H as ge,I as ke,p as we}from"./index-e497b666.js";import{e as ae}from"./Task-28f1f3c2.js";import{H as be,a as he,b as xe,g as Ce,p as Ve,_ as Me}from"./VerifyTemplateMapData-c79050aa.js";import{_ as $e,a as De,F as Se,T as Ie,g as Le,u as Fe,b as je,f as Re,h as ze,d as Be,e as He}from"./FormList-eb0fbdb5.js";import{_ as Ne,a as Ue,u as Ee}from"./index-f2c1e765.js";import{_ as Je}from"./DataTable-41a24bfd.js";import{_ as Oe,a as Pe,b as qe}from"./Upload-e16a41ce.js";import{_ as te}from"./Space-84278c21.js";import{_ as Ae}from"./PageHeader-74caddbf.js";import{_ as Ke}from"./Scrollbar-cb9be281.js";import{_ as Ge}from"./Popconfirm-7119bd46.js";import"./get-slot-1efb97e5.js";import"./TaskData-11f744cb.js";import"./DatePicker-02d3d64b.js";import"./RadioGroup-6edab0a1.js";import"./Add-f2559956.js";const We={class:""},Qe={style:{display:"flex",height:"100%",overflow:"hidden"}},Xe={style:{height:"100%","overflow-y":"auto"}},Ye={key:0,style:{flex:"1",padding:"0 20px","overflow-y":"auto"}},Ze={key:0},ea={key:1,style:{color:"red"}},aa={key:1},la={key:0},sa={key:1,style:{color:"red"}},ta={key:1,style:{flex:"1",display:"flex","justify-content":"center","align-items":"center",color:"#ccc",border:"1px solid rgb(239 239 245)",height:"200px","margin-left":"20px"}},oa=Te({__name:"submitlog",emits:["submitlogFun"],setup(oe,{emit:U}){const w=h(!1),x=h([]),b=async()=>{x.value=[],f.value=[];let n=window.sessionStorage.getItem("task"),v={T_task_id:JSON.parse(n).T_task_id,T_source:2};const{data:r}=await be(v);r.Code==200&&(f.value=r.Data||[]),w.value=!0,console.log("列表",r)},C=le(),f=h([]);function S({play:n,play1:T}){return[{title:"提交人",key:"T_uuid_name"},{title:"提交时间",key:"T_time"},{title:"操作",key:"actions",render(v){return G(te,{strong:!0,tertiary:!0,size:"small"},{default:()=>["查看","恢复"].map(r=>r==="查看"?G(y,{type:"primary",size:"small",onClick:()=>n(v)},{default:()=>r}):G(y,{type:"primary",size:"small",onClick:()=>T(v)},{default:()=>r}))})}}]}const E=S({async play(n){let T=window.sessionStorage.getItem("task"),v=JSON.parse(T);const{data:r}=await he({T_task_id:v.T_task_id,T_time:n.T_time,T_source:2});r.Code==200&&(x.value=r.Data||[])},async play1(n){let T=window.sessionStorage.getItem("task"),v=JSON.parse(T);const{data:r}=await xe({T_task_id:v.T_task_id,T_time:n.T_time,T_source:2});r.Code==200&&(C.success("恢复成功"),U("submitlogFun",!0))}});return(n,T)=>{const v=Je,r=Oe,u=Ne,M=Ue,J=$e,O=De;return _(),d("div",We,[o(p(y),{type:"primary",onClick:b},{default:t(()=>[i("历史提交记录")]),_:1}),o(O,{show:w.value,"onUpdate:show":T[0]||(T[0]=g=>w.value=g),"default-width":"98%",placement:"right",resizable:""},{default:t(()=>[o(J,{title:"历史提交记录",closable:!0},{default:t(()=>[$("div",Qe,[$("div",Xe,[o(v,{columns:p(E),data:f.value,bordered:!0,"single-line":!1},null,8,["columns","data"])]),x.value.length!=0?(_(),d("div",Ye,[o(M,{"label-placement":"top",size:"large",bordered:""},{default:t(()=>[(_(!0),d(N,null,se(x.value,(g,L)=>(_(),D(u,{key:L},{label:t(()=>[i(j(g.T_name),1)]),default:t(()=>[g.T_label==10||g.T_label==11?(_(),d("div",Ze,[g.T_value?(_(),D(r,{key:0,width:"20",src:g.T_value},null,8,["src"])):(_(),d("span",ea,"*"))])):(_(),d("div",aa,[g.T_value?(_(),d("span",la,j(g.T_value),1)):(_(),d("span",sa,"*"))]))]),_:2},1024))),128))]),_:1})])):(_(),d("div",ta," 暂无数据 "))])]),_:1})]),_:1},8,["show"])])}}}),_a={class:"h-full flex flex-col gap-y-3"},na={class:"flex justify-center"},xa={__name:"index",setup(oe){const{height:U}=Ee(),w=le(),x=h(null),b=h(!1),C=window.sessionStorage.getItem("task")?JSON.parse(window.sessionStorage.getItem("task")):{},f=H({pdf:"",formList:[]}),S=h("请选择"),E=async()=>{f.pdf="",S.value="请选择"},n=H({T_source:2,T_task_id:C.T_task_id,T_VerifyTemplate_id:C.T_VerifyTemplate_id});h([]);const T=ce(),v=()=>{w.success("复制成功"),T.commit("setTaskId",n.T_task_id)},r=async()=>{if(console.log("粘贴",T.state.TaskId,n.T_task_id),T.state.TaskId==""){w.error("请先复制模板,在进行粘贴哦");return}(await Ie({T_copy_task_id:T.state.TaskId,T_paste_task_id:n.T_task_id,T_source:2})).data.Code==200&&(w.success("粘贴成功"),z())},u=H({showModal:!1,title:""}),M=h();pe(()=>u.showModal,s=>{s||clearTimeout(M.value),console.log("显示q",s)});const J=async({file:s})=>{const l=await Le(s.name.split(".")[1]);S.value="上传中",Fe(s.file,s.name,l,{},{useCdnDomain:!0}).subscribe({next:m=>{console.warn(m)},error:()=>{w.error("上传失败")},complete:m=>{f.pdf=m.key,S.value="提交"}})},O=()=>{u.title="上传验证",u.showModal=!0},g=async()=>{try{const{data:s}=await ae({T_task_id:n.T_task_id,T_pdf2:f.pdf});s.Code===200&&(w.success(s.Msg),u.showModal=!1)}catch(s){console.log(s)}},L=H({obj:{}}),P=async s=>{if(L.obj=s,console.log(s),u.title=="生成报告"){const{data:l}=await Re({T_task_id:C.T_task_id,T_VerifyTemplate_id:C.T_VerifyTemplate_id,...s});l.Code===200?(b.value=!1,R(l.Data)):l.Code==501?(b.value=!0,M.value=setTimeout(()=>{P(L.obj)},1e3)):(b.value=!0,clearTimeout(M.value))}else{const{data:l}=await ze({T_task_id:C.T_task_id,T_VerifyTemplate_id:C.T_VerifyTemplate_id,...s});l.Code===200?(b.value=!1,R(l.Data)):l.Code==501?(b.value=!0,M.value=setTimeout(()=>{P(L.obj)},1e3)):(b.value=!0,clearTimeout(M.value))}};let q=0;const k=h({}),_e=de(()=>k.value.Item?(me(()=>{x.value.scrollTop=x.value.scrollHeight}),k.value.Item.split(`
- `).filter(s=>s)):[]),R=async s=>{const{data:l}=await Be({key:s}).catch(function(a){console.log("报错",a),R(s)});l.Code===600?q=setTimeout(()=>{R(s)},3e3):(console.log("其他",l),l.Schedule==100&&w.success("生成成功")),k.value=l},ne=()=>{k.value={},clearTimeout(q)},W=()=>{if(u.title=="生成报告")window.open(k.value.Data);else{const s=document.createElement("a");s.href=k.value.Data,s.target="_blank",s.click()}},Q=async s=>{let{picker1:l,picker2:a,...m}=F.value.person;console.log("提交",F.value),await ae(m);try{const I=ge(f.formList),A=I.map((e,X)=>e.T_label===3?{T_VerifyTemplateMap_id:e.T_VerifyTemplateMap_id,T_value:e.T_value.length!=0?e.T_value.join("|"):"",T_source:e.T_source,T_flow_sort:e.T_flow_sort,T_max_time:e.T_max_time,T_min_time:e.T_min_time}:e.T_label===9?{T_VerifyTemplateMap_id:e.T_VerifyTemplateMap_id,T_value:e.T_value!=null?e.T_value.join("|"):"",T_source:e.T_source,T_flow_sort:e.T_flow_sort,T_max_time:e.T_max_time,T_min_time:e.T_min_time}:e.T_label===12?e.T_value[0]==null&&e.T_value[1]==null?{T_VerifyTemplateMap_id:e.T_VerifyTemplateMap_id,T_value:"",T_source:e.T_source,T_flow_sort:e.T_flow_sort,T_max_time:e.T_max_time,T_min_time:e.T_min_time}:e.T_value[0]!=null?{T_VerifyTemplateMap_id:e.T_VerifyTemplateMap_id,T_value:`${e.T_value[0]}/${e.T_value[1]}`,T_source:e.T_source,T_flow_sort:e.T_flow_sort,T_max_time:e.T_max_time,T_min_time:e.T_min_time}:{T_VerifyTemplateMap_id:e.T_VerifyTemplateMap_id,T_value:`/${e.T_value[1]}`,T_source:e.T_source,T_flow_sort:e.T_flow_sort,T_max_time:e.T_max_time,T_min_time:e.T_min_time}:e.T_label===13?e.T_value[0]==null&&e.T_value[1]==null?{T_VerifyTemplateMap_id:e.T_VerifyTemplateMap_id,T_value:"",T_source:e.T_source,T_flow_sort:e.T_flow_sort,T_max_time:e.T_max_time,T_min_time:e.T_min_time}:e.T_value[0]!=null?{T_VerifyTemplateMap_id:e.T_VerifyTemplateMap_id,T_value:`${e.T_value[0].join("|")}/${e.T_value[1]}`,T_source:e.T_source,T_flow_sort:e.T_flow_sort,T_max_time:e.T_max_time,T_min_time:e.T_min_time}:{T_VerifyTemplateMap_id:e.T_VerifyTemplateMap_id,T_value:`/${e.T_value[1]}`,T_source:e.T_source,T_flow_sort:e.T_flow_sort,T_max_time:e.T_max_time,T_min_time:e.T_min_time}:{T_VerifyTemplateMap_id:e.T_VerifyTemplateMap_id,T_value:e.T_value!=null?e.T_value+"":"",T_source:e.T_source,T_flow_sort:e.T_flow_sort,T_max_time:e.T_max_time,T_min_time:e.T_min_time}),K=ke(),{data:B}=await Ve({User_tokey:K,T_source:n.T_source,T_task_id:n.T_task_id,T_VerifyTemplate_id:n.T_VerifyTemplate_id,VerifyTemplateMapData:A});console.log("sdsd",B.Code);const c={};if(B.Code==200){for(let e of I)e.T_label===3||e.T_label===9?c[e.T_name]=e.T_value!=null?e.T_value.join("|"):"":e.T_label===12?(console.log("打印12",e.T_value),e.T_value[0]==null&&e.T_value[1]==""?(console.log("12",e.T_value),c[e.T_name]=""):(e.T_value[0]==null&&e.T_value[1]!=null?c[e.T_name]="/"+e.T_value[1]:e.T_value[0]!=null&&e.T_value[1]==null?c[e.T_name]=e.T_value[0]+"/":c[e.T_name]=e.T_value[0]+"/"+e.T_value[1],console.log("打印arr22222",c[e.T_name]))):e.T_label===13?(console.log("等于时间",e.T_value[0]!=null,e.T_value[1]!=null),e.T_value[0]!=null&&e.T_value[1]!=null?c[e.T_name]=`${e.T_value[0].join("|")+"/"+e.T_value[1]}`:e.T_value[0]!=null&&e.T_value[1]==null?c[e.T_name]=`${e.T_value[0].join("|")+"/"}`:e.T_value[0]==null&&e.T_value[1]!=null?c[e.T_name]=`${"/"+e.T_value[1]}`:c[e.T_name]=""):c[e.T_name]=e.T_value;u.title=s,u.showModal=!0,P(c)}}catch(I){console.log(I)}},F=h(),z=async()=>{try{const{data:s}=await Ce(n);let l=s.Data;l.forEach(a=>{a.T_label===3?a.T_value==""||a.T_value==null?a.T_value=[]:(a.T_value=a.T_value.split("|"),a.T_value.push("123EFCF")):a.T_label==9?a.T_value==""||a.T_value==null?a.T_value=null:a.T_value=a.T_value.split("|"):a.T_label===12?a.T_value==""||a.T_value==null?a.T_value=[null,null]:a.T_value.split("/")[0]==""?a.T_value=[null,a.T_value.split("/")[1]]:a.T_value=[a.T_value.split("/")[0],a.T_value.split("/")[1]]:a.T_label===13?a.T_value==""||a.T_value==null?a.T_value=[null,null]:a.T_value.split("/")[0]==""?a.T_value=[null,a.T_value.split("/")[1]]:a.T_value=[a.T_value.split("/")[0].split("|"),a.T_value.split("/")[1]]:a.T_value=a.T_value?a.T_value:null}),f.formList=ue(l)}catch(s){console.log(s)}},ue=s=>{for(const l of s)l.T_label==3&&(l.T_value=l.T_value.filter(a=>F.value.classList.some(m=>m.T_sn===a))),l.T_label==4&&(F.value.classList.some(m=>m.T_sn===l.T_value)||(l.T_value="")),l.T_label==11&&(l.T_value=`https://coldverifylocal.coldbaozhida.com/CAD2/download/image/${n.T_task_id}_${n.T_VerifyTemplate_id}_${l.T_id}.png`);return s};return fe(()=>{clearTimeout(q)}),z(),(s,l)=>{const a=Ge,m=te,I=Ae,A=Ke,K=Pe,B=qe,c=He,e=je,X=Me,re=we,ie=ye;return _(),d(N,null,[$("div",_a,[o(I,{onBack:s.$router.back},{title:t(()=>[i(" 报告生成 ")]),extra:t(()=>[o(m,null,{default:t(()=>[o(oa,{onSubmitlogFun:l[0]||(l[0]=V=>z())}),o(a,{onPositiveClick:l[1]||(l[1]=V=>Q("数据自检"))},{trigger:t(()=>[o(p(y),{type:"primary"},{default:t(()=>[i("数据自检")]),_:1})]),default:t(()=>[i(" 确认数据质检? ")]),_:1}),o(a,{onPositiveClick:l[2]||(l[2]=V=>Q("生成报告"))},{trigger:t(()=>[o(p(y),{type:"primary"},{default:t(()=>[i("生成报告")]),_:1})]),default:t(()=>[i(" 确认生成报告? ")]),_:1}),o(p(y),{type:"primary",onClick:O},{default:t(()=>[i("上传验证报告")]),_:1}),o(p(y),{type:"primary",onClick:v},{default:t(()=>[i("复制")]),_:1}),o(p(y),{type:"primary",onClick:r},{default:t(()=>[i("粘贴")]),_:1})]),_:1})]),_:1},8,["onBack"]),o(A,{style:ve({maxHeight:`${p(U)-150}px`}),trigger:"none"},{default:t(()=>[o(Se,{ref_key:"FormListRef",ref:F,"form-list":f.formList,onUpdatas:l[3]||(l[3]=V=>z())},null,8,["form-list"])]),_:1},8,["style"])]),o(ie,{style:{width:"60%"},show:u.showModal,"onUpdate:show":l[5]||(l[5]=V=>u.showModal=V),"on-after-leave":E,"show-icon":!1,preset:"dialog","mask-closable":!1,title:u.title,onClose:ne},{action:t(()=>[u.title==="上传验证"?(_(),D(m,{key:0},{default:t(()=>[o(p(y),{onClick:l[4]||(l[4]=V=>u.showModal=!1)},{default:t(()=>[i("取消")]),_:1}),o(p(y),{type:"primary",onClick:g,disabled:f.pdf==""},{default:t(()=>[i(j(S.value),1)]),_:1},8,["disabled"])]),_:1})):(_(),d(N,{key:1},[u.title==="生成报告"?(_(),D(p(y),{key:0,type:"primary",disabled:k.value.Code!==601,onClick:W},{default:t(()=>[i("下载文件")]),_:1},8,["disabled"])):(_(),D(p(y),{key:1,type:"primary",disabled:k.value.Code!==601,onClick:W},{default:t(()=>[i("查看文档")]),_:1},8,["disabled"]))],64))]),default:t(()=>[$("div",null,j(f.pdf),1),u.title==="上传验证"?(_(),D(K,{key:0,class:"w-full","list-type":"image-card","default-upload":!1,max:1,onChange:J},{default:t(()=>[i(" 上传文件 ")]),_:1})):(_(),D(re,{key:1,embedded:"",bordered:!1},{header:t(()=>[$("div",na,[o(B,{"indicator-placement":"inside",status:k.value.Code===600?"default":k.value.Code===601?"success":"error",type:"line","gap-position":"bottom",percentage:k.value.Schedule},null,8,["status","percentage"])])]),default:t(()=>[Z($("div",{class:"pis",style:{overflow:"auto",height:"400px"},ref_key:"scrollbarRef",ref:x},[(_(!0),d(N,null,se(p(_e),(V,Y)=>(_(),d("div",{class:"flex",key:Y},[o(c,{class:"mr-5",type:"info",value:Y+1},null,8,["value"]),$("span",null,j(V),1)]))),128))],512),[[ee,b.value==!1]]),Z(o(X,{show:!0},{default:t(()=>[o(e,{title:"请等待...",type:"success"},{default:t(()=>[i(" 服务器正在处理中,请等待... ")]),_:1})]),_:1},512),[[ee,b.value==!0]])]),_:1}))]),_:1},8,["show","title"])],64)}}};export{xa as default};
|