import{d as R,a as r,r as o,s as n,K as k,I as S,J as v,u as a,e as u,f,g as m,F as h,j as H,C as M,n as O,t as j,A as B,h as p,_ as F}from"./index.0308b213.js";import{i as W}from"./isBetween.903653b2.js";import{i as q,M as x}from"./timeline.e28e5f81.js";/* empty css                                                                 *//* empty css                                                                      */import{_ as z}from"./OccupyModal.vue_vue_type_script_setup_true_lang.49574065.js";import C from"./SubscribeModal.d09d6045.js";import{_ as $}from"./DetailsModal.vue_vue_type_script_setup_true_lang.f7a1b908.js";const E={class:"plan"},P={class:"middle"},V=R({props:{start:{type:Object,required:!0},taskMode:{type:String,default:"date"},end:{type:Object,required:!0},endTimeOfRenderArea:[r,null],startTimeOfRenderArea:[r,null],blockData:{type:Object,required:!0},rowIdx:{type:Number,required:!0},rowData:{type:Object,required:!0},cellWidth:{type:Number,default:0},cellHeight:{type:Number,default:0},scale:{type:Number,default:30},getPositionOffset:Function,getWidthAbout2Times:Function,reload:{type:Function,default:()=>!1}},setup(D){const e=D,c=24;o(!1),o(null);const g=o(2),A=n(()=>{const t=e.blockData;return e.getWidthAbout2Times(t.start,t.end)}),_=n(()=>{const t=e.blockData;return e.getPositionOffset(t.start)}),y=o();k(function(){var t;(t=y.value)==null||t.open({startTime:e.blockData.start,times:e.scale,userData:e.rowData})},250);const b=o();k(function(){var t;(t=b.value)==null||t.open()},250);const I=t=>e.getPositionOffset(t)-a(_)||0;o(0),o(0),r.extend(S),r.extend(v),r.extend(W),n(()=>e.startTimeOfRenderArea.startOf("day")),n(()=>e.endTimeOfRenderArea.endOf("day"));const T=n(()=>q(e.scale));n(()=>{const t=[],{start:d,end:s,scale:l}=e;let i=d.clone().startOf("day"),N=a(T)&&l>x?l/x:1;for(;i.isSameOrBefore(s);)t.push(i),i=i.add(N,"day");return t}),n(()=>({width:`${e.cellWidth}px`}));const w=o();return(t,d)=>(u(),f(h,null,[m("div",{class:"task-block-item",style:O({left:a(_)+"px",width:a(A)+"px",zIndex:g.value,position:"relative"})},[m("div",E,[m("ul",P,[e.blockData.taskArray.length>0?(u(!0),f(h,{key:0},H(e.blockData.taskArray,(s,l)=>(u(),f("li",{class:"middle-item",onMousedown:d[0]||(d[0]=M(()=>{},["stop"])),key:s.id,style:O({height:c+"px",lineHeight:c+"px",zIndex:9999,left:e.taskMode==="date"?I(s.start)+"px":0,top:l*c+"px",width:e.taskMode==="date"?e.getWidthAbout2Times(s.start,s.end)+"px":"100%"})},j(e.taskMode==="date"?a(r)(s.start).format("HH:mm")+"-"+a(r)(s.end).format("HH:mm"):a(r)(s.start).format("HH:mm")),37))),128)):B("",!0)])])],4),p(a(C),{ref_key:"subscribeRef",ref:y},null,512),p(a(z),{ref_key:"occupyRef",ref:b},null,512),p(a($),{ref_key:"detailsRef",ref:w,blockItem:e.blockData},null,8,["blockItem"])],64))}});const Z=F(V,[["__scopeId","data-v-295777f4"]]);export{Z as default};
