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

2 lines
3.0 KiB
JavaScript

import{a7 as C}from"./element-plus.2acb577d.js";import{r as i,o as n,c as r,U as $,L as V,a as R,R as S,S as d,T as D,a9 as B,u as c,a3 as T,Q as f,i as E,K as w,n as L}from"./@vue.821a47ec.js";import{_ as N,a as O,c as F}from"./edit.vue_vue_type_script_setup_true_name_oaPlanEdit_lang.7fbe4097.js";import{_ as b}from"./detail.vue_vue_type_script_setup_true_name_customdetail_lang.21d15cf3.js";import{d as M}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 P=["onClick"],U=["onClick"],j={key:0},I={key:0},K={key:1},Q={key:2},Y={__name:"index",setup(q){const p=i(new Date),y=i([]),v=i(null),l=i(!1),m=i(null),k=i(!1);function h(o){const t=new Date(o),a=t.getFullYear(),e=t.getMonth()+1,s=t.getDate();return`${a}-${e<10?"0"+e:e}-${s<10?"0"+s:s}`}function x(o,t){const a=[];let e=new Date(o);for(;e<=new Date(t);)a.push(new Date(e)),e.setDate(e.getDate()+1);return a.map(_=>h(_))}const g=async o=>{var t,a,e;if(o.id?k.value=!0:l.value=!0,await L(),o.id){let s=await O({id:o.id});(t=m.value)==null||t.setFormData(s),(a=m.value)==null||a.open()}else(e=v.value)==null||e.open("add",o.day+" 00:00")},u=async()=>{let o=await F();y.value=o.lists.map(t=>({id:t.id,title:t.title,date:x(t.start_time,t.end_time),start:t.start_time.substring(t.start_time.length-5),end:t.end_time.substring(t.end_time.length-5)}))};return u(),(o,t)=>{const a=C;return n(),r(D,null,[$(a,{modelValue:c(p),"onUpdate:modelValue":t[0]||(t[0]=e=>E(p)?p.value=e:null)},{dateCell:V(({data:e})=>[R("div",{class:"content",onClick:s=>g(e)},[S(d(e.day.split("-").slice(1).join("-"))+" ",1),(n(!0),r(D,null,B(c(y),s=>(n(),r("div",{class:"task-li",onClick:T(_=>g(s),["stop"])},[s.date.includes(e.day)?(n(),r("div",j,[s.date[0]==e.day?(n(),r("span",I,d(s.start+" "+s.title),1)):s.date[s.date.length-1]==e.day?(n(),r("span",K,d(s.end+" "+s.title),1)):(n(),r("span",Q,d(s.title),1))])):f("",!0)],8,U))),256))],8,P)]),_:1},8,["modelValue"]),c(l)?(n(),w(N,{key:0,ref_key:"editRef",ref:v,onSuccess:u,onClose:t[1]||(t[1]=e=>l.value=!1)},null,512)):f("",!0),c(k)?(n(),w(b,{key:1,ref_key:"detailRef",ref:m,onSuccess:u,onClose:t[2]||(t[2]=e=>l.value=!1)},null,512)):f("",!0)],64)}}},Vt=M(Y,[["__scopeId","data-v-78acc9cf"]]);export{Vt as default};