@studio-west/employees 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";const e=require("vue"),S=require("./index-CHGzf-XH.cjs"),G=require("vue-i18n"),u=require("element-plus"),z=require("@imengyu/vue3-context-menu"),O=(D,E)=>{const r=D.__vccOpts||D;for(const[k,v]of E)r[k]=v;return r},R={class:"wrapper"},P={class:"month_year"},A={class:"text"},J={class:"week"},W={class:"month"},X=["onClick"],H={key:0},K={class:"month_year"},Z={class:"text"},Q={class:"week"},ee={class:"month"},te=["onClick"],ae={__name:"DataPicker",props:{data:Object,range:{type:String,default:()=>"solid"}},emits:["init"],setup(D,{emit:E}){var L,I,U,q;const r=e.ref(new Date),k=e.ref(new Date),v=D,F=E,y=e.ref(new Date().getFullYear()),b=e.ref(new Date().getMonth()),_=e.ref(new Date().getFullYear()),f=e.ref(new Date().getMonth()),d=e.ref([]),B=e.ref(0),$=e.ref(0),g=e.ref(-1),x=e.ref(-1),{locale:Y}=G.useI18n(),T=/en|zh|ja|he/.test(Y.value)?0:1,j=s=>{const o=s.split(s.match(/\D.*?\D?/));return o[0].length>2?o.join("-")+"T00:00:01":o.reverse().join("-")+"T00:00:01"};typeof((L=v.data)==null?void 0:L.startDate)<"u"&&(r.value=new Date(j(v.data.startDate)),y.value=r.value.getFullYear(),f.value=r.value.getMonth()),typeof((I=v.data)==null?void 0:I.endDate)<"u"&&(k.value=new Date(j(v.data.endDate)),_.value=k.value.getFullYear(),b.value=k.value.getMonth());const w=()=>{let s=new Date(y.value,f.value,0);for(let n=s.getDate()-s.getDay()+T;n<=s.getDate()&&s.getDay()!==6+T;n++)B.value++,d.value.push({day:n,month:s.getMonth(),year:s.getFullYear(),class:[]});for(let n=1;n<=new Date(y.value,f.value+1,0).getDate();n++)B.value++,d.value.push({day:n,month:f.value,year:y.value,class:[]});if(v.range==="range"){$.value=new Date(y.value,f.value+2,0);for(let n=1;n<=$.value.getDate();n++)d.value.push({day:n,month:$.value.getMonth(),year:$.value.getFullYear(),class:[]})}let o=v.range==="range"?2:1,i=new Date(y.value,f.value+o,1);for(let n=1;n<=(7-i.getDay()+T)%7&&i.getDay()!==T;n++)d.value.push({day:n,month:i.getMonth(),year:i.getFullYear(),class:[]});v.data.holiday.length!==0&&(v.data.holiday.preholidays.forEach(n=>{let m=n.split("-");const N=d.value.findIndex(V=>V.year==m[0]&&V.month+1==m[1]&&V.day==m[2]);N!==-1&&(d.value[N].class[0]="preholiday")}),v.data.holiday.holidays.forEach(n=>{let m=n.split("-");const N=d.value.findIndex(V=>V.year==m[0]&&V.month+1==m[1]&&V.day==m[2]);N!==-1&&(d.value[N].class[0]="weekend")}),v.data.holiday.holiday.forEach(n=>{let m=n.split("-");const N=d.value.findIndex(V=>V.year==m[0]&&V.month+1==m[1]&&V.day==m[2]);N!==-1&&(d.value[N].class[0]="holiday")}),v.data.holiday.nowork.forEach(n=>{let m=n.split("-");const N=d.value.findIndex(V=>V.year==m[0]&&V.month+1==m[1]&&V.day==m[2]);N!==-1&&(d.value[N].class[0]="nowork")}))},M=(s,o)=>{let i=s-o+1;for(let n=0;n<=s-o;n++)d.value[n+o].class[0]==="holiday"&&i--;return i},c=(s,o)=>{const i=S.parseTime(new Date(s.year,s.month,s.day),"{dd}.{m}.{Y}");if(v.range==="range")if(console.log(g.value),x.value!==-1){if(x.value<=g.value)for(let n=x.value;n<=g.value;n++)d.value[n].class[1]="";else for(let n=g.value;n<=x.value;n++)d.value[n].class[1]="";g.value=o,x.value=-1,d.value[o].class[1]="active"}else if(g.value!==-1){if(x.value=o,x.value>=g.value)for(let m=g.value+1;m<o;m++)d.value[m].class[1]="select";else for(let m=o+1;m<g.value;m++)d.value[m].class[1]="select";d.value[o].class[1]="active";let n=S.parseTime(new Date(d.value[g.value].year,d.value[g.value].month,d.value[g.value].day),"{dd}.{m}.{Y}");g.value>o?F("input",{dateStart:i,dateEnd:n,count:M(g.value,o)}):F("input",{dateStart:n,dateEnd:i,count:M(o,g.value)})}else g.value=o,d.value[o].class[1]="active";else d.value[g.value].class[1]="",g.value=o,d.value[o].class[1]="active",F("input",{dateStart:i,count:1})};if(w(),typeof((U=v.data)==null?void 0:U.startDate)<"u"&&(g.value=d.value.findIndex(s=>s.day===r.value.getDate()&&s.month===f.value&&s.year===y.value),d.value[g.value].class[1]="active"),typeof((q=v.data)==null?void 0:q.endDate)<"u"&&v.range==="range"){x.value=d.value.findIndex(s=>s.day===k.value.getDate()&&s.month===b.value&&s.year===_.value),d.value[x.value].class[1]="active";for(let s=g.value+1;s<x.value;s++)d.value[s].class[1]="select"}const h=(s,o)=>{d.value=[],B.value=0,r.value=new Date(s,o,1),y.value=r.value.getFullYear(),f.value=r.value.getMonth(),w()};return(s,o)=>(e.openBlock(),e.createElementBlock("div",R,[e.createElementVNode("div",null,[e.createElementVNode("p",P,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:o[0]||(o[0]=i=>h(y.value-1,f.value))},"«"),e.createElementVNode("button",{onClick:o[1]||(o[1]=i=>h(y.value,f.value-1))},"‹")]),e.createElementVNode("span",A,[e.createElementVNode("button",null,e.toDisplayString(y.value),1),e.createElementVNode("button",null,e.toDisplayString(e.unref(S.parseTime)(r.value,"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:o[2]||(o[2]=i=>h(y.value,f.value+1))},"›"),e.createElementVNode("button",{onClick:o[3]||(o[3]=i=>h(y.value+1,f.value))},"»")])]),e.createElementVNode("div",J,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(i,n)=>e.createElementVNode("button",{key:n,class:"disabled"},e.toDisplayString(e.unref(S.parseTime)(new Date(1970,1,i+e.unref(T)),"{D}")),1)),64))]),e.createElementVNode("div",W,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(i,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[n<B.value+(7-new Date(y.value,f.value+1,1).getDay()+e.unref(T))%7?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(i.month===f.value?i.class:"disabled"),onClick:()=>{i.month===f.value&&c(i,n)}},e.toDisplayString(i.day),11,X)):e.createCommentVNode("",!0)],64))),128))])]),v.range==="range"?(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("p",K,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:o[4]||(o[4]=i=>h(y.value-1,f.value))},"«"),e.createElementVNode("button",{onClick:o[5]||(o[5]=i=>h(y.value,f.value-1))},"‹")]),e.createElementVNode("span",Z,[e.createElementVNode("button",null,e.toDisplayString(new Date(y.value,f.value+1).getFullYear()),1),e.createElementVNode("button",null,e.toDisplayString(e.unref(S.parseTime)(r.value.setMonth(f.value+1),"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:o[6]||(o[6]=i=>h(y.value,f.value+1))},"›"),e.createElementVNode("button",{onClick:o[7]||(o[7]=i=>h(y.value+1,f.value))},"»")])]),e.createElementVNode("div",Q,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(i,n)=>e.createElementVNode("button",{key:n,class:"disabled"},e.toDisplayString(e.unref(S.parseTime)(new Date(1970,1,i+e.unref(T)),"{D}")),1)),64))]),e.createElementVNode("div",ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(i,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[n>=B.value-new Date(y.value,f.value+1,1).getDay()+e.unref(T)?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(i.month===$.value.getMonth()?i.class:"disabled"),onClick:()=>{i.month===$.value.getMonth()&&c(i,n)}},e.toDisplayString(i.day),11,te)):e.createCommentVNode("",!0)],64))),128))])])):e.createCommentVNode("",!0)]))}},le=O(ae,[["__scopeId","data-v-fef4c07c"]]),ne={key:1,class:"controls-container",style:{"margin-top":".5rem"}},oe={key:0},ue={key:1,style:{padding:"0 1rem .5rem"}},re={__name:"VacationTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,query:String,fullName:{type:String,default:"Вы"}},setup(D){const E=D,{t:r}=G.useI18n(),k=e.ref([]);e.ref([]);const v=e.ref(new Date().getFullYear()),F=e.ref(!1),y=e.ref(!1),b=e.ref(!1),_=e.ref({zIndex:3,minWidth:230,x:500,y:200}),f=e.ref(!1),d=e.ref(!1),B=e.ref({participants:[]}),$=e.ref([]),g=e.ref([]),x=e.ref("Сектор разработок и эксплуатации сети"),Y=e.ref([{value:"all",label:r("vacationSchedule.all"),key:"all"}]),T=e.ref([{value:v.value,label:v.value},{value:v.value+1,label:v.value+1}]),j=e.ref(!1),w=e.ref([]),M=e.ref(!1),c=e.ref({name:"Имя",length:0,code:""});e.watch(x,async(l,a)=>{l!==a&&(w.value=[],F.value=!1,E.odata.personalManagerData.forEach(p=>{(p.Status!=="Увольнение"&&p.Group===l||l==="all")&&(w.value.some(t=>(t==null?void 0:t.activeText)===p.Role)||w.value.push({val:!0,activeText:p.Role}))}),I())});const h=e.computed(()=>k.value.flatMap((l,a)=>!l.days||l.days.length===0?[{...l,key:0,ids:a}]:l.days.map((p,t)=>({ids:a,key:t,...l,...p})))),L=async()=>{E.odata.getPersonalManagerData({}).then(l=>{var a;x.value=(a=l.find(p=>p.Status!=="Увольнение"&&p.Description===E.fullName))==null?void 0:a.Group,l.forEach(p=>{p.Status!=="Увольнение"&&(Y.value.some(t=>(t==null?void 0:t.value)===p.Group)||Y.value.push({value:p.Group,label:p.Group,key:p.Group}),p.Group===x.value&&!w.value.some(t=>(t==null?void 0:t.activeText)===p.Role)&&w.value.push({val:!0,activeText:p.Role}))}),I(),y.value=!1})},I=()=>{k.value=[];let l=[];E.odata.personalManagerData.forEach(a=>{a.Status!=="Увольнение"&&(a.Group===x.value||x.value==="all")&&w.value.some(p=>p.val&&p.activeText===a.Role)&&(l.push(a.Code),k.value.push({name:a.Description,days:[{note:""}],jobTitle:a.Role,code:a.Code}))}),U(l),f.value=!1},U=l=>{E.workSchedule.getAllVacations({year:v.value}).then(a=>{console.log(l),l.forEach((p,t)=>{k.value[t].days=[{note:""}],a.forEach(C=>{p===C.code&&(typeof k.value[t].days[0].dateStart>"u"?k.value[t].days[0]={dateStart:S.parseTime(C.dateStart,"{dd}.{m}.{Y}"),dateEnd:S.parseTime(C.dateEnd,"{dd}.{m}.{Y}"),note:C.note,count:C.count}:k.value[t].days.push({dateStart:S.parseTime(C.dateStart,"{dd}.{m}.{Y}"),dateEnd:S.parseTime(C.dateEnd,"{dd}.{m}.{Y}"),note:C.note,count:C.count}))})})})},q=l=>{if(l.columnIndex<3&&h.value[l.rowIndex].key<h.value[l.rowIndex].days.length)return h.value[l.rowIndex].key===0?{rowspan:h.value[l.rowIndex].days.length,colspan:1}:{rowspan:0,colspan:0}},s=(l,a,p,t)=>{c.value.ids=l.ids,c.value.key=l.key,c.value.startDate=l.dateStart,c.value.endDate=l.dateEnd,c.value.name=l.name,c.value.count=l.count,c.value.length=l.days.length,c.value.add=l.days.length>0&&l.days[l.days.length-1].count,c.value.level=a.level,c.value.holiday=g.value,_.value.y=t.clientY,_.value.x=t.clientX,a.level===2&&a.no<4&&(c.value.add||l.days.length>1)&&(b.value=!0),a.level===3&&(b.value=!0)},o=l=>{console.log(l);let a=k.value[c.value.ids];switch(l){case"add":a.days.push({note:""}),console.log(a.days.length);break;case"delete":delete a.days.pop(),m(c.value.ids);break}b.value=!1},i=l=>{M.value=l,c.value.count=l.count},n=()=>{M.value&&(console.log(M.value),k.value[c.value.ids].days[c.value.key]={...M.value,note:""},m(c.value.ids)),b.value=!1},m=l=>{E.workSchedule.rewriteFull({year:v.value,code:k.value[l].code,data:k.value[l].days.map(a=>({dateStart:a.dateStart.split(".").reverse().join("-"),dateEnd:a.dateEnd.split(".").reverse().join("-"),note:a.note,count:a.count}))})},N=l=>{E.workSchedule.sendConfirmMessage({fullname:E.fullName,confirm:l}),E.query=""},V=()=>{E.workSchedule.sendAgreementMessage({users:B.value.participants}),console.log("sendAgreement"),d.value=!1};return E.workSchedule.getBoss().then(l=>{console.log(l),$.value=l[0].users}),S.holidays().then(l=>{g.value=l,L()}),(l,a)=>{const p=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",null,[D.checkEdit?(e.openBlock(),e.createBlock(e.unref(u.ElSelect),{key:0,modelValue:x.value,"onUpdate:modelValue":a[0]||(a[0]=t=>x.value=t),placeholder:"Select",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Y.value,t=>(e.openBlock(),e.createBlock(e.unref(u.ElOption),{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),e.createVNode(e.unref(u.ElButton),{plain:"",onClick:a[1]||(a[1]=t=>f.value=!0),style:{"margin-bottom":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.jobTitle")),1)]),_:1}),e.createVNode(e.unref(u.ElSelect),{modelValue:v.value,"onUpdate:modelValue":a[2]||(a[2]=t=>v.value=t),onChange:I,placeholder:"Year",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,t=>(e.openBlock(),e.createBlock(e.unref(u.ElOption),{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),e.createVNode(e.unref(u.ElSkeleton),{style:{width:"100%"},loading:y.value,animated:""},{template:e.withCtx(()=>[e.createVNode(e.unref(u.ElSkeletonItem),{variant:"text",style:{width:"100%",height:"2rem"}}),e.createVNode(e.unref(u.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"4rem","margin-right":"4px"}}),e.createVNode(e.unref(u.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"4rem"}}),e.createVNode(e.unref(u.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"8rem","margin-right":"4px"}}),e.createVNode(e.unref(u.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"8rem"}})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.ElTable),{id:"printTable",data:h.value,"span-method":q,onCellClick:s,border:"",style:{width:"100%"},size:"small","empty-text":e.unref(r)("vacationSchedule.emptyText")},{default:e.withCtx(()=>[e.createVNode(e.unref(u.ElTableColumn),{label:x.value!=="all"?e.unref(r)("vacationSchedule.title",{name:x.value}):e.unref(r)("vacationSchedule.enterprise")+` ${v.value}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.ElTableColumn),{label:e.unref(r)("vacationSchedule.jobTitle"),width:"180",align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(h.value[t.$index].jobTitle),1)]),_:1},8,["label"]),e.createVNode(e.unref(u.ElTableColumn),{label:e.unref(r)("vacationSchedule.fullName"),width:"180",align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(h.value[t.$index].name),1)]),_:1},8,["label"]),e.createVNode(e.unref(u.ElTableColumn),{label:e.unref(r)("vacationSchedule.personnelNumber"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(h.value[t.$index].code),1)]),_:1},8,["label"]),e.createVNode(e.unref(u.ElTableColumn),{label:e.unref(r)("vacationSchedule.vacation"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.ElTableColumn),{label:e.unref(r)("vacationSchedule.days"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(h.value[t.$index].count),1)]),_:1},8,["label"]),e.createVNode(e.unref(u.ElTableColumn),{label:e.unref(r)("vacationSchedule.date"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(h.value[t.$index].dateStart),1)]),_:1},8,["label"]),e.createVNode(e.unref(u.ElTableColumn),{label:e.unref(r)("vacationSchedule.endDate"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(h.value[t.$index].dateEnd),1)]),_:1},8,["label"])]),_:1},8,["label"]),e.createVNode(e.unref(u.ElTableColumn),{label:e.unref(r)("vacationSchedule.note"),align:"center"},{default:e.withCtx(t=>[e.createVNode(e.unref(u.ElInput),{modelValue:k.value[h.value[t.$index].ids].days[h.value[t.$index].key].note,"onUpdate:modelValue":C=>k.value[h.value[t.$index].ids].days[h.value[t.$index].key].note=C,style:{width:"100%"},placeholder:" ",class:"noBorder",onBlur:C=>m(h.value[t.$index].ids)},null,8,["modelValue","onUpdate:modelValue","onBlur"])]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["data","empty-text"])]),_:1},8,["loading"]),D.checkEdit?(e.openBlock(),e.createElementBlock("div",ne,[F.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(u.ElButton),{key:0,type:"primary",onClick:a[3]||(a[3]=t=>d.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("vacationSchedule.sendInformation")),1)]),_:1})),D.query==="confirm"?(e.openBlock(),e.createBlock(e.unref(u.ElButton),{key:1,type:"primary",onClick:a[4]||(a[4]=t=>N(!0))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("vacationSchedule.agreeOn")),1)]),_:1})):e.createCommentVNode("",!0),D.query==="confirm"?(e.openBlock(),e.createBlock(e.unref(u.ElButton),{key:2,type:"primary",onClick:a[5]||(a[5]=t=>N(!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("vacationSchedule.reject")),1)]),_:1})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(u.ElButton),{disabled:j.value,plain:"",onClick:l.exportToExcel,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.exportExcel")),1)]),_:1},8,["disabled","onClick"])),[[p,j.value]]),e.createVNode(e.unref(u.ElDialog),{title:e.unref(r)("workSchedule.jobTitle"),modelValue:f.value,"onUpdate:modelValue":a[7]||(a[7]=t=>f.value=t),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(u.ElButton),{onClick:a[6]||(a[6]=t=>f.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(u.ElButton),{size:"default",type:"primary",onClick:I},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.ElForm),{model:w.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,t=>(e.openBlock(),e.createBlock(e.unref(u.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.ElSwitch),{modelValue:t.val,"onUpdate:modelValue":C=>t.val=C,"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(u.ElDialog),{title:"Прошу согласовать график отпусков по отделу",modelValue:d.value,"onUpdate:modelValue":a[10]||(a[10]=t=>d.value=t),width:"500px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(u.ElButton),{onClick:a[9]||(a[9]=t=>d.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(u.ElButton),{size:"default",type:"primary",onClick:V},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("vacationSchedule.send")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.ElForm),{model:B.value,autocomplete:"on"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.ElSelect),{modelValue:B.value.participants,"onUpdate:modelValue":a[8]||(a[8]=t=>B.value.participants=t),placeholder:e.unref(r)("vacationSchedule.fullName"),multiple:"",size:"default"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,t=>(e.openBlock(),e.createBlock(e.unref(u.ElOption),{key:t,label:t,value:t},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["model"])]),_:1},8,["modelValue"]),e.createVNode(e.unref(z.ContextMenu),{show:b.value,"onUpdate:show":a[14]||(a[14]=t=>b.value=t),options:_.value},{default:e.withCtx(()=>[e.createVNode(e.unref(z.ContextMenuItem),{label:c.value.level===3&&typeof c.value.count<"u"?c.value.name+" "+c.value.count+" "+e.unref(r)("vacationSchedule.day",c.value.count):c.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(z.ContextMenuSeparator)),c.value.level===2?(e.openBlock(),e.createElementBlock("div",oe,[c.value.length>1?(e.openBlock(),e.createBlock(e.unref(z.ContextMenuItem),{key:0,label:e.unref(r)("vacationSchedule.deleteLast"),onClick:a[11]||(a[11]=t=>o("delete"))},null,8,["label"])):e.createCommentVNode("",!0),c.value.add?(e.openBlock(),e.createBlock(e.unref(z.ContextMenuItem),{key:1,label:e.unref(r)("vacationSchedule.addVacation"),onClick:a[12]||(a[12]=t=>o("add"))},null,8,["label"])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",ue,[e.createVNode(le,{data:c.value,range:"range",onInput:i},null,8,["data"]),e.createElementVNode("div",null,[e.createVNode(e.unref(u.ElButton),{onClick:a[13]||(a[13]=t=>b.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("vacationSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(u.ElButton),{onClick:n},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("vacationSchedule.save")),1)]),_:1})])]))]),_:1},8,["show","options"])])}}};module.exports=re;
1
+ "use strict";const e=require("vue"),w=require("./index-CHGzf-XH.cjs"),G=require("vue-i18n"),r=require("element-plus"),z=require("@imengyu/vue3-context-menu"),O=(D,E)=>{const u=D.__vccOpts||D;for(const[k,v]of E)u[k]=v;return u},R={class:"wrapper"},P={class:"month_year"},A={class:"text"},J={class:"week"},W={class:"month"},X=["onClick"],H={key:0},K={class:"month_year"},Z={class:"text"},Q={class:"week"},ee={class:"month"},te=["onClick"],ae={__name:"DataPicker",props:{data:Object,range:{type:String,default:()=>"solid"}},emits:["init"],setup(D,{emit:E}){var L,M,U,q;const u=e.ref(new Date),k=e.ref(new Date),v=D,I=E,y=e.ref(new Date().getFullYear()),b=e.ref(new Date().getMonth()),F=e.ref(new Date().getFullYear()),f=e.ref(new Date().getMonth()),d=e.ref([]),B=e.ref(0),$=e.ref(0),g=e.ref(-1),x=e.ref(-1),{locale:Y}=G.useI18n(),T=/en|zh|ja|he/.test(Y.value)?0:1,j=s=>{const o=s.split(s.match(/\D.*?\D?/));return o[0].length>2?o.join("-")+"T00:00:01":o.reverse().join("-")+"T00:00:01"};typeof((L=v.data)==null?void 0:L.startDate)<"u"&&(u.value=new Date(j(v.data.startDate)),y.value=u.value.getFullYear(),f.value=u.value.getMonth()),typeof((M=v.data)==null?void 0:M.endDate)<"u"&&(k.value=new Date(j(v.data.endDate)),F.value=k.value.getFullYear(),b.value=k.value.getMonth());const S=()=>{let s=new Date(y.value,f.value,0);for(let n=s.getDate()-s.getDay()+T;n<=s.getDate()&&s.getDay()!==6+T;n++)B.value++,d.value.push({day:n,month:s.getMonth(),year:s.getFullYear(),class:[]});for(let n=1;n<=new Date(y.value,f.value+1,0).getDate();n++)B.value++,d.value.push({day:n,month:f.value,year:y.value,class:[]});if(v.range==="range"){$.value=new Date(y.value,f.value+2,0);for(let n=1;n<=$.value.getDate();n++)d.value.push({day:n,month:$.value.getMonth(),year:$.value.getFullYear(),class:[]})}let o=v.range==="range"?2:1,i=new Date(y.value,f.value+o,1);for(let n=1;n<=(7-i.getDay()+T)%7&&i.getDay()!==T;n++)d.value.push({day:n,month:i.getMonth(),year:i.getFullYear(),class:[]});v.data.holiday.length!==0&&(v.data.holiday.preholidays.forEach(n=>{let m=n.split("-");const C=d.value.findIndex(V=>V.year==m[0]&&V.month+1==m[1]&&V.day==m[2]);C!==-1&&(d.value[C].class[0]="preholiday")}),v.data.holiday.holidays.forEach(n=>{let m=n.split("-");const C=d.value.findIndex(V=>V.year==m[0]&&V.month+1==m[1]&&V.day==m[2]);C!==-1&&(d.value[C].class[0]="weekend")}),v.data.holiday.holiday.forEach(n=>{let m=n.split("-");const C=d.value.findIndex(V=>V.year==m[0]&&V.month+1==m[1]&&V.day==m[2]);C!==-1&&(d.value[C].class[0]="holiday")}),v.data.holiday.nowork.forEach(n=>{let m=n.split("-");const C=d.value.findIndex(V=>V.year==m[0]&&V.month+1==m[1]&&V.day==m[2]);C!==-1&&(d.value[C].class[0]="nowork")}))},_=(s,o)=>{let i=s-o+1;for(let n=0;n<=s-o;n++)d.value[n+o].class[0]==="holiday"&&i--;return i},c=(s,o)=>{const i=w.parseTime(new Date(s.year,s.month,s.day),"{dd}.{m}.{Y}");if(v.range==="range")if(console.log(g.value),x.value!==-1){if(x.value<=g.value)for(let n=x.value;n<=g.value;n++)d.value[n].class[1]="";else for(let n=g.value;n<=x.value;n++)d.value[n].class[1]="";g.value=o,x.value=-1,d.value[o].class[1]="active"}else if(g.value!==-1){if(x.value=o,x.value>=g.value)for(let m=g.value+1;m<o;m++)d.value[m].class[1]="select";else for(let m=o+1;m<g.value;m++)d.value[m].class[1]="select";d.value[o].class[1]="active";let n=w.parseTime(new Date(d.value[g.value].year,d.value[g.value].month,d.value[g.value].day),"{dd}.{m}.{Y}");g.value>o?I("input",{dateStart:i,dateEnd:n,count:_(g.value,o)}):I("input",{dateStart:n,dateEnd:i,count:_(o,g.value)})}else g.value=o,d.value[o].class[1]="active";else d.value[g.value].class[1]="",g.value=o,d.value[o].class[1]="active",I("input",{dateStart:i,count:1})};if(S(),typeof((U=v.data)==null?void 0:U.startDate)<"u"&&(g.value=d.value.findIndex(s=>s.day===u.value.getDate()&&s.month===f.value&&s.year===y.value),d.value[g.value].class[1]="active"),typeof((q=v.data)==null?void 0:q.endDate)<"u"&&v.range==="range"){x.value=d.value.findIndex(s=>s.day===k.value.getDate()&&s.month===b.value&&s.year===F.value),d.value[x.value].class[1]="active";for(let s=g.value+1;s<x.value;s++)d.value[s].class[1]="select"}const h=(s,o)=>{d.value=[],B.value=0,u.value=new Date(s,o,1),y.value=u.value.getFullYear(),f.value=u.value.getMonth(),S()};return(s,o)=>(e.openBlock(),e.createElementBlock("div",R,[e.createElementVNode("div",null,[e.createElementVNode("p",P,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:o[0]||(o[0]=i=>h(y.value-1,f.value))},"«"),e.createElementVNode("button",{onClick:o[1]||(o[1]=i=>h(y.value,f.value-1))},"‹")]),e.createElementVNode("span",A,[e.createElementVNode("button",null,e.toDisplayString(y.value),1),e.createElementVNode("button",null,e.toDisplayString(e.unref(w.parseTime)(u.value,"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:o[2]||(o[2]=i=>h(y.value,f.value+1))},"›"),e.createElementVNode("button",{onClick:o[3]||(o[3]=i=>h(y.value+1,f.value))},"»")])]),e.createElementVNode("div",J,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(i,n)=>e.createElementVNode("button",{key:n,class:"disabled"},e.toDisplayString(e.unref(w.parseTime)(new Date(1970,1,i+e.unref(T)),"{D}")),1)),64))]),e.createElementVNode("div",W,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(i,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[n<B.value+(7-new Date(y.value,f.value+1,1).getDay()+e.unref(T))%7?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(i.month===f.value?i.class:"disabled"),onClick:()=>{i.month===f.value&&c(i,n)}},e.toDisplayString(i.day),11,X)):e.createCommentVNode("",!0)],64))),128))])]),v.range==="range"?(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("p",K,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:o[4]||(o[4]=i=>h(y.value-1,f.value))},"«"),e.createElementVNode("button",{onClick:o[5]||(o[5]=i=>h(y.value,f.value-1))},"‹")]),e.createElementVNode("span",Z,[e.createElementVNode("button",null,e.toDisplayString(new Date(y.value,f.value+1).getFullYear()),1),e.createElementVNode("button",null,e.toDisplayString(e.unref(w.parseTime)(u.value.setMonth(f.value+1),"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:o[6]||(o[6]=i=>h(y.value,f.value+1))},"›"),e.createElementVNode("button",{onClick:o[7]||(o[7]=i=>h(y.value+1,f.value))},"»")])]),e.createElementVNode("div",Q,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(i,n)=>e.createElementVNode("button",{key:n,class:"disabled"},e.toDisplayString(e.unref(w.parseTime)(new Date(1970,1,i+e.unref(T)),"{D}")),1)),64))]),e.createElementVNode("div",ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(i,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[n>=B.value-new Date(y.value,f.value+1,1).getDay()+e.unref(T)?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(i.month===$.value.getMonth()?i.class:"disabled"),onClick:()=>{i.month===$.value.getMonth()&&c(i,n)}},e.toDisplayString(i.day),11,te)):e.createCommentVNode("",!0)],64))),128))])])):e.createCommentVNode("",!0)]))}},le=O(ae,[["__scopeId","data-v-fef4c07c"]]),ne={key:1,class:"controls-container",style:{"margin-top":".5rem"}},oe={key:0},ue={key:1,style:{padding:"0 1rem .5rem"}},re={__name:"VacationTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,query:String,fullName:{type:String,default:"Вы"}},setup(D){const E=D,{t:u}=G.useI18n(),k=e.ref([]);e.ref([]);const v=e.ref(new Date().getFullYear()),I=e.ref(!1),y=e.ref(!1),b=e.ref(!1),F=e.ref({zIndex:3,minWidth:230,x:500,y:200}),f=e.ref(!1),d=e.ref(!1),B=e.ref({participants:[]}),$=e.ref([]),g=e.ref([]),x=e.ref("Сектор разработок и эксплуатации сети"),Y=e.ref([{value:"all",label:u("vacationSchedule.all"),key:"all"}]),T=e.ref([{value:v.value,label:v.value},{value:v.value+1,label:v.value+1}]),j=e.ref(!1),S=e.ref([]),_=e.ref(!1),c=e.ref({name:"Имя",length:0,code:""});e.watch(x,async(l,a)=>{l!==a&&(S.value=[],I.value=!1,E.odata.personalManagerData.forEach(p=>{(p.Status!=="Увольнение"&&p.Group===l||l==="all")&&(S.value.some(t=>(t==null?void 0:t.activeText)===p.Role)||S.value.push({val:!0,activeText:p.Role}))}),M())});const h=e.computed(()=>k.value.flatMap((l,a)=>!l.days||l.days.length===0?[{...l,key:0,ids:a}]:l.days.map((p,t)=>({ids:a,key:t,...l,...p})))),L=async()=>{E.odata.getPersonalManagerData({}).then(l=>{var a;x.value=(a=l.find(p=>p.Status!=="Увольнение"&&p.Description===E.fullName))==null?void 0:a.Group,l.forEach(p=>{p.Status!=="Увольнение"&&(Y.value.some(t=>(t==null?void 0:t.value)===p.Group)||Y.value.push({value:p.Group,label:p.Group,key:p.Group}),p.Group===x.value&&!S.value.some(t=>(t==null?void 0:t.activeText)===p.Role)&&S.value.push({val:!0,activeText:p.Role}))}),M(),y.value=!1})},M=()=>{k.value=[];let l=[];E.odata.personalManagerData.forEach(a=>{a.Status!=="Увольнение"&&(a.Group===x.value||x.value==="all")&&S.value.some(p=>p.val&&p.activeText===a.Role)&&(l.push(a.Code),k.value.push({name:a.Description,days:[{note:""}],jobTitle:a.Role,code:a.Code}))}),U(l),f.value=!1},U=l=>{E.workSchedule.getAllVacations({year:v.value}).then(a=>{l.forEach((p,t)=>{k.value[t].days=[{note:""}],a.forEach(N=>{p===N.code&&(typeof k.value[t].days[0].dateStart>"u"?k.value[t].days[0]={dateStart:w.parseTime(N.dateStart,"{dd}.{m}.{Y}"),dateEnd:w.parseTime(N.dateEnd,"{dd}.{m}.{Y}"),note:N.note,count:N.count}:k.value[t].days.push({dateStart:w.parseTime(N.dateStart,"{dd}.{m}.{Y}"),dateEnd:w.parseTime(N.dateEnd,"{dd}.{m}.{Y}"),note:N.note,count:N.count}))})})})},q=l=>{if(l.columnIndex<3&&h.value[l.rowIndex].key<h.value[l.rowIndex].days.length)return h.value[l.rowIndex].key===0?{rowspan:h.value[l.rowIndex].days.length,colspan:1}:{rowspan:0,colspan:0}},s=(l,a,p,t)=>{c.value.ids=l.ids,c.value.key=l.key,c.value.startDate=l.dateStart,c.value.endDate=l.dateEnd,c.value.name=l.name,c.value.count=l.count,c.value.length=l.days.length,c.value.add=l.days.length>0&&l.days[l.days.length-1].count,c.value.level=a.level,c.value.holiday=g.value,F.value.y=t.clientY,F.value.x=t.clientX,a.level===2&&a.no<4&&(c.value.add||l.days.length>1)&&(b.value=!0),a.level===3&&(b.value=!0)},o=l=>{console.log(l);let a=k.value[c.value.ids];switch(l){case"add":a.days.push({note:""}),console.log(a.days.length);break;case"delete":delete a.days.pop(),m(c.value.ids);break}b.value=!1},i=l=>{_.value=l,c.value.count=l.count},n=()=>{_.value&&(k.value[c.value.ids].days[c.value.key]={..._.value,note:""},m(c.value.ids)),b.value=!1},m=l=>{E.workSchedule.rewriteFull({year:v.value,code:k.value[l].code,data:k.value[l].days.map(a=>({dateStart:a.dateStart.split(".").reverse().join("-"),dateEnd:a.dateEnd.split(".").reverse().join("-"),note:a.note,count:a.count}))})},C=l=>{E.workSchedule.sendConfirmMessage({fullname:E.fullName,confirm:l}),E.query=""},V=()=>{E.workSchedule.sendAgreementMessage({users:B.value.participants}),d.value=!1};return E.workSchedule.getBoss().then(l=>{$.value=l[0].users}),w.holidays().then(l=>{g.value=l,L()}),(l,a)=>{const p=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",null,[D.checkEdit?(e.openBlock(),e.createBlock(e.unref(r.ElSelect),{key:0,modelValue:x.value,"onUpdate:modelValue":a[0]||(a[0]=t=>x.value=t),placeholder:"Select",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Y.value,t=>(e.openBlock(),e.createBlock(e.unref(r.ElOption),{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),e.createVNode(e.unref(r.ElButton),{plain:"",onClick:a[1]||(a[1]=t=>f.value=!0),style:{"margin-bottom":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.jobTitle")),1)]),_:1}),e.createVNode(e.unref(r.ElSelect),{modelValue:v.value,"onUpdate:modelValue":a[2]||(a[2]=t=>v.value=t),onChange:M,placeholder:"Year",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,t=>(e.openBlock(),e.createBlock(e.unref(r.ElOption),{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),e.createVNode(e.unref(r.ElSkeleton),{style:{width:"100%"},loading:y.value,animated:""},{template:e.withCtx(()=>[e.createVNode(e.unref(r.ElSkeletonItem),{variant:"text",style:{width:"100%",height:"2rem"}}),e.createVNode(e.unref(r.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"4rem","margin-right":"4px"}}),e.createVNode(e.unref(r.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"4rem"}}),e.createVNode(e.unref(r.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"8rem","margin-right":"4px"}}),e.createVNode(e.unref(r.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"8rem"}})]),default:e.withCtx(()=>[e.createVNode(e.unref(r.ElTable),{id:"printTable",data:h.value,"span-method":q,onCellClick:s,border:"",style:{width:"100%"},size:"small","empty-text":e.unref(u)("vacationSchedule.emptyText")},{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElTableColumn),{label:x.value!=="all"?e.unref(u)("vacationSchedule.title",{name:x.value}):e.unref(u)("vacationSchedule.enterprise")+` ${v.value}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(u)("vacationSchedule.jobTitle"),width:"180",align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(h.value[t.$index].jobTitle),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(u)("vacationSchedule.fullName"),width:"180",align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(h.value[t.$index].name),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(u)("vacationSchedule.personnelNumber"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(h.value[t.$index].code),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(u)("vacationSchedule.vacation"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(u)("vacationSchedule.days"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(h.value[t.$index].count),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(u)("vacationSchedule.date"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(h.value[t.$index].dateStart),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(u)("vacationSchedule.endDate"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(h.value[t.$index].dateEnd),1)]),_:1},8,["label"])]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(u)("vacationSchedule.note"),align:"center"},{default:e.withCtx(t=>[e.createVNode(e.unref(r.ElInput),{modelValue:k.value[h.value[t.$index].ids].days[h.value[t.$index].key].note,"onUpdate:modelValue":N=>k.value[h.value[t.$index].ids].days[h.value[t.$index].key].note=N,style:{width:"100%"},placeholder:" ",class:"noBorder",onBlur:N=>m(h.value[t.$index].ids)},null,8,["modelValue","onUpdate:modelValue","onBlur"])]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["data","empty-text"])]),_:1},8,["loading"]),D.checkEdit?(e.openBlock(),e.createElementBlock("div",ne,[I.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(r.ElButton),{key:0,type:"primary",onClick:a[3]||(a[3]=t=>d.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("vacationSchedule.sendInformation")),1)]),_:1})),D.query==="confirm"?(e.openBlock(),e.createBlock(e.unref(r.ElButton),{key:1,type:"primary",onClick:a[4]||(a[4]=t=>C(!0))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("vacationSchedule.agreeOn")),1)]),_:1})):e.createCommentVNode("",!0),D.query==="confirm"?(e.openBlock(),e.createBlock(e.unref(r.ElButton),{key:2,type:"primary",onClick:a[5]||(a[5]=t=>C(!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("vacationSchedule.reject")),1)]),_:1})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(r.ElButton),{disabled:j.value,plain:"",onClick:l.exportToExcel,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.exportExcel")),1)]),_:1},8,["disabled","onClick"])),[[p,j.value]]),e.createVNode(e.unref(r.ElDialog),{title:e.unref(u)("workSchedule.jobTitle"),modelValue:f.value,"onUpdate:modelValue":a[7]||(a[7]=t=>f.value=t),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(r.ElButton),{onClick:a[6]||(a[6]=t=>f.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(r.ElButton),{size:"default",type:"primary",onClick:M},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(r.ElForm),{model:S.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.value,t=>(e.openBlock(),e.createBlock(e.unref(r.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElSwitch),{modelValue:t.val,"onUpdate:modelValue":N=>t.val=N,"active-text":t.activeText},null,8,["modelValue","onUpdate:modelValue","active-text"])]),_:2},1024))),256))]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(r.ElDialog),{title:e.unref(u)("vacationSchedule.pleaseCoordinate"),modelValue:d.value,"onUpdate:modelValue":a[10]||(a[10]=t=>d.value=t),width:"500px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(r.ElButton),{onClick:a[9]||(a[9]=t=>d.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(r.ElButton),{size:"default",type:"primary",onClick:V},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("vacationSchedule.send")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(r.ElForm),{model:B.value,autocomplete:"on"},{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElSelect),{modelValue:B.value.participants,"onUpdate:modelValue":a[8]||(a[8]=t=>B.value.participants=t),placeholder:e.unref(u)("vacationSchedule.fullName"),multiple:"",size:"default"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,t=>(e.openBlock(),e.createBlock(e.unref(r.ElOption),{key:t,label:t,value:t},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(z.ContextMenu),{show:b.value,"onUpdate:show":a[14]||(a[14]=t=>b.value=t),options:F.value},{default:e.withCtx(()=>[e.createVNode(e.unref(z.ContextMenuItem),{label:c.value.level===3&&typeof c.value.count<"u"?c.value.name+" "+c.value.count+" "+e.unref(u)("vacationSchedule.day",c.value.count):c.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(z.ContextMenuSeparator)),c.value.level===2?(e.openBlock(),e.createElementBlock("div",oe,[c.value.length>1?(e.openBlock(),e.createBlock(e.unref(z.ContextMenuItem),{key:0,label:e.unref(u)("vacationSchedule.deleteLast"),onClick:a[11]||(a[11]=t=>o("delete"))},null,8,["label"])):e.createCommentVNode("",!0),c.value.add?(e.openBlock(),e.createBlock(e.unref(z.ContextMenuItem),{key:1,label:e.unref(u)("vacationSchedule.addVacation"),onClick:a[12]||(a[12]=t=>o("add"))},null,8,["label"])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",ue,[e.createVNode(le,{data:c.value,range:"range",onInput:i},null,8,["data"]),e.createElementVNode("div",null,[e.createVNode(e.unref(r.ElButton),{onClick:a[13]||(a[13]=t=>b.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("vacationSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(r.ElButton),{onClick:n},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("vacationSchedule.save")),1)]),_:1})])]))]),_:1},8,["show","options"])])}}};module.exports=re;
@@ -1,8 +1,8 @@
1
- import { ref as f, openBlock as p, createElementBlock as E, createElementVNode as g, toDisplayString as k, unref as e, Fragment as G, renderList as A, normalizeClass as ne, createCommentVNode as z, watch as se, computed as ve, resolveDirective as ie, createBlock as Y, withCtx as i, createVNode as v, createTextVNode as V, withDirectives as re } from "vue";
1
+ import { ref as f, openBlock as p, createElementBlock as E, createElementVNode as y, toDisplayString as k, unref as e, Fragment as G, renderList as P, normalizeClass as ne, createCommentVNode as z, watch as se, computed as ve, resolveDirective as ie, createBlock as Y, withCtx as i, createVNode as v, createTextVNode as V, withDirectives as re } from "vue";
2
2
  import { p as O, h as ce } from "./index-uVRk2ARj.js";
