@studio-west/employees 0.1.7 → 0.2.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"),E=require("./index-CHGzf-XH.cjs"),j=require("vue-i18n"),i=require("element-plus"),I=require("@imengyu/vue3-context-menu"),L=(w,C)=>{const r=w.__vccOpts||w;for(const[h,f]of C)r[h]=f;return r},G={class:"wrapper"},U={class:"month_year"},O={class:"text"},z={class:"week"},R={class:"month"},q=["onClick"],P={key:0},A={class:"month_year"},J={class:"text"},W={class:"week"},X={class:"month"},H=["onClick"],K={__name:"DataPicker",props:{data:Object,range:{type:String,default:()=>"solid"}},emits:["init"],setup(w,{emit:C}){var T,M,F,Y;const r=e.ref(new Date),h=e.ref(new Date),f=w,B=C,p=e.ref(new Date().getFullYear()),D=e.ref(new Date().getMonth()),_=e.ref(new Date().getFullYear()),m=e.ref(new Date().getMonth()),c=e.ref([]),k=e.ref(0),b=e.ref(0),y=e.ref(-1),S=e.ref(-1),V=v=>{const o=v.split(v.match(/\D.*?\D?/));return o[0].length>2?o.join("-")+"T00:00:01":o.reverse().join("-")+"T00:00:01"};typeof((T=f.data)==null?void 0:T.startDate)<"u"&&(r.value=new Date(V(f.data.startDate)),p.value=r.value.getFullYear(),m.value=r.value.getMonth()),typeof((M=f.data)==null?void 0:M.endDate)<"u"&&(h.value=new Date(V(f.data.endDate)),_.value=h.value.getFullYear(),D.value=h.value.getMonth());const $=()=>{let v=new Date(p.value,m.value,0);for(let n=v.getDate()-v.getDay();n<=v.getDate()&&v.getDay()!==6;n++)k.value++,c.value.push({day:n,month:v.getMonth(),year:v.getFullYear(),class:[]});for(let n=1;n<=new Date(p.value,m.value+1,0).getDate();n++)k.value++,c.value.push({day:n,month:m.value,year:p.value,class:[]});if(f.range==="range"){b.value=new Date(p.value,m.value+2,0);for(let n=1;n<=b.value.getDate();n++)c.value.push({day:n,month:b.value.getMonth(),year:b.value.getFullYear(),class:[]})}let o=f.range==="range"?2:1,d=new Date(p.value,m.value+o,1);for(let n=1;n<=7-d.getDay()&&d.getDay()!==0;n++)c.value.push({day:n,month:d.getMonth(),year:d.getFullYear(),class:[]});f.data.holiday.length!==0&&(f.data.holiday.preholidays.forEach(n=>{let t=n.split("-");const l=c.value.findIndex(u=>u.year==t[0]&&u.month+1==t[1]&&u.day==t[2]);l!==-1&&(c.value[l].class[0]="preholiday")}),f.data.holiday.holidays.forEach(n=>{let t=n.split("-");const l=c.value.findIndex(u=>u.year==t[0]&&u.month+1==t[1]&&u.day==t[2]);l!==-1&&(c.value[l].class[0]="weekend")}),f.data.holiday.holiday.forEach(n=>{let t=n.split("-");const l=c.value.findIndex(u=>u.year==t[0]&&u.month+1==t[1]&&u.day==t[2]);l!==-1&&(c.value[l].class[0]="holiday")}),f.data.holiday.nowork.forEach(n=>{let t=n.split("-");const l=c.value.findIndex(u=>u.year==t[0]&&u.month+1==t[1]&&u.day==t[2]);l!==-1&&(c.value[l].class[0]="nowork")}))},s=(v,o)=>{let d=v-o+1;for(let n=0;n<=v-o;n++)c.value[n+o].class[0]==="holiday"&&d--;return d},g=(v,o)=>{const d=E.parseTime(new Date(v.year,v.month,v.day),"{dd}.{m}.{Y}");if(f.range==="range")if(console.log(y.value),S.value!==-1)c.value[S.value].class[1]="",c.value[y.value].class[1]="",y.value=o,S.value=-1,c.value[o].class[1]="active";else if(y.value!==-1){S.value=o,c.value[o].class[1]="active";let n=E.parseTime(new Date(c.value[y.value].year,c.value[y.value].month,c.value[y.value].day),"{dd}.{m}.{Y}");y.value>o?B("input",{dateStart:d,dateEnd:n,count:s(y.value,o)}):B("input",{dateStart:n,dateEnd:d,count:s(o,y.value)})}else y.value=o,c.value[o].class[1]="active";else c.value[y.value].class[1]="",y.value=o,c.value[o].class[1]="active",B("input",{dateStart:d,count:1})};$(),typeof((F=f.data)==null?void 0:F.startDate)<"u"&&(y.value=c.value.findIndex(v=>v.day===r.value.getDate()&&v.month===m.value&&v.year===p.value),c.value[y.value].class[1]="active"),typeof((Y=f.data)==null?void 0:Y.endDate)<"u"&&f.range==="range"&&(S.value=c.value.findIndex(v=>v.day===h.value.getDate()&&v.month===D.value&&v.year===_.value),c.value[S.value].class[1]="active");const N=(v,o)=>{c.value=[],k.value=0,r.value=new Date(v,o,1),p.value=r.value.getFullYear(),m.value=r.value.getMonth(),$()};return(v,o)=>(e.openBlock(),e.createElementBlock("div",G,[e.createElementVNode("div",null,[e.createElementVNode("p",U,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:o[0]||(o[0]=d=>N(p.value-1,m.value))},"«"),e.createElementVNode("button",{onClick:o[1]||(o[1]=d=>N(p.value,m.value-1))},"‹")]),e.createElementVNode("span",O,[e.createElementVNode("button",null,e.toDisplayString(p.value),1),e.createElementVNode("button",null,e.toDisplayString(e.unref(E.parseTime)(r.value,"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:o[2]||(o[2]=d=>N(p.value,m.value+1))},"›"),e.createElementVNode("button",{onClick:o[3]||(o[3]=d=>N(p.value+1,m.value))},"»")])]),e.createElementVNode("div",z,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(d,n)=>e.createElementVNode("button",{key:n,class:"disabled"},e.toDisplayString(e.unref(E.parseTime)(new Date(1970,1,d),"{D}")),1)),64))]),e.createElementVNode("div",R,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(d,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[n<=k.value+5-new Date(p.value,m.value+1,0).getDay()?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(d.month===m.value?d.class:"disabled"),onClick:t=>g(d,n)},e.toDisplayString(d.day),11,q)):e.createCommentVNode("",!0)],64))),128))])]),f.range==="range"?(e.openBlock(),e.createElementBlock("div",P,[e.createElementVNode("p",A,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:o[4]||(o[4]=d=>N(p.value-1,m.value))},"«"),e.createElementVNode("button",{onClick:o[5]||(o[5]=d=>N(p.value,m.value-1))},"‹")]),e.createElementVNode("span",J,[e.createElementVNode("button",null,e.toDisplayString(new Date(p.value,m.value+1).getFullYear()),1),e.createElementVNode("button",null,e.toDisplayString(e.unref(E.parseTime)(r.value.setMonth(m.value+1),"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:o[6]||(o[6]=d=>N(p.value,m.value+1))},"›"),e.createElementVNode("button",{onClick:o[7]||(o[7]=d=>N(p.value+1,m.value))},"»")])]),e.createElementVNode("div",W,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(d,n)=>e.createElementVNode("button",{key:n,class:"disabled"},e.toDisplayString(e.unref(E.parseTime)(new Date(1970,1,d),"{D}")),1)),64))]),e.createElementVNode("div",X,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(d,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[n>=k.value-new Date(p.value,m.value+1,1).getDay()?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(d.month===b.value.getMonth()?d.class:"disabled"),onClick:t=>g(d,n)},e.toDisplayString(d.day),11,H)):e.createCommentVNode("",!0)],64))),128))])])):e.createCommentVNode("",!0)]))}},Z=L(K,[["__scopeId","data-v-a842f008"]]),Q={key:1,class:"controls-container",style:{"margin-top":".5rem"}},ee={key:0},te={key:1,style:{padding:"0 1rem .5rem"}},ae={__name:"VacationTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"}},setup(w){const C=w,{t:r}=j.useI18n(),h=e.ref([]);e.ref([]);const f=e.ref(new Date().getFullYear()),B=e.ref(!1),p=e.ref(!1),D=e.ref(!1),_=e.ref({zIndex:3,minWidth:230,x:500,y:200}),m=e.ref(!1),c=e.ref([]),k=e.ref("Сектор разработок и эксплуатации сети"),b=e.ref([{value:"all",label:r("vacationSchedule.all"),key:"all"}]),y=e.ref([{value:f.value,label:f.value},{value:f.value+1,label:f.value+1}]),S=e.ref(!1),V=e.ref([]),$=e.ref(!1),s=e.ref({name:"Имя",length:0,code:""});e.watch(k,async(t,l)=>{t!==l&&(V.value=[],B.value=!1,C.odata.personalManagerData.forEach(u=>{(u.Status!=="Увольнение"&&u.Group===t||t==="all")&&(V.value.some(a=>(a==null?void 0:a.activeText)===u.Role)||V.value.push({val:!0,activeText:u.Role}))}),T())});const g=e.computed(()=>h.value.flatMap((t,l)=>!t.days||t.days.length===0?[{...t,key:0,ids:l}]:t.days.map((u,a)=>({ids:l,key:a,...t,...u})))),N=async()=>{C.odata.getPersonalManagerData({}).then(t=>{var l;k.value=(l=t.find(u=>u.Status!=="Увольнение"&&u.Description===C.fullName))==null?void 0:l.Group,t.forEach(u=>{u.Status!=="Увольнение"&&(b.value.some(a=>(a==null?void 0:a.value)===u.Group)||b.value.push({value:u.Group,label:u.Group,key:u.Group}),u.Group===k.value&&!V.value.some(a=>(a==null?void 0:a.activeText)===u.Role)&&V.value.push({val:!0,activeText:u.Role}))}),T(),p.value=!1})},T=()=>{h.value=[];let t=[];C.odata.personalManagerData.forEach(l=>{l.Status!=="Увольнение"&&(l.Group===k.value||k.value==="all")&&V.value.some(u=>u.val&&u.activeText===l.Role)&&(t.push(l.Code),h.value.push({name:l.Description,days:[{note:""}],jobTitle:l.Role,code:l.Code}))}),M(t),m.value=!1},M=t=>{C.workSchedule.getAllVacations({year:f.value}).then(l=>{console.log(t),t.forEach((u,a)=>{h.value[a].days=[{note:""}],l.forEach(x=>{u===x.code&&(console.log(x),typeof h.value[a].days[0].dateStart>"u"?h.value[a].days[0]={dateStart:E.parseTime(x.dateStart,"{dd}.{m}.{Y}"),dateEnd:E.parseTime(x.dateEnd,"{dd}.{m}.{Y}"),note:x.note,count:x.count}:h.value[a].days.push({dateStart:E.parseTime(x.dateStart,"{dd}.{m}.{Y}"),dateEnd:E.parseTime(x.dateEnd,"{dd}.{m}.{Y}"),note:x.note,count:x.count}))})})})},F=t=>{if(t.columnIndex<3&&g.value[t.rowIndex].key<g.value[t.rowIndex].days.length)return g.value[t.rowIndex].key===0?{rowspan:g.value[t.rowIndex].days.length,colspan:1}:{rowspan:0,colspan:0}},Y=(t,l,u,a)=>{s.value.ids=t.ids,s.value.key=t.key,s.value.startDate=t.dateStart,s.value.endDate=t.dateEnd,s.value.name=t.name,s.value.count=t.count,s.value.length=t.days.length,s.value.add=t.days.length>0&&t.days[t.days.length-1].count,s.value.level=l.level,s.value.holiday=c.value,_.value.y=a.clientY,_.value.x=a.clientX,l.level===2&&l.no<4&&(s.value.add||t.days.length>1)&&(D.value=!0),l.level===3&&(D.value=!0)},v=t=>{console.log(t);let l=h.value[s.value.ids];switch(t){case"add":l.days.push({note:""}),console.log(l.days.length);break;case"delete":delete l.days.pop(),n(s.value.ids);break}D.value=!1},o=t=>{$.value=t,s.value.count=t.count},d=()=>{$.value&&(h.value[s.value.ids].days[s.value.key]={...$.value,note:""},n(s.value.ids)),D.value=!1},n=t=>{C.workSchedule.rewriteFull({year:f.value,code:h.value[t].code,data:h.value[t].days.map(l=>(l.dateStart=l.dateStart.split(".").reverse().join("-"),l.dateEnd=l.dateEnd.split(".").reverse().join("-"),l))})};return E.holidays().then(t=>{c.value=t,N()}),(t,l)=>{const u=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",null,[w.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElSelect),{key:0,modelValue:k.value,"onUpdate:modelValue":l[0]||(l[0]=a=>k.value=a),placeholder:"Select",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,a=>(e.openBlock(),e.createBlock(e.unref(i.ElOption),{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),e.createVNode(e.unref(i.ElButton),{plain:"",onClick:l[1]||(l[1]=a=>m.value=!0),style:{"margin-bottom":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.jobTitle")),1)]),_:1}),e.createVNode(e.unref(i.ElSelect),{modelValue:f.value,"onUpdate:modelValue":l[2]||(l[2]=a=>f.value=a),onChange:T,placeholder:"Year",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,a=>(e.openBlock(),e.createBlock(e.unref(i.ElOption),{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),e.createVNode(e.unref(i.ElSkeleton),{style:{width:"100%"},loading:p.value,animated:""},{template:e.withCtx(()=>[e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"100%",height:"2rem"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"4rem","margin-right":"4px"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"4rem"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"8rem","margin-right":"4px"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"8rem"}})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTable),{id:"printTable",data:g.value,"span-method":F,onCellClick:Y,border:"",style:{width:"100%"},size:"small","empty-text":e.unref(r)("vacationSchedule.emptyText")},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:k.value!=="all"?e.unref(r)("vacationSchedule.title",{name:k.value}):e.unref(r)("vacationSchedule.enterprise")+` ${f.value}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("vacationSchedule.jobTitle"),width:"180",align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(g.value[a.$index].jobTitle),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("vacationSchedule.fullName"),width:"180",align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(g.value[a.$index].name),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("vacationSchedule.personnelNumber"),align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(g.value[a.$index].code),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("vacationSchedule.vacation"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("vacationSchedule.days"),align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(g.value[a.$index].count),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("vacationSchedule.date"),align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(g.value[a.$index].dateStart),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("vacationSchedule.endDate"),align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(g.value[a.$index].dateEnd),1)]),_:1},8,["label"])]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("vacationSchedule.note"),align:"center"},{default:e.withCtx(a=>[e.createVNode(e.unref(i.ElInput),{modelValue:h.value[g.value[a.$index].ids].days[g.value[a.$index].key].note,"onUpdate:modelValue":x=>h.value[g.value[a.$index].ids].days[g.value[a.$index].key].note=x,style:{width:"100%"},placeholder:" ",class:"noBorder",onBlur:x=>n(g.value[a.$index].ids)},null,8,["modelValue","onUpdate:modelValue","onBlur"])]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["data","empty-text"])]),_:1},8,["loading"]),w.checkEdit?(e.openBlock(),e.createElementBlock("div",Q,[B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:0,type:"primary",onClick:t.confirmData},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("vacationSchedule.sendInformation")),1)]),_:1},8,["onClick"])),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:1,type:"primary",onClick:t.confirmData},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("vacationSchedule.agreeOn")),1)]),_:1},8,["onClick"])),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:2,type:"primary",onClick:t.confirmData},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("vacationSchedule.reject")),1)]),_:1},8,["onClick"]))])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(i.ElButton),{disabled:S.value,plain:"",onClick:t.exportToExcel,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.exportExcel")),1)]),_:1},8,["disabled","onClick"])),[[u,S.value]]),e.createVNode(e.unref(i.ElDialog),{title:e.unref(r)("workSchedule.jobTitle"),modelValue:m.value,"onUpdate:modelValue":l[4]||(l[4]=a=>m.value=a),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(i.ElButton),{onClick:l[3]||(l[3]=a=>m.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{size:"default",type:"primary",onClick:T},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElForm),{ref:"dialogForm",model:V.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,a=>(e.openBlock(),e.createBlock(e.unref(i.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElSwitch),{modelValue:a.val,"onUpdate:modelValue":x=>a.val=x,"active-text":a.activeText},null,8,["modelValue","onUpdate:modelValue","active-text"])]),_:2},1024))),256))]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(I.ContextMenu),{show:D.value,"onUpdate:show":l[8]||(l[8]=a=>D.value=a),options:_.value},{default:e.withCtx(()=>[e.createVNode(e.unref(I.ContextMenuItem),{label:s.value.level===3&&typeof s.value.count<"u"?s.value.name+" "+s.value.count+" "+e.unref(r)("vacationSchedule.day",s.value.count):s.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(I.ContextMenuSeparator)),s.value.level===2?(e.openBlock(),e.createElementBlock("div",ee,[s.value.length>1?(e.openBlock(),e.createBlock(e.unref(I.ContextMenuItem),{key:0,label:e.unref(r)("vacationSchedule.deleteLast"),onClick:l[5]||(l[5]=a=>v("delete"))},null,8,["label"])):e.createCommentVNode("",!0),s.value.add?(e.openBlock(),e.createBlock(e.unref(I.ContextMenuItem),{key:1,label:e.unref(r)("vacationSchedule.addVacation"),onClick:l[6]||(l[6]=a=>v("add"))},null,8,["label"])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",te,[e.createVNode(Z,{data:s.value,range:"range",onInput:o},null,8,["data"]),e.createElementVNode("div",null,[e.createVNode(e.unref(i.ElButton),{onClick:l[7]||(l[7]=a=>D.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("vacationSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{onClick:d},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("vacationSchedule.save")),1)]),_:1})])]))]),_:1},8,["show","options"])])}}};module.exports=ae;
1
+ "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,14 +1,14 @@
1
- import { ref as g, openBlock as y, createElementBlock as w, createElementVNode as f, toDisplayString as D, unref as a, Fragment as U, renderList as P, normalizeClass as K, createCommentVNode as Y, watch as ee, computed as ae, resolveDirective as le, createBlock as T, withCtx as p, createVNode as c, createTextVNode as _, withDirectives as te } from "vue";
2
- import { p as F, h as ne } from "./index-uVRk2ARj.js";
3
- import { useI18n as ue } from "vue-i18n";
4
- import { ElSelect as Z, ElOption as Q, ElButton as B, ElSkeleton as oe, ElSkeletonItem as J, ElTable as de, ElTableColumn as G, ElInput as se, ElDialog as ve, ElForm as ie, ElFormItem as re, ElSwitch as ce } from "element-plus";
5
- import { ContextMenu as he, ContextMenuItem as H, ContextMenuSeparator as pe } from "@imengyu/vue3-context-menu";
6
- const fe = (O, M) => {
7
- const d = O.__vccOpts || O;
8
- for (const [k, h] of M)
9
- d[k] = h;
10
- return d;
11
- }, me = { class: "wrapper" }, ye = { class: "month_year" }, ge = { class: "text" }, be = { class: "week" }, De = { class: "month" }, ke = ["onClick"], xe = { key: 0 }, Se = { class: "month_year" }, we = { class: "text" }, Ce = { class: "week" }, Ee = { class: "month" }, _e = ["onClick"], $e = {
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";
2
+ import { p as O, h as ce } from "./index-uVRk2ARj.js";
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";
6
+ const xe = (j, M) => {
7
+ const o = j.__vccOpts || j;
8
+ for (const [w, h] of M)
9
+ o[w] = h;
10
+ return o;
11
+ }, ke = { class: "wrapper" }, De = { class: "month_year" }, Se = { class: "text" }, we = { class: "week" }, Ce = { class: "month" }, Ee = ["onClick"], $e = { key: 0 }, Ve = { class: "month_year" }, Me = { class: "text" }, _e = { class: "week" }, Ie = { class: "month" }, Te = ["onClick"], Ye = {
12
12
  __name: "DataPicker",
13
13
  props: {
14
14
  data: Object,
@@ -16,165 +16,179 @@ const fe = (O, M) => {
16
16
  // range | solid
17
17
  },
18
18
  emits: ["init"],
19
- setup(O, { emit: M }) {
20
- var z, W, X, q;
21
- const d = g(/* @__PURE__ */ new Date()), k = g(/* @__PURE__ */ new Date()), h = O, R = M, b = g((/* @__PURE__ */ new Date()).getFullYear()), V = g((/* @__PURE__ */ new Date()).getMonth()), L = g((/* @__PURE__ */ new Date()).getFullYear()), m = g((/* @__PURE__ */ new Date()).getMonth()), v = g([]), C = g(0), j = g(0), S = g(-1), N = g(-1), $ = (r) => {
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) => {
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" && (d.value = new Date($(h.data.startDate)), b.value = d.value.getFullYear(), m.value = d.value.getMonth()), typeof ((W = h.data) == null ? void 0 : W.endDate) < "u" && (k.value = new Date($(h.data.endDate)), L.value = k.value.getFullYear(), V.value = k.value.getMonth());
26
- const A = () => {
27
- let r = new Date(b.value, m.value, 0);
28
- for (let n = r.getDate() - r.getDay(); n <= r.getDate() && r.getDay() !== 6; n++)
29
- C.value++, v.value.push({ day: n, month: r.getMonth(), year: r.getFullYear(), class: [] });
30
- for (let n = 1; n <= new Date(b.value, m.value + 1, 0).getDate(); n++)
31
- C.value++, v.value.push({ day: n, month: m.value, year: b.value, class: [] });
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());
26
+ const T = () => {
27
+ let r = new Date(S.value, m.value, 0);
28
+ for (let n = r.getDate() - r.getDay() + U; n <= r.getDate() && r.getDay() !== 6 + U; n++)
29
+ B.value++, d.value.push({ day: n, month: r.getMonth(), year: r.getFullYear(), class: [] });
30
+ for (let n = 1; n <= new Date(S.value, m.value + 1, 0).getDate(); n++)
31
+ B.value++, d.value.push({ day: n, month: m.value, year: S.value, class: [] });
32
32
  if (h.range === "range") {
33
- j.value = new Date(b.value, m.value + 2, 0);
34
- for (let n = 1; n <= j.value.getDate(); n++)
35
- v.value.push({ day: n, month: j.value.getMonth(), year: j.value.getFullYear(), class: [] });
33
+ R.value = new Date(S.value, m.value + 2, 0);
34
+ for (let n = 1; n <= R.value.getDate(); n++)
35
+ d.value.push({ day: n, month: R.value.getMonth(), year: R.value.getFullYear(), class: [] });
36
36
  }
37
- let u = h.range === "range" ? 2 : 1, s = new Date(b.value, m.value + u, 1);
38
- for (let n = 1; n <= 7 - s.getDay() && s.getDay() !== 0; n++)
39
- v.value.push({ day: n, month: s.getMonth(), year: s.getFullYear(), class: [] });
37
+ let u = h.range === "range" ? 2 : 1, s = new Date(S.value, m.value + u, 1);
38
+ for (let n = 1; n <= (7 - s.getDay() + U) % 7 && s.getDay() !== U; n++)
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 e = n.split("-");
42
- const t = v.value.findIndex((o) => o.year == e[0] && o.month + 1 == e[1] && o.day == e[2]);
43
- t !== -1 && (v.value[t].class[0] = "preholiday");
41
+ let y = n.split("-");
42
+ const _ = d.value.findIndex(($) => $.year == y[0] && $.month + 1 == y[1] && $.day == y[2]);
43
+ _ !== -1 && (d.value[_].class[0] = "preholiday");
44
44
  }), h.data.holiday.holidays.forEach((n) => {
45
- let e = n.split("-");
46
- const t = v.value.findIndex((o) => o.year == e[0] && o.month + 1 == e[1] && o.day == e[2]);
47
- t !== -1 && (v.value[t].class[0] = "weekend");
45
+ let y = n.split("-");
46
+ const _ = d.value.findIndex(($) => $.year == y[0] && $.month + 1 == y[1] && $.day == y[2]);
47
+ _ !== -1 && (d.value[_].class[0] = "weekend");
48
48
  }), h.data.holiday.holiday.forEach((n) => {
49
- let e = n.split("-");
50
- const t = v.value.findIndex((o) => o.year == e[0] && o.month + 1 == e[1] && o.day == e[2]);
51
- t !== -1 && (v.value[t].class[0] = "holiday");
49
+ let y = n.split("-");
50
+ const _ = d.value.findIndex(($) => $.year == y[0] && $.month + 1 == y[1] && $.day == y[2]);
51
+ _ !== -1 && (d.value[_].class[0] = "holiday");
52
52
  }), h.data.holiday.nowork.forEach((n) => {
53
- let e = n.split("-");
54
- const t = v.value.findIndex((o) => o.year == e[0] && o.month + 1 == e[1] && o.day == e[2]);
55
- t !== -1 && (v.value[t].class[0] = "nowork");
53
+ let y = n.split("-");
54
+ const _ = d.value.findIndex(($) => $.year == y[0] && $.month + 1 == y[1] && $.day == y[2]);
55
+ _ !== -1 && (d.value[_].class[0] = "nowork");
56
56
  }));
57
- }, i = (r, u) => {
57
+ }, P = (r, u) => {
58
58
  let s = r - u + 1;
59
59
  for (let n = 0; n <= r - u; n++)
60
- v.value[n + u].class[0] === "holiday" && s--;
60
+ d.value[n + u].class[0] === "holiday" && s--;
61
61
  return s;
62
- }, x = (r, u) => {
63
- const s = F(new Date(r.year, r.month, r.day), "{dd}.{m}.{Y}");
62
+ }, c = (r, u) => {
63
+ const s = O(new Date(r.year, r.month, r.day), "{dd}.{m}.{Y}");
64
64
  if (h.range === "range")
65
- if (console.log(S.value), N.value !== -1)
66
- v.value[N.value].class[1] = "", v.value[S.value].class[1] = "", S.value = u, N.value = -1, v.value[u].class[1] = "active";
67
- else if (S.value !== -1) {
68
- N.value = u, v.value[u].class[1] = "active";
69
- let n = F(new Date(v.value[S.value].year, v.value[S.value].month, v.value[S.value].day), "{dd}.{m}.{Y}");
70
- S.value > u ? R("input", { dateStart: s, dateEnd: n, count: i(S.value, u) }) : R("input", { dateStart: n, dateEnd: s, count: i(u, S.value) });
65
+ if (console.log(D.value), C.value !== -1) {
66
+ if (C.value <= D.value)
67
+ for (let n = C.value; n <= D.value; n++) d.value[n].class[1] = "";
68
+ else for (let n = D.value; n <= C.value; n++) d.value[n].class[1] = "";
69
+ D.value = u, C.value = -1, d.value[u].class[1] = "active";
70
+ } else if (D.value !== -1) {
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";
74
+ d.value[u].class[1] = "active";
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) });
71
77
  } else
72
- S.value = u, v.value[u].class[1] = "active";
78
+ D.value = u, d.value[u].class[1] = "active";
73
79
  else
74
- v.value[S.value].class[1] = "", S.value = u, v.value[u].class[1] = "active", R("input", { dateStart: s, count: 1 });
80
+ d.value[D.value].class[1] = "", D.value = u, d.value[u].class[1] = "active", J("input", { dateStart: s, count: 1 });
75
81
  };
