@studio-west/employees 0.6.7 → 0.6.9

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,4 +1,4 @@
1
- "use strict";const e=require("vue"),de=require("file-saver"),se=require("exceljs"),c=require("./index-DxdyeKnm.cjs"),ce=require("vue-i18n"),i=require("element-plus"),G=require("@imengyu/vue3-context-menu");function ve(w){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(w){for(const S in w)if(S!=="default"){const f=Object.getOwnPropertyDescriptor(w,S);Object.defineProperty(r,S,f.get?f:{enumerable:!0,get:()=>w[S]})}}return r.default=w,Object.freeze(r)}const me=ve(se),ge={class:"work"},he={class:"nav"},fe={style:{height:"100px",width:"100%",display:"inline-block"}},pe={style:{height:"100px",width:"100%",display:"inline-block"}},ye={key:0,class:"controls-container",style:{"margin-top":".5rem"}},we={key:0,style:{padding:"0.5em 1.5em"}},ke={key:1,style:{padding:"0.5em 1.5em"}},Ce={__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"},group:String},setup(w){const{t:r,d:S}=ce.useI18n(),f=w,z=e.ref(!1),n=e.ref([]),R=e.ref(new Date().getMonth()+1),j=e.ref(!1),E=e.ref([]),p=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1)),u=e.ref([]),D=e.ref(0),k=e.ref(9),y=e.ref(8),F=e.ref(!1),J=e.ref(!0),$=e.ref(!1),q=e.ref("5"),B=e.ref(1),C=e.ref(""),O=e.ref([]),V=e.ref([]),I=e.ref([]),v=e.ref({name:"Имя",length:0,code:""}),Y=e.ref(!1),P=e.ref({zIndex:30,minWidth:220,x:500,y:200}),Z=e.ref({}),T=e.ref("100%");e.watch(C,async(a,l)=>{a!==l&&(V.value=[],F.value=!1,f.odata.personal.forEach(o=>{o.divisionName===a&&(V.value.some(d=>(d==null?void 0:d.activeText)===o.roleName)||V.value.push({val:!0,activeText:o.roleName}))}),W())}),e.watch(R,async a=>{let l=new Date().getMonth(),o=a===null?l:a-1;o=l-1<=o?o:o+12,p.value=new Date(new Date().getFullYear(),o,1),K()});const _=(a,l,o,d)=>{v.value.ids=a.ids,v.value.key=a.key,v.value.add=a.days.length>0&&a.days[a.days.length-1].cont,v.value.level=l.level,v.value.day=o.cellIndex,P.value.y=d.clientY,P.value.x=d.clientX,l.level===2&&l.no===0&&f.checkEdit&&(v.value.name=r("workSchedule.autocomplete"),Y.value=!0),l.level===3&&o.cellIndex-l.no===1&&f.checkEdit&&(N(o.cellIndex,a.ids),v.value.name=r("workSchedule.modeSelection"),Y.value=!0)},ee=({row:a,columnIndex:l})=>{if(!E.value||E.value.length===0||!j.value)return"";const o=new Date(new Date(p.value).getFullYear(),new Date(p.value).getMonth(),l).getTime()+1e3;for(let d of E.value){const{dateStart:t,dateEnd:s,code:m}=d;if(t&&s&&m===a.code&&l!==0&&l<=u.value.length){const g=new Date(c.parseDate(t)).getTime(),b=new Date(c.parseDate(s)).getTime();if(o>=g&&o<=b)return"vacation"}}return""},K=()=>{const a=Z.value,l=new Date(p.value),o=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let d=[],t=0;for(let s=1;s<=o;s++){const m=c.parseTime(l.setDate(s),"{Y}-{m}-{dd}");t+=a.nowork.includes(m)||a.holidays.includes(m)?0:a.preholidays.includes(m)?7:8;const g=a.nowork.includes(m)?"nowork":a.holidays.includes(m)?"holiday":a.preholidays.includes(m)?"preholiday":"";d.push({day:s,holidays:g,weekday:S(new Date(l.getFullYear(),l.getMonth(),s),"day")})}D.value=t,u.value=d,f.odata.getPersonal({}).then(s=>{var m;C.value.length===0&&(C.value=(m=s.find(g=>g.employeeName===f.fullName))==null?void 0:m.divisionName),s.forEach((g,b)=>{O.value.some(x=>(x==null?void 0:x.value)===g.divisionName)||O.value.push({value:g.divisionName,label:g.divisionName,key:b}),g.divisionName===C.value&&!V.value.some(x=>(x==null?void 0:x.activeText)===g.roleName)&&V.value.push({val:!0,activeText:g.roleName})}),W(),J.value=!1})},le=e.computed(()=>!n.value.some(a=>a.contHour!==D.value)),Q=(a,l)=>{var s,m,g;const o=new Date(p.value),d=`${o.getFullYear()}-${(o.getMonth()+1).toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}`,t=(s=n.value[l])==null?void 0:s.days.findIndex(b=>b.day===d);return l===-1||t===-1?"":((m=n.value[l].days[t])==null?void 0:m.tips)+`
2
- `+((g=n.value[l].days[t])==null?void 0:g.time)},W=()=>{n.value=[],I.value=[],E.value=[],f.odata.personal.forEach(a=>{if(a.divisionName===C.value&&V.value.some(l=>l.val&&l.activeText===a.roleName)){let l=c.byInitials(a.employeeName);I.value.push(a.employeeKey),n.value.push({name:l+" ("+a.roleName+")",days:[],contHour:0,code:a.employeeKey,id:!1,ids:n.value.length})}}),f.workSchedule.getUsersYear({code:I.value,year:new Date(p.value).getFullYear()}).then(a=>{a.forEach(l=>{l.dateStart&&E.value.push({code:l.code,dateStart:l.dateStart,dateEnd:l.dateEnd})}),console.log(a),te(),$.value=!1})},te=()=>{f.workSchedule.getWorkSchedule({code:I.value,date:c.parseTime(new Date(p.value),"{Y}-{m}-{dd}")}).then(a=>{a.forEach((l,o)=>{l!==null&&(n.value[o].days=l.data.days,n.value[o].id=l.id)}),M()})},M=()=>{n.value.forEach(a=>{a.contHour=a.days.reduce((l,o)=>l+o.time,0)})},ae=a=>{n.value[a].days=[],M()},ne=a=>{switch(q.value){case"5":for(let l=B.value;l<=u.value.length;l++)u.value[l-1].holidays===""&&N(l,a,!0),u.value[l-1].holidays==="preholiday"&&(y.value-=1,N(l,a,!0),y.value+=1);break;case"2x2":for(let l=B.value;l<=u.value.length;l+=4)N(l,a,!0),l+1<=u.value.length&&N(l+1,a,!0);break;case"2x5":for(let l=B.value;l<=u.value.length;l+=7)for(let o=l;o<l+5&&o<=u.value.length;o++)u.value[o-1].holidays==="preholiday"?(y.value-=1,N(o,a,!0),y.value+=1):N(o,a,!0);break}},N=(a,l,o=!1)=>{const{date:d,ind:t}=U(a,l);t===-1?(n.value[l].days.push({day:d,time:y.value,tips:`(${k.value}:00 - ${k.value+y.value+1}:00)`}),M()):o||(y.value=n.value[l].days[t].time,k.value=parseInt(n.value[l].days[t].tips.slice(1,-12)))},oe=(a,l)=>{const{ind:o}=U(a,l);n.value[l].days.splice(o,1),M(),document.querySelector(".app-main").click()},X=(a,l)=>{const{date:o,ind:d}=U(a,l);n.value[l].days[d]={day:o,time:y.value,tips:`(${k.value}:00 - ${k.value+y.value+1}:00)`},M()},U=(a,l)=>{var t;const o=c.parseTime(new Date(p.value).setDate(a),"{Y}-{m}-{dd}"),d=(t=n.value[l])==null?void 0:t.days.findIndex(s=>s.day===o);return{date:o,ind:d}},ue=async()=>{var x;z.value=!0;const a=new me.Workbook,l=a.addWorksheet(S(p.value,"month"),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),o={vertical:"middle",horizontal:"center"},d={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},t={vertical:"middle",horizontal:"center",wrapText:!0};l.mergeCells(`A1:${c.cellsDynamically("A1",u.value.length+5)}1`),l.mergeCells(`A2:${c.cellsDynamically("A2",u.value.length+5)}2`),l.mergeCells("A3:A4"),l.mergeCells(`B3:${c.cellsDynamically("B3",u.value.length)}3`),l.mergeCells(`${c.cellsDynamically("B3",u.value.length+1)}3:${c.cellsDynamically("B3",u.value.length+2)}3`),l.mergeCells(`${c.cellsDynamically("B3",u.value.length+3)}3:${c.cellsDynamically("B4",u.value.length+3)}4`),l.mergeCells(`${c.cellsDynamically("B3",u.value.length+4)}3:${c.cellsDynamically("B4",u.value.length+4)}4`),l.getCell("A1").value=r("workSchedule.firm"),l.getCell("A2").value=r("workSchedule.title",{name:C.value})+S(p.value,"month")+` ${new Date(p.value).getFullYear()}`,l.getCell("A3").value=r("workSchedule.month"),l.getCell("B3").value=r("workSchedule.numbersMonth"),l.getCell(3,u.value.length+2).value=r("workSchedule.onSchedule"),l.getCell(3,u.value.length+4).value=r("workSchedule.acquainted"),l.getCell(3,u.value.length+5).value=r("workSchedule.date"),l.getCell(4,u.value.length+2).value=r("workSchedule.days"),l.getCell(4,u.value.length+3).value=`${r("workSchedule.hours")} (${D.value})`;for(let h=2;h<=u.value.length+1;h++)l.getCell(4,h).value=u.value[h-2].weekday+`
3
- `+(h-1),l.getColumn(h).width=6,l.getColumn(h).alignment=t,l.getCell(4,h).border=d;l.getRow(1).height=40,l.getRow(2).height=30,l.getRow(3).height=20,l.getColumn(1).width=15,l.getColumn(u.value.length+2).width=5,l.getColumn(u.value.length+3).width=6,l.getColumn(u.value.length+4).width=13,l.getColumn(u.value.length+5).width=13,l.getColumn(1).alignment=t,l.getCell("A2").alignment=o,l.getCell("A3").alignment=o,l.getCell("B3").alignment=o,l.getCell(3,u.value.length+2).alignment=o,l.getColumn(u.value.length+2).alignment=t,l.getColumn(u.value.length+3).alignment=t,l.getColumn(u.value.length+4).alignment=o,l.getColumn(u.value.length+5).alignment=o,l.getCell("A3").border=d,l.getCell("B3").border=d,l.getCell(3,u.value.length+2).border=d,l.getCell(4,u.value.length+2).border=d,l.getCell(3,u.value.length+4).border=d,l.getCell(3,u.value.length+5).border=d,l.getCell(4,u.value.length+3).border=d;let s=0;for(const h of n.value){let H=[h.name];for(let A=1;A<=u.value.length;A++){const{ind:L}=U(A,s);L!==-1?H[A]=`${h.days[L].time} ${h.days[L].tips}`:H[A]=" "}H.push(((x=h.days)==null?void 0:x.length)||" ",h.contHour||0);const ie=l.addRow(H);ie.border=d,s++}let m="Щербина Е. В.";f.odata.personal.forEach(h=>{h.roleName==="Начальник отдела правовой и кадровой работы"&&(m=h.employeeName)}),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=r("workSchedule.byInitials"),l.getCell(`Q${n.value.length+6}`).value=r("workSchedule.supervisorHR"),l.getCell(`B${n.value.length+8}`).value=r("workSchedule.compiled")+":",l.getCell(`S${n.value.length+8}`).value=r("workSchedule.approved")+":",l.getCell(`M${n.value.length+8}`).value=c.byInitials(f.fullName),l.getCell(`AD${n.value.length+8}`).value=c.byInitials(m),l.getCell(`Z${n.value.length+9}`).value=r("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 g="export_"+c.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",b=await a.xlsx.writeBuffer();de.saveAs(new Blob([b]),g),z.value=!1},re=async()=>{F.value||f.workSchedule.addWorkSchedule({data:n.value,date:c.parseTime(new Date(p.value),"{Y}-{m}-{dd}"),group:C.value}).then(a=>F.value=a)};return f.group&&(C.value=f.group),c.holidays().then(a=>{Z.value=a,K()}),(a,l)=>{const o=e.resolveComponent("el-date-picker"),d=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("div",he,[w.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElSelect),{key:0,modelValue:C.value,"onUpdate:modelValue":l[0]||(l[0]=t=>C.value=t),placeholder:"Select",style:{width:"240px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElOption),{key:t.key,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),w.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:1,plain:"",onClick:l[1]||(l[1]=t=>$.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.jobTitle")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(o,{modelValue:R.value,"onUpdate:modelValue":l[2]||(l[2]=t=>R.value=t),type:"month",placeholder:"Выберите месяц",format:"MMM","value-format":"M"},null,8,["modelValue"]),l[19]||(l[19]=e.createElementVNode("div",{class:"expander"},null,-1)),e.createVNode(e.unref(i.ElSwitch),{modelValue:T.value,"onUpdate:modelValue":l[3]||(l[3]=t=>T.value=t),"active-text":a.$t("bids.currentHeight"),"active-value":"100%","inactive-value":"calc(100vh - var(--el-component-size)*4 - var(--el-main-padding)*2 - var(--header-height))"},null,8,["modelValue","active-text"]),e.createVNode(e.unref(i.ElSwitch),{modelValue:j.value,"onUpdate:modelValue":l[4]||(l[4]=t=>j.value=t),"active-text":"Отпуска","active-value":!0,"inactive-value":!1},null,8,["modelValue"])]),e.createVNode(e.unref(i.ElSkeleton),{style:{width:"100%"},loading:J.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%"},"max-height":T.value,size:"small",align:"center",onCellClick:_,"empty-text":e.unref(r)("workSchedule.emptyText"),"cell-class-name":ee},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.title",{name:C.value})+e.unref(S)(p.value,"month")+` ${new Date(p.value).getFullYear()}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.month"),width:"180",align:"center",fixed:T.value!=="100%"},{default:e.withCtx(t=>[e.createElementVNode("div",fe,e.toDisplayString(n.value[t.$index].name),1)]),_:1},8,["label","fixed"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.numbersMonth"),align:"center"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElTableColumn),{key:t.day,width:"46","class-name":t.holidays,align:"center",label:t.weekday+`
4
- `+t.day.toString(),prop:"vacation"},{default:e.withCtx(s=>[e.createElementVNode("div",pe,e.toDisplayString(Q(t.day,s.$index)||" "),1)]),_:2},1032,["class-name","label"]))),128))]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.onSchedule"),align:"center",fixed:T.value!=="100%"?"right":!1},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("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(r)("workSchedule.hours")} ( ${D.value} )`,align:"center"},{default:e.withCtx(t=>[e.createElementVNode("div",{style:e.normalizeStyle(`color: ${D.value===t.row.contHour?"green":"red"};`)},e.toDisplayString(t.row.contHour),5)]),_:1},8,["label"])]),_:1},8,["label","fixed"])]),_:1},8,["label"])]),_:1},8,["data","max-height","empty-text"])]),_:1},8,["loading"]),le.value&&w.checkEdit?(e.openBlock(),e.createElementBlock("div",ye,[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.chartsFilled"))+": ",1),F.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:0,type:"primary",onClick:re},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.confirm")),1)]),_:1})),l[20]||(l[20]=e.createTextVNode()),e.createElementVNode("span",null,e.toDisplayString(w.fullName),1)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(i.ElButton),{disabled:z.value,plain:"",onClick:ue,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[d,z.value]]),e.createVNode(e.unref(i.ElDialog),{title:e.unref(r)("workSchedule.jobTitle"),modelValue:$.value,"onUpdate:modelValue":l[6]||(l[6]=t=>$.value=t),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(i.ElButton),{onClick:l[5]||(l[5]=t=>$.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:W},{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":s=>t.val=s,"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(G.ContextMenu),{show:Y.value,"onUpdate:show":l[18]||(l[18]=t=>Y.value=t),options:P.value},{default:e.withCtx(()=>[e.createVNode(e.unref(G.ContextMenuItem),{label:v.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(G.ContextMenuSeparator)),v.value.level===2?(e.openBlock(),e.createElementBlock("div",we,[e.createVNode(e.unref(i.ElRadioGroup),{modelValue:q.value,"onUpdate:modelValue":l[7]||(l[7]=t=>q.value=t),size:"small"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElRadioButton),{label:e.unref(r)("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[21]||(l[21]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.fromDate"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:B.value,"onUpdate:modelValue":l[8]||(l[8]=t=>B.value=t),step:1,min:1,max:u.value.length},null,8,["modelValue","max"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:k.value,"onUpdate:modelValue":l[9]||(l[9]=t=>k.value=t),step:1,min:0,max:20},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:y.value,"onUpdate:modelValue":l[10]||(l[10]=t=>y.value=t),step:1,min:4,max:22-k.value},null,8,["modelValue","max"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[11]||(l[11]=t=>ne(v.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.fillOut")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[12]||(l[12]=t=>ae(v.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.clearRow")),1)]),_:1})])):(e.openBlock(),e.createElementBlock("div",ke,[e.createElementVNode("div",null,e.toDisplayString(Q(v.value.day,v.value.ids)),1),l[22]||(l[22]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:k.value,"onUpdate:modelValue":l[13]||(l[13]=t=>k.value=t),step:1,min:0,max:20,onChange:l[14]||(l[14]=t=>X(v.value.day,v.value.ids))},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:y.value,"onUpdate:modelValue":l[15]||(l[15]=t=>y.value=t),step:1,min:4,max:22-k.value,onChange:l[16]||(l[16]=t=>X(v.value.day,v.value.ids))},null,8,["modelValue","max"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[17]||(l[17]=t=>oe(v.value.day,v.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.delete")),1)]),_:1})]))]),_:1},8,["show","options"])])}}};module.exports=Ce;
1
+ "use strict";const e=require("vue"),de=require("file-saver"),se=require("exceljs"),v=require("./index-DxdyeKnm.cjs"),ve=require("vue-i18n"),i=require("element-plus"),G=require("@imengyu/vue3-context-menu");function ce(k){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(k){for(const S in k)if(S!=="default"){const f=Object.getOwnPropertyDescriptor(k,S);Object.defineProperty(r,S,f.get?f:{enumerable:!0,get:()=>k[S]})}}return r.default=k,Object.freeze(r)}const me=ce(se),ge={class:"work"},he={class:"nav"},fe={style:{height:"100px",width:"100%",display:"inline-block"}},pe={style:{height:"100px",width:"100%",display:"inline-block"}},ye={key:0,class:"controls-container",style:{"margin-top":".5rem"}},we={key:0,style:{padding:"0.5em 1.5em"}},ke={key:1,style:{padding:"0.5em 1.5em"}},Ce={__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"},group:String},setup(k){const{t:r,d:S}=ve.useI18n(),f=k,z=e.ref(!1),n=e.ref([]),R=e.ref(new Date().getMonth()+1),j=e.ref(!1),E=e.ref([]),y=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1)),u=e.ref([]),D=e.ref(0),w=e.ref(9),p=e.ref(8),F=e.ref(!1),J=e.ref(!0),$=e.ref(!1),q=e.ref("5"),B=e.ref(1),C=e.ref(""),O=e.ref([]),V=e.ref([]),I=e.ref([]),c=e.ref({name:"Имя",length:0,code:""}),Y=e.ref(!1),P=e.ref({zIndex:30,minWidth:220,x:500,y:200}),Z=e.ref({}),T=e.ref("100%");e.watch(C,async(a,l)=>{a!==l&&(V.value=[],F.value=!1,f.odata.personal.forEach(o=>{o.divisionName===a&&(V.value.some(d=>(d==null?void 0:d.activeText)===o.roleName)||V.value.push({val:!0,activeText:o.roleName}))}),W())}),e.watch(R,async a=>{let l=new Date().getMonth(),o=a===null?l:a-1;o=l-1<=o?o:o+12,y.value=new Date(new Date().getFullYear(),o,1),K()});const _=(a,l,o,d)=>{c.value.ids=a.ids,c.value.key=a.key,c.value.add=a.days.length>0&&a.days[a.days.length-1].cont,c.value.level=l.level,c.value.day=o.cellIndex,P.value.y=d.clientY,P.value.x=d.clientX,l.level===2&&l.no===0&&f.checkEdit&&(c.value.name=r("workSchedule.autocomplete"),Y.value=!0),l.level===3&&o.cellIndex-l.no===1&&f.checkEdit&&(N(o.cellIndex,a.ids),c.value.name=r("workSchedule.modeSelection"),Y.value=!0)},ee=({row:a,columnIndex:l})=>{if(!E.value||E.value.length===0||!j.value)return"";const o=new Date(new Date(y.value).getFullYear(),new Date(y.value).getMonth(),l).getTime()+1e3;for(let d of E.value){const{dateStart:t,dateEnd:s,code:m}=d;if(t&&s&&m===a.code&&l!==0&&l<=u.value.length){const g=new Date(v.parseDate(t)).getTime(),b=new Date(v.parseDate(s)).getTime();if(o>=g&&o<=b)return"vacation"}}return""},K=()=>{const a=Z.value,l=new Date(y.value),o=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let d=[],t=0;for(let s=1;s<=o;s++){const m=v.parseTime(l.setDate(s),"{Y}-{m}-{dd}");t+=a.nowork.includes(m)||a.holidays.includes(m)?0:a.preholidays.includes(m)?7:8;const g=a.nowork.includes(m)?"nowork":a.holidays.includes(m)?"holiday":a.preholidays.includes(m)?"preholiday":"";d.push({day:s,holidays:g,weekday:S(new Date(l.getFullYear(),l.getMonth(),s),"day")})}D.value=t,u.value=d,f.odata.getPersonal({}).then(s=>{var m;C.value.length===0&&(C.value=(m=s.find(g=>g.employeeName===f.fullName))==null?void 0:m.divisionName),s.forEach((g,b)=>{O.value.some(x=>(x==null?void 0:x.value)===g.divisionName)||O.value.push({value:g.divisionName,label:g.divisionName,key:b}),g.divisionName===C.value&&!V.value.some(x=>(x==null?void 0:x.activeText)===g.roleName)&&V.value.push({val:!0,activeText:g.roleName})}),W(),J.value=!1})},le=e.computed(()=>!n.value.some(a=>a.contHour!==D.value)),Q=(a,l)=>{var s,m,g;const o=new Date(y.value),d=`${o.getFullYear()}-${(o.getMonth()+1).toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}`,t=(s=n.value[l])==null?void 0:s.days.findIndex(b=>b.day===d);return l===-1||t===-1?"":((m=n.value[l].days[t])==null?void 0:m.tips)+`
2
+ `+((g=n.value[l].days[t])==null?void 0:g.time)},W=()=>{n.value=[],I.value=[],E.value=[],f.odata.personal.forEach(a=>{if(a.divisionName===C.value&&V.value.some(l=>l.val&&l.activeText===a.roleName)){let l=v.byInitials(a.employeeName);I.value.push(a.employeeKey),n.value.push({name:l+" ("+a.roleName+")",days:[],contHour:0,code:a.employeeKey,id:!1,ids:n.value.length})}}),f.workSchedule.getUsersYear({code:I.value,year:new Date(y.value).getFullYear()}).then(a=>{a.forEach(l=>{l.dateStart&&E.value.push({code:l.code,dateStart:l.dateStart,dateEnd:l.dateEnd})}),console.log(a),te(),$.value=!1})},te=()=>{f.workSchedule.getWorkSchedule({code:I.value,date:v.parseTime(new Date(y.value),"{Y}-{m}-{dd}")}).then(a=>{a.forEach((l,o)=>{l!==null&&(n.value[o].days=l.data.days,n.value[o].id=l.id)}),M()})},M=()=>{n.value.forEach(a=>{a.contHour=a.days.reduce((l,o)=>l+o.time,0)})},ae=a=>{n.value[a].days=[],M()},ne=a=>{switch(q.value){case"5":for(let l=B.value;l<=u.value.length;l++)u.value[l-1].holidays===""&&N(l,a,!0),u.value[l-1].holidays==="preholiday"&&(p.value-=1,N(l,a,!0),p.value+=1);break;case"2x2":for(let l=B.value;l<=u.value.length;l+=4)N(l,a,!0),l+1<=u.value.length&&N(l+1,a,!0);break;case"2x5":for(let l=B.value;l<=u.value.length;l+=7)for(let o=l;o<l+5&&o<=u.value.length;o++)u.value[o-1].holidays==="preholiday"?(p.value-=1,N(o,a,!0),p.value+=1):N(o,a,!0);break}},N=(a,l,o=!1)=>{const{date:d,ind:t}=U(a,l);t===-1?(n.value[l].days.push({day:d,time:p.value,tips:`(${w.value}:00 - ${w.value+p.value===22?24:w.value+p.value+1}:00)`}),M()):o||(p.value=n.value[l].days[t].time,w.value=parseInt(n.value[l].days[t].tips.slice(1,-12)))},oe=(a,l)=>{const{ind:o}=U(a,l);n.value[l].days.splice(o,1),M(),document.querySelector(".app-main").click()},X=(a,l)=>{const{date:o,ind:d}=U(a,l);n.value[l].days[d]={day:o,time:p.value,tips:`(${w.value}:00 - ${w.value+p.value===22?24:w.value+p.value+1}:00)`},M()},U=(a,l)=>{var t;const o=v.parseTime(new Date(y.value).setDate(a),"{Y}-{m}-{dd}"),d=(t=n.value[l])==null?void 0:t.days.findIndex(s=>s.day===o);return{date:o,ind:d}},ue=async()=>{var x;z.value=!0;const a=new me.Workbook,l=a.addWorksheet(S(y.value,"month"),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),o={vertical:"middle",horizontal:"center"},d={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},t={vertical:"middle",horizontal:"center",wrapText:!0};l.mergeCells(`A1:${v.cellsDynamically("A1",u.value.length+5)}1`),l.mergeCells(`A2:${v.cellsDynamically("A2",u.value.length+5)}2`),l.mergeCells("A3:A4"),l.mergeCells(`B3:${v.cellsDynamically("B3",u.value.length)}3`),l.mergeCells(`${v.cellsDynamically("B3",u.value.length+1)}3:${v.cellsDynamically("B3",u.value.length+2)}3`),l.mergeCells(`${v.cellsDynamically("B3",u.value.length+3)}3:${v.cellsDynamically("B4",u.value.length+3)}4`),l.mergeCells(`${v.cellsDynamically("B3",u.value.length+4)}3:${v.cellsDynamically("B4",u.value.length+4)}4`),l.getCell("A1").value=r("workSchedule.firm"),l.getCell("A2").value=r("workSchedule.title",{name:C.value})+S(y.value,"month")+` ${new Date(y.value).getFullYear()}`,l.getCell("A3").value=r("workSchedule.month"),l.getCell("B3").value=r("workSchedule.numbersMonth"),l.getCell(3,u.value.length+2).value=r("workSchedule.onSchedule"),l.getCell(3,u.value.length+4).value=r("workSchedule.acquainted"),l.getCell(3,u.value.length+5).value=r("workSchedule.date"),l.getCell(4,u.value.length+2).value=r("workSchedule.days"),l.getCell(4,u.value.length+3).value=`${r("workSchedule.hours")} (${D.value})`;for(let h=2;h<=u.value.length+1;h++)l.getCell(4,h).value=u.value[h-2].weekday+`
3
+ `+(h-1),l.getColumn(h).width=6,l.getColumn(h).alignment=t,l.getCell(4,h).border=d;l.getRow(1).height=40,l.getRow(2).height=30,l.getRow(3).height=20,l.getColumn(1).width=15,l.getColumn(u.value.length+2).width=5,l.getColumn(u.value.length+3).width=6,l.getColumn(u.value.length+4).width=13,l.getColumn(u.value.length+5).width=13,l.getColumn(1).alignment=t,l.getCell("A2").alignment=o,l.getCell("A3").alignment=o,l.getCell("B3").alignment=o,l.getCell(3,u.value.length+2).alignment=o,l.getColumn(u.value.length+2).alignment=t,l.getColumn(u.value.length+3).alignment=t,l.getColumn(u.value.length+4).alignment=o,l.getColumn(u.value.length+5).alignment=o,l.getCell("A3").border=d,l.getCell("B3").border=d,l.getCell(3,u.value.length+2).border=d,l.getCell(4,u.value.length+2).border=d,l.getCell(3,u.value.length+4).border=d,l.getCell(3,u.value.length+5).border=d,l.getCell(4,u.value.length+3).border=d;let s=0;for(const h of n.value){let H=[h.name];for(let A=1;A<=u.value.length;A++){const{ind:L}=U(A,s);L!==-1?H[A]=`${h.days[L].time} ${h.days[L].tips}`:H[A]=" "}H.push(((x=h.days)==null?void 0:x.length)||" ",h.contHour||0);const ie=l.addRow(H);ie.border=d,s++}let m="Щербина Е. В.";f.odata.personal.forEach(h=>{h.roleName==="Начальник отдела правовой и кадровой работы"&&(m=h.employeeName)}),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=r("workSchedule.byInitials"),l.getCell(`Q${n.value.length+6}`).value=r("workSchedule.supervisorHR"),l.getCell(`B${n.value.length+8}`).value=r("workSchedule.compiled")+":",l.getCell(`S${n.value.length+8}`).value=r("workSchedule.approved")+":",l.getCell(`M${n.value.length+8}`).value=v.byInitials(f.fullName),l.getCell(`AD${n.value.length+8}`).value=v.byInitials(m),l.getCell(`Z${n.value.length+9}`).value=r("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 g="export_"+v.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",b=await a.xlsx.writeBuffer();de.saveAs(new Blob([b]),g),z.value=!1},re=async()=>{F.value||f.workSchedule.addWorkSchedule({data:n.value,date:v.parseTime(new Date(y.value),"{Y}-{m}-{dd}"),group:C.value}).then(a=>F.value=a)};return f.group&&(C.value=f.group),v.holidays().then(a=>{Z.value=a,K()}),(a,l)=>{const o=e.resolveComponent("el-date-picker"),d=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("div",he,[k.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElSelect),{key:0,modelValue:C.value,"onUpdate:modelValue":l[0]||(l[0]=t=>C.value=t),placeholder:"Select",style:{width:"240px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElOption),{key:t.key,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),k.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:1,plain:"",onClick:l[1]||(l[1]=t=>$.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.jobTitle")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(o,{modelValue:R.value,"onUpdate:modelValue":l[2]||(l[2]=t=>R.value=t),type:"month",placeholder:"Выберите месяц",format:"MMM","value-format":"M"},null,8,["modelValue"]),l[19]||(l[19]=e.createElementVNode("div",{class:"expander"},null,-1)),e.createVNode(e.unref(i.ElSwitch),{modelValue:T.value,"onUpdate:modelValue":l[3]||(l[3]=t=>T.value=t),"active-text":a.$t("bids.currentHeight"),"active-value":"100%","inactive-value":"calc(100vh - var(--el-component-size)*4 - var(--el-main-padding)*2 - var(--header-height))"},null,8,["modelValue","active-text"]),e.createVNode(e.unref(i.ElSwitch),{modelValue:j.value,"onUpdate:modelValue":l[4]||(l[4]=t=>j.value=t),"active-text":"Отпуска","active-value":!0,"inactive-value":!1},null,8,["modelValue"])]),e.createVNode(e.unref(i.ElSkeleton),{style:{width:"100%"},loading:J.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%"},"max-height":T.value,size:"small",align:"center",onCellClick:_,"empty-text":e.unref(r)("workSchedule.emptyText"),"cell-class-name":ee},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.title",{name:C.value})+e.unref(S)(y.value,"month")+` ${new Date(y.value).getFullYear()}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.month"),width:"180",align:"center",fixed:T.value!=="100%"},{default:e.withCtx(t=>[e.createElementVNode("div",fe,e.toDisplayString(n.value[t.$index].name),1)]),_:1},8,["label","fixed"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.numbersMonth"),align:"center"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElTableColumn),{key:t.day,width:"46","class-name":t.holidays,align:"center",label:t.weekday+`
4
+ `+t.day.toString(),prop:"vacation"},{default:e.withCtx(s=>[e.createElementVNode("div",pe,e.toDisplayString(Q(t.day,s.$index)||" "),1)]),_:2},1032,["class-name","label"]))),128))]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.onSchedule"),align:"center",fixed:T.value!=="100%"?"right":!1},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("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(r)("workSchedule.hours")} ( ${D.value} )`,align:"center"},{default:e.withCtx(t=>[e.createElementVNode("div",{style:e.normalizeStyle(`color: ${D.value===t.row.contHour?"green":"red"};`)},e.toDisplayString(t.row.contHour),5)]),_:1},8,["label"])]),_:1},8,["label","fixed"])]),_:1},8,["label"])]),_:1},8,["data","max-height","empty-text"])]),_:1},8,["loading"]),le.value&&k.checkEdit?(e.openBlock(),e.createElementBlock("div",ye,[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.chartsFilled"))+": ",1),F.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:0,type:"primary",onClick:re},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.confirm")),1)]),_:1})),l[20]||(l[20]=e.createTextVNode()),e.createElementVNode("span",null,e.toDisplayString(k.fullName),1)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(i.ElButton),{disabled:z.value,plain:"",onClick:ue,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[d,z.value]]),e.createVNode(e.unref(i.ElDialog),{title:e.unref(r)("workSchedule.jobTitle"),modelValue:$.value,"onUpdate:modelValue":l[6]||(l[6]=t=>$.value=t),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(i.ElButton),{onClick:l[5]||(l[5]=t=>$.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:W},{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":s=>t.val=s,"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(G.ContextMenu),{show:Y.value,"onUpdate:show":l[18]||(l[18]=t=>Y.value=t),options:P.value},{default:e.withCtx(()=>[e.createVNode(e.unref(G.ContextMenuItem),{label:c.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(G.ContextMenuSeparator)),c.value.level===2?(e.openBlock(),e.createElementBlock("div",we,[e.createVNode(e.unref(i.ElRadioGroup),{modelValue:q.value,"onUpdate:modelValue":l[7]||(l[7]=t=>q.value=t),size:"small"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElRadioButton),{label:e.unref(r)("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[21]||(l[21]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.fromDate"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:B.value,"onUpdate:modelValue":l[8]||(l[8]=t=>B.value=t),step:1,min:1,max:u.value.length},null,8,["modelValue","max"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:w.value,"onUpdate:modelValue":l[9]||(l[9]=t=>w.value=t),step:1,min:0,max:20},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:p.value,"onUpdate:modelValue":l[10]||(l[10]=t=>p.value=t),step:1,min:4,max:22-w.value},null,8,["modelValue","max"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[11]||(l[11]=t=>ne(c.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.fillOut")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[12]||(l[12]=t=>ae(c.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.clearRow")),1)]),_:1})])):(e.openBlock(),e.createElementBlock("div",ke,[e.createElementVNode("div",null,e.toDisplayString(Q(c.value.day,c.value.ids)),1),l[22]||(l[22]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:w.value,"onUpdate:modelValue":l[13]||(l[13]=t=>w.value=t),step:1,min:0,max:20,onChange:l[14]||(l[14]=t=>X(c.value.day,c.value.ids))},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:p.value,"onUpdate:modelValue":l[15]||(l[15]=t=>p.value=t),step:1,min:4,max:22-w.value,onChange:l[16]||(l[16]=t=>X(c.value.day,c.value.ids))},null,8,["modelValue","max"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[17]||(l[17]=t=>oe(c.value.day,c.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.delete")),1)]),_:1})]))]),_:1},8,["show","options"])])}}};module.exports=Ce;
package/dist/WorkTable.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ref as s, watch as ye, computed as Ne, resolveComponent as Ae, resolveDirective as Me, createElementBlock as B, openBlock as w, createElementVNode as k, createVNode as i, createCommentVNode as _, withDirectives as Be, createBlock as T, unref as a, withCtx as v, Fragment as de, renderList as ie, createTextVNode as b, toDisplayString as m, normalizeStyle as Te } from "vue";
1
+ import { ref as s, watch as ye, computed as Ne, resolveComponent as Ae, resolveDirective as Me, createElementBlock as B, openBlock as k, createElementVNode as C, createVNode as i, createCommentVNode as _, withDirectives as Be, createBlock as T, unref as a, withCtx as v, Fragment as de, renderList as ie, createTextVNode as b, toDisplayString as m, normalizeStyle as Te } from "vue";
2
2
  import { saveAs as ze } from "file-saver";
3
3
  import * as Fe from "exceljs";
4
4
  import { p as j, b as re, h as Ye, a as fe, c as D } from "./index-D4ZMBdCa.js";
@@ -25,7 +25,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
25
25
  group: String
26
26
  },
27
27
  setup(F) {
28
- const { t: d, d: L } = Ue(), C = F, Z = s(!1), n = s([
28
+ const { t: d, d: L } = Ue(), x = F, Z = s(!1), n = s([
29
29
  // { name: 'Иванов П.М. (Ведущий работник месяца)',
30
30
  // days: [], // {day: "2024-11-01", tips: '(9:00 - 18:00)', time: 8 }
31
31
  // contHour: 0,
@@ -38,25 +38,25 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
38
38
  // code: '0000-00052'
39
39
  // ids: 1
40
40
  // }
41
- ]), ee = s((/* @__PURE__ */ new Date()).getMonth() + 1), le = s(!1), Y = s([]), f = s(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1)), u = s([]), U = s(0), S = s(9), x = s(8), q = s(!1), ge = s(!0), I = s(!1), te = s("5"), H = s(1), $ = s(""), ae = s([]), E = s([]), J = s([]), h = s({ name: "Имя", length: 0, code: "" }), K = s(!1), ne = s({
41
+ ]), ee = s((/* @__PURE__ */ new Date()).getMonth() + 1), le = s(!1), Y = s([]), w = s(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1)), u = s([]), U = s(0), S = s(9), f = s(8), q = s(!1), ge = s(!0), I = s(!1), te = s("5"), H = s(1), $ = s(""), ae = s([]), E = s([]), J = s([]), h = s({ name: "Имя", length: 0, code: "" }), K = s(!1), ne = s({
42
42
  zIndex: 30,
43
43
  minWidth: 220,
44
44
  x: 500,
45
45
  y: 200
46
46
  }), me = s({}), R = s("100%");
47
47
  ye($, async (t, e) => {
48
- t !== e && (E.value = [], q.value = !1, C.odata.personal.forEach((o) => {
48
+ t !== e && (E.value = [], q.value = !1, x.odata.personal.forEach((o) => {
49
49
  o.divisionName === t && (E.value.some((r) => (r == null ? void 0 : r.activeText) === o.roleName) || E.value.push({ val: !0, activeText: o.roleName }));
50
50
  }), oe());
51
51
  }), ye(ee, async (t) => {
52
52
  let e = (/* @__PURE__ */ new Date()).getMonth(), o = t === null ? e : t - 1;
53
- o = e - 1 <= o ? o : o + 12, f.value = new Date((/* @__PURE__ */ new Date()).getFullYear(), o, 1), he();
53
+ o = e - 1 <= o ? o : o + 12, w.value = new Date((/* @__PURE__ */ new Date()).getFullYear(), o, 1), he();
54
54
  });
55
55
  const we = (t, e, o, r) => {
56
- h.value.ids = t.ids, h.value.key = t.key, h.value.add = t.days.length > 0 && t.days[t.days.length - 1].cont, h.value.level = e.level, h.value.day = o.cellIndex, ne.value.y = r.clientY, ne.value.x = r.clientX, e.level === 2 && e.no === 0 && C.checkEdit && (h.value.name = d("workSchedule.autocomplete"), K.value = !0), e.level === 3 && o.cellIndex - e.no === 1 && C.checkEdit && (A(o.cellIndex, t.ids), h.value.name = d("workSchedule.modeSelection"), K.value = !0);
56
+ h.value.ids = t.ids, h.value.key = t.key, h.value.add = t.days.length > 0 && t.days[t.days.length - 1].cont, h.value.level = e.level, h.value.day = o.cellIndex, ne.value.y = r.clientY, ne.value.x = r.clientX, e.level === 2 && e.no === 0 && x.checkEdit && (h.value.name = d("workSchedule.autocomplete"), K.value = !0), e.level === 3 && o.cellIndex - e.no === 1 && x.checkEdit && (A(o.cellIndex, t.ids), h.value.name = d("workSchedule.modeSelection"), K.value = !0);
57
57
  }, ke = ({ row: t, columnIndex: e }) => {
58
58
  if (!Y.value || Y.value.length === 0 || !le.value) return "";
59
- const o = new Date(new Date(f.value).getFullYear(), new Date(f.value).getMonth(), e).getTime() + 1e3;
59
+ const o = new Date(new Date(w.value).getFullYear(), new Date(w.value).getMonth(), e).getTime() + 1e3;
60
60
  for (let r of Y.value) {
61
61
  const { dateStart: l, dateEnd: g, code: c } = r;
62
62
  if (l && g && c === t.code && e !== 0 && e <= u.value.length) {
@@ -66,7 +66,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
66
66
  }
67
67
  return "";
68
68
  }, he = () => {
69
- const t = me.value, e = new Date(f.value), o = new Date(e.getFullYear(), e.getMonth() + 1, 0).getDate();
69
+ const t = me.value, e = new Date(w.value), o = new Date(e.getFullYear(), e.getMonth() + 1, 0).getDate();
70
70
  let r = [], l = 0;
71
71
  for (let g = 1; g <= o; g++) {
72
72
  const c = j(e.setDate(g), "{Y}-{m}-{dd}");
@@ -74,30 +74,30 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
74
74
  const p = t.nowork.includes(c) ? "nowork" : t.holidays.includes(c) ? "holiday" : t.preholidays.includes(c) ? "preholiday" : "";
75
75
  r.push({ day: g, holidays: p, weekday: L(new Date(e.getFullYear(), e.getMonth(), g), "day") });
76
76
  }
77
- U.value = l, u.value = r, C.odata.getPersonal({}).then((g) => {
77
+ U.value = l, u.value = r, x.odata.getPersonal({}).then((g) => {
78
78
  var c;
79
- $.value.length === 0 && ($.value = (c = g.find((p) => p.employeeName === C.fullName)) == null ? void 0 : c.divisionName), g.forEach((p, M) => {
79
+ $.value.length === 0 && ($.value = (c = g.find((p) => p.employeeName === x.fullName)) == null ? void 0 : c.divisionName), g.forEach((p, M) => {
80
80
  ae.value.some((V) => (V == null ? void 0 : V.value) === p.divisionName) || ae.value.push({ value: p.divisionName, label: p.divisionName, key: M }), p.divisionName === $.value && !E.value.some((V) => (V == null ? void 0 : V.activeText) === p.roleName) && E.value.push({ val: !0, activeText: p.roleName });
81
81
  }), oe(), ge.value = !1;
82
82
  });
83
83
  }, Ce = Ne(() => !n.value.some((t) => t.contHour !== U.value)), ce = (t, e) => {
84
84
  var g, c, p;
85
- const o = new Date(f.value), r = `${o.getFullYear()}-${(o.getMonth() + 1).toString().padStart(2, "0")}-${t.toString().padStart(2, "0")}`, l = (g = n.value[e]) == null ? void 0 : g.days.findIndex((M) => M.day === r);
85
+ const o = new Date(w.value), r = `${o.getFullYear()}-${(o.getMonth() + 1).toString().padStart(2, "0")}-${t.toString().padStart(2, "0")}`, l = (g = n.value[e]) == null ? void 0 : g.days.findIndex((M) => M.day === r);
86
86
  return e === -1 || l === -1 ? "" : ((c = n.value[e].days[l]) == null ? void 0 : c.tips) + `
