import{u as M,n as B,O as L,b as p,r as T,o as U,c as V,a as z,f as a,w as s,g as i,F as I,p as $,i as _,j as u,_ as q,v as F,x as O}from"./index-bb1600c6.js";import{a as R,e as j}from"./TaskData-ccc03cdb.js";import{_ as E}from"./PageHeader-30187700.js";import{_ as J}from"./DataTable-a287c4be.js";import{_ as P}from"./Space-6807f258.js";import{_ as A}from"./DatePicker-fecabd38.js";import"./RadioGroup-3051618a.js";import"./get-slot-1efb97e5.js";import"./Tooltip-f0032eab.js";const G={class:"h-full flex flex-col gap-y-3"},ne={__name:"index",setup(K){const c=M(),k=B(),y=L();p();const v=window.sessionStorage.getItem("task")?JSON.parse(window.sessionStorage.getItem("task")):{},e=T({T_task_id:v.T_task_id,T_sn:"",T_id:"",Time_start:null,Time_end:null,page:1,page_z:20}),d=p([]),w=[{title:"编号",key:"T_id"},{title:"SN",key:"T_sn"},{title:"温度℃",key:"T_t"},{title:"湿度%",key:"T_rh"},{title:"记录时间",key:"T_time"}],r=T({page:e.page,pageSize:e.page_z,itemCount:0,onChange:t=>{r.page=t,e.page=t,m()}}),l=p(!1),h=t=>{e.Time_start==null&&e.Time_end==null?k.error("请选择查询时间"):(e.T_id="",e.T_sn="",l.value=!1,b())},x=()=>{y.warning({title:"警告",content:"是否确认重置数据？",positiveText:"确认",negativeText:"取消",onPositiveClick:()=>{l.value=!0}})},b=async()=>{try{const{data:t}=await j({T_task_id:e.T_task_id,Time_start:e.Time_start,Time_end:e.Time_end});t.Code===200?setTimeout(function(){c.replace("/")},500):setTimeout(function(){c.replace("/")},500)}catch(t){console.log(t)}},m=async()=>{try{const{data:t}=await R(e);console.log("返回数据",t),r.itemCount=t.Data.Num,t.Data.List?(l.value=!1,d.value=t.Data.List):l.value=!0}catch(t){console.log(t)}};return m(),(t,n)=>{const C=E,f=q,g=A,D=J,H=F,N=O,S=$;return U(),V(I,null,[z("div",G,[a(C,{onBack:t.$router.back},{title:s(()=>[_(" 数据来源 ")]),_:1},8,["onBack"]),a(i(P),null,{default:s(()=>[a(f,{value:e.T_sn,"onUpdate:value":n[0]||(n[0]=o=>e.T_sn=o),placeholder:"请输入SN"},null,8,["value"]),a(f,{value:e.T_id,"onUpdate:value":n[1]||(n[1]=o=>e.T_id=o),placeholder:"请输入ID"},null,8,["value"]),a(g,{format:"yyyy-MM-dd HH:mm","time-picker-props":{format:"HH:mm"},"onUpdate:formattedValue":n[2]||(n[2]=o=>{e.Time_start=o[0],e.Time_end=o[1]}),type:"datetimerange",clearable:""}),a(i(u),{type:"primary",onClick:m},{default:s(()=>[_("搜索")]),_:1}),a(i(u),{type:"primary",onClick:x},{default:s(()=>[_("重置数据")]),_:1})]),_:1}),a(D,{remote:"",columns:w,data:d.value,pagination:r,bordered:!1,"flex-height":"",class:"flex-1"},null,8,["data","pagination"])]),a(S,{show:l.value,"onUpdate:show":n[4]||(n[4]=o=>l.value=o),"show-icon":!1,"mask-closable":!1,closable:!1,preset:"dialog"},{default:s(()=>[a(N,{"label-width":"auto","label-placement":"top",model:e,"show-require-mark":""},{default:s(()=>[a(H,{label:"自定义时间"},{default:s(()=>[a(g,{format:"yyyy-MM-dd HH:mm","time-picker-props":{format:"HH:mm"},"onUpdate:formattedValue":n[3]||(n[3]=o=>{e.Time_start=o[0],e.Time_end=o[1]}),type:"datetimerange",clearable:""})]),_:1}),a(i(u),{type:"primary",block:"",onClick:h},{default:s(()=>[_("搜索")]),_:1})]),_:1},8,["model"])]),_:1},8,["show"])],64)}}};export{ne as default};
