import{a as e,aa as a}from"./index-d4baa715.js";const t=t=>{const l=e(1),u=e(10),s=e(!1),i=e(!1),n=e(null),v=e(null),o=e(!1),r=e([]),m=e({}),d=e(0),c=e([]),T=async()=>{if(i.value||s.value)return;i.value=!0;const e=(await t({pageNo:l.value,pageSize:u.value,startTime:n.value,endTime:v.value,...m.value})).list;o.value=!1,console.log(e,"products"),e&&(e.length<=0&&(1===l.value?o.value=!0:s.value=!0),r.value=r.value.concat(e)),i.value=!1},g=async()=>{s.value=!1,i.value=!1,l.value=1,r.value=[],await T()},p=()=>{let e=new Date,a=(new Date).getHours();for(let t=0;t<4;t++){let l={time:a+t>=24?(a+t-24+":00").padStart(5,"0"):`${a+t}:00`.padStart(5,"0"),status:2,countdown:"",startTime:"",endTime:""};e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),e.setHours(a+t),l.startTime=e.getTime(),e.setHours(a+t+1),l.endTime=e.getTime(),0===t&&(l.status=1,l.countdown=e.getTime()-(new Date).getTime()),c.value.push(l)}n.value=c.value[0].startTime,v.value=c.value[0].endTime,g()};return a((()=>{i.value||s.value||(l.value+=1,T())})),{dataList:r,page:l,pageSize:u,loading:i,loadend:s,listEmpty:o,refresh:g,otherQuery:m,activeIndex:d,timesList:c,timeChange:(e,a)=>{d.value=a,n.value=e.startTime,v.value=e.endTime,g()},countDownFinish:()=>{c.value=[],d.value=0,p()},handleGetTimeList:p}};export{t as u};
