1 |
- import{e as M,b as B,u as L,f as p,r as T,o as U,c as V,a as z,i as a,w as s,j as i,F as I,s as $,l as _,m as u,_ as q,y as F,z as R}from"./index-e497b666.js";import{g as j,e as E}from"./TaskData-11f744cb.js";import{_ as J}from"./PageHeader-74caddbf.js";import{_ as O}from"./DataTable-41a24bfd.js";import{_ as P}from"./Space-84278c21.js";import{_ as A}from"./DatePicker-02d3d64b.js";import"./RadioGroup-6edab0a1.js";import"./get-slot-1efb97e5.js";const G={class:"h-full flex flex-col gap-y-3"},oe={__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,x())},b=()=>{y.warning({title:"警告",content:"是否确认重置数据?",positiveText:"确认",negativeText:"取消",onPositiveClick:()=>{l.value=!0}})},x=async()=>{try{const{data:t}=await E({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 j(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=J,f=q,g=A,D=O,H=F,N=R,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:b},{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{oe as default};
|