import{o as T,r as c,a as D,j as p}from"./react.b0bedc10.js";import{T as k}from"./zarm.80120c4d.js";import{L as w}from"./List.baa8939f.js";import{s as A}from"./index.9b0ee734.js";import{a as E,u as L,L as S}from"./index.a3f0fe79.js";import"./Fetch.e6ea9900.js";import"./Patrol.49bc16dd.js";import"./Empty.1ca4811e.js";import"./searchEmpty.9ddd526b.js";import"./Project.fe0152f3.js";const j="_button_bar_16h7s_12",I="_button_1_16h7s_22",x="_button_2_16h7s_33",B="_unity_pop_new_16h7s_42",$="_unity_pop_16h7s_42",v="_unity_check_16h7s_66",N="_unity_check_2_16h7s_73",P="_unity_choose_16h7s_79",z="_unity_empty_16h7s_98",q="_unity_close_16h7s_108",C="_schedule_16h7s_126";var F={"detail-cell":"_detail-cell_16h7s_1",button_bar:j,button_1:I,button_2:x,unity_pop_new:B,unity_pop:$,unity_check:v,unity_check_2:N,unity_choose:P,unity_empty:z,unity_close:q,schedule:C};const G=()=>{const{schedulesTotal:m,schedules:d,getSchedules:h}=A.ProjectStore,{state:t}=E(),y=L(),[f,_]=c.exports.useState(""),[r,a]=c.exports.useState(!1);c.exports.useEffect(()=>{switch(t.role){case"self":i({currentPage:1,pageSize:10}),document.title="\u81EA\u67E5\u8BA1\u5212\u8868",_("\u81EA\u67E5\u8BA1\u5212\u8868");break;case"admin-self":i({currentPage:1,pageSize:10}),document.title="\u81EA\u67E5\u8BA1\u5212\u8868",_("\u81EA\u67E5\u8BA1\u5212\u8868");break}},[]);const b=(n,e)=>{let u=0;const s=new Date().getTime(),o=new Date(n).getTime(),l=new Date(e).getTime();return s<o?0:s>=o&&s<=l?1:s>l?2:u},i=async({currentPage:n,pageSize:e,show_current:u})=>{let s={currentPage:n,pageSize:e};u&&t.role=="self"&&(s.show_current=u),a(!0);const o=await h({...s},{projectID:t.ids.projectID,roomID:t.ids.roomID});return a(!1),(o==null?void 0:o.code)==200},g=(n,e)=>{if(b(e.dtstart,e.dtend)){y(`/my-self-inspect/${t.ids.roomID}/${t.ids.projectID}/${t.role}`,{state:{task:{pid:t.ids.projectID,period:e.period,title:t.taskName,status:e.status}}});return}else k.show("\u6682\u672A\u5F00\u59CB")};return D("div",{className:F.schedule,children:[r&&p(S,{}),p(w,{loading:r,listData:d,total:m,type:f,goDetail:g,getList:i})]})};var X=T(G);export{X as default};
