@studio-west/employees 0.1.6 → 0.1.8

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,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";
@@ -1 +1 @@
1
- .wrapper[data-v-a842f008]{display:flex}.wrapper .month_year[data-v-a842f008]{display:flex;justify-content:space-around;align-items:center}.wrapper .month_year span:not(.text) button[data-v-a842f008]{font-size:1.3em}.wrapper>div[data-v-a842f008]:not(:first-child){margin-left:2rem}.wrapper button[data-v-a842f008]{height:30px;text-align:center;line-height:30px;cursor:pointer;background:none;border:none;border-radius:.2rem;transition:all .3s ease}.wrapper button[data-v-a842f008]:hover:not(.disabled):not(.active){color:var(--el-color-success)}.wrapper .week[data-v-a842f008]{border-bottom:1px solid var(--el-color-info);margin-bottom:.5rem}.wrapper .month[data-v-a842f008],.wrapper .week[data-v-a842f008]{width:250px;display:grid;grid-template-columns:1fr 1fr 1fr 1fr 1fr 1fr 1fr;gap:.2rem}.wrapper .month>button[data-v-a842f008],.wrapper .week>button[data-v-a842f008]{width:30px}.wrapper .month>button.disabled[data-v-a842f008],.wrapper .week>button.disabled[data-v-a842f008]{color:var(--el-color-info);cursor:not-allowed}.wrapper .month>button.preholiday[data-v-a842f008],.wrapper .week>button.preholiday[data-v-a842f008]{background-color:#fdd404}.wrapper .month>button.weekend[data-v-a842f008],.wrapper .week>button.weekend[data-v-a842f008]{background-color:#ff8080}.wrapper .month>button.holiday[data-v-a842f008],.wrapper .week>button.holiday[data-v-a842f008]{background-color:red}.wrapper .month>button.nowork[data-v-a842f008],.wrapper .week>button.nowork[data-v-a842f008]{background-color:red}.wrapper .month>button.active[data-v-a842f008],.wrapper .week>button.active[data-v-a842f008]{background-color:#007bff}.noBorder .el-input__wrapper{box-shadow:none}
1
+ .wrapper[data-v-fef4c07c]{display:flex}.wrapper .month_year[data-v-fef4c07c]{display:flex;justify-content:space-around;align-items:center}.wrapper .month_year span:not(.text) button[data-v-fef4c07c]{font-size:1.3em}.wrapper>div[data-v-fef4c07c]:not(:first-child){margin-left:2rem}.wrapper button[data-v-fef4c07c]{height:30px;text-align:center;line-height:30px;cursor:pointer;background:none;border:none;border-radius:.2rem;transition:all .3s ease}.wrapper button[data-v-fef4c07c]:hover:not(.disabled):not(.active){color:var(--el-color-success)}.wrapper .week[data-v-fef4c07c]{border-bottom:1px solid var(--el-color-info);margin-bottom:.5rem}.wrapper .month[data-v-fef4c07c],.wrapper .week[data-v-fef4c07c]{width:250px;display:grid;grid-template-columns:1fr 1fr 1fr 1fr 1fr 1fr 1fr;gap:.2rem}.wrapper .month>button[data-v-fef4c07c],.wrapper .week>button[data-v-fef4c07c]{width:30px}.wrapper .month>button.disabled[data-v-fef4c07c],.wrapper .week>button.disabled[data-v-fef4c07c]{color:var(--el-color-info);cursor:not-allowed}.wrapper .month>button.preholiday[data-v-fef4c07c],.wrapper .week>button.preholiday[data-v-fef4c07c]{background-color:#ffe78070}.wrapper .month>button.weekend[data-v-fef4c07c],.wrapper .week>button.weekend[data-v-fef4c07c]{background-color:#ff808070}.wrapper .month>button.select[data-v-fef4c07c],.wrapper .week>button.select[data-v-fef4c07c]{background-color:#007bff70}.wrapper .month>button.holiday[data-v-fef4c07c],.wrapper .week>button.holiday[data-v-fef4c07c]{background-color:red}.wrapper .month>button.nowork[data-v-fef4c07c],.wrapper .week>button.nowork[data-v-fef4c07c]{background-color:red}.wrapper .month>button.active[data-v-fef4c07c],.wrapper .week>button.active[data-v-fef4c07c]{background-color:#007bff}.noBorder .el-input__wrapper{box-shadow:none}
@@ -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.8",
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
- };