87
87
  ` + ((p = n.value[e].days[l]) == null ? void 0 : p.time);
88
88
  }, oe = () => {
89
- n.value = [], J.value = [], Y.value = [], C.odata.personal.forEach((t) => {
89
+ n.value = [], J.value = [], Y.value = [], x.odata.personal.forEach((t) => {
90
90
  if (t.divisionName === $.value && E.value.some((e) => e.val && e.activeText === t.roleName)) {
91
91
  let e = re(t.employeeName);
92
92
  J.value.push(t.employeeKey), n.value.push({ name: e + " (" + t.roleName + ")", days: [], contHour: 0, code: t.employeeKey, id: !1, ids: n.value.length });
93
93
  }
94
- }), C.workSchedule.getUsersYear({ code: J.value, year: new Date(f.value).getFullYear() }).then((t) => {
94
+ }), x.workSchedule.getUsersYear({ code: J.value, year: new Date(w.value).getFullYear() }).then((t) => {
95
95
  t.forEach((e) => {
96
96
  e.dateStart && Y.value.push({ code: e.code, dateStart: e.dateStart, dateEnd: e.dateEnd });
97
97
  }), console.log(t), xe(), I.value = !1;
98
98
  });
99
99
  }, xe = () => {
100
- C.workSchedule.getWorkSchedule({ code: J.value, date: j(new Date(f.value), "{Y}-{m}-{dd}") }).then(
100
+ x.workSchedule.getWorkSchedule({ code: J.value, date: j(new Date(w.value), "{Y}-{m}-{dd}") }).then(
101
101
  (t) => {
102
102
  t.forEach((e, o) => {
103
103
  e !== null && (n.value[o].days = e.data.days, n.value[o].id = e.id);
@@ -114,7 +114,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
114
114
  switch (te.value) {
115
115
  case "5":
116
116
  for (let e = H.value; e <= u.value.length; e++)
117
- u.value[e - 1].holidays === "" && A(e, t, !0), u.value[e - 1].holidays === "preholiday" && (x.value -= 1, A(e, t, !0), x.value += 1);
117
+ u.value[e - 1].holidays === "" && A(e, t, !0), u.value[e - 1].holidays === "preholiday" && (f.value -= 1, A(e, t, !0), f.value += 1);
118
118
  break;
119
119
  case "2x2":
120
120
  for (let e = H.value; e <= u.value.length; e += 4)
@@ -123,16 +123,16 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
123
123
  case "2x5":
124
124
  for (let e = H.value; e <= u.value.length; e += 7)
125
125
  for (let o = e; o < e + 5 && o <= u.value.length; o++)
126
- u.value[o - 1].holidays === "preholiday" ? (x.value -= 1, A(o, t, !0), x.value += 1) : A(o, t, !0);
126
+ u.value[o - 1].holidays === "preholiday" ? (f.value -= 1, A(o, t, !0), f.value += 1) : A(o, t, !0);
127
127
  break;
128
128
  }
129
129
  }, A = (t, e, o = !1) => {
130
130
  const { date: r, ind: l } = Q(t, e);
131
131
  l === -1 ? (n.value[e].days.push({
132
132
  day: r,
133
- time: x.value,
134
- tips: `(${S.value}:00 - ${S.value + x.value + 1}:00)`
135
- }), W()) : o || (x.value = n.value[e].days[l].time, S.value = parseInt(n.value[e].days[l].tips.slice(1, -12)));
133
+ time: f.value,
134
+ tips: `(${S.value}:00 - ${S.value + f.value === 22 ? 24 : S.value + f.value + 1}:00)`
135
+ }), W()) : o || (f.value = n.value[e].days[l].time, S.value = parseInt(n.value[e].days[l].tips.slice(1, -12)));
136
136
  }, be = (t, e) => {
137
137
  const { ind: o } = Q(t, e);
138
138
  n.value[e].days.splice(o, 1), W(), document.querySelector(".app-main").click();
@@ -140,18 +140,18 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
140
140
  const { date: o, ind: r } = Q(t, e);
141
141
  n.value[e].days[r] = {
142
142
  day: o,
143
- time: x.value,
144
- tips: `(${S.value}:00 - ${S.value + x.value + 1}:00)`
143
+ time: f.value,
144
+ tips: `(${S.value}:00 - ${S.value + f.value === 22 ? 24 : S.value + f.value + 1}:00)`
145
145
  }, W();
146
146
  }, Q = (t, e) => {
147
147
  var l;
148
- const o = j(new Date(f.value).setDate(t), "{Y}-{m}-{dd}"), r = (l = n.value[e]) == null ? void 0 : l.days.findIndex((g) => g.day === o);
148
+ const o = j(new Date(w.value).setDate(t), "{Y}-{m}-{dd}"), r = (l = n.value[e]) == null ? void 0 : l.days.findIndex((g) => g.day === o);
149
149
  return { date: o, ind: r };
150
150
  }, Ve = async () => {
151
151
  var V;
152
152
  Z.value = !0;
153
- const t = new Fe.Workbook(), e = t.addWorksheet(L(f.value, "month"), { pageSetup: { paperSize: 9, orientation: "landscape", fitToPage: !0 } }), o = { vertical: "middle", horizontal: "center" }, r = { top: { style: "thin" }, left: { style: "thin" }, bottom: { style: "thin" }, right: { style: "thin" } }, l = { vertical: "middle", horizontal: "center", wrapText: !0 };
154
- e.mergeCells(`A1:${D("A1", u.value.length + 5)}1`), e.mergeCells(`A2:${D("A2", u.value.length + 5)}2`), e.mergeCells("A3:A4"), e.mergeCells(`B3:${D("B3", u.value.length)}3`), e.mergeCells(`${D("B3", u.value.length + 1)}3:${D("B3", u.value.length + 2)}3`), e.mergeCells(`${D("B3", u.value.length + 3)}3:${D("B4", u.value.length + 3)}4`), e.mergeCells(`${D("B3", u.value.length + 4)}3:${D("B4", u.value.length + 4)}4`), e.getCell("A1").value = d("workSchedule.firm"), e.getCell("A2").value = d("workSchedule.title", { name: $.value }) + L(f.value, "month") + ` ${new Date(f.value).getFullYear()}`, e.getCell("A3").value = d("workSchedule.month"), e.getCell("B3").value = d("workSchedule.numbersMonth"), e.getCell(3, u.value.length + 2).value = d("workSchedule.onSchedule"), e.getCell(3, u.value.length + 4).value = d("workSchedule.acquainted"), e.getCell(3, u.value.length + 5).value = d("workSchedule.date"), e.getCell(4, u.value.length + 2).value = d("workSchedule.days"), e.getCell(4, u.value.length + 3).value = `${d("workSchedule.hours")} (${U.value})`;
153
+ const t = new Fe.Workbook(), e = t.addWorksheet(L(w.value, "month"), { pageSetup: { paperSize: 9, orientation: "landscape", fitToPage: !0 } }), o = { vertical: "middle", horizontal: "center" }, r = { top: { style: "thin" }, left: { style: "thin" }, bottom: { style: "thin" }, right: { style: "thin" } }, l = { vertical: "middle", horizontal: "center", wrapText: !0 };
154
+ e.mergeCells(`A1:${D("A1", u.value.length + 5)}1`), e.mergeCells(`A2:${D("A2", u.value.length + 5)}2`), e.mergeCells("A3:A4"), e.mergeCells(`B3:${D("B3", u.value.length)}3`), e.mergeCells(`${D("B3", u.value.length + 1)}3:${D("B3", u.value.length + 2)}3`), e.mergeCells(`${D("B3", u.value.length + 3)}3:${D("B4", u.value.length + 3)}4`), e.mergeCells(`${D("B3", u.value.length + 4)}3:${D("B4", u.value.length + 4)}4`), e.getCell("A1").value = d("workSchedule.firm"), e.getCell("A2").value = d("workSchedule.title", { name: $.value }) + L(w.value, "month") + ` ${new Date(w.value).getFullYear()}`, e.getCell("A3").value = d("workSchedule.month"), e.getCell("B3").value = d("workSchedule.numbersMonth"), e.getCell(3, u.value.length + 2).value = d("workSchedule.onSchedule"), e.getCell(3, u.value.length + 4).value = d("workSchedule.acquainted"), e.getCell(3, u.value.length + 5).value = d("workSchedule.date"), e.getCell(4, u.value.length + 2).value = d("workSchedule.days"), e.getCell(4, u.value.length + 3).value = `${d("workSchedule.hours")} (${U.value})`;
155
155
  for (let y = 2; y <= u.value.length + 1; y++)
156
156
  e.getCell(4, y).value = u.value[y - 2].weekday + `
