@studio-west/employees 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";const e=require("vue"),w=require("./index-CHGzf-XH.cjs"),G=require("vue-i18n"),r=require("element-plus"),z=require("@imengyu/vue3-context-menu"),O=(D,E)=>{const u=D.__vccOpts||D;for(const[k,v]of E)u[k]=v;return u},R={class:"wrapper"},P={class:"month_year"},A={class:"text"},J={class:"week"},W={class:"month"},X=["onClick"],H={key:0},K={class:"month_year"},Z={class:"text"},Q={class:"week"},ee={class:"month"},te=["onClick"],ae={__name:"DataPicker",props:{data:Object,range:{type:String,default:()=>"solid"}},emits:["init"],setup(D,{emit:E}){var L,M,U,q;const u=e.ref(new Date),k=e.ref(new Date),v=D,I=E,y=e.ref(new Date().getFullYear()),b=e.ref(new Date().getMonth()),F=e.ref(new Date().getFullYear()),f=e.ref(new Date().getMonth()),d=e.ref([]),B=e.ref(0),$=e.ref(0),g=e.ref(-1),x=e.ref(-1),{locale:Y}=G.useI18n(),T=/en|zh|ja|he/.test(Y.value)?0:1,j=s=>{const o=s.split(s.match(/\D.*?\D?/));return o[0].length>2?o.join("-")+"T00:00:01":o.reverse().join("-")+"T00:00:01"};typeof((L=v.data)==null?void 0:L.startDate)<"u"&&(u.value=new Date(j(v.data.startDate)),y.value=u.value.getFullYear(),f.value=u.value.getMonth()),typeof((M=v.data)==null?void 0:M.endDate)<"u"&&(k.value=new Date(j(v.data.endDate)),F.value=k.value.getFullYear(),b.value=k.value.getMonth());const S=()=>{let s=new Date(y.value,f.value,0);for(let n=s.getDate()-s.getDay()+T;n<=s.getDate()&&s.getDay()!==6+T;n++)B.value++,d.value.push({day:n,month:s.getMonth(),year:s.getFullYear(),class:[]});for(let n=1;n<=new Date(y.value,f.value+1,0).getDate();n++)B.value++,d.value.push({day:n,month:f.value,year:y.value,class:[]});if(v.range==="range"){$.value=new Date(y.value,f.value+2,0);for(let n=1;n<=$.value.getDate();n++)d.value.push({day:n,month:$.value.getMonth(),year:$.value.getFullYear(),class:[]})}let o=v.range==="range"?2:1,i=new Date(y.value,f.value+o,1);for(let n=1;n<=(7-i.getDay()+T)%7&&i.getDay()!==T;n++)d.value.push({day:n,month:i.getMonth(),year:i.getFullYear(),class:[]});v.data.holiday.length!==0&&(v.data.holiday.preholidays.forEach(n=>{let m=n.split("-");const C=d.value.findIndex(V=>V.year==m[0]&&V.month+1==m[1]&&V.day==m[2]);C!==-1&&(d.value[C].class[0]="preholiday")}),v.data.holiday.holidays.forEach(n=>{let m=n.split("-");const C=d.value.findIndex(V=>V.year==m[0]&&V.month+1==m[1]&&V.day==m[2]);C!==-1&&(d.value[C].class[0]="weekend")}),v.data.holiday.holiday.forEach(n=>{let m=n.split("-");const C=d.value.findIndex(V=>V.year==m[0]&&V.month+1==m[1]&&V.day==m[2]);C!==-1&&(d.value[C].class[0]="holiday")}),v.data.holiday.nowork.forEach(n=>{let m=n.split("-");const C=d.value.findIndex(V=>V.year==m[0]&&V.month+1==m[1]&&V.day==m[2]);C!==-1&&(d.value[C].class[0]="nowork")}))},_=(s,o)=>{let i=s-o+1;for(let n=0;n<=s-o;n++)d.value[n+o].class[0]==="holiday"&&i--;return i},c=(s,o)=>{const i=w.parseTime(new Date(s.year,s.month,s.day),"{dd}.{m}.{Y}");if(v.range==="range")if(console.log(g.value),x.value!==-1){if(x.value<=g.value)for(let n=x.value;n<=g.value;n++)d.value[n].class[1]="";else for(let n=g.value;n<=x.value;n++)d.value[n].class[1]="";g.value=o,x.value=-1,d.value[o].class[1]="active"}else if(g.value!==-1){if(x.value=o,x.value>=g.value)for(let m=g.value+1;m<o;m++)d.value[m].class[1]="select";else for(let m=o+1;m<g.value;m++)d.value[m].class[1]="select";d.value[o].class[1]="active";let n=w.parseTime(new Date(d.value[g.value].year,d.value[g.value].month,d.value[g.value].day),"{dd}.{m}.{Y}");g.value>o?I("input",{dateStart:i,dateEnd:n,count:_(g.value,o)}):I("input",{dateStart:n,dateEnd:i,count:_(o,g.value)})}else g.value=o,d.value[o].class[1]="active";else d.value[g.value].class[1]="",g.value=o,d.value[o].class[1]="active",I("input",{dateStart:i,count:1})};if(S(),typeof((U=v.data)==null?void 0:U.startDate)<"u"&&(g.value=d.value.findIndex(s=>s.day===u.value.getDate()&&s.month===f.value&&s.year===y.value),d.value[g.value].class[1]="active"),typeof((q=v.data)==null?void 0:q.endDate)<"u"&&v.range==="range"){x.value=d.value.findIndex(s=>s.day===k.value.getDate()&&s.month===b.value&&s.year===F.value),d.value[x.value].class[1]="active";for(let s=g.value+1;s<x.value;s++)d.value[s].class[1]="select"}const h=(s,o)=>{d.value=[],B.value=0,u.value=new Date(s,o,1),y.value=u.value.getFullYear(),f.value=u.value.getMonth(),S()};return(s,o)=>(e.openBlock(),e.createElementBlock("div",R,[e.createElementVNode("div",null,[e.createElementVNode("p",P,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:o[0]||(o[0]=i=>h(y.value-1,f.value))},"«"),e.createElementVNode("button",{onClick:o[1]||(o[1]=i=>h(y.value,f.value-1))},"‹")]),e.createElementVNode("span",A,[e.createElementVNode("button",null,e.toDisplayString(y.value),1),e.createElementVNode("button",null,e.toDisplayString(e.unref(w.parseTime)(u.value,"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:o[2]||(o[2]=i=>h(y.value,f.value+1))},"›"),e.createElementVNode("button",{onClick:o[3]||(o[3]=i=>h(y.value+1,f.value))},"»")])]),e.createElementVNode("div",J,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(i,n)=>e.createElementVNode("button",{key:n,class:"disabled"},e.toDisplayString(e.unref(w.parseTime)(new Date(1970,1,i+e.unref(T)),"{D}")),1)),64))]),e.createElementVNode("div",W,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(i,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[n<B.value+(7-new Date(y.value,f.value+1,1).getDay()+e.unref(T))%7?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(i.month===f.value?i.class:"disabled"),onClick:()=>{i.month===f.value&&c(i,n)}},e.toDisplayString(i.day),11,X)):e.createCommentVNode("",!0)],64))),128))])]),v.range==="range"?(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("p",K,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:o[4]||(o[4]=i=>h(y.value-1,f.value))},"«"),e.createElementVNode("button",{onClick:o[5]||(o[5]=i=>h(y.value,f.value-1))},"‹")]),e.createElementVNode("span",Z,[e.createElementVNode("button",null,e.toDisplayString(new Date(y.value,f.value+1).getFullYear()),1),e.createElementVNode("button",null,e.toDisplayString(e.unref(w.parseTime)(u.value.setMonth(f.value+1),"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:o[6]||(o[6]=i=>h(y.value,f.value+1))},"›"),e.createElementVNode("button",{onClick:o[7]||(o[7]=i=>h(y.value+1,f.value))},"»")])]),e.createElementVNode("div",Q,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(i,n)=>e.createElementVNode("button",{key:n,class:"disabled"},e.toDisplayString(e.unref(w.parseTime)(new Date(1970,1,i+e.unref(T)),"{D}")),1)),64))]),e.createElementVNode("div",ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(i,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[n>=B.value-new Date(y.value,f.value+1,1).getDay()+e.unref(T)?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(i.month===$.value.getMonth()?i.class:"disabled"),onClick:()=>{i.month===$.value.getMonth()&&c(i,n)}},e.toDisplayString(i.day),11,te)):e.createCommentVNode("",!0)],64))),128))])])):e.createCommentVNode("",!0)]))}},le=O(ae,[["__scopeId","data-v-fef4c07c"]]),ne={key:1,class:"controls-container",style:{"margin-top":".5rem"}},oe={key:0},ue={key:1,style:{padding:"0 1rem .5rem"}},re={__name:"VacationTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,query:String,fullName:{type:String,default:"Вы"}},setup(D){const E=D,{t:u}=G.useI18n(),k=e.ref([]);e.ref([]);const v=e.ref(new Date().getFullYear()),I=e.ref(!1),y=e.ref(!1),b=e.ref(!1),F=e.ref({zIndex:3,minWidth:230,x:500,y:200}),f=e.ref(!1),d=e.ref(!1),B=e.ref({participants:[]}),$=e.ref([]),g=e.ref([]),x=e.ref("Сектор разработок и эксплуатации сети"),Y=e.ref([{value:"all",label:u("vacationSchedule.all"),key:"all"}]),T=e.ref([{value:v.value,label:v.value},{value:v.value+1,label:v.value+1}]),j=e.ref(!1),S=e.ref([]),_=e.ref(!1),c=e.ref({name:"Имя",length:0,code:""});e.watch(x,async(l,a)=>{l!==a&&(S.value=[],I.value=!1,E.odata.personalManagerData.forEach(p=>{(p.Status!=="Увольнение"&&p.Group===l||l==="all")&&(S.value.some(t=>(t==null?void 0:t.activeText)===p.Role)||S.value.push({val:!0,activeText:p.Role}))}),M())});const h=e.computed(()=>k.value.flatMap((l,a)=>!l.days||l.days.length===0?[{...l,key:0,ids:a}]:l.days.map((p,t)=>({ids:a,key:t,...l,...p})))),L=async()=>{E.odata.getPersonalManagerData({}).then(l=>{var a;x.value=(a=l.find(p=>p.Status!=="Увольнение"&&p.Description===E.fullName))==null?void 0:a.Group,l.forEach(p=>{p.Status!=="Увольнение"&&(Y.value.some(t=>(t==null?void 0:t.value)===p.Group)||Y.value.push({value:p.Group,label:p.Group,key:p.Group}),p.Group===x.value&&!S.value.some(t=>(t==null?void 0:t.activeText)===p.Role)&&S.value.push({val:!0,activeText:p.Role}))}),M(),y.value=!1})},M=()=>{k.value=[];let l=[];E.odata.personalManagerData.forEach(a=>{a.Status!=="Увольнение"&&(a.Group===x.value||x.value==="all")&&S.value.some(p=>p.val&&p.activeText===a.Role)&&(l.push(a.Code),k.value.push({name:a.Description,days:[{note:""}],jobTitle:a.Role,code:a.Code}))}),U(l),f.value=!1},U=l=>{E.workSchedule.getAllVacations({year:v.value}).then(a=>{l.forEach((p,t)=>{k.value[t].days=[{note:""}],a.forEach(N=>{p===N.code&&(typeof k.value[t].days[0].dateStart>"u"?k.value[t].days[0]={dateStart:w.parseTime(N.dateStart,"{dd}.{m}.{Y}"),dateEnd:w.parseTime(N.dateEnd,"{dd}.{m}.{Y}"),note:N.note,count:N.count}:k.value[t].days.push({dateStart:w.parseTime(N.dateStart,"{dd}.{m}.{Y}"),dateEnd:w.parseTime(N.dateEnd,"{dd}.{m}.{Y}"),note:N.note,count:N.count}))})})})},q=l=>{if(l.columnIndex<3&&h.value[l.rowIndex].key<h.value[l.rowIndex].days.length)return h.value[l.rowIndex].key===0?{rowspan:h.value[l.rowIndex].days.length,colspan:1}:{rowspan:0,colspan:0}},s=(l,a,p,t)=>{c.value.ids=l.ids,c.value.key=l.key,c.value.startDate=l.dateStart,c.value.endDate=l.dateEnd,c.value.name=l.name,c.value.count=l.count,c.value.length=l.days.length,c.value.add=l.days.length>0&&l.days[l.days.length-1].count,c.value.level=a.level,c.value.holiday=g.value,F.value.y=t.clientY,F.value.x=t.clientX,a.level===2&&a.no<4&&(c.value.add||l.days.length>1)&&(b.value=!0),a.level===3&&(b.value=!0)},o=l=>{console.log(l);let a=k.value[c.value.ids];switch(l){case"add":a.days.push({note:""}),console.log(a.days.length);break;case"delete":delete a.days.pop(),m(c.value.ids);break}b.value=!1},i=l=>{_.value=l,c.value.count=l.count},n=()=>{_.value&&(k.value[c.value.ids].days[c.value.key]={..._.value,note:""},m(c.value.ids)),b.value=!1},m=l=>{E.workSchedule.rewriteFull({year:v.value,code:k.value[l].code,data:k.value[l].days.map(a=>({dateStart:a.dateStart.split(".").reverse().join("-"),dateEnd:a.dateEnd.split(".").reverse().join("-"),note:a.note,count:a.count}))})},C=l=>{E.workSchedule.sendConfirmMessage({fullname:E.fullName,confirm:l}),E.query=""},V=()=>{E.workSchedule.sendAgreementMessage({users:B.value.participants}),d.value=!1};return E.workSchedule.getBoss().then(l=>{$.value=l[0].users}),w.holidays().then(l=>{g.value=l,L()}),(l,a)=>{const p=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",null,[D.checkEdit?(e.openBlock(),e.createBlock(e.unref(r.ElSelect),{key:0,modelValue:x.value,"onUpdate:modelValue":a[0]||(a[0]=t=>x.value=t),placeholder:"Select",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Y.value,t=>(e.openBlock(),e.createBlock(e.unref(r.ElOption),{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),e.createVNode(e.unref(r.ElButton),{plain:"",onClick:a[1]||(a[1]=t=>f.value=!0),style:{"margin-bottom":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.jobTitle")),1)]),_:1}),e.createVNode(e.unref(r.ElSelect),{modelValue:v.value,"onUpdate:modelValue":a[2]||(a[2]=t=>v.value=t),onChange:M,placeholder:"Year",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,t=>(e.openBlock(),e.createBlock(e.unref(r.ElOption),{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),e.createVNode(e.unref(r.ElSkeleton),{style:{width:"100%"},loading:y.value,animated:""},{template:e.withCtx(()=>[e.createVNode(e.unref(r.ElSkeletonItem),{variant:"text",style:{width:"100%",height:"2rem"}}),e.createVNode(e.unref(r.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"4rem","margin-right":"4px"}}),e.createVNode(e.unref(r.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"4rem"}}),e.createVNode(e.unref(r.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"8rem","margin-right":"4px"}}),e.createVNode(e.unref(r.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"8rem"}})]),default:e.withCtx(()=>[e.createVNode(e.unref(r.ElTable),{id:"printTable",data:h.value,"span-method":q,onCellClick:s,border:"",style:{width:"100%"},size:"small","empty-text":e.unref(u)("vacationSchedule.emptyText")},{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElTableColumn),{label:x.value!=="all"?e.unref(u)("vacationSchedule.title",{name:x.value}):e.unref(u)("vacationSchedule.enterprise")+` ${v.value}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(u)("vacationSchedule.jobTitle"),width:"180",align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(h.value[t.$index].jobTitle),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(u)("vacationSchedule.fullName"),width:"180",align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(h.value[t.$index].name),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(u)("vacationSchedule.personnelNumber"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(h.value[t.$index].code),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(u)("vacationSchedule.vacation"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(u)("vacationSchedule.days"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(h.value[t.$index].count),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(u)("vacationSchedule.date"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(h.value[t.$index].dateStart),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(u)("vacationSchedule.endDate"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(h.value[t.$index].dateEnd),1)]),_:1},8,["label"])]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(u)("vacationSchedule.note"),align:"center"},{default:e.withCtx(t=>[e.createVNode(e.unref(r.ElInput),{modelValue:k.value[h.value[t.$index].ids].days[h.value[t.$index].key].note,"onUpdate:modelValue":N=>k.value[h.value[t.$index].ids].days[h.value[t.$index].key].note=N,style:{width:"100%"},placeholder:" ",class:"noBorder",onBlur:N=>m(h.value[t.$index].ids)},null,8,["modelValue","onUpdate:modelValue","onBlur"])]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["data","empty-text"])]),_:1},8,["loading"]),D.checkEdit?(e.openBlock(),e.createElementBlock("div",ne,[I.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(r.ElButton),{key:0,type:"primary",onClick:a[3]||(a[3]=t=>d.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("vacationSchedule.sendInformation")),1)]),_:1})),D.query==="confirm"?(e.openBlock(),e.createBlock(e.unref(r.ElButton),{key:1,type:"primary",onClick:a[4]||(a[4]=t=>C(!0))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("vacationSchedule.agreeOn")),1)]),_:1})):e.createCommentVNode("",!0),D.query==="confirm"?(e.openBlock(),e.createBlock(e.unref(r.ElButton),{key:2,type:"primary",onClick:a[5]||(a[5]=t=>C(!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("vacationSchedule.reject")),1)]),_:1})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(r.ElButton),{disabled:j.value,plain:"",onClick:l.exportToExcel,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.exportExcel")),1)]),_:1},8,["disabled","onClick"])),[[p,j.value]]),e.createVNode(e.unref(r.ElDialog),{title:e.unref(u)("workSchedule.jobTitle"),modelValue:f.value,"onUpdate:modelValue":a[7]||(a[7]=t=>f.value=t),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(r.ElButton),{onClick:a[6]||(a[6]=t=>f.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(r.ElButton),{size:"default",type:"primary",onClick:M},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(r.ElForm),{model:S.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.value,t=>(e.openBlock(),e.createBlock(e.unref(r.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElSwitch),{modelValue:t.val,"onUpdate:modelValue":N=>t.val=N,"active-text":t.activeText},null,8,["modelValue","onUpdate:modelValue","active-text"])]),_:2},1024))),256))]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(r.ElDialog),{title:e.unref(u)("vacationSchedule.pleaseCoordinate"),modelValue:d.value,"onUpdate:modelValue":a[10]||(a[10]=t=>d.value=t),width:"500px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(r.ElButton),{onClick:a[9]||(a[9]=t=>d.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(r.ElButton),{size:"default",type:"primary",onClick:V},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("vacationSchedule.send")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(r.ElForm),{model:B.value,autocomplete:"on"},{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElSelect),{modelValue:B.value.participants,"onUpdate:modelValue":a[8]||(a[8]=t=>B.value.participants=t),placeholder:e.unref(u)("vacationSchedule.fullName"),multiple:"",size:"default"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,t=>(e.openBlock(),e.createBlock(e.unref(r.ElOption),{key:t,label:t,value:t},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(z.ContextMenu),{show:b.value,"onUpdate:show":a[14]||(a[14]=t=>b.value=t),options:F.value},{default:e.withCtx(()=>[e.createVNode(e.unref(z.ContextMenuItem),{label:c.value.level===3&&typeof c.value.count<"u"?c.value.name+" "+c.value.count+" "+e.unref(u)("vacationSchedule.day",c.value.count):c.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(z.ContextMenuSeparator)),c.value.level===2?(e.openBlock(),e.createElementBlock("div",oe,[c.value.length>1?(e.openBlock(),e.createBlock(e.unref(z.ContextMenuItem),{key:0,label:e.unref(u)("vacationSchedule.deleteLast"),onClick:a[11]||(a[11]=t=>o("delete"))},null,8,["label"])):e.createCommentVNode("",!0),c.value.add?(e.openBlock(),e.createBlock(e.unref(z.ContextMenuItem),{key:1,label:e.unref(u)("vacationSchedule.addVacation"),onClick:a[12]||(a[12]=t=>o("add"))},null,8,["label"])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",ue,[e.createVNode(le,{data:c.value,range:"range",onInput:i},null,8,["data"]),e.createElementVNode("div",null,[e.createVNode(e.unref(r.ElButton),{onClick:a[13]||(a[13]=t=>b.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("vacationSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(r.ElButton),{onClick:n},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("vacationSchedule.save")),1)]),_:1})])]))]),_:1},8,["show","options"])])}}};module.exports=re;
1
+ "use strict";const e=require("vue"),N=require("./index-CHGzf-XH.cjs"),J=require("vue-i18n"),Z=require("file-saver"),Q=require("exceljs"),r=require("element-plus"),z=require("@imengyu/vue3-context-menu");function ee(b){const E=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(b){for(const a in b)if(a!=="default"){const h=Object.getOwnPropertyDescriptor(b,a);Object.defineProperty(E,a,h.get?h:{enumerable:!0,get:()=>b[a]})}}return E.default=b,Object.freeze(E)}const te=ee(Q),le=(b,E)=>{const a=b.__vccOpts||b;for(const[h,c]of E)a[h]=c;return a},ae={class:"wrapper"},ne={class:"month_year"},oe={class:"text"},ue={class:"week"},re={class:"month"},de=["onClick"],ie={key:0},ce={class:"month_year"},se={class:"text"},ve={class:"week"},me={class:"month"},fe=["onClick"],ge={__name:"DataPicker",props:{data:Object,range:{type:String,default:()=>"solid"}},emits:["init"],setup(b,{emit:E}){var q,I,L,U;const a=e.ref(new Date),h=e.ref(new Date),c=b,F=E,y=e.ref(new Date().getFullYear()),T=e.ref(new Date().getMonth()),Y=e.ref(new Date().getFullYear()),m=e.ref(new Date().getMonth()),d=e.ref([]),$=e.ref(0),M=e.ref(0),C=e.ref(-1),x=e.ref(-1),{locale:A}=J.useI18n(),D=/en|zh|ja|he/.test(A.value)?0:1,B=s=>{const u=s.split(s.match(/\D.*?\D?/));return u[0].length>2?u.join("-")+"T00:00:01":u.reverse().join("-")+"T00:00:01"};typeof((q=c.data)==null?void 0:q.startDate)<"u"&&(a.value=new Date(B(c.data.startDate)),y.value=a.value.getFullYear(),m.value=a.value.getMonth()),typeof((I=c.data)==null?void 0:I.endDate)<"u"&&(h.value=new Date(B(c.data.endDate)),Y.value=h.value.getFullYear(),T.value=h.value.getMonth());const j=()=>{let s=new Date(y.value,m.value,0);for(let o=s.getDate()-s.getDay()+D;o<=s.getDate()&&s.getDay()!==6+D;o++)$.value++,d.value.push({day:o,month:s.getMonth(),year:s.getFullYear(),class:[]});for(let o=1;o<=new Date(y.value,m.value+1,0).getDate();o++)$.value++,d.value.push({day:o,month:m.value,year:y.value,class:[]});if(c.range==="range"){M.value=new Date(y.value,m.value+2,0);for(let o=1;o<=M.value.getDate();o++)d.value.push({day:o,month:M.value.getMonth(),year:M.value.getFullYear(),class:[]})}let u=c.range==="range"?2:1,i=new Date(y.value,m.value+u,1);for(let o=1;o<=(7-i.getDay()+D)%7&&i.getDay()!==D;o++)d.value.push({day:o,month:i.getMonth(),year:i.getFullYear(),class:[]});c.data.holiday.length!==0&&(c.data.holiday.preholidays.forEach(o=>{let g=o.split("-");const V=d.value.findIndex(S=>S.year==g[0]&&S.month+1==g[1]&&S.day==g[2]);V!==-1&&(d.value[V].class[0]="preholiday")}),c.data.holiday.holidays.forEach(o=>{let g=o.split("-");const V=d.value.findIndex(S=>S.year==g[0]&&S.month+1==g[1]&&S.day==g[2]);V!==-1&&(d.value[V].class[0]="weekend")}),c.data.holiday.holiday.forEach(o=>{let g=o.split("-");const V=d.value.findIndex(S=>S.year==g[0]&&S.month+1==g[1]&&S.day==g[2]);V!==-1&&(d.value[V].class[0]="holiday")}),c.data.holiday.nowork.forEach(o=>{let g=o.split("-");const V=d.value.findIndex(S=>S.year==g[0]&&S.month+1==g[1]&&S.day==g[2]);V!==-1&&(d.value[V].class[0]="nowork")}))},v=(s,u)=>{let i=s-u+1;for(let o=0;o<=s-u;o++)d.value[o+u].class[0]==="holiday"&&i--;return i},O=(s,u)=>{const i=N.parseTime(new Date(s.year,s.month,s.day),"{dd}.{m}.{Y}");if(c.range==="range")if(console.log(C.value),x.value!==-1){if(x.value<=C.value)for(let o=x.value;o<=C.value;o++)d.value[o].class[1]="";else for(let o=C.value;o<=x.value;o++)d.value[o].class[1]="";C.value=u,x.value=-1,d.value[u].class[1]="active"}else if(C.value!==-1){if(x.value=u,x.value>=C.value)for(let g=C.value+1;g<u;g++)d.value[g].class[1]="select";else for(let g=u+1;g<C.value;g++)d.value[g].class[1]="select";d.value[u].class[1]="active";let o=N.parseTime(new Date(d.value[C.value].year,d.value[C.value].month,d.value[C.value].day),"{dd}.{m}.{Y}");C.value>u?F("input",{dateStart:i,dateEnd:o,count:v(C.value,u)}):F("input",{dateStart:o,dateEnd:i,count:v(u,C.value)})}else C.value=u,d.value[u].class[1]="active";else d.value[C.value].class[1]="",C.value=u,d.value[u].class[1]="active",F("input",{dateStart:i,count:1})};if(j(),typeof((L=c.data)==null?void 0:L.startDate)<"u"&&(C.value=d.value.findIndex(s=>s.day===a.value.getDate()&&s.month===m.value&&s.year===y.value),d.value[C.value].class[1]="active"),typeof((U=c.data)==null?void 0:U.endDate)<"u"&&c.range==="range"){x.value=d.value.findIndex(s=>s.day===h.value.getDate()&&s.month===T.value&&s.year===Y.value),d.value[x.value].class[1]="active";for(let s=C.value+1;s<x.value;s++)d.value[s].class[1]="select"}const p=(s,u)=>{d.value=[],$.value=0,a.value=new Date(s,u,1),y.value=a.value.getFullYear(),m.value=a.value.getMonth(),j()};return(s,u)=>(e.openBlock(),e.createElementBlock("div",ae,[e.createElementVNode("div",null,[e.createElementVNode("p",ne,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:u[0]||(u[0]=i=>p(y.value-1,m.value))},"«"),e.createElementVNode("button",{onClick:u[1]||(u[1]=i=>p(y.value,m.value-1))},"‹")]),e.createElementVNode("span",oe,[e.createElementVNode("button",null,e.toDisplayString(y.value),1),e.createElementVNode("button",null,e.toDisplayString(e.unref(N.parseTime)(a.value,"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:u[2]||(u[2]=i=>p(y.value,m.value+1))},"›"),e.createElementVNode("button",{onClick:u[3]||(u[3]=i=>p(y.value+1,m.value))},"»")])]),e.createElementVNode("div",ue,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(i,o)=>e.createElementVNode("button",{key:o,class:"disabled"},e.toDisplayString(e.unref(N.parseTime)(new Date(1970,1,i+e.unref(D)),"{D}")),1)),64))]),e.createElementVNode("div",re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(i,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:o},[o<$.value+(7-new Date(y.value,m.value+1,1).getDay()+e.unref(D))%7?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(i.month===m.value?i.class:"disabled"),onClick:()=>{i.month===m.value&&O(i,o)}},e.toDisplayString(i.day),11,de)):e.createCommentVNode("",!0)],64))),128))])]),c.range==="range"?(e.openBlock(),e.createElementBlock("div",ie,[e.createElementVNode("p",ce,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:u[4]||(u[4]=i=>p(y.value-1,m.value))},"«"),e.createElementVNode("button",{onClick:u[5]||(u[5]=i=>p(y.value,m.value-1))},"‹")]),e.createElementVNode("span",se,[e.createElementVNode("button",null,e.toDisplayString(new Date(y.value,m.value+1).getFullYear()),1),e.createElementVNode("button",null,e.toDisplayString(e.unref(N.parseTime)(a.value.setMonth(m.value+1),"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:u[6]||(u[6]=i=>p(y.value,m.value+1))},"›"),e.createElementVNode("button",{onClick:u[7]||(u[7]=i=>p(y.value+1,m.value))},"»")])]),e.createElementVNode("div",ve,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(i,o)=>e.createElementVNode("button",{key:o,class:"disabled"},e.toDisplayString(e.unref(N.parseTime)(new Date(1970,1,i+e.unref(D)),"{D}")),1)),64))]),e.createElementVNode("div",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(i,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:o},[o>=$.value-new Date(y.value,m.value+1,1).getDay()+e.unref(D)?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(i.month===M.value.getMonth()?i.class:"disabled"),onClick:()=>{i.month===M.value.getMonth()&&O(i,o)}},e.toDisplayString(i.day),11,fe)):e.createCommentVNode("",!0)],64))),128))])])):e.createCommentVNode("",!0)]))}},pe=le(ge,[["__scopeId","data-v-fef4c07c"]]),he={key:1,class:"controls-container",style:{"margin-top":".5rem"}},Ce={key:0},ye={key:1,style:{padding:"0 1rem .5rem"}},ke={__name:"VacationTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,query:String,fullName:{type:String,default:"Вы"}},setup(b){const E=b,{t:a}=J.useI18n(),h=e.ref([]);e.ref([]);const c=e.ref(new Date().getFullYear()),F=e.ref(!1),y=e.ref(!1),T=e.ref(!1),Y=e.ref({zIndex:3,minWidth:230,x:500,y:200}),m=e.ref(!1),d=e.ref(!1),$=e.ref({participants:[]}),M=e.ref([]),C=e.ref([]),x=e.ref("all"),A=e.ref([{value:"all",label:a("vacationSchedule.all"),key:"all"}]),D=e.ref(!1),B=e.ref([]),j=e.ref(!1),v=e.ref({name:"Имя",length:0,code:""}),O=new Date().getMonth()>11?[{value:c.value,label:c.value},{value:c.value+1,label:c.value+1}]:[{value:c.value-1,label:c.value-1},{value:c.value,label:c.value}];e.watch(x,async(n,t)=>{n!==t&&(B.value=[],F.value=!1,E.odata.personalManagerData.forEach(f=>{(f.Status!=="Увольнение"&&f.Group===n||n==="all")&&(B.value.some(l=>(l==null?void 0:l.activeText)===f.Role)||B.value.push({val:!0,activeText:f.Role}))}),I())});const p=e.computed(()=>h.value.flatMap((n,t)=>!n.days||n.days.length===0?[{...n,key:0,ids:t}]:n.days.map((f,l)=>({ids:t,key:l,...n,...f})))),q=async()=>{E.odata.getPersonalManagerData({}).then(n=>{var t;x.value=(t=n.find(f=>f.Status!=="Увольнение"&&f.Description===E.fullName))==null?void 0:t.Group,n.forEach(f=>{f.Status!=="Увольнение"&&(A.value.some(l=>(l==null?void 0:l.value)===f.Group)||A.value.push({value:f.Group,label:f.Group,key:f.Group}),f.Group===x.value&&!B.value.some(l=>(l==null?void 0:l.activeText)===f.Role)&&B.value.push({val:!0,activeText:f.Role}))}),I(),y.value=!1})},I=()=>{h.value=[];let n=[];E.odata.personalManagerData.forEach(t=>{t.Status!=="Увольнение"&&(t.Group===x.value||x.value==="all")&&B.value.some(f=>f.val&&f.activeText===t.Role)&&(n.push(t.Code),h.value.push({name:t.Description,days:[{note:""}],jobTitle:t.Role,code:t.Code}))}),L(n),m.value=!1},L=n=>{E.workSchedule.getAllVacations({year:c.value}).then(t=>{n.forEach((f,l)=>{h.value[l].days=[{note:""}],t.forEach(k=>{f===k.code&&(typeof h.value[l].days[0].dateStart>"u"?h.value[l].days[0]={dateStart:N.parseTime(k.dateStart,"{dd}.{m}.{Y}"),dateEnd:N.parseTime(k.dateEnd,"{dd}.{m}.{Y}"),note:k.note,count:k.count}:h.value[l].days.push({dateStart:N.parseTime(k.dateStart,"{dd}.{m}.{Y}"),dateEnd:N.parseTime(k.dateEnd,"{dd}.{m}.{Y}"),note:k.note,count:k.count}))})})})},U=n=>{if(n.columnIndex<3&&p.value[n.rowIndex].key<p.value[n.rowIndex].days.length)return p.value[n.rowIndex].key===0?{rowspan:p.value[n.rowIndex].days.length,colspan:1}:{rowspan:0,colspan:0}},s=(n,t,f,l)=>{v.value.ids=n.ids,v.value.key=n.key,v.value.startDate=n.dateStart,v.value.endDate=n.dateEnd,v.value.name=n.name,v.value.count=n.count,v.value.length=n.days.length,v.value.add=n.days.length>0&&n.days[n.days.length-1].count,v.value.level=t.level,v.value.holiday=C.value,Y.value.y=l.clientY,Y.value.x=l.clientX,t.level===2&&t.no<4&&(v.value.add||n.days.length>1)&&(T.value=!0),t.level===3&&(T.value=!0)},u=n=>{let t=h.value[v.value.ids];switch(n){case"add":t.days.push({note:""}),console.log(t.days.length);break;case"delete":delete t.days.pop(),g(v.value.ids);break}T.value=!1},i=n=>{j.value=n,v.value.count=n.count},o=()=>{j.value&&(h.value[v.value.ids].days[v.value.key]={...j.value,note:""},g(v.value.ids)),T.value=!1},g=n=>{E.workSchedule.rewriteFull({year:c.value,code:h.value[n].code,data:h.value[n].days.map(t=>({dateStart:t.dateStart.split(".").reverse().join("-"),dateEnd:t.dateEnd.split(".").reverse().join("-"),note:t.note,count:t.count}))})},V=n=>{E.workSchedule.sendConfirmMessage({fullname:E.fullName,confirm:n}),E.query=""},S=()=>{E.workSchedule.sendAgreementMessage({users:$.value.participants}),d.value=!1};E.workSchedule.getBoss().then(n=>{M.value=n[0].users}),N.holidays().then(n=>{C.value=n,q()});const W=async()=>{D.value=!0;const n=new te.Workbook,t=n.addWorksheet(c.value.toString(),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),f={vertical:"middle",horizontal:"center"},l={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},k={vertical:"middle",horizontal:"center",wrapText:!0},P={vertical:"middle",horizontal:"right",wrapText:!0};t.mergeCells("D1:G1"),t.mergeCells("D2:G2"),t.mergeCells("D3:G3"),t.mergeCells("D4:G4"),t.mergeCells("A5:G5"),t.mergeCells("A6:G6"),t.mergeCells("A9:G9"),t.mergeCells("A10:A11"),t.mergeCells("B10:B11"),t.mergeCells("C10:C11"),t.mergeCells("D10:F10"),t.mergeCells("G10:G11"),t.getCell("D1").value=a("vacationSchedule.approve"),t.getCell("D2").value=a("vacationSchedule.dateApprove",{year:c.value-1}),t.getCell("D3").value=a("workSchedule.printPlace"),t.getCell("D4").value=a("vacationSchedule.dateApprove",{year:c.value-1}),t.getCell("A5").value=a("workSchedule.firm"),t.getCell("B7").value=a("vacationSchedule.vacationSchedule"),t.getCell("C7").value=a("vacationSchedule.numberDocs"),t.getCell("D7").value=a("vacationSchedule.compilation"),t.getCell("E7").value=a("vacationSchedule.year"),t.getCell("C8").value="",t.getCell("D8").value="",t.getCell("E8").value=c.value,t.getCell("E7").value=a("vacationSchedule.year"),t.getCell("A10").value=a("vacationSchedule.jobTitle"),t.getCell("B10").value=a("vacationSchedule.fullName"),t.getCell("C10").value=a("vacationSchedule.personnelNumber"),t.getCell("D10").value=a("vacationSchedule.vacation"),t.getCell("D11").value=a("vacationSchedule.days"),t.getCell("E11").value=a("vacationSchedule.date"),t.getCell("F11").value=a("vacationSchedule.endDate"),t.getCell("G11").value=a("vacationSchedule.note"),t.getRow(1).height=80,t.getColumn(1).width=28,t.getColumn(2).width=28,t.getColumn(3).width=18,t.getColumn(4).width=18,t.getColumn(5).width=14,t.getColumn(6).width=14,t.getColumn(7).width=14,t.getColumn(1).alignment=k,t.getColumn(2).alignment=k,t.getColumn(3).alignment=k,t.getColumn(4).alignment=k,t.getColumn(5).alignment=k,t.getColumn(6).alignment=k,t.getColumn(7).alignment=k,t.getCell("D1").alignment=P,t.getCell("D2").alignment=P,t.getCell("D4").alignment=P,t.getCell("A5").alignment=f,t.getCell("C7").border=l,t.getCell("D7").border=l,t.getCell("E7").border=l,t.getCell("C8").border=l,t.getCell("D8").border=l,t.getCell("E8").border=l,t.getCell("A10").border=l,t.getCell("B10").border=l,t.getCell("C10").border=l,t.getCell("D10").border=l,t.getCell("G10").border=l,t.getCell("D11").border=l,t.getCell("E11").border=l,t.getCell("F11").border=l;let _=11;for(const w of h.value)if(w.days.length>1)w.days.forEach(G=>{let R=[w.jobTitle,w.name,w.code,G.count,G.dateStart,G.dateEnd,G.note];const K=t.addRow(R);K.border=l,_++}),t.mergeCells(`A${_-w.days.length+1}:A${_}`),t.mergeCells(`B${_-w.days.length+1}:B${_}`),t.mergeCells(`C${_-w.days.length+1}:C${_}`);else{let G=[w.jobTitle,w.name,w.code,w.days[0].count,w.days[0].dateStart,w.days[0].dateEnd,w.days[0].note];const R=t.addRow(G);R.border=l,_++}const X="export_"+N.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",H=await n.xlsx.writeBuffer();Z.saveAs(new Blob([H]),X),D.value=!1};return(n,t)=>{const f=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",null,[b.checkEdit?(e.openBlock(),e.createBlock(e.unref(r.ElSelect),{key:0,modelValue:x.value,"onUpdate:modelValue":t[0]||(t[0]=l=>x.value=l),placeholder:"Select",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.value,l=>(e.openBlock(),e.createBlock(e.unref(r.ElOption),{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),e.createVNode(e.unref(r.ElButton),{plain:"",onClick:t[1]||(t[1]=l=>m.value=!0),style:{"margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("workSchedule.jobTitle")),1)]),_:1}),e.createVNode(e.unref(r.ElSelect),{modelValue:c.value,"onUpdate:modelValue":t[2]||(t[2]=l=>c.value=l),onChange:I,placeholder:"Year",style:{width:"80px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(O),l=>(e.openBlock(),e.createBlock(e.unref(r.ElOption),{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),e.createVNode(e.unref(r.ElSkeleton),{style:{width:"100%"},loading:y.value,animated:""},{template:e.withCtx(()=>[e.createVNode(e.unref(r.ElSkeletonItem),{variant:"text",style:{width:"100%",height:"2rem"}}),e.createVNode(e.unref(r.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"4rem","margin-right":"4px"}}),e.createVNode(e.unref(r.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"4rem"}}),e.createVNode(e.unref(r.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"8rem","margin-right":"4px"}}),e.createVNode(e.unref(r.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"8rem"}})]),default:e.withCtx(()=>[e.createVNode(e.unref(r.ElTable),{id:"printTable",data:p.value,"span-method":U,onCellClick:s,border:"",style:{width:"100%"},size:"small","empty-text":e.unref(a)("vacationSchedule.emptyText")},{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElTableColumn),{label:x.value!=="all"?e.unref(a)("vacationSchedule.title",{name:x.value}):e.unref(a)("vacationSchedule.enterprise")+` ${c.value}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(a)("vacationSchedule.jobTitle"),width:"180",align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(p.value[l.$index].jobTitle),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(a)("vacationSchedule.fullName"),width:"180",align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(p.value[l.$index].name),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(a)("vacationSchedule.personnelNumber"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(p.value[l.$index].code),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(a)("vacationSchedule.vacation"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(a)("vacationSchedule.days"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(p.value[l.$index].count),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(a)("vacationSchedule.date"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(p.value[l.$index].dateStart),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(a)("vacationSchedule.endDate"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(p.value[l.$index].dateEnd),1)]),_:1},8,["label"])]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(a)("vacationSchedule.note"),align:"center"},{default:e.withCtx(l=>[e.createVNode(e.unref(r.ElInput),{modelValue:h.value[p.value[l.$index].ids].days[p.value[l.$index].key].note,"onUpdate:modelValue":k=>h.value[p.value[l.$index].ids].days[p.value[l.$index].key].note=k,style:{width:"100%"},placeholder:" ",class:"noBorder",onBlur:k=>g(p.value[l.$index].ids)},null,8,["modelValue","onUpdate:modelValue","onBlur"])]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["data","empty-text"])]),_:1},8,["loading"]),b.checkEdit?(e.openBlock(),e.createElementBlock("div",he,[F.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(r.ElButton),{key:0,type:"primary",onClick:t[3]||(t[3]=l=>d.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("vacationSchedule.sendInformation")),1)]),_:1})),b.query==="confirm"?(e.openBlock(),e.createBlock(e.unref(r.ElButton),{key:1,type:"primary",onClick:t[4]||(t[4]=l=>V(!0))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("vacationSchedule.agreeOn")),1)]),_:1})):e.createCommentVNode("",!0),b.query==="confirm"?(e.openBlock(),e.createBlock(e.unref(r.ElButton),{key:2,type:"primary",onClick:t[5]||(t[5]=l=>V(!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("vacationSchedule.reject")),1)]),_:1})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(r.ElButton),{disabled:D.value,plain:"",onClick:W,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[f,D.value]]),e.createVNode(e.unref(r.ElDialog),{title:e.unref(a)("workSchedule.jobTitle"),modelValue:m.value,"onUpdate:modelValue":t[7]||(t[7]=l=>m.value=l),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(r.ElButton),{onClick:t[6]||(t[6]=l=>m.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(r.ElButton),{size:"default",type:"primary",onClick:I},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(r.ElForm),{model:B.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,l=>(e.openBlock(),e.createBlock(e.unref(r.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElSwitch),{modelValue:l.val,"onUpdate:modelValue":k=>l.val=k,"active-text":l.activeText},null,8,["modelValue","onUpdate:modelValue","active-text"])]),_:2},1024))),256))]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(r.ElDialog),{title:e.unref(a)("vacationSchedule.pleaseCoordinate"),modelValue:d.value,"onUpdate:modelValue":t[10]||(t[10]=l=>d.value=l),width:"500px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(r.ElButton),{onClick:t[9]||(t[9]=l=>d.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(r.ElButton),{size:"default",type:"primary",onClick:S},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("vacationSchedule.send")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(r.ElForm),{model:$.value,autocomplete:"on"},{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElSelect),{modelValue:$.value.participants,"onUpdate:modelValue":t[8]||(t[8]=l=>$.value.participants=l),placeholder:e.unref(a)("vacationSchedule.fullName"),multiple:"",size:"default"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,l=>(e.openBlock(),e.createBlock(e.unref(r.ElOption),{key:l,label:l,value:l},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(z.ContextMenu),{show:T.value,"onUpdate:show":t[14]||(t[14]=l=>T.value=l),options:Y.value},{default:e.withCtx(()=>[e.createVNode(e.unref(z.ContextMenuItem),{label:v.value.level===3&&typeof v.value.count<"u"?v.value.name+" "+v.value.count+" "+e.unref(a)("vacationSchedule.day",v.value.count):v.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(z.ContextMenuSeparator)),v.value.level===2?(e.openBlock(),e.createElementBlock("div",Ce,[v.value.length>1?(e.openBlock(),e.createBlock(e.unref(z.ContextMenuItem),{key:0,label:e.unref(a)("vacationSchedule.deleteLast"),onClick:t[11]||(t[11]=l=>u("delete"))},null,8,["label"])):e.createCommentVNode("",!0),v.value.add?(e.openBlock(),e.createBlock(e.unref(z.ContextMenuItem),{key:1,label:e.unref(a)("vacationSchedule.addVacation"),onClick:t[12]||(t[12]=l=>u("add"))},null,8,["label"])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",ye,[e.createVNode(pe,{data:v.value,range:"range",onInput:i},null,8,["data"]),e.createElementVNode("div",null,[e.createVNode(e.unref(r.ElButton),{onClick:t[13]||(t[13]=l=>T.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("vacationSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(r.ElButton),{onClick:o},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("vacationSchedule.save")),1)]),_:1})])]))]),_:1},8,["show","options"])])}}};module.exports=ke;
@@ -1,14 +1,16 @@
1
- import { ref as f, openBlock as p, createElementBlock as E, createElementVNode as y, toDisplayString as k, unref as e, Fragment as G, renderList as P, normalizeClass as ne, createCommentVNode as z, watch as se, computed as ve, resolveDirective as ie, createBlock as Y, withCtx as i, createVNode as v, createTextVNode as V, withDirectives as re } from "vue";
2
- import { p as O, h as ce } from "./index-uVRk2ARj.js";
3
- import { useI18n as de } from "vue-i18n";
4
- import { ElSelect as ae, ElOption as le, ElButton as F, ElSkeleton as fe, ElSkeletonItem as K, ElTable as pe, ElTableColumn as q, ElInput as he, ElDialog as ue, ElForm as oe, ElFormItem as me, ElSwitch as ye } from "element-plus";
5
- import { ContextMenu as ge, ContextMenuItem as te, ContextMenuSeparator as be } from "@imengyu/vue3-context-menu";
6
- const xe = (j, M) => {
7
- const o = j.__vccOpts || j;
8
- for (const [w, h] of M)
9
- o[w] = h;
10
- return o;
11
- }, ke = { class: "wrapper" }, De = { class: "month_year" }, Se = { class: "text" }, we = { class: "week" }, Ce = { class: "month" }, Ee = ["onClick"], $e = { key: 0 }, Ve = { class: "month_year" }, Me = { class: "text" }, _e = { class: "week" }, Ie = { class: "month" }, Te = ["onClick"], Ye = {
1
+ import { ref as h, openBlock as m, createElementBlock as $, createElementVNode as y, toDisplayString as D, unref as a, Fragment as R, renderList as L, normalizeClass as ie, createCommentVNode as U, watch as fe, computed as ye, resolveDirective as Ce, createBlock as F, withCtx as r, createVNode as v, createTextVNode as M, withDirectives as be } from "vue";
2
+ import { p as A, h as De } from "./index-uVRk2ARj.js";
3
+ import { useI18n as ce } from "vue-i18n";
4
+ import { saveAs as Se } from "file-saver";
5
+ import * as we from "exceljs";
6
+ import { ElSelect as oe, ElOption as de, ElButton as G, ElSkeleton as xe, ElSkeletonItem as Q, ElTable as ke, ElTableColumn as P, ElInput as Ee, ElDialog as ve, ElForm as re, ElFormItem as $e, ElSwitch as Ve } from "element-plus";
7
+ import { ContextMenu as Me, ContextMenuItem as se, ContextMenuSeparator as _e } from "@imengyu/vue3-context-menu";
8
+ const Te = (j, _) => {
9
+ const t = j.__vccOpts || j;
10
+ for (const [k, i] of _)
11
+ t[k] = i;
12
+ return t;
13
+ }, Ie = { class: "wrapper" }, Ye = { class: "month_year" }, Be = { class: "text" }, Fe = { class: "week" }, Ge = { class: "month" }, Ae = ["onClick"], je = { key: 0 }, ze = { class: "month_year" }, Ne = { class: "text" }, Ue = { class: "week" }, Re = { class: "month" }, Oe = ["onClick"], Pe = {
12
14
  __name: "DataPicker",
13
15
  props: {
14
16
  data: Object,
@@ -16,169 +18,169 @@ const xe = (j, M) => {
16
18
  // range | solid
17
19
  },
18
20
  emits: ["init"],
19
- setup(j, { emit: M }) {
20
- var Z, A, Q, ee;
21
- const o = f(/* @__PURE__ */ new Date()), w = f(/* @__PURE__ */ new Date()), h = j, L = M, S = f((/* @__PURE__ */ new Date()).getFullYear()), N = f((/* @__PURE__ */ new Date()).getMonth()), J = f((/* @__PURE__ */ new Date()).getFullYear()), m = f((/* @__PURE__ */ new Date()).getMonth()), d = f([]), B = f(0), R = f(0), D = f(-1), C = f(-1), { locale: X } = de(), U = /en|zh|ja|he/.test(X.value) ? 0 : 1, H = (r) => {
22
- const u = r.split(r.match(/\D.*?\D?/));
23
- return u[0].length > 2 ? u.join("-") + "T00:00:01" : u.reverse().join("-") + "T00:00:01";
21
+ setup(j, { emit: _ }) {
22
+ var le, W, ae, te;
23
+ const t = h(/* @__PURE__ */ new Date()), k = h(/* @__PURE__ */ new Date()), i = j, J = _, w = h((/* @__PURE__ */ new Date()).getFullYear()), z = h((/* @__PURE__ */ new Date()).getMonth()), X = h((/* @__PURE__ */ new Date()).getFullYear()), p = h((/* @__PURE__ */ new Date()).getMonth()), d = h([]), N = h(0), O = h(0), S = h(-1), E = h(-1), { locale: Z } = ce(), Y = /en|zh|ja|he/.test(Z.value) ? 0 : 1, B = (c) => {
24
+ const o = c.split(c.match(/\D.*?\D?/));
25
+ return o[0].length > 2 ? o.join("-") + "T00:00:01" : o.reverse().join("-") + "T00:00:01";
24
26
  };
25
- typeof ((Z = h.data) == null ? void 0 : Z.startDate) < "u" && (o.value = new Date(H(h.data.startDate)), S.value = o.value.getFullYear(), m.value = o.value.getMonth()), typeof ((A = h.data) == null ? void 0 : A.endDate) < "u" && (w.value = new Date(H(h.data.endDate)), J.value = w.value.getFullYear(), N.value = w.value.getMonth());
26
- const T = () => {
27
- let r = new Date(S.value, m.value, 0);
28
- for (let n = r.getDate() - r.getDay() + U; n <= r.getDate() && r.getDay() !== 6 + U; n++)
29
- B.value++, d.value.push({ day: n, month: r.getMonth(), year: r.getFullYear(), class: [] });
30
- for (let n = 1; n <= new Date(S.value, m.value + 1, 0).getDate(); n++)
31
- B.value++, d.value.push({ day: n, month: m.value, year: S.value, class: [] });
32
- if (h.range === "range") {
33
- R.value = new Date(S.value, m.value + 2, 0);
34
- for (let n = 1; n <= R.value.getDate(); n++)
35
- d.value.push({ day: n, month: R.value.getMonth(), year: R.value.getFullYear(), class: [] });
27
+ typeof ((le = i.data) == null ? void 0 : le.startDate) < "u" && (t.value = new Date(B(i.data.startDate)), w.value = t.value.getFullYear(), p.value = t.value.getMonth()), typeof ((W = i.data) == null ? void 0 : W.endDate) < "u" && (k.value = new Date(B(i.data.endDate)), X.value = k.value.getFullYear(), z.value = k.value.getMonth());
28
+ const H = () => {
29
+ let c = new Date(w.value, p.value, 0);
30
+ for (let u = c.getDate() - c.getDay() + Y; u <= c.getDate() && c.getDay() !== 6 + Y; u++)
31
+ N.value++, d.value.push({ day: u, month: c.getMonth(), year: c.getFullYear(), class: [] });
32
+ for (let u = 1; u <= new Date(w.value, p.value + 1, 0).getDate(); u++)
33
+ N.value++, d.value.push({ day: u, month: p.value, year: w.value, class: [] });
34
+ if (i.range === "range") {
35
+ O.value = new Date(w.value, p.value + 2, 0);
36
+ for (let u = 1; u <= O.value.getDate(); u++)
37
+ d.value.push({ day: u, month: O.value.getMonth(), year: O.value.getFullYear(), class: [] });
36
38
  }
37
- let u = h.range === "range" ? 2 : 1, s = new Date(S.value, m.value + u, 1);
38
- for (let n = 1; n <= (7 - s.getDay() + U) % 7 && s.getDay() !== U; n++)
39
- d.value.push({ day: n, month: s.getMonth(), year: s.getFullYear(), class: [] });
40
- h.data.holiday.length !== 0 && (h.data.holiday.preholidays.forEach((n) => {
41
- let g = n.split("-");
42
- const _ = d.value.findIndex(($) => $.year == g[0] && $.month + 1 == g[1] && $.day == g[2]);
43
- _ !== -1 && (d.value[_].class[0] = "preholiday");
44
- }), h.data.holiday.holidays.forEach((n) => {
45
- let g = n.split("-");
46
- const _ = d.value.findIndex(($) => $.year == g[0] && $.month + 1 == g[1] && $.day == g[2]);
47
- _ !== -1 && (d.value[_].class[0] = "weekend");
48
- }), h.data.holiday.holiday.forEach((n) => {
49
- let g = n.split("-");
50
- const _ = d.value.findIndex(($) => $.year == g[0] && $.month + 1 == g[1] && $.day == g[2]);
51
- _ !== -1 && (d.value[_].class[0] = "holiday");
52
- }), h.data.holiday.nowork.forEach((n) => {
53
- let g = n.split("-");
54
- const _ = d.value.findIndex(($) => $.year == g[0] && $.month + 1 == g[1] && $.day == g[2]);
55
- _ !== -1 && (d.value[_].class[0] = "nowork");
39
+ let o = i.range === "range" ? 2 : 1, s = new Date(w.value, p.value + o, 1);
40
+ for (let u = 1; u <= (7 - s.getDay() + Y) % 7 && s.getDay() !== Y; u++)
41
+ d.value.push({ day: u, month: s.getMonth(), year: s.getFullYear(), class: [] });
42
+ i.data.holiday.length !== 0 && (i.data.holiday.preholidays.forEach((u) => {
43
+ let C = u.split("-");
44
+ const I = d.value.findIndex((V) => V.year == C[0] && V.month + 1 == C[1] && V.day == C[2]);
45
+ I !== -1 && (d.value[I].class[0] = "preholiday");
46
+ }), i.data.holiday.holidays.forEach((u) => {
47
+ let C = u.split("-");
48
+ const I = d.value.findIndex((V) => V.year == C[0] && V.month + 1 == C[1] && V.day == C[2]);
49
+ I !== -1 && (d.value[I].class[0] = "weekend");
50
+ }), i.data.holiday.holiday.forEach((u) => {
51
+ let C = u.split("-");
52
+ const I = d.value.findIndex((V) => V.year == C[0] && V.month + 1 == C[1] && V.day == C[2]);
53
+ I !== -1 && (d.value[I].class[0] = "holiday");
54
+ }), i.data.holiday.nowork.forEach((u) => {
55
+ let C = u.split("-");
56
+ const I = d.value.findIndex((V) => V.year == C[0] && V.month + 1 == C[1] && V.day == C[2]);
57
+ I !== -1 && (d.value[I].class[0] = "nowork");
56
58
  }));
57
- }, W = (r, u) => {
58
- let s = r - u + 1;
59
- for (let n = 0; n <= r - u; n++)
60
- d.value[n + u].class[0] === "holiday" && s--;
59
+ }, g = (c, o) => {
60
+ let s = c - o + 1;
61
+ for (let u = 0; u <= c - o; u++)
62
+ d.value[u + o].class[0] === "holiday" && s--;
61
63
  return s;
62
- }, c = (r, u) => {
63
- const s = O(new Date(r.year, r.month, r.day), "{dd}.{m}.{Y}");
64
- if (h.range === "range")
65
- if (console.log(D.value), C.value !== -1) {
66
- if (C.value <= D.value)
67
- for (let n = C.value; n <= D.value; n++) d.value[n].class[1] = "";
68
- else for (let n = D.value; n <= C.value; n++) d.value[n].class[1] = "";
69
- D.value = u, C.value = -1, d.value[u].class[1] = "active";
70
- } else if (D.value !== -1) {
71
- if (C.value = u, C.value >= D.value)
72
- for (let g = D.value + 1; g < u; g++) d.value[g].class[1] = "select";
73
- else for (let g = u + 1; g < D.value; g++) d.value[g].class[1] = "select";
74
- d.value[u].class[1] = "active";
75
- let n = O(new Date(d.value[D.value].year, d.value[D.value].month, d.value[D.value].day), "{dd}.{m}.{Y}");
76
- D.value > u ? L("input", { dateStart: s, dateEnd: n, count: W(D.value, u) }) : L("input", { dateStart: n, dateEnd: s, count: W(u, D.value) });
64
+ }, ee = (c, o) => {
65
+ const s = A(new Date(c.year, c.month, c.day), "{dd}.{m}.{Y}");
66
+ if (i.range === "range")
67
+ if (console.log(S.value), E.value !== -1) {
68
+ if (E.value <= S.value)
69
+ for (let u = E.value; u <= S.value; u++) d.value[u].class[1] = "";
70
+ else for (let u = S.value; u <= E.value; u++) d.value[u].class[1] = "";
71
+ S.value = o, E.value = -1, d.value[o].class[1] = "active";
72
+ } else if (S.value !== -1) {
73
+ if (E.value = o, E.value >= S.value)
74
+ for (let C = S.value + 1; C < o; C++) d.value[C].class[1] = "select";
75
+ else for (let C = o + 1; C < S.value; C++) d.value[C].class[1] = "select";
76
+ d.value[o].class[1] = "active";
77
+ let u = A(new Date(d.value[S.value].year, d.value[S.value].month, d.value[S.value].day), "{dd}.{m}.{Y}");
78
+ S.value > o ? J("input", { dateStart: s, dateEnd: u, count: g(S.value, o) }) : J("input", { dateStart: u, dateEnd: s, count: g(o, S.value) });
77
79
  } else
78
- D.value = u, d.value[u].class[1] = "active";
80
+ S.value = o, d.value[o].class[1] = "active";
79
81
  else
80
- d.value[D.value].class[1] = "", D.value = u, d.value[u].class[1] = "active", L("input", { dateStart: s, count: 1 });
82
+ d.value[S.value].class[1] = "", S.value = o, d.value[o].class[1] = "active", J("input", { dateStart: s, count: 1 });
81
83
  };
82
- if (T(), typeof ((Q = h.data) == null ? void 0 : Q.startDate) < "u" && (D.value = d.value.findIndex((r) => r.day === o.value.getDate() && r.month === m.value && r.year === S.value), d.value[D.value].class[1] = "active"), typeof ((ee = h.data) == null ? void 0 : ee.endDate) < "u" && h.range === "range") {
83
- C.value = d.value.findIndex((r) => r.day === w.value.getDate() && r.month === N.value && r.year === J.value), d.value[C.value].class[1] = "active";
84
- for (let r = D.value + 1; r < C.value; r++) d.value[r].class[1] = "select";
84
+ if (H(), typeof ((ae = i.data) == null ? void 0 : ae.startDate) < "u" && (S.value = d.value.findIndex((c) => c.day === t.value.getDate() && c.month === p.value && c.year === w.value), d.value[S.value].class[1] = "active"), typeof ((te = i.data) == null ? void 0 : te.endDate) < "u" && i.range === "range") {
85
+ E.value = d.value.findIndex((c) => c.day === k.value.getDate() && c.month === z.value && c.year === X.value), d.value[E.value].class[1] = "active";
86
+ for (let c = S.value + 1; c < E.value; c++) d.value[c].class[1] = "select";
85
87
  }
86
- const x = (r, u) => {
87
- d.value = [], B.value = 0, o.value = new Date(r, u, 1), S.value = o.value.getFullYear(), m.value = o.value.getMonth(), T();
88
+ const b = (c, o) => {
89
+ d.value = [], N.value = 0, t.value = new Date(c, o, 1), w.value = t.value.getFullYear(), p.value = t.value.getMonth(), H();
88
90
  };
89
- return (r, u) => (p(), E("div", ke, [
91
+ return (c, o) => (m(), $("div", Ie, [
90
92
  y("div", null, [
91
- y("p", De, [
93
+ y("p", Ye, [
92
94
  y("span", null, [
93
95
  y("button", {
94
- onClick: u[0] || (u[0] = (s) => x(S.value - 1, m.value))
96
+ onClick: o[0] || (o[0] = (s) => b(w.value - 1, p.value))
95
97
  }, "«"),
96
98
  y("button", {
97
- onClick: u[1] || (u[1] = (s) => x(S.value, m.value - 1))
99
+ onClick: o[1] || (o[1] = (s) => b(w.value, p.value - 1))
98
100
  }, "‹")
99
101
  ]),
100
- y("span", Se, [
101
- y("button", null, k(S.value), 1),
102
- y("button", null, k(e(O)(o.value, "{F}")), 1)
102
+ y("span", Be, [
103
+ y("button", null, D(w.value), 1),
104
+ y("button", null, D(a(A)(t.value, "{F}")), 1)
103
105
  ]),
104
106
  y("span", null, [
105
107
  y("button", {
106
- onClick: u[2] || (u[2] = (s) => x(S.value, m.value + 1))
108
+ onClick: o[2] || (o[2] = (s) => b(w.value, p.value + 1))
107
109
  }, "›"),
108
110
  y("button", {
109
- onClick: u[3] || (u[3] = (s) => x(S.value + 1, m.value))
111
+ onClick: o[3] || (o[3] = (s) => b(w.value + 1, p.value))
110
112
  }, "»")
111
113
  ])
112
114
  ]),
113
- y("div", we, [
114
- (p(), E(G, null, P(7, (s, n) => y("button", {
115
- key: n,
115
+ y("div", Fe, [
116
+ (m(), $(R, null, L(7, (s, u) => y("button", {
117
+ key: u,
116
118
  class: "disabled"
117
- }, k(e(O)(new Date(1970, 1, s + e(U)), "{D}")), 1)), 64))
119
+ }, D(a(A)(new Date(1970, 1, s + a(Y)), "{D}")), 1)), 64))
118
120
  ]),
119
- y("div", Ce, [
120
- (p(!0), E(G, null, P(d.value, (s, n) => (p(), E(G, { key: n }, [
121
- n < B.value + (7 - new Date(S.value, m.value + 1, 1).getDay() + e(U)) % 7 ? (p(), E("button", {
121
+ y("div", Ge, [
122
+ (m(!0), $(R, null, L(d.value, (s, u) => (m(), $(R, { key: u }, [
123
+ u < N.value + (7 - new Date(w.value, p.value + 1, 1).getDay() + a(Y)) % 7 ? (m(), $("button", {
122
124
  key: 0,
123
- class: ne(s.month === m.value ? s.class : "disabled"),
125
+ class: ie(s.month === p.value ? s.class : "disabled"),
124
126
  onClick: () => {
125
- s.month === m.value && c(s, n);
127
+ s.month === p.value && ee(s, u);
126
128
  }
127
- }, k(s.day), 11, Ee)) : z("", !0)
129
+ }, D(s.day), 11, Ae)) : U("", !0)
128
130
  ], 64))), 128))
129
131
  ])
130
132
  ]),
131
- h.range === "range" ? (p(), E("div", $e, [
132
- y("p", Ve, [
133
+ i.range === "range" ? (m(), $("div", je, [
134
+ y("p", ze, [
133
135
  y("span", null, [
134
136
  y("button", {
135
- onClick: u[4] || (u[4] = (s) => x(S.value - 1, m.value))
137
+ onClick: o[4] || (o[4] = (s) => b(w.value - 1, p.value))
136
138
  }, "«"),
137
139
  y("button", {
138
- onClick: u[5] || (u[5] = (s) => x(S.value, m.value - 1))
140
+ onClick: o[5] || (o[5] = (s) => b(w.value, p.value - 1))
139
141
  }, "‹")
140
142
  ]),
141
- y("span", Me, [
142
- y("button", null, k(new Date(S.value, m.value + 1).getFullYear()), 1),
143
- y("button", null, k(e(O)(o.value.setMonth(m.value + 1), "{F}")), 1)
143
+ y("span", Ne, [
144
+ y("button", null, D(new Date(w.value, p.value + 1).getFullYear()), 1),
145
+ y("button", null, D(a(A)(t.value.setMonth(p.value + 1), "{F}")), 1)
144
146
  ]),
145
147
  y("span", null, [
146
148
  y("button", {
147
- onClick: u[6] || (u[6] = (s) => x(S.value, m.value + 1))
149
+ onClick: o[6] || (o[6] = (s) => b(w.value, p.value + 1))
148
150
  }, "›"),
149
151
  y("button", {
150
- onClick: u[7] || (u[7] = (s) => x(S.value + 1, m.value))
152
+ onClick: o[7] || (o[7] = (s) => b(w.value + 1, p.value))
151
153
  }, "»")
152
154
  ])
153
155
  ]),
154
- y("div", _e, [
155
- (p(), E(G, null, P(7, (s, n) => y("button", {
156
- key: n,
156
+ y("div", Ue, [
157
+ (m(), $(R, null, L(7, (s, u) => y("button", {
158
+ key: u,
157
159
  class: "disabled"
158
- }, k(e(O)(new Date(1970, 1, s + e(U)), "{D}")), 1)), 64))
160
+ }, D(a(A)(new Date(1970, 1, s + a(Y)), "{D}")), 1)), 64))
159
161
  ]),
160
- y("div", Ie, [
161
- (p(!0), E(G, null, P(d.value, (s, n) => (p(), E(G, { key: n }, [
162
- n >= B.value - new Date(S.value, m.value + 1, 1).getDay() + e(U) ? (p(), E("button", {
162
+ y("div", Re, [
163
+ (m(!0), $(R, null, L(d.value, (s, u) => (m(), $(R, { key: u }, [
164
+ u >= N.value - new Date(w.value, p.value + 1, 1).getDay() + a(Y) ? (m(), $("button", {
163
165
  key: 0,
164
- class: ne(s.month === R.value.getMonth() ? s.class : "disabled"),
166
+ class: ie(s.month === O.value.getMonth() ? s.class : "disabled"),
165
167
  onClick: () => {
166
- s.month === R.value.getMonth() && c(s, n);
168
+ s.month === O.value.getMonth() && ee(s, u);
167
169
  }
168
- }, k(s.day), 11, Te)) : z("", !0)
170
+ }, D(s.day), 11, Oe)) : U("", !0)
169
171
  ], 64))), 128))
170
172
  ])
171
- ])) : z("", !0)
173
+ ])) : U("", !0)
172
174
  ]));
173
175
  }
174
- }, Fe = /* @__PURE__ */ xe(Ye, [["__scopeId", "data-v-fef4c07c"]]), je = {
176
+ }, qe = /* @__PURE__ */ Te(Pe, [["__scopeId", "data-v-fef4c07c"]]), Le = {
175
177
  key: 1,
176
178
  class: "controls-container",
177
179
  style: { "margin-top": ".5rem" }
178
- }, Ne = { key: 0 }, Be = {
180
+ }, We = { key: 0 }, Je = {
179
181
  key: 1,
180
182
  style: { padding: "0 1rem .5rem" }
181
- }, qe = {
183
+ }, ll = {
182
184
  __name: "VacationTable",
183
185
  props: {
184
186
  checkEdit: { type: Boolean, default: () => !0 },
@@ -188,7 +190,7 @@ const xe = (j, M) => {
188
190
  fullName: { type: String, default: "Вы" }
189
191
  },
190
192
  setup(j) {
191
- const M = j, { t: o } = de(), w = f([
193
+ const _ = j, { t } = ce(), k = h([
192
194
  // { name: 'Иванов Петр Михалыч',
193
195
  // jobTitle: '(Ведущий работник месяца)',
194
196
  // days: [{dateStart: "03.05.2024", dateEnd: "06.06.2024", note: 'забил - сказал он ослик', count: 14 },
@@ -207,269 +209,289 @@ const xe = (j, M) => {
207
209
  // code: '0000-00053'
208
210
  // }
209
211
  ]);
210
- f([]);
211
- const h = f((/* @__PURE__ */ new Date()).getFullYear()), L = f(!1), S = f(!1), N = f(!1), J = f({
212
+ h([]);
213
+ const i = h((/* @__PURE__ */ new Date()).getFullYear()), J = h(!1), w = h(!1), z = h(!1), X = h({
212
214
  zIndex: 3,
213
215
  minWidth: 230,
214
216
  x: 500,
215
217
  y: 200
216
- }), m = f(!1), d = f(!1), B = f({ participants: [] }), R = f([]), D = f([]), C = f("Сектор разработок и эксплуатации сети"), X = f([{ value: "all", label: o("vacationSchedule.all"), key: "all" }]), U = f([{ value: h.value, label: h.value }, { value: h.value + 1, label: h.value + 1 }]), H = f(!1), T = f([]), W = f(!1), c = f({ name: "Имя", length: 0, code: "" });
217
- se(C, async (t, l) => {
218
- t !== l && (T.value = [], L.value = !1, M.odata.personalManagerData.forEach((b) => {
219
- (b.Status !== "Увольнение" && b.Group === t || t === "all") && (T.value.some((a) => (a == null ? void 0 : a.activeText) === b.Role) || T.value.push({ val: !0, activeText: b.Role }));
220
- }), A());
218
+ }), p = h(!1), d = h(!1), N = h({ participants: [] }), O = h([]), S = h([]), E = h("all"), Z = h([{ value: "all", label: t("vacationSchedule.all"), key: "all" }]), Y = h(!1), B = h([]), H = h(!1), g = h({ name: "Имя", length: 0, code: "" }), ee = (/* @__PURE__ */ new Date()).getMonth() > 11 ? [{ value: i.value, label: i.value }, { value: i.value + 1, label: i.value + 1 }] : [{ value: i.value - 1, label: i.value - 1 }, { value: i.value, label: i.value }];
219
+ fe(E, async (n, e) => {
220
+ n !== e && (B.value = [], J.value = !1, _.odata.personalManagerData.forEach((f) => {
221
+ (f.Status !== "Увольнение" && f.Group === n || n === "all") && (B.value.some((l) => (l == null ? void 0 : l.activeText) === f.Role) || B.value.push({ val: !0, activeText: f.Role }));
222
+ }), W());
221
223
  });
222
- const x = ve(() => w.value.flatMap((t, l) => !t.days || t.days.length === 0 ? [{ ...t, key: 0, ids: l }] : t.days.map((b, a) => ({
223
- ids: l,
224
- key: a,
225
- ...t,
226
- ...b
227
- })))), Z = async () => {
228
- M.odata.getPersonalManagerData({}).then((t) => {
229
- var l;
230
- C.value = (l = t.find((b) => b.Status !== "Увольнение" && b.Description === M.fullName)) == null ? void 0 : l.Group, t.forEach((b) => {
231
- b.Status !== "Увольнение" && (X.value.some((a) => (a == null ? void 0 : a.value) === b.Group) || X.value.push({ value: b.Group, label: b.Group, key: b.Group }), b.Group === C.value && !T.value.some((a) => (a == null ? void 0 : a.activeText) === b.Role) && T.value.push({ val: !0, activeText: b.Role }));
232
- }), A(), S.value = !1;
224
+ const b = ye(() => k.value.flatMap((n, e) => !n.days || n.days.length === 0 ? [{ ...n, key: 0, ids: e }] : n.days.map((f, l) => ({
225
+ ids: e,
226
+ key: l,
227
+ ...n,
228
+ ...f
229
+ })))), le = async () => {
230
+ _.odata.getPersonalManagerData({}).then((n) => {
231
+ var e;
232
+ E.value = (e = n.find((f) => f.Status !== "Увольнение" && f.Description === _.fullName)) == null ? void 0 : e.Group, n.forEach((f) => {
233
+ f.Status !== "Увольнение" && (Z.value.some((l) => (l == null ? void 0 : l.value) === f.Group) || Z.value.push({ value: f.Group, label: f.Group, key: f.Group }), f.Group === E.value && !B.value.some((l) => (l == null ? void 0 : l.activeText) === f.Role) && B.value.push({ val: !0, activeText: f.Role }));
234
+ }), W(), w.value = !1;
233
235
  });
234
- }, A = () => {
235
- w.value = [];
236
- let t = [];
237
- M.odata.personalManagerData.forEach((l) => {
238
- l.Status !== "Увольнение" && (l.Group === C.value || C.value === "all") && T.value.some((b) => b.val && b.activeText === l.Role) && (t.push(l.Code), w.value.push({ name: l.Description, days: [{ note: "" }], jobTitle: l.Role, code: l.Code }));
239
- }), Q(t), m.value = !1;
240
- }, Q = (t) => {
241
- M.workSchedule.getAllVacations({ year: h.value }).then(
242
- (l) => {
243
- t.forEach((b, a) => {
244
- w.value[a].days = [{ note: "" }], l.forEach((I) => {
245
- b === I.code && (typeof w.value[a].days[0].dateStart > "u" ? w.value[a].days[0] = {
246
- dateStart: O(I.dateStart, "{dd}.{m}.{Y}"),
247
- dateEnd: O(I.dateEnd, "{dd}.{m}.{Y}"),
248
- note: I.note,
249
- count: I.count
250
- } : w.value[a].days.push({
251
- dateStart: O(I.dateStart, "{dd}.{m}.{Y}"),
252
- dateEnd: O(I.dateEnd, "{dd}.{m}.{Y}"),
253
- note: I.note,
254
- count: I.count
236
+ }, W = () => {
237
+ k.value = [];
238
+ let n = [];
239
+ _.odata.personalManagerData.forEach((e) => {
240
+ e.Status !== "Увольнение" && (e.Group === E.value || E.value === "all") && B.value.some((f) => f.val && f.activeText === e.Role) && (n.push(e.Code), k.value.push({ name: e.Description, days: [{ note: "" }], jobTitle: e.Role, code: e.Code }));
241
+ }), ae(n), p.value = !1;
242
+ }, ae = (n) => {
243
+ _.workSchedule.getAllVacations({ year: i.value }).then(
244
+ (e) => {
245
+ n.forEach((f, l) => {
246
+ k.value[l].days = [{ note: "" }], e.forEach((x) => {
247
+ f === x.code && (typeof k.value[l].days[0].dateStart > "u" ? k.value[l].days[0] = {
248
+ dateStart: A(x.dateStart, "{dd}.{m}.{Y}"),
249
+ dateEnd: A(x.dateEnd, "{dd}.{m}.{Y}"),
250
+ note: x.note,
251
+ count: x.count
252
+ } : k.value[l].days.push({
253
+ dateStart: A(x.dateStart, "{dd}.{m}.{Y}"),
254
+ dateEnd: A(x.dateEnd, "{dd}.{m}.{Y}"),
255
+ note: x.note,
256
+ count: x.count
255
257
  }));
256
258
  });
257
259
  });
258
260
  }
259
261
  );
260
- }, ee = (t) => {
261
- if (t.columnIndex < 3 && x.value[t.rowIndex].key < x.value[t.rowIndex].days.length)
262
- return x.value[t.rowIndex].key === 0 ? {
263
- rowspan: x.value[t.rowIndex].days.length,
262
+ }, te = (n) => {
263
+ if (n.columnIndex < 3 && b.value[n.rowIndex].key < b.value[n.rowIndex].days.length)
264
+ return b.value[n.rowIndex].key === 0 ? {
265
+ rowspan: b.value[n.rowIndex].days.length,
264
266
  colspan: 1
265
267
  } : {
266
268
  rowspan: 0,
267
269
  colspan: 0
268
270
  };
269
- }, r = (t, l, b, a) => {
270
- c.value.ids = t.ids, c.value.key = t.key, c.value.startDate = t.dateStart, c.value.endDate = t.dateEnd, c.value.name = t.name, c.value.count = t.count, c.value.length = t.days.length, c.value.add = t.days.length > 0 && t.days[t.days.length - 1].count, c.value.level = l.level, c.value.holiday = D.value, J.value.y = a.clientY, J.value.x = a.clientX, l.level === 2 && l.no < 4 && (c.value.add || t.days.length > 1) && (N.value = !0), l.level === 3 && (N.value = !0);
271
- }, u = (t) => {
272
- console.log(t);
273
- let l = w.value[c.value.ids];
274
- switch (t) {
271
+ }, c = (n, e, f, l) => {
272
+ g.value.ids = n.ids, g.value.key = n.key, g.value.startDate = n.dateStart, g.value.endDate = n.dateEnd, g.value.name = n.name, g.value.count = n.count, g.value.length = n.days.length, g.value.add = n.days.length > 0 && n.days[n.days.length - 1].count, g.value.level = e.level, g.value.holiday = S.value, X.value.y = l.clientY, X.value.x = l.clientX, e.level === 2 && e.no < 4 && (g.value.add || n.days.length > 1) && (z.value = !0), e.level === 3 && (z.value = !0);
273
+ }, o = (n) => {
274
+ let e = k.value[g.value.ids];
275
+ switch (n) {
275
276
  case "add":
276
- l.days.push({ note: "" }), console.log(l.days.length);
277
+ e.days.push({ note: "" }), console.log(e.days.length);
277
278
  break;
278
279
  case "delete":
279
- delete l.days.pop(), g(c.value.ids);
280
+ delete e.days.pop(), C(g.value.ids);
280
281
  break;
281
282
  }
282
- N.value = !1;
283
- }, s = (t) => {
284
- W.value = t, c.value.count = t.count;
285
- }, n = () => {
286
- W.value && (w.value[c.value.ids].days[c.value.key] = { ...W.value, note: "" }, g(c.value.ids)), N.value = !1;
287
- }, g = (t) => {
288
- M.workSchedule.rewriteFull({
289
- year: h.value,
290
- code: w.value[t].code,
291
- data: w.value[t].days.map((l) => ({
292
- dateStart: l.dateStart.split(".").reverse().join("-"),
293
- dateEnd: l.dateEnd.split(".").reverse().join("-"),
294
- note: l.note,
295
- count: l.count
283
+ z.value = !1;
284
+ }, s = (n) => {
285
+ H.value = n, g.value.count = n.count;
286
+ }, u = () => {
287
+ H.value && (k.value[g.value.ids].days[g.value.key] = { ...H.value, note: "" }, C(g.value.ids)), z.value = !1;
288
+ }, C = (n) => {
289
+ _.workSchedule.rewriteFull({
290
+ year: i.value,
291
+ code: k.value[n].code,
292
+ data: k.value[n].days.map((e) => ({
293
+ dateStart: e.dateStart.split(".").reverse().join("-"),
294
+ dateEnd: e.dateEnd.split(".").reverse().join("-"),
295
+ note: e.note,
296
+ count: e.count
296
297
  }))
297
298
  });
298
- }, _ = (t) => {
299
- M.workSchedule.sendConfirmMessage({ fullname: M.fullName, confirm: t }), M.query = "";
300
- }, $ = () => {
301
- M.workSchedule.sendAgreementMessage({ users: B.value.participants }), d.value = !1;
299
+ }, I = (n) => {
300
+ _.workSchedule.sendConfirmMessage({ fullname: _.fullName, confirm: n }), _.query = "";
301
+ }, V = () => {
302
+ _.workSchedule.sendAgreementMessage({ users: N.value.participants }), d.value = !1;
302
303
  };
303
- return M.workSchedule.getBoss().then((t) => {
304
- R.value = t[0].users;
305
- }), ce().then((t) => {
306
- D.value = t, Z();
307
- }), (t, l) => {
308
- const b = ie("loading");
309
- return p(), E("div", null, [
310
- j.checkEdit ? (p(), Y(e(ae), {
304
+ _.workSchedule.getBoss().then((n) => {
305
+ O.value = n[0].users;
306
+ }), De().then((n) => {
307
+ S.value = n, le();
308
+ });
309
+ const ge = async () => {
310
+ Y.value = !0;
311
+ const n = new we.Workbook(), e = n.addWorksheet(i.value.toString(), { pageSetup: { paperSize: 9, orientation: "landscape", fitToPage: !0 } }), f = { vertical: "middle", horizontal: "center" }, l = { top: { style: "thin" }, left: { style: "thin" }, bottom: { style: "thin" }, right: { style: "thin" } }, x = { vertical: "middle", horizontal: "center", wrapText: !0 }, ne = { vertical: "middle", horizontal: "right", wrapText: !0 };
312
+ e.mergeCells("D1:G1"), e.mergeCells("D2:G2"), e.mergeCells("D3:G3"), e.mergeCells("D4:G4"), e.mergeCells("A5:G5"), e.mergeCells("A6:G6"), e.mergeCells("A9:G9"), e.mergeCells("A10:A11"), e.mergeCells("B10:B11"), e.mergeCells("C10:C11"), e.mergeCells("D10:F10"), e.mergeCells("G10:G11"), e.getCell("D1").value = t("vacationSchedule.approve"), e.getCell("D2").value = t("vacationSchedule.dateApprove", { year: i.value - 1 }), e.getCell("D3").value = t("workSchedule.printPlace"), e.getCell("D4").value = t("vacationSchedule.dateApprove", { year: i.value - 1 }), e.getCell("A5").value = t("workSchedule.firm"), e.getCell("B7").value = t("vacationSchedule.vacationSchedule"), e.getCell("C7").value = t("vacationSchedule.numberDocs"), e.getCell("D7").value = t("vacationSchedule.compilation"), e.getCell("E7").value = t("vacationSchedule.year"), e.getCell("C8").value = "", e.getCell("D8").value = "", e.getCell("E8").value = i.value, e.getCell("E7").value = t("vacationSchedule.year"), e.getCell("A10").value = t("vacationSchedule.jobTitle"), e.getCell("B10").value = t("vacationSchedule.fullName"), e.getCell("C10").value = t("vacationSchedule.personnelNumber"), e.getCell("D10").value = t("vacationSchedule.vacation"), e.getCell("D11").value = t("vacationSchedule.days"), e.getCell("E11").value = t("vacationSchedule.date"), e.getCell("F11").value = t("vacationSchedule.endDate"), e.getCell("G11").value = t("vacationSchedule.note"), e.getRow(1).height = 80, e.getColumn(1).width = 28, e.getColumn(2).width = 28, e.getColumn(3).width = 18, e.getColumn(4).width = 18, e.getColumn(5).width = 14, e.getColumn(6).width = 14, e.getColumn(7).width = 14, e.getColumn(1).alignment = x, e.getColumn(2).alignment = x, e.getColumn(3).alignment = x, e.getColumn(4).alignment = x, e.getColumn(5).alignment = x, e.getColumn(6).alignment = x, e.getColumn(7).alignment = x, e.getCell("D1").alignment = ne, e.getCell("D2").alignment = ne, e.getCell("D4").alignment = ne, e.getCell("A5").alignment = f, e.getCell("C7").border = l, e.getCell("D7").border = l, e.getCell("E7").border = l, e.getCell("C8").border = l, e.getCell("D8").border = l, e.getCell("E8").border = l, e.getCell("A10").border = l, e.getCell("B10").border = l, e.getCell("C10").border = l, e.getCell("D10").border = l, e.getCell("G10").border = l, e.getCell("D11").border = l, e.getCell("E11").border = l, e.getCell("F11").border = l;
313
+ let q = 11;
314
+ for (const T of k.value)
315
+ if (T.days.length > 1)
316
+ T.days.forEach((K) => {
317
+ let ue = [T.jobTitle, T.name, T.code, K.count, K.dateStart, K.dateEnd, K.note];
318
+ const pe = e.addRow(ue);
319
+ pe.border = l, q++;
320
+ }), e.mergeCells(`A${q - T.days.length + 1}:A${q}`), e.mergeCells(`B${q - T.days.length + 1}:B${q}`), e.mergeCells(`C${q - T.days.length + 1}:C${q}`);
321
+ else {
322
+ let K = [T.jobTitle, T.name, T.code, T.days[0].count, T.days[0].dateStart, T.days[0].dateEnd, T.days[0].note];
323
+ const ue = e.addRow(K);
324
+ ue.border = l, q++;
325
+ }
326
+ const me = "export_" + A(Date.now(), "{dd}.{m}.{Y}") + ".xlsx", he = await n.xlsx.writeBuffer();
327
+ Se(new Blob([he]), me), Y.value = !1;
328
+ };
329
+ return (n, e) => {
330
+ const f = Ce("loading");
331
+ return m(), $("div", null, [
332
+ j.checkEdit ? (m(), F(a(oe), {
311
333
  key: 0,
312
- modelValue: C.value,
313
- "onUpdate:modelValue": l[0] || (l[0] = (a) => C.value = a),
334
+ modelValue: E.value,
335
+ "onUpdate:modelValue": e[0] || (e[0] = (l) => E.value = l),
314
336
  placeholder: "Select",
315
337
  style: { width: "240px", "margin-bottom": ".5rem", "margin-right": ".5rem" }
316
338
  }, {
317
- default: i(() => [
318
- (p(!0), E(G, null, P(X.value, (a) => (p(), Y(e(le), {
319
- key: a.value,
320
- label: a.label,
321
- value: a.value
339
+ default: r(() => [
340
+ (m(!0), $(R, null, L(Z.value, (l) => (m(), F(a(de), {
341
+ key: l.value,
342
+ label: l.label,
343
+ value: l.value
322
344
  }, null, 8, ["label", "value"]))), 128))
323
345
  ]),
324
346
  _: 1
325
- }, 8, ["modelValue"])) : z("", !0),
326
- v(e(F), {
347
+ }, 8, ["modelValue"])) : U("", !0),
348
+ v(a(G), {
327
349
  plain: "",
328
- onClick: l[1] || (l[1] = (a) => m.value = !0),
329
- style: { "margin-bottom": ".5rem" }
350
+ onClick: e[1] || (e[1] = (l) => p.value = !0),
351
+ style: { "margin-bottom": ".5rem", "margin-right": ".5rem" }
330
352
  }, {
331
- default: i(() => [
332
- V(k(e(o)("workSchedule.jobTitle")), 1)
353
+ default: r(() => [
354
+ M(D(a(t)("workSchedule.jobTitle")), 1)
333
355
  ]),
334
356
  _: 1
335
357
  }),
336
- v(e(ae), {
337
- modelValue: h.value,
338
- "onUpdate:modelValue": l[2] || (l[2] = (a) => h.value = a),
339
- onChange: A,
358
+ v(a(oe), {
359
+ modelValue: i.value,
360
+ "onUpdate:modelValue": e[2] || (e[2] = (l) => i.value = l),
361
+ onChange: W,
340
362
  placeholder: "Year",
341
- style: { width: "240px", "margin-bottom": ".5rem", "margin-right": ".5rem" }
363
+ style: { width: "80px", "margin-bottom": ".5rem", "margin-right": ".5rem" }
342
364
  }, {
343
- default: i(() => [
344
- (p(!0), E(G, null, P(U.value, (a) => (p(), Y(e(le), {
345
- key: a.value,
346
- label: a.label,
347
- value: a.value
365
+ default: r(() => [
366
+ (m(!0), $(R, null, L(a(ee), (l) => (m(), F(a(de), {
367
+ key: l.value,
368
+ label: l.label,
369
+ value: l.value
348
370
  }, null, 8, ["label", "value"]))), 128))
349
371
  ]),
350
372
  _: 1
351
373
  }, 8, ["modelValue"]),
352
- v(e(fe), {
374
+ v(a(xe), {
353
375
  style: { width: "100%" },
354
- loading: S.value,
376
+ loading: w.value,
355
377
  animated: ""
356
378
  }, {
357
- template: i(() => [
358
- v(e(K), {
379
+ template: r(() => [
380
+ v(a(Q), {
359
381
  variant: "text",
360
382
  style: { width: "100%", height: "2rem" }
361
383
  }),
362
- v(e(K), {
384
+ v(a(Q), {
363
385
  variant: "text",
364
386
  style: { width: "180px", height: "4rem", "margin-right": "4px" }
365
387
  }),
366
- v(e(K), {
388
+ v(a(Q), {
367
389
  variant: "text",
368
390
  style: { width: "calc( 100% - 184px)", height: "4rem" }
369
391
  }),
370
- v(e(K), {
392
+ v(a(Q), {
371
393
  variant: "text",
372
394
  style: { width: "180px", height: "8rem", "margin-right": "4px" }
373
395
  }),
374
- v(e(K), {
396
+ v(a(Q), {
375
397
  variant: "text",
376
398
  style: { width: "calc( 100% - 184px)", height: "8rem" }
377
399
  })
378
400
  ]),
379
- default: i(() => [
380
- v(e(pe), {
401
+ default: r(() => [
402
+ v(a(ke), {
381
403
  id: "printTable",
382
- data: x.value,
383
- "span-method": ee,
384
- onCellClick: r,
404
+ data: b.value,
405
+ "span-method": te,
406
+ onCellClick: c,
385
407
  border: "",
386
408
  style: { width: "100%" },
387
409
  size: "small",
388
- "empty-text": e(o)("vacationSchedule.emptyText")
410
+ "empty-text": a(t)("vacationSchedule.emptyText")
389
411
  }, {
390
- default: i(() => [
391
- v(e(q), {
392
- label: C.value !== "all" ? e(o)("vacationSchedule.title", { name: C.value }) : e(o)("vacationSchedule.enterprise") + ` ${h.value}`,
412
+ default: r(() => [
413
+ v(a(P), {
414
+ label: E.value !== "all" ? a(t)("vacationSchedule.title", { name: E.value }) : a(t)("vacationSchedule.enterprise") + ` ${i.value}`,
393
415
  align: "center",
394
416
  height: "34"
395
417
  }, {
396
- default: i(() => [
397
- v(e(q), {
398
- label: e(o)("vacationSchedule.jobTitle"),
418
+ default: r(() => [
419
+ v(a(P), {
420
+ label: a(t)("vacationSchedule.jobTitle"),
399
421
  width: "180",
400
422
  align: "center"
401
423
  }, {
402
- default: i((a) => [
403
- V(k(x.value[a.$index].jobTitle), 1)
424
+ default: r((l) => [
425
+ M(D(b.value[l.$index].jobTitle), 1)
404
426
  ]),
405
427
  _: 1
406
428
  }, 8, ["label"]),
407
- v(e(q), {
408
- label: e(o)("vacationSchedule.fullName"),
429
+ v(a(P), {
430
+ label: a(t)("vacationSchedule.fullName"),
409
431
  width: "180",
410
432
  align: "center"
411
433
  }, {
412
- default: i((a) => [
413
- V(k(x.value[a.$index].name), 1)
434
+ default: r((l) => [
435
+ M(D(b.value[l.$index].name), 1)
414
436
  ]),
415
437
  _: 1
416
438
  }, 8, ["label"]),
417
- v(e(q), {
418
- label: e(o)("vacationSchedule.personnelNumber"),
439
+ v(a(P), {
440
+ label: a(t)("vacationSchedule.personnelNumber"),
419
441
  align: "center"
420
442
  }, {
421
- default: i((a) => [
422
- V(k(x.value[a.$index].code), 1)
443
+ default: r((l) => [
444
+ M(D(b.value[l.$index].code), 1)
423
445
  ]),
424
446
  _: 1
425
447
  }, 8, ["label"]),
426
- v(e(q), {
427
- label: e(o)("vacationSchedule.vacation"),
448
+ v(a(P), {
449
+ label: a(t)("vacationSchedule.vacation"),
428
450
  align: "center"
429
451
  }, {
430
- default: i(() => [
431
- v(e(q), {
432
- label: e(o)("vacationSchedule.days"),
452
+ default: r(() => [
453
+ v(a(P), {
454
+ label: a(t)("vacationSchedule.days"),
433
455
  align: "center"
434
456
  }, {
435
- default: i((a) => [
436
- V(k(x.value[a.$index].count), 1)
457
+ default: r((l) => [
458
+ M(D(b.value[l.$index].count), 1)
437
459
  ]),
438
460
  _: 1
439
461
  }, 8, ["label"]),
440
- v(e(q), {
441
- label: e(o)("vacationSchedule.date"),
462
+ v(a(P), {
463
+ label: a(t)("vacationSchedule.date"),
442
464
  align: "center"
443
465
  }, {
444
- default: i((a) => [
445
- V(k(x.value[a.$index].dateStart), 1)
466
+ default: r((l) => [
467
+ M(D(b.value[l.$index].dateStart), 1)
446
468
  ]),
447
469
  _: 1
448
470
  }, 8, ["label"]),
449
- v(e(q), {
450
- label: e(o)("vacationSchedule.endDate"),
471
+ v(a(P), {
472
+ label: a(t)("vacationSchedule.endDate"),
451
473
  align: "center"
452
474
  }, {
453
- default: i((a) => [
454
- V(k(x.value[a.$index].dateEnd), 1)
475
+ default: r((l) => [
476
+ M(D(b.value[l.$index].dateEnd), 1)
455
477
  ]),
456
478
  _: 1
457
479
  }, 8, ["label"])
458
480
  ]),
459
481
  _: 1
460
482
  }, 8, ["label"]),
461
- v(e(q), {
462
- label: e(o)("vacationSchedule.note"),
483
+ v(a(P), {
484
+ label: a(t)("vacationSchedule.note"),
463
485
  align: "center"
464
486
  }, {
465
- default: i((a) => [
466
- v(e(he), {
467
- modelValue: w.value[x.value[a.$index].ids].days[x.value[a.$index].key].note,
468
- "onUpdate:modelValue": (I) => w.value[x.value[a.$index].ids].days[x.value[a.$index].key].note = I,
487
+ default: r((l) => [
488
+ v(a(Ee), {
489
+ modelValue: k.value[b.value[l.$index].ids].days[b.value[l.$index].key].note,
490
+ "onUpdate:modelValue": (x) => k.value[b.value[l.$index].ids].days[b.value[l.$index].key].note = x,
469
491
  style: { width: "100%" },
470
492
  placeholder: " ",
471
493
  class: "noBorder",
472
- onBlur: (I) => g(x.value[a.$index].ids)
494
+ onBlur: (x) => C(b.value[l.$index].ids)
473
495
  }, null, 8, ["modelValue", "onUpdate:modelValue", "onBlur"])
474
496
  ]),
475
497
  _: 1
@@ -483,90 +505,90 @@ const xe = (j, M) => {
483
505
  ]),
484
506
  _: 1
485
507
  }, 8, ["loading"]),
486
- j.checkEdit ? (p(), E("div", je, [
487
- L.value ? z("", !0) : (p(), Y(e(F), {
508
+ j.checkEdit ? (m(), $("div", Le, [
509
+ J.value ? U("", !0) : (m(), F(a(G), {
488
510
  key: 0,
489
511
  type: "primary",
490
- onClick: l[3] || (l[3] = (a) => d.value = !0)
512
+ onClick: e[3] || (e[3] = (l) => d.value = !0)
491
513
  }, {
492
- default: i(() => [
493
- V(k(e(o)("vacationSchedule.sendInformation")), 1)
514
+ default: r(() => [
515
+ M(D(a(t)("vacationSchedule.sendInformation")), 1)
494
516
  ]),
495
517
  _: 1
496
518
  })),
497
- j.query === "confirm" ? (p(), Y(e(F), {
519
+ j.query === "confirm" ? (m(), F(a(G), {
498
520
  key: 1,
499
521
  type: "primary",
500
- onClick: l[4] || (l[4] = (a) => _(!0))
522
+ onClick: e[4] || (e[4] = (l) => I(!0))
501
523
  }, {
502
- default: i(() => [
503
- V(k(e(o)("vacationSchedule.agreeOn")), 1)
524
+ default: r(() => [
525
+ M(D(a(t)("vacationSchedule.agreeOn")), 1)
504
526
  ]),
505
527
  _: 1
506
- })) : z("", !0),
507
- j.query === "confirm" ? (p(), Y(e(F), {
528
+ })) : U("", !0),
529
+ j.query === "confirm" ? (m(), F(a(G), {
508
530
  key: 2,
509
531
  type: "primary",
510
- onClick: l[5] || (l[5] = (a) => _(!1))
532
+ onClick: e[5] || (e[5] = (l) => I(!1))
511
533
  }, {
512
- default: i(() => [
513
- V(k(e(o)("vacationSchedule.reject")), 1)
534
+ default: r(() => [
535
+ M(D(a(t)("vacationSchedule.reject")), 1)
514
536
  ]),
515
537
  _: 1
516
- })) : z("", !0)
517
- ])) : z("", !0),
518
- re((p(), Y(e(F), {
519
- disabled: H.value,
538
+ })) : U("", !0)
539
+ ])) : U("", !0),
540
+ be((m(), F(a(G), {
541
+ disabled: Y.value,
520
542
  plain: "",
521
- onClick: t.exportToExcel,
543
+ onClick: ge,
522
544
  style: { "margin-top": ".5rem" }
523
545
  }, {
524
- default: i(() => [
525
- V(k(e(o)("workSchedule.exportExcel")), 1)
546
+ default: r(() => [
547
+ M(D(a(t)("workSchedule.exportExcel")), 1)
526
548
  ]),
527
549
  _: 1
528
- }, 8, ["disabled", "onClick"])), [
529
- [b, H.value]
550
+ }, 8, ["disabled"])), [
551
+ [f, Y.value]
530
552
  ]),
531
- v(e(ue), {
532
- title: e(o)("workSchedule.jobTitle"),
533
- modelValue: m.value,
534
- "onUpdate:modelValue": l[7] || (l[7] = (a) => m.value = a),
553
+ v(a(ve), {
554
+ title: a(t)("workSchedule.jobTitle"),
555
+ modelValue: p.value,
556
+ "onUpdate:modelValue": e[7] || (e[7] = (l) => p.value = l),
535
557
  width: "400px"
536
558
  }, {
537
- footer: i(() => [
538
- v(e(F), {
539
- onClick: l[6] || (l[6] = (a) => m.value = !1),
559
+ footer: r(() => [
560
+ v(a(G), {
561
+ onClick: e[6] || (e[6] = (l) => p.value = !1),
540
562
  size: "default"
541
563
  }, {
542
- default: i(() => [
543
- V(k(t.$t("workSchedule.cancel")), 1)
564
+ default: r(() => [
565
+ M(D(n.$t("workSchedule.cancel")), 1)
544
566
  ]),
545
567
  _: 1
546
568
  }),
547
- v(e(F), {
569
+ v(a(G), {
548
570
  size: "default",
549
571
  type: "primary",
550
- onClick: A
572
+ onClick: W
551
573
  }, {
552
- default: i(() => [
553
- V(k(t.$t("workSchedule.select")), 1)
574
+ default: r(() => [
575
+ M(D(n.$t("workSchedule.select")), 1)
554
576
  ]),
555
577
  _: 1
556
578
  })
557
579
  ]),
558
- default: i(() => [
559
- v(e(oe), {
560
- model: T.value,
580
+ default: r(() => [
581
+ v(a(re), {
582
+ model: B.value,
561
583
  autocomplete: "on"
562
584
  }, {
563
- default: i(() => [
564
- (p(!0), E(G, null, P(T.value, (a) => (p(), Y(e(me), null, {
565
- default: i(() => [
566
- v(e(ye), {
567
- modelValue: a.val,
568
- "onUpdate:modelValue": (I) => a.val = I,
569
- "active-text": a.activeText
585
+ default: r(() => [
586
+ (m(!0), $(R, null, L(B.value, (l) => (m(), F(a($e), null, {
587
+ default: r(() => [
588
+ v(a(Ve), {
589
+ modelValue: l.val,
590
+ "onUpdate:modelValue": (x) => l.val = x,
591
+ "active-text": l.activeText
570
592
  }, null, 8, ["modelValue", "onUpdate:modelValue", "active-text"])
571
593
  ]),
572
594
  _: 2
@@ -577,51 +599,51 @@ const xe = (j, M) => {
577
599
  ]),
578
600
  _: 1
579
601
  }, 8, ["title", "modelValue"]),
580
- v(e(ue), {
581
- title: e(o)("vacationSchedule.pleaseCoordinate"),
602
+ v(a(ve), {
603
+ title: a(t)("vacationSchedule.pleaseCoordinate"),
582
604
  modelValue: d.value,
583
- "onUpdate:modelValue": l[10] || (l[10] = (a) => d.value = a),
605
+ "onUpdate:modelValue": e[10] || (e[10] = (l) => d.value = l),
584
606
  width: "500px"
585
607
  }, {
586
- footer: i(() => [
587
- v(e(F), {
588
- onClick: l[9] || (l[9] = (a) => d.value = !1),
608
+ footer: r(() => [
609
+ v(a(G), {
610
+ onClick: e[9] || (e[9] = (l) => d.value = !1),
589
611
  size: "default"
590
612
  }, {
591
- default: i(() => [
592
- V(k(e(o)("workSchedule.cancel")), 1)
613
+ default: r(() => [
614
+ M(D(a(t)("workSchedule.cancel")), 1)
593
615
  ]),
594
616
  _: 1
595
617
  }),
596
- v(e(F), {
618
+ v(a(G), {
597
619
  size: "default",
598
620
  type: "primary",
599
- onClick: $
621
+ onClick: V
600
622
  }, {
601
- default: i(() => [
602
- V(k(e(o)("vacationSchedule.send")), 1)
623
+ default: r(() => [
624
+ M(D(a(t)("vacationSchedule.send")), 1)
603
625
  ]),
604
626
  _: 1
605
627
  })
606
628
  ]),
607
- default: i(() => [
608
- v(e(oe), {
609
- model: B.value,
629
+ default: r(() => [
630
+ v(a(re), {
631
+ model: N.value,
610
632
  autocomplete: "on"
611
633
  }, {
612
- default: i(() => [
613
- v(e(ae), {
614
- modelValue: B.value.participants,
615
- "onUpdate:modelValue": l[8] || (l[8] = (a) => B.value.participants = a),
616
- placeholder: e(o)("vacationSchedule.fullName"),
634
+ default: r(() => [
635
+ v(a(oe), {
636
+ modelValue: N.value.participants,
637
+ "onUpdate:modelValue": e[8] || (e[8] = (l) => N.value.participants = l),
638
+ placeholder: a(t)("vacationSchedule.fullName"),
617
639
  multiple: "",
618
640
  size: "default"
619
641
  }, {
620
- default: i(() => [
621
- (p(!0), E(G, null, P(R.value, (a) => (p(), Y(e(le), {
622
- key: a,
623
- label: a,
624
- value: a
642
+ default: r(() => [
643
+ (m(!0), $(R, null, L(O.value, (l) => (m(), F(a(de), {
644
+ key: l,
645
+ label: l,
646
+ value: l
625
647
  }, null, 8, ["label", "value"]))), 128))
626
648
  ]),
627
649
  _: 1
@@ -632,46 +654,46 @@ const xe = (j, M) => {
632
654
  ]),
633
655
  _: 1
634
656
  }, 8, ["title", "modelValue"]),
635
- v(e(ge), {
636
- show: N.value,
637
- "onUpdate:show": l[14] || (l[14] = (a) => N.value = a),
638
- options: J.value
657
+ v(a(Me), {
658
+ show: z.value,
659
+ "onUpdate:show": e[14] || (e[14] = (l) => z.value = l),
660
+ options: X.value
639
661
  }, {
640
- default: i(() => [
641
- v(e(te), {
642
- label: c.value.level === 3 && typeof c.value.count < "u" ? c.value.name + " " + c.value.count + " " + e(o)("vacationSchedule.day", c.value.count) : c.value.name,
662
+ default: r(() => [
663
+ v(a(se), {
664
+ label: g.value.level === 3 && typeof g.value.count < "u" ? g.value.name + " " + g.value.count + " " + a(t)("vacationSchedule.day", g.value.count) : g.value.name,
643
665
  disabled: ""
644
666
  }, null, 8, ["label"]),
645
- v(e(be)),
646
- c.value.level === 2 ? (p(), E("div", Ne, [
647
- c.value.length > 1 ? (p(), Y(e(te), {
667
+ v(a(_e)),
668
+ g.value.level === 2 ? (m(), $("div", We, [
669
+ g.value.length > 1 ? (m(), F(a(se), {
648
670
  key: 0,
649
- label: e(o)("vacationSchedule.deleteLast"),
650
- onClick: l[11] || (l[11] = (a) => u("delete"))
651
- }, null, 8, ["label"])) : z("", !0),
652
- c.value.add ? (p(), Y(e(te), {
671
+ label: a(t)("vacationSchedule.deleteLast"),
672
+ onClick: e[11] || (e[11] = (l) => o("delete"))
673
+ }, null, 8, ["label"])) : U("", !0),
674
+ g.value.add ? (m(), F(a(se), {
653
675
  key: 1,
654
- label: e(o)("vacationSchedule.addVacation"),
655
- onClick: l[12] || (l[12] = (a) => u("add"))
656
- }, null, 8, ["label"])) : z("", !0)
657
- ])) : (p(), E("div", Be, [
658
- v(Fe, {
659
- data: c.value,
676
+ label: a(t)("vacationSchedule.addVacation"),
677
+ onClick: e[12] || (e[12] = (l) => o("add"))
678
+ }, null, 8, ["label"])) : U("", !0)
679
+ ])) : (m(), $("div", Je, [
680
+ v(qe, {
681
+ data: g.value,
660
682
  range: "range",
661
683
  onInput: s
662
684
  }, null, 8, ["data"]),
663
685
  y("div", null, [
664
- v(e(F), {
665
- onClick: l[13] || (l[13] = (a) => N.value = !1)
686
+ v(a(G), {
687
+ onClick: e[13] || (e[13] = (l) => z.value = !1)
666
688
  }, {
667
- default: i(() => [
668
- V(k(e(o)("vacationSchedule.cancel")), 1)
689
+ default: r(() => [
690
+ M(D(a(t)("vacationSchedule.cancel")), 1)
669
691
  ]),
670
692
  _: 1
671
693
  }),
672
- v(e(F), { onClick: n }, {
673
- default: i(() => [
674
- V(k(e(o)("vacationSchedule.save")), 1)
694
+ v(a(G), { onClick: u }, {
695
+ default: r(() => [
696
+ M(D(a(t)("vacationSchedule.save")), 1)
675
697
  ]),
676
698
  _: 1
677
699
  })
@@ -685,5 +707,5 @@ const xe = (j, M) => {
685
707
  }
686
708
  };
687
709
  export {
688
- qe as default
710
+ ll as default
689
711
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studio-west/employees",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "files": [
5
5
  "dist"
6
6
  ],