@studio-west/employees 0.1.6 → 0.1.7

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"),E=require("./index-C8OllN4P.cjs"),j=require("vue-i18n"),i=require("element-plus"),I=require("@imengyu/vue3-context-menu"),L=(w,C)=>{const r=w.__vccOpts||w;for(const[h,f]of C)r[h]=f;return r},G={class:"wrapper"},U={class:"month_year"},O={class:"text"},z={class:"week"},R={class:"month"},q=["onClick"],P={key:0},A={class:"month_year"},J={class:"text"},W={class:"week"},X={class:"month"},H=["onClick"],K={__name:"DataPicker",props:{data:Object,range:{type:String,default:()=>"solid"}},emits:["init"],setup(w,{emit:C}){var T,M,F,Y;const r=e.ref(new Date),h=e.ref(new Date),f=w,B=C,p=e.ref(new Date().getFullYear()),D=e.ref(new Date().getMonth()),_=e.ref(new Date().getFullYear()),m=e.ref(new Date().getMonth()),c=e.ref([]),k=e.ref(0),b=e.ref(0),y=e.ref(-1),S=e.ref(-1),V=v=>{const o=v.split(v.match(/\D.*?\D?/));return o[0].length>2?o.join("-")+"T00:00:01":o.reverse().join("-")+"T00:00:01"};typeof((T=f.data)==null?void 0:T.startDate)<"u"&&(r.value=new Date(V(f.data.startDate)),p.value=r.value.getFullYear(),m.value=r.value.getMonth()),typeof((M=f.data)==null?void 0:M.endDate)<"u"&&(h.value=new Date(V(f.data.endDate)),_.value=h.value.getFullYear(),D.value=h.value.getMonth());const $=()=>{let v=new Date(p.value,m.value,0);for(let n=v.getDate()-v.getDay();n<=v.getDate()&&v.getDay()!==6;n++)k.value++,c.value.push({day:n,month:v.getMonth(),year:v.getFullYear(),class:[]});for(let n=1;n<=new Date(p.value,m.value+1,0).getDate();n++)k.value++,c.value.push({day:n,month:m.value,year:p.value,class:[]});if(f.range==="range"){b.value=new Date(p.value,m.value+2,0);for(let n=1;n<=b.value.getDate();n++)c.value.push({day:n,month:b.value.getMonth(),year:b.value.getFullYear(),class:[]})}let o=f.range==="range"?2:1,d=new Date(p.value,m.value+o,1);for(let n=1;n<=7-d.getDay()&&d.getDay()!==0;n++)c.value.push({day:n,month:d.getMonth(),year:d.getFullYear(),class:[]});f.data.holiday.length!==0&&(f.data.holiday.preholidays.forEach(n=>{let t=n.split("-");const l=c.value.findIndex(u=>u.year==t[0]&&u.month+1==t[1]&&u.day==t[2]);l!==-1&&(c.value[l].class[0]="preholiday")}),f.data.holiday.holidays.forEach(n=>{let t=n.split("-");const l=c.value.findIndex(u=>u.year==t[0]&&u.month+1==t[1]&&u.day==t[2]);l!==-1&&(c.value[l].class[0]="weekend")}),f.data.holiday.holiday.forEach(n=>{let t=n.split("-");const l=c.value.findIndex(u=>u.year==t[0]&&u.month+1==t[1]&&u.day==t[2]);l!==-1&&(c.value[l].class[0]="holiday")}),f.data.holiday.nowork.forEach(n=>{let t=n.split("-");const l=c.value.findIndex(u=>u.year==t[0]&&u.month+1==t[1]&&u.day==t[2]);l!==-1&&(c.value[l].class[0]="nowork")}))},s=(v,o)=>{let d=v-o+1;for(let n=0;n<=v-o;n++)c.value[n+o].class[0]==="holiday"&&d--;return d},g=(v,o)=>{const d=E.parseTime(new Date(v.year,v.month,v.day),"{dd}.{m}.{Y}");if(f.range==="range")if(console.log(y.value),S.value!==-1)c.value[S.value].class[1]="",c.value[y.value].class[1]="",y.value=o,S.value=-1,c.value[o].class[1]="active";else if(y.value!==-1){S.value=o,c.value[o].class[1]="active";let n=E.parseTime(new Date(c.value[y.value].year,c.value[y.value].month,c.value[y.value].day),"{dd}.{m}.{Y}");y.value>o?B("input",{dateStart:d,dateEnd:n,count:s(y.value,o)}):B("input",{dateStart:n,dateEnd:d,count:s(o,y.value)})}else y.value=o,c.value[o].class[1]="active";else c.value[y.value].class[1]="",y.value=o,c.value[o].class[1]="active",B("input",{dateStart:d,count:1})};$(),typeof((F=f.data)==null?void 0:F.startDate)<"u"&&(y.value=c.value.findIndex(v=>v.day===r.value.getDate()&&v.month===m.value&&v.year===p.value),c.value[y.value].class[1]="active"),typeof((Y=f.data)==null?void 0:Y.endDate)<"u"&&f.range==="range"&&(S.value=c.value.findIndex(v=>v.day===h.value.getDate()&&v.month===D.value&&v.year===_.value),c.value[S.value].class[1]="active");const N=(v,o)=>{c.value=[],k.value=0,r.value=new Date(v,o,1),p.value=r.value.getFullYear(),m.value=r.value.getMonth(),$()};return(v,o)=>(e.openBlock(),e.createElementBlock("div",G,[e.createElementVNode("div",null,[e.createElementVNode("p",U,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:o[0]||(o[0]=d=>N(p.value-1,m.value))},"«"),e.createElementVNode("button",{onClick:o[1]||(o[1]=d=>N(p.value,m.value-1))},"‹")]),e.createElementVNode("span",O,[e.createElementVNode("button",null,e.toDisplayString(p.value),1),e.createElementVNode("button",null,e.toDisplayString(e.unref(E.parseTime)(r.value,"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:o[2]||(o[2]=d=>N(p.value,m.value+1))},"›"),e.createElementVNode("button",{onClick:o[3]||(o[3]=d=>N(p.value+1,m.value))},"»")])]),e.createElementVNode("div",z,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(d,n)=>e.createElementVNode("button",{key:n,class:"disabled"},e.toDisplayString(e.unref(E.parseTime)(new Date(1970,1,d),"{D}")),1)),64))]),e.createElementVNode("div",R,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(d,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[n<=k.value+5-new Date(p.value,m.value+1,0).getDay()?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(d.month===m.value?d.class:"disabled"),onClick:t=>g(d,n)},e.toDisplayString(d.day),11,q)):e.createCommentVNode("",!0)],64))),128))])]),f.range==="range"?(e.openBlock(),e.createElementBlock("div",P,[e.createElementVNode("p",A,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:o[4]||(o[4]=d=>N(p.value-1,m.value))},"«"),e.createElementVNode("button",{onClick:o[5]||(o[5]=d=>N(p.value,m.value-1))},"‹")]),e.createElementVNode("span",J,[e.createElementVNode("button",null,e.toDisplayString(new Date(p.value,m.value+1).getFullYear()),1),e.createElementVNode("button",null,e.toDisplayString(e.unref(E.parseTime)(r.value.setMonth(m.value+1),"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:o[6]||(o[6]=d=>N(p.value,m.value+1))},"›"),e.createElementVNode("button",{onClick:o[7]||(o[7]=d=>N(p.value+1,m.value))},"»")])]),e.createElementVNode("div",W,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(d,n)=>e.createElementVNode("button",{key:n,class:"disabled"},e.toDisplayString(e.unref(E.parseTime)(new Date(1970,1,d),"{D}")),1)),64))]),e.createElementVNode("div",X,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(d,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[n>=k.value-new Date(p.value,m.value+1,1).getDay()?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(d.month===b.value.getMonth()?d.class:"disabled"),onClick:t=>g(d,n)},e.toDisplayString(d.day),11,H)):e.createCommentVNode("",!0)],64))),128))])])):e.createCommentVNode("",!0)]))}},Z=L(K,[["__scopeId","data-v-a842f008"]]),Q={key:1,class:"controls-container",style:{"margin-top":".5rem"}},ee={key:0},te={key:1,style:{padding:"0 1rem .5rem"}},ae={__name:"VacationTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"}},setup(w){const C=w,{t:r}=j.useI18n(),h=e.ref([]);e.ref([]);const f=e.ref(new Date().getFullYear()),B=e.ref(!1),p=e.ref(!1),D=e.ref(!1),_=e.ref({zIndex:3,minWidth:230,x:500,y:200}),m=e.ref(!1),c=e.ref([]),k=e.ref("Сектор разработок и эксплуатации сети"),b=e.ref([{value:"all",label:r("vacationSchedule.all"),key:"all"}]),y=e.ref([{value:f.value,label:f.value},{value:f.value+1,label:f.value+1}]),S=e.ref(!1),V=e.ref([]),$=e.ref(!1),s=e.ref({name:"Имя",length:0,code:""});e.watch(k,async(t,l)=>{t!==l&&(V.value=[],B.value=!1,C.odata.personalManagerData.forEach(u=>{(u.Status!=="Увольнение"&&u.Group===t||t==="all")&&(V.value.some(a=>(a==null?void 0:a.activeText)===u.Role)||V.value.push({val:!0,activeText:u.Role}))}),T())});const g=e.computed(()=>h.value.flatMap((t,l)=>!t.days||t.days.length===0?[{...t,key:0,ids:l}]:t.days.map((u,a)=>({ids:l,key:a,...t,...u})))),N=async()=>{C.odata.getPersonalManagerData({}).then(t=>{var l;k.value=(l=t.find(u=>u.Status!=="Увольнение"&&u.Description===C.fullName))==null?void 0:l.Group,t.forEach(u=>{u.Status!=="Увольнение"&&(b.value.some(a=>(a==null?void 0:a.value)===u.Group)||b.value.push({value:u.Group,label:u.Group,key:u.Group}),u.Group===k.value&&!V.value.some(a=>(a==null?void 0:a.activeText)===u.Role)&&V.value.push({val:!0,activeText:u.Role}))}),T(),p.value=!1})},T=()=>{h.value=[];let t=[];C.odata.personalManagerData.forEach(l=>{l.Status!=="Увольнение"&&(l.Group===k.value||k.value==="all")&&V.value.some(u=>u.val&&u.activeText===l.Role)&&(t.push(l.Code),h.value.push({name:l.Description,days:[{note:""}],jobTitle:l.Role,code:l.Code}))}),M(t),m.value=!1},M=t=>{C.workSchedule.getAllVacations({year:f.value}).then(l=>{console.log(t),t.forEach((u,a)=>{h.value[a].days=[{note:""}],l.forEach(x=>{u===x.code&&(console.log(x),typeof h.value[a].days[0].dateStart>"u"?h.value[a].days[0]={dateStart:E.parseTime(x.dateStart,"{dd}.{m}.{Y}"),dateEnd:E.parseTime(x.dateEnd,"{dd}.{m}.{Y}"),note:x.note,count:x.count}:h.value[a].days.push({dateStart:E.parseTime(x.dateStart,"{dd}.{m}.{Y}"),dateEnd:E.parseTime(x.dateEnd,"{dd}.{m}.{Y}"),note:x.note,count:x.count}))})})})},F=t=>{if(t.columnIndex<3&&g.value[t.rowIndex].key<g.value[t.rowIndex].days.length)return g.value[t.rowIndex].key===0?{rowspan:g.value[t.rowIndex].days.length,colspan:1}:{rowspan:0,colspan:0}},Y=(t,l,u,a)=>{s.value.ids=t.ids,s.value.key=t.key,s.value.startDate=t.dateStart,s.value.endDate=t.dateEnd,s.value.name=t.name,s.value.count=t.count,s.value.length=t.days.length,s.value.add=t.days.length>0&&t.days[t.days.length-1].count,s.value.level=l.level,s.value.holiday=c.value,_.value.y=a.clientY,_.value.x=a.clientX,l.level===2&&l.no<4&&(s.value.add||t.days.length>1)&&(D.value=!0),l.level===3&&(D.value=!0)},v=t=>{console.log(t);let l=h.value[s.value.ids];switch(t){case"add":l.days.push({note:""}),console.log(l.days.length);break;case"delete":delete l.days.pop(),n(s.value.ids);break}D.value=!1},o=t=>{$.value=t,s.value.count=t.count},d=()=>{$.value&&(h.value[s.value.ids].days[s.value.key]={...$.value,note:""},n(s.value.ids)),D.value=!1},n=t=>{C.workSchedule.rewriteFull({year:f.value,code:h.value[t].code,data:h.value[t].days.map(l=>(l.dateStart=l.dateStart.split(".").reverse().join("-"),l.dateEnd=l.dateEnd.split(".").reverse().join("-"),l))})};return E.holidays().then(t=>{c.value=t,N()}),(t,l)=>{const u=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",null,[w.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElSelect),{key:0,modelValue:k.value,"onUpdate:modelValue":l[0]||(l[0]=a=>k.value=a),placeholder:"Select",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,a=>(e.openBlock(),e.createBlock(e.unref(i.ElOption),{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),e.createVNode(e.unref(i.ElButton),{plain:"",onClick:l[1]||(l[1]=a=>m.value=!0),style:{"margin-bottom":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.jobTitle")),1)]),_:1}),e.createVNode(e.unref(i.ElSelect),{modelValue:f.value,"onUpdate:modelValue":l[2]||(l[2]=a=>f.value=a),onChange:T,placeholder:"Year",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,a=>(e.openBlock(),e.createBlock(e.unref(i.ElOption),{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),e.createVNode(e.unref(i.ElSkeleton),{style:{width:"100%"},loading:p.value,animated:""},{template:e.withCtx(()=>[e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"100%",height:"2rem"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"4rem","margin-right":"4px"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"4rem"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"8rem","margin-right":"4px"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"8rem"}})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTable),{id:"printTable",data:g.value,"span-method":F,onCellClick:Y,border:"",style:{width:"100%"},size:"small","empty-text":e.unref(r)("vacationSchedule.emptyText")},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:k.value!=="all"?e.unref(r)("vacationSchedule.title",{name:k.value}):e.unref(r)("vacationSchedule.enterprise")+` ${f.value}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("vacationSchedule.jobTitle"),width:"180",align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(g.value[a.$index].jobTitle),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("vacationSchedule.fullName"),width:"180",align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(g.value[a.$index].name),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("vacationSchedule.personnelNumber"),align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(g.value[a.$index].code),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("vacationSchedule.vacation"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("vacationSchedule.days"),align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(g.value[a.$index].count),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("vacationSchedule.date"),align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(g.value[a.$index].dateStart),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("vacationSchedule.endDate"),align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(g.value[a.$index].dateEnd),1)]),_:1},8,["label"])]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("vacationSchedule.note"),align:"center"},{default:e.withCtx(a=>[e.createVNode(e.unref(i.ElInput),{modelValue:h.value[g.value[a.$index].ids].days[g.value[a.$index].key].note,"onUpdate:modelValue":x=>h.value[g.value[a.$index].ids].days[g.value[a.$index].key].note=x,style:{width:"100%"},placeholder:" ",class:"noBorder",onBlur:x=>n(g.value[a.$index].ids)},null,8,["modelValue","onUpdate:modelValue","onBlur"])]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["data","empty-text"])]),_:1},8,["loading"]),w.checkEdit?(e.openBlock(),e.createElementBlock("div",Q,[B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:0,type:"primary",onClick:t.confirmData},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("vacationSchedule.sendInformation")),1)]),_:1},8,["onClick"])),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:1,type:"primary",onClick:t.confirmData},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("vacationSchedule.agreeOn")),1)]),_:1},8,["onClick"])),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:2,type:"primary",onClick:t.confirmData},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("vacationSchedule.reject")),1)]),_:1},8,["onClick"]))])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(i.ElButton),{disabled:S.value,plain:"",onClick:t.exportToExcel,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.exportExcel")),1)]),_:1},8,["disabled","onClick"])),[[u,S.value]]),e.createVNode(e.unref(i.ElDialog),{title:e.unref(r)("workSchedule.jobTitle"),modelValue:m.value,"onUpdate:modelValue":l[4]||(l[4]=a=>m.value=a),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(i.ElButton),{onClick:l[3]||(l[3]=a=>m.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{size:"default",type:"primary",onClick:T},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElForm),{ref:"dialogForm",model:V.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,a=>(e.openBlock(),e.createBlock(e.unref(i.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElSwitch),{modelValue:a.val,"onUpdate:modelValue":x=>a.val=x,"active-text":a.activeText},null,8,["modelValue","onUpdate:modelValue","active-text"])]),_:2},1024))),256))]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(I.ContextMenu),{show:D.value,"onUpdate:show":l[8]||(l[8]=a=>D.value=a),options:_.value},{default:e.withCtx(()=>[e.createVNode(e.unref(I.ContextMenuItem),{label:s.value.level===3&&typeof s.value.count<"u"?s.value.name+" "+s.value.count+" "+e.unref(r)("vacationSchedule.day",s.value.count):s.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(I.ContextMenuSeparator)),s.value.level===2?(e.openBlock(),e.createElementBlock("div",ee,[s.value.length>1?(e.openBlock(),e.createBlock(e.unref(I.ContextMenuItem),{key:0,label:e.unref(r)("vacationSchedule.deleteLast"),onClick:l[5]||(l[5]=a=>v("delete"))},null,8,["label"])):e.createCommentVNode("",!0),s.value.add?(e.openBlock(),e.createBlock(e.unref(I.ContextMenuItem),{key:1,label:e.unref(r)("vacationSchedule.addVacation"),onClick:l[6]||(l[6]=a=>v("add"))},null,8,["label"])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",te,[e.createVNode(Z,{data:s.value,range:"range",onInput:o},null,8,["data"]),e.createElementVNode("div",null,[e.createVNode(e.unref(i.ElButton),{onClick:l[7]||(l[7]=a=>D.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("vacationSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{onClick:d},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("vacationSchedule.save")),1)]),_:1})])]))]),_:1},8,["show","options"])])}}};module.exports=ae;
1
+ "use strict";const e=require("vue"),E=require("./index-CHGzf-XH.cjs"),j=require("vue-i18n"),i=require("element-plus"),I=require("@imengyu/vue3-context-menu"),L=(w,C)=>{const r=w.__vccOpts||w;for(const[h,f]of C)r[h]=f;return r},G={class:"wrapper"},U={class:"month_year"},O={class:"text"},z={class:"week"},R={class:"month"},q=["onClick"],P={key:0},A={class:"month_year"},J={class:"text"},W={class:"week"},X={class:"month"},H=["onClick"],K={__name:"DataPicker",props:{data:Object,range:{type:String,default:()=>"solid"}},emits:["init"],setup(w,{emit:C}){var T,M,F,Y;const r=e.ref(new Date),h=e.ref(new Date),f=w,B=C,p=e.ref(new Date().getFullYear()),D=e.ref(new Date().getMonth()),_=e.ref(new Date().getFullYear()),m=e.ref(new Date().getMonth()),c=e.ref([]),k=e.ref(0),b=e.ref(0),y=e.ref(-1),S=e.ref(-1),V=v=>{const o=v.split(v.match(/\D.*?\D?/));return o[0].length>2?o.join("-")+"T00:00:01":o.reverse().join("-")+"T00:00:01"};typeof((T=f.data)==null?void 0:T.startDate)<"u"&&(r.value=new Date(V(f.data.startDate)),p.value=r.value.getFullYear(),m.value=r.value.getMonth()),typeof((M=f.data)==null?void 0:M.endDate)<"u"&&(h.value=new Date(V(f.data.endDate)),_.value=h.value.getFullYear(),D.value=h.value.getMonth());const $=()=>{let v=new Date(p.value,m.value,0);for(let n=v.getDate()-v.getDay();n<=v.getDate()&&v.getDay()!==6;n++)k.value++,c.value.push({day:n,month:v.getMonth(),year:v.getFullYear(),class:[]});for(let n=1;n<=new Date(p.value,m.value+1,0).getDate();n++)k.value++,c.value.push({day:n,month:m.value,year:p.value,class:[]});if(f.range==="range"){b.value=new Date(p.value,m.value+2,0);for(let n=1;n<=b.value.getDate();n++)c.value.push({day:n,month:b.value.getMonth(),year:b.value.getFullYear(),class:[]})}let o=f.range==="range"?2:1,d=new Date(p.value,m.value+o,1);for(let n=1;n<=7-d.getDay()&&d.getDay()!==0;n++)c.value.push({day:n,month:d.getMonth(),year:d.getFullYear(),class:[]});f.data.holiday.length!==0&&(f.data.holiday.preholidays.forEach(n=>{let t=n.split("-");const l=c.value.findIndex(u=>u.year==t[0]&&u.month+1==t[1]&&u.day==t[2]);l!==-1&&(c.value[l].class[0]="preholiday")}),f.data.holiday.holidays.forEach(n=>{let t=n.split("-");const l=c.value.findIndex(u=>u.year==t[0]&&u.month+1==t[1]&&u.day==t[2]);l!==-1&&(c.value[l].class[0]="weekend")}),f.data.holiday.holiday.forEach(n=>{let t=n.split("-");const l=c.value.findIndex(u=>u.year==t[0]&&u.month+1==t[1]&&u.day==t[2]);l!==-1&&(c.value[l].class[0]="holiday")}),f.data.holiday.nowork.forEach(n=>{let t=n.split("-");const l=c.value.findIndex(u=>u.year==t[0]&&u.month+1==t[1]&&u.day==t[2]);l!==-1&&(c.value[l].class[0]="nowork")}))},s=(v,o)=>{let d=v-o+1;for(let n=0;n<=v-o;n++)c.value[n+o].class[0]==="holiday"&&d--;return d},g=(v,o)=>{const d=E.parseTime(new Date(v.year,v.month,v.day),"{dd}.{m}.{Y}");if(f.range==="range")if(console.log(y.value),S.value!==-1)c.value[S.value].class[1]="",c.value[y.value].class[1]="",y.value=o,S.value=-1,c.value[o].class[1]="active";else if(y.value!==-1){S.value=o,c.value[o].class[1]="active";let n=E.parseTime(new Date(c.value[y.value].year,c.value[y.value].month,c.value[y.value].day),"{dd}.{m}.{Y}");y.value>o?B("input",{dateStart:d,dateEnd:n,count:s(y.value,o)}):B("input",{dateStart:n,dateEnd:d,count:s(o,y.value)})}else y.value=o,c.value[o].class[1]="active";else c.value[y.value].class[1]="",y.value=o,c.value[o].class[1]="active",B("input",{dateStart:d,count:1})};$(),typeof((F=f.data)==null?void 0:F.startDate)<"u"&&(y.value=c.value.findIndex(v=>v.day===r.value.getDate()&&v.month===m.value&&v.year===p.value),c.value[y.value].class[1]="active"),typeof((Y=f.data)==null?void 0:Y.endDate)<"u"&&f.range==="range"&&(S.value=c.value.findIndex(v=>v.day===h.value.getDate()&&v.month===D.value&&v.year===_.value),c.value[S.value].class[1]="active");const N=(v,o)=>{c.value=[],k.value=0,r.value=new Date(v,o,1),p.value=r.value.getFullYear(),m.value=r.value.getMonth(),$()};return(v,o)=>(e.openBlock(),e.createElementBlock("div",G,[e.createElementVNode("div",null,[e.createElementVNode("p",U,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:o[0]||(o[0]=d=>N(p.value-1,m.value))},"«"),e.createElementVNode("button",{onClick:o[1]||(o[1]=d=>N(p.value,m.value-1))},"‹")]),e.createElementVNode("span",O,[e.createElementVNode("button",null,e.toDisplayString(p.value),1),e.createElementVNode("button",null,e.toDisplayString(e.unref(E.parseTime)(r.value,"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:o[2]||(o[2]=d=>N(p.value,m.value+1))},"›"),e.createElementVNode("button",{onClick:o[3]||(o[3]=d=>N(p.value+1,m.value))},"»")])]),e.createElementVNode("div",z,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(d,n)=>e.createElementVNode("button",{key:n,class:"disabled"},e.toDisplayString(e.unref(E.parseTime)(new Date(1970,1,d),"{D}")),1)),64))]),e.createElementVNode("div",R,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(d,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[n<=k.value+5-new Date(p.value,m.value+1,0).getDay()?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(d.month===m.value?d.class:"disabled"),onClick:t=>g(d,n)},e.toDisplayString(d.day),11,q)):e.createCommentVNode("",!0)],64))),128))])]),f.range==="range"?(e.openBlock(),e.createElementBlock("div",P,[e.createElementVNode("p",A,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:o[4]||(o[4]=d=>N(p.value-1,m.value))},"«"),e.createElementVNode("button",{onClick:o[5]||(o[5]=d=>N(p.value,m.value-1))},"‹")]),e.createElementVNode("span",J,[e.createElementVNode("button",null,e.toDisplayString(new Date(p.value,m.value+1).getFullYear()),1),e.createElementVNode("button",null,e.toDisplayString(e.unref(E.parseTime)(r.value.setMonth(m.value+1),"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:o[6]||(o[6]=d=>N(p.value,m.value+1))},"›"),e.createElementVNode("button",{onClick:o[7]||(o[7]=d=>N(p.value+1,m.value))},"»")])]),e.createElementVNode("div",W,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(d,n)=>e.createElementVNode("button",{key:n,class:"disabled"},e.toDisplayString(e.unref(E.parseTime)(new Date(1970,1,d),"{D}")),1)),64))]),e.createElementVNode("div",X,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(d,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[n>=k.value-new Date(p.value,m.value+1,1).getDay()?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(d.month===b.value.getMonth()?d.class:"disabled"),onClick:t=>g(d,n)},e.toDisplayString(d.day),11,H)):e.createCommentVNode("",!0)],64))),128))])])):e.createCommentVNode("",!0)]))}},Z=L(K,[["__scopeId","data-v-a842f008"]]),Q={key:1,class:"controls-container",style:{"margin-top":".5rem"}},ee={key:0},te={key:1,style:{padding:"0 1rem .5rem"}},ae={__name:"VacationTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"}},setup(w){const C=w,{t:r}=j.useI18n(),h=e.ref([]);e.ref([]);const f=e.ref(new Date().getFullYear()),B=e.ref(!1),p=e.ref(!1),D=e.ref(!1),_=e.ref({zIndex:3,minWidth:230,x:500,y:200}),m=e.ref(!1),c=e.ref([]),k=e.ref("Сектор разработок и эксплуатации сети"),b=e.ref([{value:"all",label:r("vacationSchedule.all"),key:"all"}]),y=e.ref([{value:f.value,label:f.value},{value:f.value+1,label:f.value+1}]),S=e.ref(!1),V=e.ref([]),$=e.ref(!1),s=e.ref({name:"Имя",length:0,code:""});e.watch(k,async(t,l)=>{t!==l&&(V.value=[],B.value=!1,C.odata.personalManagerData.forEach(u=>{(u.Status!=="Увольнение"&&u.Group===t||t==="all")&&(V.value.some(a=>(a==null?void 0:a.activeText)===u.Role)||V.value.push({val:!0,activeText:u.Role}))}),T())});const g=e.computed(()=>h.value.flatMap((t,l)=>!t.days||t.days.length===0?[{...t,key:0,ids:l}]:t.days.map((u,a)=>({ids:l,key:a,...t,...u})))),N=async()=>{C.odata.getPersonalManagerData({}).then(t=>{var l;k.value=(l=t.find(u=>u.Status!=="Увольнение"&&u.Description===C.fullName))==null?void 0:l.Group,t.forEach(u=>{u.Status!=="Увольнение"&&(b.value.some(a=>(a==null?void 0:a.value)===u.Group)||b.value.push({value:u.Group,label:u.Group,key:u.Group}),u.Group===k.value&&!V.value.some(a=>(a==null?void 0:a.activeText)===u.Role)&&V.value.push({val:!0,activeText:u.Role}))}),T(),p.value=!1})},T=()=>{h.value=[];let t=[];C.odata.personalManagerData.forEach(l=>{l.Status!=="Увольнение"&&(l.Group===k.value||k.value==="all")&&V.value.some(u=>u.val&&u.activeText===l.Role)&&(t.push(l.Code),h.value.push({name:l.Description,days:[{note:""}],jobTitle:l.Role,code:l.Code}))}),M(t),m.value=!1},M=t=>{C.workSchedule.getAllVacations({year:f.value}).then(l=>{console.log(t),t.forEach((u,a)=>{h.value[a].days=[{note:""}],l.forEach(x=>{u===x.code&&(console.log(x),typeof h.value[a].days[0].dateStart>"u"?h.value[a].days[0]={dateStart:E.parseTime(x.dateStart,"{dd}.{m}.{Y}"),dateEnd:E.parseTime(x.dateEnd,"{dd}.{m}.{Y}"),note:x.note,count:x.count}:h.value[a].days.push({dateStart:E.parseTime(x.dateStart,"{dd}.{m}.{Y}"),dateEnd:E.parseTime(x.dateEnd,"{dd}.{m}.{Y}"),note:x.note,count:x.count}))})})})},F=t=>{if(t.columnIndex<3&&g.value[t.rowIndex].key<g.value[t.rowIndex].days.length)return g.value[t.rowIndex].key===0?{rowspan:g.value[t.rowIndex].days.length,colspan:1}:{rowspan:0,colspan:0}},Y=(t,l,u,a)=>{s.value.ids=t.ids,s.value.key=t.key,s.value.startDate=t.dateStart,s.value.endDate=t.dateEnd,s.value.name=t.name,s.value.count=t.count,s.value.length=t.days.length,s.value.add=t.days.length>0&&t.days[t.days.length-1].count,s.value.level=l.level,s.value.holiday=c.value,_.value.y=a.clientY,_.value.x=a.clientX,l.level===2&&l.no<4&&(s.value.add||t.days.length>1)&&(D.value=!0),l.level===3&&(D.value=!0)},v=t=>{console.log(t);let l=h.value[s.value.ids];switch(t){case"add":l.days.push({note:""}),console.log(l.days.length);break;case"delete":delete l.days.pop(),n(s.value.ids);break}D.value=!1},o=t=>{$.value=t,s.value.count=t.count},d=()=>{$.value&&(h.value[s.value.ids].days[s.value.key]={...$.value,note:""},n(s.value.ids)),D.value=!1},n=t=>{C.workSchedule.rewriteFull({year:f.value,code:h.value[t].code,data:h.value[t].days.map(l=>(l.dateStart=l.dateStart.split(".").reverse().join("-"),l.dateEnd=l.dateEnd.split(".").reverse().join("-"),l))})};return E.holidays().then(t=>{c.value=t,N()}),(t,l)=>{const u=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",null,[w.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElSelect),{key:0,modelValue:k.value,"onUpdate:modelValue":l[0]||(l[0]=a=>k.value=a),placeholder:"Select",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,a=>(e.openBlock(),e.createBlock(e.unref(i.ElOption),{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),e.createVNode(e.unref(i.ElButton),{plain:"",onClick:l[1]||(l[1]=a=>m.value=!0),style:{"margin-bottom":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.jobTitle")),1)]),_:1}),e.createVNode(e.unref(i.ElSelect),{modelValue:f.value,"onUpdate:modelValue":l[2]||(l[2]=a=>f.value=a),onChange:T,placeholder:"Year",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,a=>(e.openBlock(),e.createBlock(e.unref(i.ElOption),{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),e.createVNode(e.unref(i.ElSkeleton),{style:{width:"100%"},loading:p.value,animated:""},{template:e.withCtx(()=>[e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"100%",height:"2rem"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"4rem","margin-right":"4px"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"4rem"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"8rem","margin-right":"4px"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"8rem"}})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTable),{id:"printTable",data:g.value,"span-method":F,onCellClick:Y,border:"",style:{width:"100%"},size:"small","empty-text":e.unref(r)("vacationSchedule.emptyText")},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:k.value!=="all"?e.unref(r)("vacationSchedule.title",{name:k.value}):e.unref(r)("vacationSchedule.enterprise")+` ${f.value}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("vacationSchedule.jobTitle"),width:"180",align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(g.value[a.$index].jobTitle),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("vacationSchedule.fullName"),width:"180",align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(g.value[a.$index].name),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("vacationSchedule.personnelNumber"),align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(g.value[a.$index].code),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("vacationSchedule.vacation"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("vacationSchedule.days"),align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(g.value[a.$index].count),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("vacationSchedule.date"),align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(g.value[a.$index].dateStart),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("vacationSchedule.endDate"),align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(g.value[a.$index].dateEnd),1)]),_:1},8,["label"])]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("vacationSchedule.note"),align:"center"},{default:e.withCtx(a=>[e.createVNode(e.unref(i.ElInput),{modelValue:h.value[g.value[a.$index].ids].days[g.value[a.$index].key].note,"onUpdate:modelValue":x=>h.value[g.value[a.$index].ids].days[g.value[a.$index].key].note=x,style:{width:"100%"},placeholder:" ",class:"noBorder",onBlur:x=>n(g.value[a.$index].ids)},null,8,["modelValue","onUpdate:modelValue","onBlur"])]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["data","empty-text"])]),_:1},8,["loading"]),w.checkEdit?(e.openBlock(),e.createElementBlock("div",Q,[B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:0,type:"primary",onClick:t.confirmData},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("vacationSchedule.sendInformation")),1)]),_:1},8,["onClick"])),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:1,type:"primary",onClick:t.confirmData},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("vacationSchedule.agreeOn")),1)]),_:1},8,["onClick"])),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:2,type:"primary",onClick:t.confirmData},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("vacationSchedule.reject")),1)]),_:1},8,["onClick"]))])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(i.ElButton),{disabled:S.value,plain:"",onClick:t.exportToExcel,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.exportExcel")),1)]),_:1},8,["disabled","onClick"])),[[u,S.value]]),e.createVNode(e.unref(i.ElDialog),{title:e.unref(r)("workSchedule.jobTitle"),modelValue:m.value,"onUpdate:modelValue":l[4]||(l[4]=a=>m.value=a),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(i.ElButton),{onClick:l[3]||(l[3]=a=>m.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{size:"default",type:"primary",onClick:T},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElForm),{ref:"dialogForm",model:V.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,a=>(e.openBlock(),e.createBlock(e.unref(i.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElSwitch),{modelValue:a.val,"onUpdate:modelValue":x=>a.val=x,"active-text":a.activeText},null,8,["modelValue","onUpdate:modelValue","active-text"])]),_:2},1024))),256))]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(I.ContextMenu),{show:D.value,"onUpdate:show":l[8]||(l[8]=a=>D.value=a),options:_.value},{default:e.withCtx(()=>[e.createVNode(e.unref(I.ContextMenuItem),{label:s.value.level===3&&typeof s.value.count<"u"?s.value.name+" "+s.value.count+" "+e.unref(r)("vacationSchedule.day",s.value.count):s.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(I.ContextMenuSeparator)),s.value.level===2?(e.openBlock(),e.createElementBlock("div",ee,[s.value.length>1?(e.openBlock(),e.createBlock(e.unref(I.ContextMenuItem),{key:0,label:e.unref(r)("vacationSchedule.deleteLast"),onClick:l[5]||(l[5]=a=>v("delete"))},null,8,["label"])):e.createCommentVNode("",!0),s.value.add?(e.openBlock(),e.createBlock(e.unref(I.ContextMenuItem),{key:1,label:e.unref(r)("vacationSchedule.addVacation"),onClick:l[6]||(l[6]=a=>v("add"))},null,8,["label"])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",te,[e.createVNode(Z,{data:s.value,range:"range",onInput:o},null,8,["data"]),e.createElementVNode("div",null,[e.createVNode(e.unref(i.ElButton),{onClick:l[7]||(l[7]=a=>D.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("vacationSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{onClick:d},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("vacationSchedule.save")),1)]),_:1})])]))]),_:1},8,["show","options"])])}}};module.exports=ae;
@@ -1,5 +1,5 @@
1
1
  import { ref as g, openBlock as y, createElementBlock as w, createElementVNode as f, toDisplayString as D, unref as a, Fragment as U, renderList as P, normalizeClass as K, createCommentVNode as Y, watch as ee, computed as ae, resolveDirective as le, createBlock as T, withCtx as p, createVNode as c, createTextVNode as _, withDirectives as te } from "vue";
2
- import { p as F, h as ne } from "./index-DkDfHM4U.js";
2
+ import { p as F, h as ne } from "./index-uVRk2ARj.js";
3
3
  import { useI18n as ue } from "vue-i18n";
4
4
  import { ElSelect as Z, ElOption as Q, ElButton as B, ElSkeleton as oe, ElSkeletonItem as J, ElTable as de, ElTableColumn as G, ElInput as se, ElDialog as ve, ElForm as ie, ElFormItem as re, ElSwitch as ce } from "element-plus";
5
5
  import { ContextMenu as he, ContextMenuItem as H, ContextMenuSeparator as pe } from "@imengyu/vue3-context-menu";
@@ -1,3 +1,3 @@
1
- "use strict";const e=require("vue"),ne=require("file-saver"),oe=require("exceljs"),g=require("./index-C8OllN4P.cjs"),ue=require("vue-i18n"),i=require("element-plus"),q=require("@imengyu/vue3-context-menu");function re(y){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(y){for(const C in y)if(C!=="default"){const f=Object.getOwnPropertyDescriptor(y,C);Object.defineProperty(u,C,f.get?f:{enumerable:!0,get:()=>y[C]})}}return u.default=y,Object.freeze(u)}const ie=re(oe),de={style:{height:"100px",width:"100%",display:"inline-block"}},se={style:{height:"100px",width:"100%",display:"inline-block"}},ce={key:3,class:"controls-container",style:{"margin-top":".5rem"}},ve={key:0,style:{padding:"0.5em 1.5em"}},ge={key:1,style:{padding:"0.5em 1.5em"}},me={__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"}},setup(y){const{t:u,d:C}=ue.useI18n(),f=y,T=e.ref(!1),n=e.ref([]),M=e.ref(1),w=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(M.value))),r=e.ref([]),E=e.ref(0),S=e.ref(9),p=e.ref(8),A=e.ref(!1),H=e.ref(!0),D=e.ref(!1),R=e.ref("5"),$=e.ref(1),x=e.ref("Сектор разработок и эксплуатации сети"),Y=e.ref([]),V=e.ref([]),s=e.ref({name:"Имя",length:0,code:""}),I=e.ref(!1),U=e.ref({zIndex:30,minWidth:220,x:500,y:200}),O=e.ref({});e.watch(x,async(a,l)=>{a!==l&&(V.value=[],A.value=!1,f.odata.personalManagerData.forEach(o=>{o.Status!=="Увольнение"&&o.Group===a&&(V.value.some(t=>(t==null?void 0:t.activeText)===o.Role)||V.value.push({val:!0,activeText:o.Role}))}),G())}),e.watch(M,async(a,l)=>{a!==l&&(w.value=new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(a)),P())});const Z=(a,l,o,t)=>{s.value.ids=a.ids,s.value.key=a.key,s.value.add=a.days.length>0&&a.days[a.days.length-1].cont,s.value.level=l.level,s.value.day=o.cellIndex,U.value.y=t.clientY,U.value.x=t.clientX,l.level===2&&l.no===0&&f.checkEdit&&(s.value.name=u("workSchedule.autocomplete"),I.value=!0),l.level===3&&o.cellIndex-l.no===1&&f.checkEdit&&(b(o.cellIndex,a.ids),s.value.name=u("workSchedule.modeSelection"),I.value=!0)},P=()=>{const a=O.value,l=new Date(w.value),o=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let t=[],d=0;for(let m=1;m<=o;m++){const h=g.parseTime(l.setDate(m),"{Y}-{m}-{dd}");d+=a.nowork.includes(h)||a.holidays.includes(h)?0:a.preholidays.includes(h)?7:8;const c=a.nowork.includes(h)?"nowork":a.holidays.includes(h)?"holiday":a.preholidays.includes(h)?"preholiday":"";t.push({day:m,holidays:c,weekday:C(new Date(l.getFullYear(),l.getMonth(),m),"day")})}E.value=d,r.value=t,f.odata.getPersonalManagerData({}).then(m=>{var h;x.value=(h=m.find(c=>c.Status!=="Увольнение"&&c.Description===f.fullName))==null?void 0:h.Group,m.forEach(c=>{c.Status!=="Увольнение"&&(Y.value.some(k=>(k==null?void 0:k.value)===c.Group)||Y.value.push({value:c.Group,label:c.Group,key:c.Group}),c.Group===x.value&&!V.value.some(k=>(k==null?void 0:k.activeText)===c.Role)&&V.value.push({val:!0,activeText:c.Role}))}),G(),H.value=!1})},Q=e.computed(()=>!n.value.some(a=>a.contHour!==E.value)),W=(a,l)=>{var m,h,c;const o=new Date(w.value),t=`${o.getFullYear()}-${(o.getMonth()+1).toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}`,d=(m=n.value[l])==null?void 0:m.days.findIndex(k=>k.day===t);return l===-1||d===-1?"":((h=n.value[l].days[d])==null?void 0:h.time)+" "+((c=n.value[l].days[d])==null?void 0:c.tips)},G=()=>{n.value=[];let a=[];f.odata.personalManagerData.forEach(l=>{if(l.Status!=="Увольнение"&&l.Group===x.value&&V.value.some(o=>o.val&&o.activeText===l.Role)){let o=g.byInitials(l.Description);a.push(l.Code),n.value.push({name:o+" ("+l.Role+")",days:[],contHour:0,code:l.Code,id:!1,ids:n.value.length})}}),X(a),D.value=!1},X=a=>{f.workSchedule.getWorkSchedule({code:a,date:g.parseTime(new Date(w.value),"{Y}-{m}-{dd}")}).then(l=>{l.forEach((o,t)=>{o!==null&&(n.value[t].days=o.data.days,n.value[t].id=o.id)}),N()})},N=()=>{n.value.forEach(a=>{a.contHour=a.days.reduce((l,o)=>l+o.time,0)})},K=a=>{n.value[a].days=[],N()},_=a=>{switch(R.value){case"5":for(let l=$.value;l<=r.value.length;l++)r.value[l-1].holidays===""&&b(l,a,!0),r.value[l-1].holidays==="preholiday"&&(p.value-=1,b(l,a,!0),p.value+=1);break;case"2x2":for(let l=$.value;l<=r.value.length;l+=4)b(l,a,!0),l+1<=r.value.length&&b(l+1,a,!0);break;case"2x5":for(let l=$.value;l<=r.value.length;l+=7)for(let o=l;o<l+5&&o<=r.value.length;o++)r.value[o-1].holidays==="preholiday"?(p.value-=1,b(o,a,!0),p.value+=1):b(o,a,!0);break}},b=(a,l,o=!1)=>{const{date:t,ind:d}=z(a,l);d===-1?(n.value[l].days.push({day:t,time:p.value,tips:`(${S.value}:00 - ${S.value+p.value+1}:00)`}),N()):o||(p.value=n.value[l].days[d].time,S.value=parseInt(n.value[l].days[d].tips.slice(1,-12)))},ee=(a,l)=>{const{ind:o}=z(a,l);n.value[l].days.splice(o,1),N(),document.querySelector(".app-main").click()},L=(a,l)=>{const{date:o,ind:t}=z(a,l);n.value[l].days[t]={day:o,time:p.value,tips:`(${S.value}:00 - ${S.value+p.value+1}:00)`},N()},z=(a,l)=>{var d;const o=g.parseTime(new Date(w.value).setDate(a),"{Y}-{m}-{dd}"),t=(d=n.value[l])==null?void 0:d.days.findIndex(m=>m.day===o);return{date:o,ind:t}},le=async()=>{var J;T.value=!0;const a=new ie.Workbook,l=a.addWorksheet(C(w.value,"month"),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),o={vertical:"middle",horizontal:"center"},t={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},d={vertical:"middle",horizontal:"center",wrapText:!0};l.mergeCells(`A1:${g.cellsDynamically("A1",r.value.length+5)}1`),l.mergeCells(`A2:${g.cellsDynamically("A2",r.value.length+5)}2`),l.mergeCells("A3:A4"),l.mergeCells(`B3:${g.cellsDynamically("B3",r.value.length)}3`),l.mergeCells(`${g.cellsDynamically("B3",r.value.length+1)}3:${g.cellsDynamically("B3",r.value.length+2)}3`),l.mergeCells(`${g.cellsDynamically("B3",r.value.length+3)}3:${g.cellsDynamically("B4",r.value.length+3)}4`),l.mergeCells(`${g.cellsDynamically("B3",r.value.length+4)}3:${g.cellsDynamically("B4",r.value.length+4)}4`),l.getCell("A1").value=u("workSchedule.firm"),l.getCell("A2").value=u("workSchedule.title",{name:x.value})+C(w.value,"month")+` ${new Date(w.value).getFullYear()}`,l.getCell("A3").value=u("workSchedule.month"),l.getCell("B3").value=u("workSchedule.numbersMonth"),l.getCell(3,r.value.length+2).value=u("workSchedule.onSchedule"),l.getCell(3,r.value.length+4).value=u("workSchedule.acquainted"),l.getCell(3,r.value.length+5).value=u("workSchedule.date"),l.getCell(4,r.value.length+2).value=u("workSchedule.days"),l.getCell(4,r.value.length+3).value=`${u("workSchedule.hours")} (${E.value})`;for(let v=2;v<=r.value.length+1;v++)l.getCell(4,v).value=r.value[v-2].weekday+`
1
+ "use strict";const e=require("vue"),ne=require("file-saver"),oe=require("exceljs"),g=require("./index-CHGzf-XH.cjs"),ue=require("vue-i18n"),i=require("element-plus"),q=require("@imengyu/vue3-context-menu");function re(y){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(y){for(const C in y)if(C!=="default"){const f=Object.getOwnPropertyDescriptor(y,C);Object.defineProperty(u,C,f.get?f:{enumerable:!0,get:()=>y[C]})}}return u.default=y,Object.freeze(u)}const ie=re(oe),de={style:{height:"100px",width:"100%",display:"inline-block"}},se={style:{height:"100px",width:"100%",display:"inline-block"}},ce={key:3,class:"controls-container",style:{"margin-top":".5rem"}},ve={key:0,style:{padding:"0.5em 1.5em"}},ge={key:1,style:{padding:"0.5em 1.5em"}},me={__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"}},setup(y){const{t:u,d:C}=ue.useI18n(),f=y,T=e.ref(!1),n=e.ref([]),M=e.ref(1),w=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(M.value))),r=e.ref([]),E=e.ref(0),S=e.ref(9),p=e.ref(8),A=e.ref(!1),H=e.ref(!0),D=e.ref(!1),R=e.ref("5"),$=e.ref(1),x=e.ref("Сектор разработок и эксплуатации сети"),Y=e.ref([]),V=e.ref([]),s=e.ref({name:"Имя",length:0,code:""}),I=e.ref(!1),U=e.ref({zIndex:30,minWidth:220,x:500,y:200}),O=e.ref({});e.watch(x,async(a,l)=>{a!==l&&(V.value=[],A.value=!1,f.odata.personalManagerData.forEach(o=>{o.Status!=="Увольнение"&&o.Group===a&&(V.value.some(t=>(t==null?void 0:t.activeText)===o.Role)||V.value.push({val:!0,activeText:o.Role}))}),G())}),e.watch(M,async(a,l)=>{a!==l&&(w.value=new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(a)),P())});const Z=(a,l,o,t)=>{s.value.ids=a.ids,s.value.key=a.key,s.value.add=a.days.length>0&&a.days[a.days.length-1].cont,s.value.level=l.level,s.value.day=o.cellIndex,U.value.y=t.clientY,U.value.x=t.clientX,l.level===2&&l.no===0&&f.checkEdit&&(s.value.name=u("workSchedule.autocomplete"),I.value=!0),l.level===3&&o.cellIndex-l.no===1&&f.checkEdit&&(b(o.cellIndex,a.ids),s.value.name=u("workSchedule.modeSelection"),I.value=!0)},P=()=>{const a=O.value,l=new Date(w.value),o=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let t=[],d=0;for(let m=1;m<=o;m++){const h=g.parseTime(l.setDate(m),"{Y}-{m}-{dd}");d+=a.nowork.includes(h)||a.holidays.includes(h)?0:a.preholidays.includes(h)?7:8;const c=a.nowork.includes(h)?"nowork":a.holidays.includes(h)?"holiday":a.preholidays.includes(h)?"preholiday":"";t.push({day:m,holidays:c,weekday:C(new Date(l.getFullYear(),l.getMonth(),m),"day")})}E.value=d,r.value=t,f.odata.getPersonalManagerData({}).then(m=>{var h;x.value=(h=m.find(c=>c.Status!=="Увольнение"&&c.Description===f.fullName))==null?void 0:h.Group,m.forEach(c=>{c.Status!=="Увольнение"&&(Y.value.some(k=>(k==null?void 0:k.value)===c.Group)||Y.value.push({value:c.Group,label:c.Group,key:c.Group}),c.Group===x.value&&!V.value.some(k=>(k==null?void 0:k.activeText)===c.Role)&&V.value.push({val:!0,activeText:c.Role}))}),G(),H.value=!1})},Q=e.computed(()=>!n.value.some(a=>a.contHour!==E.value)),W=(a,l)=>{var m,h,c;const o=new Date(w.value),t=`${o.getFullYear()}-${(o.getMonth()+1).toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}`,d=(m=n.value[l])==null?void 0:m.days.findIndex(k=>k.day===t);return l===-1||d===-1?"":((h=n.value[l].days[d])==null?void 0:h.time)+" "+((c=n.value[l].days[d])==null?void 0:c.tips)},G=()=>{n.value=[];let a=[];f.odata.personalManagerData.forEach(l=>{if(l.Status!=="Увольнение"&&l.Group===x.value&&V.value.some(o=>o.val&&o.activeText===l.Role)){let o=g.byInitials(l.Description);a.push(l.Code),n.value.push({name:o+" ("+l.Role+")",days:[],contHour:0,code:l.Code,id:!1,ids:n.value.length})}}),X(a),D.value=!1},X=a=>{f.workSchedule.getWorkSchedule({code:a,date:g.parseTime(new Date(w.value),"{Y}-{m}-{dd}")}).then(l=>{l.forEach((o,t)=>{o!==null&&(n.value[t].days=o.data.days,n.value[t].id=o.id)}),N()})},N=()=>{n.value.forEach(a=>{a.contHour=a.days.reduce((l,o)=>l+o.time,0)})},K=a=>{n.value[a].days=[],N()},_=a=>{switch(R.value){case"5":for(let l=$.value;l<=r.value.length;l++)r.value[l-1].holidays===""&&b(l,a,!0),r.value[l-1].holidays==="preholiday"&&(p.value-=1,b(l,a,!0),p.value+=1);break;case"2x2":for(let l=$.value;l<=r.value.length;l+=4)b(l,a,!0),l+1<=r.value.length&&b(l+1,a,!0);break;case"2x5":for(let l=$.value;l<=r.value.length;l+=7)for(let o=l;o<l+5&&o<=r.value.length;o++)r.value[o-1].holidays==="preholiday"?(p.value-=1,b(o,a,!0),p.value+=1):b(o,a,!0);break}},b=(a,l,o=!1)=>{const{date:t,ind:d}=z(a,l);d===-1?(n.value[l].days.push({day:t,time:p.value,tips:`(${S.value}:00 - ${S.value+p.value+1}:00)`}),N()):o||(p.value=n.value[l].days[d].time,S.value=parseInt(n.value[l].days[d].tips.slice(1,-12)))},ee=(a,l)=>{const{ind:o}=z(a,l);n.value[l].days.splice(o,1),N(),document.querySelector(".app-main").click()},L=(a,l)=>{const{date:o,ind:t}=z(a,l);n.value[l].days[t]={day:o,time:p.value,tips:`(${S.value}:00 - ${S.value+p.value+1}:00)`},N()},z=(a,l)=>{var d;const o=g.parseTime(new Date(w.value).setDate(a),"{Y}-{m}-{dd}"),t=(d=n.value[l])==null?void 0:d.days.findIndex(m=>m.day===o);return{date:o,ind:t}},le=async()=>{var J;T.value=!0;const a=new ie.Workbook,l=a.addWorksheet(C(w.value,"month"),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),o={vertical:"middle",horizontal:"center"},t={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},d={vertical:"middle",horizontal:"center",wrapText:!0};l.mergeCells(`A1:${g.cellsDynamically("A1",r.value.length+5)}1`),l.mergeCells(`A2:${g.cellsDynamically("A2",r.value.length+5)}2`),l.mergeCells("A3:A4"),l.mergeCells(`B3:${g.cellsDynamically("B3",r.value.length)}3`),l.mergeCells(`${g.cellsDynamically("B3",r.value.length+1)}3:${g.cellsDynamically("B3",r.value.length+2)}3`),l.mergeCells(`${g.cellsDynamically("B3",r.value.length+3)}3:${g.cellsDynamically("B4",r.value.length+3)}4`),l.mergeCells(`${g.cellsDynamically("B3",r.value.length+4)}3:${g.cellsDynamically("B4",r.value.length+4)}4`),l.getCell("A1").value=u("workSchedule.firm"),l.getCell("A2").value=u("workSchedule.title",{name:x.value})+C(w.value,"month")+` ${new Date(w.value).getFullYear()}`,l.getCell("A3").value=u("workSchedule.month"),l.getCell("B3").value=u("workSchedule.numbersMonth"),l.getCell(3,r.value.length+2).value=u("workSchedule.onSchedule"),l.getCell(3,r.value.length+4).value=u("workSchedule.acquainted"),l.getCell(3,r.value.length+5).value=u("workSchedule.date"),l.getCell(4,r.value.length+2).value=u("workSchedule.days"),l.getCell(4,r.value.length+3).value=`${u("workSchedule.hours")} (${E.value})`;for(let v=2;v<=r.value.length+1;v++)l.getCell(4,v).value=r.value[v-2].weekday+`
2
2
  `+(v-1),l.getColumn(v).width=6,l.getColumn(v).alignment=d,l.getCell(4,v).border=t;l.getRow(1).height=40,l.getRow(2).height=30,l.getRow(3).height=20,l.getColumn(1).width=15,l.getColumn(r.value.length+2).width=5,l.getColumn(r.value.length+3).width=6,l.getColumn(r.value.length+4).width=13,l.getColumn(r.value.length+5).width=13,l.getColumn(1).alignment=d,l.getCell("A2").alignment=o,l.getCell("A3").alignment=o,l.getCell("B3").alignment=o,l.getCell(3,r.value.length+2).alignment=o,l.getColumn(r.value.length+2).alignment=d,l.getColumn(r.value.length+3).alignment=d,l.getColumn(r.value.length+4).alignment=o,l.getColumn(r.value.length+5).alignment=o,l.getCell("A3").border=t,l.getCell("B3").border=t,l.getCell(3,r.value.length+2).border=t,l.getCell(4,r.value.length+2).border=t,l.getCell(3,r.value.length+4).border=t,l.getCell(3,r.value.length+5).border=t,l.getCell(4,r.value.length+3).border=t;let m=0;for(const v of n.value){let F=[v.name];for(let B=1;B<=r.value.length;B++){const{ind:j}=z(B,m);j!==-1?F[B]=`${v.days[j].time} ${v.days[j].tips}`:F[B]=" "}F.push(((J=v.days)==null?void 0:J.length)||" ",v.contHour||0);const ae=l.addRow(F);ae.border=t,m++}let h="Начальник отдела";f.odata.personalManagerData.forEach(v=>{v.Status!=="Увольнение"&&v.Role==="Начальник отдела правовой и кадровой работы"&&(h=v.Description)}),l.mergeCells(`A${n.value.length+6}:P${n.value.length+6}`),l.mergeCells(`Q${n.value.length+6}:AG${n.value.length+6}`),l.mergeCells(`B${n.value.length+8}:E${n.value.length+8}`),l.mergeCells(`F${n.value.length+8}:L${n.value.length+8}`),l.mergeCells(`M${n.value.length+8}:P${n.value.length+8}`),l.mergeCells(`S${n.value.length+8}:V${n.value.length+8}`),l.mergeCells(`W${n.value.length+8}:AC${n.value.length+8}`),l.mergeCells(`AD${n.value.length+8}:AG${n.value.length+8}`),l.mergeCells(`Z${n.value.length+9}:AA${n.value.length+9}`),l.getCell(`A${n.value.length+6}`).value=u("workSchedule.byInitials"),l.getCell(`Q${n.value.length+6}`).value=u("workSchedule.supervisorHR"),l.getCell(`B${n.value.length+8}`).value=u("workSchedule.compiled")+":",l.getCell(`S${n.value.length+8}`).value=u("workSchedule.approved")+":",l.getCell(`M${n.value.length+8}`).value=g.byInitials(f.fullName),l.getCell(`AD${n.value.length+8}`).value=g.byInitials(h),l.getCell(`Z${n.value.length+9}`).value=u("workSchedule.printPlace"),l.getCell(`A${n.value.length+6}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`Q${n.value.length+6}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`B${n.value.length+8}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`F${n.value.length+8}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`M${n.value.length+8}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`AD${n.value.length+8}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`Z${n.value.length+9}`).alignment=o,l.getCell(`F${n.value.length+8}`).border={bottom:{style:"thin"}},l.getCell(`W${n.value.length+8}`).border={bottom:{style:"thin"}};const c="export_"+g.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",k=await a.xlsx.writeBuffer();ne.saveAs(new Blob([k]),c),T.value=!1},te=async()=>{A.value||f.workSchedule.addWorkSchedule({data:n.value,date:g.parseTime(new Date(w.value),"{Y}-{m}-{dd}")}).then(a=>A.value=a)};return g.holidays().then(a=>{O.value=a,P()}),(a,l)=>{const o=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",null,[y.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElSelect),{key:0,modelValue:x.value,"onUpdate:modelValue":l[0]||(l[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(i.ElOption),{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),y.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:1,plain:"",onClick:l[1]||(l[1]=t=>D.value=!0),style:{"margin-bottom":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.jobTitle")),1)]),_:1})):e.createCommentVNode("",!0),y.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElSwitch),{key:2,modelValue:M.value,"onUpdate:modelValue":l[2]||(l[2]=t=>M.value=t),"active-text":e.unref(u)("workSchedule.currentMonth"),"active-value":"0","inactive-value":"1",style:{"margin-bottom":".5rem","margin-left":".5rem"}},null,8,["modelValue","active-text"])):e.createCommentVNode("",!0),e.createVNode(e.unref(i.ElSkeleton),{style:{width:"100%"},loading:H.value,animated:""},{template:e.withCtx(()=>[e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"100%",height:"2rem"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"4rem","margin-right":"4px"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"4rem"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"8rem","margin-right":"4px"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"8rem"}})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTable),{id:"printTable",data:n.value,style:{width:"100%"},size:"small",align:"center",onCellClick:Z,"empty-text":e.unref(u)("workSchedule.emptyText")},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(u)("workSchedule.title",{name:x.value})+e.unref(C)(w.value,"month")+` ${new Date(w.value).getFullYear()}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(u)("workSchedule.month"),width:"180",align:"center"},{default:e.withCtx(t=>[e.createElementVNode("div",de,e.toDisplayString(n.value[t.$index].name),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(u)("workSchedule.numbersMonth"),align:"center"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElTableColumn),{key:t.day,width:"45","class-name":t.holidays,align:"center",label:t.weekday+`
3
3
  `+t.day.toString()},{default:e.withCtx(d=>[e.createElementVNode("div",se,e.toDisplayString(W(t.day,d.$index)||" "),1)]),_:2},1032,["class-name","label"]))),128))]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(u)("workSchedule.onSchedule"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(u)("workSchedule.days"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(n.value[t.$index].days.length||0),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:`${e.unref(u)("workSchedule.hours")} ( ${E.value} )`,align:"center"},{default:e.withCtx(t=>[e.createElementVNode("div",{style:e.normalizeStyle(`color: ${E.value===t.row.contHour?"green":"red"};`)},e.toDisplayString(t.row.contHour),5)]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["data","empty-text"])]),_:1},8,["loading"]),Q.value&&y.checkEdit?(e.openBlock(),e.createElementBlock("div",ce,[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.chartsFilled"))+": ",1),A.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:0,type:"primary",onClick:te},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.confirm")),1)]),_:1})),l[17]||(l[17]=e.createTextVNode()),e.createElementVNode("span",null,e.toDisplayString(y.fullName),1)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(i.ElButton),{disabled:T.value,plain:"",onClick:le,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[o,T.value]]),e.createVNode(e.unref(i.ElDialog),{title:e.unref(u)("workSchedule.jobTitle"),modelValue:D.value,"onUpdate:modelValue":l[4]||(l[4]=t=>D.value=t),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(i.ElButton),{onClick:l[3]||(l[3]=t=>D.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{size:"default",type:"primary",onClick:G},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElForm),{ref:"dialogForm",model:V.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElSwitch),{modelValue:t.val,"onUpdate:modelValue":d=>t.val=d,"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(q.ContextMenu),{show:I.value,"onUpdate:show":l[16]||(l[16]=t=>I.value=t),options:U.value},{default:e.withCtx(()=>[e.createVNode(e.unref(q.ContextMenuItem),{label:s.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(q.ContextMenuSeparator)),s.value.level===2?(e.openBlock(),e.createElementBlock("div",ve,[e.createVNode(e.unref(i.ElRadioGroup),{modelValue:R.value,"onUpdate:modelValue":l[5]||(l[5]=t=>R.value=t),size:"small"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElRadioButton),{label:e.unref(u)("workSchedule.Days5"),value:"5"},null,8,["label"]),e.createVNode(e.unref(i.ElRadioButton),{label:"2 Х 2",value:"2x2"}),e.createVNode(e.unref(i.ElRadioButton),{label:"2 Х 5",value:"2x5"})]),_:1},8,["modelValue"]),l[18]||(l[18]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(u)("workSchedule.fromDate"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:$.value,"onUpdate:modelValue":l[6]||(l[6]=t=>$.value=t),step:1,min:1,max:r.value.length},null,8,["modelValue","max"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(u)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:S.value,"onUpdate:modelValue":l[7]||(l[7]=t=>S.value=t),step:1,min:8,max:11},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(u)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:p.value,"onUpdate:modelValue":l[8]||(l[8]=t=>p.value=t),step:1,min:4,max:12},null,8,["modelValue"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[9]||(l[9]=t=>_(s.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.fillOut")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[10]||(l[10]=t=>K(s.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.clearRow")),1)]),_:1})])):(e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("div",null,e.toDisplayString(W(s.value.day,s.value.ids)),1),l[19]||(l[19]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(u)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:S.value,"onUpdate:modelValue":l[11]||(l[11]=t=>S.value=t),step:1,min:8,max:11,onChange:l[12]||(l[12]=t=>L(s.value.day,s.value.ids))},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(u)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:p.value,"onUpdate:modelValue":l[13]||(l[13]=t=>p.value=t),step:1,min:4,max:12,onChange:l[14]||(l[14]=t=>L(s.value.day,s.value.ids))},null,8,["modelValue"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[15]||(l[15]=t=>ee(s.value.day,s.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.delete")),1)]),_:1})]))]),_:1},8,["show","options"])])}}};module.exports=me;