157
157
  ` + (y - 1), e.getColumn(y).width = 6, e.getColumn(y).alignment = l, e.getCell(4, y).border = r;
@@ -168,21 +168,21 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
168
168
  Ee.border = r, g++;
169
169
  }
170
170
  let c = "Щербина Е. В.";
171
- C.odata.personal.forEach((y) => {
171
+ x.odata.personal.forEach((y) => {
172
172
  y.roleName === "Начальник отдела правовой и кадровой работы" && (c = y.employeeName);
173
- }), e.mergeCells(`A${n.value.length + 6}:P${n.value.length + 6}`), e.mergeCells(`Q${n.value.length + 6}:AG${n.value.length + 6}`), e.mergeCells(`B${n.value.length + 8}:E${n.value.length + 8}`), e.mergeCells(`F${n.value.length + 8}:L${n.value.length + 8}`), e.mergeCells(`M${n.value.length + 8}:P${n.value.length + 8}`), e.mergeCells(`S${n.value.length + 8}:V${n.value.length + 8}`), e.mergeCells(`W${n.value.length + 8}:AC${n.value.length + 8}`), e.mergeCells(`AD${n.value.length + 8}:AG${n.value.length + 8}`), e.mergeCells(`Z${n.value.length + 9}:AA${n.value.length + 9}`), e.getCell(`A${n.value.length + 6}`).value = d("workSchedule.byInitials"), e.getCell(`Q${n.value.length + 6}`).value = d("workSchedule.supervisorHR"), e.getCell(`B${n.value.length + 8}`).value = d("workSchedule.compiled") + ":", e.getCell(`S${n.value.length + 8}`).value = d("workSchedule.approved") + ":", e.getCell(`M${n.value.length + 8}`).value = re(C.fullName), e.getCell(`AD${n.value.length + 8}`).value = re(c), e.getCell(`Z${n.value.length + 9}`).value = d("workSchedule.printPlace"), e.getCell(`A${n.value.length + 6}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`Q${n.value.length + 6}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`B${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`F${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`M${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "left" }, e.getCell(`AD${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "left" }, e.getCell(`Z${n.value.length + 9}`).alignment = o, e.getCell(`F${n.value.length + 8}`).border = { bottom: { style: "thin" } }, e.getCell(`W${n.value.length + 8}`).border = { bottom: { style: "thin" } };
173
+ }), e.mergeCells(`A${n.value.length + 6}:P${n.value.length + 6}`), e.mergeCells(`Q${n.value.length + 6}:AG${n.value.length + 6}`), e.mergeCells(`B${n.value.length + 8}:E${n.value.length + 8}`), e.mergeCells(`F${n.value.length + 8}:L${n.value.length + 8}`), e.mergeCells(`M${n.value.length + 8}:P${n.value.length + 8}`), e.mergeCells(`S${n.value.length + 8}:V${n.value.length + 8}`), e.mergeCells(`W${n.value.length + 8}:AC${n.value.length + 8}`), e.mergeCells(`AD${n.value.length + 8}:AG${n.value.length + 8}`), e.mergeCells(`Z${n.value.length + 9}:AA${n.value.length + 9}`), e.getCell(`A${n.value.length + 6}`).value = d("workSchedule.byInitials"), e.getCell(`Q${n.value.length + 6}`).value = d("workSchedule.supervisorHR"), e.getCell(`B${n.value.length + 8}`).value = d("workSchedule.compiled") + ":", e.getCell(`S${n.value.length + 8}`).value = d("workSchedule.approved") + ":", e.getCell(`M${n.value.length + 8}`).value = re(x.fullName), e.getCell(`AD${n.value.length + 8}`).value = re(c), e.getCell(`Z${n.value.length + 9}`).value = d("workSchedule.printPlace"), e.getCell(`A${n.value.length + 6}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`Q${n.value.length + 6}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`B${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`F${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`M${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "left" }, e.getCell(`AD${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "left" }, e.getCell(`Z${n.value.length + 9}`).alignment = o, e.getCell(`F${n.value.length + 8}`).border = { bottom: { style: "thin" } }, e.getCell(`W${n.value.length + 8}`).border = { bottom: { style: "thin" } };
174
174
  const p = "export_" + j(Date.now(), "{dd}.{m}.{Y}") + ".xlsx", M = await t.xlsx.writeBuffer();
175
175
  ze(new Blob([M]), p), Z.value = !1;
176
176
  }, De = async () => {
177
- q.value || C.workSchedule.addWorkSchedule({ data: n.value, date: j(new Date(f.value), "{Y}-{m}-{dd}"), group: $.value }).then((t) => q.value = t);
177
+ q.value || x.workSchedule.addWorkSchedule({ data: n.value, date: j(new Date(w.value), "{Y}-{m}-{dd}"), group: $.value }).then((t) => q.value = t);
178
178
  };
179
- return C.group && ($.value = C.group), Ye().then((t) => {
179
+ return x.group && ($.value = x.group), Ye().then((t) => {
180
180
  me.value = t, he();
181
181
  }), (t, e) => {
182
182
  const o = Ae("el-date-picker"), r = Me("loading");
183
- return w(), B("div", Je, [
184
- k("div", Ke, [
185
- F.checkEdit ? (w(), T(a(Ie), {
183
+ return k(), B("div", Je, [
184
+ C("div", Ke, [
185
+ F.checkEdit ? (k(), T(a(Ie), {
186
186
  key: 0,
187
187
  modelValue: $.value,
188
188
  "onUpdate:modelValue": e[0] || (e[0] = (l) => $.value = l),
@@ -190,7 +190,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
190
190
  style: { width: "240px" }
191
191
  }, {
192
192
  default: v(() => [
193
- (w(!0), B(de, null, ie(ae.value, (l) => (w(), T(a(He), {
193
+ (k(!0), B(de, null, ie(ae.value, (l) => (k(), T(a(He), {
194
194
  key: l.key,
195
195
  label: l.label,
196
196
  value: l.value
@@ -198,7 +198,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
198
198
  ]),
199
199
  _: 1
200
200
  }, 8, ["modelValue"])) : _("", !0),
201
- F.checkEdit ? (w(), T(a(N), {
201
+ F.checkEdit ? (k(), T(a(N), {
202
202
  key: 1,
203
203
  plain: "",
204
204
  onClick: e[1] || (e[1] = (l) => I.value = !0)
@@ -216,7 +216,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
216
216
  format: "MMM",
217
217
  "value-format": "M"
218
218
  }, null, 8, ["modelValue"]),
219
- e[19] || (e[19] = k("div", { class: "expander" }, null, -1)),
219
+ e[19] || (e[19] = C("div", { class: "expander" }, null, -1)),
220
220
  i(a(ve), {
221
221
  modelValue: R.value,
222
222
  "onUpdate:modelValue": e[3] || (e[3] = (l) => R.value = l),
@@ -273,7 +273,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
273
273
  }, {
274
274
  default: v(() => [
275
275
  i(a(z), {
276
- label: a(d)("workSchedule.title", { name: $.value }) + a(L)(f.value, "month") + ` ${new Date(f.value).getFullYear()}`,
276
+ label: a(d)("workSchedule.title", { name: $.value }) + a(L)(w.value, "month") + ` ${new Date(w.value).getFullYear()}`,
277
277
  align: "center",
278
278
  height: "34"
279
279
  }, {
@@ -285,7 +285,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
285
285
  fixed: R.value !== "100%"
286
286
  }, {
287
287
  default: v((l) => [
288
- k("div", Qe, m(n.value[l.$index].name), 1)
288
+ C("div", Qe, m(n.value[l.$index].name), 1)
289
289
  ]),
290
290
  _: 1
291
291
  }, 8, ["label", "fixed"]),
@@ -294,7 +294,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
294
294
  align: "center"
295
295
  }, {
296
296
  default: v(() => [
297
- (w(!0), B(de, null, ie(u.value, (l) => (w(), T(a(z), {
297
+ (k(!0), B(de, null, ie(u.value, (l) => (k(), T(a(z), {
298
298
  key: l.day,
299
299
  width: "46",
300
300
  "class-name": l.holidays,
@@ -304,7 +304,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
304
304
  prop: "vacation"
305
305
  }, {
306
306
  default: v((g) => [
307
- k("div", Xe, m(ce(l.day, g.$index) || " "), 1)
307
+ C("div", Xe, m(ce(l.day, g.$index) || " "), 1)
308
308
  ]),
309
309
  _: 2
310
310
  }, 1032, ["class-name", "label"]))), 128))
@@ -331,7 +331,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
331
331
  align: "center"
332
332
  }, {
333
333
  default: v((l) => [
334
- k("div", {
334
+ C("div", {
335
335
  style: Te(`color: ${U.value === l.row.contHour ? "green" : "red"};`)
336
336
  }, m(l.row.contHour), 5)
337
337
  ]),
@@ -349,9 +349,9 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
349
349
  ]),
350
350
  _: 1
351
351
  }, 8, ["loading"]),
352
- Ce.value && F.checkEdit ? (w(), B("div", _e, [
352
+ Ce.value && F.checkEdit ? (k(), B("div", _e, [
353
353
  b(m(a(d)("workSchedule.chartsFilled")) + ": ", 1),
354
- q.value ? _("", !0) : (w(), T(a(N), {
354
+ q.value ? _("", !0) : (k(), T(a(N), {
355
355
  key: 0,
356
356
  type: "primary",
357
357
  onClick: De
@@ -362,9 +362,9 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
362
362
  _: 1
363
363
  })),
364
364
  e[20] || (e[20] = b()),
365
- k("span", null, m(F.fullName), 1)
365
+ C("span", null, m(F.fullName), 1)
366
366
  ])) : _("", !0),
367
- Be((w(), T(a(N), {
367
+ Be((k(), T(a(N), {
368
368
  disabled: Z.value,
369
369
  plain: "",
370
370
  onClick: Ve,
@@ -411,7 +411,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
411
411
  autocomplete: "on"
412
412
  }, {
413
413
  default: v(() => [
414
- (w(!0), B(de, null, ie(E.value, (l) => (w(), T(a(Oe), null, {
414
+ (k(!0), B(de, null, ie(E.value, (l) => (k(), T(a(Oe), null, {
415
415
  default: v(() => [
416
416
  i(a(ve), {
417
417
  modelValue: l.val,
@@ -438,7 +438,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
438
438
  disabled: ""
439
439
  }, null, 8, ["label"]),
440
440
  i(a(qe)),
441
- h.value.level === 2 ? (w(), B("div", el, [
441
+ h.value.level === 2 ? (k(), B("div", el, [
442
442
  i(a(Ge), {
443
443
  modelValue: te.value,
444
444
  "onUpdate:modelValue": e[7] || (e[7] = (l) => te.value = l),
@@ -460,8 +460,8 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
460
460
  ]),
461
461
  _: 1
462
462
  }, 8, ["modelValue"]),
463
- e[21] || (e[21] = k("br", null, null, -1)),
464
- k("span", null, m(a(d)("workSchedule.fromDate")) + ":", 1),
463
+ e[21] || (e[21] = C("br", null, null, -1)),
464
+ C("span", null, m(a(d)("workSchedule.fromDate")) + ":", 1),
465
465
  i(a(G), {
466
466
  modelValue: H.value,
467
467
  "onUpdate:modelValue": e[8] || (e[8] = (l) => H.value = l),
@@ -469,7 +469,7 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
469
469
  min: 1,
470
470
  max: u.value.length
471
471
  }, null, 8, ["modelValue", "max"]),
472
- k("span", null, m(a(d)("workSchedule.with")) + ":", 1),
472
+ C("span", null, m(a(d)("workSchedule.with")) + ":", 1),
473
473
  i(a(G), {
474
474
  modelValue: S.value,
475
475
  "onUpdate:modelValue": e[9] || (e[9] = (l) => S.value = l),
@@ -477,10 +477,10 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
477
477
  min: 0,
478
478
  max: 20
479
479
  }, null, 8, ["modelValue"]),
480
- k("span", null, m(a(d)("workSchedule.duration")) + ":", 1),
480
+ C("span", null, m(a(d)("workSchedule.duration")) + ":", 1),
481
481
  i(a(G), {
482
- modelValue: x.value,
483
- "onUpdate:modelValue": e[10] || (e[10] = (l) => x.value = l),
482
+ modelValue: f.value,
483
+ "onUpdate:modelValue": e[10] || (e[10] = (l) => f.value = l),
484
484
  step: 1,
485
485
  min: 4,
486
486
  max: 22 - S.value
@@ -505,10 +505,10 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
505
505
  ]),
506
506
  _: 1
507
507
  })
508
- ])) : (w(), B("div", ll, [
509
- k("div", null, m(ce(h.value.day, h.value.ids)), 1),
510
- e[22] || (e[22] = k("br", null, null, -1)),
511
- k("span", null, m(a(d)("workSchedule.with")) + ":", 1),
508
+ ])) : (k(), B("div", ll, [
509
+ C("div", null, m(ce(h.value.day, h.value.ids)), 1),
510
+ e[22] || (e[22] = C("br", null, null, -1)),
511
+ C("span", null, m(a(d)("workSchedule.with")) + ":", 1),
512
512
  i(a(G), {
513
513
  modelValue: S.value,
514
514
  "onUpdate:modelValue": e[13] || (e[13] = (l) => S.value = l),
@@ -517,10 +517,10 @@ const Je = { class: "work" }, Ke = { class: "nav" }, Qe = { style: { height: "10
517
517
  max: 20,
518
518
  onChange: e[14] || (e[14] = (l) => pe(h.value.day, h.value.ids))
519
519
  }, null, 8, ["modelValue"]),
520
- k("span", null, m(a(d)("workSchedule.duration")) + ":", 1),
520
+ C("span", null, m(a(d)("workSchedule.duration")) + ":", 1),
521
521
  i(a(G), {
522
- modelValue: x.value,
523
- "onUpdate:modelValue": e[15] || (e[15] = (l) => x.value = l),
522
+ modelValue: f.value,
523
+ "onUpdate:modelValue": e[15] || (e[15] = (l) => f.value = l),
524
524
  step: 1,
525
525
  min: 4,
526
526
  max: 22 - S.value,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studio-west/employees",
3
- "version": "0.6.7",
3
+ "version": "0.6.9",
4
4
  "files": [
5
5
  "dist"
6
6
  ],