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