package/dist/WorkTable.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ref as v, watch as ge, computed as Se, resolveDirective as $e, openBlock as f, createElementBlock as T, createBlock as M, unref as t, withCtx as i, Fragment as te, renderList as ae, createCommentVNode as N, createTextVNode as S, toDisplayString as g, createVNode as r, createElementVNode as k, normalizeStyle as xe, withDirectives as De } from "vue";
2
2
  import { saveAs as Ve } from "file-saver";
3
3
  import * as Ee from "exceljs";
4
- import { p as H, b as ne, h as Me, c as D } from "./index-DkDfHM4U.js";
4
+ import { p as H, b as ne, h as Me, c as D } from "./index-uVRk2ARj.js";
5
5
  import { useI18n as Ae } from "vue-i18n";
6
6
  import { ElSelect as Be, ElOption as Te, ElButton as A, ElSwitch as he, ElSkeleton as ze, ElSkeletonItem as W, ElTable as Fe, ElTableColumn as z, ElDialog as Re, ElForm as Ie, ElFormItem as Ye, ElRadioGroup as Ue, ElRadioButton as ue, ElSlider as P } from "element-plus";
7
7
  import { ContextMenu as Ge, ContextMenuItem as Ne, ContextMenuSeparator as He } from "@imengyu/vue3-context-menu";
