2025-03-20 10:25:32 +08:00

2 lines
3.0 KiB
JavaScript

import{a7 as V}from"./element-plus.2acb577d.js";import{r as o,o as i,c as l,U as N,L as R,a as g,a3 as x,R as S,S as _,Q as f,T as C,a9 as $,u as m,i as B,K as b,n as L}from"./@vue.821a47ec.js";import{_ as E,a as T,c as F}from"./edit.vue_vue_type_script_setup_true_name_oaScheduleEdit_lang.23308f54.js";import{_ as O}from"./detail.vue_vue_type_script_setup_true_name_customdetail_lang.7ac81037.js";import{d as U,t as j}from"./index.81df6f20.js";import"./lodash-es.df44a280.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.81e2759c.js";import"./@element-plus.dabbc398.js";import"./dayjs.d2a77ee0.js";import"./axios.9e996410.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./index.f292cd50.js";import"./lodash.6bfd3540.js";import"./vue-router.4c04f9b6.js";import"./pinia.fefed778.js";import"./css-color-function.8ff67959.js";import"./color.bfa08e9a.js";import"./clone.660f80c4.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.dcb32030.js";import"./vue-clipboard3.e681583f.js";import"./clipboard.3ad9b20b.js";import"./echarts.42bea269.js";import"./tslib.60310f1a.js";import"./zrender.2cb48b70.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.8864a4be.js";const I=["onClick"],K={key:0,class:"laber-time"},M=["onClick"],Q={__name:"index",setup(q){const d=o(new Date),p=o([]),v=o(null),n=o(!1),u=o(null),y=o(!1);function h(r,e){const a=[];let t=new Date(r);for(;t<=new Date(e);)a.push(new Date(t)),t.setDate(t.getDate()+1);return a.map(D=>j(D,"yyyy-mm-dd"))}const k=r=>p.value.filter(t=>t.date[0]==r).reduce((t,s)=>Number(t)+Number(s.labor_time),0),w=async r=>{var e,a,t;if(r.id?y.value=!0:n.value=!0,await L(),r.id){let s=await T({id:r.id});(e=u.value)==null||e.setFormData(s),(a=u.value)==null||a.open()}else(t=v.value)==null||t.open("add",r.day+" 00:00")},c=async()=>{let r=await F();p.value=r.lists.map(e=>({id:e.id,title:e.title,date:h(e.start_time,e.end_time),start:e.start_time.substring(e.start_time.length-5),end:e.end_time.substring(e.end_time.length-5),labor_time:e.labor_time}))};return c(),(r,e)=>{const a=V;return i(),l(C,null,[N(a,{modelValue:m(d),"onUpdate:modelValue":e[0]||(e[0]=t=>B(d)?d.value=t:null)},{dateCell:R(({data:t})=>[g("div",{class:"content",onClick:x(s=>w(t),["stop"])},[S(_(t.day.split("-").slice(1).join("-"))+" ",1),k(t.day)?(i(),l("div",K," [ \u5F53\u5929\u603B\u5DE5\u65F6\uFF1A "+_(k(t.day))+"] ",1)):f("",!0),(i(!0),l(C,null,$(m(p).filter(s=>s.date.includes(t.day)),s=>(i(),l("div",{class:"task-li",key:s.id,onClick:x(D=>w(s),["stop"])},[g("span",null,_(s.start+" "+s.title),1)],8,M))),128))],8,I)]),_:1},8,["modelValue"]),m(n)?(i(),b(E,{key:0,ref_key:"editRef",ref:v,onSuccess:c,onClose:e[1]||(e[1]=t=>n.value=!1)},null,512)):f("",!0),m(y)?(i(),b(O,{key:1,ref_key:"detailRef",ref:u,onSuccess:c,onClose:e[2]||(e[2]=t=>n.value=!1)},null,512)):f("",!0)],64)}}},be=U(Q,[["__scopeId","data-v-47eedd63"]]);export{be as default};