3
3
  import { useI18n as de } from "vue-i18n";
4
- import { ElSelect as ae, ElOption as le, ElButton as F, ElSkeleton as fe, ElSkeletonItem as K, ElTable as pe, ElTableColumn as q, ElInput as he, ElDialog as ue, ElForm as oe, ElFormItem as me, ElSwitch as ge } from "element-plus";
5
- import { ContextMenu as ye, ContextMenuItem as te, ContextMenuSeparator as be } from "@imengyu/vue3-context-menu";
4
+ import { ElSelect as ae, ElOption as le, ElButton as F, ElSkeleton as fe, ElSkeletonItem as K, ElTable as pe, ElTableColumn as q, ElInput as he, ElDialog as ue, ElForm as oe, ElFormItem as me, ElSwitch as ye } from "element-plus";
5
+ import { ContextMenu as ge, ContextMenuItem as te, ContextMenuSeparator as be } from "@imengyu/vue3-context-menu";
6
6
  const xe = (j, M) => {
7
7
  const o = j.__vccOpts || j;
8
8
  for (const [w, h] of M)
@@ -17,12 +17,12 @@ const xe = (j, M) => {
17
17
  },
18
18
  emits: ["init"],
19
19
  setup(j, { emit: M }) {
20
- var Z, L, Q, ee;
21
- const o = f(/* @__PURE__ */ new Date()), w = f(/* @__PURE__ */ new Date()), h = j, J = M, S = f((/* @__PURE__ */ new Date()).getFullYear()), N = f((/* @__PURE__ */ new Date()).getMonth()), W = f((/* @__PURE__ */ new Date()).getFullYear()), m = f((/* @__PURE__ */ new Date()).getMonth()), d = f([]), B = f(0), R = f(0), D = f(-1), C = f(-1), { locale: X } = de(), U = /en|zh|ja|he/.test(X.value) ? 0 : 1, H = (r) => {
20
+ var Z, A, Q, ee;
21
+ const o = f(/* @__PURE__ */ new Date()), w = f(/* @__PURE__ */ new Date()), h = j, L = M, S = f((/* @__PURE__ */ new Date()).getFullYear()), N = f((/* @__PURE__ */ new Date()).getMonth()), J = f((/* @__PURE__ */ new Date()).getFullYear()), m = f((/* @__PURE__ */ new Date()).getMonth()), d = f([]), B = f(0), R = f(0), D = f(-1), C = f(-1), { locale: X } = de(), U = /en|zh|ja|he/.test(X.value) ? 0 : 1, H = (r) => {
22
22
  const u = r.split(r.match(/\D.*?\D?/));
23
23
  return u[0].length > 2 ? u.join("-") + "T00:00:01" : u.reverse().join("-") + "T00:00:01";
24
24
  };
25
- typeof ((Z = h.data) == null ? void 0 : Z.startDate) < "u" && (o.value = new Date(H(h.data.startDate)), S.value = o.value.getFullYear(), m.value = o.value.getMonth()), typeof ((L = h.data) == null ? void 0 : L.endDate) < "u" && (w.value = new Date(H(h.data.endDate)), W.value = w.value.getFullYear(), N.value = w.value.getMonth());
25
+ typeof ((Z = h.data) == null ? void 0 : Z.startDate) < "u" && (o.value = new Date(H(h.data.startDate)), S.value = o.value.getFullYear(), m.value = o.value.getMonth()), typeof ((A = h.data) == null ? void 0 : A.endDate) < "u" && (w.value = new Date(H(h.data.endDate)), J.value = w.value.getFullYear(), N.value = w.value.getMonth());
26
26
  const T = () => {
27
27
  let r = new Date(S.value, m.value, 0);
28
28
  for (let n = r.getDate() - r.getDay() + U; n <= r.getDate() && r.getDay() !== 6 + U; n++)
@@ -38,23 +38,23 @@ const xe = (j, M) => {
38
38
  for (let n = 1; n <= (7 - s.getDay() + U) % 7 && s.getDay() !== U; n++)
39
39
  d.value.push({ day: n, month: s.getMonth(), year: s.getFullYear(), class: [] });
40
40
  h.data.holiday.length !== 0 && (h.data.holiday.preholidays.forEach((n) => {
41
- let y = n.split("-");
42
- const _ = d.value.findIndex(($) => $.year == y[0] && $.month + 1 == y[1] && $.day == y[2]);
41
+ let g = n.split("-");
42
+ const _ = d.value.findIndex(($) => $.year == g[0] && $.month + 1 == g[1] && $.day == g[2]);
43
43
  _ !== -1 && (d.value[_].class[0] = "preholiday");
44
44
  }), h.data.holiday.holidays.forEach((n) => {
45
- let y = n.split("-");
46
- const _ = d.value.findIndex(($) => $.year == y[0] && $.month + 1 == y[1] && $.day == y[2]);
45
+ let g = n.split("-");
46
+ const _ = d.value.findIndex(($) => $.year == g[0] && $.month + 1 == g[1] && $.day == g[2]);
47
47
  _ !== -1 && (d.value[_].class[0] = "weekend");
48
48
  }), h.data.holiday.holiday.forEach((n) => {
49
- let y = n.split("-");
50
- const _ = d.value.findIndex(($) => $.year == y[0] && $.month + 1 == y[1] && $.day == y[2]);
49
+ let g = n.split("-");
50
+ const _ = d.value.findIndex(($) => $.year == g[0] && $.month + 1 == g[1] && $.day == g[2]);
51
51
  _ !== -1 && (d.value[_].class[0] = "holiday");
52
52
  }), h.data.holiday.nowork.forEach((n) => {
53
- let y = n.split("-");
54
- const _ = d.value.findIndex(($) => $.year == y[0] && $.month + 1 == y[1] && $.day == y[2]);
53
+ let g = n.split("-");
54
+ const _ = d.value.findIndex(($) => $.year == g[0] && $.month + 1 == g[1] && $.day == g[2]);
55
55
  _ !== -1 && (d.value[_].class[0] = "nowork");
56
56
  }));
57
- }, P = (r, u) => {
57
+ }, W = (r, u) => {
58
58
  let s = r - u + 1;
59
59
  for (let n = 0; n <= r - u; n++)
60
60
  d.value[n + u].class[0] === "holiday" && s--;
@@ -69,55 +69,55 @@ const xe = (j, M) => {
69
69
  D.value = u, C.value = -1, d.value[u].class[1] = "active";
70
70
  } else if (D.value !== -1) {
71
71
  if (C.value = u, C.value >= D.value)
72
- for (let y = D.value + 1; y < u; y++) d.value[y].class[1] = "select";
73
- else for (let y = u + 1; y < D.value; y++) d.value[y].class[1] = "select";
72
+ for (let g = D.value + 1; g < u; g++) d.value[g].class[1] = "select";
73
+ else for (let g = u + 1; g < D.value; g++) d.value[g].class[1] = "select";
74
74
  d.value[u].class[1] = "active";
75
75
  let n = O(new Date(d.value[D.value].year, d.value[D.value].month, d.value[D.value].day), "{dd}.{m}.{Y}");
76
- D.value > u ? J("input", { dateStart: s, dateEnd: n, count: P(D.value, u) }) : J("input", { dateStart: n, dateEnd: s, count: P(u, D.value) });
76
+ D.value > u ? L("input", { dateStart: s, dateEnd: n, count: W(D.value, u) }) : L("input", { dateStart: n, dateEnd: s, count: W(u, D.value) });
77
77
  } else
78
78
  D.value = u, d.value[u].class[1] = "active";
79
79
  else
80
- d.value[D.value].class[1] = "", D.value = u, d.value[u].class[1] = "active", J("input", { dateStart: s, count: 1 });
80
+ d.value[D.value].class[1] = "", D.value = u, d.value[u].class[1] = "active", L("input", { dateStart: s, count: 1 });
81
81
  };
82
82
  if (T(), typeof ((Q = h.data) == null ? void 0 : Q.startDate) < "u" && (D.value = d.value.findIndex((r) => r.day === o.value.getDate() && r.month === m.value && r.year === S.value), d.value[D.value].class[1] = "active"), typeof ((ee = h.data) == null ? void 0 : ee.endDate) < "u" && h.range === "range") {
83
- C.value = d.value.findIndex((r) => r.day === w.value.getDate() && r.month === N.value && r.year === W.value), d.value[C.value].class[1] = "active";
83
+ C.value = d.value.findIndex((r) => r.day === w.value.getDate() && r.month === N.value && r.year === J.value), d.value[C.value].class[1] = "active";
84
84
  for (let r = D.value + 1; r < C.value; r++) d.value[r].class[1] = "select";
85
85
  }
86
86
  const x = (r, u) => {
87
87
  d.value = [], B.value = 0, o.value = new Date(r, u, 1), S.value = o.value.getFullYear(), m.value = o.value.getMonth(), T();
88
88
  };
89
89
  return (r, u) => (p(), E("div", ke, [
90
- g("div", null, [
91
- g("p", De, [
92
- g("span", null, [
93
- g("button", {
90
+ y("div", null, [
91
+ y("p", De, [
92
+ y("span", null, [
93
+ y("button", {
94
94
  onClick: u[0] || (u[0] = (s) => x(S.value - 1, m.value))
95
95
  }, "«"),
96
- g("button", {
96
+ y("button", {
97
97
  onClick: u[1] || (u[1] = (s) => x(S.value, m.value - 1))
98
98
  }, "‹")
99
99
  ]),
100
- g("span", Se, [
101
- g("button", null, k(S.value), 1),
102
- g("button", null, k(e(O)(o.value, "{F}")), 1)
100
+ y("span", Se, [
101
+ y("button", null, k(S.value), 1),
102
+ y("button", null, k(e(O)(o.value, "{F}")), 1)
103
103
  ]),
104
- g("span", null, [
105
- g("button", {
104
+ y("span", null, [
105
+ y("button", {
106
106
  onClick: u[2] || (u[2] = (s) => x(S.value, m.value + 1))
107
107
  }, "›"),
108
- g("button", {
108
+ y("button", {
109
109
  onClick: u[3] || (u[3] = (s) => x(S.value + 1, m.value))
110
110
  }, "»")
111
111
  ])
112
112
  ]),
113
- g("div", we, [
114
- (p(), E(G, null, A(7, (s, n) => g("button", {
113
+ y("div", we, [
114
+ (p(), E(G, null, P(7, (s, n) => y("button", {
115
115
  key: n,
116
116
  class: "disabled"
117
117
  }, k(e(O)(new Date(1970, 1, s + e(U)), "{D}")), 1)), 64))
118
118
  ]),
119
- g("div", Ce, [
120
- (p(!0), E(G, null, A(d.value, (s, n) => (p(), E(G, { key: n }, [
119
+ y("div", Ce, [
120
+ (p(!0), E(G, null, P(d.value, (s, n) => (p(), E(G, { key: n }, [
121
121
  n < B.value + (7 - new Date(S.value, m.value + 1, 1).getDay() + e(U)) % 7 ? (p(), E("button", {
122
122
  key: 0,
123
123
  class: ne(s.month === m.value ? s.class : "disabled"),
@@ -129,36 +129,36 @@ const xe = (j, M) => {
129
129
  ])
130
130
  ]),
131
131
  h.range === "range" ? (p(), E("div", $e, [
132
- g("p", Ve, [
133
- g("span", null, [
134
- g("button", {
132
+ y("p", Ve, [
133
+ y("span", null, [
134
+ y("button", {
135
135
  onClick: u[4] || (u[4] = (s) => x(S.value - 1, m.value))
136
136
  }, "«"),
137
- g("button", {
137
+ y("button", {
138
138
  onClick: u[5] || (u[5] = (s) => x(S.value, m.value - 1))
139
139
  }, "‹")
140
140
  ]),
141
- g("span", Me, [
142
- g("button", null, k(new Date(S.value, m.value + 1).getFullYear()), 1),
143
- g("button", null, k(e(O)(o.value.setMonth(m.value + 1), "{F}")), 1)
141
+ y("span", Me, [
142
+ y("button", null, k(new Date(S.value, m.value + 1).getFullYear()), 1),
143
+ y("button", null, k(e(O)(o.value.setMonth(m.value + 1), "{F}")), 1)
144
144
  ]),
145
- g("span", null, [
146
- g("button", {
145
+ y("span", null, [
146
+ y("button", {
147
147
  onClick: u[6] || (u[6] = (s) => x(S.value, m.value + 1))
148
148
  }, "›"),
149
- g("button", {
149
+ y("button", {
150
150
  onClick: u[7] || (u[7] = (s) => x(S.value + 1, m.value))
151
151
  }, "»")
152
152
  ])
153
153
  ]),
154
- g("div", _e, [
155
- (p(), E(G, null, A(7, (s, n) => g("button", {
154
+ y("div", _e, [
155
+ (p(), E(G, null, P(7, (s, n) => y("button", {
156
156
  key: n,
157
157
  class: "disabled"
158
158
  }, k(e(O)(new Date(1970, 1, s + e(U)), "{D}")), 1)), 64))
159
159
  ]),
160
- g("div", Ie, [
161
- (p(!0), E(G, null, A(d.value, (s, n) => (p(), E(G, { key: n }, [
160
+ y("div", Ie, [
161
+ (p(!0), E(G, null, P(d.value, (s, n) => (p(), E(G, { key: n }, [
162
162
  n >= B.value - new Date(S.value, m.value + 1, 1).getDay() + e(U) ? (p(), E("button", {
163
163
  key: 0,
164
164
  class: ne(s.month === R.value.getMonth() ? s.class : "disabled"),
@@ -208,16 +208,16 @@ const xe = (j, M) => {
208
208
  // }
209
209
  ]);
210
210
  f([]);
211
- const h = f((/* @__PURE__ */ new Date()).getFullYear()), J = f(!1), S = f(!1), N = f(!1), W = f({
211
+ const h = f((/* @__PURE__ */ new Date()).getFullYear()), L = f(!1), S = f(!1), N = f(!1), J = f({
212
212
  zIndex: 3,
213
213
  minWidth: 230,
214
214
  x: 500,
215
215
  y: 200
216
- }), m = f(!1), d = f(!1), B = f({ participants: [] }), R = f([]), D = f([]), C = f("Сектор разработок и эксплуатации сети"), X = f([{ value: "all", label: o("vacationSchedule.all"), key: "all" }]), U = f([{ value: h.value, label: h.value }, { value: h.value + 1, label: h.value + 1 }]), H = f(!1), T = f([]), P = f(!1), c = f({ name: "Имя", length: 0, code: "" });
216
+ }), m = f(!1), d = f(!1), B = f({ participants: [] }), R = f([]), D = f([]), C = f("Сектор разработок и эксплуатации сети"), X = f([{ value: "all", label: o("vacationSchedule.all"), key: "all" }]), U = f([{ value: h.value, label: h.value }, { value: h.value + 1, label: h.value + 1 }]), H = f(!1), T = f([]), W = f(!1), c = f({ name: "Имя", length: 0, code: "" });
217
217
  se(C, async (t, l) => {
218
- t !== l && (T.value = [], J.value = !1, M.odata.personalManagerData.forEach((b) => {
218
+ t !== l && (T.value = [], L.value = !1, M.odata.personalManagerData.forEach((b) => {
219
219
  (b.Status !== "Увольнение" && b.Group === t || t === "all") && (T.value.some((a) => (a == null ? void 0 : a.activeText) === b.Role) || T.value.push({ val: !0, activeText: b.Role }));
220
- }), L());
220
+ }), A());
221
221
  });
222
222
  const x = ve(() => w.value.flatMap((t, l) => !t.days || t.days.length === 0 ? [{ ...t, key: 0, ids: l }] : t.days.map((b, a) => ({
223
223
  ids: l,
@@ -229,9 +229,9 @@ const xe = (j, M) => {
229
229
  var l;
230
230
  C.value = (l = t.find((b) => b.Status !== "Увольнение" && b.Description === M.fullName)) == null ? void 0 : l.Group, t.forEach((b) => {
231
231
  b.Status !== "Увольнение" && (X.value.some((a) => (a == null ? void 0 : a.value) === b.Group) || X.value.push({ value: b.Group, label: b.Group, key: b.Group }), b.Group === C.value && !T.value.some((a) => (a == null ? void 0 : a.activeText) === b.Role) && T.value.push({ val: !0, activeText: b.Role }));
232
- }), L(), S.value = !1;
232
+ }), A(), S.value = !1;
233
233
  });
234
- }, L = () => {
234
+ }, A = () => {
235
235
  w.value = [];
236
236
  let t = [];
237
237
  M.odata.personalManagerData.forEach((l) => {
@@ -240,7 +240,7 @@ const xe = (j, M) => {
240
240
  }, Q = (t) => {
241
241
  M.workSchedule.getAllVacations({ year: h.value }).then(
242
242
  (l) => {
243
- console.log(t), t.forEach((b, a) => {
243
+ t.forEach((b, a) => {
244
244
  w.value[a].days = [{ note: "" }], l.forEach((I) => {
245
245
  b === I.code && (typeof w.value[a].days[0].dateStart > "u" ? w.value[a].days[0] = {
246
246
  dateStart: O(I.dateStart, "{dd}.{m}.{Y}"),
@@ -267,7 +267,7 @@ const xe = (j, M) => {
267
267
  colspan: 0
268
268
  };
269
269
  }, r = (t, l, b, a) => {
270
- c.value.ids = t.ids, c.value.key = t.key, c.value.startDate = t.dateStart, c.value.endDate = t.dateEnd, c.value.name = t.name, c.value.count = t.count, c.value.length = t.days.length, c.value.add = t.days.length > 0 && t.days[t.days.length - 1].count, c.value.level = l.level, c.value.holiday = D.value, W.value.y = a.clientY, W.value.x = a.clientX, l.level === 2 && l.no < 4 && (c.value.add || t.days.length > 1) && (N.value = !0), l.level === 3 && (N.value = !0);
270
+ c.value.ids = t.ids, c.value.key = t.key, c.value.startDate = t.dateStart, c.value.endDate = t.dateEnd, c.value.name = t.name, c.value.count = t.count, c.value.length = t.days.length, c.value.add = t.days.length > 0 && t.days[t.days.length - 1].count, c.value.level = l.level, c.value.holiday = D.value, J.value.y = a.clientY, J.value.x = a.clientX, l.level === 2 && l.no < 4 && (c.value.add || t.days.length > 1) && (N.value = !0), l.level === 3 && (N.value = !0);
271
271
  }, u = (t) => {
272
272
  console.log(t);
273
273
  let l = w.value[c.value.ids];
@@ -276,15 +276,15 @@ const xe = (j, M) => {
276
276
  l.days.push({ note: "" }), console.log(l.days.length);
277
277
  break;
278
278
  case "delete":
279
- delete l.days.pop(), y(c.value.ids);
279
+ delete l.days.pop(), g(c.value.ids);
280
280
  break;
281
281
  }
282
282
  N.value = !1;
283
283
  }, s = (t) => {
284
- P.value = t, c.value.count = t.count;
284
+ W.value = t, c.value.count = t.count;
285
285
  }, n = () => {
286
- P.value && (console.log(P.value), w.value[c.value.ids].days[c.value.key] = { ...P.value, note: "" }, y(c.value.ids)), N.value = !1;
287
- }, y = (t) => {
286
+ W.value && (w.value[c.value.ids].days[c.value.key] = { ...W.value, note: "" }, g(c.value.ids)), N.value = !1;
287
+ }, g = (t) => {
288
288
  M.workSchedule.rewriteFull({
289
289
  year: h.value,
290
290
  code: w.value[t].code,
@@ -298,10 +298,10 @@ const xe = (j, M) => {
298
298
  }, _ = (t) => {
299
299
  M.workSchedule.sendConfirmMessage({ fullname: M.fullName, confirm: t }), M.query = "";
300
300
  }, $ = () => {
301
- M.workSchedule.sendAgreementMessage({ users: B.value.participants }), console.log("sendAgreement"), d.value = !1;
301
+ M.workSchedule.sendAgreementMessage({ users: B.value.participants }), d.value = !1;
302
302
  };
303
303
  return M.workSchedule.getBoss().then((t) => {
304
- console.log(t), R.value = t[0].users;
304
+ R.value = t[0].users;
305
305
  }), ce().then((t) => {
306
306
  D.value = t, Z();
307
307
  }), (t, l) => {
@@ -315,7 +315,7 @@ const xe = (j, M) => {
315
315
  style: { width: "240px", "margin-bottom": ".5rem", "margin-right": ".5rem" }
316
316
  }, {
317
317
  default: i(() => [
318
- (p(!0), E(G, null, A(X.value, (a) => (p(), Y(e(le), {
318
+ (p(!0), E(G, null, P(X.value, (a) => (p(), Y(e(le), {
319
319
  key: a.value,
320
320
  label: a.label,
321
321
  value: a.value
@@ -336,12 +336,12 @@ const xe = (j, M) => {
336
336
  v(e(ae), {
337
337
  modelValue: h.value,
338
338
  "onUpdate:modelValue": l[2] || (l[2] = (a) => h.value = a),
339
- onChange: L,
339
+ onChange: A,
340
340
  placeholder: "Year",
341
341
  style: { width: "240px", "margin-bottom": ".5rem", "margin-right": ".5rem" }
342
342
  }, {
343
343
  default: i(() => [
344
- (p(!0), E(G, null, A(U.value, (a) => (p(), Y(e(le), {
344
+ (p(!0), E(G, null, P(U.value, (a) => (p(), Y(e(le), {
345
345
  key: a.value,
346
346
  label: a.label,
347
347
  value: a.value
@@ -469,7 +469,7 @@ const xe = (j, M) => {
469
469
  style: { width: "100%" },
470
470
  placeholder: " ",
471
471
  class: "noBorder",
472
- onBlur: (I) => y(x.value[a.$index].ids)
472
+ onBlur: (I) => g(x.value[a.$index].ids)
473
473
  }, null, 8, ["modelValue", "onUpdate:modelValue", "onBlur"])
474
474
  ]),
475
475
  _: 1
@@ -484,7 +484,7 @@ const xe = (j, M) => {
484
484
  _: 1
485
485
  }, 8, ["loading"]),
486
486
  j.checkEdit ? (p(), E("div", je, [
487
- J.value ? z("", !0) : (p(), Y(e(F), {
487
+ L.value ? z("", !0) : (p(), Y(e(F), {
488
488
  key: 0,
489
489
  type: "primary",
490
490
  onClick: l[3] || (l[3] = (a) => d.value = !0)
@@ -547,7 +547,7 @@ const xe = (j, M) => {
547
547
  v(e(F), {
548
548
  size: "default",
549
549
  type: "primary",
550
- onClick: L
550
+ onClick: A
551
551
  }, {
552
552
  default: i(() => [
553
553
  V(k(t.$t("workSchedule.select")), 1)
@@ -561,9 +561,9 @@ const xe = (j, M) => {
561
561
  autocomplete: "on"
562
562
  }, {
563
563
  default: i(() => [
564
- (p(!0), E(G, null, A(T.value, (a) => (p(), Y(e(me), null, {
564
+ (p(!0), E(G, null, P(T.value, (a) => (p(), Y(e(me), null, {
565
565
  default: i(() => [
566
- v(e(ge), {
566
+ v(e(ye), {
567
567
  modelValue: a.val,
568
568
  "onUpdate:modelValue": (I) => a.val = I,
569
569
  "active-text": a.activeText
@@ -578,7 +578,7 @@ const xe = (j, M) => {
578
578
  _: 1
579
579
  }, 8, ["title", "modelValue"]),
580
580
  v(e(ue), {
581
- title: "Прошу согласовать график отпусков по отделу",
581
+ title: e(o)("vacationSchedule.pleaseCoordinate"),
582
582
  modelValue: d.value,
583
583
  "onUpdate:modelValue": l[10] || (l[10] = (a) => d.value = a),
584
584
  width: "500px"
@@ -618,7 +618,7 @@ const xe = (j, M) => {
618
618
  size: "default"
619
619
  }, {
620
620
  default: i(() => [
621
- (p(!0), E(G, null, A(R.value, (a) => (p(), Y(e(le), {
621
+ (p(!0), E(G, null, P(R.value, (a) => (p(), Y(e(le), {
622
622
  key: a,
623
623
  label: a,
624
624
  value: a
@@ -631,11 +631,11 @@ const xe = (j, M) => {
631
631
  }, 8, ["model"])
632
632
  ]),
633
633
  _: 1
634
- }, 8, ["modelValue"]),
635
- v(e(ye), {
634
+ }, 8, ["title", "modelValue"]),
635
+ v(e(ge), {
636
636
  show: N.value,
637
637
  "onUpdate:show": l[14] || (l[14] = (a) => N.value = a),
638
- options: W.value
638
+ options: J.value
639
639
  }, {
640
640
  default: i(() => [
641
641
  v(e(te), {
@@ -660,7 +660,7 @@ const xe = (j, M) => {
660
660
  range: "range",
661
661
  onInput: s
662
662
  }, null, 8, ["data"]),
663
- g("div", null, [
663
+ y("div", null, [
664
664
  v(e(F), {
665
665
  onClick: l[13] || (l[13] = (a) => N.value = !1)
666
666
  }, {
@@ -1,3 +1,3 @@
1
- "use strict";const e=require("vue"),ne=require("file-saver"),oe=require("exceljs"),g=require("./index-CHGzf-XH.cjs"),ue=require("vue-i18n"),i=require("element-plus"),q=require("@imengyu/vue3-context-menu");function re(y){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(y){for(const C in y)if(C!=="default"){const f=Object.getOwnPropertyDescriptor(y,C);Object.defineProperty(u,C,f.get?f:{enumerable:!0,get:()=>y[C]})}}return u.default=y,Object.freeze(u)}const ie=re(oe),de={style:{height:"100px",width:"100%",display:"inline-block"}},se={style:{height:"100px",width:"100%",display:"inline-block"}},ce={key:3,class:"controls-container",style:{"margin-top":".5rem"}},ve={key:0,style:{padding:"0.5em 1.5em"}},ge={key:1,style:{padding:"0.5em 1.5em"}},me={__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"}},setup(y){const{t:u,d:C}=ue.useI18n(),f=y,T=e.ref(!1),n=e.ref([]),M=e.ref(1),w=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(M.value))),r=e.ref([]),E=e.ref(0),S=e.ref(9),p=e.ref(8),A=e.ref(!1),H=e.ref(!0),D=e.ref(!1),R=e.ref("5"),$=e.ref(1),x=e.ref("Сектор разработок и эксплуатации сети"),Y=e.ref([]),V=e.ref([]),s=e.ref({name:"Имя",length:0,code:""}),I=e.ref(!1),U=e.ref({zIndex:30,minWidth:220,x:500,y:200}),O=e.ref({});e.watch(x,async(a,l)=>{a!==l&&(V.value=[],A.value=!1,f.odata.personalManagerData.forEach(o=>{o.Status!=="Увольнение"&&o.Group===a&&(V.value.some(t=>(t==null?void 0:t.activeText)===o.Role)||V.value.push({val:!0,activeText:o.Role}))}),G())}),e.watch(M,async(a,l)=>{a!==l&&(w.value=new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(a)),P())});const Z=(a,l,o,t)=>{s.value.ids=a.ids,s.value.key=a.key,s.value.add=a.days.length>0&&a.days[a.days.length-1].cont,s.value.level=l.level,s.value.day=o.cellIndex,U.value.y=t.clientY,U.value.x=t.clientX,l.level===2&&l.no===0&&f.checkEdit&&(s.value.name=u("workSchedule.autocomplete"),I.value=!0),l.level===3&&o.cellIndex-l.no===1&&f.checkEdit&&(b(o.cellIndex,a.ids),s.value.name=u("workSchedule.modeSelection"),I.value=!0)},P=()=>{const a=O.value,l=new Date(w.value),o=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let t=[],d=0;for(let m=1;m<=o;m++){const h=g.parseTime(l.setDate(m),"{Y}-{m}-{dd}");d+=a.nowork.includes(h)||a.holidays.includes(h)?0:a.preholidays.includes(h)?7:8;const c=a.nowork.includes(h)?"nowork":a.holidays.includes(h)?"holiday":a.preholidays.includes(h)?"preholiday":"";t.push({day:m,holidays:c,weekday:C(new Date(l.getFullYear(),l.getMonth(),m),"day")})}E.value=d,r.value=t,f.odata.getPersonalManagerData({}).then(m=>{var h;x.value=(h=m.find(c=>c.Status!=="Увольнение"&&c.Description===f.fullName))==null?void 0:h.Group,m.forEach(c=>{c.Status!=="Увольнение"&&(Y.value.some(k=>(k==null?void 0:k.value)===c.Group)||Y.value.push({value:c.Group,label:c.Group,key:c.Group}),c.Group===x.value&&!V.value.some(k=>(k==null?void 0:k.activeText)===c.Role)&&V.value.push({val:!0,activeText:c.Role}))}),G(),H.value=!1})},Q=e.computed(()=>!n.value.some(a=>a.contHour!==E.value)),W=(a,l)=>{var m,h,c;const o=new Date(w.value),t=`${o.getFullYear()}-${(o.getMonth()+1).toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}`,d=(m=n.value[l])==null?void 0:m.days.findIndex(k=>k.day===t);return l===-1||d===-1?"":((h=n.value[l].days[d])==null?void 0:h.time)+" "+((c=n.value[l].days[d])==null?void 0:c.tips)},G=()=>{n.value=[];let a=[];f.odata.personalManagerData.forEach(l=>{if(l.Status!=="Увольнение"&&l.Group===x.value&&V.value.some(o=>o.val&&o.activeText===l.Role)){let o=g.byInitials(l.Description);a.push(l.Code),n.value.push({name:o+" ("+l.Role+")",days:[],contHour:0,code:l.Code,id:!1,ids:n.value.length})}}),X(a),D.value=!1},X=a=>{f.workSchedule.getWorkSchedule({code:a,date:g.parseTime(new Date(w.value),"{Y}-{m}-{dd}")}).then(l=>{l.forEach((o,t)=>{o!==null&&(n.value[t].days=o.data.days,n.value[t].id=o.id)}),N()})},N=()=>{n.value.forEach(a=>{a.contHour=a.days.reduce((l,o)=>l+o.time,0)})},K=a=>{n.value[a].days=[],N()},_=a=>{switch(R.value){case"5":for(let l=$.value;l<=r.value.length;l++)r.value[l-1].holidays===""&&b(l,a,!0),r.value[l-1].holidays==="preholiday"&&(p.value-=1,b(l,a,!0),p.value+=1);break;case"2x2":for(let l=$.value;l<=r.value.length;l+=4)b(l,a,!0),l+1<=r.value.length&&b(l+1,a,!0);break;case"2x5":for(let l=$.value;l<=r.value.length;l+=7)for(let o=l;o<l+5&&o<=r.value.length;o++)r.value[o-1].holidays==="preholiday"?(p.value-=1,b(o,a,!0),p.value+=1):b(o,a,!0);break}},b=(a,l,o=!1)=>{const{date:t,ind:d}=z(a,l);d===-1?(n.value[l].days.push({day:t,time:p.value,tips:`(${S.value}:00 - ${S.value+p.value+1}:00)`}),N()):o||(p.value=n.value[l].days[d].time,S.value=parseInt(n.value[l].days[d].tips.slice(1,-12)))},ee=(a,l)=>{const{ind:o}=z(a,l);n.value[l].days.splice(o,1),N(),document.querySelector(".app-main").click()},L=(a,l)=>{const{date:o,ind:t}=z(a,l);n.value[l].days[t]={day:o,time:p.value,tips:`(${S.value}:00 - ${S.value+p.value+1}:00)`},N()},z=(a,l)=>{var d;const o=g.parseTime(new Date(w.value).setDate(a),"{Y}-{m}-{dd}"),t=(d=n.value[l])==null?void 0:d.days.findIndex(m=>m.day===o);return{date:o,ind:t}},le=async()=>{var J;T.value=!0;const a=new ie.Workbook,l=a.addWorksheet(C(w.value,"month"),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),o={vertical:"middle",horizontal:"center"},t={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},d={vertical:"middle",horizontal:"center",wrapText:!0};l.mergeCells(`A1:${g.cellsDynamically("A1",r.value.length+5)}1`),l.mergeCells(`A2:${g.cellsDynamically("A2",r.value.length+5)}2`),l.mergeCells("A3:A4"),l.mergeCells(`B3:${g.cellsDynamically("B3",r.value.length)}3`),l.mergeCells(`${g.cellsDynamically("B3",r.value.length+1)}3:${g.cellsDynamically("B3",r.value.length+2)}3`),l.mergeCells(`${g.cellsDynamically("B3",r.value.length+3)}3:${g.cellsDynamically("B4",r.value.length+3)}4`),l.mergeCells(`${g.cellsDynamically("B3",r.value.length+4)}3:${g.cellsDynamically("B4",r.value.length+4)}4`),l.getCell("A1").value=u("workSchedule.firm"),l.getCell("A2").value=u("workSchedule.title",{name:x.value})+C(w.value,"month")+` ${new Date(w.value).getFullYear()}`,l.getCell("A3").value=u("workSchedule.month"),l.getCell("B3").value=u("workSchedule.numbersMonth"),l.getCell(3,r.value.length+2).value=u("workSchedule.onSchedule"),l.getCell(3,r.value.length+4).value=u("workSchedule.acquainted"),l.getCell(3,r.value.length+5).value=u("workSchedule.date"),l.getCell(4,r.value.length+2).value=u("workSchedule.days"),l.getCell(4,r.value.length+3).value=`${u("workSchedule.hours")} (${E.value})`;for(let v=2;v<=r.value.length+1;v++)l.getCell(4,v).value=r.value[v-2].weekday+`
1
+ "use strict";const e=require("vue"),ne=require("file-saver"),oe=require("exceljs"),g=require("./index-CHGzf-XH.cjs"),ue=require("vue-i18n"),i=require("element-plus"),q=require("@imengyu/vue3-context-menu");function re(y){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(y){for(const C in y)if(C!=="default"){const f=Object.getOwnPropertyDescriptor(y,C);Object.defineProperty(u,C,f.get?f:{enumerable:!0,get:()=>y[C]})}}return u.default=y,Object.freeze(u)}const ie=re(oe),de={style:{height:"100px",width:"100%",display:"inline-block"}},se={style:{height:"100px",width:"100%",display:"inline-block"}},ce={key:3,class:"controls-container",style:{"margin-top":".5rem"}},ve={key:0,style:{padding:"0.5em 1.5em"}},ge={key:1,style:{padding:"0.5em 1.5em"}},me={__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"}},setup(y){const{t:u,d:C}=ue.useI18n(),f=y,T=e.ref(!1),n=e.ref([]),M=e.ref("1"),w=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(M.value))),r=e.ref([]),E=e.ref(0),S=e.ref(9),p=e.ref(8),A=e.ref(!1),H=e.ref(!0),D=e.ref(!1),R=e.ref("5"),$=e.ref(1),x=e.ref("Сектор разработок и эксплуатации сети"),Y=e.ref([]),V=e.ref([]),s=e.ref({name:"Имя",length:0,code:""}),I=e.ref(!1),U=e.ref({zIndex:30,minWidth:220,x:500,y:200}),O=e.ref({});e.watch(x,async(a,l)=>{a!==l&&(V.value=[],A.value=!1,f.odata.personalManagerData.forEach(o=>{o.Status!=="Увольнение"&&o.Group===a&&(V.value.some(t=>(t==null?void 0:t.activeText)===o.Role)||V.value.push({val:!0,activeText:o.Role}))}),G())}),e.watch(M,async(a,l)=>{w.value=new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(a)),P()});const Z=(a,l,o,t)=>{s.value.ids=a.ids,s.value.key=a.key,s.value.add=a.days.length>0&&a.days[a.days.length-1].cont,s.value.level=l.level,s.value.day=o.cellIndex,U.value.y=t.clientY,U.value.x=t.clientX,l.level===2&&l.no===0&&f.checkEdit&&(s.value.name=u("workSchedule.autocomplete"),I.value=!0),l.level===3&&o.cellIndex-l.no===1&&f.checkEdit&&(b(o.cellIndex,a.ids),s.value.name=u("workSchedule.modeSelection"),I.value=!0)},P=()=>{const a=O.value,l=new Date(w.value),o=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let t=[],d=0;for(let m=1;m<=o;m++){const h=g.parseTime(l.setDate(m),"{Y}-{m}-{dd}");d+=a.nowork.includes(h)||a.holidays.includes(h)?0:a.preholidays.includes(h)?7:8;const c=a.nowork.includes(h)?"nowork":a.holidays.includes(h)?"holiday":a.preholidays.includes(h)?"preholiday":"";t.push({day:m,holidays:c,weekday:C(new Date(l.getFullYear(),l.getMonth(),m),"day")})}E.value=d,r.value=t,f.odata.getPersonalManagerData({}).then(m=>{var h;x.value=(h=m.find(c=>c.Status!=="Увольнение"&&c.Description===f.fullName))==null?void 0:h.Group,m.forEach(c=>{c.Status!=="Увольнение"&&(Y.value.some(k=>(k==null?void 0:k.value)===c.Group)||Y.value.push({value:c.Group,label:c.Group,key:c.Group}),c.Group===x.value&&!V.value.some(k=>(k==null?void 0:k.activeText)===c.Role)&&V.value.push({val:!0,activeText:c.Role}))}),G(),H.value=!1})},Q=e.computed(()=>!n.value.some(a=>a.contHour!==E.value)),W=(a,l)=>{var m,h,c;const o=new Date(w.value),t=`${o.getFullYear()}-${(o.getMonth()+1).toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}`,d=(m=n.value[l])==null?void 0:m.days.findIndex(k=>k.day===t);return l===-1||d===-1?"":((h=n.value[l].days[d])==null?void 0:h.time)+" "+((c=n.value[l].days[d])==null?void 0:c.tips)},G=()=>{n.value=[];let a=[];f.odata.personalManagerData.forEach(l=>{if(l.Status!=="Увольнение"&&l.Group===x.value&&V.value.some(o=>o.val&&o.activeText===l.Role)){let o=g.byInitials(l.Description);a.push(l.Code),n.value.push({name:o+" ("+l.Role+")",days:[],contHour:0,code:l.Code,id:!1,ids:n.value.length})}}),X(a),D.value=!1},X=a=>{f.workSchedule.getWorkSchedule({code:a,date:g.parseTime(new Date(w.value),"{Y}-{m}-{dd}")}).then(l=>{l.forEach((o,t)=>{o!==null&&(n.value[t].days=o.data.days,n.value[t].id=o.id)}),N()})},N=()=>{n.value.forEach(a=>{a.contHour=a.days.reduce((l,o)=>l+o.time,0)})},K=a=>{n.value[a].days=[],N()},_=a=>{switch(R.value){case"5":for(let l=$.value;l<=r.value.length;l++)r.value[l-1].holidays===""&&b(l,a,!0),r.value[l-1].holidays==="preholiday"&&(p.value-=1,b(l,a,!0),p.value+=1);break;case"2x2":for(let l=$.value;l<=r.value.length;l+=4)b(l,a,!0),l+1<=r.value.length&&b(l+1,a,!0);break;case"2x5":for(let l=$.value;l<=r.value.length;l+=7)for(let o=l;o<l+5&&o<=r.value.length;o++)r.value[o-1].holidays==="preholiday"?(p.value-=1,b(o,a,!0),p.value+=1):b(o,a,!0);break}},b=(a,l,o=!1)=>{const{date:t,ind:d}=z(a,l);d===-1?(n.value[l].days.push({day:t,time:p.value,tips:`(${S.value}:00 - ${S.value+p.value+1}:00)`}),N()):o||(p.value=n.value[l].days[d].time,S.value=parseInt(n.value[l].days[d].tips.slice(1,-12)))},ee=(a,l)=>{const{ind:o}=z(a,l);n.value[l].days.splice(o,1),N(),document.querySelector(".app-main").click()},L=(a,l)=>{const{date:o,ind:t}=z(a,l);n.value[l].days[t]={day:o,time:p.value,tips:`(${S.value}:00 - ${S.value+p.value+1}:00)`},N()},z=(a,l)=>{var d;const o=g.parseTime(new Date(w.value).setDate(a),"{Y}-{m}-{dd}"),t=(d=n.value[l])==null?void 0:d.days.findIndex(m=>m.day===o);return{date:o,ind:t}},le=async()=>{var J;T.value=!0;const a=new ie.Workbook,l=a.addWorksheet(C(w.value,"month"),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),o={vertical:"middle",horizontal:"center"},t={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},d={vertical:"middle",horizontal:"center",wrapText:!0};l.mergeCells(`A1:${g.cellsDynamically("A1",r.value.length+5)}1`),l.mergeCells(`A2:${g.cellsDynamically("A2",r.value.length+5)}2`),l.mergeCells("A3:A4"),l.mergeCells(`B3:${g.cellsDynamically("B3",r.value.length)}3`),l.mergeCells(`${g.cellsDynamically("B3",r.value.length+1)}3:${g.cellsDynamically("B3",r.value.length+2)}3`),l.mergeCells(`${g.cellsDynamically("B3",r.value.length+3)}3:${g.cellsDynamically("B4",r.value.length+3)}4`),l.mergeCells(`${g.cellsDynamically("B3",r.value.length+4)}3:${g.cellsDynamically("B4",r.value.length+4)}4`),l.getCell("A1").value=u("workSchedule.firm"),l.getCell("A2").value=u("workSchedule.title",{name:x.value})+C(w.value,"month")+` ${new Date(w.value).getFullYear()}`,l.getCell("A3").value=u("workSchedule.month"),l.getCell("B3").value=u("workSchedule.numbersMonth"),l.getCell(3,r.value.length+2).value=u("workSchedule.onSchedule"),l.getCell(3,r.value.length+4).value=u("workSchedule.acquainted"),l.getCell(3,r.value.length+5).value=u("workSchedule.date"),l.getCell(4,r.value.length+2).value=u("workSchedule.days"),l.getCell(4,r.value.length+3).value=`${u("workSchedule.hours")} (${E.value})`;for(let v=2;v<=r.value.length+1;v++)l.getCell(4,v).value=r.value[v-2].weekday+`
2
2
  `+(v-1),l.getColumn(v).width=6,l.getColumn(v).alignment=d,l.getCell(4,v).border=t;l.getRow(1).height=40,l.getRow(2).height=30,l.getRow(3).height=20,l.getColumn(1).width=15,l.getColumn(r.value.length+2).width=5,l.getColumn(r.value.length+3).width=6,l.getColumn(r.value.length+4).width=13,l.getColumn(r.value.length+5).width=13,l.getColumn(1).alignment=d,l.getCell("A2").alignment=o,l.getCell("A3").alignment=o,l.getCell("B3").alignment=o,l.getCell(3,r.value.length+2).alignment=o,l.getColumn(r.value.length+2).alignment=d,l.getColumn(r.value.length+3).alignment=d,l.getColumn(r.value.length+4).alignment=o,l.getColumn(r.value.length+5).alignment=o,l.getCell("A3").border=t,l.getCell("B3").border=t,l.getCell(3,r.value.length+2).border=t,l.getCell(4,r.value.length+2).border=t,l.getCell(3,r.value.length+4).border=t,l.getCell(3,r.value.length+5).border=t,l.getCell(4,r.value.length+3).border=t;let m=0;for(const v of n.value){let F=[v.name];for(let B=1;B<=r.value.length;B++){const{ind:j}=z(B,m);j!==-1?F[B]=`${v.days[j].time} ${v.days[j].tips}`:F[B]=" "}F.push(((J=v.days)==null?void 0:J.length)||" ",v.contHour||0);const ae=l.addRow(F);ae.border=t,m++}let h="Начальник отдела";f.odata.personalManagerData.forEach(v=>{v.Status!=="Увольнение"&&v.Role==="Начальник отдела правовой и кадровой работы"&&(h=v.Description)}),l.mergeCells(`A${n.value.length+6}:P${n.value.length+6}`),l.mergeCells(`Q${n.value.length+6}:AG${n.value.length+6}`),l.mergeCells(`B${n.value.length+8}:E${n.value.length+8}`),l.mergeCells(`F${n.value.length+8}:L${n.value.length+8}`),l.mergeCells(`M${n.value.length+8}:P${n.value.length+8}`),l.mergeCells(`S${n.value.length+8}:V${n.value.length+8}`),l.mergeCells(`W${n.value.length+8}:AC${n.value.length+8}`),l.mergeCells(`AD${n.value.length+8}:AG${n.value.length+8}`),l.mergeCells(`Z${n.value.length+9}:AA${n.value.length+9}`),l.getCell(`A${n.value.length+6}`).value=u("workSchedule.byInitials"),l.getCell(`Q${n.value.length+6}`).value=u("workSchedule.supervisorHR"),l.getCell(`B${n.value.length+8}`).value=u("workSchedule.compiled")+":",l.getCell(`S${n.value.length+8}`).value=u("workSchedule.approved")+":",l.getCell(`M${n.value.length+8}`).value=g.byInitials(f.fullName),l.getCell(`AD${n.value.length+8}`).value=g.byInitials(h),l.getCell(`Z${n.value.length+9}`).value=u("workSchedule.printPlace"),l.getCell(`A${n.value.length+6}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`Q${n.value.length+6}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`B${n.value.length+8}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`F${n.value.length+8}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`M${n.value.length+8}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`AD${n.value.length+8}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`Z${n.value.length+9}`).alignment=o,l.getCell(`F${n.value.length+8}`).border={bottom:{style:"thin"}},l.getCell(`W${n.value.length+8}`).border={bottom:{style:"thin"}};const c="export_"+g.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",k=await a.xlsx.writeBuffer();ne.saveAs(new Blob([k]),c),T.value=!1},te=async()=>{A.value||f.workSchedule.addWorkSchedule({data:n.value,date:g.parseTime(new Date(w.value),"{Y}-{m}-{dd}")}).then(a=>A.value=a)};return g.holidays().then(a=>{O.value=a,P()}),(a,l)=>{const o=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",null,[y.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElSelect),{key:0,modelValue:x.value,"onUpdate:modelValue":l[0]||(l[0]=t=>x.value=t),placeholder:"Select",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Y.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElOption),{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),y.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:1,plain:"",onClick:l[1]||(l[1]=t=>D.value=!0),style:{"margin-bottom":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.jobTitle")),1)]),_:1})):e.createCommentVNode("",!0),y.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElSwitch),{key:2,modelValue:M.value,"onUpdate:modelValue":l[2]||(l[2]=t=>M.value=t),"active-text":e.unref(u)("workSchedule.currentMonth"),"active-value":"0","inactive-value":"1",style:{"margin-bottom":".5rem","margin-left":".5rem"}},null,8,["modelValue","active-text"])):e.createCommentVNode("",!0),e.createVNode(e.unref(i.ElSkeleton),{style:{width:"100%"},loading:H.value,animated:""},{template:e.withCtx(()=>[e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"100%",height:"2rem"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"4rem","margin-right":"4px"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"4rem"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"8rem","margin-right":"4px"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"8rem"}})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTable),{id:"printTable",data:n.value,style:{width:"100%"},size:"small",align:"center",onCellClick:Z,"empty-text":e.unref(u)("workSchedule.emptyText")},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(u)("workSchedule.title",{name:x.value})+e.unref(C)(w.value,"month")+` ${new Date(w.value).getFullYear()}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(u)("workSchedule.month"),width:"180",align:"center"},{default:e.withCtx(t=>[e.createElementVNode("div",de,e.toDisplayString(n.value[t.$index].name),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(u)("workSchedule.numbersMonth"),align:"center"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElTableColumn),{key:t.day,width:"45","class-name":t.holidays,align:"center",label:t.weekday+`
3
3
  `+t.day.toString()},{default:e.withCtx(d=>[e.createElementVNode("div",se,e.toDisplayString(W(t.day,d.$index)||" "),1)]),_:2},1032,["class-name","label"]))),128))]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(u)("workSchedule.onSchedule"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(u)("workSchedule.days"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(n.value[t.$index].days.length||0),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:`${e.unref(u)("workSchedule.hours")} ( ${E.value} )`,align:"center"},{default:e.withCtx(t=>[e.createElementVNode("div",{style:e.normalizeStyle(`color: ${E.value===t.row.contHour?"green":"red"};`)},e.toDisplayString(t.row.contHour),5)]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["data","empty-text"])]),_:1},8,["loading"]),Q.value&&y.checkEdit?(e.openBlock(),e.createElementBlock("div",ce,[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.chartsFilled"))+": ",1),A.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:0,type:"primary",onClick:te},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.confirm")),1)]),_:1})),l[17]||(l[17]=e.createTextVNode()),e.createElementVNode("span",null,e.toDisplayString(y.fullName),1)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(i.ElButton),{disabled:T.value,plain:"",onClick:le,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[o,T.value]]),e.createVNode(e.unref(i.ElDialog),{title:e.unref(u)("workSchedule.jobTitle"),modelValue:D.value,"onUpdate:modelValue":l[4]||(l[4]=t=>D.value=t),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(i.ElButton),{onClick:l[3]||(l[3]=t=>D.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{size:"default",type:"primary",onClick:G},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElForm),{ref:"dialogForm",model:V.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElSwitch),{modelValue:t.val,"onUpdate:modelValue":d=>t.val=d,"active-text":t.activeText},null,8,["modelValue","onUpdate:modelValue","active-text"])]),_:2},1024))),256))]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(q.ContextMenu),{show:I.value,"onUpdate:show":l[16]||(l[16]=t=>I.value=t),options:U.value},{default:e.withCtx(()=>[e.createVNode(e.unref(q.ContextMenuItem),{label:s.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(q.ContextMenuSeparator)),s.value.level===2?(e.openBlock(),e.createElementBlock("div",ve,[e.createVNode(e.unref(i.ElRadioGroup),{modelValue:R.value,"onUpdate:modelValue":l[5]||(l[5]=t=>R.value=t),size:"small"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElRadioButton),{label:e.unref(u)("workSchedule.Days5"),value:"5"},null,8,["label"]),e.createVNode(e.unref(i.ElRadioButton),{label:"2 Х 2",value:"2x2"}),e.createVNode(e.unref(i.ElRadioButton),{label:"2 Х 5",value:"2x5"})]),_:1},8,["modelValue"]),l[18]||(l[18]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(u)("workSchedule.fromDate"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:$.value,"onUpdate:modelValue":l[6]||(l[6]=t=>$.value=t),step:1,min:1,max:r.value.length},null,8,["modelValue","max"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(u)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:S.value,"onUpdate:modelValue":l[7]||(l[7]=t=>S.value=t),step:1,min:8,max:11},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(u)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:p.value,"onUpdate:modelValue":l[8]||(l[8]=t=>p.value=t),step:1,min:4,max:12},null,8,["modelValue"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[9]||(l[9]=t=>_(s.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.fillOut")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[10]||(l[10]=t=>K(s.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.clearRow")),1)]),_:1})])):(e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("div",null,e.toDisplayString(W(s.value.day,s.value.ids)),1),l[19]||(l[19]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(u)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:S.value,"onUpdate:modelValue":l[11]||(l[11]=t=>S.value=t),step:1,min:8,max:11,onChange:l[12]||(l[12]=t=>L(s.value.day,s.value.ids))},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(u)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:p.value,"onUpdate:modelValue":l[13]||(l[13]=t=>p.value=t),step:1,min:4,max:12,onChange:l[14]||(l[14]=t=>L(s.value.day,s.value.ids))},null,8,["modelValue"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[15]||(l[15]=t=>ee(s.value.day,s.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.delete")),1)]),_:1})]))]),_:1},8,["show","options"])])}}};module.exports=me;
package/dist/WorkTable.js CHANGED
@@ -3,7 +3,7 @@ import { saveAs as Ve } from "file-saver";
3
3
  import * as Ee from "exceljs";
4
4
  import { p as H, b as ne, h as Me, c as D } from "./index-uVRk2ARj.js";
5
5
  import { useI18n as Ae } from "vue-i18n";
6
- import { ElSelect as Be, ElOption as Te, ElButton as A, ElSwitch as he, ElSkeleton as ze, ElSkeletonItem as W, ElTable as Fe, ElTableColumn as z, ElDialog as Re, ElForm as Ie, ElFormItem as Ye, ElRadioGroup as Ue, ElRadioButton as ue, ElSlider as P } from "element-plus";
6
+ import { ElSelect as Be, ElOption as Te, ElButton as A, ElSwitch as he, ElSkeleton as ze, ElSkeletonItem as W, ElTable as Fe, ElTableColumn as z, ElDialog as Ie, ElForm as Re, ElFormItem as Ye, ElRadioGroup as Ue, ElRadioButton as ue, ElSlider as P } from "element-plus";
7
7
  import { ContextMenu as Ge, ContextMenuItem as Ne, ContextMenuSeparator as He } from "@imengyu/vue3-context-menu";
8
8
  const We = { style: { height: "100px", width: "100%", display: "inline-block" } }, Pe = { style: { height: "100px", width: "100%", display: "inline-block" } }, je = {
9
9
  key: 3,
@@ -37,7 +37,7 @@ const We = { style: { height: "100px", width: "100%", display: "inline-block" }
37
37
  // code: '0000-00052'
38
38
  // ids: 1
39
39
  // }
40
- ]), L = v(1), C = v(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1).setMonth((/* @__PURE__ */ new Date()).getMonth() + Number(L.value))), o = v([]), R = v(0), x = v(9), w = v(8), Z = v(!1), oe = v(!0), I = v(!1), X = v("5"), Y = v(1), V = v("Сектор разработок и эксплуатации сети"), K = v([]), E = v([]), h = v({ name: "Имя", length: 0, code: "" }), q = v(!1), _ = v({
40
+ ]), L = v("1"), C = v(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1).setMonth((/* @__PURE__ */ new Date()).getMonth() + Number(L.value))), o = v([]), I = v(0), x = v(9), w = v(8), Z = v(!1), oe = v(!0), R = v(!1), X = v("5"), Y = v(1), V = v("Сектор разработок и эксплуатации сети"), K = v([]), E = v([]), h = v({ name: "Имя", length: 0, code: "" }), q = v(!1), _ = v({
41
41
  zIndex: 30,
42
42
  minWidth: 220,
43
43
  x: 500,
@@ -48,7 +48,7 @@ const We = { style: { height: "100px", width: "100%", display: "inline-block" }
48
48
  u.Status !== "Увольнение" && u.Group === a && (E.value.some((l) => (l == null ? void 0 : l.activeText) === u.Role) || E.value.push({ val: !0, activeText: u.Role }));
49
49
  }), ee());
50
50
  }), ge(L, async (a, e) => {
51
- a !== e && (C.value = new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1).setMonth((/* @__PURE__ */ new Date()).getMonth() + Number(a)), re());
51
+ C.value = new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1).setMonth((/* @__PURE__ */ new Date()).getMonth() + Number(a)), re();
52
52
  });
53
53
  const me = (a, e, u, l) => {
54
54
  h.value.ids = a.ids, h.value.key = a.key, h.value.add = a.days.length > 0 && a.days[a.days.length - 1].cont, h.value.level = e.level, h.value.day = u.cellIndex, _.value.y = l.clientY, _.value.x = l.clientX, e.level === 2 && e.no === 0 && $.checkEdit && (h.value.name = d("workSchedule.autocomplete"), q.value = !0), e.level === 3 && u.cellIndex - e.no === 1 && $.checkEdit && (B(u.cellIndex, a.ids), h.value.name = d("workSchedule.modeSelection"), q.value = !0);
@@ -61,13 +61,13 @@ const We = { style: { height: "100px", width: "100%", display: "inline-block" }
61
61
  const m = a.nowork.includes(y) ? "nowork" : a.holidays.includes(y) ? "holiday" : a.preholidays.includes(y) ? "preholiday" : "";
62
62
  l.push({ day: p, holidays: m, weekday: j(new Date(e.getFullYear(), e.getMonth(), p), "day") });
63
63
  }
64
- R.value = s, o.value = l, $.odata.getPersonalManagerData({}).then((p) => {
64
+ I.value = s, o.value = l, $.odata.getPersonalManagerData({}).then((p) => {
65
65
  var y;
66
66
  V.value = (y = p.find((m) => m.Status !== "Увольнение" && m.Description === $.fullName)) == null ? void 0 : y.Group, p.forEach((m) => {
67
67
  m.Status !== "Увольнение" && (K.value.some((b) => (b == null ? void 0 : b.value) === m.Group) || K.value.push({ value: m.Group, label: m.Group, key: m.Group }), m.Group === V.value && !E.value.some((b) => (b == null ? void 0 : b.activeText) === m.Role) && E.value.push({ val: !0, activeText: m.Role }));
68
68
  }), ee(), oe.value = !1;
69
69
  });
70
- }, ce = Se(() => !n.value.some((a) => a.contHour !== R.value)), ie = (a, e) => {
70
+ }, ce = Se(() => !n.value.some((a) => a.contHour !== I.value)), ie = (a, e) => {
71
71
  var p, y, m;
72
72
  const u = new Date(C.value), l = `${u.getFullYear()}-${(u.getMonth() + 1).toString().padStart(2, "0")}-${a.toString().padStart(2, "0")}`, s = (p = n.value[e]) == null ? void 0 : p.days.findIndex((b) => b.day === l);
73
73
  return e === -1 || s === -1 ? "" : ((y = n.value[e].days[s]) == null ? void 0 : y.time) + " " + ((m = n.value[e].days[s]) == null ? void 0 : m.tips);
@@ -79,7 +79,7 @@ const We = { style: { height: "100px", width: "100%", display: "inline-block" }
79
79
  let u = ne(e.Description);
80
80
  a.push(e.Code), n.value.push({ name: u + " (" + e.Role + ")", days: [], contHour: 0, code: e.Code, id: !1, ids: n.value.length });
81
81
  }
82
- }), pe(a), I.value = !1;
82
+ }), pe(a), R.value = !1;
83
83
  }, pe = (a) => {
84
84
  $.workSchedule.getWorkSchedule({ code: a, date: H(new Date(C.value), "{Y}-{m}-{dd}") }).then(
85
85
  (e) => {
@@ -135,7 +135,7 @@ const We = { style: { height: "100px", width: "100%", display: "inline-block" }
135
135
  var ve;
136
136
  O.value = !0;
137
137
  const a = new Ee.Workbook(), e = a.addWorksheet(j(C.value, "month"), { pageSetup: { paperSize: 9, orientation: "landscape", fitToPage: !0 } }), u = { vertical: "middle", horizontal: "center" }, l = { top: { style: "thin" }, left: { style: "thin" }, bottom: { style: "thin" }, right: { style: "thin" } }, s = { vertical: "middle", horizontal: "center", wrapText: !0 };
138
- e.mergeCells(`A1:${D("A1", o.value.length + 5)}1`), e.mergeCells(`A2:${D("A2", o.value.length + 5)}2`), e.mergeCells("A3:A4"), e.mergeCells(`B3:${D("B3", o.value.length)}3`), e.mergeCells(`${D("B3", o.value.length + 1)}3:${D("B3", o.value.length + 2)}3`), e.mergeCells(`${D("B3", o.value.length + 3)}3:${D("B4", o.value.length + 3)}4`), e.mergeCells(`${D("B3", o.value.length + 4)}3:${D("B4", o.value.length + 4)}4`), e.getCell("A1").value = d("workSchedule.firm"), e.getCell("A2").value = d("workSchedule.title", { name: V.value }) + j(C.value, "month") + ` ${new Date(C.value).getFullYear()}`, e.getCell("A3").value = d("workSchedule.month"), e.getCell("B3").value = d("workSchedule.numbersMonth"), e.getCell(3, o.value.length + 2).value = d("workSchedule.onSchedule"), e.getCell(3, o.value.length + 4).value = d("workSchedule.acquainted"), e.getCell(3, o.value.length + 5).value = d("workSchedule.date"), e.getCell(4, o.value.length + 2).value = d("workSchedule.days"), e.getCell(4, o.value.length + 3).value = `${d("workSchedule.hours")} (${R.value})`;
138
+ e.mergeCells(`A1:${D("A1", o.value.length + 5)}1`), e.mergeCells(`A2:${D("A2", o.value.length + 5)}2`), e.mergeCells("A3:A4"), e.mergeCells(`B3:${D("B3", o.value.length)}3`), e.mergeCells(`${D("B3", o.value.length + 1)}3:${D("B3", o.value.length + 2)}3`), e.mergeCells(`${D("B3", o.value.length + 3)}3:${D("B4", o.value.length + 3)}4`), e.mergeCells(`${D("B3", o.value.length + 4)}3:${D("B4", o.value.length + 4)}4`), e.getCell("A1").value = d("workSchedule.firm"), e.getCell("A2").value = d("workSchedule.title", { name: V.value }) + j(C.value, "month") + ` ${new Date(C.value).getFullYear()}`, e.getCell("A3").value = d("workSchedule.month"), e.getCell("B3").value = d("workSchedule.numbersMonth"), e.getCell(3, o.value.length + 2).value = d("workSchedule.onSchedule"), e.getCell(3, o.value.length + 4).value = d("workSchedule.acquainted"), e.getCell(3, o.value.length + 5).value = d("workSchedule.date"), e.getCell(4, o.value.length + 2).value = d("workSchedule.days"), e.getCell(4, o.value.length + 3).value = `${d("workSchedule.hours")} (${I.value})`;
139
139
  for (let c = 2; c <= o.value.length + 1; c++)
140
140
  e.getCell(4, c).value = o.value[c - 2].weekday + `
141
141
  ` + (c - 1), e.getColumn(c).width = 6, e.getColumn(c).alignment = s, e.getCell(4, c).border = l;
@@ -184,7 +184,7 @@ const We = { style: { height: "100px", width: "100%", display: "inline-block" }
184
184
  F.checkEdit ? (f(), M(t(A), {
185
185
  key: 1,
186
186
  plain: "",
187
- onClick: e[1] || (e[1] = (l) => I.value = !0),
187
+ onClick: e[1] || (e[1] = (l) => R.value = !0),
188
188
  style: { "margin-bottom": ".5rem" }
189
189
  }, {
190
190
  default: i(() => [
@@ -291,12 +291,12 @@ const We = { style: { height: "100px", width: "100%", display: "inline-block" }
291
291
  _: 1
292
292
  }, 8, ["label"]),
293
293
  r(t(z), {
294
- label: `${t(d)("workSchedule.hours")} ( ${R.value} )`,
294
+ label: `${t(d)("workSchedule.hours")} ( ${I.value} )`,
295
295
  align: "center"
296
296
  }, {
297
297
  default: i((l) => [
298
298
  k("div", {
299
- style: xe(`color: ${R.value === l.row.contHour ? "green" : "red"};`)
299
+ style: xe(`color: ${I.value === l.row.contHour ? "green" : "red"};`)
300
300
  }, g(l.row.contHour), 5)
301
301
  ]),
302
302
  _: 1
@@ -341,15 +341,15 @@ const We = { style: { height: "100px", width: "100%", display: "inline-block" }
341
341
  }, 8, ["disabled"])), [
342
342
  [u, O.value]
343
343
  ]),
344
- r(t(Re), {
344
+ r(t(Ie), {
345
345
  title: t(d)("workSchedule.jobTitle"),
346
- modelValue: I.value,
347
- "onUpdate:modelValue": e[4] || (e[4] = (l) => I.value = l),
346
+ modelValue: R.value,
347
+ "onUpdate:modelValue": e[4] || (e[4] = (l) => R.value = l),
348
348
  width: "400px"
349
349
  }, {
350
350
  footer: i(() => [
351
351
  r(t(A), {
352
- onClick: e[3] || (e[3] = (l) => I.value = !1),
352
+ onClick: e[3] || (e[3] = (l) => R.value = !1),
353
353
  size: "default"
354
354
  }, {
355
355
  default: i(() => [
@@ -369,7 +369,7 @@ const We = { style: { height: "100px", width: "100%", display: "inline-block" }
369
369
  })
370
370
  ]),
371
371
  default: i(() => [
372
- r(t(Ie), {
372
+ r(t(Re), {
373
373
  ref: "dialogForm",
374
374
  model: E.value,
375
375
  autocomplete: "on"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studio-west/employees",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],