@studio-west/employees 0.6.59 → 0.6.60

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"),m=require("./index-Dn3djtwj.cjs"),ve=require("vue-i18n"),i=require("element-plus"),_=require("@imengyu/vue3-context-menu");function ce(C){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(C){for(const V in C)if(V!=="default"){const c=Object.getOwnPropertyDescriptor(C,V);Object.defineProperty(r,V,c.get?c:{enumerable:!0,get:()=>C[V]})}}return r.default=C,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={class:"label"},ke={key:0,style:{padding:"0.5em 1.5em"}},Ce={key:1,style:{padding:"0.5em 1.5em"}},xe={__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"},group:String,date:String},setup(C){const{t:r,d:V}=ve.useI18n(),c=C,I=e.ref(!1),n=e.ref([]),R=e.ref(c.date?new Date(c.date+"T00:00:01").getMonth():new Date().getMonth()),j=e.ref(!1),B=e.ref([]),h=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1)),u=e.ref([]),T=e.ref(0),y=e.ref(9),f=e.ref(8),Y=e.ref(!1),J=e.ref(!0),$=e.ref(!1),q=e.ref("5"),M=e.ref(1),x=e.ref([]),O=e.ref([]),E=e.ref([]),U=e.ref([]),g=e.ref({name:"Имя",length:0,code:""}),A=e.ref(!1),P=e.ref({zIndex:3,minWidth:230,x:500,y:200}),Z=e.ref({}),z=e.ref("100%");e.watch(x,async(t,l)=>{t!==l&&(E.value=[],Y.value=!1,c.odata.personal.forEach(o=>{t.includes(o.divisionName)&&(E.value.some(d=>(d==null?void 0:d.activeText)===o.roleName)||E.value.push({val:!0,activeText:o.roleName}))}),W())}),e.watch(R,async t=>{let l=new Date().getMonth(),o=t===null?l:t-1;o=l-1<=o?o-l>=11?o-12:o:o+12,h.value=new Date(new Date().getFullYear(),o,1),Q()});const ee=(t,l,o,d)=>{g.value.ids=t.ids,g.value.key=t.key,g.value.add=t.days.length>0&&t.days[t.days.length-1].cont,g.value.level=l.level,g.value.day=o.cellIndex,P.value.y=d.clientY,P.value.x=d.clientX,l.level===2&&l.no===0&&c.checkEdit&&(g.value.name=r("workSchedule.autocomplete"),A.value=!0),l.level===3&&o.cellIndex-l.no===1&&c.checkEdit&&(b(o.cellIndex,t.ids),g.value.name=r("workSchedule.modeSelection"),A.value=!0)},le=({row:t,columnIndex:l})=>{if(!B.value||B.value.length===0||!j.value)return"";const o=new Date(new Date(h.value).getFullYear(),new Date(h.value).getMonth(),l).getTime()+1e3;for(let d of B.value){const{dateStart:v,dateEnd:a,code:w}=d;if(v&&a&&w===t.code&&l!==0&&l<=u.value.length){const N=new Date(m.parseDate(v)).getTime(),D=new Date(m.parseDate(a)).getTime();if(o>=N&&o<=D)return"vacation"}}return""},Q=()=>{var a,w,N,D;const t=Z.value,l=new Date(h.value),o=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let d=[],v=0;for(let S=1;S<=o;S++){const s=m.parseTime(l.setDate(S),"{Y}-{m}-{dd}");v+=(a=t.nowork)!=null&&a.includes(s)||t.holidays.includes(s)?0:(w=t.preholidays)!=null&&w.includes(s)?7:8;const p=(N=t.nowork)!=null&&N.includes(s)?"nowork":t.holidays.includes(s)?"holiday":(D=t.preholidays)!=null&&D.includes(s)?"preholiday":"";d.push({day:S,holidays:p,weekday:V(new Date(l.getFullYear(),l.getMonth(),S),"day")})}T.value=v,u.value=d,c.odata.getPersonal({dismissed:"false"}).then(S=>{var s;x.value.length===0&&(x.value=[(s=S.find(p=>p.employeeName===c.fullName))==null?void 0:s.divisionName]),S.forEach((p,L)=>{O.value.some(k=>p.dismissalDate.length>0&&new Date(p.dismissalDate)<new Date(h.value)||(k==null?void 0:k.value)===p.divisionName)||O.value.push({value:p.divisionName,label:p.divisionName,key:L}),x.value.includes(p.divisionName)&&!E.value.some(k=>(k==null?void 0:k.activeText)===p.roleName)&&E.value.push({val:!0,activeText:p.roleName})}),W(),J.value=!1})},te=e.computed(()=>!n.value.some(t=>t.contHour!==T.value)),K=(t,l)=>{var a,w,N;const o=new Date(h.value),d=`${o.getFullYear()}-${(o.getMonth()+1).toString().padStart(2,"0")}-${t.toString().padStart(2,"0")}`,v=(a=n.value[l])==null?void 0:a.days.findIndex(D=>D.day===d);return l===-1||v===-1?"":((w=n.value[l].days[v])==null?void 0:w.tips)+`
2
- `+((N=n.value[l].days[v])==null?void 0:N.time)},W=()=>{n.value=[],U.value=[],B.value=[],c.odata.personal.forEach(t=>{if(x.value.includes(t.divisionName)&&E.value.some(l=>l.val&&l.activeText===t.roleName)&&(t.dismissalDate.length===0||new Date(t.dismissalDate)>new Date(h.value))){let l=m.byInitials(t.employeeName);n.value.push({name:l+" ("+t.roleName+")",days:[],contHour:0,code:t.employeeKey,id:!1})}}),n.value.sort((t,l)=>t.name<l.name?-1:t.name>l.name?1:0),n.value.forEach((t,l)=>{t.ids=l,U.value.push(t.code)}),c.workSchedule.getUsersYear({code:U.value,year:new Date(h.value).getFullYear()}).then(t=>{t.forEach(l=>{l.dateStart&&B.value.push({code:l.code,dateStart:l.dateStart,dateEnd:l.dateEnd})}),ae(),$.value=!1})},ae=()=>{c.workSchedule.getWorkSchedule({code:U.value,date:m.parseTime(new Date(h.value),"{Y}-{m}-{dd}")}).then(t=>{t.forEach((l,o)=>{l!==null&&(n.value[o].days=l.data.days,n.value[o].id=l.id)}),F()})},F=()=>{n.value.forEach(t=>{t.contHour=t.days.reduce((l,o)=>l+o.time,0)})},ne=t=>{n.value[t].days=[],F()},oe=t=>{switch(q.value){case"5":for(let l=M.value;l<=u.value.length;l++)u.value[l-1].holidays===""&&b(l,t,!0),u.value[l-1].holidays==="preholiday"&&(f.value-=1,b(l,t,!0),f.value+=1);break;case"2x2":for(let l=M.value;l<=u.value.length;l+=4)b(l,t,!0),l+1<=u.value.length&&b(l+1,t,!0);break;case"2x5":for(let l=M.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"?(f.value-=1,b(o,t,!0),f.value+=1):b(o,t,!0);break}},b=(t,l,o=!1)=>{const{date:d,ind:v}=H(t,l);v===-1?(n.value[l].days.push({day:d,time:f.value,tips:`(${y.value}:00 - ${f.value>=22?y.value+f.value+2:y.value+f.value+1}:00)`}),F()):o||(f.value=n.value[l].days[v].time,y.value=parseInt(n.value[l].days[v].tips.slice(1,-12)))},ue=(t,l)=>{const{ind:o}=H(t,l);n.value[l].days.splice(o,1),F(),document.querySelector(".app-main").click()},X=(t,l)=>{const{date:o,ind:d}=H(t,l);n.value[l].days[d]={day:o,time:f.value,tips:`(${y.value}:00 - ${f.value>=22?y.value+f.value+2:y.value+f.value+1}:00)`},F()},H=(t,l)=>{var v;const o=m.parseTime(new Date(h.value).setDate(t),"{Y}-{m}-{dd}"),d=(v=n.value[l])==null?void 0:v.days.findIndex(a=>a.day===o);return{date:o,ind:d}},re=async()=>{var S;I.value=!0;const t=new me.Workbook,l=t.addWorksheet(V(h.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"}},v={vertical:"middle",horizontal:"center",wrapText:!0};l.mergeCells(`A1:${m.cellsDynamically("A1",u.value.length+5)}1`),l.mergeCells(`A2:${m.cellsDynamically("A2",u.value.length+5)}2`),l.mergeCells("A3:A4"),l.mergeCells(`B3:${m.cellsDynamically("B3",u.value.length)}3`),l.mergeCells(`${m.cellsDynamically("B3",u.value.length+1)}3:${m.cellsDynamically("B3",u.value.length+2)}3`),l.mergeCells(`${m.cellsDynamically("B3",u.value.length+3)}3:${m.cellsDynamically("B4",u.value.length+3)}4`),l.mergeCells(`${m.cellsDynamically("B3",u.value.length+4)}3:${m.cellsDynamically("B4",u.value.length+4)}4`),l.getCell("A1").value=r("workSchedule.firm"),l.getCell("A2").value=r("workSchedule.title",{name:x.value[0]})+V(h.value,"month")+` ${new Date(h.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")} (${T.value})`;for(let s=2;s<=u.value.length+1;s++)l.getCell(4,s).value=u.value[s-2].weekday+`
3
- `+(s-1),l.getColumn(s).width=6,l.getColumn(s).alignment=v,l.getCell(4,s).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=v,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=v,l.getColumn(u.value.length+3).alignment=v,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 a=0;for(const s of n.value){let p=[s.name];for(let k=1;k<=u.value.length;k++){const{ind:G}=H(k,a);G!==-1?p[k]=`${s.days[G].time} ${s.days[G].tips}`:p[k]=" "}p.push(((S=s.days)==null?void 0:S.length)||" ",s.contHour||0);const L=l.addRow(p);L.border=d,a++}let w="Щербина Е. В.";c.odata.personal.forEach(s=>{s.roleName==="Начальник отдела правовой и кадровой работы"&&(w=s.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=m.byInitials(c.fullName),l.getCell(`AD${n.value.length+8}`).value=m.byInitials(w),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 N="export_"+m.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",D=await t.xlsx.writeBuffer();de.saveAs(new Blob([D]),N),I.value=!1},ie=async()=>{Y.value||c.workSchedule.addWorkSchedule({data:n.value,date:m.parseTime(new Date(h.value),"{Y}-{m}-{dd}"),group:x.value[0]}).then(t=>Y.value=t)};return console.log("props.group",c.group),console.log("props.date",c.date),c.group&&(x.value[0]=c.group),c.date&&(h.value=new Date(c.date+"T00:00:01")),m.holidays().then(t=>{Z.value=t,Q()}),(t,l)=>{const o=e.resolveComponent("el-date-picker"),d=e.resolveComponent("svg-icon"),v=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("div",he,[C.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElSelect),{key:0,modelValue:x.value,"onUpdate:modelValue":l[0]||(l[0]=a=>x.value=a),multiple:"","collapse-tags":"","collapse-tags-tooltip":"",placeholder:"Select",style:{width:"240px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,a=>(e.openBlock(),e.createBlock(e.unref(i.ElOption),{key:a.key,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),C.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:1,plain:"",onClick:l[1]||(l[1]=a=>$.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]=a=>R.value=a),type:"month",placeholder:"Выберите месяц",format:"MMM","value-format":"M"},null,8,["modelValue"]),l[21]||(l[21]=e.createElementVNode("div",{class:"expander"},null,-1)),e.createVNode(e.unref(i.ElSwitch),{modelValue:z.value,"onUpdate:modelValue":l[3]||(l[3]=a=>z.value=a),"active-text":t.$t("bids.currentHeight"),"active-value":"100%","inactive-value":"calc(100vh - var(--el-component-size)*5 - 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]=a=>j.value=a),"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":z.value,size:"small",align:"center",onCellClick:ee,"empty-text":e.unref(r)("workSchedule.emptyText"),"cell-class-name":le},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.title",{name:x.value[0]})+e.unref(V)(h.value,"month")+` ${new Date(h.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:z.value!=="100%"},{default:e.withCtx(a=>[e.createElementVNode("div",fe,e.toDisplayString(n.value[a.$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,a=>(e.openBlock(),e.createBlock(e.unref(i.ElTableColumn),{key:a.day,width:"46","class-name":a.holidays,align:"center",label:a.weekday+`
4
- `+a.day.toString(),prop:"vacation"},{default:e.withCtx(w=>[e.createElementVNode("div",pe,e.toDisplayString(K(a.day,w.$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:z.value!=="100%"?"right":!1},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.days"),align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(n.value[a.$index].days.length||0),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:`${e.unref(r)("workSchedule.hours")} ( ${T.value} )`,align:"center"},{default:e.withCtx(a=>[e.createElementVNode("div",{style:e.normalizeStyle(`color: ${T.value===a.row.contHour?"green":"red"};`)},e.toDisplayString(a.row.contHour),5)]),_:1},8,["label"])]),_:1},8,["label","fixed"])]),_:1},8,["label"])]),_:1},8,["data","max-height","empty-text"])]),_:1},8,["loading"]),te.value&&C.checkEdit?(e.openBlock(),e.createElementBlock("div",ye,[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.chartsFilled"))+": ",1),Y.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:0,type:"primary",onClick:ie},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.confirm")),1)]),_:1})),l[22]||(l[22]=e.createTextVNode()),e.createElementVNode("span",null,e.toDisplayString(C.fullName),1)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(i.ElButton),{disabled:I.value,plain:"",onClick:re,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[v,I.value]]),e.createVNode(e.unref(i.ElDialog),{title:e.unref(r)("workSchedule.jobTitle"),modelValue:$.value,"onUpdate:modelValue":l[7]||(l[7]=a=>$.value=a),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(i.ElButton),{onClick:l[5]||(l[5]=a=>$.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{size:"default",type:"primary",onClick:l[6]||(l[6]=a=>{W(),$.value=!1})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElForm),{ref:"dialogForm",model:E.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,a=>(e.openBlock(),e.createBlock(e.unref(i.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElSwitch),{modelValue:a.val,"onUpdate:modelValue":w=>a.val=w,"active-text":a.activeText},null,8,["modelValue","onUpdate:modelValue","active-text"])]),_:2},1024))),256))]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(_.ContextMenu),{show:A.value,"onUpdate:show":l[20]||(l[20]=a=>A.value=a),options:P.value},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"mx-context-menu-item",onClick:l[8]||(l[8]=a=>A.value=!1)},[e.createElementVNode("span",we,e.toDisplayString(g.value.name),1),l[23]||(l[23]=e.createElementVNode("div",{class:"expander"},null,-1)),e.createVNode(d,{"icon-class":"cross"})]),e.createVNode(e.unref(_.ContextMenuSeparator)),g.value.level===2?(e.openBlock(),e.createElementBlock("div",ke,[e.createVNode(e.unref(i.ElRadioGroup),{modelValue:q.value,"onUpdate:modelValue":l[9]||(l[9]=a=>q.value=a),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[24]||(l[24]=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:M.value,"onUpdate:modelValue":l[10]||(l[10]=a=>M.value=a),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:y.value,"onUpdate:modelValue":l[11]||(l[11]=a=>y.value=a),step:1,min:0,max:19},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:f.value,"onUpdate:modelValue":l[12]||(l[12]=a=>f.value=a),step:1,min:4,max:e.unref(m.clamp)(y.value!==1?23-y.value:21,4,22)},null,8,["modelValue","max"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[13]||(l[13]=a=>oe(g.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[14]||(l[14]=a=>ne(g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.clearRow")),1)]),_:1})])):(e.openBlock(),e.createElementBlock("div",Ce,[e.createElementVNode("div",null,e.toDisplayString(K(g.value.day,g.value.ids)),1),l[25]||(l[25]=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:y.value,"onUpdate:modelValue":l[15]||(l[15]=a=>y.value=a),step:1,min:0,max:19,onChange:l[16]||(l[16]=a=>X(g.value.day,g.value.ids))},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:f.value,"onUpdate:modelValue":l[17]||(l[17]=a=>f.value=a),step:1,min:4,max:e.unref(m.clamp)(y.value!==1?23-y.value:21,4,22),onChange:l[18]||(l[18]=a=>X(g.value.day,g.value.ids))},null,8,["modelValue","max"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[19]||(l[19]=a=>ue(g.value.day,g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.delete")),1)]),_:1})]))]),_:1},8,["show","options"])])}}};module.exports=xe;
1
+ "use strict";const e=require("vue"),de=require("file-saver"),se=require("exceljs"),m=require("./index-Dn3djtwj.cjs"),ve=require("vue-i18n"),i=require("element-plus"),_=require("@imengyu/vue3-context-menu");function ce(C){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(C){for(const S in C)if(S!=="default"){const c=Object.getOwnPropertyDescriptor(C,S);Object.defineProperty(r,S,c.get?c:{enumerable:!0,get:()=>C[S]})}}return r.default=C,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={class:"label"},ke={key:0,style:{padding:"0.5em 1.5em"}},Ce={key:1,style:{padding:"0.5em 1.5em"}},xe={__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"},group:String,date:String},setup(C){const{t:r,d:S}=ve.useI18n(),c=C,U=e.ref(!1),n=e.ref([]),q=e.ref(c.date?new Date(c.date+"T00:00:01").getMonth():new Date().getMonth()),O=e.ref(!1),T=e.ref([]),h=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1)),u=e.ref([]),M=e.ref(0),p=e.ref(9),f=e.ref(8),H=e.ref(!1),Z=e.ref(!0),$=e.ref(!1),P=e.ref("5"),A=e.ref(1),x=e.ref([]),W=e.ref([]),D=e.ref([]),R=e.ref([]),g=e.ref({name:"Имя",length:0,code:""}),z=e.ref(!1),L=e.ref({zIndex:3,minWidth:230,x:500,y:200}),E=e.ref({}),F=e.ref("100%");e.watch(x,async(t,l)=>{t!==l&&(D.value=[],H.value=!1,c.odata.personal.forEach(o=>{t.includes(o.divisionName)&&(D.value.some(d=>(d==null?void 0:d.activeText)===o.roleName)||D.value.push({val:!0,activeText:o.roleName}))}),G())}),e.watch(q,async t=>{let l=new Date().getMonth(),o=t===null?l:t-1;o=l-1<=o?o-l>=11?o-12:o:o+12,h.value=new Date(new Date().getFullYear(),o,1),Q()});const ee=(t,l,o,d)=>{g.value.ids=t.ids,g.value.key=t.key,g.value.add=t.days.length>0&&t.days[t.days.length-1].cont,g.value.level=l.level,g.value.day=o.cellIndex,L.value.y=d.clientY,L.value.x=d.clientX,l.level===2&&l.no===0&&c.checkEdit&&(g.value.name=r("workSchedule.autocomplete"),z.value=!0),l.level===3&&o.cellIndex-l.no===1&&c.checkEdit&&(b(o.cellIndex,t.ids),g.value.name=r("workSchedule.modeSelection"),z.value=!0)},le=({row:t,columnIndex:l})=>{if(!T.value||T.value.length===0||!O.value)return"";const o=new Date(new Date(h.value).getFullYear(),new Date(h.value).getMonth(),l).getTime()+1e3;for(let d of T.value){const{dateStart:v,dateEnd:a,code:y}=d;if(v&&a&&y===t.code&&l!==0&&l<=u.value.length){const V=new Date(m.parseDate(v)).getTime(),w=new Date(m.parseDate(a)).getTime();if(o>=V&&o<=w)return"vacation"}}return""},Q=()=>{var v,a,y,V;const t=new Date(h.value),l=new Date(t.getFullYear(),t.getMonth()+1,0).getDate();let o=[],d=0;for(let w=1;w<=l;w++){const k=m.parseTime(t.setDate(w),"{Y}-{m}-{dd}");d+=(v=E.value.nowork)!=null&&v.includes(k)||E.value.holidays.includes(k)?0:(a=E.value.preholidays)!=null&&a.includes(k)?7:8;const s=(y=E.value.nowork)!=null&&y.includes(k)?"nowork":E.value.holidays.includes(k)?"holiday":(V=E.value.preholidays)!=null&&V.includes(k)?"preholiday":"";o.push({day:w,holidays:s,weekday:S(new Date(t.getFullYear(),t.getMonth(),w),"day")})}M.value=d,u.value=o,c.odata.getPersonal({dismissed:"false"}).then(w=>{var k;x.value.length===0&&(x.value=[(k=w.find(s=>s.employeeName===c.fullName&&s.dismissalDate.length===0))==null?void 0:k.divisionName]),w.forEach((s,B)=>{W.value.some(N=>s.dismissalDate.length>0&&new Date(s.dismissalDate)<new Date(h.value)||(N==null?void 0:N.value)===s.divisionName)||W.value.push({value:s.divisionName,label:s.divisionName,key:B}),x.value.includes(s.divisionName)&&!D.value.some(N=>(N==null?void 0:N.activeText)===s.roleName)&&D.value.push({val:!0,activeText:s.roleName})}),G(),Z.value=!1})},te=e.computed(()=>!n.value.some(t=>t.contHour!==M.value)),K=(t,l)=>{var a,y,V;const o=new Date(h.value),d=`${o.getFullYear()}-${(o.getMonth()+1).toString().padStart(2,"0")}-${t.toString().padStart(2,"0")}`,v=(a=n.value[l])==null?void 0:a.days.findIndex(w=>w.day===d);return l===-1||v===-1?"":((y=n.value[l].days[v])==null?void 0:y.tips)+`
2
+ `+((V=n.value[l].days[v])==null?void 0:V.time)},G=()=>{n.value=[],R.value=[],T.value=[],c.odata.personal.forEach(t=>{if(x.value.includes(t.divisionName)&&D.value.some(l=>l.val&&l.activeText===t.roleName)&&(t.dismissalDate.length===0||new Date(t.dismissalDate)>new Date(h.value))){let l=m.byInitials(t.employeeName);n.value.push({name:l+" ("+t.roleName+")",days:[],contHour:0,code:t.employeeKey,id:!1})}}),n.value.sort((t,l)=>t.name<l.name?-1:t.name>l.name?1:0),n.value.forEach((t,l)=>{t.ids=l,R.value.push(t.code)}),c.workSchedule.getUsersYear({code:R.value,year:new Date(h.value).getFullYear()}).then(t=>{t.forEach(l=>{l.dateStart&&T.value.push({code:l.code,dateStart:l.dateStart,dateEnd:l.dateEnd})}),ae(),$.value=!1})},ae=()=>{c.workSchedule.getWorkSchedule({code:R.value,date:m.parseTime(new Date(h.value),"{Y}-{m}-{dd}")}).then(t=>{t.forEach((l,o)=>{l!==null&&(n.value[o].days=l.data.days,n.value[o].id=l.id)}),I()})},I=()=>{n.value.forEach(t=>{t.contHour=t.days.reduce((l,o)=>l+o.time,0)})},ne=t=>{n.value[t].days=[],I()},oe=t=>{switch(P.value){case"5":for(let l=A.value;l<=u.value.length;l++)u.value[l-1].holidays===""&&b(l,t,!0),u.value[l-1].holidays==="preholiday"&&(f.value-=1,b(l,t,!0),f.value+=1);break;case"2x2":for(let l=A.value;l<=u.value.length;l+=4)b(l,t,!0),l+1<=u.value.length&&b(l+1,t,!0);break;case"2x5":for(let l=A.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"?(f.value-=1,b(o,t,!0),f.value+=1):b(o,t,!0);break}},b=(t,l,o=!1)=>{const{date:d,ind:v}=j(t,l);v===-1?(n.value[l].days.push({day:d,time:f.value,tips:`(${p.value}:00 - ${f.value>=22?p.value+f.value+2:p.value+f.value+1}:00)`}),I()):o||(f.value=n.value[l].days[v].time,p.value=parseInt(n.value[l].days[v].tips.slice(1,-12)))},ue=(t,l)=>{const{ind:o}=j(t,l);n.value[l].days.splice(o,1),I(),document.querySelector(".app-main").click()},X=(t,l)=>{const{date:o,ind:d}=j(t,l);n.value[l].days[d]={day:o,time:f.value,tips:`(${p.value}:00 - ${f.value>=22?p.value+f.value+2:p.value+f.value+1}:00)`},I()},j=(t,l)=>{var v;const o=m.parseTime(new Date(h.value).setDate(t),"{Y}-{m}-{dd}"),d=(v=n.value[l])==null?void 0:v.days.findIndex(a=>a.day===o);return{date:o,ind:d}},re=async()=>{var k;U.value=!0;const t=new me.Workbook,l=t.addWorksheet(S(h.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"}},v={vertical:"middle",horizontal:"center",wrapText:!0};l.mergeCells(`A1:${m.cellsDynamically("A1",u.value.length+5)}1`),l.mergeCells(`A2:${m.cellsDynamically("A2",u.value.length+5)}2`),l.mergeCells("A3:A4"),l.mergeCells(`B3:${m.cellsDynamically("B3",u.value.length)}3`),l.mergeCells(`${m.cellsDynamically("B3",u.value.length+1)}3:${m.cellsDynamically("B3",u.value.length+2)}3`),l.mergeCells(`${m.cellsDynamically("B3",u.value.length+3)}3:${m.cellsDynamically("B4",u.value.length+3)}4`),l.mergeCells(`${m.cellsDynamically("B3",u.value.length+4)}3:${m.cellsDynamically("B4",u.value.length+4)}4`),l.getCell("A1").value=r("workSchedule.firm"),l.getCell("A2").value=r("workSchedule.title",{name:x.value[0]})+S(h.value,"month")+` ${new Date(h.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")} (${M.value})`;for(let s=2;s<=u.value.length+1;s++)l.getCell(4,s).value=u.value[s-2].weekday+`
3
+ `+(s-1),l.getColumn(s).width=6,l.getColumn(s).alignment=v,l.getCell(4,s).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=v,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=v,l.getColumn(u.value.length+3).alignment=v,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 a=0;for(const s of n.value){let B=[s.name];for(let Y=1;Y<=u.value.length;Y++){const{ind:J}=j(Y,a);J!==-1?B[Y]=`${s.days[J].time} ${s.days[J].tips}`:B[Y]=" "}B.push(((k=s.days)==null?void 0:k.length)||" ",s.contHour||0);const N=l.addRow(B);N.border=d,a++}let y="Щербина Е. В.";c.odata.personal.forEach(s=>{s.roleName==="Начальник отдела правовой и кадровой работы"&&(y=s.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=m.byInitials(c.fullName),l.getCell(`AD${n.value.length+8}`).value=m.byInitials(y),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 V="export_"+m.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",w=await t.xlsx.writeBuffer();de.saveAs(new Blob([w]),V),U.value=!1},ie=async()=>{H.value||c.workSchedule.addWorkSchedule({data:n.value,date:m.parseTime(new Date(h.value),"{Y}-{m}-{dd}"),group:x.value[0]}).then(t=>H.value=t)};return console.log("props.group",c.group),console.log("props.date",c.date),c.group&&(x.value[0]=c.group),c.date&&(h.value=new Date(c.date+"T00:00:01")),m.holidays().then(t=>{E.value=t,Q()}),(t,l)=>{const o=e.resolveComponent("el-date-picker"),d=e.resolveComponent("svg-icon"),v=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("div",he,[C.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElSelect),{key:0,modelValue:x.value,"onUpdate:modelValue":l[0]||(l[0]=a=>x.value=a),multiple:"","collapse-tags":"","collapse-tags-tooltip":"",placeholder:"Select",style:{width:"240px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.value,a=>(e.openBlock(),e.createBlock(e.unref(i.ElOption),{key:a.key,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),C.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:1,plain:"",onClick:l[1]||(l[1]=a=>$.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.jobTitle")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(o,{modelValue:q.value,"onUpdate:modelValue":l[2]||(l[2]=a=>q.value=a),type:"month",placeholder:"Выберите месяц",format:"MMM","value-format":"M"},null,8,["modelValue"]),l[21]||(l[21]=e.createElementVNode("div",{class:"expander"},null,-1)),e.createVNode(e.unref(i.ElSwitch),{modelValue:F.value,"onUpdate:modelValue":l[3]||(l[3]=a=>F.value=a),"active-text":t.$t("bids.currentHeight"),"active-value":"100%","inactive-value":"calc(100vh - var(--el-component-size)*5 - var(--el-main-padding)*2 - var(--header-height))"},null,8,["modelValue","active-text"]),e.createVNode(e.unref(i.ElSwitch),{modelValue:O.value,"onUpdate:modelValue":l[4]||(l[4]=a=>O.value=a),"active-text":"Отпуска","active-value":!0,"inactive-value":!1},null,8,["modelValue"])]),e.createVNode(e.unref(i.ElSkeleton),{style:{width:"100%"},loading:Z.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":F.value,size:"small",align:"center",onCellClick:ee,"empty-text":e.unref(r)("workSchedule.emptyText"),"cell-class-name":le},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.title",{name:x.value[0]})+e.unref(S)(h.value,"month")+` ${new Date(h.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:F.value!=="100%"},{default:e.withCtx(a=>[e.createElementVNode("div",fe,e.toDisplayString(n.value[a.$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,a=>(e.openBlock(),e.createBlock(e.unref(i.ElTableColumn),{key:a.day,width:"46","class-name":a.holidays,align:"center",label:a.weekday+`
4
+ `+a.day.toString(),prop:"vacation"},{default:e.withCtx(y=>[e.createElementVNode("div",pe,e.toDisplayString(K(a.day,y.$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:F.value!=="100%"?"right":!1},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.days"),align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(n.value[a.$index].days.length||0),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:`${e.unref(r)("workSchedule.hours")} ( ${M.value} )`,align:"center"},{default:e.withCtx(a=>[e.createElementVNode("div",{style:e.normalizeStyle(`color: ${M.value===a.row.contHour?"green":"red"};`)},e.toDisplayString(a.row.contHour),5)]),_:1},8,["label"])]),_:1},8,["label","fixed"])]),_:1},8,["label"])]),_:1},8,["data","max-height","empty-text"])]),_:1},8,["loading"]),te.value&&C.checkEdit?(e.openBlock(),e.createElementBlock("div",ye,[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.chartsFilled"))+": ",1),H.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:0,type:"primary",onClick:ie},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.confirm")),1)]),_:1})),l[22]||(l[22]=e.createTextVNode()),e.createElementVNode("span",null,e.toDisplayString(C.fullName),1)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(i.ElButton),{disabled:U.value,plain:"",onClick:re,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[v,U.value]]),e.createVNode(e.unref(i.ElDialog),{title:e.unref(r)("workSchedule.jobTitle"),modelValue:$.value,"onUpdate:modelValue":l[7]||(l[7]=a=>$.value=a),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(i.ElButton),{onClick:l[5]||(l[5]=a=>$.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{size:"default",type:"primary",onClick:l[6]||(l[6]=a=>{G(),$.value=!1})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElForm),{ref:"dialogForm",model:D.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.value,a=>(e.openBlock(),e.createBlock(e.unref(i.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElSwitch),{modelValue:a.val,"onUpdate:modelValue":y=>a.val=y,"active-text":a.activeText},null,8,["modelValue","onUpdate:modelValue","active-text"])]),_:2},1024))),256))]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(_.ContextMenu),{show:z.value,"onUpdate:show":l[20]||(l[20]=a=>z.value=a),options:L.value},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"mx-context-menu-item",onClick:l[8]||(l[8]=a=>z.value=!1)},[e.createElementVNode("span",we,e.toDisplayString(g.value.name),1),l[23]||(l[23]=e.createElementVNode("div",{class:"expander"},null,-1)),e.createVNode(d,{"icon-class":"cross"})]),e.createVNode(e.unref(_.ContextMenuSeparator)),g.value.level===2?(e.openBlock(),e.createElementBlock("div",ke,[e.createVNode(e.unref(i.ElRadioGroup),{modelValue:P.value,"onUpdate:modelValue":l[9]||(l[9]=a=>P.value=a),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[24]||(l[24]=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:A.value,"onUpdate:modelValue":l[10]||(l[10]=a=>A.value=a),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:p.value,"onUpdate:modelValue":l[11]||(l[11]=a=>p.value=a),step:1,min:0,max:19},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:f.value,"onUpdate:modelValue":l[12]||(l[12]=a=>f.value=a),step:1,min:4,max:e.unref(m.clamp)(p.value!==1?23-p.value:21,4,22)},null,8,["modelValue","max"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[13]||(l[13]=a=>oe(g.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[14]||(l[14]=a=>ne(g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.clearRow")),1)]),_:1})])):(e.openBlock(),e.createElementBlock("div",Ce,[e.createElementVNode("div",null,e.toDisplayString(K(g.value.day,g.value.ids)),1),l[25]||(l[25]=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:p.value,"onUpdate:modelValue":l[15]||(l[15]=a=>p.value=a),step:1,min:0,max:19,onChange:l[16]||(l[16]=a=>X(g.value.day,g.value.ids))},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:f.value,"onUpdate:modelValue":l[17]||(l[17]=a=>f.value=a),step:1,min:4,max:e.unref(m.clamp)(p.value!==1?23-p.value:21,4,22),onChange:l[18]||(l[18]=a=>X(g.value.day,g.value.ids))},null,8,["modelValue","max"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[19]||(l[19]=a=>ue(g.value.day,g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.delete")),1)]),_:1})]))]),_:1},8,["show","options"])])}}};module.exports=xe;
package/dist/WorkTable.js CHANGED
@@ -1,9 +1,9 @@
1
- import { ref as g, watch as ye, computed as Me, resolveComponent as we, resolveDirective as Te, createElementBlock as z, openBlock as S, createElementVNode as k, createVNode as i, createCommentVNode as _, withDirectives as Be, createBlock as F, unref as a, withCtx as v, Fragment as ie, renderList as re, createTextVNode as V, toDisplayString as h, normalizeStyle as ze } from "vue";
1
+ import { ref as g, watch as ye, computed as Me, resolveComponent as we, resolveDirective as Te, createElementBlock as z, openBlock as S, createElementVNode as w, createVNode as i, createCommentVNode as le, withDirectives as Be, createBlock as F, unref as a, withCtx as v, Fragment as re, renderList as se, createTextVNode as D, toDisplayString as h, normalizeStyle as ze } from "vue";
2
2
  import { saveAs as Fe } from "file-saver";
3
3
  import * as Ye from "exceljs";
4
- import { p as G, b as se, h as Ue, c as ke, a as Ce, d as N } from "./index-2Mx6IUGl.js";
4
+ import { p as Z, b as ve, h as Ue, c as ke, a as Ce, d as N } from "./index-2Mx6IUGl.js";
5
5
  import { useI18n as He } from "vue-i18n";
6
- import { ElSelect as Ie, ElOption as Re, ElButton as T, ElSwitch as ve, ElSkeleton as We, ElTable as Pe, ElTableColumn as Y, ElSkeletonItem as L, ElDialog as je, ElForm as Oe, ElFormItem as Ge, ElRadioGroup as Le, ElRadioButton as ge, ElSlider as Z } from "element-plus";
6
+ import { ElSelect as Ie, ElOption as Re, ElButton as M, ElSwitch as ge, ElSkeleton as We, ElTable as Pe, ElTableColumn as Y, ElSkeletonItem as q, ElDialog as je, ElForm as Oe, ElFormItem as Ge, ElRadioGroup as Le, ElRadioButton as me, ElSlider as J } from "element-plus";
7
7
  import { ContextMenu as Ze, ContextMenuSeparator as qe } from "@imengyu/vue3-context-menu";
8
8
  const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "100px", width: "100%", display: "inline-block" } }, Xe = { style: { height: "100px", width: "100%", display: "inline-block" } }, _e = {
9
9
  key: 0,
@@ -25,8 +25,8 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
25
25
  group: String,
26
26
  date: String
27
27
  },
28
- setup(H) {
29
- const { t: d, d: q } = He(), c = H, J = g(!1), n = g([
28
+ setup(I) {
29
+ const { t: d, d: Q } = He(), c = I, K = g(!1), n = g([
30
30
  // { name: 'Иванов П.М. (Ведущий работник месяца)',
31
31
  // days: [], // {day: "2024-11-01", tips: '(9:00 - 18:00)', time: 8 }
32
32
  // contHour: 0,
@@ -39,154 +39,154 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
39
39
  // code: '0000-00052'
40
40
  // ids: 1
41
41
  // }
42
- ]), ee = g(c.date ? (/* @__PURE__ */ new Date(c.date + "T00:00:01")).getMonth() : (/* @__PURE__ */ new Date()).getMonth()), le = g(!1), I = g([]), f = g(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1)), u = g([]), R = g(0), C = g(9), y = g(8), Q = g(!1), me = g(!0), U = g(!1), te = g("5"), W = g(1), b = g([]), ae = g([]), A = g([]), K = g([]), p = g({ name: "Имя", length: 0, code: "" }), P = g(!1), ne = g({
42
+ ]), te = g(c.date ? (/* @__PURE__ */ new Date(c.date + "T00:00:01")).getMonth() : (/* @__PURE__ */ new Date()).getMonth()), ae = g(!1), R = g([]), f = g(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1)), u = g([]), W = g(0), k = g(9), y = g(8), X = g(!1), he = g(!0), U = g(!1), ne = g("5"), P = g(1), b = g([]), oe = g([]), A = g([]), _ = g([]), p = g({ name: "Имя", length: 0, code: "" }), j = g(!1), ue = g({
43
43
  zIndex: 3,
44
44
  minWidth: 230,
45
45
  x: 500,
46
46
  y: 200
47
- }), he = g({}), j = g("100%");
47
+ }), T = g({}), O = g("100%");
48
48
  ye(b, async (l, e) => {
49
- l !== e && (A.value = [], Q.value = !1, c.odata.personal.forEach((o) => {
49
+ l !== e && (A.value = [], X.value = !1, c.odata.personal.forEach((o) => {
50
50
  l.includes(o.divisionName) && (A.value.some((r) => (r == null ? void 0 : r.activeText) === o.roleName) || A.value.push({ val: !0, activeText: o.roleName }));
51
- }), oe());
52
- }), ye(ee, async (l) => {
51
+ }), de());
52
+ }), ye(te, async (l) => {
53
53
  let e = (/* @__PURE__ */ new Date()).getMonth(), o = l === null ? e : l - 1;
54
54
  o = e - 1 <= o ? o - e >= 11 ? o - 12 : o : o + 12, f.value = new Date((/* @__PURE__ */ new Date()).getFullYear(), o, 1), ce();
55
55
  });
56
56
  const xe = (l, e, o, r) => {
57
- p.value.ids = l.ids, p.value.key = l.key, p.value.add = l.days.length > 0 && l.days[l.days.length - 1].cont, p.value.level = e.level, p.value.day = o.cellIndex, ne.value.y = r.clientY, ne.value.x = r.clientX, e.level === 2 && e.no === 0 && c.checkEdit && (p.value.name = d("workSchedule.autocomplete"), P.value = !0), e.level === 3 && o.cellIndex - e.no === 1 && c.checkEdit && (B(o.cellIndex, l.ids), p.value.name = d("workSchedule.modeSelection"), P.value = !0);
57
+ p.value.ids = l.ids, p.value.key = l.key, p.value.add = l.days.length > 0 && l.days[l.days.length - 1].cont, p.value.level = e.level, p.value.day = o.cellIndex, ue.value.y = r.clientY, ue.value.x = r.clientX, e.level === 2 && e.no === 0 && c.checkEdit && (p.value.name = d("workSchedule.autocomplete"), j.value = !0), e.level === 3 && o.cellIndex - e.no === 1 && c.checkEdit && (B(o.cellIndex, l.ids), p.value.name = d("workSchedule.modeSelection"), j.value = !0);
58
58
  }, Se = ({ row: l, columnIndex: e }) => {
59
- if (!I.value || I.value.length === 0 || !le.value) return "";
59
+ if (!R.value || R.value.length === 0 || !ae.value) return "";
60
60
  const o = new Date(new Date(f.value).getFullYear(), new Date(f.value).getMonth(), e).getTime() + 1e3;
61
- for (let r of I.value) {
62
- const { dateStart: m, dateEnd: t, code: x } = r;
63
- if (m && t && x === l.code && e !== 0 && e <= u.value.length) {
64
- const E = new Date(Ce(m)).getTime(), M = new Date(Ce(t)).getTime();
65
- if (o >= E && o <= M) return "vacation";
61
+ for (let r of R.value) {
62
+ const { dateStart: m, dateEnd: t, code: C } = r;
63
+ if (m && t && C === l.code && e !== 0 && e <= u.value.length) {
64
+ const V = new Date(Ce(m)).getTime(), x = new Date(Ce(t)).getTime();
65
+ if (o >= V && o <= x) return "vacation";
66
66
  }
67
67
  }
68
68
  return "";
69
69
  }, ce = () => {
70
- var t, x, E, M;
71
- const l = he.value, e = new Date(f.value), o = new Date(e.getFullYear(), e.getMonth() + 1, 0).getDate();
72
- let r = [], m = 0;
73
- for (let D = 1; D <= o; D++) {
74
- const s = G(e.setDate(D), "{Y}-{m}-{dd}");
75
- m += (t = l.nowork) != null && t.includes(s) || l.holidays.includes(s) ? 0 : (x = l.preholidays) != null && x.includes(s) ? 7 : 8;
76
- const w = (E = l.nowork) != null && E.includes(s) ? "nowork" : l.holidays.includes(s) ? "holiday" : (M = l.preholidays) != null && M.includes(s) ? "preholiday" : "";
77
- r.push({ day: D, holidays: w, weekday: q(new Date(e.getFullYear(), e.getMonth(), D), "day") });
70
+ var m, t, C, V;
71
+ const l = new Date(f.value), e = new Date(l.getFullYear(), l.getMonth() + 1, 0).getDate();
72
+ let o = [], r = 0;
73
+ for (let x = 1; x <= e; x++) {
74
+ const $ = Z(l.setDate(x), "{Y}-{m}-{dd}");
75
+ r += (m = T.value.nowork) != null && m.includes($) || T.value.holidays.includes($) ? 0 : (t = T.value.preholidays) != null && t.includes($) ? 7 : 8;
76
+ const s = (C = T.value.nowork) != null && C.includes($) ? "nowork" : T.value.holidays.includes($) ? "holiday" : (V = T.value.preholidays) != null && V.includes($) ? "preholiday" : "";
77
+ o.push({ day: x, holidays: s, weekday: Q(new Date(l.getFullYear(), l.getMonth(), x), "day") });
78
78
  }
79
- R.value = m, u.value = r, c.odata.getPersonal({ dismissed: "false" }).then((D) => {
80
- var s;
81
- b.value.length === 0 && (b.value = [(s = D.find((w) => w.employeeName === c.fullName)) == null ? void 0 : s.divisionName]), D.forEach((w, ue) => {
82
- ae.value.some(($) => w.dismissalDate.length > 0 && new Date(w.dismissalDate) < new Date(f.value) || ($ == null ? void 0 : $.value) === w.divisionName) || ae.value.push({ value: w.divisionName, label: w.divisionName, key: ue }), b.value.includes(w.divisionName) && !A.value.some(($) => ($ == null ? void 0 : $.activeText) === w.roleName) && A.value.push({ val: !0, activeText: w.roleName });
83
- }), oe(), me.value = !1;
79
+ W.value = r, u.value = o, c.odata.getPersonal({ dismissed: "false" }).then((x) => {
80
+ var $;
81
+ b.value.length === 0 && (b.value = [($ = x.find((s) => s.employeeName === c.fullName && s.dismissalDate.length === 0)) == null ? void 0 : $.divisionName]), x.forEach((s, H) => {
82
+ oe.value.some((E) => s.dismissalDate.length > 0 && new Date(s.dismissalDate) < new Date(f.value) || (E == null ? void 0 : E.value) === s.divisionName) || oe.value.push({ value: s.divisionName, label: s.divisionName, key: H }), b.value.includes(s.divisionName) && !A.value.some((E) => (E == null ? void 0 : E.activeText) === s.roleName) && A.value.push({ val: !0, activeText: s.roleName });
83
+ }), de(), he.value = !1;
84
84
  });
85
- }, $e = Me(() => !n.value.some((l) => l.contHour !== R.value)), pe = (l, e) => {
86
- var t, x, E;
87
- const o = new Date(f.value), r = `${o.getFullYear()}-${(o.getMonth() + 1).toString().padStart(2, "0")}-${l.toString().padStart(2, "0")}`, m = (t = n.value[e]) == null ? void 0 : t.days.findIndex((M) => M.day === r);
88
- return e === -1 || m === -1 ? "" : ((x = n.value[e].days[m]) == null ? void 0 : x.tips) + `
89
- ` + ((E = n.value[e].days[m]) == null ? void 0 : E.time);
90
- }, oe = () => {
91
- n.value = [], K.value = [], I.value = [], c.odata.personal.forEach((l) => {
85
+ }, $e = Me(() => !n.value.some((l) => l.contHour !== W.value)), pe = (l, e) => {
86
+ var t, C, V;
87
+ const o = new Date(f.value), r = `${o.getFullYear()}-${(o.getMonth() + 1).toString().padStart(2, "0")}-${l.toString().padStart(2, "0")}`, m = (t = n.value[e]) == null ? void 0 : t.days.findIndex((x) => x.day === r);
88
+ return e === -1 || m === -1 ? "" : ((C = n.value[e].days[m]) == null ? void 0 : C.tips) + `
89
+ ` + ((V = n.value[e].days[m]) == null ? void 0 : V.time);
90
+ }, de = () => {
91
+ n.value = [], _.value = [], R.value = [], c.odata.personal.forEach((l) => {
92
92
  if (b.value.includes(l.divisionName) && A.value.some((e) => e.val && e.activeText === l.roleName) && (l.dismissalDate.length === 0 || new Date(l.dismissalDate) > new Date(f.value))) {
93
- let e = se(l.employeeName);
93
+ let e = ve(l.employeeName);
94
94
  n.value.push({ name: e + " (" + l.roleName + ")", days: [], contHour: 0, code: l.employeeKey, id: !1 });
95
95
  }
96
96
  }), n.value.sort((l, e) => l.name < e.name ? -1 : l.name > e.name ? 1 : 0), n.value.forEach((l, e) => {
97
- l.ids = e, K.value.push(l.code);
98
- }), c.workSchedule.getUsersYear({ code: K.value, year: new Date(f.value).getFullYear() }).then((l) => {
97
+ l.ids = e, _.value.push(l.code);
98
+ }), c.workSchedule.getUsersYear({ code: _.value, year: new Date(f.value).getFullYear() }).then((l) => {
99
99
  l.forEach((e) => {
100
- e.dateStart && I.value.push({ code: e.code, dateStart: e.dateStart, dateEnd: e.dateEnd });
100
+ e.dateStart && R.value.push({ code: e.code, dateStart: e.dateStart, dateEnd: e.dateEnd });
101
101
  }), be(), U.value = !1;
102
102
  });
103
103
  }, be = () => {
104
- c.workSchedule.getWorkSchedule({ code: K.value, date: G(new Date(f.value), "{Y}-{m}-{dd}") }).then(
104
+ c.workSchedule.getWorkSchedule({ code: _.value, date: Z(new Date(f.value), "{Y}-{m}-{dd}") }).then(
105
105
  (l) => {
106
106
  l.forEach((e, o) => {
107
107
  e !== null && (n.value[o].days = e.data.days, n.value[o].id = e.id);
108
- }), O();
108
+ }), G();
109
109
  }
110
110
  );
111
- }, O = () => {
111
+ }, G = () => {
112
112
  n.value.forEach((l) => {
113
113
  l.contHour = l.days.reduce((e, o) => e + o.time, 0);
114
114
  });
115
115
  }, De = (l) => {
116
- n.value[l].days = [], O();
116
+ n.value[l].days = [], G();
117
117
  }, Ve = (l) => {
118
- switch (te.value) {
118
+ switch (ne.value) {
119
119
  case "5":
120
- for (let e = W.value; e <= u.value.length; e++)
120
+ for (let e = P.value; e <= u.value.length; e++)
121
121
  u.value[e - 1].holidays === "" && B(e, l, !0), u.value[e - 1].holidays === "preholiday" && (y.value -= 1, B(e, l, !0), y.value += 1);
122
122
  break;
123
123
  case "2x2":
124
- for (let e = W.value; e <= u.value.length; e += 4)
124
+ for (let e = P.value; e <= u.value.length; e += 4)
125
125
  B(e, l, !0), e + 1 <= u.value.length && B(e + 1, l, !0);
126
126
  break;
127
127
  case "2x5":
128
- for (let e = W.value; e <= u.value.length; e += 7)
128
+ for (let e = P.value; e <= u.value.length; e += 7)
129
129
  for (let o = e; o < e + 5 && o <= u.value.length; o++)
130
130
  u.value[o - 1].holidays === "preholiday" ? (y.value -= 1, B(o, l, !0), y.value += 1) : B(o, l, !0);
131
131
  break;
132
132
  }
133
133
  }, B = (l, e, o = !1) => {
134
- const { date: r, ind: m } = X(l, e);
134
+ const { date: r, ind: m } = ee(l, e);
135
135
  m === -1 ? (n.value[e].days.push({
136
136
  day: r,
137
137
  time: y.value,
138
- tips: `(${C.value}:00 - ${y.value >= 22 ? C.value + y.value + 2 : C.value + y.value + 1}:00)`
139
- }), O()) : o || (y.value = n.value[e].days[m].time, C.value = parseInt(n.value[e].days[m].tips.slice(1, -12)));
138
+ tips: `(${k.value}:00 - ${y.value >= 22 ? k.value + y.value + 2 : k.value + y.value + 1}:00)`
139
+ }), G()) : o || (y.value = n.value[e].days[m].time, k.value = parseInt(n.value[e].days[m].tips.slice(1, -12)));
140
140
  }, Ee = (l, e) => {
141
- const { ind: o } = X(l, e);
142
- n.value[e].days.splice(o, 1), O(), document.querySelector(".app-main").click();
141
+ const { ind: o } = ee(l, e);
142
+ n.value[e].days.splice(o, 1), G(), document.querySelector(".app-main").click();
143
143
  }, fe = (l, e) => {
144
- const { date: o, ind: r } = X(l, e);
144
+ const { date: o, ind: r } = ee(l, e);
145
145
  n.value[e].days[r] = {
146
146
  day: o,
147
147
  time: y.value,
148
- tips: `(${C.value}:00 - ${y.value >= 22 ? C.value + y.value + 2 : C.value + y.value + 1}:00)`
149
- }, O();
150
- }, X = (l, e) => {
148
+ tips: `(${k.value}:00 - ${y.value >= 22 ? k.value + y.value + 2 : k.value + y.value + 1}:00)`
149
+ }, G();
150
+ }, ee = (l, e) => {
151
151
  var m;
152
- const o = G(new Date(f.value).setDate(l), "{Y}-{m}-{dd}"), r = (m = n.value[e]) == null ? void 0 : m.days.findIndex((t) => t.day === o);
152
+ const o = Z(new Date(f.value).setDate(l), "{Y}-{m}-{dd}"), r = (m = n.value[e]) == null ? void 0 : m.days.findIndex((t) => t.day === o);
153
153
  return { date: o, ind: r };
154
154
  }, Ne = async () => {
155
- var D;
156
- J.value = !0;
157
- const l = new Ye.Workbook(), e = l.addWorksheet(q(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" } }, m = { vertical: "middle", horizontal: "center", wrapText: !0 };
158
- e.mergeCells(`A1:${N("A1", u.value.length + 5)}1`), e.mergeCells(`A2:${N("A2", u.value.length + 5)}2`), e.mergeCells("A3:A4"), e.mergeCells(`B3:${N("B3", u.value.length)}3`), e.mergeCells(`${N("B3", u.value.length + 1)}3:${N("B3", u.value.length + 2)}3`), e.mergeCells(`${N("B3", u.value.length + 3)}3:${N("B4", u.value.length + 3)}4`), e.mergeCells(`${N("B3", u.value.length + 4)}3:${N("B4", u.value.length + 4)}4`), e.getCell("A1").value = d("workSchedule.firm"), e.getCell("A2").value = d("workSchedule.title", { name: b.value[0] }) + q(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")} (${R.value})`;
155
+ var $;
156
+ K.value = !0;
157
+ const l = new Ye.Workbook(), e = l.addWorksheet(Q(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" } }, m = { vertical: "middle", horizontal: "center", wrapText: !0 };
158
+ e.mergeCells(`A1:${N("A1", u.value.length + 5)}1`), e.mergeCells(`A2:${N("A2", u.value.length + 5)}2`), e.mergeCells("A3:A4"), e.mergeCells(`B3:${N("B3", u.value.length)}3`), e.mergeCells(`${N("B3", u.value.length + 1)}3:${N("B3", u.value.length + 2)}3`), e.mergeCells(`${N("B3", u.value.length + 3)}3:${N("B4", u.value.length + 3)}4`), e.mergeCells(`${N("B3", u.value.length + 4)}3:${N("B4", u.value.length + 4)}4`), e.getCell("A1").value = d("workSchedule.firm"), e.getCell("A2").value = d("workSchedule.title", { name: b.value[0] }) + Q(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")} (${W.value})`;
159
159
  for (let s = 2; s <= u.value.length + 1; s++)
160
160
  e.getCell(4, s).value = u.value[s - 2].weekday + `
161
161
  ` + (s - 1), e.getColumn(s).width = 6, e.getColumn(s).alignment = m, e.getCell(4, s).border = r;
162
162
  e.getRow(1).height = 40, e.getRow(2).height = 30, e.getRow(3).height = 20, e.getColumn(1).width = 15, e.getColumn(u.value.length + 2).width = 5, e.getColumn(u.value.length + 3).width = 6, e.getColumn(u.value.length + 4).width = 13, e.getColumn(u.value.length + 5).width = 13, e.getColumn(1).alignment = m, e.getCell("A2").alignment = o, e.getCell("A3").alignment = o, e.getCell("B3").alignment = o, e.getCell(3, u.value.length + 2).alignment = o, e.getColumn(u.value.length + 2).alignment = m, e.getColumn(u.value.length + 3).alignment = m, e.getColumn(u.value.length + 4).alignment = o, e.getColumn(u.value.length + 5).alignment = o, e.getCell("A3").border = r, e.getCell("B3").border = r, e.getCell(3, u.value.length + 2).border = r, e.getCell(4, u.value.length + 2).border = r, e.getCell(3, u.value.length + 4).border = r, e.getCell(3, u.value.length + 5).border = r, e.getCell(4, u.value.length + 3).border = r;
163
163
  let t = 0;
164
164
  for (const s of n.value) {
165
- let w = [s.name];
166
- for (let $ = 1; $ <= u.value.length; $++) {
167
- const { ind: de } = X($, t);
168
- de !== -1 ? w[$] = `${s.days[de].time} ${s.days[de].tips}` : w[$] = " ";
165
+ let H = [s.name];
166
+ for (let L = 1; L <= u.value.length; L++) {
167
+ const { ind: ie } = ee(L, t);
168
+ ie !== -1 ? H[L] = `${s.days[ie].time} ${s.days[ie].tips}` : H[L] = " ";
169
169
  }
170
- w.push(((D = s.days) == null ? void 0 : D.length) || " ", s.contHour || 0);
171
- const ue = e.addRow(w);
172
- ue.border = r, t++;
170
+ H.push((($ = s.days) == null ? void 0 : $.length) || " ", s.contHour || 0);
171
+ const E = e.addRow(H);
172
+ E.border = r, t++;
173
173
  }
174
- let x = "Щербина Е. В.";
174
+ let C = "Щербина Е. В.";
175
175
  c.odata.personal.forEach((s) => {
176
- s.roleName === "Начальник отдела правовой и кадровой работы" && (x = s.employeeName);
177
- }), 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 = se(c.fullName), e.getCell(`AD${n.value.length + 8}`).value = se(x), 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" } };
178
- const E = "export_" + G(Date.now(), "{dd}.{m}.{Y}") + ".xlsx", M = await l.xlsx.writeBuffer();
179
- Fe(new Blob([M]), E), J.value = !1;
176
+ s.roleName === "Начальник отдела правовой и кадровой работы" && (C = s.employeeName);
177
+ }), 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 = ve(c.fullName), e.getCell(`AD${n.value.length + 8}`).value = ve(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" } };
178
+ const V = "export_" + Z(Date.now(), "{dd}.{m}.{Y}") + ".xlsx", x = await l.xlsx.writeBuffer();
179
+ Fe(new Blob([x]), V), K.value = !1;
180
180
  }, Ae = async () => {
181
- Q.value || c.workSchedule.addWorkSchedule({ data: n.value, date: G(new Date(f.value), "{Y}-{m}-{dd}"), group: b.value[0] }).then((l) => Q.value = l);
181
+ X.value || c.workSchedule.addWorkSchedule({ data: n.value, date: Z(new Date(f.value), "{Y}-{m}-{dd}"), group: b.value[0] }).then((l) => X.value = l);
182
182
  };
183
183
  return console.log("props.group", c.group), console.log("props.date", c.date), c.group && (b.value[0] = c.group), c.date && (f.value = /* @__PURE__ */ new Date(c.date + "T00:00:01")), Ue().then((l) => {
184
- he.value = l, ce();
184
+ T.value = l, ce();
185
185
  }), (l, e) => {
186
186
  const o = we("el-date-picker"), r = we("svg-icon"), m = Te("loading");
187
187
  return S(), z("div", Je, [
188
- k("div", Qe, [
189
- H.checkEdit ? (S(), F(a(Ie), {
188
+ w("div", Qe, [
189
+ I.checkEdit ? (S(), F(a(Ie), {
190
190
  key: 0,
191
191
  modelValue: b.value,
192
192
  "onUpdate:modelValue": e[0] || (e[0] = (t) => b.value = t),
@@ -197,43 +197,43 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
197
197
  style: { width: "240px" }
198
198
  }, {
199
199
  default: v(() => [
200
- (S(!0), z(ie, null, re(ae.value, (t) => (S(), F(a(Re), {
200
+ (S(!0), z(re, null, se(oe.value, (t) => (S(), F(a(Re), {
201
201
  key: t.key,
202
202
  label: t.label,
203
203
  value: t.value
204
204
  }, null, 8, ["label", "value"]))), 128))
205
205
  ]),
206
206
  _: 1
207
- }, 8, ["modelValue"])) : _("", !0),
208
- H.checkEdit ? (S(), F(a(T), {
207
+ }, 8, ["modelValue"])) : le("", !0),
208
+ I.checkEdit ? (S(), F(a(M), {
209
209
  key: 1,
210
210
  plain: "",
211
211
  onClick: e[1] || (e[1] = (t) => U.value = !0)
212
212
  }, {
213
213
  default: v(() => [
214
- V(h(a(d)("workSchedule.jobTitle")), 1)
214
+ D(h(a(d)("workSchedule.jobTitle")), 1)
215
215
  ]),
216
216
  _: 1
217
- })) : _("", !0),
217
+ })) : le("", !0),
218
218
  i(o, {
219
- modelValue: ee.value,
220
- "onUpdate:modelValue": e[2] || (e[2] = (t) => ee.value = t),
219
+ modelValue: te.value,
220
+ "onUpdate:modelValue": e[2] || (e[2] = (t) => te.value = t),
221
221
  type: "month",
222
222
  placeholder: "Выберите месяц",
223
223
  format: "MMM",
224
224
  "value-format": "M"
225
225
  }, null, 8, ["modelValue"]),
226
- e[21] || (e[21] = k("div", { class: "expander" }, null, -1)),
227
- i(a(ve), {
228
- modelValue: j.value,
229
- "onUpdate:modelValue": e[3] || (e[3] = (t) => j.value = t),
226
+ e[21] || (e[21] = w("div", { class: "expander" }, null, -1)),
227
+ i(a(ge), {
228
+ modelValue: O.value,
229
+ "onUpdate:modelValue": e[3] || (e[3] = (t) => O.value = t),
230
230
  "active-text": l.$t("bids.currentHeight"),
231
231
  "active-value": "100%",
232
232
  "inactive-value": "calc(100vh - var(--el-component-size)*5 - var(--el-main-padding)*2 - var(--header-height))"
233
233
  }, null, 8, ["modelValue", "active-text"]),
234
- i(a(ve), {
235
- modelValue: le.value,
236
- "onUpdate:modelValue": e[4] || (e[4] = (t) => le.value = t),
234
+ i(a(ge), {
235
+ modelValue: ae.value,
236
+ "onUpdate:modelValue": e[4] || (e[4] = (t) => ae.value = t),
237
237
  "active-text": "Отпуска",
238
238
  "active-value": !0,
239
239
  "inactive-value": !1
@@ -241,27 +241,27 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
241
241
  ]),
242
242
  i(a(We), {
243
243
  style: { width: "100%" },
244
- loading: me.value,
244
+ loading: he.value,
245
245
  animated: ""
246
246
  }, {
247
247
  template: v(() => [
248
- i(a(L), {
248
+ i(a(q), {
249
249
  variant: "text",
250
250
  style: { width: "100%", height: "2rem" }
251
251
  }),
252
- i(a(L), {
252
+ i(a(q), {
253
253
  variant: "text",
254
254
  style: { width: "180px", height: "4rem", "margin-right": "4px" }
255
255
  }),
256
- i(a(L), {
256
+ i(a(q), {
257
257
  variant: "text",
258
258
  style: { width: "calc( 100% - 184px)", height: "4rem" }
259
259
  }),
260
- i(a(L), {
260
+ i(a(q), {
261
261
  variant: "text",
262
262
  style: { width: "180px", height: "8rem", "margin-right": "4px" }
263
263
  }),
264
- i(a(L), {
264
+ i(a(q), {
265
265
  variant: "text",
266
266
  style: { width: "calc( 100% - 184px)", height: "8rem" }
267
267
  })
@@ -271,7 +271,7 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
271
271
  id: "printTable",
272
272
  data: n.value,
273
273
  style: { width: "100%" },
274
- "max-height": j.value,
274
+ "max-height": O.value,
275
275
  size: "small",
276
276
  align: "center",
277
277
  onCellClick: xe,
@@ -280,7 +280,7 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
280
280
  }, {
281
281
  default: v(() => [
282
282
  i(a(Y), {
283
- label: a(d)("workSchedule.title", { name: b.value[0] }) + a(q)(f.value, "month") + ` ${new Date(f.value).getFullYear()}`,
283
+ label: a(d)("workSchedule.title", { name: b.value[0] }) + a(Q)(f.value, "month") + ` ${new Date(f.value).getFullYear()}`,
284
284
  align: "center",
285
285
  height: "34"
286
286
  }, {
@@ -289,10 +289,10 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
289
289
  label: a(d)("workSchedule.month"),
290
290
  width: "180",
291
291
  align: "center",
292
- fixed: j.value !== "100%"
292
+ fixed: O.value !== "100%"
293
293
  }, {
294
294
  default: v((t) => [
295
- k("div", Ke, h(n.value[t.$index].name), 1)
295
+ w("div", Ke, h(n.value[t.$index].name), 1)
296
296
  ]),
297
297
  _: 1
298
298
  }, 8, ["label", "fixed"]),
@@ -301,7 +301,7 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
301
301
  align: "center"
302
302
  }, {
303
303
  default: v(() => [
304
- (S(!0), z(ie, null, re(u.value, (t) => (S(), F(a(Y), {
304
+ (S(!0), z(re, null, se(u.value, (t) => (S(), F(a(Y), {
305
305
  key: t.day,
306
306
  width: "46",
307
307
  "class-name": t.holidays,
@@ -310,8 +310,8 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
310
310
  ` + t.day.toString(),
311
311
  prop: "vacation"
312
312
  }, {
313
- default: v((x) => [
314
- k("div", Xe, h(pe(t.day, x.$index) || " "), 1)
313
+ default: v((C) => [
314
+ w("div", Xe, h(pe(t.day, C.$index) || " "), 1)
315
315
  ]),
316
316
  _: 2
317
317
  }, 1032, ["class-name", "label"]))), 128))
@@ -321,7 +321,7 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
321
321
  i(a(Y), {
322
322
  label: a(d)("workSchedule.onSchedule"),
323
323
  align: "center",
324
- fixed: j.value !== "100%" ? "right" : !1
324
+ fixed: O.value !== "100%" ? "right" : !1
325
325
  }, {
326
326
  default: v(() => [
327
327
  i(a(Y), {
@@ -329,17 +329,17 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
329
329
  align: "center"
330
330
  }, {
331
331
  default: v((t) => [
332
- V(h(n.value[t.$index].days.length || 0), 1)
332
+ D(h(n.value[t.$index].days.length || 0), 1)
333
333
  ]),
334
334
  _: 1
335
335
  }, 8, ["label"]),
336
336
  i(a(Y), {
337
- label: `${a(d)("workSchedule.hours")} ( ${R.value} )`,
337
+ label: `${a(d)("workSchedule.hours")} ( ${W.value} )`,
338
338
  align: "center"
339
339
  }, {
340
340
  default: v((t) => [
341
- k("div", {
342
- style: ze(`color: ${R.value === t.row.contHour ? "green" : "red"};`)
341
+ w("div", {
342
+ style: ze(`color: ${W.value === t.row.contHour ? "green" : "red"};`)
343
343
  }, h(t.row.contHour), 5)
344
344
  ]),
345
345
  _: 1
@@ -356,33 +356,33 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
356
356
  ]),
357
357
  _: 1
358
358
  }, 8, ["loading"]),
359
- $e.value && H.checkEdit ? (S(), z("div", _e, [
360
- V(h(a(d)("workSchedule.chartsFilled")) + ": ", 1),
361
- Q.value ? _("", !0) : (S(), F(a(T), {
359
+ $e.value && I.checkEdit ? (S(), z("div", _e, [
360
+ D(h(a(d)("workSchedule.chartsFilled")) + ": ", 1),
361
+ X.value ? le("", !0) : (S(), F(a(M), {
362
362
  key: 0,
363
363
  type: "primary",
364
364
  onClick: Ae
365
365
  }, {
366
366
  default: v(() => [
367
- V(h(a(d)("workSchedule.confirm")), 1)
367
+ D(h(a(d)("workSchedule.confirm")), 1)
368
368
  ]),
369
369
  _: 1
370
370
  })),
371
- e[22] || (e[22] = V()),
372
- k("span", null, h(H.fullName), 1)
373
- ])) : _("", !0),
374
- Be((S(), F(a(T), {
375
- disabled: J.value,
371
+ e[22] || (e[22] = D()),
372
+ w("span", null, h(I.fullName), 1)
373
+ ])) : le("", !0),
374
+ Be((S(), F(a(M), {
375
+ disabled: K.value,
376
376
  plain: "",
377
377
  onClick: Ne,
378
378
  style: { "margin-top": ".5rem" }
379
379
  }, {
380
380
  default: v(() => [
381
- V(h(a(d)("workSchedule.exportExcel")), 1)
381
+ D(h(a(d)("workSchedule.exportExcel")), 1)
382
382
  ]),
383
383
  _: 1
384
384
  }, 8, ["disabled"])), [
385
- [m, J.value]
385
+ [m, K.value]
386
386
  ]),
387
387
  i(a(je), {
388
388
  title: a(d)("workSchedule.jobTitle"),
@@ -391,24 +391,24 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
391
391
  width: "400px"
392
392
  }, {
393
393
  footer: v(() => [
394
- i(a(T), {
394
+ i(a(M), {
395
395
  onClick: e[5] || (e[5] = (t) => U.value = !1),
396
396
  size: "default"
397
397
  }, {
398
398
  default: v(() => [
399
- V(h(l.$t("workSchedule.cancel")), 1)
399
+ D(h(l.$t("workSchedule.cancel")), 1)
400
400
  ]),
401
401
  _: 1
402
402
  }),
403
- i(a(T), {
403
+ i(a(M), {
404
404
  size: "default",
405
405
  type: "primary",
406
406
  onClick: e[6] || (e[6] = (t) => {
407
- oe(), U.value = !1;
407
+ de(), U.value = !1;
408
408
  })
409
409
  }, {
410
410
  default: v(() => [
411
- V(h(l.$t("workSchedule.select")), 1)
411
+ D(h(l.$t("workSchedule.select")), 1)
412
412
  ]),
413
413
  _: 1
414
414
  })
@@ -420,11 +420,11 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
420
420
  autocomplete: "on"
421
421
  }, {
422
422
  default: v(() => [
423
- (S(!0), z(ie, null, re(A.value, (t) => (S(), F(a(Ge), null, {
423
+ (S(!0), z(re, null, se(A.value, (t) => (S(), F(a(Ge), null, {
424
424
  default: v(() => [
425
- i(a(ve), {
425
+ i(a(ge), {
426
426
  modelValue: t.val,
427
- "onUpdate:modelValue": (x) => t.val = x,
427
+ "onUpdate:modelValue": (C) => t.val = C,
428
428
  "active-text": t.activeText
429
429
  }, null, 8, ["modelValue", "onUpdate:modelValue", "active-text"])
430
430
  ]),
@@ -437,115 +437,115 @@ const Je = { class: "work" }, Qe = { class: "nav" }, Ke = { style: { height: "10
437
437
  _: 1
438
438
  }, 8, ["title", "modelValue"]),
439
439
  i(a(Ze), {
440
- show: P.value,
441
- "onUpdate:show": e[20] || (e[20] = (t) => P.value = t),
442
- options: ne.value
440
+ show: j.value,
441
+ "onUpdate:show": e[20] || (e[20] = (t) => j.value = t),
442
+ options: ue.value
443
443
  }, {
444
444
  default: v(() => [
445
- k("div", {
445
+ w("div", {
446
446
  class: "mx-context-menu-item",
447
- onClick: e[8] || (e[8] = (t) => P.value = !1)
447
+ onClick: e[8] || (e[8] = (t) => j.value = !1)
448
448
  }, [
449
- k("span", el, h(p.value.name), 1),
450
- e[23] || (e[23] = k("div", { class: "expander" }, null, -1)),
449
+ w("span", el, h(p.value.name), 1),
450
+ e[23] || (e[23] = w("div", { class: "expander" }, null, -1)),
451
451
  i(r, { "icon-class": "cross" })
452
452
  ]),
453
453
  i(a(qe)),
454
454
  p.value.level === 2 ? (S(), z("div", ll, [
455
455
  i(a(Le), {
456
- modelValue: te.value,
457
- "onUpdate:modelValue": e[9] || (e[9] = (t) => te.value = t),
456
+ modelValue: ne.value,
457
+ "onUpdate:modelValue": e[9] || (e[9] = (t) => ne.value = t),
458
458
  size: "small"
459
459
  }, {
460
460
  default: v(() => [
461
- i(a(ge), {
461
+ i(a(me), {
462
462
  label: a(d)("workSchedule.Days5"),
463
463
  value: "5"
464
464
  }, null, 8, ["label"]),
465
- i(a(ge), {
465
+ i(a(me), {
466
466
  label: "2 Х 2",
467
467
  value: "2x2"
468
468
  }),
469
- i(a(ge), {
469
+ i(a(me), {
470
470
  label: "2 Х 5",
471
471
  value: "2x5"
472
472
  })
473
473
  ]),
474
474
  _: 1
475
475
  }, 8, ["modelValue"]),
476
- e[24] || (e[24] = k("br", null, null, -1)),
477
- k("span", null, h(a(d)("workSchedule.fromDate")) + ":", 1),
478
- i(a(Z), {
479
- modelValue: W.value,
480
- "onUpdate:modelValue": e[10] || (e[10] = (t) => W.value = t),
476
+ e[24] || (e[24] = w("br", null, null, -1)),
477
+ w("span", null, h(a(d)("workSchedule.fromDate")) + ":", 1),
478
+ i(a(J), {
479
+ modelValue: P.value,
480
+ "onUpdate:modelValue": e[10] || (e[10] = (t) => P.value = t),
481
481
  step: 1,
482
482
  min: 1,
483
483
  max: u.value.length
484
484
  }, null, 8, ["modelValue", "max"]),
485
- k("span", null, h(a(d)("workSchedule.with")) + ":", 1),
486
- i(a(Z), {
487
- modelValue: C.value,
488
- "onUpdate:modelValue": e[11] || (e[11] = (t) => C.value = t),
485
+ w("span", null, h(a(d)("workSchedule.with")) + ":", 1),
486
+ i(a(J), {
487
+ modelValue: k.value,
488
+ "onUpdate:modelValue": e[11] || (e[11] = (t) => k.value = t),
489
489
  step: 1,
490
490
  min: 0,
491
491
  max: 19
492
492
  }, null, 8, ["modelValue"]),
493
- k("span", null, h(a(d)("workSchedule.duration")) + ":", 1),
494
- i(a(Z), {
493
+ w("span", null, h(a(d)("workSchedule.duration")) + ":", 1),
494
+ i(a(J), {
495
495
  modelValue: y.value,
496
496
  "onUpdate:modelValue": e[12] || (e[12] = (t) => y.value = t),
497
497
  step: 1,
498
498
  min: 4,
499
- max: a(ke)(C.value !== 1 ? 23 - C.value : 21, 4, 22)
499
+ max: a(ke)(k.value !== 1 ? 23 - k.value : 21, 4, 22)
500
500
  }, null, 8, ["modelValue", "max"]),
501
- i(a(T), {
501
+ i(a(M), {
502
502
  style: { "margin-top": ".5rem" },
503
503
  size: "small",
504
504
  onClick: e[13] || (e[13] = (t) => Ve(p.value.ids))
505
505
  }, {
506
506
  default: v(() => [
507
- V(h(a(d)("workSchedule.fillOut")), 1)
507
+ D(h(a(d)("workSchedule.fillOut")), 1)
508
508
  ]),
509
509
  _: 1
510
510
  }),
511
- i(a(T), {
511
+ i(a(M), {
512
512
  style: { "margin-top": ".5rem" },
513
513
  size: "small",
514
514
  onClick: e[14] || (e[14] = (t) => De(p.value.ids))
515
515
  }, {
516
516
  default: v(() => [
517
- V(h(a(d)("workSchedule.clearRow")), 1)
517
+ D(h(a(d)("workSchedule.clearRow")), 1)
518
518
  ]),
519
519
  _: 1
520
520
  })
521
521
  ])) : (S(), z("div", tl, [
522
- k("div", null, h(pe(p.value.day, p.value.ids)), 1),
523
- e[25] || (e[25] = k("br", null, null, -1)),
524
- k("span", null, h(a(d)("workSchedule.with")) + ":", 1),
525
- i(a(Z), {
526
- modelValue: C.value,
527
- "onUpdate:modelValue": e[15] || (e[15] = (t) => C.value = t),
522
+ w("div", null, h(pe(p.value.day, p.value.ids)), 1),
523
+ e[25] || (e[25] = w("br", null, null, -1)),
524
+ w("span", null, h(a(d)("workSchedule.with")) + ":", 1),
525
+ i(a(J), {
526
+ modelValue: k.value,
527
+ "onUpdate:modelValue": e[15] || (e[15] = (t) => k.value = t),
528
528
  step: 1,
529
529
  min: 0,
530
530
  max: 19,
531
531
  onChange: e[16] || (e[16] = (t) => fe(p.value.day, p.value.ids))
532
532
  }, null, 8, ["modelValue"]),
533
- k("span", null, h(a(d)("workSchedule.duration")) + ":", 1),
534
- i(a(Z), {
533
+ w("span", null, h(a(d)("workSchedule.duration")) + ":", 1),
534
+ i(a(J), {
535
535
  modelValue: y.value,
536
536
  "onUpdate:modelValue": e[17] || (e[17] = (t) => y.value = t),
537
537
  step: 1,
538
538
  min: 4,
539
- max: a(ke)(C.value !== 1 ? 23 - C.value : 21, 4, 22),
539
+ max: a(ke)(k.value !== 1 ? 23 - k.value : 21, 4, 22),
540
540
  onChange: e[18] || (e[18] = (t) => fe(p.value.day, p.value.ids))
541
541
  }, null, 8, ["modelValue", "max"]),
542
- i(a(T), {
542
+ i(a(M), {
543
543
  style: { "margin-top": ".5rem" },
544
544
  size: "small",
545
545
  onClick: e[19] || (e[19] = (t) => Ee(p.value.day, p.value.ids))
546
546
  }, {
547
547
  default: v(() => [
548
- V(h(a(d)("workSchedule.delete")), 1)
548
+ D(h(a(d)("workSchedule.delete")), 1)
549
549
  ]),
550
550
  _: 1
551
551
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studio-west/employees",
3
- "version": "0.6.59",
3
+ "version": "0.6.60",
4
4
  "files": [
5
5
  "dist"
6
6
  ],