@studio-west/employees 0.5.9 → 0.5.11
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.
- package/dist/SheetTable.cjs +2 -2
- package/dist/SheetTable.js +17 -17
- package/dist/VacationTable.cjs +1 -1
- package/dist/VacationTable.js +55 -55
- package/dist/WorkTable.cjs +3 -3
- package/dist/WorkTable.js +121 -112
- package/package.json +1 -1
package/dist/SheetTable.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),M=require("vue-i18n"),p=require("./index-CmFQ6bqG.cjs"),r=require("element-plus"),F={style:{height:"20px",width:"100%",display:"inline-block"}},Y={style:{height:"20px",width:"100%",display:"inline-block"}},H={__name:"SheetTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"}},setup(w){const g=w,{t:i,d:C}=M.useI18n(),c=e.ref([]),x=e.ref("0"),y=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(x.value))),h=e.ref([]),v=e.ref("all"),N=e.ref([{value:"all",label:"Все",key:"all"}]),T=e.ref([]),k=e.ref(0),b=e.ref([]);e.watch(v,async(a,l)=>{a!==l&&(b.value=[],confirm.value=!1,g.odata.personal.forEach(t=>{t.divisionName===a&&(b.value.some(n=>(n==null?void 0:n.activeText)===t.roleName)||b.value.push({val:!0,activeText:t.roleName}))}),V())}),e.watch(x,a=>{y.value=new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(a)),D()});const u=e.computed(()=>c.value.flatMap((a,l)=>[{...a,key:0,ids:l},{...a,key:1,ids:l}])),S=a=>{if(a.columnIndex<2||a.columnIndex>h.value.length+3&&a.columnIndex<h.value.length+9||a.columnIndex>h.value.length+11)return u.value[a.rowIndex].key===0?{rowspan:2,colspan:1}:{rowspan:0,colspan:0}},D=()=>{const a=T.value,l=new Date(y.value),t=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let n=[],f=0;for(let d=1;d<=t;d++){const o=p.parseTime(l.setDate(d),"{Y}-{m}-{dd}");f+=a.nowork.includes(o)||a.holidays.includes(o)?0:a.preholidays.includes(o)?7:8;let s=a.nowork.includes(o)?"nowork":a.holidays.includes(o)?"holiday":a.preholidays.includes(o)?"preholiday":"";n.push({day:d,holidays:s,weekday:C(new Date(l.getFullYear(),l.getMonth(),d),"day")})}k.value=f,h.value=n,g.odata.getPersonal({}).then(d=>{var o;v.value=(o=d.find(s=>s.employeeName===g.fullName))==null?void 0:o.divisionName,d.forEach(s=>{N.value.some(m=>(m==null?void 0:m.value)===s.divisionName)||N.value.push({value:s.divisionName,label:s.divisionName,key:s.divisionName}),s.divisionName===v.value&&!b.value.some(m=>(m==null?void 0:m.activeText)===s.roleName)&&b.value.push({val:!0,activeText:s.roleName})}),V()})},V=()=>{c.value=[];let a=[];g.odata.personal.forEach(l=>{if(l.divisionName===v.value&&b.value.some(t=>t.val&&t.activeText===l.roleName)){let t=p.byInitials(l.employeeName);a.push(l.employeeKey),c.value.push({name:t+" ("+l.roleName+")",code:l.employeeKey,days:[],contHour:0,id:!1,ids:c.value.length})}}),B(a)},B=a=>{g.workSchedule.getWorkSchedule({code:a,date:p.parseTime(new Date(y.value),"{Y}-{m}-{dd}")}).then(l=>{l.forEach((t,n)=>{var f,d;if(t!==null){t.data.days.forEach(o=>o.state="Я");for(let o=1;o<=h.value.length;o++){let s=p.parseTime(new Date(y.value).setDate(o),"{Y}-{m}-{dd}");const m=(f=t.data)==null?void 0:f.days.findIndex($=>$.day===s);m===-1?c.value[n].days.push({day:s,time:"-",state:"В"}):c.value[n].days.push((d=t.data)==null?void 0:d.days[m])}}else{c.value[n].days=[];for(let o=1;o<=h.value.length;o++)h.value[o-1].holidays===""?E(o,n,8):h.value[o-1].holidays==="preholiday"?E(o,n,7):c.value[n].days.push({day:p.parseTime(new Date(y.value).setDate(o),"{Y}-{m}-{dd}"),time:"-",state:"В"})}}),_()})},E=(a,l,t)=>{const n=p.parseTime(new Date(y.value).setDate(a),"{Y}-{m}-{dd}");c.value[l].days.push({day:n,time:t,state:"Я"})},_=()=>{c.value.forEach(a=>{a.hourI=0,a.hourII=0,a.halfII=0,a.halfI=0,a.weekend=0,a.weekendDays=0,a.night=0;for(let l=0;l<a.days.length;l++)l<15&&a.days[l].time!=="-"&&(a.hourI+=a.days[l].time),l<15&&a.days[l].state==="Я"&&a.halfI++,l>=15&&a.days[l].time!=="-"&&(a.hourII+=a.days[l].time),l>=15&&a.days[l].state==="Я"&&a.halfII++,a.days[l].state==="Н"&&(a.night+=a.days[l].time),a.days[l].state==="РВ"&&(a.weekend+=a.days[l].time),a.days[l].state==="В"&&a.weekendDays++;a.contDays=a.halfI+a.halfII,a.contHour=a.hourI+a.hourII,a.overtime=0,k.value<a.contHour&&(a.overtime=a.contHour-k.value),a.numberNonAppearing=0,a.appearing={code:"-",countH:"-"}})},I=(a,l)=>{var d,o;if(l===-1)return"";const t=new Date(y.value),n=`${t.getFullYear()}-${(t.getMonth()+1).toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}`,f=u.value[l].days.findIndex(s=>s.day===n);return f===-1?"":u.value[l].key===0?(d=u.value[l].days[f])==null?void 0:d.state:(o=u.value[l].days[f])==null?void 0:o.time};return p.holidays().then(a=>{T.value=a,D()}),(a,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[w.checkEdit?(e.openBlock(),e.createBlock(e.unref(r.ElSelect),{key:0,modelValue:v.value,"onUpdate:modelValue":l[0]||(l[0]=t=>v.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(N.value,t=>(e.openBlock(),e.createBlock(e.unref(r.ElOption),{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),w.checkEdit?(e.openBlock(),e.createBlock(e.unref(r.ElSwitch),{key:1,modelValue:x.value,"onUpdate:modelValue":l[1]||(l[1]=t=>x.value=t),"active-text":e.unref(i)("workSchedule.currentMonth"),"active-value":"0","inactive-value":"-1",style:{"margin-bottom":".5rem","margin-left":".5rem"}},null,8,["modelValue","active-text"])):e.createCommentVNode("",!0),e.createVNode(e.unref(r.ElTable),{id:"printTable",data:u.value,"span-method":S,border:"",style:{width:"100%"},size:"small","empty-text":e.unref(i)("sheet.emptyText"),align:"center",
|
|
1
|
+
"use strict";const e=require("vue"),M=require("vue-i18n"),p=require("./index-CmFQ6bqG.cjs"),r=require("element-plus"),F={style:{height:"20px",width:"100%",display:"inline-block"}},Y={style:{height:"20px",width:"100%",display:"inline-block"}},H={__name:"SheetTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"}},setup(w){const g=w,{t:i,d:C}=M.useI18n(),c=e.ref([]),x=e.ref("0"),y=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(x.value))),h=e.ref([]),v=e.ref("all"),N=e.ref([{value:"all",label:"Все",key:"all"}]),T=e.ref([]),k=e.ref(0),b=e.ref([]);e.watch(v,async(a,l)=>{a!==l&&(b.value=[],confirm.value=!1,g.odata.personal.forEach(t=>{t.divisionName===a&&(b.value.some(n=>(n==null?void 0:n.activeText)===t.roleName)||b.value.push({val:!0,activeText:t.roleName}))}),V())}),e.watch(x,a=>{y.value=new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(a)),D()});const u=e.computed(()=>c.value.flatMap((a,l)=>[{...a,key:0,ids:l},{...a,key:1,ids:l}])),S=a=>{if(a.columnIndex<2||a.columnIndex>h.value.length+3&&a.columnIndex<h.value.length+9||a.columnIndex>h.value.length+11)return u.value[a.rowIndex].key===0?{rowspan:2,colspan:1}:{rowspan:0,colspan:0}},D=()=>{const a=T.value,l=new Date(y.value),t=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let n=[],f=0;for(let d=1;d<=t;d++){const o=p.parseTime(l.setDate(d),"{Y}-{m}-{dd}");f+=a.nowork.includes(o)||a.holidays.includes(o)?0:a.preholidays.includes(o)?7:8;let s=a.nowork.includes(o)?"nowork":a.holidays.includes(o)?"holiday":a.preholidays.includes(o)?"preholiday":"";n.push({day:d,holidays:s,weekday:C(new Date(l.getFullYear(),l.getMonth(),d),"day")})}k.value=f,h.value=n,g.odata.getPersonal({}).then(d=>{var o;v.value=(o=d.find(s=>s.employeeName===g.fullName))==null?void 0:o.divisionName,d.forEach(s=>{N.value.some(m=>(m==null?void 0:m.value)===s.divisionName)||N.value.push({value:s.divisionName,label:s.divisionName,key:s.divisionName}),s.divisionName===v.value&&!b.value.some(m=>(m==null?void 0:m.activeText)===s.roleName)&&b.value.push({val:!0,activeText:s.roleName})}),V()})},V=()=>{c.value=[];let a=[];g.odata.personal.forEach(l=>{if(l.divisionName===v.value&&b.value.some(t=>t.val&&t.activeText===l.roleName)){let t=p.byInitials(l.employeeName);a.push(l.employeeKey),c.value.push({name:t+" ("+l.roleName+")",code:l.employeeKey,days:[],contHour:0,id:!1,ids:c.value.length})}}),B(a)},B=a=>{g.workSchedule.getWorkSchedule({code:a,date:p.parseTime(new Date(y.value),"{Y}-{m}-{dd}")}).then(l=>{l.forEach((t,n)=>{var f,d;if(t!==null){t.data.days.forEach(o=>o.state="Я");for(let o=1;o<=h.value.length;o++){let s=p.parseTime(new Date(y.value).setDate(o),"{Y}-{m}-{dd}");const m=(f=t.data)==null?void 0:f.days.findIndex($=>$.day===s);m===-1?c.value[n].days.push({day:s,time:"-",state:"В"}):c.value[n].days.push((d=t.data)==null?void 0:d.days[m])}}else{c.value[n].days=[];for(let o=1;o<=h.value.length;o++)h.value[o-1].holidays===""?E(o,n,8):h.value[o-1].holidays==="preholiday"?E(o,n,7):c.value[n].days.push({day:p.parseTime(new Date(y.value).setDate(o),"{Y}-{m}-{dd}"),time:"-",state:"В"})}}),_()})},E=(a,l,t)=>{const n=p.parseTime(new Date(y.value).setDate(a),"{Y}-{m}-{dd}");c.value[l].days.push({day:n,time:t,state:"Я"})},_=()=>{c.value.forEach(a=>{a.hourI=0,a.hourII=0,a.halfII=0,a.halfI=0,a.weekend=0,a.weekendDays=0,a.night=0;for(let l=0;l<a.days.length;l++)l<15&&a.days[l].time!=="-"&&(a.hourI+=a.days[l].time),l<15&&a.days[l].state==="Я"&&a.halfI++,l>=15&&a.days[l].time!=="-"&&(a.hourII+=a.days[l].time),l>=15&&a.days[l].state==="Я"&&a.halfII++,a.days[l].state==="Н"&&(a.night+=a.days[l].time),a.days[l].state==="РВ"&&(a.weekend+=a.days[l].time),a.days[l].state==="В"&&a.weekendDays++;a.contDays=a.halfI+a.halfII,a.contHour=a.hourI+a.hourII,a.overtime=0,k.value<a.contHour&&(a.overtime=a.contHour-k.value),a.numberNonAppearing=0,a.appearing={code:"-",countH:"-"}})},I=(a,l)=>{var d,o;if(l===-1)return"";const t=new Date(y.value),n=`${t.getFullYear()}-${(t.getMonth()+1).toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}`,f=u.value[l].days.findIndex(s=>s.day===n);return f===-1?"":u.value[l].key===0?(d=u.value[l].days[f])==null?void 0:d.state:(o=u.value[l].days[f])==null?void 0:o.time};return p.holidays().then(a=>{T.value=a,D()}),(a,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[w.checkEdit?(e.openBlock(),e.createBlock(e.unref(r.ElSelect),{key:0,modelValue:v.value,"onUpdate:modelValue":l[0]||(l[0]=t=>v.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(N.value,t=>(e.openBlock(),e.createBlock(e.unref(r.ElOption),{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),w.checkEdit?(e.openBlock(),e.createBlock(e.unref(r.ElSwitch),{key:1,modelValue:x.value,"onUpdate:modelValue":l[1]||(l[1]=t=>x.value=t),"active-text":e.unref(i)("workSchedule.currentMonth"),"active-value":"0","inactive-value":"-1",style:{"margin-bottom":".5rem","margin-left":".5rem"}},null,8,["modelValue","active-text"])):e.createCommentVNode("",!0),e.createVNode(e.unref(r.ElTable),{id:"printTable",data:u.value,"span-method":S,border:"",style:{width:"100%"},size:"small","empty-text":e.unref(i)("sheet.emptyText"),align:"center",onCellClick:a.coMenu},{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.title",{name:v.value})+e.unref(C)(y.value,"month"),align:"center",height:"10"},{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.employee"),width:"180",align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(u.value[t.$index].name),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.personnelNumber"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(u.value[t.$index].code),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.marks"),align:"center"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.day},[t.day<=15?(e.openBlock(),e.createBlock(e.unref(r.ElTableColumn),{key:0,width:"30","class-name":t.holidays,align:"center",label:t.day.toString()+`
|
|
2
2
|
`+t.weekday},{default:e.withCtx(n=>[e.createElementVNode("div",F,e.toDisplayString(I(t.day,n.$index)||" "),1)]),_:2},1032,["class-name","label"])):e.createCommentVNode("",!0)],64))),128)),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.halfMonth",{half:"I"}),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(u.value[t.$index].key===0?u.value[t.$index].halfI:u.value[t.$index].hourI),1)]),_:1},8,["label"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.day},[t.day>15?(e.openBlock(),e.createBlock(e.unref(r.ElTableColumn),{key:0,width:"30","class-name":t.holidays,align:"center",label:t.day.toString()+`
|
|
3
|
-
`+t.weekday},{default:e.withCtx(n=>[e.createElementVNode("div",Y,e.toDisplayString(I(t.day,n.$index)||" "),1)]),_:2},1032,["class-name","label"])):e.createCommentVNode("",!0)],64))),128)),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.halfMonth",{half:"II"}),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(u.value[t.$index].key===0?u.value[t.$index].halfII:u.value[t.$index].hourII),1)]),_:1},8,["label"])]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.workedMonth"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.days"),align:"center","label-class-name":"turn",width:"34"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(u.value[t.$index].contDays),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.hours"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.all"),align:"center","label-class-name":"turn",width:"40"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(u.value[t.$index].contHour),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.overtime"),align:"center","label-class-name":"turn",width:"34"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(u.value[t.$index].overtime),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.night"),align:"center","label-class-name":"turn",width:"34"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(u.value[t.$index].night),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.weekend"),align:"center","label-class-name":"turn",width:"34"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(u.value[t.$index].weekend),1)]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.numberNonAppearing"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(u.value[t.$index].numberNonAppearing),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.them"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.code"),align:"center","label-class-name":"turn",width:"30"},{default:e.withCtx(t=>{var n;return[e.createTextVNode(e.toDisplayString((n=u.value[t.$index].appearing)==null?void 0:n.code),1)]}),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.count"),align:"center","label-class-name":"turn",width:"30"},{default:e.withCtx(t=>{var n;return[e.createTextVNode(e.toDisplayString((n=u.value[t.$index].appearing)==null?void 0:n.countH),1)]}),_:1},8,["label"])]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.countWeekend"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(u.value[t.$index].weekendDays),1)]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["data","empty-text","
|
|
3
|
+
`+t.weekday},{default:e.withCtx(n=>[e.createElementVNode("div",Y,e.toDisplayString(I(t.day,n.$index)||" "),1)]),_:2},1032,["class-name","label"])):e.createCommentVNode("",!0)],64))),128)),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.halfMonth",{half:"II"}),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(u.value[t.$index].key===0?u.value[t.$index].halfII:u.value[t.$index].hourII),1)]),_:1},8,["label"])]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.workedMonth"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.days"),align:"center","label-class-name":"turn",width:"34"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(u.value[t.$index].contDays),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.hours"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.all"),align:"center","label-class-name":"turn",width:"40"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(u.value[t.$index].contHour),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.overtime"),align:"center","label-class-name":"turn",width:"34"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(u.value[t.$index].overtime),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.night"),align:"center","label-class-name":"turn",width:"34"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(u.value[t.$index].night),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.weekend"),align:"center","label-class-name":"turn",width:"34"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(u.value[t.$index].weekend),1)]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.numberNonAppearing"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(u.value[t.$index].numberNonAppearing),1)]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.them"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.code"),align:"center","label-class-name":"turn",width:"30"},{default:e.withCtx(t=>{var n;return[e.createTextVNode(e.toDisplayString((n=u.value[t.$index].appearing)==null?void 0:n.code),1)]}),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.count"),align:"center","label-class-name":"turn",width:"30"},{default:e.withCtx(t=>{var n;return[e.createTextVNode(e.toDisplayString((n=u.value[t.$index].appearing)==null?void 0:n.countH),1)]}),_:1},8,["label"])]),_:1},8,["label"]),e.createVNode(e.unref(r.ElTableColumn),{label:e.unref(i)("sheet.countWeekend"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(u.value[t.$index].weekendDays),1)]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["data","empty-text","onCellClick"])],64))}};module.exports=H;
|
package/dist/SheetTable.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ref as w, watch as K, computed as L, createElementBlock as D, openBlock as y, Fragment as N, createBlock as $, createCommentVNode as E, createVNode as d, unref as t, withCtx as s, renderList as H,
|
|
2
|
-
import { useI18n as
|
|
3
|
-
import { p as M, b as
|
|
4
|
-
import { ElSelect as
|
|
5
|
-
const
|
|
1
|
+
import { ref as w, watch as K, computed as L, createElementBlock as D, openBlock as y, Fragment as N, createBlock as $, createCommentVNode as E, createVNode as d, unref as t, withCtx as s, renderList as H, createTextVNode as m, toDisplayString as c, createElementVNode as P } from "vue";
|
|
2
|
+
import { useI18n as q } from "vue-i18n";
|
|
3
|
+
import { p as M, b as G, h as R } from "./index-DIjJDdmP.js";
|
|
4
|
+
import { ElSelect as X, ElOption as Z, ElSwitch as Q, ElTable as ee, ElTableColumn as r } from "element-plus";
|
|
5
|
+
const ae = { style: { height: "20px", width: "100%", display: "inline-block" } }, le = { style: { height: "20px", width: "100%", display: "inline-block" } }, se = {
|
|
6
6
|
__name: "SheetTable",
|
|
7
7
|
props: {
|
|
8
8
|
checkEdit: { type: Boolean, default: () => !0 },
|
|
@@ -11,7 +11,7 @@ const le = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
11
11
|
fullName: { type: String, default: "Вы" }
|
|
12
12
|
},
|
|
13
13
|
setup(T) {
|
|
14
|
-
const _ = T, { t: i, d: C } =
|
|
14
|
+
const _ = T, { t: i, d: C } = q(), f = w([]), S = w("0"), x = w(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1).setMonth((/* @__PURE__ */ new Date()).getMonth() + Number(S.value))), b = w([]), k = w("all"), V = w([{ value: "all", label: "Все", key: "all" }]), F = w([]), Y = w(0), I = w([]);
|
|
15
15
|
K(k, async (e, l) => {
|
|
16
16
|
e !== l && (I.value = [], confirm.value = !1, _.odata.personal.forEach((a) => {
|
|
17
17
|
a.divisionName === e && (I.value.some((n) => (n == null ? void 0 : n.activeText) === a.roleName) || I.value.push({ val: !0, activeText: a.roleName }));
|
|
@@ -48,7 +48,7 @@ const le = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
48
48
|
let e = [];
|
|
49
49
|
_.odata.personal.forEach((l) => {
|
|
50
50
|
if (l.divisionName === k.value && I.value.some((a) => a.val && a.activeText === l.roleName)) {
|
|
51
|
-
let a =
|
|
51
|
+
let a = G(l.employeeName);
|
|
52
52
|
e.push(l.employeeKey), f.value.push({ name: a + " (" + l.roleName + ")", code: l.employeeKey, days: [], contHour: 0, id: !1, ids: f.value.length });
|
|
53
53
|
}
|
|
54
54
|
}), W(e);
|
|
@@ -103,10 +103,10 @@ const le = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
103
103
|
const a = new Date(x.value), n = `${a.getFullYear()}-${(a.getMonth() + 1).toString().padStart(2, "0")}-${e.toString().padStart(2, "0")}`, g = u.value[l].days.findIndex((h) => h.day === n);
|
|
104
104
|
return g === -1 ? "" : u.value[l].key === 0 ? (v = u.value[l].days[g]) == null ? void 0 : v.state : (o = u.value[l].days[g]) == null ? void 0 : o.time;
|
|
105
105
|
};
|
|
106
|
-
return
|
|
106
|
+
return R().then((e) => {
|
|
107
107
|
F.value = e, B();
|
|
108
108
|
}), (e, l) => (y(), D(N, null, [
|
|
109
|
-
T.checkEdit ? (y(), $(t(
|
|
109
|
+
T.checkEdit ? (y(), $(t(X), {
|
|
110
110
|
key: 0,
|
|
111
111
|
modelValue: k.value,
|
|
112
112
|
"onUpdate:modelValue": l[0] || (l[0] = (a) => k.value = a),
|
|
@@ -114,7 +114,7 @@ const le = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
114
114
|
style: { width: "240px", "margin-bottom": ".5rem", "margin-right": ".5rem" }
|
|
115
115
|
}, {
|
|
116
116
|
default: s(() => [
|
|
117
|
-
(y(!0), D(N, null, H(V.value, (a) => (y(), $(t(
|
|
117
|
+
(y(!0), D(N, null, H(V.value, (a) => (y(), $(t(Z), {
|
|
118
118
|
key: a.value,
|
|
119
119
|
label: a.label,
|
|
120
120
|
value: a.value
|
|
@@ -122,7 +122,7 @@ const le = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
122
122
|
]),
|
|
123
123
|
_: 1
|
|
124
124
|
}, 8, ["modelValue"])) : E("", !0),
|
|
125
|
-
T.checkEdit ? (y(), $(t(
|
|
125
|
+
T.checkEdit ? (y(), $(t(Q), {
|
|
126
126
|
key: 1,
|
|
127
127
|
modelValue: S.value,
|
|
128
128
|
"onUpdate:modelValue": l[1] || (l[1] = (a) => S.value = a),
|
|
@@ -131,7 +131,7 @@ const le = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
131
131
|
"inactive-value": "-1",
|
|
132
132
|
style: { "margin-bottom": ".5rem", "margin-left": ".5rem" }
|
|
133
133
|
}, null, 8, ["modelValue", "active-text"])) : E("", !0),
|
|
134
|
-
d(t(
|
|
134
|
+
d(t(ee), {
|
|
135
135
|
id: "printTable",
|
|
136
136
|
data: u.value,
|
|
137
137
|
"span-method": U,
|
|
@@ -140,7 +140,7 @@ const le = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
140
140
|
size: "small",
|
|
141
141
|
"empty-text": t(i)("sheet.emptyText"),
|
|
142
142
|
align: "center",
|
|
143
|
-
|
|
143
|
+
onCellClick: e.coMenu
|
|
144
144
|
}, {
|
|
145
145
|
default: s(() => [
|
|
146
146
|
d(t(r), {
|
|
@@ -185,7 +185,7 @@ const le = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
185
185
|
` + a.weekday
|
|
186
186
|
}, {
|
|
187
187
|
default: s((n) => [
|
|
188
|
-
P("div",
|
|
188
|
+
P("div", ae, c(O(a.day, n.$index) || " "), 1)
|
|
189
189
|
]),
|
|
190
190
|
_: 2
|
|
191
191
|
}, 1032, ["class-name", "label"])) : E("", !0)
|
|
@@ -211,7 +211,7 @@ const le = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
211
211
|
` + a.weekday
|
|
212
212
|
}, {
|
|
213
213
|
default: s((n) => [
|
|
214
|
-
P("div",
|
|
214
|
+
P("div", le, c(O(a.day, n.$index) || " "), 1)
|
|
215
215
|
]),
|
|
216
216
|
_: 2
|
|
217
217
|
}, 1032, ["class-name", "label"])) : E("", !0)
|
|
@@ -358,10 +358,10 @@ const le = { style: { height: "20px", width: "100%", display: "inline-block" } }
|
|
|
358
358
|
}, 8, ["label"])
|
|
359
359
|
]),
|
|
360
360
|
_: 1
|
|
361
|
-
}, 8, ["data", "empty-text", "
|
|
361
|
+
}, 8, ["data", "empty-text", "onCellClick"])
|
|
362
362
|
], 64));
|
|
363
363
|
}
|
|
364
364
|
};
|
|
365
365
|
export {
|
|
366
|
-
|
|
366
|
+
se as default
|
|
367
367
|
};
|
package/dist/VacationTable.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),V=require("./index-CmFQ6bqG.cjs"),W=require("vue-i18n"),Q=require("file-saver"),ee=require("exceljs"),d=require("element-plus"),G=require("@imengyu/vue3-context-menu");function te(D){const x=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(D){for(const n in D)if(n!=="default"){const p=Object.getOwnPropertyDescriptor(D,n);Object.defineProperty(x,n,p.get?p:{enumerable:!0,get:()=>D[n]})}}return x.default=D,Object.freeze(x)}const le=te(ee),ae=(D,x)=>{const n=D.__vccOpts||D;for(const[p,o]of x)n[p]=o;return n},ne={class:"wrapper"},oe={class:"month_year"},ue={class:"text"},re={class:"week"},ie={class:"month"},de=["onClick"],se={key:0},ce={class:"month_year"},ve={class:"text"},me={class:"week"},fe={class:"month"},ge=["onClick"],pe={__name:"DataPicker",props:{data:Object,limitation:{type:[Boolean,Array],default:()=>!1},range:{type:String,default:()=>"solid"}},emits:["input"],setup(D,{emit:x}){var U,P,J,O;const n=e.ref(new Date),p=e.ref(new Date),o=D,F=x,y=e.ref(new Date().getFullYear()),T=e.ref(new Date().getMonth()),Y=e.ref(new Date().getFullYear()),m=e.ref(new Date().getMonth()),s=e.ref([]),$=e.ref(0),_=e.ref(0),h=e.ref(-1),k=e.ref(-1),{locale:A}=W.useI18n(),b=/en|zh|ja|he/.test(A.value)?0:1,N=o.range==="range"?2:1,I=c=>{const r=c.split(c.match(/\D.*?\D?/));return r[0].length>2?r.join("-")+"T00:00:01":r.reverse().join("-")+"T00:00:01"};typeof((U=o.data)==null?void 0:U.startDate)<"u"&&(n.value=new Date(I(o.data.startDate)),y.value=n.value.getFullYear(),m.value=n.value.getMonth()),typeof((P=o.data)==null?void 0:P.endDate)<"u"&&(p.value=new Date(I(o.data.endDate)),Y.value=p.value.getFullYear(),T.value=p.value.getMonth());const v=()=>{let c=new Date(y.value,m.value,0);for(let a=c.getDate()-c.getDay()+b;a<=c.getDate()&&c.getDay()!==6+b;a++)$.value++,s.value.push({day:a,month:c.getMonth(),year:c.getFullYear(),class:[]});for(let a=1;a<=new Date(y.value,m.value+1,0).getDate();a++)$.value++,s.value.push({day:a,month:m.value,year:y.value,class:[]});if(o.range==="range"){_.value=new Date(y.value,m.value+2,0);for(let a=1;a<=_.value.getDate();a++)s.value.push({day:a,month:_.value.getMonth(),year:_.value.getFullYear(),class:[]})}let r=new Date(y.value,m.value+N,1);console.log(r.getDay());for(let a=1;a<=(7-r.getDay()+b)%7&&r.getDay()!==b;a++)s.value.push({day:a,month:r.getMonth(),year:r.getFullYear(),class:[]});o.data.holiday.length!==0&&(o.data.holiday.preholidays.forEach(a=>{let i=a.split("-");const C=s.value.findIndex(S=>S.year==i[0]&&S.month+1==i[1]&&S.day==i[2]);C!==-1&&(s.value[C].class[0]="preholiday")}),o.data.holiday.holidays.forEach(a=>{let i=a.split("-");const C=s.value.findIndex(S=>S.year==i[0]&&S.month+1==i[1]&&S.day==i[2]);C!==-1&&(s.value[C].class[0]="weekend")}),o.data.holiday.holiday.forEach(a=>{let i=a.split("-");const C=s.value.findIndex(S=>S.year==i[0]&&S.month+1==i[1]&&S.day==i[2]);C!==-1&&(s.value[C].class[0]="holiday")}),o.data.holiday.nowork.forEach(a=>{let i=a.split("-");const C=s.value.findIndex(S=>S.year==i[0]&&S.month+1==i[1]&&S.day==i[2]);C!==-1&&(s.value[C].class[0]="nowork")}))},L=(c,r)=>{let a=c-r+1;for(let i=0;i<=c-r;i++)s.value[i+r].class[0]==="holiday"&&a--;return a},E=(c,r)=>{const a=V.parseTime(new Date(c.year,c.month,c.day),"{dd}.{m}.{Y}");if(o.range==="range")if(console.log(h.value),k.value!==-1){if(k.value<=h.value)for(let i=k.value;i<=h.value;i++)s.value[i].class[1]="";else for(let i=h.value;i<=k.value;i++)s.value[i].class[1]="";h.value=r,k.value=-1,s.value[r].class[1]="active"}else if(h.value!==-1){if(k.value=r,k.value>=h.value)for(let C=h.value+1;C<r;C++)s.value[C].class[1]="select";else for(let C=r+1;C<h.value;C++)s.value[C].class[1]="select";s.value[r].class[1]="active";let i=V.parseTime(new Date(s.value[h.value].year,s.value[h.value].month,s.value[h.value].day),"{dd}.{m}.{Y}");h.value>r?F("input",{dateStart:a,dateEnd:i,count:L(h.value,r)}):F("input",{dateStart:i,dateEnd:a,count:L(r,h.value)})}else h.value=r,s.value[r].class[1]="active";else s.value[h.value].class[1]="",h.value=r,s.value[r].class[1]="active",F("input",{dateStart:a,count:1})};if(v(),typeof((J=o.data)==null?void 0:J.startDate)<"u"&&(h.value=s.value.findIndex(c=>c.day===n.value.getDate()&&c.month===m.value&&c.year===y.value),s.value[h.value].class[1]="active"),typeof((O=o.data)==null?void 0:O.endDate)<"u"&&o.range==="range"){k.value=s.value.findIndex(c=>c.day===p.value.getDate()&&c.month===T.value&&c.year===Y.value),s.value[k.value].class[1]="active";for(let c=h.value+1;c<k.value;c++)s.value[c].class[1]="select"}const B=(c,r)=>{z(c,r)&&(s.value=[],$.value=0,n.value=new Date(c,r,1),y.value=n.value.getFullYear(),m.value=n.value.getMonth(),v())},z=(c,r)=>{if(!o.limitation)return!0;if(o.limitation[0].dateStart){console.log(o.limitation[0].dateStart);let a=o.limitation[0].dateStart.split(o.limitation[0].dateStart.match(/\D.*?\D?/));if(a[0].length>2&&a.reverse(),parseInt(a[2])>c||parseInt(a[2])===c&&parseInt(a[1])>r+1)return!1}if(o.limitation[o.limitation.length-1].dateEnd){console.log(o.limitation[o.limitation.length-1].dateEnd);let a=o.limitation[o.limitation.length-1].dateEnd.split(o.limitation[o.limitation.length-1].dateEnd.match(/\D.*?\D?/));if(a[0].length>2&&a.reverse(),parseInt(a[2])<c||parseInt(a[2])===c&&parseInt(a[1])<r+N)return!1}return!0};return(c,r)=>(e.openBlock(),e.createElementBlock("div",ne,[e.createElementVNode("div",null,[e.createElementVNode("p",oe,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:r[0]||(r[0]=a=>B(y.value-1,m.value))},"«"),e.createElementVNode("button",{onClick:r[1]||(r[1]=a=>B(y.value,m.value-1))},"‹")]),e.createElementVNode("span",ue,[e.createElementVNode("button",null,e.toDisplayString(y.value),1),e.createElementVNode("button",null,e.toDisplayString(e.unref(V.parseTime)(n.value.setMonth(m.value),"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:r[2]||(r[2]=a=>B(y.value,m.value+1))},"›"),e.createElementVNode("button",{onClick:r[3]||(r[3]=a=>B(y.value+1,m.value))},"»")])]),e.createElementVNode("div",re,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(a,i)=>e.createElementVNode("button",{key:i,class:"disabled"},e.toDisplayString(e.unref(V.parseTime)(new Date(1970,1,a+e.unref(b)),"{D}")),1)),64))]),e.createElementVNode("div",ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[i<$.value+(7-new Date(y.value,m.value+1,1).getDay()+e.unref(b))%7?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(a.month===m.value&&(!o.limitation||new Date(a.year,a.month,a.day+1).getTime()>new Date(I(o.limitation[0].dateStart)).getTime()&&new Date(a.year,a.month,a.day).getTime()<new Date(I(o.limitation[0].dateEnd)).getTime())?a.class:"disabled"),onClick:()=>{a.month===m.value&&E(a,i)}},e.toDisplayString(a.day),11,de)):e.createCommentVNode("",!0)],64))),128))])]),o.range==="range"?(e.openBlock(),e.createElementBlock("div",se,[e.createElementVNode("p",ce,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:r[4]||(r[4]=a=>B(y.value-1,m.value))},"«"),e.createElementVNode("button",{onClick:r[5]||(r[5]=a=>B(y.value,m.value-1))},"‹")]),e.createElementVNode("span",ve,[e.createElementVNode("button",null,e.toDisplayString(new Date(y.value,m.value+1).getFullYear()),1),e.createElementVNode("button",null,e.toDisplayString(e.unref(V.parseTime)(n.value.setMonth(m.value+1),"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:r[6]||(r[6]=a=>B(y.value,m.value+1))},"›"),e.createElementVNode("button",{onClick:r[7]||(r[7]=a=>B(y.value+1,m.value))},"»")])]),e.createElementVNode("div",me,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(a,i)=>e.createElementVNode("button",{key:i,class:"disabled"},e.toDisplayString(e.unref(V.parseTime)(new Date(1970,1,a+e.unref(b)),"{D}")),1)),64))]),e.createElementVNode("div",fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[i>=$.value-(7+new Date(y.value,m.value+1,1).getDay()-e.unref(b))%7?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(a.month===_.value.getMonth()&&(!o.limitation||new Date(a.year,a.month,a.day+1).getTime()>new Date(I(o.limitation[0].dateStart)).getTime()&&new Date(a.year,a.month,a.day).getTime()<new Date(I(o.limitation[0].dateEnd)).getTime())?a.class:"disabled"),onClick:()=>{a.month===_.value.getMonth()&&E(a,i)}},e.toDisplayString(a.day),11,ge)):e.createCommentVNode("",!0)],64))),128))])])):e.createCommentVNode("",!0)]))}},he=ae(pe,[["__scopeId","data-v-d1aa0363"]]),ye={key:1,class:"controls-container",style:{"margin-top":".5rem"}},Ce={key:0},ke={key:1,style:{padding:"0 1rem .5rem"}},xe={__name:"VacationTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,query:String,fullName:{type:String,default:"Вы"}},setup(D){const x=D,{t:n}=W.useI18n(),p=e.ref([]);e.ref([]);const o=e.ref(new Date().getFullYear()),F=e.ref(!1),y=e.ref(!1),T=e.ref(!1),Y=e.ref({zIndex:3,minWidth:230,x:500,y:200}),m=e.ref(!1),s=e.ref(!1),$=e.ref({participants:[]}),_=e.ref([]),h=e.ref([]),k=e.ref("all"),A=e.ref([{value:"all",label:n("vacationSchedule.all"),key:"all"}]),b=e.ref(!1),N=e.ref([]),I=e.ref(!1),v=e.ref({name:"",length:0,code:""}),L=new Date().getMonth()>11?[{value:o.value,label:o.value},{value:o.value+1,label:o.value+1}]:[{value:o.value-1,label:o.value-1},{value:o.value,label:o.value}];e.watch(k,async(u,t)=>{u!==t&&(console.log(u),N.value=[],F.value=!1,x.odata.employee.forEach(f=>{(f.divisionName===u||u==="all")&&(N.value.some(l=>(l==null?void 0:l.activeText)===f.roleName)||N.value.push({val:!0,activeText:f.roleName}))}),z())});const E=e.computed(()=>p.value.flatMap((u,t)=>!u.days||u.days.length===0?[{...u,key:0,ids:t}]:u.days.map((f,l)=>({ids:t,key:l,...u,...f})))),B=async()=>{x.odata.getEmployee(o.value-1+"-12-17T23:59:00").then(u=>{var t;k.value=(t=u.find(f=>f.employeeName===x.fullName))==null?void 0:t.divisionName,u.forEach(f=>{A.value.some(l=>(l==null?void 0:l.value)===f.divisionName)||A.value.push({value:f.divisionName,label:f.divisionName,key:f.divisionName}),f.divisionName===k.value&&!N.value.some(l=>(l==null?void 0:l.activeText)===f.roleName)&&N.value.push({val:!0,activeText:f.roleName})}),z(),y.value=!1})},z=()=>{p.value=[];let u=[];x.odata.employee.forEach(t=>{(t.divisionName===k.value||k.value==="all")&&N.value.some(f=>f.val&&f.activeText===t.roleName)&&(u.push(t.employeeKey),p.value.push({name:t.employeeName,days:[{note:""}],jobTitle:t.roleName,code:t.employeeKey}))}),U(u),m.value=!1},U=u=>{x.workSchedule.getAllVacations({year:o.value}).then(t=>{u.forEach((f,l)=>{p.value[l].days=[{note:""}],t.forEach(g=>{f===g.code&&(typeof p.value[l].days[0].dateStart>"u"?p.value[l].days[0]={dateStart:V.parseTime(g.dateStart,"{dd}.{m}.{Y}"),dateEnd:V.parseTime(g.dateEnd,"{dd}.{m}.{Y}"),note:g.note,count:g.count}:p.value[l].days.push({dateStart:V.parseTime(g.dateStart,"{dd}.{m}.{Y}"),dateEnd:V.parseTime(g.dateEnd,"{dd}.{m}.{Y}"),note:g.note,count:g.count}))})})})},P=u=>{if(u.columnIndex<3&&E.value[u.rowIndex].key<E.value[u.rowIndex].days.length)return E.value[u.rowIndex].key===0?{rowspan:E.value[u.rowIndex].days.length,colspan:1}:{rowspan:0,colspan:0}},J=(u,t,f,l)=>{v.value.ids=u.ids,v.value.key=u.key,v.value.startDate=u.dateStart,v.value.endDate=u.dateEnd,v.value.name=u.name,v.value.count=u.count,v.value.allCount=()=>u.days.length===0?0:u.days.reduce((g,q,M)=>M!==u.key?g+parseInt(q.count):g,0),v.value.length=u.days.length,v.value.add=u.days.length>0&&u.days[u.days.length-1].count,v.value.level=t.level,v.value.holiday=h.value,Y.value.y=l.clientY,Y.value.x=l.clientX,t.level===2&&t.no<4&&(v.value.add||u.days.length>1)&&(T.value=!0),t.level===3&&(T.value=!0)},O=u=>{let t=p.value[v.value.ids];switch(u){case"add":t.days.push({note:""}),console.log(t.days.length);break;case"delete":delete t.days.pop(),a(v.value.ids);break}T.value=!1},c=u=>{I.value=u,v.value.count=u.count},r=()=>{I.value&&(p.value[v.value.ids].days[v.value.key]={...I.value,note:""},a(v.value.ids)),T.value=!1},a=u=>{x.workSchedule.rewriteFull({year:o.value,code:p.value[u].code,data:p.value[u].days.map(t=>({dateStart:t.dateStart.split(".").reverse().join("-"),dateEnd:t.dateEnd.split(".").reverse().join("-"),note:t.note,count:t.count}))})},i=u=>{x.workSchedule.sendConfirmMessage({fullname:x.fullName,confirm:u}),x.query=""},C=()=>{x.workSchedule.sendAgreementMessage({users:$.value.participants}),s.value=!1};x.workSchedule.getBoss().then(u=>{_.value=u[0].users}),V.holidays().then(u=>{h.value=u,B()});const S=()=>v.value.length<2?[{dateStart:"01.01."+o.value,dateEnd:"31.12."+o.value}]:[{dateStart:"01.01."+o.value,dateEnd:"31.12."+o.value}],K=async()=>{b.value=!0;const u=new le.Workbook,t=u.addWorksheet(o.value.toString(),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),f={vertical:"middle",horizontal:"center"},l={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},g={vertical:"middle",horizontal:"center",wrapText:!0},q={vertical:"middle",horizontal:"right",wrapText:!0};t.mergeCells("D1:G1"),t.mergeCells("D2:G2"),t.mergeCells("D3:G3"),t.mergeCells("D4:G4"),t.mergeCells("A5:G5"),t.mergeCells("A6:G6"),t.mergeCells("A9:G9"),t.mergeCells("A10:A11"),t.mergeCells("B10:B11"),t.mergeCells("C10:C11"),t.mergeCells("D10:F10"),t.mergeCells("G10:G11"),t.getCell("D1").value=n("vacationSchedule.approve"),t.getCell("D2").value=n("vacationSchedule.dateApprove",{year:o.value-1}),t.getCell("D3").value=n("workSchedule.printPlace"),t.getCell("D4").value=n("vacationSchedule.dateApprove",{year:o.value-1}),t.getCell("A5").value=n("workSchedule.firm"),t.getCell("B7").value=n("vacationSchedule.vacationSchedule"),t.getCell("C7").value=n("vacationSchedule.numberDocs"),t.getCell("D7").value=n("vacationSchedule.compilation"),t.getCell("E7").value=n("vacationSchedule.year"),t.getCell("C8").value="",t.getCell("D8").value="",t.getCell("E8").value=o.value,t.getCell("E7").value=n("vacationSchedule.year"),t.getCell("A10").value=n("vacationSchedule.jobTitle"),t.getCell("B10").value=n("vacationSchedule.fullName"),t.getCell("C10").value=n("vacationSchedule.personnelNumber"),t.getCell("D10").value=n("vacationSchedule.vacation"),t.getCell("D11").value=n("vacationSchedule.days"),t.getCell("E11").value=n("vacationSchedule.date"),t.getCell("F11").value=n("vacationSchedule.endDate"),t.getCell("G11").value=n("vacationSchedule.note"),t.getRow(1).height=80,t.getColumn(1).width=28,t.getColumn(2).width=28,t.getColumn(3).width=18,t.getColumn(4).width=18,t.getColumn(5).width=14,t.getColumn(6).width=14,t.getColumn(7).width=14,t.getColumn(1).alignment=g,t.getColumn(2).alignment=g,t.getColumn(3).alignment=g,t.getColumn(4).alignment=g,t.getColumn(5).alignment=g,t.getColumn(6).alignment=g,t.getColumn(7).alignment=g,t.getCell("D1").alignment=q,t.getCell("D2").alignment=q,t.getCell("D4").alignment=q,t.getCell("A5").alignment=f,t.getCell("C7").border=l,t.getCell("D7").border=l,t.getCell("E7").border=l,t.getCell("C8").border=l,t.getCell("D8").border=l,t.getCell("E8").border=l,t.getCell("A10").border=l,t.getCell("B10").border=l,t.getCell("C10").border=l,t.getCell("D10").border=l,t.getCell("G10").border=l,t.getCell("D11").border=l,t.getCell("E11").border=l,t.getCell("F11").border=l;let M=11;for(const w of p.value)if(w.days.length>1)w.days.forEach(j=>{let R=[w.jobTitle,w.name,w.code,j.count,j.dateStart,j.dateEnd,j.note];const Z=t.addRow(R);Z.border=l,M++}),t.mergeCells(`A${M-w.days.length+1}:A${M}`),t.mergeCells(`B${M-w.days.length+1}:B${M}`),t.mergeCells(`C${M-w.days.length+1}:C${M}`);else{let j=[w.jobTitle,w.name,w.code,w.days[0].count,w.days[0].dateStart,w.days[0].dateEnd,w.days[0].note];const R=t.addRow(j);R.border=l,M++}const X="export_"+V.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",H=await u.xlsx.writeBuffer();Q.saveAs(new Blob([H]),X),b.value=!1};return(u,t)=>{const f=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",null,[D.checkEdit?(e.openBlock(),e.createBlock(e.unref(d.ElSelect),{key:0,modelValue:k.value,"onUpdate:modelValue":t[0]||(t[0]=l=>k.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(A.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=>m.value=!0),style:{"margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("workSchedule.jobTitle")),1)]),_:1}),e.createVNode(e.unref(d.ElSelect),{modelValue:o.value,"onUpdate:modelValue":t[2]||(t[2]=l=>o.value=l),onChange:B,placeholder:"Year",style:{width:"80px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(L),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:y.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:E.value,"span-method":P,onCellContextmenu:e.withModifiers(J,["stop"]),border:"",style:{width:"100%"},size:"small","empty-text":e.unref(n)("vacationSchedule.emptyText")},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElTableColumn),{label:k.value!=="all"?e.unref(n)("vacationSchedule.title",{name:k.value}):e.unref(n)("vacationSchedule.enterprise")+` ${o.value}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.jobTitle"),width:"180",align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(E.value[l.$index].jobTitle),1)]),_:1},8,["label"]),e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.fullName"),width:"180",align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(E.value[l.$index].name),1)]),_:1},8,["label"]),e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.personnelNumber"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(E.value[l.$index].code),1)]),_:1},8,["label"]),e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.vacation"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.days"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(E.value[l.$index].count),1)]),_:1},8,["label"]),e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.date"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(E.value[l.$index].dateStart),1)]),_:1},8,["label"]),e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.endDate"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(E.value[l.$index].dateEnd),1)]),_:1},8,["label"])]),_:1},8,["label"]),e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.note"),align:"center"},{default:e.withCtx(l=>[e.createVNode(e.unref(d.ElInput),{modelValue:p.value[E.value[l.$index].ids].days[E.value[l.$index].key].note,"onUpdate:modelValue":g=>p.value[E.value[l.$index].ids].days[E.value[l.$index].key].note=g,style:{width:"100%"},placeholder:" ",class:"noBorder",onBlur:g=>a(E.value[l.$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",ye,[F.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:0,type:"primary",onClick:t[3]||(t[3]=l=>s.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.sendInformation")),1)]),_:1})),D.query==="confirm"?(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:1,type:"primary",onClick:t[4]||(t[4]=l=>i(!0))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.agreeOn")),1)]),_:1})):e.createCommentVNode("",!0),D.query==="confirm"?(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:2,type:"primary",onClick:t[5]||(t[5]=l=>i(!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.reject")),1)]),_:1})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(d.ElButton),{disabled:b.value,plain:"",onClick:K,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[f,b.value]]),e.createVNode(e.unref(d.ElDialog),{title:e.unref(n)("workSchedule.jobTitle"),modelValue:m.value,"onUpdate:modelValue":t[7]||(t[7]=l=>m.value=l),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(d.ElButton),{onClick:t[6]||(t[6]=l=>m.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(d.ElButton),{size:"default",type:"primary",onClick:z},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(d.ElForm),{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":g=>l.val=g,"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(d.ElDialog),{title:e.unref(n)("vacationSchedule.pleaseCoordinate"),modelValue:s.value,"onUpdate:modelValue":t[10]||(t[10]=l=>s.value=l),width:"500px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(d.ElButton),{onClick:t[9]||(t[9]=l=>s.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(d.ElButton),{size:"default",type:"primary",onClick:C},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.send")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(d.ElForm),{model:$.value,autocomplete:"on"},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElSelect),{modelValue:$.value.participants,"onUpdate:modelValue":t[8]||(t[8]=l=>$.value.participants=l),placeholder:e.unref(n)("vacationSchedule.fullName"),multiple:"",size:"default"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,l=>(e.openBlock(),e.createBlock(e.unref(d.ElOption),{key:l,label:l,value:l},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(G.ContextMenu),{show:T.value,"onUpdate:show":t[14]||(t[14]=l=>T.value=l),options:Y.value},{default:e.withCtx(()=>[e.createVNode(e.unref(G.ContextMenuItem),{label:v.value.level===3&&typeof v.value.count<"u"?v.value.name+" "+v.value.count+" "+e.unref(n)("vacationSchedule.day",v.value.count)+` ${e.unref(n)("vacationSchedule.from")}: ${v.value.allCount()+parseInt(v.value.count)}`:v.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(G.ContextMenuSeparator)),v.value.level===2?(e.openBlock(),e.createElementBlock("div",Ce,[v.value.length>1?(e.openBlock(),e.createBlock(e.unref(G.ContextMenuItem),{key:0,label:e.unref(n)("vacationSchedule.deleteLast"),onClick:t[11]||(t[11]=l=>O("delete"))},null,8,["label"])):e.createCommentVNode("",!0),v.value.add?(e.openBlock(),e.createBlock(e.unref(G.ContextMenuItem),{key:1,label:e.unref(n)("vacationSchedule.addVacation"),onClick:t[12]||(t[12]=l=>O("add"))},null,8,["label"])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",ke,[e.createVNode(he,{data:v.value,range:"range",limitation:S(),onInput:c},null,8,["data","limitation"]),e.createElementVNode("div",null,[e.createVNode(e.unref(d.ElButton),{onClick:t[13]||(t[13]=l=>T.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(d.ElButton),{onClick:r},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.save")),1)]),_:1})])]))]),_:1},8,["show","options"])])}}};module.exports=xe;
|
|
1
|
+
"use strict";const e=require("vue"),V=require("./index-CmFQ6bqG.cjs"),W=require("vue-i18n"),Q=require("file-saver"),ee=require("exceljs"),d=require("element-plus"),G=require("@imengyu/vue3-context-menu");function te(D){const x=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(D){for(const n in D)if(n!=="default"){const p=Object.getOwnPropertyDescriptor(D,n);Object.defineProperty(x,n,p.get?p:{enumerable:!0,get:()=>D[n]})}}return x.default=D,Object.freeze(x)}const le=te(ee),ae=(D,x)=>{const n=D.__vccOpts||D;for(const[p,o]of x)n[p]=o;return n},ne={class:"wrapper"},oe={class:"month_year"},ue={class:"text"},re={class:"week"},ie={class:"month"},de=["onClick"],ce={key:0},se={class:"month_year"},ve={class:"text"},me={class:"week"},fe={class:"month"},ge=["onClick"],pe={__name:"DataPicker",props:{data:Object,limitation:{type:[Boolean,Array],default:()=>!1},range:{type:String,default:()=>"solid"}},emits:["input"],setup(D,{emit:x}){var U,P,J,O;const n=e.ref(new Date),p=e.ref(new Date),o=D,F=x,y=e.ref(new Date().getFullYear()),T=e.ref(new Date().getMonth()),Y=e.ref(new Date().getFullYear()),m=e.ref(new Date().getMonth()),c=e.ref([]),$=e.ref(0),_=e.ref(0),h=e.ref(-1),k=e.ref(-1),{locale:A}=W.useI18n(),b=/en|zh|ja|he/.test(A.value)?0:1,N=o.range==="range"?2:1,I=s=>{const r=s.split(s.match(/\D.*?\D?/));return r[0].length>2?r.join("-")+"T00:00:01":r.reverse().join("-")+"T00:00:01"};typeof((U=o.data)==null?void 0:U.startDate)<"u"&&(n.value=new Date(I(o.data.startDate)),y.value=n.value.getFullYear(),m.value=n.value.getMonth()),typeof((P=o.data)==null?void 0:P.endDate)<"u"&&(p.value=new Date(I(o.data.endDate)),Y.value=p.value.getFullYear(),T.value=p.value.getMonth());const v=()=>{let s=new Date(y.value,m.value,0);for(let a=s.getDate()-s.getDay()+b;a<=s.getDate()&&s.getDay()!==6+b;a++)$.value++,c.value.push({day:a,month:s.getMonth(),year:s.getFullYear(),class:[]});for(let a=1;a<=new Date(y.value,m.value+1,0).getDate();a++)$.value++,c.value.push({day:a,month:m.value,year:y.value,class:[]});if(o.range==="range"){_.value=new Date(y.value,m.value+2,0);for(let a=1;a<=_.value.getDate();a++)c.value.push({day:a,month:_.value.getMonth(),year:_.value.getFullYear(),class:[]})}let r=new Date(y.value,m.value+N,1);console.log(r.getDay());for(let a=1;a<=(7-r.getDay()+b)%7&&r.getDay()!==b;a++)c.value.push({day:a,month:r.getMonth(),year:r.getFullYear(),class:[]});o.data.holiday.length!==0&&(o.data.holiday.preholidays.forEach(a=>{let i=a.split("-");const C=c.value.findIndex(S=>S.year==i[0]&&S.month+1==i[1]&&S.day==i[2]);C!==-1&&(c.value[C].class[0]="preholiday")}),o.data.holiday.holidays.forEach(a=>{let i=a.split("-");const C=c.value.findIndex(S=>S.year==i[0]&&S.month+1==i[1]&&S.day==i[2]);C!==-1&&(c.value[C].class[0]="weekend")}),o.data.holiday.holiday.forEach(a=>{let i=a.split("-");const C=c.value.findIndex(S=>S.year==i[0]&&S.month+1==i[1]&&S.day==i[2]);C!==-1&&(c.value[C].class[0]="holiday")}),o.data.holiday.nowork.forEach(a=>{let i=a.split("-");const C=c.value.findIndex(S=>S.year==i[0]&&S.month+1==i[1]&&S.day==i[2]);C!==-1&&(c.value[C].class[0]="nowork")}))},L=(s,r)=>{let a=s-r+1;for(let i=0;i<=s-r;i++)c.value[i+r].class[0]==="holiday"&&a--;return a},E=(s,r)=>{const a=V.parseTime(new Date(s.year,s.month,s.day),"{dd}.{m}.{Y}");if(o.range==="range")if(console.log(h.value),k.value!==-1){if(k.value<=h.value)for(let i=k.value;i<=h.value;i++)c.value[i].class[1]="";else for(let i=h.value;i<=k.value;i++)c.value[i].class[1]="";h.value=r,k.value=-1,c.value[r].class[1]="active"}else if(h.value!==-1){if(k.value=r,k.value>=h.value)for(let C=h.value+1;C<r;C++)c.value[C].class[1]="select";else for(let C=r+1;C<h.value;C++)c.value[C].class[1]="select";c.value[r].class[1]="active";let i=V.parseTime(new Date(c.value[h.value].year,c.value[h.value].month,c.value[h.value].day),"{dd}.{m}.{Y}");h.value>r?F("input",{dateStart:a,dateEnd:i,count:L(h.value,r)}):F("input",{dateStart:i,dateEnd:a,count:L(r,h.value)})}else h.value=r,c.value[r].class[1]="active";else c.value[h.value].class[1]="",h.value=r,c.value[r].class[1]="active",F("input",{dateStart:a,count:1})};if(v(),typeof((J=o.data)==null?void 0:J.startDate)<"u"&&(h.value=c.value.findIndex(s=>s.day===n.value.getDate()&&s.month===m.value&&s.year===y.value),c.value[h.value].class[1]="active"),typeof((O=o.data)==null?void 0:O.endDate)<"u"&&o.range==="range"){k.value=c.value.findIndex(s=>s.day===p.value.getDate()&&s.month===T.value&&s.year===Y.value),c.value[k.value].class[1]="active";for(let s=h.value+1;s<k.value;s++)c.value[s].class[1]="select"}const B=(s,r)=>{z(s,r)&&(c.value=[],$.value=0,n.value=new Date(s,r,1),y.value=n.value.getFullYear(),m.value=n.value.getMonth(),v())},z=(s,r)=>{if(!o.limitation)return!0;if(o.limitation[0].dateStart){console.log(o.limitation[0].dateStart);let a=o.limitation[0].dateStart.split(o.limitation[0].dateStart.match(/\D.*?\D?/));if(a[0].length>2&&a.reverse(),parseInt(a[2])>s||parseInt(a[2])===s&&parseInt(a[1])>r+1)return!1}if(o.limitation[o.limitation.length-1].dateEnd){console.log(o.limitation[o.limitation.length-1].dateEnd);let a=o.limitation[o.limitation.length-1].dateEnd.split(o.limitation[o.limitation.length-1].dateEnd.match(/\D.*?\D?/));if(a[0].length>2&&a.reverse(),parseInt(a[2])<s||parseInt(a[2])===s&&parseInt(a[1])<r+N)return!1}return!0};return(s,r)=>(e.openBlock(),e.createElementBlock("div",ne,[e.createElementVNode("div",null,[e.createElementVNode("p",oe,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:r[0]||(r[0]=a=>B(y.value-1,m.value))},"«"),e.createElementVNode("button",{onClick:r[1]||(r[1]=a=>B(y.value,m.value-1))},"‹")]),e.createElementVNode("span",ue,[e.createElementVNode("button",null,e.toDisplayString(y.value),1),e.createElementVNode("button",null,e.toDisplayString(e.unref(V.parseTime)(n.value.setMonth(m.value),"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:r[2]||(r[2]=a=>B(y.value,m.value+1))},"›"),e.createElementVNode("button",{onClick:r[3]||(r[3]=a=>B(y.value+1,m.value))},"»")])]),e.createElementVNode("div",re,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(a,i)=>e.createElementVNode("button",{key:i,class:"disabled"},e.toDisplayString(e.unref(V.parseTime)(new Date(1970,1,a+e.unref(b)),"{D}")),1)),64))]),e.createElementVNode("div",ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(a,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[i<$.value+(7-new Date(y.value,m.value+1,1).getDay()+e.unref(b))%7?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(a.month===m.value&&(!o.limitation||new Date(a.year,a.month,a.day+1).getTime()>new Date(I(o.limitation[0].dateStart)).getTime()&&new Date(a.year,a.month,a.day).getTime()<new Date(I(o.limitation[0].dateEnd)).getTime())?a.class:"disabled"),onClick:()=>{a.month===m.value&&E(a,i)}},e.toDisplayString(a.day),11,de)):e.createCommentVNode("",!0)],64))),128))])]),o.range==="range"?(e.openBlock(),e.createElementBlock("div",ce,[e.createElementVNode("p",se,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:r[4]||(r[4]=a=>B(y.value-1,m.value))},"«"),e.createElementVNode("button",{onClick:r[5]||(r[5]=a=>B(y.value,m.value-1))},"‹")]),e.createElementVNode("span",ve,[e.createElementVNode("button",null,e.toDisplayString(new Date(y.value,m.value+1).getFullYear()),1),e.createElementVNode("button",null,e.toDisplayString(e.unref(V.parseTime)(n.value.setMonth(m.value+1),"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:r[6]||(r[6]=a=>B(y.value,m.value+1))},"›"),e.createElementVNode("button",{onClick:r[7]||(r[7]=a=>B(y.value+1,m.value))},"»")])]),e.createElementVNode("div",me,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(a,i)=>e.createElementVNode("button",{key:i,class:"disabled"},e.toDisplayString(e.unref(V.parseTime)(new Date(1970,1,a+e.unref(b)),"{D}")),1)),64))]),e.createElementVNode("div",fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(a,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[i>=$.value-(7+new Date(y.value,m.value+1,1).getDay()-e.unref(b))%7?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(a.month===_.value.getMonth()&&(!o.limitation||new Date(a.year,a.month,a.day+1).getTime()>new Date(I(o.limitation[0].dateStart)).getTime()&&new Date(a.year,a.month,a.day).getTime()<new Date(I(o.limitation[0].dateEnd)).getTime())?a.class:"disabled"),onClick:()=>{a.month===_.value.getMonth()&&E(a,i)}},e.toDisplayString(a.day),11,ge)):e.createCommentVNode("",!0)],64))),128))])])):e.createCommentVNode("",!0)]))}},he=ae(pe,[["__scopeId","data-v-d1aa0363"]]),ye={key:1,class:"controls-container",style:{"margin-top":".5rem"}},Ce={key:0},ke={key:1,style:{padding:"0 1rem .5rem"}},xe={__name:"VacationTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,query:String,fullName:{type:String,default:"Вы"}},setup(D){const x=D,{t:n}=W.useI18n(),p=e.ref([]);e.ref([]);const o=e.ref(new Date().getFullYear()),F=e.ref(!1),y=e.ref(!1),T=e.ref(!1),Y=e.ref({zIndex:3,minWidth:230,x:500,y:200}),m=e.ref(!1),c=e.ref(!1),$=e.ref({participants:[]}),_=e.ref([]),h=e.ref([]),k=e.ref("all"),A=e.ref([{value:"all",label:n("vacationSchedule.all"),key:"all"}]),b=e.ref(!1),N=e.ref([]),I=e.ref(!1),v=e.ref({name:"",length:0,code:""}),L=new Date().getMonth()>11?[{value:o.value,label:o.value},{value:o.value+1,label:o.value+1}]:[{value:o.value-1,label:o.value-1},{value:o.value,label:o.value}];e.watch(k,async(u,t)=>{u!==t&&(console.log(u),N.value=[],F.value=!1,x.odata.employee.forEach(f=>{(f.divisionName===u||u==="all")&&(N.value.some(l=>(l==null?void 0:l.activeText)===f.roleName)||N.value.push({val:!0,activeText:f.roleName}))}),z())});const E=e.computed(()=>p.value.flatMap((u,t)=>!u.days||u.days.length===0?[{...u,key:0,ids:t}]:u.days.map((f,l)=>({ids:t,key:l,...u,...f})))),B=async()=>{x.odata.getEmployee(o.value-1+"-12-17T23:59:00").then(u=>{var t;k.value=(t=u.find(f=>f.employeeName===x.fullName))==null?void 0:t.divisionName,u.forEach(f=>{A.value.some(l=>(l==null?void 0:l.value)===f.divisionName)||A.value.push({value:f.divisionName,label:f.divisionName,key:f.divisionName}),f.divisionName===k.value&&!N.value.some(l=>(l==null?void 0:l.activeText)===f.roleName)&&N.value.push({val:!0,activeText:f.roleName})}),z(),y.value=!1})},z=()=>{p.value=[];let u=[];x.odata.employee.forEach(t=>{(t.divisionName===k.value||k.value==="all")&&N.value.some(f=>f.val&&f.activeText===t.roleName)&&(u.push(t.employeeKey),p.value.push({name:t.employeeName,days:[{note:""}],jobTitle:t.roleName,code:t.employeeKey}))}),U(u),m.value=!1},U=u=>{x.workSchedule.getAllVacations({year:o.value}).then(t=>{u.forEach((f,l)=>{p.value[l].days=[{note:""}],t.forEach(g=>{f===g.code&&(typeof p.value[l].days[0].dateStart>"u"?p.value[l].days[0]={dateStart:V.parseTime(g.dateStart,"{dd}.{m}.{Y}"),dateEnd:V.parseTime(g.dateEnd,"{dd}.{m}.{Y}"),note:g.note,count:g.count}:p.value[l].days.push({dateStart:V.parseTime(g.dateStart,"{dd}.{m}.{Y}"),dateEnd:V.parseTime(g.dateEnd,"{dd}.{m}.{Y}"),note:g.note,count:g.count}))})})})},P=u=>{if(u.columnIndex<3&&E.value[u.rowIndex].key<E.value[u.rowIndex].days.length)return E.value[u.rowIndex].key===0?{rowspan:E.value[u.rowIndex].days.length,colspan:1}:{rowspan:0,colspan:0}},J=(u,t,f,l)=>{v.value.ids=u.ids,v.value.key=u.key,v.value.startDate=u.dateStart,v.value.endDate=u.dateEnd,v.value.name=u.name,v.value.count=u.count,v.value.allCount=()=>u.days.length===0?0:u.days.reduce((g,q,M)=>M!==u.key?g+parseInt(q.count):g,0),v.value.length=u.days.length,v.value.add=u.days.length>0&&u.days[u.days.length-1].count,v.value.level=t.level,v.value.holiday=h.value,Y.value.y=l.clientY,Y.value.x=l.clientX,t.level===2&&t.no<4&&(v.value.add||u.days.length>1)&&(T.value=!0),t.level===3&&(T.value=!0)},O=u=>{let t=p.value[v.value.ids];switch(u){case"add":t.days.push({note:""}),console.log(t.days.length);break;case"delete":delete t.days.pop(),a(v.value.ids);break}T.value=!1},s=u=>{I.value=u,v.value.count=u.count},r=()=>{I.value&&(p.value[v.value.ids].days[v.value.key]={...I.value,note:""},a(v.value.ids)),T.value=!1},a=u=>{x.workSchedule.rewriteFull({year:o.value,code:p.value[u].code,data:p.value[u].days.map(t=>({dateStart:t.dateStart.split(".").reverse().join("-"),dateEnd:t.dateEnd.split(".").reverse().join("-"),note:t.note,count:t.count}))})},i=u=>{x.workSchedule.sendConfirmMessage({fullname:x.fullName,confirm:u}),x.query=""},C=()=>{x.workSchedule.sendAgreementMessage({users:$.value.participants}),c.value=!1};x.workSchedule.getBoss().then(u=>{_.value=u[0].users}),V.holidays().then(u=>{h.value=u,B()});const S=()=>v.value.length<2?[{dateStart:"01.01."+o.value,dateEnd:"31.12."+o.value}]:[{dateStart:"01.01."+o.value,dateEnd:"31.12."+o.value}],K=async()=>{b.value=!0;const u=new le.Workbook,t=u.addWorksheet(o.value.toString(),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),f={vertical:"middle",horizontal:"center"},l={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},g={vertical:"middle",horizontal:"center",wrapText:!0},q={vertical:"middle",horizontal:"right",wrapText:!0};t.mergeCells("D1:G1"),t.mergeCells("D2:G2"),t.mergeCells("D3:G3"),t.mergeCells("D4:G4"),t.mergeCells("A5:G5"),t.mergeCells("A6:G6"),t.mergeCells("A9:G9"),t.mergeCells("A10:A11"),t.mergeCells("B10:B11"),t.mergeCells("C10:C11"),t.mergeCells("D10:F10"),t.mergeCells("G10:G11"),t.getCell("D1").value=n("vacationSchedule.approve"),t.getCell("D2").value=n("vacationSchedule.dateApprove",{year:o.value-1}),t.getCell("D3").value=n("workSchedule.printPlace"),t.getCell("D4").value=n("vacationSchedule.dateApprove",{year:o.value-1}),t.getCell("A5").value=n("workSchedule.firm"),t.getCell("B7").value=n("vacationSchedule.vacationSchedule"),t.getCell("C7").value=n("vacationSchedule.numberDocs"),t.getCell("D7").value=n("vacationSchedule.compilation"),t.getCell("E7").value=n("vacationSchedule.year"),t.getCell("C8").value="",t.getCell("D8").value="",t.getCell("E8").value=o.value,t.getCell("E7").value=n("vacationSchedule.year"),t.getCell("A10").value=n("vacationSchedule.jobTitle"),t.getCell("B10").value=n("vacationSchedule.fullName"),t.getCell("C10").value=n("vacationSchedule.personnelNumber"),t.getCell("D10").value=n("vacationSchedule.vacation"),t.getCell("D11").value=n("vacationSchedule.days"),t.getCell("E11").value=n("vacationSchedule.date"),t.getCell("F11").value=n("vacationSchedule.endDate"),t.getCell("G11").value=n("vacationSchedule.note"),t.getRow(1).height=80,t.getColumn(1).width=28,t.getColumn(2).width=28,t.getColumn(3).width=18,t.getColumn(4).width=18,t.getColumn(5).width=14,t.getColumn(6).width=14,t.getColumn(7).width=14,t.getColumn(1).alignment=g,t.getColumn(2).alignment=g,t.getColumn(3).alignment=g,t.getColumn(4).alignment=g,t.getColumn(5).alignment=g,t.getColumn(6).alignment=g,t.getColumn(7).alignment=g,t.getCell("D1").alignment=q,t.getCell("D2").alignment=q,t.getCell("D4").alignment=q,t.getCell("A5").alignment=f,t.getCell("C7").border=l,t.getCell("D7").border=l,t.getCell("E7").border=l,t.getCell("C8").border=l,t.getCell("D8").border=l,t.getCell("E8").border=l,t.getCell("A10").border=l,t.getCell("B10").border=l,t.getCell("C10").border=l,t.getCell("D10").border=l,t.getCell("G10").border=l,t.getCell("D11").border=l,t.getCell("E11").border=l,t.getCell("F11").border=l;let M=11;for(const w of p.value)if(w.days.length>1)w.days.forEach(j=>{let R=[w.jobTitle,w.name,w.code,j.count,j.dateStart,j.dateEnd,j.note];const Z=t.addRow(R);Z.border=l,M++}),t.mergeCells(`A${M-w.days.length+1}:A${M}`),t.mergeCells(`B${M-w.days.length+1}:B${M}`),t.mergeCells(`C${M-w.days.length+1}:C${M}`);else{let j=[w.jobTitle,w.name,w.code,w.days[0].count,w.days[0].dateStart,w.days[0].dateEnd,w.days[0].note];const R=t.addRow(j);R.border=l,M++}const X="export_"+V.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",H=await u.xlsx.writeBuffer();Q.saveAs(new Blob([H]),X),b.value=!1};return(u,t)=>{const f=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",null,[D.checkEdit?(e.openBlock(),e.createBlock(e.unref(d.ElSelect),{key:0,modelValue:k.value,"onUpdate:modelValue":t[0]||(t[0]=l=>k.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(A.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=>m.value=!0),style:{"margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("workSchedule.jobTitle")),1)]),_:1}),e.createVNode(e.unref(d.ElSelect),{modelValue:o.value,"onUpdate:modelValue":t[2]||(t[2]=l=>o.value=l),onChange:B,placeholder:"Year",style:{width:"80px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(L),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:y.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:E.value,"span-method":P,onCellClick:J,border:"",style:{width:"100%"},size:"small","empty-text":e.unref(n)("vacationSchedule.emptyText")},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElTableColumn),{label:k.value!=="all"?e.unref(n)("vacationSchedule.title",{name:k.value}):e.unref(n)("vacationSchedule.enterprise")+` ${o.value}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.jobTitle"),width:"180",align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(E.value[l.$index].jobTitle),1)]),_:1},8,["label"]),e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.fullName"),width:"180",align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(E.value[l.$index].name),1)]),_:1},8,["label"]),e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.personnelNumber"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(E.value[l.$index].code),1)]),_:1},8,["label"]),e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.vacation"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.days"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(E.value[l.$index].count),1)]),_:1},8,["label"]),e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.date"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(E.value[l.$index].dateStart),1)]),_:1},8,["label"]),e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.endDate"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(E.value[l.$index].dateEnd),1)]),_:1},8,["label"])]),_:1},8,["label"]),e.createVNode(e.unref(d.ElTableColumn),{label:e.unref(n)("vacationSchedule.note"),align:"center"},{default:e.withCtx(l=>[e.createVNode(e.unref(d.ElInput),{modelValue:p.value[E.value[l.$index].ids].days[E.value[l.$index].key].note,"onUpdate:modelValue":g=>p.value[E.value[l.$index].ids].days[E.value[l.$index].key].note=g,style:{width:"100%"},placeholder:" ",class:"noBorder",onBlur:g=>a(E.value[l.$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",ye,[F.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:0,type:"primary",onClick:t[3]||(t[3]=l=>c.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.sendInformation")),1)]),_:1})),D.query==="confirm"?(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:1,type:"primary",onClick:t[4]||(t[4]=l=>i(!0))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.agreeOn")),1)]),_:1})):e.createCommentVNode("",!0),D.query==="confirm"?(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:2,type:"primary",onClick:t[5]||(t[5]=l=>i(!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.reject")),1)]),_:1})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(d.ElButton),{disabled:b.value,plain:"",onClick:K,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[f,b.value]]),e.createVNode(e.unref(d.ElDialog),{title:e.unref(n)("workSchedule.jobTitle"),modelValue:m.value,"onUpdate:modelValue":t[7]||(t[7]=l=>m.value=l),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(d.ElButton),{onClick:t[6]||(t[6]=l=>m.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(d.ElButton),{size:"default",type:"primary",onClick:z},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(d.ElForm),{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":g=>l.val=g,"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(d.ElDialog),{title:e.unref(n)("vacationSchedule.pleaseCoordinate"),modelValue:c.value,"onUpdate:modelValue":t[10]||(t[10]=l=>c.value=l),width:"500px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(d.ElButton),{onClick:t[9]||(t[9]=l=>c.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(d.ElButton),{size:"default",type:"primary",onClick:C},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.send")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(d.ElForm),{model:$.value,autocomplete:"on"},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ElSelect),{modelValue:$.value.participants,"onUpdate:modelValue":t[8]||(t[8]=l=>$.value.participants=l),placeholder:e.unref(n)("vacationSchedule.fullName"),multiple:"",size:"default"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,l=>(e.openBlock(),e.createBlock(e.unref(d.ElOption),{key:l,label:l,value:l},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(G.ContextMenu),{show:T.value,"onUpdate:show":t[14]||(t[14]=l=>T.value=l),options:Y.value},{default:e.withCtx(()=>[e.createVNode(e.unref(G.ContextMenuItem),{label:v.value.level===3&&typeof v.value.count<"u"?v.value.name+" "+v.value.count+" "+e.unref(n)("vacationSchedule.day",v.value.count)+` ${e.unref(n)("vacationSchedule.from")}: ${v.value.allCount()+parseInt(v.value.count)}`:v.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(G.ContextMenuSeparator)),v.value.level===2?(e.openBlock(),e.createElementBlock("div",Ce,[v.value.length>1?(e.openBlock(),e.createBlock(e.unref(G.ContextMenuItem),{key:0,label:e.unref(n)("vacationSchedule.deleteLast"),onClick:t[11]||(t[11]=l=>O("delete"))},null,8,["label"])):e.createCommentVNode("",!0),v.value.add?(e.openBlock(),e.createBlock(e.unref(G.ContextMenuItem),{key:1,label:e.unref(n)("vacationSchedule.addVacation"),onClick:t[12]||(t[12]=l=>O("add"))},null,8,["label"])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",ke,[e.createVNode(he,{data:v.value,range:"range",limitation:S(),onInput:s},null,8,["data","limitation"]),e.createElementVNode("div",null,[e.createVNode(e.unref(d.ElButton),{onClick:t[13]||(t[13]=l=>T.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(d.ElButton),{onClick:r},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.save")),1)]),_:1})])]))]),_:1},8,["show","options"])])}}};module.exports=xe;
|