局长信箱-互联网端管理-前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
2.5 KiB

import{r as u,O as S,L as g,o as _,x as w,b as t,w as l,q as I,H as T,M,f as x,F as N,I as R,E as m,n as U,k as $,p as P,i as j,c as q,e as O,B as Q,P as W,Q as Z,R as z,h as A}from"./index-BSiuwHTj.js";/* empty css *//* empty css */import{g as G,p as J}from"./request-ivp8oFtZ.js";/* empty css */function K(){return G({url:"/outer/holiday/show-holiday"})}function X(f){return J({url:"/outer/holiday/refresh-holiday",body:f})}const ee={class:"app-container"},ae=["active"],ce={__name:"HolidayList",setup(f){const s=u(""),a=u(!0),y=u([]),d=u([]),h=()=>{K().then(e=>{console.log(e),d.value=e,a.value=!1})};h();const E=e=>{const[o,n,p]=e.split("-"),i=parseInt(p,10).toString();return`${o}-${n}-${i}`};S(()=>{let e=new Date().getFullYear();D(e),a.value=!1});const D=e=>{const o=[];for(let n=0;n<12;n++)o.push({cal:new Date(e,n,1)});y.value=o},V=()=>{a.value=!0;let e=new Date().getFullYear();s.value===String(e)?(h(),setTimeout(()=>{a.value=!1},1e3)):(m.info("其他年份尚未拥有数据"),a.value=!1)},Y=()=>{if(s.value==""){m.info("请输入年份"),a.value=!1;return}a.value=!0,X({year:s.value}).then(e=>{d.value=e.holidayList,setTimeout(()=>{a.value=!1},1e3),m.success("同步成功")})};return(e,o)=>{const n=U,p=$,i=P,k=I,C=Z,b=z,F=A,B=j,H=T,L=M;return g((_(),w("div",ee,[t(k,{inline:!0,style:{display:"flex","justify-content":"left","margin-top":"10px","margin-right":"70px","margin-left":"50px"}},{default:l(()=>[t(p,{label:"请选择年份"},{default:l(()=>[t(n,{type:"year",modelValue:s.value,"onUpdate:modelValue":o[0]||(o[0]=r=>s.value=r),placeholder:"请选择年份","value-format":"YYYY"},null,8,["modelValue"])]),_:1}),t(i,{type:"primary",onClick:V},{default:l(()=>[x("查询节假日")]),_:1}),t(i,{type:"primary",onClick:Y},{default:l(()=>[x("同步节假日")]),_:1})]),_:1}),t(H,{class:"scrollbar-container"},{default:l(()=>[t(B,null,{default:l(()=>[(_(!0),w(N,null,R(y.value,(r,te)=>(_(),q(F,{key:r.cal,span:7,style:{"margin-right":"10px","margin-left":"50px"}},{default:l(()=>[t(b,{shadow:"hover",style:{"margin-bottom":"20px"}},{default:l(()=>[t(C,{modelValue:r.cal,"onUpdate:modelValue":c=>r.cal=c,class:"holiday",style:{"pointer-events":"none"}},{"date-cell":l(({data:c})=>[g(O("div",{class:"holiday-cell",active:d.value.findIndex(v=>v.date===c.day&&v.holidayFlag==="Y")!==-1},Q(E(c.day).split("-")[2]),9,ae),[[W,c.type==="current-month"]])]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:1})])),[[L,a.value]])}}};export{ce as default};