76
- A(), typeof ((X = h.data) == null ? void 0 : X.startDate) < "u" && (S.value = v.value.findIndex((r) => r.day === d.value.getDate() && r.month === m.value && r.year === b.value), v.value[S.value].class[1] = "active"), typeof ((q = h.data) == null ? void 0 : q.endDate) < "u" && h.range === "range" && (N.value = v.value.findIndex((r) => r.day === k.value.getDate() && r.month === V.value && r.year === L.value), v.value[N.value].class[1] = "active");
77
- const I = (r, u) => {
78
- v.value = [], C.value = 0, d.value = new Date(r, u, 1), b.value = d.value.getFullYear(), m.value = d.value.getMonth(), A();
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";
84
+ for (let r = D.value + 1; r < C.value; r++) d.value[r].class[1] = "select";
85
+ }
86
+ const x = (r, u) => {
87
+ d.value = [], B.value = 0, o.value = new Date(r, u, 1), S.value = o.value.getFullYear(), m.value = o.value.getMonth(), T();
79
88
  };
80
- return (r, u) => (y(), w("div", me, [
81
- f("div", null, [
82
- f("p", ye, [
83
- f("span", null, [
84
- f("button", {
85
- onClick: u[0] || (u[0] = (s) => I(b.value - 1, m.value))
89
+ return (r, u) => (p(), E("div", ke, [
90
+ g("div", null, [
91
+ g("p", De, [
92
+ g("span", null, [
93
+ g("button", {
94
+ onClick: u[0] || (u[0] = (s) => x(S.value - 1, m.value))
86
95
  }, "«"),
87
- f("button", {
88
- onClick: u[1] || (u[1] = (s) => I(b.value, m.value - 1))
96
+ g("button", {
97
+ onClick: u[1] || (u[1] = (s) => x(S.value, m.value - 1))
89
98
  }, "‹")
90
99
  ]),
91
- f("span", ge, [
92
- f("button", null, D(b.value), 1),
93
- f("button", null, D(a(F)(d.value, "{F}")), 1)
100
+ g("span", Se, [
101
+ g("button", null, k(S.value), 1),
102
+ g("button", null, k(e(O)(o.value, "{F}")), 1)
94
103
  ]),
95
- f("span", null, [
96
- f("button", {
97
- onClick: u[2] || (u[2] = (s) => I(b.value, m.value + 1))
104
+ g("span", null, [
105
+ g("button", {
106
+ onClick: u[2] || (u[2] = (s) => x(S.value, m.value + 1))
98
107
  }, "›"),
99
- f("button", {
100
- onClick: u[3] || (u[3] = (s) => I(b.value + 1, m.value))
108
+ g("button", {
109
+ onClick: u[3] || (u[3] = (s) => x(S.value + 1, m.value))
101
110
  }, "»")
102
111
  ])
103
112
  ]),
104
- f("div", be, [
105
- (y(), w(U, null, P(7, (s, n) => f("button", {
113
+ g("div", we, [
114
+ (p(), E(G, null, A(7, (s, n) => g("button", {
106
115
  key: n,
107
116
  class: "disabled"
108
- }, D(a(F)(new Date(1970, 1, s), "{D}")), 1)), 64))
117
+ }, k(e(O)(new Date(1970, 1, s + e(U)), "{D}")), 1)), 64))
109
118
  ]),
110
- f("div", De, [
111
- (y(!0), w(U, null, P(v.value, (s, n) => (y(), w(U, { key: n }, [
112
- n <= C.value + 5 - new Date(b.value, m.value + 1, 0).getDay() ? (y(), w("button", {
119
+ g("div", Ce, [
120
+ (p(!0), E(G, null, A(d.value, (s, n) => (p(), E(G, { key: n }, [
121
+ n < B.value + (7 - new Date(S.value, m.value + 1, 1).getDay() + e(U)) % 7 ? (p(), E("button", {
113
122
  key: 0,
114
- class: K(s.month === m.value ? s.class : "disabled"),
115
- onClick: (e) => x(s, n)
116
- }, D(s.day), 11, ke)) : Y("", !0)
123
+ class: ne(s.month === m.value ? s.class : "disabled"),
124
+ onClick: () => {
125
+ s.month === m.value && c(s, n);
126
+ }
127
+ }, k(s.day), 11, Ee)) : z("", !0)
117
128
  ], 64))), 128))
118
129
  ])
119
130
  ]),
120
- h.range === "range" ? (y(), w("div", xe, [
121
- f("p", Se, [
122
- f("span", null, [
123
- f("button", {
124
- onClick: u[4] || (u[4] = (s) => I(b.value - 1, m.value))
131
+ h.range === "range" ? (p(), E("div", $e, [
132
+ g("p", Ve, [
133
+ g("span", null, [
134
+ g("button", {
135
+ onClick: u[4] || (u[4] = (s) => x(S.value - 1, m.value))
125
136
  }, "«"),
126
- f("button", {
127
- onClick: u[5] || (u[5] = (s) => I(b.value, m.value - 1))
137
+ g("button", {
138
+ onClick: u[5] || (u[5] = (s) => x(S.value, m.value - 1))
128
139
  }, "‹")
129
140
  ]),
130
- f("span", we, [
131
- f("button", null, D(new Date(b.value, m.value + 1).getFullYear()), 1),
132
- f("button", null, D(a(F)(d.value.setMonth(m.value + 1), "{F}")), 1)
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)
133
144
  ]),
134
- f("span", null, [
135
- f("button", {
136
- onClick: u[6] || (u[6] = (s) => I(b.value, m.value + 1))
145
+ g("span", null, [
146
+ g("button", {
147
+ onClick: u[6] || (u[6] = (s) => x(S.value, m.value + 1))
137
148
  }, "›"),
138
- f("button", {
139
- onClick: u[7] || (u[7] = (s) => I(b.value + 1, m.value))
149
+ g("button", {
150
+ onClick: u[7] || (u[7] = (s) => x(S.value + 1, m.value))
140
151
  }, "»")
141
152
  ])
142
153
  ]),
143
- f("div", Ce, [
144
- (y(), w(U, null, P(7, (s, n) => f("button", {
154
+ g("div", _e, [
155
+ (p(), E(G, null, A(7, (s, n) => g("button", {
145
156
  key: n,
146
157
  class: "disabled"
147
- }, D(a(F)(new Date(1970, 1, s), "{D}")), 1)), 64))
158
+ }, k(e(O)(new Date(1970, 1, s + e(U)), "{D}")), 1)), 64))
148
159
  ]),
149
- f("div", Ee, [
150
- (y(!0), w(U, null, P(v.value, (s, n) => (y(), w(U, { key: n }, [
151
- n >= C.value - new Date(b.value, m.value + 1, 1).getDay() ? (y(), w("button", {
160
+ g("div", Ie, [
161
+ (p(!0), E(G, null, A(d.value, (s, n) => (p(), E(G, { key: n }, [
162
+ n >= B.value - new Date(S.value, m.value + 1, 1).getDay() + e(U) ? (p(), E("button", {
152
163
  key: 0,
153
- class: K(s.month === j.value.getMonth() ? s.class : "disabled"),
154
- onClick: (e) => x(s, n)
155
- }, D(s.day), 11, _e)) : Y("", !0)
164
+ class: ne(s.month === R.value.getMonth() ? s.class : "disabled"),
165
+ onClick: () => {
166
+ s.month === R.value.getMonth() && c(s, n);
167
+ }
168
+ }, k(s.day), 11, Te)) : z("", !0)
156
169
  ], 64))), 128))
157
170
  ])
158
- ])) : Y("", !0)
171
+ ])) : z("", !0)
159
172
  ]));
160
173
  }
161
- }, Me = /* @__PURE__ */ fe($e, [["__scopeId", "data-v-a842f008"]]), Ve = {
174
+ }, Fe = /* @__PURE__ */ xe(Ye, [["__scopeId", "data-v-fef4c07c"]]), je = {
162
175
  key: 1,
163
176
  class: "controls-container",
164
177
  style: { "margin-top": ".5rem" }
165
- }, Ie = { key: 0 }, Te = {
178
+ }, Ne = { key: 0 }, Be = {
166
179
  key: 1,
167
180
  style: { padding: "0 1rem .5rem" }
168
- }, Ge = {
181
+ }, qe = {
169
182
  __name: "VacationTable",
170
183
  props: {
171
184
  checkEdit: { type: Boolean, default: () => !0 },
172
185
  odata: Object,
173
186
  workSchedule: Object,
187
+ query: String,
174
188
  fullName: { type: String, default: "Вы" }
175
189
  },
176
- setup(O) {
177
- const M = O, { t: d } = ue(), k = g([
190
+ setup(j) {
191
+ const M = j, { t: o } = de(), w = f([
178
192
  // { name: 'Иванов Петр Михалыч',
179
193
  // jobTitle: '(Ведущий работник месяца)',
180
194
  // days: [{dateStart: "03.05.2024", dateEnd: "06.06.2024", note: 'забил - сказал он ослик', count: 14 },
@@ -193,258 +207,269 @@ const fe = (O, M) => {
193
207
  // code: '0000-00053'
194
208
  // }
195
209
  ]);
196
- g([]);
197
- const h = g((/* @__PURE__ */ new Date()).getFullYear()), R = g(!1), b = g(!1), V = g(!1), L = g({
210
+ f([]);
211
+ const h = f((/* @__PURE__ */ new Date()).getFullYear()), J = f(!1), S = f(!1), N = f(!1), W = f({
198
212
  zIndex: 3,
199
213
  minWidth: 230,
200
214
  x: 500,
201
215
  y: 200
202
- }), m = g(!1), v = g([]), C = g("Сектор разработок и эксплуатации сети"), j = g([{ value: "all", label: d("vacationSchedule.all"), key: "all" }]), S = g([{ value: h.value, label: h.value }, { value: h.value + 1, label: h.value + 1 }]), N = g(!1), $ = g([]), A = g(!1), i = g({ name: "Имя", length: 0, code: "" });
203
- ee(C, async (e, t) => {
204
- e !== t && ($.value = [], R.value = !1, M.odata.personalManagerData.forEach((o) => {
205
- (o.Status !== "Увольнение" && o.Group === e || e === "all") && ($.value.some((l) => (l == null ? void 0 : l.activeText) === o.Role) || $.value.push({ val: !0, activeText: o.Role }));
206
- }), z());
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: "" });
217
+ se(C, async (t, l) => {
218
+ t !== l && (T.value = [], J.value = !1, M.odata.personalManagerData.forEach((b) => {
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());
207
221
  });
208
- const x = ae(() => k.value.flatMap((e, t) => !e.days || e.days.length === 0 ? [{ ...e, key: 0, ids: t }] : e.days.map((o, l) => ({
209
- ids: t,
210
- key: l,
211
- ...e,
212
- ...o
213
- })))), I = async () => {
214
- M.odata.getPersonalManagerData({}).then((e) => {
215
- var t;
216
- C.value = (t = e.find((o) => o.Status !== "Увольнение" && o.Description === M.fullName)) == null ? void 0 : t.Group, e.forEach((o) => {
217
- o.Status !== "Увольнение" && (j.value.some((l) => (l == null ? void 0 : l.value) === o.Group) || j.value.push({ value: o.Group, label: o.Group, key: o.Group }), o.Group === C.value && !$.value.some((l) => (l == null ? void 0 : l.activeText) === o.Role) && $.value.push({ val: !0, activeText: o.Role }));
218
- }), z(), b.value = !1;
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
+ ids: l,
224
+ key: a,
225
+ ...t,
226
+ ...b
227
+ })))), Z = async () => {
228
+ M.odata.getPersonalManagerData({}).then((t) => {
229
+ var l;
230
+ C.value = (l = t.find((b) => b.Status !== "Увольнение" && b.Description === M.fullName)) == null ? void 0 : l.Group, t.forEach((b) => {
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;
219
233
  });
220
- }, z = () => {
221
- k.value = [];
222
- let e = [];
223
- M.odata.personalManagerData.forEach((t) => {
224
- t.Status !== "Увольнение" && (t.Group === C.value || C.value === "all") && $.value.some((o) => o.val && o.activeText === t.Role) && (e.push(t.Code), k.value.push({ name: t.Description, days: [{ note: "" }], jobTitle: t.Role, code: t.Code }));
225
- }), W(e), m.value = !1;
226
- }, W = (e) => {
234
+ }, L = () => {
235
+ w.value = [];
236
+ let t = [];
237
+ M.odata.personalManagerData.forEach((l) => {
238
+ l.Status !== "Увольнение" && (l.Group === C.value || C.value === "all") && T.value.some((b) => b.val && b.activeText === l.Role) && (t.push(l.Code), w.value.push({ name: l.Description, days: [{ note: "" }], jobTitle: l.Role, code: l.Code }));
239
+ }), Q(t), m.value = !1;
240
+ }, Q = (t) => {
227
241
  M.workSchedule.getAllVacations({ year: h.value }).then(
228
- (t) => {
229
- console.log(e), e.forEach((o, l) => {
230
- k.value[l].days = [{ note: "" }], t.forEach((E) => {
231
- o === E.code && (console.log(E), typeof k.value[l].days[0].dateStart > "u" ? k.value[l].days[0] = {
232
- dateStart: F(E.dateStart, "{dd}.{m}.{Y}"),
233
- dateEnd: F(E.dateEnd, "{dd}.{m}.{Y}"),
234
- note: E.note,
235
- count: E.count
236
- } : k.value[l].days.push({
237
- dateStart: F(E.dateStart, "{dd}.{m}.{Y}"),
238
- dateEnd: F(E.dateEnd, "{dd}.{m}.{Y}"),
239
- note: E.note,
240
- count: E.count
242
+ (l) => {
243
+ console.log(t), t.forEach((b, a) => {
244
+ w.value[a].days = [{ note: "" }], l.forEach((I) => {
245
+ b === I.code && (typeof w.value[a].days[0].dateStart > "u" ? w.value[a].days[0] = {
246
+ dateStart: O(I.dateStart, "{dd}.{m}.{Y}"),
247
+ dateEnd: O(I.dateEnd, "{dd}.{m}.{Y}"),
248
+ note: I.note,
249
+ count: I.count
250
+ } : w.value[a].days.push({
251
+ dateStart: O(I.dateStart, "{dd}.{m}.{Y}"),
252
+ dateEnd: O(I.dateEnd, "{dd}.{m}.{Y}"),
253
+ note: I.note,
254
+ count: I.count
241
255
  }));
242
256
  });
243
257
  });
244
258
  }
245
259
  );
246
- }, X = (e) => {
247
- if (e.columnIndex < 3 && x.value[e.rowIndex].key < x.value[e.rowIndex].days.length)
248
- return x.value[e.rowIndex].key === 0 ? {
249
- rowspan: x.value[e.rowIndex].days.length,
260
+ }, ee = (t) => {
261
+ if (t.columnIndex < 3 && x.value[t.rowIndex].key < x.value[t.rowIndex].days.length)
262
+ return x.value[t.rowIndex].key === 0 ? {
263
+ rowspan: x.value[t.rowIndex].days.length,
250
264
  colspan: 1
251
265
  } : {
252
266
  rowspan: 0,
253
267
  colspan: 0
254
268
  };
255
- }, q = (e, t, o, l) => {
256
- i.value.ids = e.ids, i.value.key = e.key, i.value.startDate = e.dateStart, i.value.endDate = e.dateEnd, i.value.name = e.name, i.value.count = e.count, i.value.length = e.days.length, i.value.add = e.days.length > 0 && e.days[e.days.length - 1].count, i.value.level = t.level, i.value.holiday = v.value, L.value.y = l.clientY, L.value.x = l.clientX, t.level === 2 && t.no < 4 && (i.value.add || e.days.length > 1) && (V.value = !0), t.level === 3 && (V.value = !0);
257
- }, r = (e) => {
258
- console.log(e);
259
- let t = k.value[i.value.ids];
260
- switch (e) {
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);
271
+ }, u = (t) => {
272
+ console.log(t);
273
+ let l = w.value[c.value.ids];
274
+ switch (t) {
261
275
  case "add":
262
- t.days.push({ note: "" }), console.log(t.days.length);
276
+ l.days.push({ note: "" }), console.log(l.days.length);
263
277
  break;
264
278
  case "delete":
265
- delete t.days.pop(), n(i.value.ids);
279
+ delete l.days.pop(), y(c.value.ids);
266
280
  break;
267
281
  }
268
- V.value = !1;
269
- }, u = (e) => {
270
- A.value = e, i.value.count = e.count;
271
- }, s = () => {
272
- A.value && (k.value[i.value.ids].days[i.value.key] = { ...A.value, note: "" }, n(i.value.ids)), V.value = !1;
273
- }, n = (e) => {
282
+ N.value = !1;
283
+ }, s = (t) => {
284
+ P.value = t, c.value.count = t.count;
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) => {
274
288
  M.workSchedule.rewriteFull({
275
289
  year: h.value,
276
- code: k.value[e].code,
277
- data: k.value[e].days.map((t) => (t.dateStart = t.dateStart.split(".").reverse().join("-"), t.dateEnd = t.dateEnd.split(".").reverse().join("-"), t))
290
+ code: w.value[t].code,
291
+ data: w.value[t].days.map((l) => ({
292
+ dateStart: l.dateStart.split(".").reverse().join("-"),
293
+ dateEnd: l.dateEnd.split(".").reverse().join("-"),
294
+ note: l.note,
295
+ count: l.count
296
+ }))
278
297
  });
298
+ }, _ = (t) => {
299
+ M.workSchedule.sendConfirmMessage({ fullname: M.fullName, confirm: t }), M.query = "";
300
+ }, $ = () => {
301
+ M.workSchedule.sendAgreementMessage({ users: B.value.participants }), console.log("sendAgreement"), d.value = !1;
279
302
  };
280
- return ne().then((e) => {
281
- v.value = e, I();
282
- }), (e, t) => {
283
- const o = le("loading");
284
- return y(), w("div", null, [
285
- O.checkEdit ? (y(), T(a(Z), {
303
+ return M.workSchedule.getBoss().then((t) => {
304
+ console.log(t), R.value = t[0].users;
305
+ }), ce().then((t) => {
306
+ D.value = t, Z();
307
+ }), (t, l) => {
308
+ const b = ie("loading");
309
+ return p(), E("div", null, [
310
+ j.checkEdit ? (p(), Y(e(ae), {
286
311
  key: 0,
287
312
  modelValue: C.value,
288
- "onUpdate:modelValue": t[0] || (t[0] = (l) => C.value = l),
313
+ "onUpdate:modelValue": l[0] || (l[0] = (a) => C.value = a),
289
314
  placeholder: "Select",
290
315
  style: { width: "240px", "margin-bottom": ".5rem", "margin-right": ".5rem" }
291
316
  }, {
292
- default: p(() => [
293
- (y(!0), w(U, null, P(j.value, (l) => (y(), T(a(Q), {
294
- key: l.value,
295
- label: l.label,
296
- value: l.value
317
+ default: i(() => [
318
+ (p(!0), E(G, null, A(X.value, (a) => (p(), Y(e(le), {
319
+ key: a.value,
320
+ label: a.label,
321
+ value: a.value
297
322
  }, null, 8, ["label", "value"]))), 128))
298
323
  ]),
299
324
  _: 1
300
- }, 8, ["modelValue"])) : Y("", !0),
301
- c(a(B), {
325
+ }, 8, ["modelValue"])) : z("", !0),
326
+ v(e(F), {
302
327
  plain: "",
303
- onClick: t[1] || (t[1] = (l) => m.value = !0),
328
+ onClick: l[1] || (l[1] = (a) => m.value = !0),
304
329
  style: { "margin-bottom": ".5rem" }
305
330
  }, {
306
- default: p(() => [
307
- _(D(a(d)("workSchedule.jobTitle")), 1)
331
+ default: i(() => [
332
+ V(k(e(o)("workSchedule.jobTitle")), 1)
308
333
  ]),
309
334
  _: 1
310
335
  }),
311
- c(a(Z), {
336
+ v(e(ae), {
312
337
  modelValue: h.value,
313
- "onUpdate:modelValue": t[2] || (t[2] = (l) => h.value = l),
314
- onChange: z,
338
+ "onUpdate:modelValue": l[2] || (l[2] = (a) => h.value = a),
339
+ onChange: L,
315
340
  placeholder: "Year",
316
341
  style: { width: "240px", "margin-bottom": ".5rem", "margin-right": ".5rem" }
317
342
  }, {
318
- default: p(() => [
319
- (y(!0), w(U, null, P(S.value, (l) => (y(), T(a(Q), {
320
- key: l.value,
321
- label: l.label,
322
- value: l.value
343
+ default: i(() => [
344
+ (p(!0), E(G, null, A(U.value, (a) => (p(), Y(e(le), {
345
+ key: a.value,
346
+ label: a.label,
347
+ value: a.value
323
348
  }, null, 8, ["label", "value"]))), 128))
324
349
  ]),
325
350
  _: 1
326
351
  }, 8, ["modelValue"]),
327
- c(a(oe), {
352
+ v(e(fe), {
328
353
  style: { width: "100%" },
329
- loading: b.value,
354
+ loading: S.value,
330
355
  animated: ""
331
356
  }, {
332
- template: p(() => [
333
- c(a(J), {
357
+ template: i(() => [
358
+ v(e(K), {
334
359
  variant: "text",
335
360
  style: { width: "100%", height: "2rem" }
336
361
  }),
337
- c(a(J), {
362
+ v(e(K), {
338
363
  variant: "text",
339
364
  style: { width: "180px", height: "4rem", "margin-right": "4px" }
340
365
  }),
341
- c(a(J), {
366
+ v(e(K), {
342
367
  variant: "text",
343
368
  style: { width: "calc( 100% - 184px)", height: "4rem" }
344
369
  }),
345
- c(a(J), {
370
+ v(e(K), {
346
371
  variant: "text",
347
372
  style: { width: "180px", height: "8rem", "margin-right": "4px" }
348
373
  }),
349
- c(a(J), {
374
+ v(e(K), {
350
375
  variant: "text",
351
376
  style: { width: "calc( 100% - 184px)", height: "8rem" }
352
377
  })
353
378
  ]),
354
- default: p(() => [
355
- c(a(de), {
379
+ default: i(() => [
380
+ v(e(pe), {
356
381
  id: "printTable",
357
382
  data: x.value,
358
- "span-method": X,
359
- onCellClick: q,
383
+ "span-method": ee,
384
+ onCellClick: r,
360
385
  border: "",
361
386
  style: { width: "100%" },
362
387
  size: "small",
363
- "empty-text": a(d)("vacationSchedule.emptyText")
388
+ "empty-text": e(o)("vacationSchedule.emptyText")
364
389
  }, {
365
- default: p(() => [
366
- c(a(G), {
367
- label: C.value !== "all" ? a(d)("vacationSchedule.title", { name: C.value }) : a(d)("vacationSchedule.enterprise") + ` ${h.value}`,
390
+ default: i(() => [
391
+ v(e(q), {
392
+ label: C.value !== "all" ? e(o)("vacationSchedule.title", { name: C.value }) : e(o)("vacationSchedule.enterprise") + ` ${h.value}`,
368
393
  align: "center",
369
394
  height: "34"
370
395
  }, {
371
- default: p(() => [
372
- c(a(G), {
373
- label: a(d)("vacationSchedule.jobTitle"),
396
+ default: i(() => [
397
+ v(e(q), {
398
+ label: e(o)("vacationSchedule.jobTitle"),
374
399
  width: "180",
375
400
  align: "center"
376
401
  }, {
377
- default: p((l) => [
378
- _(D(x.value[l.$index].jobTitle), 1)
402
+ default: i((a) => [
403
+ V(k(x.value[a.$index].jobTitle), 1)
379
404
  ]),
380
405
  _: 1
381
406
  }, 8, ["label"]),
382
- c(a(G), {
383
- label: a(d)("vacationSchedule.fullName"),
407
+ v(e(q), {
408
+ label: e(o)("vacationSchedule.fullName"),
384
409
  width: "180",
385
410
  align: "center"
386
411
  }, {
387
- default: p((l) => [
388
- _(D(x.value[l.$index].name), 1)
412
+ default: i((a) => [
413
+ V(k(x.value[a.$index].name), 1)
389
414
  ]),
390
415
  _: 1
391
416
  }, 8, ["label"]),
392
- c(a(G), {
393
- label: a(d)("vacationSchedule.personnelNumber"),
417
+ v(e(q), {
418
+ label: e(o)("vacationSchedule.personnelNumber"),
394
419
  align: "center"
395
420
  }, {
396
- default: p((l) => [
397
- _(D(x.value[l.$index].code), 1)
421
+ default: i((a) => [
422
+ V(k(x.value[a.$index].code), 1)
398
423
  ]),
399
424
  _: 1
400
425
  }, 8, ["label"]),
401
- c(a(G), {
402
- label: a(d)("vacationSchedule.vacation"),
426
+ v(e(q), {
427
+ label: e(o)("vacationSchedule.vacation"),
403
428
  align: "center"
404
429
  }, {
405
- default: p(() => [
406
- c(a(G), {
407
- label: a(d)("vacationSchedule.days"),
430
+ default: i(() => [
431
+ v(e(q), {
432
+ label: e(o)("vacationSchedule.days"),
408
433
  align: "center"
409
434
  }, {
410
- default: p((l) => [
411
- _(D(x.value[l.$index].count), 1)
435
+ default: i((a) => [
436
+ V(k(x.value[a.$index].count), 1)
412
437
  ]),
413
438
  _: 1
414
439
  }, 8, ["label"]),
415
- c(a(G), {
416
- label: a(d)("vacationSchedule.date"),
440
+ v(e(q), {
441
+ label: e(o)("vacationSchedule.date"),
417
442
  align: "center"
418
443
  }, {
419
- default: p((l) => [
420
- _(D(x.value[l.$index].dateStart), 1)
444
+ default: i((a) => [
445
+ V(k(x.value[a.$index].dateStart), 1)
421
446
  ]),
422
447
  _: 1
423
448
  }, 8, ["label"]),
424
- c(a(G), {
425
- label: a(d)("vacationSchedule.endDate"),
449
+ v(e(q), {
450
+ label: e(o)("vacationSchedule.endDate"),
426
451
  align: "center"
427
452
  }, {
428
- default: p((l) => [
429
- _(D(x.value[l.$index].dateEnd), 1)
453
+ default: i((a) => [
454
+ V(k(x.value[a.$index].dateEnd), 1)
430
455
  ]),
431
456
  _: 1
432
457
  }, 8, ["label"])
433
458
  ]),
434
459
  _: 1
435
460
  }, 8, ["label"]),
436
- c(a(G), {
437
- label: a(d)("vacationSchedule.note"),
461
+ v(e(q), {
462
+ label: e(o)("vacationSchedule.note"),
438
463
  align: "center"
439
464
  }, {
440
- default: p((l) => [
441
- c(a(se), {
442
- modelValue: k.value[x.value[l.$index].ids].days[x.value[l.$index].key].note,
443
- "onUpdate:modelValue": (E) => k.value[x.value[l.$index].ids].days[x.value[l.$index].key].note = E,
465
+ default: i((a) => [
466
+ v(e(he), {
467
+ modelValue: w.value[x.value[a.$index].ids].days[x.value[a.$index].key].note,
468
+ "onUpdate:modelValue": (I) => w.value[x.value[a.$index].ids].days[x.value[a.$index].key].note = I,
444
469
  style: { width: "100%" },
445
470
  placeholder: " ",
446
471
  class: "noBorder",
447
- onBlur: (E) => n(x.value[l.$index].ids)
472
+ onBlur: (I) => y(x.value[a.$index].ids)
448
473
  }, null, 8, ["modelValue", "onUpdate:modelValue", "onBlur"])
449
474
  ]),
450
475
  _: 1
@@ -458,91 +483,90 @@ const fe = (O, M) => {
458
483
  ]),
459
484
  _: 1
460
485
  }, 8, ["loading"]),
461
- O.checkEdit ? (y(), w("div", Ve, [
462
- R.value ? Y("", !0) : (y(), T(a(B), {
486
+ j.checkEdit ? (p(), E("div", je, [
487
+ J.value ? z("", !0) : (p(), Y(e(F), {
463
488
  key: 0,
464
489
  type: "primary",
465
- onClick: e.confirmData
490
+ onClick: l[3] || (l[3] = (a) => d.value = !0)
466
491
  }, {
467
- default: p(() => [
468
- _(D(a(d)("vacationSchedule.sendInformation")), 1)
492
+ default: i(() => [
493
+ V(k(e(o)("vacationSchedule.sendInformation")), 1)
469
494
  ]),
470
495
  _: 1
471
- }, 8, ["onClick"])),
472
- R.value ? Y("", !0) : (y(), T(a(B), {
496
+ })),
497
+ j.query === "confirm" ? (p(), Y(e(F), {
473
498
  key: 1,
474
499
  type: "primary",
475
- onClick: e.confirmData
500
+ onClick: l[4] || (l[4] = (a) => _(!0))
476
501
  }, {
477
- default: p(() => [
478
- _(D(a(d)("vacationSchedule.agreeOn")), 1)
502
+ default: i(() => [
503
+ V(k(e(o)("vacationSchedule.agreeOn")), 1)
479
504
  ]),
480
505
  _: 1
481
- }, 8, ["onClick"])),
482
- R.value ? Y("", !0) : (y(), T(a(B), {
506
+ })) : z("", !0),
507
+ j.query === "confirm" ? (p(), Y(e(F), {
483
508
  key: 2,
484
509
  type: "primary",
485
- onClick: e.confirmData
510
+ onClick: l[5] || (l[5] = (a) => _(!1))
486
511
  }, {
487
- default: p(() => [
488
- _(D(a(d)("vacationSchedule.reject")), 1)
512
+ default: i(() => [
513
+ V(k(e(o)("vacationSchedule.reject")), 1)
489
514
  ]),
490
515
  _: 1
491
- }, 8, ["onClick"]))
492
- ])) : Y("", !0),
493
- te((y(), T(a(B), {
494
- disabled: N.value,
516
+ })) : z("", !0)
517
+ ])) : z("", !0),
518
+ re((p(), Y(e(F), {
519
+ disabled: H.value,
495
520
  plain: "",
496
- onClick: e.exportToExcel,
521
+ onClick: t.exportToExcel,
497
522
  style: { "margin-top": ".5rem" }
498
523
  }, {
499
- default: p(() => [
500
- _(D(a(d)("workSchedule.exportExcel")), 1)
524
+ default: i(() => [
525
+ V(k(e(o)("workSchedule.exportExcel")), 1)
501
526
  ]),
502
527
  _: 1
503
528
  }, 8, ["disabled", "onClick"])), [
504
- [o, N.value]
529
+ [b, H.value]
505
530
  ]),
506
- c(a(ve), {
507
- title: a(d)("workSchedule.jobTitle"),
531
+ v(e(ue), {
532
+ title: e(o)("workSchedule.jobTitle"),
508
533
  modelValue: m.value,
509
- "onUpdate:modelValue": t[4] || (t[4] = (l) => m.value = l),
534
+ "onUpdate:modelValue": l[7] || (l[7] = (a) => m.value = a),
510
535
  width: "400px"
511
536
  }, {
512
- footer: p(() => [
513
- c(a(B), {
514
- onClick: t[3] || (t[3] = (l) => m.value = !1),
537
+ footer: i(() => [
538
+ v(e(F), {
539
+ onClick: l[6] || (l[6] = (a) => m.value = !1),
515
540
  size: "default"
516
541
  }, {
517
- default: p(() => [
518
- _(D(e.$t("workSchedule.cancel")), 1)
542
+ default: i(() => [
543
+ V(k(t.$t("workSchedule.cancel")), 1)
519
544
  ]),
520
545
  _: 1
521
546
  }),
522
- c(a(B), {
547
+ v(e(F), {
523
548
  size: "default",
524
549
  type: "primary",
525
- onClick: z
550
+ onClick: L
526
551
  }, {
527
- default: p(() => [
528
- _(D(e.$t("workSchedule.select")), 1)
552
+ default: i(() => [
553
+ V(k(t.$t("workSchedule.select")), 1)
529
554
  ]),
530
555
  _: 1
531
556
  })
532
557
  ]),
533
- default: p(() => [
534
- c(a(ie), {
535
- ref: "dialogForm",
536
- model: $.value,
558
+ default: i(() => [
559
+ v(e(oe), {
560
+ model: T.value,
537
561
  autocomplete: "on"
538
562
  }, {
539
- default: p(() => [
540
- (y(!0), w(U, null, P($.value, (l) => (y(), T(a(re), null, {
541
- default: p(() => [
542
- c(a(ce), {
543
- modelValue: l.val,
544
- "onUpdate:modelValue": (E) => l.val = E,
545
- "active-text": l.activeText
563
+ default: i(() => [
564
+ (p(!0), E(G, null, A(T.value, (a) => (p(), Y(e(me), null, {
565
+ default: i(() => [
566
+ v(e(ge), {
567
+ modelValue: a.val,
568
+ "onUpdate:modelValue": (I) => a.val = I,
569
+ "active-text": a.activeText
546
570
  }, null, 8, ["modelValue", "onUpdate:modelValue", "active-text"])
547
571
  ]),
548
572
  _: 2
@@ -553,46 +577,101 @@ const fe = (O, M) => {
553
577
  ]),
554
578
  _: 1
555
579
  }, 8, ["title", "modelValue"]),
556
- c(a(he), {
557
- show: V.value,
558
- "onUpdate:show": t[8] || (t[8] = (l) => V.value = l),
559
- options: L.value
580
+ v(e(ue), {
581
+ title: "Прошу согласовать график отпусков по отделу",
582
+ modelValue: d.value,
583
+ "onUpdate:modelValue": l[10] || (l[10] = (a) => d.value = a),
584
+ width: "500px"
560
585
  }, {
561
- default: p(() => [
562
- c(a(H), {
563
- label: i.value.level === 3 && typeof i.value.count < "u" ? i.value.name + " " + i.value.count + " " + a(d)("vacationSchedule.day", i.value.count) : i.value.name,
586
+ footer: i(() => [
587
+ v(e(F), {
588
+ onClick: l[9] || (l[9] = (a) => d.value = !1),
589
+ size: "default"
590
+ }, {
591
+ default: i(() => [
592
+ V(k(e(o)("workSchedule.cancel")), 1)
593
+ ]),
594
+ _: 1
595
+ }),
596
+ v(e(F), {
597
+ size: "default",
598
+ type: "primary",
599
+ onClick: $
600
+ }, {
601
+ default: i(() => [
602
+ V(k(e(o)("vacationSchedule.send")), 1)
603
+ ]),
604
+ _: 1
605
+ })
606
+ ]),
607
+ default: i(() => [
608
+ v(e(oe), {
609
+ model: B.value,
610
+ autocomplete: "on"
611
+ }, {
612
+ default: i(() => [
613
+ v(e(ae), {
614
+ modelValue: B.value.participants,
615
+ "onUpdate:modelValue": l[8] || (l[8] = (a) => B.value.participants = a),
616
+ placeholder: e(o)("vacationSchedule.fullName"),
617
+ multiple: "",
618
+ size: "default"
619
+ }, {
620
+ default: i(() => [
621
+ (p(!0), E(G, null, A(R.value, (a) => (p(), Y(e(le), {
622
+ key: a,
623
+ label: a,
624
+ value: a
625
+ }, null, 8, ["label", "value"]))), 128))
626
+ ]),
627
+ _: 1
628
+ }, 8, ["modelValue", "placeholder"])
629
+ ]),
630
+ _: 1
631
+ }, 8, ["model"])
632
+ ]),
633
+ _: 1
634
+ }, 8, ["modelValue"]),
635
+ v(e(ye), {
636
+ show: N.value,
637
+ "onUpdate:show": l[14] || (l[14] = (a) => N.value = a),
638
+ options: W.value
639
+ }, {
640
+ default: i(() => [
641
+ v(e(te), {
642
+ label: c.value.level === 3 && typeof c.value.count < "u" ? c.value.name + " " + c.value.count + " " + e(o)("vacationSchedule.day", c.value.count) : c.value.name,
564
643
  disabled: ""
565
644
  }, null, 8, ["label"]),
566
- c(a(pe)),
567
- i.value.level === 2 ? (y(), w("div", Ie, [
568
- i.value.length > 1 ? (y(), T(a(H), {
645
+ v(e(be)),
646
+ c.value.level === 2 ? (p(), E("div", Ne, [
647
+ c.value.length > 1 ? (p(), Y(e(te), {
569
648
  key: 0,
570
- label: a(d)("vacationSchedule.deleteLast"),
571
- onClick: t[5] || (t[5] = (l) => r("delete"))
572
- }, null, 8, ["label"])) : Y("", !0),
573
- i.value.add ? (y(), T(a(H), {
649
+ label: e(o)("vacationSchedule.deleteLast"),
650
+ onClick: l[11] || (l[11] = (a) => u("delete"))
651
+ }, null, 8, ["label"])) : z("", !0),
652
+ c.value.add ? (p(), Y(e(te), {
574
653
  key: 1,
575
- label: a(d)("vacationSchedule.addVacation"),
576
- onClick: t[6] || (t[6] = (l) => r("add"))
577
- }, null, 8, ["label"])) : Y("", !0)
578
- ])) : (y(), w("div", Te, [
579
- c(Me, {
580
- data: i.value,
654
+ label: e(o)("vacationSchedule.addVacation"),
655
+ onClick: l[12] || (l[12] = (a) => u("add"))
656
+ }, null, 8, ["label"])) : z("", !0)
657
+ ])) : (p(), E("div", Be, [
658
+ v(Fe, {
659
+ data: c.value,
581
660
  range: "range",
582
- onInput: u
661
+ onInput: s
583
662
  }, null, 8, ["data"]),
584
- f("div", null, [
585
- c(a(B), {
586
- onClick: t[7] || (t[7] = (l) => V.value = !1)
663
+ g("div", null, [
664
+ v(e(F), {
665
+ onClick: l[13] || (l[13] = (a) => N.value = !1)
587
666
  }, {
588
- default: p(() => [
589
- _(D(a(d)("vacationSchedule.cancel")), 1)
667
+ default: i(() => [
668
+ V(k(e(o)("vacationSchedule.cancel")), 1)
590
669
  ]),
591
670
  _: 1
592
671
  }),
593
- c(a(B), { onClick: s }, {
594
- default: p(() => [
595
- _(D(a(d)("vacationSchedule.save")), 1)
672
+ v(e(F), { onClick: n }, {
673
+ default: i(() => [
674
+ V(k(e(o)("vacationSchedule.save")), 1)
596
675
  ]),
597
676
  _: 1
598
677
  })
@@ -606,5 +685,5 @@ const fe = (O, M) => {
606
685
  }
607
686
  };
608
687
  export {
609
- Ge as default
688
+ qe as default
610
689
  };
@@ -1 +1 @@
1
- .wrapper[data-v-a842f008]{display:flex}.wrapper .month_year[data-v-a842f008]{display:flex;justify-content:space-around;align-items:center}.wrapper .month_year span:not(.text) button[data-v-a842f008]{font-size:1.3em}.wrapper>div[data-v-a842f008]:not(:first-child){margin-left:2rem}.wrapper button[data-v-a842f008]{height:30px;text-align:center;line-height:30px;cursor:pointer;background:none;border:none;border-radius:.2rem;transition:all .3s ease}.wrapper button[data-v-a842f008]:hover:not(.disabled):not(.active){color:var(--el-color-success)}.wrapper .week[data-v-a842f008]{border-bottom:1px solid var(--el-color-info);margin-bottom:.5rem}.wrapper .month[data-v-a842f008],.wrapper .week[data-v-a842f008]{width:250px;display:grid;grid-template-columns:1fr 1fr 1fr 1fr 1fr 1fr 1fr;gap:.2rem}.wrapper .month>button[data-v-a842f008],.wrapper .week>button[data-v-a842f008]{width:30px}.wrapper .month>button.disabled[data-v-a842f008],.wrapper .week>button.disabled[data-v-a842f008]{color:var(--el-color-info);cursor:not-allowed}.wrapper .month>button.preholiday[data-v-a842f008],.wrapper .week>button.preholiday[data-v-a842f008]{background-color:#fdd404}.wrapper .month>button.weekend[data-v-a842f008],.wrapper .week>button.weekend[data-v-a842f008]{background-color:#ff8080}.wrapper .month>button.holiday[data-v-a842f008],.wrapper .week>button.holiday[data-v-a842f008]{background-color:red}.wrapper .month>button.nowork[data-v-a842f008],.wrapper .week>button.nowork[data-v-a842f008]{background-color:red}.wrapper .month>button.active[data-v-a842f008],.wrapper .week>button.active[data-v-a842f008]{background-color:#007bff}.noBorder .el-input__wrapper{box-shadow:none}
1
+ .wrapper[data-v-fef4c07c]{display:flex}.wrapper .month_year[data-v-fef4c07c]{display:flex;justify-content:space-around;align-items:center}.wrapper .month_year span:not(.text) button[data-v-fef4c07c]{font-size:1.3em}.wrapper>div[data-v-fef4c07c]:not(:first-child){margin-left:2rem}.wrapper button[data-v-fef4c07c]{height:30px;text-align:center;line-height:30px;cursor:pointer;background:none;border:none;border-radius:.2rem;transition:all .3s ease}.wrapper button[data-v-fef4c07c]:hover:not(.disabled):not(.active){color:var(--el-color-success)}.wrapper .week[data-v-fef4c07c]{border-bottom:1px solid var(--el-color-info);margin-bottom:.5rem}.wrapper .month[data-v-fef4c07c],.wrapper .week[data-v-fef4c07c]{width:250px;display:grid;grid-template-columns:1fr 1fr 1fr 1fr 1fr 1fr 1fr;gap:.2rem}.wrapper .month>button[data-v-fef4c07c],.wrapper .week>button[data-v-fef4c07c]{width:30px}.wrapper .month>button.disabled[data-v-fef4c07c],.wrapper .week>button.disabled[data-v-fef4c07c]{color:var(--el-color-info);cursor:not-allowed}.wrapper .month>button.preholiday[data-v-fef4c07c],.wrapper .week>button.preholiday[data-v-fef4c07c]{background-color:#ffe78070}.wrapper .month>button.weekend[data-v-fef4c07c],.wrapper .week>button.weekend[data-v-fef4c07c]{background-color:#ff808070}.wrapper .month>button.select[data-v-fef4c07c],.wrapper .week>button.select[data-v-fef4c07c]{background-color:#007bff70}.wrapper .month>button.holiday[data-v-fef4c07c],.wrapper .week>button.holiday[data-v-fef4c07c]{background-color:red}.wrapper .month>button.nowork[data-v-fef4c07c],.wrapper .week>button.nowork[data-v-fef4c07c]{background-color:red}.wrapper .month>button.active[data-v-fef4c07c],.wrapper .week>button.active[data-v-fef4c07c]{background-color:#007bff}.noBorder .el-input__wrapper{box-shadow:none}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studio-west/employees",
3
- "version": "0.1.7",
3
+ "version": "0.2.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],