@@ -0,0 +1 @@
1
+ "use strict";const i=require("js-cookie");function u(t,e){if(arguments.length===0||!t)return null;const o=e||"{Y}-{m}-{d} {G}:{i}:{s}";let r;typeof t=="object"?r=t:(typeof t=="string"&&(/^[0-9]+$/.test(t)?t=parseInt(t):t=t.replace(new RegExp(/-/gm),"/")),typeof t=="number"&&t.toString().length===10&&(t=t*1e3),r=new Date(t));const a="ru-RU",l={Y:r.getFullYear(),m:(r.getMonth()+1).toString().padStart(2,"0"),d:r.getDate(),dd:r.getDate().toString().padStart(2,"0"),G:r.getHours(),H:r.getHours().toString().padStart(2,"0"),i:r.getMinutes().toString().padStart(2,"0"),s:r.getSeconds().toString().padStart(2,"0"),D:new Intl.DateTimeFormat(a,{weekday:"short"}).format(r),F:new Intl.DateTimeFormat(a,{month:"long"}).format(r),M:new Intl.DateTimeFormat(a,{month:"short"}).format(r)};return o.replace(/{(dd|[YmdGHisDFM])+}/g,(m,c)=>l[c])}function f(t,e){let r=t.replace(/[0-9]/g,"").split("").reverse().map(a=>a.charCodeAt(0));return s(r,e,0),r.map(a=>String.fromCharCode(a)).reverse().join("")}function p(t){return t.split(" ",3).map((e,o)=>o!==0?e.slice(0,1)+".":e).join(" ")}let n={};async function g(){if(n!=null&&n.holidays)return n;try{const t=await fetch("https://cp.avanta-telecom.ru/api/v2/calendar/getHoliday",{method:"GET",mode:"cors",cache:"default",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"text/html","X-Token":h(),"Cache-Control":"no-cache"},redirect:"follow",referrerPolicy:"no-referrer"});if(!t.ok)throw new Error(`HTTP error! Status: ${t.status}`);const e=await t.json();return e.result.holiday=["2024-01-01","2024-01-02","2024-01-03","2024-01-04","2024-01-05","2024-01-06","2024-01-07","2024-01-08","2024-02-23","2024-03-08","2024-05-01","2024-05-09","2024-06-12","2024-11-04","2025-01-01","2025-01-02","2025-01-03","2025-01-04","2025-01-05","2025-01-06","2025-01-07","2025-01-08","2025-02-23","2025-03-08","2025-05-01","2025-05-09","2025-06-12","2025-11-04"],n=e.result,n}catch(t){throw console.error("Ошибка загрузки данных о праздниках:",t),t}}function s(t,e,o){if(typeof e!="number"||e<1)return!0;if(e=e-1,(typeof t[o]!="number"||t[o]<65)&&(t[o]=65),t[o]+e<=90)t[o]=t[o]+e;else{let r=Math.floor((t[o]-65+e)/26);t[o]=(t[o]-65+e)%26+65,s(t,r,o+1)}}const h=()=>i.get("X-Token")||!1;exports.byInitials=p;exports.cellsDynamically=f;exports.holidays=g;exports.parseTime=u;
@@ -0,0 +1,100 @@
1
+ import f from "js-cookie";
2
+ function g(t, e) {
3
+ if (arguments.length === 0 || !t)
4
+ return null;
5
+ const o = e || "{Y}-{m}-{d} {G}:{i}:{s}";
6
+ let r;
7
+ typeof t == "object" ? r = t : (typeof t == "string" && (/^[0-9]+$/.test(t) ? t = parseInt(t) : t = t.replace(new RegExp(/-/gm), "/")), typeof t == "number" && t.toString().length === 10 && (t = t * 1e3), r = new Date(t));
8
+ const a = "ru-RU", l = {
9
+ Y: r.getFullYear(),
10
+ m: (r.getMonth() + 1).toString().padStart(2, "0"),
11
+ d: r.getDate(),
12
+ dd: r.getDate().toString().padStart(2, "0"),
13
+ G: r.getHours(),
14
+ H: r.getHours().toString().padStart(2, "0"),
15
+ i: r.getMinutes().toString().padStart(2, "0"),
16
+ s: r.getSeconds().toString().padStart(2, "0"),
17
+ D: new Intl.DateTimeFormat(a, { weekday: "short" }).format(r),
18
+ F: new Intl.DateTimeFormat(a, { month: "long" }).format(r),
19
+ M: new Intl.DateTimeFormat(a, { month: "short" }).format(r)
20
+ };
21
+ return o.replace(/{(dd|[YmdGHisDFM])+}/g, (p, c) => l[c]);
22
+ }
23
+ function h(t, e) {
24
+ let r = t.replace(/[0-9]/g, "").split("").reverse().map((a) => a.charCodeAt(0));
25
+ return s(r, e, 0), r.map((a) => String.fromCharCode(a)).reverse().join("");
26
+ }
27
+ function m(t) {
28
+ return t.split(" ", 3).map((e, o) => o !== 0 ? e.slice(0, 1) + "." : e).join(" ");
29
+ }
30
+ let n = {};
31
+ async function y() {
32
+ if (n != null && n.holidays) return n;
33
+ try {
34
+ const t = await fetch("https://cp.avanta-telecom.ru/api/v2/calendar/getHoliday", {
35
+ method: "GET",
36
+ mode: "cors",
37
+ cache: "default",
38
+ credentials: "same-origin",
39
+ headers: {
40
+ "Content-Type": "application/json",
41
+ Accept: "text/html",
42
+ "X-Token": u(),
43
+ // Предполагается, что эта функция определена где-то в коде
44
+ "Cache-Control": "no-cache"
45
+ },
46
+ redirect: "follow",
47
+ referrerPolicy: "no-referrer"
48
+ });
49
+ if (!t.ok)
50
+ throw new Error(`HTTP error! Status: ${t.status}`);
51
+ const e = await t.json();
52
+ return e.result.holiday = [
53
+ "2024-01-01",
54
+ "2024-01-02",
55
+ "2024-01-03",
56
+ "2024-01-04",
57
+ "2024-01-05",
58
+ "2024-01-06",
59
+ "2024-01-07",
60
+ "2024-01-08",
61
+ "2024-02-23",
62
+ "2024-03-08",
63
+ "2024-05-01",
64
+ "2024-05-09",
65
+ "2024-06-12",
66
+ "2024-11-04",
67
+ "2025-01-01",
68
+ "2025-01-02",
69
+ "2025-01-03",
70
+ "2025-01-04",
71
+ "2025-01-05",
72
+ "2025-01-06",
73
+ "2025-01-07",
74
+ "2025-01-08",
75
+ "2025-02-23",
76
+ "2025-03-08",
77
+ "2025-05-01",
78
+ "2025-05-09",
79
+ "2025-06-12",
80
+ "2025-11-04"
81
+ ], n = e.result, n;
82
+ } catch (t) {
83
+ throw console.error("Ошибка загрузки данных о праздниках:", t), t;
84
+ }
85
+ }
86
+ function s(t, e, o) {
87
+ if (typeof e != "number" || e < 1) return !0;
88
+ if (e = e - 1, (typeof t[o] != "number" || t[o] < 65) && (t[o] = 65), t[o] + e <= 90) t[o] = t[o] + e;
89
+ else {
90
+ let r = Math.floor((t[o] - 65 + e) / 26);
91
+ t[o] = (t[o] - 65 + e) % 26 + 65, s(t, r, o + 1);
92
+ }
93
+ }
94
+ const u = () => f.get("X-Token") || !1;
95
+ export {
96
+ m as b,
97
+ h as c,
98
+ y as h,
99
+ g as p
100
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studio-west/employees",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -1 +0,0 @@
1
- "use strict";const i=require("js-cookie");function u(t,r){if(arguments.length===0||!t)return null;const o=r||"{Y}-{m}-{d} {G}:{i}:{s}";let e;typeof t=="object"?e=t:(typeof t=="string"&&(/^[0-9]+$/.test(t)?t=parseInt(t):t=t.replace(new RegExp(/-/gm),"/")),typeof t=="number"&&t.toString().length===10&&(t=t*1e3),e=new Date(t));const a="ru-RU",s={Y:e.getFullYear(),m:(e.getMonth()+1).toString().padStart(2,"0"),d:e.getDate(),dd:e.getDate().toString().padStart(2,"0"),G:e.getHours(),H:e.getHours().toString().padStart(2,"0"),i:e.getMinutes().toString().padStart(2,"0"),s:e.getSeconds().toString().padStart(2,"0"),D:new Intl.DateTimeFormat(a,{weekday:"short"}).format(e),F:new Intl.DateTimeFormat(a,{month:"long"}).format(e),M:new Intl.DateTimeFormat(a,{month:"short"}).format(e)};return o.replace(/{(dd|[YmdGHisDFM])+}/g,(m,c)=>s[c])}function f(t,r){let e=t.replace(/[0-9]/g,"").split("").reverse().map(a=>a.charCodeAt(0));return l(e,r,0),e.map(a=>String.fromCharCode(a)).reverse().join("")}function p(t){return t.split(" ",3).map((r,o)=>o!==0?r.slice(0,1)+".":r).join(" ")}let n={};function g(){if(typeof n.holidays<"u")return n;fetch("https://cp.avanta-telecom.ru/api/v2/calendar/getHoliday",{method:"GET",mode:"cors",cache:"default",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"text/html","X-Token":h(),"Cache-Control":"no-cache"},redirect:"follow",referrerPolicy:"no-referrer"}).then(t=>{if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return t.json()}).then(t=>(t.result.holiday=["2024-01-01","2024-01-02","2024-01-03","2024-01-04","2024-01-05","2024-01-06","2024-01-07","2024-01-08","2024-02-23","2024-03-08","2024-05-01","2024-05-09","2024-06-12","2024-11-04","2025-01-01","2025-01-02","2025-01-03","2025-01-04","2025-01-05","2025-01-06","2025-01-07","2025-01-08","2025-02-23","2025-03-08","2025-05-01","2025-05-09","2025-06-12","2025-11-04"],n=t.result,t.result)).catch(t=>{console.error("Ошибка загрузки файла:",t)})}function l(t,r,o){if(typeof r!="number"||r<1)return!0;if(r=r-1,(typeof t[o]!="number"||t[o]<65)&&(t[o]=65),t[o]+r<=90)t[o]=t[o]+r;else{let e=Math.floor((t[o]-65+r)/26);t[o]=(t[o]-65+r)%26+65,l(t,e,o+1)}}const h=()=>i.get("X-Token")||!1;exports.byInitials=p;exports.cellsDynamically=f;exports.holidays=g;exports.parseTime=u;
@@ -1,107 +0,0 @@
1
- import f from "js-cookie";
2
- function g(t, r) {
3
- if (arguments.length === 0 || !t)
4
- return null;
5
- const o = r || "{Y}-{m}-{d} {G}:{i}:{s}";
6
- let e;
7
- typeof t == "object" ? e = t : (typeof t == "string" && (/^[0-9]+$/.test(t) ? t = parseInt(t) : t = t.replace(new RegExp(/-/gm), "/")), typeof t == "number" && t.toString().length === 10 && (t = t * 1e3), e = new Date(t));
8
- const a = "ru-RU", s = {
9
- Y: e.getFullYear(),
10
- m: (e.getMonth() + 1).toString().padStart(2, "0"),
11
- d: e.getDate(),
12
- dd: e.getDate().toString().padStart(2, "0"),
13
- G: e.getHours(),
14
- H: e.getHours().toString().padStart(2, "0"),
15
- i: e.getMinutes().toString().padStart(2, "0"),
16
- s: e.getSeconds().toString().padStart(2, "0"),
17
- D: new Intl.DateTimeFormat(a, { weekday: "short" }).format(e),
18
- F: new Intl.DateTimeFormat(a, { month: "long" }).format(e),
19
- M: new Intl.DateTimeFormat(a, { month: "short" }).format(e)
20
- };
21
- return o.replace(/{(dd|[YmdGHisDFM])+}/g, (i, c) => s[c]);
22
- }
23
- function h(t, r) {
24
- let e = t.replace(/[0-9]/g, "").split("").reverse().map((a) => a.charCodeAt(0));
25
- return l(e, r, 0), e.map((a) => String.fromCharCode(a)).reverse().join("");
26
- }
27
- function m(t) {
28
- return t.split(" ", 3).map((r, o) => o !== 0 ? r.slice(0, 1) + "." : r).join(" ");
29
- }
30
- let n = {};
31
- function y() {
32
- if (typeof n.holidays < "u") return n;
33
- fetch(
34
- "https://cp.avanta-telecom.ru/api/v2/calendar/getHoliday",
35
- {
36
- method: "GET",
37
- // *GET, POST, PUT, DELETE, etc.
38
- mode: "cors",
39
- // no-cors, *cors, same-origin
40
- cache: "default",
41
- // *default, no-cache, reload, force-cache, only-if-cached
42
- credentials: "same-origin",
43
- // include, *same-origin, omit
44
- headers: {
45
- "Content-Type": "application/json",
46
- Accept: "text/html",
47
- "X-Token": u(),
48
- "Cache-Control": "no-cache"
49
- },
50
- redirect: "follow",
51
- // manual, *follow, error
52
- referrerPolicy: "no-referrer"
53
- // no-referrer, *client
54
- // body: JSON.stringify(data), // body data type must match "Content-Type" header
55
- }
56
- ).then((t) => {
57
- if (!t.ok)
58
- throw new Error(`HTTP error! status: ${t.status}`);
59
- return t.json();
60
- }).then((t) => (t.result.holiday = [
61
- "2024-01-01",
62
- "2024-01-02",
63
- "2024-01-03",
64
- "2024-01-04",
65
- "2024-01-05",
66
- "2024-01-06",
67
- "2024-01-07",
68
- "2024-01-08",
69
- "2024-02-23",
70
- "2024-03-08",
71
- "2024-05-01",
72
- "2024-05-09",
73
- "2024-06-12",
74
- "2024-11-04",
75
- "2025-01-01",
76
- "2025-01-02",
77
- "2025-01-03",
78
- "2025-01-04",
79
- "2025-01-05",
80
- "2025-01-06",
81
- "2025-01-07",
82
- "2025-01-08",
83
- "2025-02-23",
84
- "2025-03-08",
85
- "2025-05-01",
86
- "2025-05-09",
87
- "2025-06-12",
88
- "2025-11-04"
89
- ], n = t.result, t.result)).catch((t) => {
90
- console.error("Ошибка загрузки файла:", t);
91
- });
92
- }
93
- function l(t, r, o) {
94
- if (typeof r != "number" || r < 1) return !0;
95
- if (r = r - 1, (typeof t[o] != "number" || t[o] < 65) && (t[o] = 65), t[o] + r <= 90) t[o] = t[o] + r;
96
- else {
97
- let e = Math.floor((t[o] - 65 + r) / 26);
98
- t[o] = (t[o] - 65 + r) % 26 + 65, l(t, e, o + 1);
99
- }
100
- }
101
- const u = () => f.get("X-Token") || !1;
102
- export {
103
- m as b,
104
- h as c,
105
- y as h,
106
- g as p
107
- };