@studio-west/employees 0.6.56 → 0.6.58
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 +1 -1
- package/dist/SheetTable.js +1 -1
- package/dist/{SwDatePicker-C-UmCyTm-CTOiwZL1.cjs → SwDatePicker-C-UmCyTm-B1c4pG3O.cjs} +1 -1
- package/dist/{SwDatePicker-C-UmCyTm-Co9VaGQR.js → SwDatePicker-C-UmCyTm-B2cLQbrd.js} +1 -1
- package/dist/{SwDropdownItem-Db2TXRVI-BcLri1T3.js → SwDropdownItem-Db2TXRVI-BTVxTD5o.js} +1 -1
- package/dist/{SwDropdownItem-Db2TXRVI-DHp91ADz.cjs → SwDropdownItem-Db2TXRVI-r8WktVN3.cjs} +1 -1
- package/dist/{SwGide-Bv05X9FW-XUYykhog.js → SwGide-Bv05X9FW-BffDNxEd.js} +1 -1
- package/dist/{SwGide-Bv05X9FW-BTqybd7p.cjs → SwGide-Bv05X9FW-BwlJwQvQ.cjs} +1 -1
- package/dist/{SwInput-B1hD3QYw-zCu7Xl3k.js → SwInput-B1hD3QYw-DbBfWvIh.js} +1 -1
- package/dist/{SwInput-B1hD3QYw-DaqUVUBC.cjs → SwInput-B1hD3QYw-DrNbPI55.cjs} +1 -1
- package/dist/{SwMessage-D24ZbJyd-B0sGfA92.js → SwMessage-D24ZbJyd-DYlO9Avo.js} +1 -1
- package/dist/{SwMessage-D24ZbJyd-hmjlb3jg.cjs → SwMessage-D24ZbJyd-Dge6kQzo.cjs} +1 -1
- package/dist/{SwSlider-B8ah3WJf-eotQC_I3.cjs → SwSlider-B8ah3WJf-BFKzdLM4.cjs} +1 -1
- package/dist/{SwSlider-B8ah3WJf-DFs0WIbH.js → SwSlider-B8ah3WJf-BgnlLKrg.js} +1 -1
- package/dist/VacationTable-BmcxmYjS.cjs +1 -0
- package/dist/{VacationTable-GeJlpGuk.js → VacationTable-r0eXSOmg.js} +3 -5
- package/dist/VacationTable.cjs +1 -1
- package/dist/VacationTable.js +1 -1
- package/package.json +1 -1
- package/dist/VacationTable-3jJUSDHf.cjs +0 -1
package/dist/SheetTable.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),be=require("vue-i18n"),c=require("./index-Dn3djtwj.cjs"),g=require("element-plus"),_=require("@imengyu/vue3-context-menu"),de=require("file-saver"),we=require("exceljs");function De(N){const y=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(N){for(const s in N)if(s!=="default"){const M=Object.getOwnPropertyDescriptor(N,s);Object.defineProperty(y,s,M.get?M:{enumerable:!0,get:()=>N[s]})}}return y.default=N,Object.freeze(y)}const xe=De(we),$e={class:"nav"},ke={style:{height:"20px",width:"100%",display:"inline-block"}},Ne={style:{height:"20px",width:"100%",display:"inline-block"}},Ve={class:"label"},Se={key:0,style:{padding:"0 1rem .5rem"}},Te={key:1,style:{padding:"0 1rem .5rem"}},Ee={__name:"SheetTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"},group:String,date:String,logo:{type:URL,default:"#"},editor:{type:Object,default:()=>({})}},setup(N){const y=N,{t:s,d:M}=be.useI18n(),q=e.ref(!1),b=e.ref([]),H=e.ref("0"),p=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(H.value))),d=e.ref([]),V=e.ref([]),Z=e.ref("100%"),A=e.ref("true"),Q=e.ref([]),ve=e.ref([{value:"Я",label:s("sheet.valid.1")},{value:"К",label:s("sheet.valid.2")},{value:"ОТ",label:s("sheet.valid.3")},{value:"ДО",label:s("sheet.valid.4")},{value:"Р",label:s("sheet.valid.5")},{value:"ОЖ",label:s("sheet.valid.6")},{value:"Б",label:s("sheet.valid.7")},{value:"НН",label:s("sheet.valid.8")},{value:"ПР",label:s("sheet.valid.9")},{value:"У",label:s("sheet.valid.10")},{value:"УД",label:s("sheet.valid.11")},{value:"Г",label:s("sheet.valid.12")}]),ne=e.ref([]),ce=e.ref(0),x=e.ref(9),D=e.ref(8),I=e.ref(0),z=e.ref(0),O=e.ref([]),Y=e.ref(!1),P=e.ref(!1),ee=e.ref([]),j=e.ref([]),B=e.ref(!1),J=e.ref(!1),L=e.ref(1),oe=e.ref(null),le=e.ref({zIndex:3,minWidth:230,x:500,y:200}),v=e.ref({name:"",length:0,code:""}),$=e.ref([]),G=e.ref(""),R=e.ref("_____"),i=e.computed(()=>b.value.flatMap((t,l)=>{const m=$.value.find(n=>n.code===t.code),o=new Map;t.days.forEach(n=>o.set(n.day,{...n})),m&&m.days.forEach(n=>o.set(n.day,{...n}));const h=Array.from(o.values());return[{...t,days:h,key:0,ids:l,numberNonAppearing:[0,0]},{...t,days:h,key:1,ids:l,numberNonAppearing:[0,0]}]}));e.watch(V,async(t,l)=>{t!==l&&(O.value=[],y.odata.personal.forEach(m=>{t.includes(m.divisionName)&&(O.value.some(o=>(o==null?void 0:o.activeText)===m.roleName)||O.value.push({val:!0,activeText:m.roleName}))}),te())}),e.watch(H,t=>{p.value=new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(t)),ue(),te()}),e.watch(D,()=>Y.value=B.value),e.watch(x,()=>Y.value=B.value),e.watch(L,()=>Y.value=B.value);const me=async(t,l,m,o)=>{if(console.log("row",t),console.log("column",l),l.level!==3||l.labelClassName==="turn"||l.no===15||l.no>d.value.length||!y.checkEdit)return"";v.value.ids=t.ids,v.value.key=t.key,v.value.day=l.no<15?l.no:l.no-1;const h=new Date(p.value),n=`${h.getFullYear()}-${(h.getMonth()+1).toString().padStart(2,"0")}-${(v.value.day+1).toString().padStart(2,"0")}`,a=$.value.findIndex(f=>f.code===t.code);v.value.id=a!==-1?$.value[a].days.findIndex(f=>(f==null?void 0:f.day)===n):a,x.value=typeof t.days[v.value.day].tips>"u"?9:parseInt(t.days[v.value.day].tips.match(/(\d{1,2})/)),I.value=typeof t.days[v.value.day].night>"u"?0:parseInt(t.days[v.value.day].night),z.value=typeof t.days[v.value.day].overtime>"u"?0:parseInt(t.days[v.value.day].overtime),D.value=t.days[v.value.day].time!=="-"?parseInt(t.days[v.value.day].time):8;const u=t.days.findIndex(f=>f.day===n);v.value.failure=t.days[u].state,le.value.y=o.clientY,le.value.x=o.clientX,v.value.rest=a!==-1&&v.value.id!==-1,v.value.name=c.byInitials(t.fio),B.value=!0,await e.nextTick(),Y.value=!1},K=t=>{const l=new Date(p.value),m=`${l.getFullYear()}-${(l.getMonth()+1).toString().padStart(2,"0")}-${(v.value.day+1).toString().padStart(2,"0")}`;let o=$.value.findIndex(C=>C.code===b.value[v.value.ids].code);v.value.id=o!==-1?$.value[o].days.findIndex(C=>(C==null?void 0:C.day)===`${l.getFullYear()}-${(l.getMonth()+1).toString().padStart(2,"0")}-${(v.value.day+1).toString().padStart(2,"0")}`):o;let h=b.value[v.value.ids].days[v.value.day].state,n=t,a="-",u,f,w;switch(t){case"Я":h==="В"&&(n="РВ"),a=8;break;case"КВ":case"К":h==="В"||h==="КВ"?n="КВ":n="К";break;case"save":let C=W.value.split('"');n=C[1],Y.value=!1,C[2]!==""&&(a=D.value,w="("+C[2].split("(")[1],u=I.value,f=z.value)}t==="reset"?(n=h,$.value[o].days.splice(v.value.id,1)):o===-1?$.value.push({code:b.value[v.value.ids].code,days:[{day:m,state:n,time:a,night:u,overtime:f,tips:w}]}):v.value.id===-1?$.value[o].days.push({day:m,state:n,time:a,night:u,overtime:f,tips:w}):$.value[o].days[v.value.id]={day:m,state:n,time:a,night:u,overtime:f,tips:w},o=$.value.findIndex(C=>C.code===b.value[v.value.ids].code),y.workSchedule.addWorkSheet({date:c.parseTime(new Date(p.value),"{Y}-{m}-{dd}"),data:[{name:b.value[v.value.ids].fio,days:$.value[o].days,code:b.value[v.value.ids].code}]}),v.value.failure=n,L.value>1&&(L.value--,v.value.day++,K(n)),re()},W=e.computed(()=>{J.value=!1;let t=b.value[v.value.ids].days[v.value.day],l="";I.value=0,z.value=0;let m=D.value>=22?x.value+D.value+2:x.value+D.value+1,o=v.value.failure.split("/")[0];o=/^Н(?!Н$)С?$/.test(o)?t.state!=="В"?"Я":"РВ":o,/^(|Я|РВ)$/.test(o)&&((x.value<6||m>22)&&(l="Н",I.value=x.value<6?Math.min(6,m)-x.value:0,m<=6&&(I.value=D.value,o=""),m===7&&I.value>3&&I.value--,I.value+=Math.max(22,m)-22),D.value>t.time&&o!=="РВ"&&(l+="С",J.value=!0,z.value=D.value-t.time),/РВ/.test(o)&&(J.value=!0)),l.length>0&&o.length>0&&(l="/"+l);let h=`(${x.value}:00 - ${D.value>=22?x.value+D.value+2:x.value+D.value+1}:00)`,n=i.value[v.value.ids*2].days[v.value.day].time!=="-"?" "+D.value+" "+h:"";return'"'+o+l+'"'+n}),he=t=>{if(t.columnIndex<2||t.columnIndex>d.value.length+3&&t.columnIndex<d.value.length+9||t.columnIndex>d.value.length+11)return i.value[t.rowIndex].key===0?{rowspan:2,colspan:1}:{rowspan:0,colspan:0}},ue=()=>{const t=ne.value,l=new Date(p.value),m=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let o=[],h=0;for(let n=1;n<=m;n++){const a=c.parseTime(l.setDate(n),"{Y}-{m}-{dd}");h+=t.nowork.includes(a)||t.holidays.includes(a)?0:t.preholidays.includes(a)?7:8;let u=t.nowork.includes(a)?"nowork":t.holidays.includes(a)?"holiday":t.preholidays.includes(a)?"preholiday":"";o.push({day:n,holidays:u,weekday:M(new Date(l.getFullYear(),l.getMonth(),n),"day")})}return ce.value=h,d.value=o,y.odata.getPersonal({dismissed:"false"}).then(n=>{var a;V.value.length===0&&(V.value=[(a=n.find(u=>u.employeeName===y.fullName))==null?void 0:a.divisionName]),n.forEach(u=>{Q.value.some(f=>u.dismissalDate.length>0&&new Date(u.dismissalDate)<new Date(p.value)||(f==null?void 0:f.value)===u.divisionName)||Q.value.push({value:u.divisionName,label:u.divisionName,key:u.divisionName})})}),!0},te=()=>{b.value=[],j.value=[],ee.value=[],y.odata.personal.forEach(t=>{if(V.value.includes(t.divisionName)&&O.value.some(l=>l.val&&l.activeText===t.roleName)&&(t.dismissalDate.length===0||new Date(t.dismissalDate)>new Date(p.value))){let l=c.byInitials(t.employeeName);b.value.push({fio:t.employeeName,name:l+" ("+t.roleName+")",code:t.employeeKey,days:[],contHour:0,id:!1,employmentDate:c.parseTime(new Date(t.employmentDate),"{Y}-{m}-{dd}T00:00:00"),dismissalDate:t.dismissalDate})}t.employeeName===y.fullName&&(R.value=t.roleName)}),b.value.sort((t,l)=>t.fio<l.fio?-1:t.fio>l.fio?1:0),b.value.forEach((t,l)=>{t.ids=l,j.value.push(t.code)}),y.workSchedule.getUsersYear({code:j.value,year:new Date(p.value).getFullYear()}).then(t=>{t.forEach(l=>{l.dateStart&&ee.value.push({code:l.code,dateStart:l.dateStart,dateEnd:l.dateEnd})}),ge()})},ge=()=>{y.workSchedule.getWorkSheet({code:j.value,date:c.parseTime(new Date(p.value),"{Y}-{m}-{dd}")}).then(t=>{$.value=[],t.forEach(l=>{l!==null&&$.value.push({code:l.code,days:l.data.days})}),y.workSchedule.getWorkSchedule({code:j.value,date:c.parseTime(new Date(p.value),"{Y}-{m}-{dd}")}).then(l=>{l.forEach((m,o)=>{var n,a;if(m!==null){b.value[o].days=[],m.data.days.forEach(u=>u.state="Я");for(let u=1;u<=d.value.length;u++){let f=c.parseTime(new Date(p.value).setDate(u),"{Y}-{m}-{dd}");const w=(n=m.data)==null?void 0:n.days.findIndex(C=>C.day===f);w===-1?X(u,o,"-","В"):b.value[o].days.push((a=m.data)==null?void 0:a.days[w])}}else for(let u=1;u<=d.value.length;u++)d.value[u-1].holidays===""?X(u,o,8):d.value[u-1].holidays==="preholiday"?X(u,o,7):X(u,o,"-","В");const h=b.value[o];if(h.employmentDate||h.dismissalDate)for(let u=1;u<=d.value.length;u++){const f=new Date(new Date(p.value).setDate(u)),w=c.parseTime(f,"{Y}-{m}-{dd}"),C=h.employmentDate&&f<new Date(h.employmentDate),S=h.dismissalDate&&f>new Date(h.dismissalDate);if(C||S){const k=h.days.findIndex(E=>E.day===w);k!==-1&&(h.days[k].state="-",h.days[k].time="-")}}for(let u=1;u<=d.value.length;u++){let f=new Date(new Date(p.value).getFullYear(),new Date(p.value).getMonth(),u).getTime()+1e3;for(let w of ee.value){const{dateStart:C,dateEnd:S,code:k}=w;if(C&&S&&k===b.value[o].code){const E=new Date(c.parseDate(C)).getTime(),U=new Date(c.parseDate(S)).getTime();if(f>=E&&f<=U){const r=c.parseTime(new Date(p.value).setDate(u),"{Y}-{m}-{dd}"),F=b.value[o].days.findIndex(ae=>ae.day===r);F!==-1?b.value[o].days[F]={day:r,time:"-",state:"ОТ"}:b.value[o].days.push({day:r,time:"-",state:"ОТ"})}}}}}),re()})})},X=(t,l,m,o="Я")=>{const h=c.parseTime(new Date(p.value).setDate(t),"{Y}-{m}-{dd}");b.value[l].days.push({day:h,time:m,state:o})},re=()=>{i.value.forEach(t=>{t.hourI=0,t.hourII=0,t.halfII=0,t.halfI=0,t.weekend=0,t.weekendDays=0,t.overtime=0,t.night=0,t.appearing={code:"-",count:"-"};const l=Object.entries(t.days.reduce((n,a)=>{if(a.hasOwnProperty("state")&&/^(|К|КВ|ОТ|Б|Р|ПР|ОЖ|НН|У|ДО|УД|Г)$/.test(a.state)){const u=a.state;n[u]=(n[u]||0)+1}return n},{})).map(([n,a])=>({code:n,count:a}));t.numberNonAppearing=[l.reduce((n,a)=>n+a.count,0),0];const m=Math.ceil(l.length/2),o=l.slice(0,m),h=l.slice(m);t.key===0&&o.length>0&&(t.appearing={code:o.map(n=>n.code).join("/"),count:o.map(n=>n.count).join("/")}),t.key===1&&h.length>0&&(t.appearing={code:h.map(n=>n.code).join("/"),count:h.map(n=>n.count).join("/")});for(let n=0;n<t.days.length;n++)n<15&&t.days[n].time!=="-"&&(t.hourI+=Number(t.days[n].time),t.days[n].overtime&&(t.hourI+=Number(t.days[n].overtime)),t.halfI++),n>=15&&t.days[n].time!=="-"&&(t.days[n].overtime&&(t.hourII+=Number(t.days[n].overtime)),t.hourII+=Number(t.days[n].time),t.halfII++),t.days[n].night&&(t.night+=Number(t.days[n].night)),t.days[n].overtime&&(t.overtime+=Number(t.days[n].overtime)),/{|РВ|}/.test(t.days[n].state)&&(t.weekend+=Number(t.days[n].time)),t.days[n].state==="В"&&t.weekendDays++;t.contDays=t.halfI+t.halfII,t.contHour=t.hourI+t.hourII})},ie=(t,l)=>{var u,f,w,C,S,k,E;if(l===-1)return"";const m=i.value[l],o=new Date(p.value),h=`${o.getFullYear()}-${(o.getMonth()+1).toString().padStart(2,"0")}-${t.toString().padStart(2,"0")}`,n=m.days.findIndex(U=>U.day===h);let a=0;return(u=m.days[n])!=null&&u.night&&(a+=m.days[n].night),(f=m.days[n])!=null&&f.overtime&&(a+=m.days[n].overtime),n===-1?"":m.key===0?(w=m.days[n])==null?void 0:w.state:((C=m.days[n])==null?void 0:C.time)===0?a===0?"-":a:a===0||a===((S=m.days[n])==null?void 0:S.time)?(k=m.days[n])==null?void 0:k.time:`${(E=m.days[n])==null?void 0:E.time}/${a}`};y.group&&(V.value[0]=y.group),y.date&&(H.value=new Date(y.date+"T00:00:01").getMonth()),c.holidays().then(t=>{ne.value=t,ue()});const se=t=>new Date(p.value).getMonth()===new Date().getMonth()&&t===new Date().getDate()?" today":"",fe=()=>{let t=W.value.match(/(\d{1,2}):\d{2}\s*-\s*(\d{1,2})/),l=b.value[v.value.ids].days[v.value.day+1].tips;return l=typeof l<"u"?l.match(/(\d{1,2}):\d{2}\s*-\s*(\d{1,2})/):[0,9,18],Number(t[1])<Number(l[1])?`${t[1]}:00 по ${Number(t[1])+z.value}:00`:`${Number(t[2])-z.value}:00 по ${t[2]}:00`},ye=()=>{let t=/РВ/.test(W.value),l=t?W.value.match(/\(([^)]+)\)/)[1].replace("-"," по "):fe();G.value=`<p style="position: absolute;"><img src="https://cp.avanta-telecom.ru${y.logo}" style="height: 3rem;"></p><div style="display:inline-block;margin-left:66%;width:34%;">Директору<br>ООО "АВАНТА ТЕЛЕКОМ" Пунину Д. В.<br><br>от ${R.value} ${c.byInitials(y.fullName)}</div><p>${V.value[0]}<br>СЛУЖЕБНАЯ ЗАПИСКА<br>${c.parseTime(new Date(p.value).setDate(v.value.day+1),'"{dd}" {F} {Y}')}г.</p><p style="text-align:center;">Уважаемый Дмитрий Владимирович!</p><p>В связи с производственной необходимостью _________________, прошу привлечь к ${t?"к работе в выходной день":"сверхурочной работе"}, ${c.parseTime(new Date(p.value).setDate(v.value.day+1),"{dd}.{m}.{Y}")} c ${l}, ${i.value[v.value.ids*2].name.match(/\(([^)]+)\)/)[1]} ${i.value[v.value.ids*2].fio} для выполнения вышеуказанных работ с его(её) письменного согласия.</p><p>${R.value} ________________ ${c.byInitials(y.fullName)}</p>`},pe=async()=>{var S,k,E,U;q.value=!0;const t=new xe.Workbook,l=t.addWorksheet(M(p.value,"month"),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),m={vertical:"middle",horizontal:"center"},o={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},h={vertical:"middle",horizontal:"center",wrapText:!0};l.mergeCells(`A1:${c.cellsDynamically("A1",d.value.length+15)}1`),l.mergeCells("A2:A4"),l.mergeCells("B2:B4"),l.mergeCells("C2:C4"),l.mergeCells("D5:R5"),l.mergeCells(`D2:${c.cellsDynamically("D2",d.value.length+2)}2`),l.mergeCells(`${c.cellsDynamically("D2",d.value.length+3)}2:${c.cellsDynamically("D2",d.value.length+8)}2`),l.mergeCells(`${c.cellsDynamically("D2",d.value.length+9)}2:${c.cellsDynamically("D2",d.value.length+9)}4`),l.mergeCells(`${c.cellsDynamically("D2",d.value.length+10)}2:${c.cellsDynamically("D2",d.value.length+11)}2`),l.mergeCells(`${c.cellsDynamically("D2",d.value.length+12)}2:${c.cellsDynamically("D2",d.value.length+12)}4`),l.mergeCells(`${c.cellsDynamically("D3",d.value.length+3)}3:${c.cellsDynamically("D3",d.value.length+3)}4`),l.mergeCells(`${c.cellsDynamically("D3",d.value.length+4)}3:${c.cellsDynamically("D3",d.value.length+8)}3`),l.mergeCells(`${c.cellsDynamically("D3",d.value.length+10)}3:${c.cellsDynamically("D3",d.value.length+10)}4`),l.mergeCells(`${c.cellsDynamically("D3",d.value.length+11)}3:${c.cellsDynamically("D3",d.value.length+11)}4`),l.mergeCells(`T5:${c.cellsDynamically("D5",d.value.length+1)}5`);for(let r=1;r<=d.value.length+2;r++)l.mergeCells(`${c.cellsDynamically("D3",r)}3:${c.cellsDynamically("D4",r)}4`),l.getColumn(r+3).width=5,l.getColumn(r+3).alignment=h,l.getCell(3,r+3).border=o,r<16&&(l.getCell(3,r+3).value=r),r>16&&(l.getCell(3,r+3).value=r-1);l.getCell("A1").value=s("sheet.title",{name:V.value[0]})+M(p.value,"month"),l.getCell("A2").value=s("sheet.listNumber"),l.getCell("B2").value=s("sheet.employee"),l.getCell("C2").value=s("sheet.personnelNumber"),l.getCell("D2").value=s("sheet.marks"),l.getCell("S3").value=s("sheet.halfMonth",{half:"I"}),l.getCell("A5").value="1",l.getCell("B5").value="2",l.getCell("C5").value="3",l.getCell("D5").value="4",l.getCell("S5").value="5",l.getCell("T5").value="6",l.getCell(5,d.value.length+5).value="7",l.getCell(2,d.value.length+6).value=s("sheet.workedMonth"),l.getCell(2,d.value.length+12).value=s("sheet.numberNonAppearing"),l.getCell(2,d.value.length+13).value=s("sheet.them"),l.getCell(2,d.value.length+15).value=s("sheet.countWeekend"),l.getCell(3,d.value.length+5).value=s("sheet.halfMonth",{half:"II"}),l.getCell(3,d.value.length+6).value=s("sheet.days"),l.getCell(3,d.value.length+7).value=s("sheet.hours"),l.getCell(4,d.value.length+7).value=s("sheet.all"),l.getCell(4,d.value.length+8).value=s("sheet.overtime"),l.getCell(4,d.value.length+9).value=s("sheet.night"),l.getCell(4,d.value.length+10).value=s("sheet.weekend"),l.getCell(4,d.value.length+13).value=s("sheet.code"),l.getCell(4,d.value.length+14).value=s("sheet.count"),l.getRow(1).height=40,l.getRow(2).height=32,l.getRow(3).height=20,l.getRow(4).height=60,l.getColumn(1).width=6,l.getColumn(2).width=30,l.getColumn(3).width=17,l.getColumn(19).width=12,l.getColumn(d.value.length+5).width=12,l.getColumn(d.value.length+12).width=11,l.getColumn(d.value.length+15).width=11,l.getCell("A1").alignment=m,l.getColumn(1).alignment=h,l.getColumn(2).alignment=h,l.getColumn(3).alignment=h;for(let r=6;r<=15;r++)l.getCell(5,d.value.length+r).value=r+2,l.getColumn(d.value.length+r).alignment=h,l.getCell(4,d.value.length+r).border=o,l.getCell(5,d.value.length+r).border=o;l.getCell("A2").border=o,l.getCell("B2").border=o,l.getCell("C2").border=o,l.getCell("D2").border=o,l.getCell("D2").border=o,l.getCell("A5").border=o,l.getCell("B5").border=o,l.getCell("C5").border=o,l.getCell("D5").border=o,l.getCell("S5").border=o,l.getCell("T5").border=o,l.getCell(2,d.value.length+6).border=o,l.getCell(2,d.value.length+12).border=o,l.getCell(2,d.value.length+13).border=o,l.getCell(2,d.value.length+15).border=o,l.getCell(3,d.value.length+7).border=o;let n=1,a=5,u=!0;for(const r of i.value){let F=[n,r.name,r.code];for(let T=0;T<d.value.length;T++)T===15&&F.push(u?(r==null?void 0:r.halfI)||"":(r==null?void 0:r.hourI)||""),F.push(u?((S=r.days[T])==null?void 0:S.state)||"":((k=r.days[T])==null?void 0:k.time)||"");F.push(u?(r==null?void 0:r.halfII)||0:(r==null?void 0:r.hourII)||0,(r==null?void 0:r.contDays)||0,(r==null?void 0:r.contHour)||0,(r==null?void 0:r.overtime)||0,(r==null?void 0:r.night)||0,(r==null?void 0:r.weekend)||0,"",u?(r==null?void 0:r.numberNonAppearing[0])||"":(r==null?void 0:r.numberNonAppearing[1])||0,((E=r==null?void 0:r.appearing)==null?void 0:E.code)||"-",((U=r==null?void 0:r.appearing)==null?void 0:U.count)||"-",(r==null?void 0:r.weekendDays)||0);const ae=l.addRow(F);if(ae.border=o,!u){l.mergeCells(`A${a+n*2-1}:A${a+n*2}`),l.mergeCells(`B${a+n*2-1}:B${a+n*2}`),l.mergeCells(`C${a+n*2-1}:C${a+n*2}`);for(let T=d.value.length+3;T<=d.value.length+8;T++)l.mergeCells(`${c.cellsDynamically("D",T)}${a+n*2-1}:${c.cellsDynamically("D",T)}${a+n*2}`);l.mergeCells(`${c.cellsDynamically("D",d.value.length+12)}${a+n*2-1}:${c.cellsDynamically("D",d.value.length+12)}${a+n*2}`),n++}u=!u}let f="Чемарина Н. Ю.";y.odata.personal.forEach(r=>{r.roleName==="Специалист по кадрам и кадровому делопроизводству"&&(f=r.employeeName)}),l.mergeCells(`A${i.value.length+7}:B${i.value.length+7}`),l.mergeCells(`C${i.value.length+7}:G${i.value.length+7}`),l.mergeCells(`H${i.value.length+7}:M${i.value.length+7}`),l.mergeCells(`O${i.value.length+7}:T${i.value.length+7}`),l.mergeCells(`V${i.value.length+7}:AC${i.value.length+7}`),l.mergeCells(`AD${i.value.length+7}:AI${i.value.length+7}`),l.mergeCells(`AJ${i.value.length+7}:AL${i.value.length+7}`),l.mergeCells(`AM${i.value.length+7}:AP${i.value.length+7}`),l.mergeCells(`V${i.value.length+9}:AC${i.value.length+9}`),l.mergeCells(`AD${i.value.length+9}:AI${i.value.length+9}`),l.mergeCells(`AJ${i.value.length+9}:AL${i.value.length+9}`),l.mergeCells(`AM${i.value.length+9}:AP${i.value.length+9}`),l.getCell(`A${i.value.length+7}`).value=s("sheet.responsiblePerson"),l.getCell(`V${i.value.length+7}`).value=s("sheet.headStructural"),l.getCell(`C${i.value.length+7}`).value=R.value+":",l.getCell(`O${i.value.length+7}`).value=c.byInitials(y.fullName),l.getCell(`AD${i.value.length+7}`).value=R.value+":",l.getCell(`AM${i.value.length+7}`).value=c.byInitials(y.fullName),l.getCell(`V${i.value.length+9}`).value=s("sheet.HREmployee"),l.getCell(`AD${i.value.length+9}`).value="Специалист по кадрам и кадровому делопроизводству:",l.getCell(`AM${i.value.length+9}`).value=c.byInitials(f),l.getCell(`A${i.value.length+7}`).alignment={vertical:"middle",horizontal:"right",wrapText:!0},l.getCell(`C${i.value.length+7}`).alignment={vertical:"middle",horizontal:"right",wrapText:!0},l.getCell(`O${i.value.length+7}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`V${i.value.length+7}`).alignment={vertical:"middle",horizontal:"right",wrapText:!0},l.getCell(`AD${i.value.length+7}`).alignment={vertical:"middle",horizontal:"right",wrapText:!0},l.getCell(`AM${i.value.length+7}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`V${i.value.length+9}`).alignment={vertical:"middle",horizontal:"right",wrapText:!0},l.getCell(`AD${i.value.length+9}`).alignment={vertical:"middle",horizontal:"right",wrapText:!0},l.getCell(`AM${i.value.length+9}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`H${i.value.length+7}`).border={bottom:{style:"thin"}},l.getCell(`AJ${i.value.length+7}`).border={bottom:{style:"thin"}},l.getCell(`AJ${i.value.length+9}`).border={bottom:{style:"thin"}};const w=`export_${c.parseTime(Date.now(),"{dd}.{m}.{Y}")}.xlsx`,C=await t.xlsx.writeBuffer();de.saveAs(new Blob([C]),w),q.value=!1},Ce=()=>{let t=new Blob([G.value],{type:"text/plain;charset=utf-8"});de.saveAs(t,`Служебка_${c.byInitials(i.value[v.value.ids*2].fio)}_${c.parseTime(Date.now(),"{dd}.{m}.{Y}")}.html`)};return(t,l)=>{const m=e.resolveComponent("el-form-item"),o=e.resolveComponent("svg-icon"),h=e.resolveComponent("el-slider"),n=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",$e,[N.checkEdit?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),{key:0,modelValue:V.value,"onUpdate:modelValue":l[0]||(l[0]=a=>V.value=a),multiple:"","collapse-tags":"","collapse-tags-tooltip":"",placeholder:"Select",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,a=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),N.checkEdit?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:1,plain:"",onClick:l[1]||(l[1]=a=>P.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("workSchedule.jobTitle")),1)]),_:1})):e.createCommentVNode("",!0),l[19]||(l[19]=e.createElementVNode("div",{class:"expander"},null,-1)),N.checkEdit?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),{key:2,modelValue:H.value,"onUpdate:modelValue":l[2]||(l[2]=a=>H.value=a),"active-text":e.unref(s)("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(g.ElSwitch),{modelValue:Z.value,"onUpdate:modelValue":l[3]||(l[3]=a=>Z.value=a),"active-text":t.$t("sheet.currentHeight"),"active-value":"100%","inactive-value":"calc(100vh - var(--el-component-size)*5 - var(--el-main-padding)*2 - var(--header-height))"},null,8,["modelValue","active-text"]),e.createVNode(e.unref(g.ElSwitch),{modelValue:A.value,"onUpdate:modelValue":l[4]||(l[4]=a=>A.value=a),"active-text":t.$t("sheet.simplified"),"active-value":"true","inactive-value":"false"},null,8,["modelValue","active-text"])]),e.createVNode(e.unref(g.ElTable),{id:"printTable",data:i.value,"span-method":he,border:"",style:{width:"100%"},size:"small","empty-text":e.unref(s)("sheet.emptyText"),align:"center",onCellClick:me,"max-height":Z.value,"default-sort":{prop:"mame",order:"descending"}},{default:e.withCtx(()=>[e.createVNode(e.unref(g.ElTableColumn),{label:e.unref(s)("sheet.title",{name:V.value[0]})+e.unref(M)(p.value,"month"),align:"center",height:"10"},{default:e.withCtx(()=>[e.createVNode(e.unref(g.ElTableColumn),{label:e.unref(s)("sheet.employee"),width:A.value==="false"?180:t.auto,align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(i.value[a.$index].name),1)]),_:1},8,["label","width"]),e.createVNode(e.unref(g.ElTableColumn),{label:e.unref(s)("sheet.personnelNumber"),align:"center",width:"108"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(i.value[a.$index].code),1)]),_:1},8,["label"]),e.createVNode(e.unref(g.ElTableColumn),{label:e.unref(s)("sheet.marks"),align:"center"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,a=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.day},[a.day<=15?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),{key:0,width:"39","class-name":a.holidays+se(a.day),align:"center",label:a.day.toString()+`
|
|
1
|
+
"use strict";const e=require("vue"),be=require("vue-i18n"),c=require("./index-Dn3djtwj.cjs"),g=require("element-plus"),_=require("@imengyu/vue3-context-menu"),de=require("file-saver"),we=require("exceljs");function De(N){const y=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(N){for(const s in N)if(s!=="default"){const M=Object.getOwnPropertyDescriptor(N,s);Object.defineProperty(y,s,M.get?M:{enumerable:!0,get:()=>N[s]})}}return y.default=N,Object.freeze(y)}const xe=De(we),$e={class:"nav"},ke={style:{height:"20px",width:"100%",display:"inline-block"}},Ne={style:{height:"20px",width:"100%",display:"inline-block"}},Ve={class:"label"},Se={key:0,style:{padding:"0 1rem .5rem"}},Te={key:1,style:{padding:"0 1rem .5rem"}},Ee={__name:"SheetTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"},group:String,date:String,logo:{type:URL,default:"#"},editor:{type:Object,default:()=>({})}},setup(N){const y=N,{t:s,d:M}=be.useI18n(),q=e.ref(!1),b=e.ref([]),H=e.ref("0"),p=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(H.value))),d=e.ref([]),V=e.ref([]),Z=e.ref("100%"),A=e.ref("true"),Q=e.ref([]),ve=e.ref([{value:"Я",label:s("sheet.valid.1")},{value:"К",label:s("sheet.valid.2")},{value:"ОТ",label:s("sheet.valid.3")},{value:"ДО",label:s("sheet.valid.4")},{value:"Р",label:s("sheet.valid.5")},{value:"ОЖ",label:s("sheet.valid.6")},{value:"Б",label:s("sheet.valid.7")},{value:"НН",label:s("sheet.valid.8")},{value:"ПР",label:s("sheet.valid.9")},{value:"У",label:s("sheet.valid.10")},{value:"УД",label:s("sheet.valid.11")},{value:"Г",label:s("sheet.valid.12")}]),ne=e.ref([]),ce=e.ref(0),x=e.ref(9),D=e.ref(8),I=e.ref(0),z=e.ref(0),O=e.ref([]),Y=e.ref(!1),P=e.ref(!1),ee=e.ref([]),j=e.ref([]),B=e.ref(!1),J=e.ref(!1),L=e.ref(1),oe=e.ref(null),le=e.ref({zIndex:3,minWidth:230,x:500,y:200}),v=e.ref({name:"",length:0,code:""}),$=e.ref([]),G=e.ref(""),R=e.ref("_____"),i=e.computed(()=>b.value.flatMap((t,l)=>{const m=$.value.find(n=>n.code===t.code),o=new Map;t.days.forEach(n=>o.set(n.day,{...n})),m&&m.days.forEach(n=>o.set(n.day,{...n}));const h=Array.from(o.values());return[{...t,days:h,key:0,ids:l,numberNonAppearing:[0,0]},{...t,days:h,key:1,ids:l,numberNonAppearing:[0,0]}]}));e.watch(V,async(t,l)=>{t!==l&&(O.value=[],y.odata.personal.forEach(m=>{t.includes(m.divisionName)&&(O.value.some(o=>(o==null?void 0:o.activeText)===m.roleName)||O.value.push({val:!0,activeText:m.roleName}))}),te())}),e.watch(H,t=>{p.value=new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(t)),ue(),te()}),e.watch(D,()=>Y.value=B.value),e.watch(x,()=>Y.value=B.value),e.watch(L,()=>Y.value=B.value);const me=async(t,l,m,o)=>{if(console.log("row",t),console.log("column",l),l.level!==3||l.labelClassName==="turn"||l.no===15||l.no>d.value.length||!y.checkEdit)return"";v.value.ids=t.ids,v.value.key=t.key,v.value.day=l.no<15?l.no:l.no-1;const h=new Date(p.value),n=`${h.getFullYear()}-${(h.getMonth()+1).toString().padStart(2,"0")}-${(v.value.day+1).toString().padStart(2,"0")}`,a=$.value.findIndex(f=>f.code===t.code);v.value.id=a!==-1?$.value[a].days.findIndex(f=>(f==null?void 0:f.day)===n):a,x.value=typeof t.days[v.value.day].tips>"u"?9:parseInt(t.days[v.value.day].tips.match(/(\d{1,2})/)),I.value=typeof t.days[v.value.day].night>"u"?0:parseInt(t.days[v.value.day].night),z.value=typeof t.days[v.value.day].overtime>"u"?0:parseInt(t.days[v.value.day].overtime),D.value=t.days[v.value.day].time!=="-"?parseInt(t.days[v.value.day].time):8;const u=t.days.findIndex(f=>f.day===n);v.value.failure=t.days[u].state,le.value.y=o.clientY,le.value.x=o.clientX,v.value.rest=a!==-1&&v.value.id!==-1,v.value.name=c.byInitials(t.fio),B.value=!0,await e.nextTick(),Y.value=!1},K=t=>{const l=new Date(p.value),m=`${l.getFullYear()}-${(l.getMonth()+1).toString().padStart(2,"0")}-${(v.value.day+1).toString().padStart(2,"0")}`;let o=$.value.findIndex(C=>C.code===b.value[v.value.ids].code);v.value.id=o!==-1?$.value[o].days.findIndex(C=>(C==null?void 0:C.day)===`${l.getFullYear()}-${(l.getMonth()+1).toString().padStart(2,"0")}-${(v.value.day+1).toString().padStart(2,"0")}`):o;let h=b.value[v.value.ids].days[v.value.day].state,n=t,a="-",u,f,w;switch(t){case"Я":h==="В"&&(n="РВ"),a=8;break;case"КВ":case"К":h==="В"||h==="КВ"?n="КВ":n="К";break;case"save":let C=W.value.split('"');n=C[1],Y.value=!1,C[2]!==""&&(a=D.value,w="("+C[2].split("(")[1],u=I.value,f=z.value)}t==="reset"?(n=h,$.value[o].days.splice(v.value.id,1)):o===-1?$.value.push({code:b.value[v.value.ids].code,days:[{day:m,state:n,time:a,night:u,overtime:f,tips:w}]}):v.value.id===-1?$.value[o].days.push({day:m,state:n,time:a,night:u,overtime:f,tips:w}):$.value[o].days[v.value.id]={day:m,state:n,time:a,night:u,overtime:f,tips:w},o=$.value.findIndex(C=>C.code===b.value[v.value.ids].code),y.workSchedule.addWorkSheet({date:c.parseTime(new Date(p.value),"{Y}-{m}-{dd}"),data:[{name:b.value[v.value.ids].fio,days:$.value[o].days,code:b.value[v.value.ids].code}]}),v.value.failure=n,L.value>1&&(L.value--,v.value.day++,K(n)),re()},W=e.computed(()=>{J.value=!1;let t=b.value[v.value.ids].days[v.value.day],l="";I.value=0,z.value=0;let m=D.value>=22?x.value+D.value+2:x.value+D.value+1,o=v.value.failure.split("/")[0];o=/^Н(?!Н$)С?$/.test(o)?t.state!=="В"?"Я":"РВ":o,/^(|Я|РВ)$/.test(o)&&((x.value<6||m>22)&&(l="Н",I.value=x.value<6?Math.min(6,m)-x.value:0,m<=6&&(I.value=D.value,o=""),m===7&&I.value>3&&I.value--,I.value+=Math.max(22,m)-22),D.value>t.time&&o!=="РВ"&&(l+="С",J.value=!0,z.value=D.value-t.time),/РВ/.test(o)&&(J.value=!0)),l.length>0&&o.length>0&&(l="/"+l);let h=`(${x.value}:00 - ${D.value>=22?x.value+D.value+2:x.value+D.value+1}:00)`,n=i.value[v.value.ids*2].days[v.value.day].time!=="-"?" "+D.value+" "+h:"";return'"'+o+l+'"'+n}),he=t=>{if(t.columnIndex<2||t.columnIndex>d.value.length+3&&t.columnIndex<d.value.length+9||t.columnIndex>d.value.length+11)return i.value[t.rowIndex].key===0?{rowspan:2,colspan:1}:{rowspan:0,colspan:0}},ue=()=>{const t=ne.value,l=new Date(p.value),m=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let o=[],h=0;for(let n=1;n<=m;n++){const a=c.parseTime(l.setDate(n),"{Y}-{m}-{dd}");h+=t.nowork.includes(a)||t.holidays.includes(a)?0:t.preholidays.includes(a)?7:8;let u=t.nowork.includes(a)?"nowork":t.holidays.includes(a)?"holiday":t.preholidays.includes(a)?"preholiday":"";o.push({day:n,holidays:u,weekday:M(new Date(l.getFullYear(),l.getMonth(),n),"day")})}return ce.value=h,d.value=o,y.odata.getPersonal({dismissed:"false"}).then(n=>{var a;V.value.length===0&&(V.value=[(a=n.find(u=>u.employeeName===y.fullName))==null?void 0:a.divisionName]),n.forEach(u=>{Q.value.some(f=>u.dismissalDate.length>0&&new Date(u.dismissalDate)<new Date(p.value)||(f==null?void 0:f.value)===u.divisionName)||Q.value.push({value:u.divisionName,label:u.divisionName,key:u.divisionName})})}),!0},te=()=>{b.value=[],j.value=[],ee.value=[],y.odata.personal.forEach(t=>{if(V.value.includes(t.divisionName)&&O.value.some(l=>l.val&&l.activeText===t.roleName)&&(t.dismissalDate.length===0||new Date(t.dismissalDate)>new Date(p.value))){let l=c.byInitials(t.employeeName);b.value.push({fio:t.employeeName,name:l+" ("+t.roleName+")",code:t.employeeKey,days:[],contHour:0,id:!1,employmentDate:c.parseTime(new Date(t.employmentDate),"{Y}-{m}-{dd}T00:00:00"),dismissalDate:t.dismissalDate})}t.employeeName===y.fullName&&(R.value=t.roleName)}),b.value.sort((t,l)=>t.fio<l.fio?-1:t.fio>l.fio?1:0),b.value.forEach((t,l)=>{t.ids=l,j.value.push(t.code)}),y.workSchedule.getUsersYear({code:j.value,year:new Date(p.value).getFullYear()}).then(t=>{t.forEach(l=>{l.dateStart&&ee.value.push({code:l.code,dateStart:l.dateStart,dateEnd:l.dateEnd})}),ge()})},ge=()=>{y.workSchedule.getWorkSheet({code:j.value,date:c.parseTime(new Date(p.value),"{Y}-{m}-{dd}")}).then(t=>{$.value=[],t.forEach(l=>{l!==null&&$.value.push({code:l.code,days:l.data.days})}),y.workSchedule.getWorkSchedule({code:j.value,date:c.parseTime(new Date(p.value),"{Y}-{m}-{dd}")}).then(l=>{l.forEach((m,o)=>{var n,a;if(m!==null){b.value[o].days=[],m.data.days.forEach(u=>u.state="Я");for(let u=1;u<=d.value.length;u++){let f=c.parseTime(new Date(p.value).setDate(u),"{Y}-{m}-{dd}");const w=(n=m.data)==null?void 0:n.days.findIndex(C=>C.day===f);w===-1?X(u,o,"-","В"):b.value[o].days.push((a=m.data)==null?void 0:a.days[w])}}else for(let u=1;u<=d.value.length;u++)d.value[u-1].holidays===""?X(u,o,8):d.value[u-1].holidays==="preholiday"?X(u,o,7):X(u,o,"-","В");const h=b.value[o];if(h.employmentDate||h.dismissalDate)for(let u=1;u<=d.value.length;u++){const f=new Date(new Date(p.value).setDate(u)),w=c.parseTime(f,"{Y}-{m}-{dd}"),C=h.employmentDate&&f<new Date(h.employmentDate),S=h.dismissalDate&&f>=new Date(h.dismissalDate).setSeconds(0);if(C||S){const k=h.days.findIndex(E=>E.day===w);k!==-1&&(h.days[k].state="-",h.days[k].time="-")}}for(let u=1;u<=d.value.length;u++){let f=new Date(new Date(p.value).getFullYear(),new Date(p.value).getMonth(),u).getTime()+1e3;for(let w of ee.value){const{dateStart:C,dateEnd:S,code:k}=w;if(C&&S&&k===b.value[o].code){const E=new Date(c.parseDate(C)).getTime(),U=new Date(c.parseDate(S)).getTime();if(f>=E&&f<=U){const r=c.parseTime(new Date(p.value).setDate(u),"{Y}-{m}-{dd}"),F=b.value[o].days.findIndex(ae=>ae.day===r);F!==-1?b.value[o].days[F]={day:r,time:"-",state:"ОТ"}:b.value[o].days.push({day:r,time:"-",state:"ОТ"})}}}}}),re()})})},X=(t,l,m,o="Я")=>{const h=c.parseTime(new Date(p.value).setDate(t),"{Y}-{m}-{dd}");b.value[l].days.push({day:h,time:m,state:o})},re=()=>{i.value.forEach(t=>{t.hourI=0,t.hourII=0,t.halfII=0,t.halfI=0,t.weekend=0,t.weekendDays=0,t.overtime=0,t.night=0,t.appearing={code:"-",count:"-"};const l=Object.entries(t.days.reduce((n,a)=>{if(a.hasOwnProperty("state")&&/^(|К|КВ|ОТ|Б|Р|ПР|ОЖ|НН|У|ДО|УД|Г)$/.test(a.state)){const u=a.state;n[u]=(n[u]||0)+1}return n},{})).map(([n,a])=>({code:n,count:a}));t.numberNonAppearing=[l.reduce((n,a)=>n+a.count,0),0];const m=Math.ceil(l.length/2),o=l.slice(0,m),h=l.slice(m);t.key===0&&o.length>0&&(t.appearing={code:o.map(n=>n.code).join("/"),count:o.map(n=>n.count).join("/")}),t.key===1&&h.length>0&&(t.appearing={code:h.map(n=>n.code).join("/"),count:h.map(n=>n.count).join("/")});for(let n=0;n<t.days.length;n++)n<15&&t.days[n].time!=="-"&&(t.hourI+=Number(t.days[n].time),t.days[n].overtime&&(t.hourI+=Number(t.days[n].overtime)),t.halfI++),n>=15&&t.days[n].time!=="-"&&(t.days[n].overtime&&(t.hourII+=Number(t.days[n].overtime)),t.hourII+=Number(t.days[n].time),t.halfII++),t.days[n].night&&(t.night+=Number(t.days[n].night)),t.days[n].overtime&&(t.overtime+=Number(t.days[n].overtime)),/{|РВ|}/.test(t.days[n].state)&&(t.weekend+=Number(t.days[n].time)),t.days[n].state==="В"&&t.weekendDays++;t.contDays=t.halfI+t.halfII,t.contHour=t.hourI+t.hourII})},ie=(t,l)=>{var u,f,w,C,S,k,E;if(l===-1)return"";const m=i.value[l],o=new Date(p.value),h=`${o.getFullYear()}-${(o.getMonth()+1).toString().padStart(2,"0")}-${t.toString().padStart(2,"0")}`,n=m.days.findIndex(U=>U.day===h);let a=0;return(u=m.days[n])!=null&&u.night&&(a+=m.days[n].night),(f=m.days[n])!=null&&f.overtime&&(a+=m.days[n].overtime),n===-1?"":m.key===0?(w=m.days[n])==null?void 0:w.state:((C=m.days[n])==null?void 0:C.time)===0?a===0?"-":a:a===0||a===((S=m.days[n])==null?void 0:S.time)?(k=m.days[n])==null?void 0:k.time:`${(E=m.days[n])==null?void 0:E.time}/${a}`};y.group&&(V.value[0]=y.group),y.date&&(H.value=new Date(y.date+"T00:00:01").getMonth()),c.holidays().then(t=>{ne.value=t,ue()});const se=t=>new Date(p.value).getMonth()===new Date().getMonth()&&t===new Date().getDate()?" today":"",fe=()=>{let t=W.value.match(/(\d{1,2}):\d{2}\s*-\s*(\d{1,2})/),l=b.value[v.value.ids].days[v.value.day+1].tips;return l=typeof l<"u"?l.match(/(\d{1,2}):\d{2}\s*-\s*(\d{1,2})/):[0,9,18],Number(t[1])<Number(l[1])?`${t[1]}:00 по ${Number(t[1])+z.value}:00`:`${Number(t[2])-z.value}:00 по ${t[2]}:00`},ye=()=>{let t=/РВ/.test(W.value),l=t?W.value.match(/\(([^)]+)\)/)[1].replace("-"," по "):fe();G.value=`<p style="position: absolute;"><img src="https://cp.avanta-telecom.ru${y.logo}" style="height: 3rem;"></p><div style="display:inline-block;margin-left:66%;width:34%;">Директору<br>ООО "АВАНТА ТЕЛЕКОМ" Пунину Д. В.<br><br>от ${R.value} ${c.byInitials(y.fullName)}</div><p>${V.value[0]}<br>СЛУЖЕБНАЯ ЗАПИСКА<br>${c.parseTime(new Date(p.value).setDate(v.value.day+1),'"{dd}" {F} {Y}')}г.</p><p style="text-align:center;">Уважаемый Дмитрий Владимирович!</p><p>В связи с производственной необходимостью _________________, прошу привлечь к ${t?"к работе в выходной день":"сверхурочной работе"}, ${c.parseTime(new Date(p.value).setDate(v.value.day+1),"{dd}.{m}.{Y}")} c ${l}, ${i.value[v.value.ids*2].name.match(/\(([^)]+)\)/)[1]} ${i.value[v.value.ids*2].fio} для выполнения вышеуказанных работ с его(её) письменного согласия.</p><p>${R.value} ________________ ${c.byInitials(y.fullName)}</p>`},pe=async()=>{var S,k,E,U;q.value=!0;const t=new xe.Workbook,l=t.addWorksheet(M(p.value,"month"),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),m={vertical:"middle",horizontal:"center"},o={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},h={vertical:"middle",horizontal:"center",wrapText:!0};l.mergeCells(`A1:${c.cellsDynamically("A1",d.value.length+15)}1`),l.mergeCells("A2:A4"),l.mergeCells("B2:B4"),l.mergeCells("C2:C4"),l.mergeCells("D5:R5"),l.mergeCells(`D2:${c.cellsDynamically("D2",d.value.length+2)}2`),l.mergeCells(`${c.cellsDynamically("D2",d.value.length+3)}2:${c.cellsDynamically("D2",d.value.length+8)}2`),l.mergeCells(`${c.cellsDynamically("D2",d.value.length+9)}2:${c.cellsDynamically("D2",d.value.length+9)}4`),l.mergeCells(`${c.cellsDynamically("D2",d.value.length+10)}2:${c.cellsDynamically("D2",d.value.length+11)}2`),l.mergeCells(`${c.cellsDynamically("D2",d.value.length+12)}2:${c.cellsDynamically("D2",d.value.length+12)}4`),l.mergeCells(`${c.cellsDynamically("D3",d.value.length+3)}3:${c.cellsDynamically("D3",d.value.length+3)}4`),l.mergeCells(`${c.cellsDynamically("D3",d.value.length+4)}3:${c.cellsDynamically("D3",d.value.length+8)}3`),l.mergeCells(`${c.cellsDynamically("D3",d.value.length+10)}3:${c.cellsDynamically("D3",d.value.length+10)}4`),l.mergeCells(`${c.cellsDynamically("D3",d.value.length+11)}3:${c.cellsDynamically("D3",d.value.length+11)}4`),l.mergeCells(`T5:${c.cellsDynamically("D5",d.value.length+1)}5`);for(let r=1;r<=d.value.length+2;r++)l.mergeCells(`${c.cellsDynamically("D3",r)}3:${c.cellsDynamically("D4",r)}4`),l.getColumn(r+3).width=5,l.getColumn(r+3).alignment=h,l.getCell(3,r+3).border=o,r<16&&(l.getCell(3,r+3).value=r),r>16&&(l.getCell(3,r+3).value=r-1);l.getCell("A1").value=s("sheet.title",{name:V.value[0]})+M(p.value,"month"),l.getCell("A2").value=s("sheet.listNumber"),l.getCell("B2").value=s("sheet.employee"),l.getCell("C2").value=s("sheet.personnelNumber"),l.getCell("D2").value=s("sheet.marks"),l.getCell("S3").value=s("sheet.halfMonth",{half:"I"}),l.getCell("A5").value="1",l.getCell("B5").value="2",l.getCell("C5").value="3",l.getCell("D5").value="4",l.getCell("S5").value="5",l.getCell("T5").value="6",l.getCell(5,d.value.length+5).value="7",l.getCell(2,d.value.length+6).value=s("sheet.workedMonth"),l.getCell(2,d.value.length+12).value=s("sheet.numberNonAppearing"),l.getCell(2,d.value.length+13).value=s("sheet.them"),l.getCell(2,d.value.length+15).value=s("sheet.countWeekend"),l.getCell(3,d.value.length+5).value=s("sheet.halfMonth",{half:"II"}),l.getCell(3,d.value.length+6).value=s("sheet.days"),l.getCell(3,d.value.length+7).value=s("sheet.hours"),l.getCell(4,d.value.length+7).value=s("sheet.all"),l.getCell(4,d.value.length+8).value=s("sheet.overtime"),l.getCell(4,d.value.length+9).value=s("sheet.night"),l.getCell(4,d.value.length+10).value=s("sheet.weekend"),l.getCell(4,d.value.length+13).value=s("sheet.code"),l.getCell(4,d.value.length+14).value=s("sheet.count"),l.getRow(1).height=40,l.getRow(2).height=32,l.getRow(3).height=20,l.getRow(4).height=60,l.getColumn(1).width=6,l.getColumn(2).width=30,l.getColumn(3).width=17,l.getColumn(19).width=12,l.getColumn(d.value.length+5).width=12,l.getColumn(d.value.length+12).width=11,l.getColumn(d.value.length+15).width=11,l.getCell("A1").alignment=m,l.getColumn(1).alignment=h,l.getColumn(2).alignment=h,l.getColumn(3).alignment=h;for(let r=6;r<=15;r++)l.getCell(5,d.value.length+r).value=r+2,l.getColumn(d.value.length+r).alignment=h,l.getCell(4,d.value.length+r).border=o,l.getCell(5,d.value.length+r).border=o;l.getCell("A2").border=o,l.getCell("B2").border=o,l.getCell("C2").border=o,l.getCell("D2").border=o,l.getCell("D2").border=o,l.getCell("A5").border=o,l.getCell("B5").border=o,l.getCell("C5").border=o,l.getCell("D5").border=o,l.getCell("S5").border=o,l.getCell("T5").border=o,l.getCell(2,d.value.length+6).border=o,l.getCell(2,d.value.length+12).border=o,l.getCell(2,d.value.length+13).border=o,l.getCell(2,d.value.length+15).border=o,l.getCell(3,d.value.length+7).border=o;let n=1,a=5,u=!0;for(const r of i.value){let F=[n,r.name,r.code];for(let T=0;T<d.value.length;T++)T===15&&F.push(u?(r==null?void 0:r.halfI)||"":(r==null?void 0:r.hourI)||""),F.push(u?((S=r.days[T])==null?void 0:S.state)||"":((k=r.days[T])==null?void 0:k.time)||"");F.push(u?(r==null?void 0:r.halfII)||0:(r==null?void 0:r.hourII)||0,(r==null?void 0:r.contDays)||0,(r==null?void 0:r.contHour)||0,(r==null?void 0:r.overtime)||0,(r==null?void 0:r.night)||0,(r==null?void 0:r.weekend)||0,"",u?(r==null?void 0:r.numberNonAppearing[0])||"":(r==null?void 0:r.numberNonAppearing[1])||0,((E=r==null?void 0:r.appearing)==null?void 0:E.code)||"-",((U=r==null?void 0:r.appearing)==null?void 0:U.count)||"-",(r==null?void 0:r.weekendDays)||0);const ae=l.addRow(F);if(ae.border=o,!u){l.mergeCells(`A${a+n*2-1}:A${a+n*2}`),l.mergeCells(`B${a+n*2-1}:B${a+n*2}`),l.mergeCells(`C${a+n*2-1}:C${a+n*2}`);for(let T=d.value.length+3;T<=d.value.length+8;T++)l.mergeCells(`${c.cellsDynamically("D",T)}${a+n*2-1}:${c.cellsDynamically("D",T)}${a+n*2}`);l.mergeCells(`${c.cellsDynamically("D",d.value.length+12)}${a+n*2-1}:${c.cellsDynamically("D",d.value.length+12)}${a+n*2}`),n++}u=!u}let f="Чемарина Н. Ю.";y.odata.personal.forEach(r=>{r.roleName==="Специалист по кадрам и кадровому делопроизводству"&&(f=r.employeeName)}),l.mergeCells(`A${i.value.length+7}:B${i.value.length+7}`),l.mergeCells(`C${i.value.length+7}:G${i.value.length+7}`),l.mergeCells(`H${i.value.length+7}:M${i.value.length+7}`),l.mergeCells(`O${i.value.length+7}:T${i.value.length+7}`),l.mergeCells(`V${i.value.length+7}:AC${i.value.length+7}`),l.mergeCells(`AD${i.value.length+7}:AI${i.value.length+7}`),l.mergeCells(`AJ${i.value.length+7}:AL${i.value.length+7}`),l.mergeCells(`AM${i.value.length+7}:AP${i.value.length+7}`),l.mergeCells(`V${i.value.length+9}:AC${i.value.length+9}`),l.mergeCells(`AD${i.value.length+9}:AI${i.value.length+9}`),l.mergeCells(`AJ${i.value.length+9}:AL${i.value.length+9}`),l.mergeCells(`AM${i.value.length+9}:AP${i.value.length+9}`),l.getCell(`A${i.value.length+7}`).value=s("sheet.responsiblePerson"),l.getCell(`V${i.value.length+7}`).value=s("sheet.headStructural"),l.getCell(`C${i.value.length+7}`).value=R.value+":",l.getCell(`O${i.value.length+7}`).value=c.byInitials(y.fullName),l.getCell(`AD${i.value.length+7}`).value=R.value+":",l.getCell(`AM${i.value.length+7}`).value=c.byInitials(y.fullName),l.getCell(`V${i.value.length+9}`).value=s("sheet.HREmployee"),l.getCell(`AD${i.value.length+9}`).value="Специалист по кадрам и кадровому делопроизводству:",l.getCell(`AM${i.value.length+9}`).value=c.byInitials(f),l.getCell(`A${i.value.length+7}`).alignment={vertical:"middle",horizontal:"right",wrapText:!0},l.getCell(`C${i.value.length+7}`).alignment={vertical:"middle",horizontal:"right",wrapText:!0},l.getCell(`O${i.value.length+7}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`V${i.value.length+7}`).alignment={vertical:"middle",horizontal:"right",wrapText:!0},l.getCell(`AD${i.value.length+7}`).alignment={vertical:"middle",horizontal:"right",wrapText:!0},l.getCell(`AM${i.value.length+7}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`V${i.value.length+9}`).alignment={vertical:"middle",horizontal:"right",wrapText:!0},l.getCell(`AD${i.value.length+9}`).alignment={vertical:"middle",horizontal:"right",wrapText:!0},l.getCell(`AM${i.value.length+9}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`H${i.value.length+7}`).border={bottom:{style:"thin"}},l.getCell(`AJ${i.value.length+7}`).border={bottom:{style:"thin"}},l.getCell(`AJ${i.value.length+9}`).border={bottom:{style:"thin"}};const w=`export_${c.parseTime(Date.now(),"{dd}.{m}.{Y}")}.xlsx`,C=await t.xlsx.writeBuffer();de.saveAs(new Blob([C]),w),q.value=!1},Ce=()=>{let t=new Blob([G.value],{type:"text/plain;charset=utf-8"});de.saveAs(t,`Служебка_${c.byInitials(i.value[v.value.ids*2].fio)}_${c.parseTime(Date.now(),"{dd}.{m}.{Y}")}.html`)};return(t,l)=>{const m=e.resolveComponent("el-form-item"),o=e.resolveComponent("svg-icon"),h=e.resolveComponent("el-slider"),n=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",$e,[N.checkEdit?(e.openBlock(),e.createBlock(e.unref(g.ElSelect),{key:0,modelValue:V.value,"onUpdate:modelValue":l[0]||(l[0]=a=>V.value=a),multiple:"","collapse-tags":"","collapse-tags-tooltip":"",placeholder:"Select",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,a=>(e.openBlock(),e.createBlock(e.unref(g.ElOption),{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),N.checkEdit?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:1,plain:"",onClick:l[1]||(l[1]=a=>P.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("workSchedule.jobTitle")),1)]),_:1})):e.createCommentVNode("",!0),l[19]||(l[19]=e.createElementVNode("div",{class:"expander"},null,-1)),N.checkEdit?(e.openBlock(),e.createBlock(e.unref(g.ElSwitch),{key:2,modelValue:H.value,"onUpdate:modelValue":l[2]||(l[2]=a=>H.value=a),"active-text":e.unref(s)("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(g.ElSwitch),{modelValue:Z.value,"onUpdate:modelValue":l[3]||(l[3]=a=>Z.value=a),"active-text":t.$t("sheet.currentHeight"),"active-value":"100%","inactive-value":"calc(100vh - var(--el-component-size)*5 - var(--el-main-padding)*2 - var(--header-height))"},null,8,["modelValue","active-text"]),e.createVNode(e.unref(g.ElSwitch),{modelValue:A.value,"onUpdate:modelValue":l[4]||(l[4]=a=>A.value=a),"active-text":t.$t("sheet.simplified"),"active-value":"true","inactive-value":"false"},null,8,["modelValue","active-text"])]),e.createVNode(e.unref(g.ElTable),{id:"printTable",data:i.value,"span-method":he,border:"",style:{width:"100%"},size:"small","empty-text":e.unref(s)("sheet.emptyText"),align:"center",onCellClick:me,"max-height":Z.value,"default-sort":{prop:"mame",order:"descending"}},{default:e.withCtx(()=>[e.createVNode(e.unref(g.ElTableColumn),{label:e.unref(s)("sheet.title",{name:V.value[0]})+e.unref(M)(p.value,"month"),align:"center",height:"10"},{default:e.withCtx(()=>[e.createVNode(e.unref(g.ElTableColumn),{label:e.unref(s)("sheet.employee"),width:A.value==="false"?180:t.auto,align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(i.value[a.$index].name),1)]),_:1},8,["label","width"]),e.createVNode(e.unref(g.ElTableColumn),{label:e.unref(s)("sheet.personnelNumber"),align:"center",width:"108"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(i.value[a.$index].code),1)]),_:1},8,["label"]),e.createVNode(e.unref(g.ElTableColumn),{label:e.unref(s)("sheet.marks"),align:"center"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,a=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.day},[a.day<=15?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),{key:0,width:"39","class-name":a.holidays+se(a.day),align:"center",label:a.day.toString()+`
|
|
2
2
|
`+a.weekday},{default:e.withCtx(u=>[e.createElementVNode("div",ke,e.toDisplayString(ie(a.day,u.$index)||" "),1)]),_:2},1032,["class-name","label"])):e.createCommentVNode("",!0),a.day===15?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),{key:1,label:e.unref(s)("sheet.halfMonth",{half:"I"}),align:"center",width:"120"},{default:e.withCtx(u=>[e.createTextVNode(e.toDisplayString(i.value[u.$index].key===0?i.value[u.$index].halfI:i.value[u.$index].hourI),1)]),_:1},8,["label"])):e.createCommentVNode("",!0),a.day>15?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),{key:2,width:"39","class-name":a.holidays+se(a.day),align:"center",label:a.day.toString()+`
|
|
3
3
|
`+a.weekday},{default:e.withCtx(u=>[e.createElementVNode("div",Ne,e.toDisplayString(ie(a.day,u.$index)||" "),1)]),_:2},1032,["class-name","label"])):e.createCommentVNode("",!0)],64))),128)),e.createVNode(e.unref(g.ElTableColumn),{label:e.unref(s)("sheet.halfMonth",{half:"II"}),align:"center",width:"120"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(i.value[a.$index].key===0?i.value[a.$index].halfII:i.value[a.$index].hourII),1)]),_:1},8,["label"])]),_:1},8,["label"]),A.value==="false"?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),{key:0,label:e.unref(s)("sheet.workedMonth"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(g.ElTableColumn),{label:e.unref(s)("sheet.days"),align:"center","label-class-name":"turn",width:"34"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(i.value[a.$index].contDays),1)]),_:1},8,["label"]),e.createVNode(e.unref(g.ElTableColumn),{label:e.unref(s)("sheet.hours"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(g.ElTableColumn),{label:e.unref(s)("sheet.all"),align:"center","label-class-name":"turn",width:"40"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(i.value[a.$index].contHour),1)]),_:1},8,["label"]),e.createVNode(e.unref(g.ElTableColumn),{label:e.unref(s)("sheet.overtime"),align:"center","label-class-name":"turn",width:"34"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(i.value[a.$index].overtime),1)]),_:1},8,["label"]),e.createVNode(e.unref(g.ElTableColumn),{label:e.unref(s)("sheet.night"),align:"center","label-class-name":"turn",width:"34"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(i.value[a.$index].night),1)]),_:1},8,["label"]),e.createVNode(e.unref(g.ElTableColumn),{label:e.unref(s)("sheet.weekend"),align:"center","label-class-name":"turn",width:"34"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(i.value[a.$index].weekend),1)]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["label"])):e.createCommentVNode("",!0),A.value==="false"?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),{key:1,label:e.unref(s)("sheet.numberNonAppearing"),align:"center"},{default:e.withCtx(a=>{var u;return[e.createTextVNode(e.toDisplayString((u=i.value[a.$index])==null?void 0:u.numberNonAppearing[i.value[a.$index].key]),1)]}),_:1},8,["label"])):e.createCommentVNode("",!0),A.value==="false"?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),{key:2,label:e.unref(s)("sheet.them"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(g.ElTableColumn),{label:e.unref(s)("sheet.code"),align:"center","label-class-name":"turn",width:"30"},{default:e.withCtx(a=>{var u;return[e.createTextVNode(e.toDisplayString((u=i.value[a.$index].appearing)==null?void 0:u.code),1)]}),_:1},8,["label"]),e.createVNode(e.unref(g.ElTableColumn),{label:e.unref(s)("sheet.count"),align:"center","label-class-name":"turn",width:"30"},{default:e.withCtx(a=>{var u;return[e.createTextVNode(e.toDisplayString((u=i.value[a.$index].appearing)==null?void 0:u.count),1)]}),_:1},8,["label"])]),_:1},8,["label"])):e.createCommentVNode("",!0),A.value==="false"?(e.openBlock(),e.createBlock(e.unref(g.ElTableColumn),{key:3,label:e.unref(s)("sheet.countWeekend"),align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(i.value[a.$index].weekendDays),1)]),_:1},8,["label"])):e.createCommentVNode("",!0)]),_:1},8,["label"])]),_:1},8,["data","empty-text","max-height"]),e.withDirectives((e.openBlock(),e.createBlock(e.unref(g.ElButton),{disabled:q.value,plain:"",onClick:pe,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[n,q.value]]),e.createVNode(e.unref(g.ElDialog),{title:e.unref(s)("workSchedule.jobTitle"),modelValue:P.value,"onUpdate:modelValue":l[7]||(l[7]=a=>P.value=a),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(g.ElButton),{onClick:l[5]||(l[5]=a=>P.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(g.ElButton),{size:"default",type:"primary",onClick:l[6]||(l[6]=a=>{te(),P.value=!1})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(g.ElForm),{ref:"dialogForm",model:O.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,a=>(e.openBlock(),e.createBlock(m,null,{default:e.withCtx(()=>[e.createVNode(e.unref(g.ElSwitch),{modelValue:a.val,"onUpdate:modelValue":u=>a.val=u,"active-text":a.activeText},null,8,["modelValue","onUpdate:modelValue","active-text"])]),_:2},1024))),256))]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(_.ContextMenu),{show:B.value,"onUpdate:show":l[16]||(l[16]=a=>B.value=a),options:le.value},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"mx-context-menu-item",onClick:l[8]||(l[8]=a=>B.value=!1)},[e.createElementVNode("span",Ve,e.toDisplayString(v.value.name),1),l[20]||(l[20]=e.createElementVNode("div",{class:"expander"},null,-1)),e.createVNode(o,{"icon-class":"cross"})]),e.createVNode(e.unref(_.ContextMenuSeparator)),e.createElementVNode("div",null,[e.createElementVNode("div",null,[e.createVNode(e.unref(_.ContextMenuGroup),{label:W.value,style:{padding:"0 0 .5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ve.value,a=>(e.openBlock(),e.createBlock(e.unref(_.ContextMenuItem),{key:a.value,label:a.label,onClick:u=>{v.value.rest=!0,Y.value=!1,K(a.value)},clickClose:!1},null,8,["label","onClick"]))),128))]),_:1},8,["label"])]),/^(РВ|Я|Н(?![Н])).*$/.test(v.value.failure)?(e.openBlock(),e.createElementBlock("div",Se,[e.createVNode(e.unref(_.ContextMenuItem),{clickClose:!1},{default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(e.unref(s)("workSchedule.with"))+":",1)]),_:1}),e.createVNode(h,{modelValue:x.value,"onUpdate:modelValue":l[9]||(l[9]=a=>x.value=a),step:1,min:0,max:19,style:{width:"100%"}},null,8,["modelValue"]),e.createVNode(e.unref(_.ContextMenuItem),{clickClose:!1},{default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(e.unref(s)("workSchedule.duration"))+":",1)]),_:1}),e.createVNode(h,{modelValue:D.value,"onUpdate:modelValue":l[10]||(l[10]=a=>D.value=a),step:1,min:4,max:e.unref(c.clamp)(x.value!==1?23-x.value:21,4,22)},null,8,["modelValue","max"])])):e.createCommentVNode("",!0),/^(|К|КВ|ОТ|Б|Р|ОЖ|У|ДО|УД|Г)$/.test(v.value.failure)?(e.openBlock(),e.createElementBlock("div",Te,[e.createVNode(e.unref(_.ContextMenuItem),{clickClose:!1},{default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(e.unref(s)("sheet.count"))+":",1)]),_:1}),e.createVNode(h,{modelValue:L.value,"onUpdate:modelValue":l[11]||(l[11]=a=>L.value=a),step:1,min:1,max:d.value.length-v.value.day,style:{width:"100%"}},null,8,["modelValue","max"])])):e.createCommentVNode("",!0),e.createVNode(e.unref(_.ContextMenuItem),{class:"wrap"},{default:e.withCtx(()=>[v.value.rest?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:0,onClick:l[12]||(l[12]=a=>K("reset"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("sheet.reset")),1)]),_:1})):e.createCommentVNode("",!0),Y.value?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:1,onClick:l[13]||(l[13]=a=>K("save"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("sheet.save")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(g.ElButton),{onClick:l[14]||(l[14]=a=>B.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("sheet.cancel")),1)]),_:1}),J.value?(e.openBlock(),e.createBlock(e.unref(g.ElButton),{key:2,onClick:l[15]||(l[15]=a=>ye()),popovertarget:"my-service"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("sheet.service")),1)]),_:1})):e.createCommentVNode("",!0)]),_:1})])]),_:1},8,["show","options"]),e.createElementVNode("div",{id:"my-service",class:"sw-popover",popover:"",ref_key:"myService",ref:oe},[l[21]||(l[21]=e.createElementVNode("header",null,"Служебная записка",-1)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(y.editor),{modelValue:G.value,"onUpdate:modelValue":l[17]||(l[17]=a=>G.value=a)},null,8,["modelValue"])),e.createElementVNode("footer",null,[e.createVNode(e.unref(g.ElButton),{onClick:l[18]||(l[18]=a=>oe.value.hidePopover()),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("calendar.cancel")),1)]),_:1}),e.createVNode(e.unref(g.ElButton),{type:"success",plain:"",onClick:Ce},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("calendar.save")),1)]),_:1})])],512)],64)}}};module.exports=Ee;
|
package/dist/SheetTable.js
CHANGED
|
@@ -175,7 +175,7 @@ const al = { class: "nav" }, tl = { style: { height: "20px", width: "100%", disp
|
|
|
175
175
|
const g = x.value[u];
|
|
176
176
|
if (g.employmentDate || g.dismissalDate)
|
|
177
177
|
for (let o = 1; o <= r.value.length; o++) {
|
|
178
|
-
const f = new Date(new Date(b.value).setDate(o)), N = T(f, "{Y}-{m}-{dd}"), w = g.employmentDate && f < new Date(g.employmentDate), B = g.dismissalDate && f
|
|
178
|
+
const f = new Date(new Date(b.value).setDate(o)), N = T(f, "{Y}-{m}-{dd}"), w = g.employmentDate && f < new Date(g.employmentDate), B = g.dismissalDate && f >= new Date(g.dismissalDate).setSeconds(0);
|
|
179
179
|
if (w || B) {
|
|
180
180
|
const Y = g.days.findIndex((H) => H.day === N);
|
|
181
181
|
Y !== -1 && (g.days[Y].state = "-", g.days[Y].time = "-");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),v=require("./VacationTable-3jJUSDHf.cjs"),H={class:"sw-data-picker"},J={key:0,class:"month_year"},K={class:"text"},R={key:1,class:"month_year"},Z={class:"text"},Q={key:2,class:"week"},X={key:3,class:"year"},ee=["onClick"],te={key:4,class:"year"},ae=["onClick"],le={key:5,class:"month"},ne=["onClick"],re={key:0},oe={key:0,class:"month_year"},ue={class:"text"},ce={key:1,class:"month_year"},se={class:"text"},ie={key:2,class:"week"},ve={key:3,class:"year"},de=["onClick"],me={key:4,class:"year"},ke=["onClick"],pe={key:5,class:"month"},ye=["onClick"],ge={__name:"SwDatePicker",props:{data:Object,limitation:{type:[Boolean,Array],default:()=>!1},range:{type:String,default:"solid"}},emits:["input"],setup(q,{emit:A}){var Y,z,_,I,j;const r=q,b=A,s=e.ref(5),y=e.ref(new Date),N=e.ref(new Date),u=e.ref(new Date().getFullYear()),o=e.ref(new Date().getMonth()),T=e.ref(new Date().getFullYear()),F=e.ref(new Date().getMonth()),V=e.ref(new Date(u.value,o.value+1,1).getMonth()),c=e.ref([]),B=e.ref(0),m=e.ref(-1),f=e.ref(-1),x=e.ref(navigator.language||"ru"),w=/en|zh|ja|he/.test(x.value)?0:1,L=e.computed(()=>Array.from({length:12},(l,t)=>{const a=new Date(2024,t);return new Intl.DateTimeFormat(x.value,{month:"long"}).format(a)})),h=e.ref(Math.floor(u.value/10)*10),D=e.computed(()=>Array.from({length:12},(l,t)=>h.value+t-1));(Y=r.data)!=null&&Y.startDate?(y.value=new Date(v.U(r.data.startDate)),u.value=y.value.getFullYear(),o.value=y.value.getMonth()):(z=r.data)!=null&&z.firstDate&&(u.value=new Date(v.U(r.data.firstDate)).getFullYear(),o.value=new Date(v.U(r.data.firstDate)).getMonth(),V.value=new Date(u.value,o.value+1,1).getMonth()),(_=r.data)!=null&&_.endDate&&r.range==="range"&&(N.value=new Date(v.U(r.data.endDate)),T.value=N.value.getFullYear(),F.value=N.value.getMonth());const $=()=>{c.value=[],B.value=0;const l=new Date(u.value,o.value,0);for(let a=l.getDate()-l.getDay()+w;a<=l.getDate();a++)l.getDay()!==6+w&&(c.value.push({day:a,month:l.getMonth(),year:l.getFullYear(),class:[]}),B.value++);const t=new Date(u.value,o.value+1,0).getDate();for(let a=1;a<=t;a++)c.value.push({day:a,month:o.value,year:u.value,class:[]}),B.value++;if(r.range==="range"){const a=new Date(u.value,o.value+1,1),n=new Date(u.value,o.value+2,0).getDate();for(let i=1;i<=n;i++)c.value.push({day:i,month:a.getMonth(),year:a.getFullYear(),class:[]})}O()},O=()=>{var t;if(!((t=r.data)!=null&&t.holiday))return;const l=(a,n)=>{a.forEach(i=>{const[p,k,g]=i.split("-").map(Number),E=c.value.findIndex(S=>S.year===p&&S.month+1===k&&S.day===g);E!==-1&&(c.value[E].class[0]=n)})};l(r.data.holiday.preholidays,"preholiday"),l(r.data.holiday.holidays,"weekend"),l(r.data.holiday.holiday,"holiday"),l(r.data.holiday.nowork,"nowork")},P=()=>{if(!r.limitation||r.limitation.length<2)return!1;const l=[...r.limitation].sort((t,a)=>new Date(v.U(t.startDate)).getTime()-new Date(v.U(a.startDate)).getTime());for(let t=1;t<l.length;t++){const a=new Date(v.U(l[t-1].endDate));if(new Date(v.U(l[t].startDate))<=a)return console.warn("Warning: Диапазоны пересекаются:",l[t-1],l[t]),!0}return!1},C=(l,t,a)=>{if(!r.limitation||r.limitation.length===0)return!0;const n=new Date(l,t,a).getTime();for(let i of r.limitation){const{startDate:p,endDate:k}=i;if(!p&&k){const g=new Date(v.U(k)).getTime();if(n<=g)return!1}if(p&&!k){const g=new Date(v.U(p)).getTime();if(n>=g)return!1}if(p&&k){const g=new Date(v.U(p)).getTime(),E=new Date(v.U(k)).getTime();if(g<=E){if(n>=g&&n<=E)return!1}else if(n>=g||n<=E)return!1}}return!0},M=(l,t)=>{const a=v.L(new Date(l.year,l.month,l.day),"{dd}.{m}.{Y}");r.range==="range"?f.value!==-1?(W(),m.value=t,c.value[t].class[1]="active"):m.value!==-1?(f.value=t,G(m.value,f.value,a)):(m.value=t,c.value[t].class[1]="active"):(m.value!==-1&&(c.value[m.value].class[1]=""),m.value=t,c.value[t].class[1]="active",b("input",{dateStart:a,count:1}))},W=()=>{c.value.forEach(l=>l.class[1]=""),m.value=-1,f.value=-1},G=(l,t,a)=>{let n=v.L(new Date(c.value[l].year,c.value[l].month,c.value[l].day),"{dd}.{m}.{Y}");if(t>=l){for(let i=l+1;i<t;i++)c.value[i].class[1]="select";b("input",{dateStart:n,dateEnd:a,count:U(l,t)})}else{for(let i=t+1;i<l;i++)c.value[i].class[1]="select";b("input",{dateStart:a,dateEnd:n,count:U(t,l)})}c.value[t].class[1]="active"},U=(l,t)=>{var p;let a=Math.abs(l-t)+1,[n,i]=[Math.min(l,t),Math.max(l,t)];for(let k=n;k<=i;k++)((p=c.value[k])==null?void 0:p.class[0])==="holiday"&&a--;return a},d=(l,t)=>{C(l,t)&&(y.value=new Date(l,t,1),u.value=y.value.getFullYear(),o.value=y.value.getMonth(),V.value=new Date(l,t+1,1).getMonth(),(r.range==="year"||r.range==="decades")&&s.value===0?M({year:l,month:t,day:1},8):$())};if($(),P(),(I=r.data)!=null&&I.startDate&&(m.value=c.value.findIndex(l=>l.day===y.value.getDate()&&l.month===o.value&&l.year===u.value),m.value!==-1&&(c.value[m.value].class[1]="active")),((j=r.data)==null?void 0:j.endDate)&&r.range==="range"&&(f.value=c.value.findIndex(l=>l.day===N.value.getDate()&&l.month===F.value&&l.year===T.value),f.value!==-1)){c.value[f.value].class[1]="active";for(let l=m.value+1;l<f.value;l++)c.value[l].class[1]="select"}return(l,t)=>(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("div",null,[r.range==="decades"||s.value===3?(e.openBlock(),e.createElementBlock("p",J,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:t[0]||(t[0]=e.withModifiers(a=>{h.value-=10,d(u.value,o.value)},["prevent"]))},[e.renderSlot(l.$slots,"double-arrow",{},()=>[t[16]||(t[16]=e.createTextVNode("«",-1))])])]),e.createElementVNode("span",K,e.toDisplayString(D.value[0])+" - "+e.toDisplayString(D.value[11]),1),e.createElementVNode("span",null,[e.createElementVNode("button",{class:"sw-revers",onClick:t[1]||(t[1]=e.withModifiers(a=>{h.value+=10,d(u.value,o.value)},["prevent"]))},[e.renderSlot(l.$slots,"double-arrow",{},()=>[t[17]||(t[17]=e.createTextVNode("«",-1))])])])])):(e.openBlock(),e.createElementBlock("p",R,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:t[2]||(t[2]=e.withModifiers(a=>d(u.value-1,o.value),["prevent"]))},[e.renderSlot(l.$slots,"double-arrow",{},()=>[t[18]||(t[18]=e.createTextVNode("«",-1))])]),e.createElementVNode("button",{onClick:t[3]||(t[3]=e.withModifiers(a=>{s.value=0,d(u.value,o.value-1)},["prevent"]))},[e.renderSlot(l.$slots,"arrow",{},()=>[t[19]||(t[19]=e.createTextVNode("‹",-1))])])]),e.createElementVNode("span",Z,[e.createElementVNode("button",{onClick:t[4]||(t[4]=e.withModifiers(a=>s.value=3,["prevent"]))},e.toDisplayString(u.value),1),e.createElementVNode("button",{onClick:t[5]||(t[5]=e.withModifiers(a=>s.value=1,["prevent"]))},e.toDisplayString(e.unref(v.L)(y.value.setMonth(o.value),"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{class:"sw-revers",onClick:t[6]||(t[6]=e.withModifiers(a=>{s.value=0,d(u.value,o.value+1)},["prevent"]))},[e.renderSlot(l.$slots,"arrow",{},()=>[t[20]||(t[20]=e.createTextVNode("‹",-1))])]),e.createElementVNode("button",{class:"sw-revers",onClick:t[7]||(t[7]=e.withModifiers(a=>d(u.value+1,o.value),["prevent"]))},[e.renderSlot(l.$slots,"double-arrow",{},()=>[t[21]||(t[21]=e.createTextVNode("«",-1))])])])])),r.range==="year"||r.range==="decades"||s.value===1||s.value===3?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Q,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(a,n)=>e.createElementVNode("button",{key:n,class:"disabled"},e.toDisplayString(e.unref(v.L)(new Date(1970,1,a+e.unref(w)),"{D}")),1)),64))])),s.value!==3&&r.range==="year"||s.value===1?(e.openBlock(),e.createElementBlock("div",X,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(a,n)=>(e.openBlock(),e.createElementBlock("button",{key:n,onClick:e.withModifiers(i=>{s.value=0,d(u.value,n)},["prevent"]),class:e.normalizeClass(n===o.value?"active":"")},e.toDisplayString(a),11,ee))),128))])):r.range==="decades"||s.value===3?(e.openBlock(),e.createElementBlock("div",te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.value,(a,n)=>(e.openBlock(),e.createElementBlock("button",{key:n,onClick:e.withModifiers(i=>{s.value=r.range==="year"?1:0,d(a,o.value)},["prevent"]),class:e.normalizeClass(h.value+n-1===u.value?"active":"")},e.toDisplayString(a),11,ae))),128))])):(e.openBlock(),e.createElementBlock("div",le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(a,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[n<B.value+(7-new Date(u.value,o.value+1,1).getDay()+e.unref(w))%7?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(a.month===o.value&&C(a.year,a.month,a.day)?a.class:"disabled"),onClick:e.withModifiers(()=>{a.month===o.value&&M(a,n)},["prevent"])},e.toDisplayString(a.day),11,ne)):e.createCommentVNode("",!0)],64))),128))]))]),r.range==="range"?(e.openBlock(),e.createElementBlock("div",re,[r.range==="decades"||s.value===4?(e.openBlock(),e.createElementBlock("p",oe,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:t[8]||(t[8]=e.withModifiers(a=>{h.value-=10,d(u.value,o.value)},["prevent"]))},[e.renderSlot(l.$slots,"double-arrow",{},()=>[t[22]||(t[22]=e.createTextVNode("«",-1))])])]),e.createElementVNode("span",ue,e.toDisplayString(D.value[0])+" - "+e.toDisplayString(D.value[11]),1),e.createElementVNode("span",null,[e.createElementVNode("button",{class:"sw-revers",onClick:t[9]||(t[9]=e.withModifiers(a=>{h.value+=10,d(u.value,o.value)},["prevent"]))},[e.renderSlot(l.$slots,"double-arrow",{},()=>[t[23]||(t[23]=e.createTextVNode("«",-1))])])])])):(e.openBlock(),e.createElementBlock("p",ce,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:t[10]||(t[10]=e.withModifiers(a=>d(u.value-1,o.value),["prevent"]))},[e.renderSlot(l.$slots,"double-arrow",{},()=>[t[24]||(t[24]=e.createTextVNode("«",-1))])]),e.createElementVNode("button",{onClick:t[11]||(t[11]=e.withModifiers(a=>{s.value=0,d(u.value,o.value-1)},["prevent"]))},[e.renderSlot(l.$slots,"arrow",{},()=>[t[25]||(t[25]=e.createTextVNode("‹",-1))])])]),e.createElementVNode("span",se,[e.createElementVNode("button",{onClick:t[12]||(t[12]=e.withModifiers(a=>s.value=4,["prevent"]))},e.toDisplayString(new Date(u.value,o.value+1).getFullYear()),1),e.createElementVNode("button",{onClick:t[13]||(t[13]=e.withModifiers(a=>s.value=2,["prevent"]))},e.toDisplayString(e.unref(v.L)(y.value.setMonth(o.value+1),"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{class:"sw-revers",onClick:t[14]||(t[14]=e.withModifiers(a=>{s.value=0,d(u.value,o.value+1)},["prevent"]))},[e.renderSlot(l.$slots,"arrow",{},()=>[t[26]||(t[26]=e.createTextVNode("‹",-1))])]),e.createElementVNode("button",{class:"sw-revers",onClick:t[15]||(t[15]=e.withModifiers(a=>d(u.value+1,o.value),["prevent"]))},[e.renderSlot(l.$slots,"double-arrow",{},()=>[t[27]||(t[27]=e.createTextVNode("«",-1))])])])])),s.value===2||s.value===4?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ie,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(a,n)=>e.createElementVNode("button",{key:n,class:"disabled"},e.toDisplayString(e.unref(v.L)(new Date(1970,1,a+e.unref(w)),"{D}")),1)),64))])),s.value===2?(e.openBlock(),e.createElementBlock("div",ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(a,n)=>(e.openBlock(),e.createElementBlock("button",{key:n,onClick:e.withModifiers(i=>{s.value=0,d(u.value,n-1)},["prevent"]),class:e.normalizeClass(n===(o.value+1)%12?"active":"")},e.toDisplayString(a),11,de))),128))])):s.value===4?(e.openBlock(),e.createElementBlock("div",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.value,(a,n)=>(e.openBlock(),e.createElementBlock("button",{key:n,onClick:e.withModifiers(i=>{s.value=0,d(a,o.value)},["prevent"]),class:e.normalizeClass(h.value+n-1===u.value?"active":"")},e.toDisplayString(a),11,ke))),128))])):(e.openBlock(),e.createElementBlock("div",pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(a,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[n>=B.value-(7+new Date(u.value,o.value+1,1).getDay()-e.unref(w))%7?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(a.month===V.value&&C(a.year,a.month,a.day)?a.class:"disabled"),onClick:e.withModifiers(()=>{a.month===V.value&&M(a,n)},["prevent"])},e.toDisplayString(a.day),11,ye)):e.createCommentVNode("",!0)],64))),128))]))])):e.createCommentVNode("",!0)]))}};exports.default=ge;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),v=require("./VacationTable-BmcxmYjS.cjs"),H={class:"sw-data-picker"},J={key:0,class:"month_year"},K={class:"text"},R={key:1,class:"month_year"},Z={class:"text"},Q={key:2,class:"week"},X={key:3,class:"year"},ee=["onClick"],te={key:4,class:"year"},ae=["onClick"],le={key:5,class:"month"},ne=["onClick"],re={key:0},oe={key:0,class:"month_year"},ue={class:"text"},ce={key:1,class:"month_year"},se={class:"text"},ie={key:2,class:"week"},ve={key:3,class:"year"},de=["onClick"],me={key:4,class:"year"},ke=["onClick"],pe={key:5,class:"month"},ye=["onClick"],ge={__name:"SwDatePicker",props:{data:Object,limitation:{type:[Boolean,Array],default:()=>!1},range:{type:String,default:"solid"}},emits:["input"],setup(q,{emit:A}){var Y,z,_,I,j;const r=q,b=A,s=e.ref(5),y=e.ref(new Date),N=e.ref(new Date),u=e.ref(new Date().getFullYear()),o=e.ref(new Date().getMonth()),T=e.ref(new Date().getFullYear()),F=e.ref(new Date().getMonth()),V=e.ref(new Date(u.value,o.value+1,1).getMonth()),c=e.ref([]),B=e.ref(0),m=e.ref(-1),f=e.ref(-1),x=e.ref(navigator.language||"ru"),w=/en|zh|ja|he/.test(x.value)?0:1,L=e.computed(()=>Array.from({length:12},(l,t)=>{const a=new Date(2024,t);return new Intl.DateTimeFormat(x.value,{month:"long"}).format(a)})),h=e.ref(Math.floor(u.value/10)*10),D=e.computed(()=>Array.from({length:12},(l,t)=>h.value+t-1));(Y=r.data)!=null&&Y.startDate?(y.value=new Date(v.U(r.data.startDate)),u.value=y.value.getFullYear(),o.value=y.value.getMonth()):(z=r.data)!=null&&z.firstDate&&(u.value=new Date(v.U(r.data.firstDate)).getFullYear(),o.value=new Date(v.U(r.data.firstDate)).getMonth(),V.value=new Date(u.value,o.value+1,1).getMonth()),(_=r.data)!=null&&_.endDate&&r.range==="range"&&(N.value=new Date(v.U(r.data.endDate)),T.value=N.value.getFullYear(),F.value=N.value.getMonth());const $=()=>{c.value=[],B.value=0;const l=new Date(u.value,o.value,0);for(let a=l.getDate()-l.getDay()+w;a<=l.getDate();a++)l.getDay()!==6+w&&(c.value.push({day:a,month:l.getMonth(),year:l.getFullYear(),class:[]}),B.value++);const t=new Date(u.value,o.value+1,0).getDate();for(let a=1;a<=t;a++)c.value.push({day:a,month:o.value,year:u.value,class:[]}),B.value++;if(r.range==="range"){const a=new Date(u.value,o.value+1,1),n=new Date(u.value,o.value+2,0).getDate();for(let i=1;i<=n;i++)c.value.push({day:i,month:a.getMonth(),year:a.getFullYear(),class:[]})}O()},O=()=>{var t;if(!((t=r.data)!=null&&t.holiday))return;const l=(a,n)=>{a.forEach(i=>{const[p,k,g]=i.split("-").map(Number),E=c.value.findIndex(S=>S.year===p&&S.month+1===k&&S.day===g);E!==-1&&(c.value[E].class[0]=n)})};l(r.data.holiday.preholidays,"preholiday"),l(r.data.holiday.holidays,"weekend"),l(r.data.holiday.holiday,"holiday"),l(r.data.holiday.nowork,"nowork")},P=()=>{if(!r.limitation||r.limitation.length<2)return!1;const l=[...r.limitation].sort((t,a)=>new Date(v.U(t.startDate)).getTime()-new Date(v.U(a.startDate)).getTime());for(let t=1;t<l.length;t++){const a=new Date(v.U(l[t-1].endDate));if(new Date(v.U(l[t].startDate))<=a)return console.warn("Warning: Диапазоны пересекаются:",l[t-1],l[t]),!0}return!1},C=(l,t,a)=>{if(!r.limitation||r.limitation.length===0)return!0;const n=new Date(l,t,a).getTime();for(let i of r.limitation){const{startDate:p,endDate:k}=i;if(!p&&k){const g=new Date(v.U(k)).getTime();if(n<=g)return!1}if(p&&!k){const g=new Date(v.U(p)).getTime();if(n>=g)return!1}if(p&&k){const g=new Date(v.U(p)).getTime(),E=new Date(v.U(k)).getTime();if(g<=E){if(n>=g&&n<=E)return!1}else if(n>=g||n<=E)return!1}}return!0},M=(l,t)=>{const a=v.L(new Date(l.year,l.month,l.day),"{dd}.{m}.{Y}");r.range==="range"?f.value!==-1?(W(),m.value=t,c.value[t].class[1]="active"):m.value!==-1?(f.value=t,G(m.value,f.value,a)):(m.value=t,c.value[t].class[1]="active"):(m.value!==-1&&(c.value[m.value].class[1]=""),m.value=t,c.value[t].class[1]="active",b("input",{dateStart:a,count:1}))},W=()=>{c.value.forEach(l=>l.class[1]=""),m.value=-1,f.value=-1},G=(l,t,a)=>{let n=v.L(new Date(c.value[l].year,c.value[l].month,c.value[l].day),"{dd}.{m}.{Y}");if(t>=l){for(let i=l+1;i<t;i++)c.value[i].class[1]="select";b("input",{dateStart:n,dateEnd:a,count:U(l,t)})}else{for(let i=t+1;i<l;i++)c.value[i].class[1]="select";b("input",{dateStart:a,dateEnd:n,count:U(t,l)})}c.value[t].class[1]="active"},U=(l,t)=>{var p;let a=Math.abs(l-t)+1,[n,i]=[Math.min(l,t),Math.max(l,t)];for(let k=n;k<=i;k++)((p=c.value[k])==null?void 0:p.class[0])==="holiday"&&a--;return a},d=(l,t)=>{C(l,t)&&(y.value=new Date(l,t,1),u.value=y.value.getFullYear(),o.value=y.value.getMonth(),V.value=new Date(l,t+1,1).getMonth(),(r.range==="year"||r.range==="decades")&&s.value===0?M({year:l,month:t,day:1},8):$())};if($(),P(),(I=r.data)!=null&&I.startDate&&(m.value=c.value.findIndex(l=>l.day===y.value.getDate()&&l.month===o.value&&l.year===u.value),m.value!==-1&&(c.value[m.value].class[1]="active")),((j=r.data)==null?void 0:j.endDate)&&r.range==="range"&&(f.value=c.value.findIndex(l=>l.day===N.value.getDate()&&l.month===F.value&&l.year===T.value),f.value!==-1)){c.value[f.value].class[1]="active";for(let l=m.value+1;l<f.value;l++)c.value[l].class[1]="select"}return(l,t)=>(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("div",null,[r.range==="decades"||s.value===3?(e.openBlock(),e.createElementBlock("p",J,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:t[0]||(t[0]=e.withModifiers(a=>{h.value-=10,d(u.value,o.value)},["prevent"]))},[e.renderSlot(l.$slots,"double-arrow",{},()=>[t[16]||(t[16]=e.createTextVNode("«",-1))])])]),e.createElementVNode("span",K,e.toDisplayString(D.value[0])+" - "+e.toDisplayString(D.value[11]),1),e.createElementVNode("span",null,[e.createElementVNode("button",{class:"sw-revers",onClick:t[1]||(t[1]=e.withModifiers(a=>{h.value+=10,d(u.value,o.value)},["prevent"]))},[e.renderSlot(l.$slots,"double-arrow",{},()=>[t[17]||(t[17]=e.createTextVNode("«",-1))])])])])):(e.openBlock(),e.createElementBlock("p",R,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:t[2]||(t[2]=e.withModifiers(a=>d(u.value-1,o.value),["prevent"]))},[e.renderSlot(l.$slots,"double-arrow",{},()=>[t[18]||(t[18]=e.createTextVNode("«",-1))])]),e.createElementVNode("button",{onClick:t[3]||(t[3]=e.withModifiers(a=>{s.value=0,d(u.value,o.value-1)},["prevent"]))},[e.renderSlot(l.$slots,"arrow",{},()=>[t[19]||(t[19]=e.createTextVNode("‹",-1))])])]),e.createElementVNode("span",Z,[e.createElementVNode("button",{onClick:t[4]||(t[4]=e.withModifiers(a=>s.value=3,["prevent"]))},e.toDisplayString(u.value),1),e.createElementVNode("button",{onClick:t[5]||(t[5]=e.withModifiers(a=>s.value=1,["prevent"]))},e.toDisplayString(e.unref(v.L)(y.value.setMonth(o.value),"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{class:"sw-revers",onClick:t[6]||(t[6]=e.withModifiers(a=>{s.value=0,d(u.value,o.value+1)},["prevent"]))},[e.renderSlot(l.$slots,"arrow",{},()=>[t[20]||(t[20]=e.createTextVNode("‹",-1))])]),e.createElementVNode("button",{class:"sw-revers",onClick:t[7]||(t[7]=e.withModifiers(a=>d(u.value+1,o.value),["prevent"]))},[e.renderSlot(l.$slots,"double-arrow",{},()=>[t[21]||(t[21]=e.createTextVNode("«",-1))])])])])),r.range==="year"||r.range==="decades"||s.value===1||s.value===3?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Q,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(a,n)=>e.createElementVNode("button",{key:n,class:"disabled"},e.toDisplayString(e.unref(v.L)(new Date(1970,1,a+e.unref(w)),"{D}")),1)),64))])),s.value!==3&&r.range==="year"||s.value===1?(e.openBlock(),e.createElementBlock("div",X,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(a,n)=>(e.openBlock(),e.createElementBlock("button",{key:n,onClick:e.withModifiers(i=>{s.value=0,d(u.value,n)},["prevent"]),class:e.normalizeClass(n===o.value?"active":"")},e.toDisplayString(a),11,ee))),128))])):r.range==="decades"||s.value===3?(e.openBlock(),e.createElementBlock("div",te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.value,(a,n)=>(e.openBlock(),e.createElementBlock("button",{key:n,onClick:e.withModifiers(i=>{s.value=r.range==="year"?1:0,d(a,o.value)},["prevent"]),class:e.normalizeClass(h.value+n-1===u.value?"active":"")},e.toDisplayString(a),11,ae))),128))])):(e.openBlock(),e.createElementBlock("div",le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(a,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[n<B.value+(7-new Date(u.value,o.value+1,1).getDay()+e.unref(w))%7?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(a.month===o.value&&C(a.year,a.month,a.day)?a.class:"disabled"),onClick:e.withModifiers(()=>{a.month===o.value&&M(a,n)},["prevent"])},e.toDisplayString(a.day),11,ne)):e.createCommentVNode("",!0)],64))),128))]))]),r.range==="range"?(e.openBlock(),e.createElementBlock("div",re,[r.range==="decades"||s.value===4?(e.openBlock(),e.createElementBlock("p",oe,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:t[8]||(t[8]=e.withModifiers(a=>{h.value-=10,d(u.value,o.value)},["prevent"]))},[e.renderSlot(l.$slots,"double-arrow",{},()=>[t[22]||(t[22]=e.createTextVNode("«",-1))])])]),e.createElementVNode("span",ue,e.toDisplayString(D.value[0])+" - "+e.toDisplayString(D.value[11]),1),e.createElementVNode("span",null,[e.createElementVNode("button",{class:"sw-revers",onClick:t[9]||(t[9]=e.withModifiers(a=>{h.value+=10,d(u.value,o.value)},["prevent"]))},[e.renderSlot(l.$slots,"double-arrow",{},()=>[t[23]||(t[23]=e.createTextVNode("«",-1))])])])])):(e.openBlock(),e.createElementBlock("p",ce,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:t[10]||(t[10]=e.withModifiers(a=>d(u.value-1,o.value),["prevent"]))},[e.renderSlot(l.$slots,"double-arrow",{},()=>[t[24]||(t[24]=e.createTextVNode("«",-1))])]),e.createElementVNode("button",{onClick:t[11]||(t[11]=e.withModifiers(a=>{s.value=0,d(u.value,o.value-1)},["prevent"]))},[e.renderSlot(l.$slots,"arrow",{},()=>[t[25]||(t[25]=e.createTextVNode("‹",-1))])])]),e.createElementVNode("span",se,[e.createElementVNode("button",{onClick:t[12]||(t[12]=e.withModifiers(a=>s.value=4,["prevent"]))},e.toDisplayString(new Date(u.value,o.value+1).getFullYear()),1),e.createElementVNode("button",{onClick:t[13]||(t[13]=e.withModifiers(a=>s.value=2,["prevent"]))},e.toDisplayString(e.unref(v.L)(y.value.setMonth(o.value+1),"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{class:"sw-revers",onClick:t[14]||(t[14]=e.withModifiers(a=>{s.value=0,d(u.value,o.value+1)},["prevent"]))},[e.renderSlot(l.$slots,"arrow",{},()=>[t[26]||(t[26]=e.createTextVNode("‹",-1))])]),e.createElementVNode("button",{class:"sw-revers",onClick:t[15]||(t[15]=e.withModifiers(a=>d(u.value+1,o.value),["prevent"]))},[e.renderSlot(l.$slots,"double-arrow",{},()=>[t[27]||(t[27]=e.createTextVNode("«",-1))])])])])),s.value===2||s.value===4?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ie,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(a,n)=>e.createElementVNode("button",{key:n,class:"disabled"},e.toDisplayString(e.unref(v.L)(new Date(1970,1,a+e.unref(w)),"{D}")),1)),64))])),s.value===2?(e.openBlock(),e.createElementBlock("div",ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(a,n)=>(e.openBlock(),e.createElementBlock("button",{key:n,onClick:e.withModifiers(i=>{s.value=0,d(u.value,n-1)},["prevent"]),class:e.normalizeClass(n===(o.value+1)%12?"active":"")},e.toDisplayString(a),11,de))),128))])):s.value===4?(e.openBlock(),e.createElementBlock("div",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.value,(a,n)=>(e.openBlock(),e.createElementBlock("button",{key:n,onClick:e.withModifiers(i=>{s.value=0,d(a,o.value)},["prevent"]),class:e.normalizeClass(h.value+n-1===u.value?"active":"")},e.toDisplayString(a),11,ke))),128))])):(e.openBlock(),e.createElementBlock("div",pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(a,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[n>=B.value-(7+new Date(u.value,o.value+1,1).getDay()-e.unref(w))%7?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(a.month===V.value&&C(a.year,a.month,a.day)?a.class:"disabled"),onClick:e.withModifiers(()=>{a.month===V.value&&M(a,n)},["prevent"])},e.toDisplayString(a.day),11,ye)):e.createCommentVNode("",!0)],64))),128))]))])):e.createCommentVNode("",!0)]))}};exports.default=ge;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref as D, computed as ee, createElementBlock as s, openBlock as o, createElementVNode as r, createCommentVNode as z, withModifiers as d, renderSlot as m, createTextVNode as p, toDisplayString as h, unref as Y, Fragment as C, renderList as x, normalizeClass as I } from "vue";
|
|
2
|
-
import { U as k, L as N } from "./VacationTable-
|
|
2
|
+
import { U as k, L as N } from "./VacationTable-r0eXSOmg.js";
|
|
3
3
|
const re = { class: "sw-data-picker" }, se = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "month_year"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed as n, createElementBlock as r, openBlock as l, normalizeClass as a, createBlock as c, createCommentVNode as p, renderSlot as i } from "vue";
|
|
2
|
-
import { g as u } from "./VacationTable-
|
|
2
|
+
import { g as u } from "./VacationTable-r0eXSOmg.js";
|
|
3
3
|
const g = {
|
|
4
4
|
__name: "SwDropdownItem",
|
|
5
5
|
props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./VacationTable-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./VacationTable-BmcxmYjS.cjs"),r={__name:"SwDropdownItem",props:{class:{type:String,default:""},size:{type:String,default:""},type:{type:String,default:""},iconBefore:{type:String,default:""}},setup(o){const t=o,n=e.computed(()=>{let l=["sw-dropdown-item"];return t.size.length>0&&l.push("sw-"+t.size),t.type.length>0&&l.push("sw-"+t.type),t.class.length>0&&l.push(t.class),l});return(l,c)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(n.value)},[o.iconBefore.length>0?(e.openBlock(),e.createBlock(s.g,{key:0,"icon-class":o.iconBefore},null,8,["icon-class"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"default")],2))}};exports.default=r;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { mergeModels as $, ref as p, useModel as S, createElementBlock as _, watchEffect as b, onMounted as B, openBlock as L, createElementVNode as r, createVNode as u, withCtx as i, renderSlot as d, createTextVNode as v, toDisplayString as C, normalizeClass as N } from "vue";
|
|
2
2
|
import R from "./SwDropdown-DQGTnnKw-CJPDuCfV.js";
|
|
3
3
|
import f from "./SwButton-85-tKHA7-D0loTJgt.js";
|
|
4
|
-
import { g as z } from "./VacationTable-
|
|
4
|
+
import { g as z } from "./VacationTable-r0eXSOmg.js";
|
|
5
5
|
const G = ["src"], O = {
|
|
6
6
|
__name: "SwGide",
|
|
7
7
|
props: /* @__PURE__ */ $({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),V=require("./SwDropdown-DQGTnnKw-BltvlnsL.cjs"),c=require("./SwButton-85-tKHA7-BpZ2q9aj.cjs"),x=require("./VacationTable-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),V=require("./SwDropdown-DQGTnnKw-BltvlnsL.cjs"),c=require("./SwButton-85-tKHA7-BpZ2q9aj.cjs"),x=require("./VacationTable-BmcxmYjS.cjs"),E=["src"],N={__name:"SwGide",props:e.mergeModels({steps:{type:Array,default:()=>[]},iconClose:{type:String,default:""},maxWidth:{type:Number,default:250}},{modelValue:{type:Number,default:0},modelModifiers:{}}),emits:e.mergeModels(["close"],["update:modelValue"]),setup(i,{emit:g}){const s=e.ref(null),m=e.ref(!0),a=e.ref(null),n=e.useModel(i,"modelValue"),y=g,r=i,p=()=>y("close"),v=l=>{const t=n.value+l;t<0?n.value=0:t>=r.steps.length?p():n.value=t};let d=!1;const h=l=>{const t=l.getBoundingClientRect(),o=window.innerHeight;t.top<5?(d=!0,document.documentElement.scrollTop+=t.top-5):t.bottom>o-5&&(d=!0,document.documentElement.scrollTop+=t.bottom-o+5)},u=()=>{if(!a.value||!s.value)return;const l=a.value.getBoundingClientRect(),t=window.pageYOffset||document.documentElement.scrollTop,o=window.pageXOffset||document.documentElement.scrollLeft;s.value.style.gridTemplateRows=`${l.top+t-5}px ${l.height+10}px 1fr`,s.value.style.gridTemplateColumns=`${l.left+o-5}px ${l.width+10}px 1fr`,s.value.style.height=document.documentElement.scrollHeight+"px"};return e.watchEffect(l=>{var w;if(!s.value)return;const t=(w=r.steps[n.value])==null?void 0:w.tag;if(!t||!t.trim()){s.value.style.gridTemplateRows="40% 0 1fr",s.value.style.gridTemplateColumns="1fr 0 1fr",s.value.style.height=document.documentElement.scrollHeight+"px";return}if(a.value=document.querySelector(t),!a.value){console.warn(`[SwGuide] Элемент не найден: ${t}`);return}h(a.value);const o=()=>{if(d){d=!1;return}u()};u();const f=new ResizeObserver(u);f.observe(a.value),window.addEventListener("resize",o),window.addEventListener("scroll",o,{passive:!0}),l(()=>{f.disconnect(),window.removeEventListener("resize",o),window.removeEventListener("scroll",o)})}),e.onMounted(()=>window.onload=()=>{var l;return a.value=document.querySelector((l=r.steps[n.value])==null?void 0:l.tag)}),(l,t)=>(e.openBlock(),e.createElementBlock("div",{class:"sw-gide",ref_key:"swGide",ref:s},[t[6]||(t[6]=e.createElementVNode("div",{class:"overlay0"},null,-1)),t[7]||(t[7]=e.createElementVNode("div",{class:"overlay1"},null,-1)),e.createVNode(V.default,{class:"gide",trigger:"none",placement:r.steps[n.value].placement,modelValue:m.value,"onUpdate:modelValue":t[2]||(t[2]=o=>m.value=o),maxWidth:r.maxWidth},{dropdown:e.withCtx(()=>[e.createElementVNode("header",null,[e.renderSlot(l.$slots,"header",{},()=>[e.createTextVNode(e.toDisplayString(r.steps[n.value].header)+" ",1),e.createVNode(c.default,{type:"primary",link:"",onClick:p},{default:e.withCtx(()=>[e.createVNode(x.g,{"icon-class":r.iconClose},null,8,["icon-class"])]),_:1})])]),e.renderSlot(l.$slots,"default",{},()=>{var o;return[e.createElementVNode("div",null,e.toDisplayString(r.steps[n.value].text),1),e.createElementVNode("img",{class:e.normalizeClass(/left/.test((o=r.steps[n.value])==null?void 0:o.placement)?"reflect":null),src:r.steps[n.value].img},null,10,E)]}),e.createElementVNode("footer",null,[e.renderSlot(l.$slots,"footer",{},()=>[e.createVNode(c.default,{type:n.value===0?"info":"warning",text:"",link:"",onClick:t[0]||(t[0]=o=>v(-1))},{default:e.withCtx(()=>[e.renderSlot(l.$slots,"arrow",{},()=>[t[3]||(t[3]=e.createTextVNode("‹",-1))])]),_:3},8,["type"]),e.createVNode(c.default,{type:"success",onClick:t[1]||(t[1]=o=>v(1)),text:"",link:"",class:"sw-revers"},{default:e.withCtx(()=>[e.renderSlot(l.$slots,"arrow",{},()=>[t[4]||(t[4]=e.createTextVNode("‹",-1))])]),_:3})])])]),default:e.withCtx(()=>[t[5]||(t[5]=e.createElementVNode("div",{class:"hole"},null,-1))]),_:3},8,["placement","modelValue","maxWidth"]),t[8]||(t[8]=e.createElementVNode("div",{class:"overlay2"},null,-1)),t[9]||(t[9]=e.createElementVNode("div",{class:"overlay3"},null,-1))],512))}};exports.default=N;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { mergeModels as p, useModel as k, ref as z, computed as V, createElementBlock as o, watch as q, openBlock as n, normalizeClass as N, createBlock as d, renderSlot as f, createCommentVNode as c, withDirectives as w, createTextVNode as B, toDisplayString as M, createElementVNode as C, mergeProps as D, vModelDynamic as I } from "vue";
|
|
2
|
-
import { V as $, g as m } from "./VacationTable-
|
|
2
|
+
import { V as $, g as m } from "./VacationTable-r0eXSOmg.js";
|
|
3
3
|
const E = ["for"], _ = {
|
|
4
4
|
key: 0,
|
|
5
5
|
title: "Это поле обязательно для заполнения."
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./VacationTable-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./VacationTable-BmcxmYjS.cjs"),h=["for"],v={key:0,title:"Это поле обязательно для заполнения."},k=["required","placeholder","type","id","name","size","maxlength","minlength","autofocus"],S={__name:"SwInput",props:e.mergeModels({before:{type:String,default:""},after:{type:String,default:""},placeholder:{type:String,default:""},label:{type:String,default:""},name:{type:String,required:!0},class:{type:String,default:""},size:{type:String,default:""},type:{type:String,default:"text"},inputMode:{type:String,default:"text"},required:{type:Boolean,default:!1},maxlength:{type:Number,default:128},minlength:{type:Number,default:1},inputSize:{type:Number,default:60}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["suffix","prefix","focusInput"],["update:modelValue"]),setup(i,{emit:c}){var s;const a=e.useModel(i,"modelValue"),t=i,n=e.ref(null),r=c,p=l=>{r("focusInput"),l.target.setSelectionRange(a.value.length,a.value.length),n.value!==null&&(n.value.style.top="-.6em")},d=l=>{var u;((u=a.value)==null?void 0:u.length)===0&&n.value!==null&&n.value.removeAttribute("style")};((s=a.value)==null?void 0:s.length)>0&&n.value!==null&&(n.value.style.top="-.6em");const m=()=>{r("suffix")},f=()=>{r("prefix")},g=e.computed(()=>{let l=["sw-input"];return t.size.length>0&&l.push("sw-"+t.size),t.class.length>0&&l.push(t.class),l});return e.watch(a,(l,u)=>{t.type==="phone"&&(a.value=o.V(l,u))}),(l,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(g.value)},[t.before.length>0?(e.openBlock(),e.createBlock(o.g,{key:0,"icon-class":t.before,onClick:f},null,8,["icon-class"])):e.renderSlot(l.$slots,"prefix",{key:1}),t.label.length>0?(e.openBlock(),e.createElementBlock("label",{key:2,for:t.name,ref_key:"lab",ref:n},[e.createTextVNode(e.toDisplayString(t.label),1),t.required?(e.openBlock(),e.createElementBlock("span",v,"*")):e.createCommentVNode("",!0)],8,h)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",e.mergeProps({"onUpdate:modelValue":u[0]||(u[0]=y=>a.value=y),required:t.required,placeholder:t.required&&t.label.length===0?t.placeholder+"*":t.placeholder,type:t.type,id:t.name,name:t.name,size:t.inputSize,onFocus:p,onBlur:d,maxlength:t.maxlength,minlength:t.minlength,autofocus:t.autofocus},l.$attrs),null,16,k),[[e.vModelDynamic,a.value]]),t.after.length>0?(e.openBlock(),e.createBlock(o.g,{key:3,"icon-class":t.after,onClick:m},null,8,["icon-class"])):e.renderSlot(l.$slots,"suffix",{key:4})],2))}};exports.default=S;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mergeModels as f, useModel as g, ref as p, useSlots as v, createElementBlock as c, watch as w, nextTick as k, onUnmounted as h, openBlock as d, normalizeClass as y, createCommentVNode as S, renderSlot as r, createElementVNode as V, unref as x, createTextVNode as C, createVNode as u, toDisplayString as E, withCtx as M } from "vue";
|
|
2
2
|
import N from "./SwButton-85-tKHA7-D0loTJgt.js";
|
|
3
|
-
import { g as _ } from "./VacationTable-
|
|
3
|
+
import { g as _ } from "./VacationTable-r0eXSOmg.js";
|
|
4
4
|
const B = { key: 0 }, T = {
|
|
5
5
|
__name: "SwMessage",
|
|
6
6
|
props: /* @__PURE__ */ f({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./SwButton-85-tKHA7-BpZ2q9aj.cjs"),d=require("./VacationTable-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./SwButton-85-tKHA7-BpZ2q9aj.cjs"),d=require("./VacationTable-BmcxmYjS.cjs"),m={key:0},f={__name:"SwMessage",props:e.mergeModels({name:{type:String,default:""},class:{type:String,default:""},iconAfter:{type:String,default:""}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(s){const n=e.useModel(s,"modelValue"),a=s,o=e.ref(null),i=e.useSlots(),r=t=>{if(console.log("target - ",t.target),o.value&&n.value){const l=o.value.getBoundingClientRect();t.clientX>=l.left&&t.clientX<=l.right&&t.clientY>=l.top&&t.clientY<=l.bottom||(n.value=!1)}};return e.watch(()=>n.value,t=>{t?(o.value.showModal(),e.nextTick(),window.addEventListener("click",r,!0)):(o.value.close(),window.removeEventListener("click",r))}),e.onUnmounted(()=>{window.removeEventListener("click",r)}),(t,l)=>{var c;return e.openBlock(),e.createElementBlock("dialog",{class:e.normalizeClass("sw-message "+a.class),ref_key:"messageRef",ref:o},[a.name.length>0||(c=e.unref(i))!=null&&c.header?(e.openBlock(),e.createElementBlock("header",m,[e.renderSlot(t.$slots,"header",{},()=>[e.createTextVNode(e.toDisplayString(a.name)+" ",1),e.createVNode(u.default,{link:"",type:"primary",onClick:l[0]||(l[0]=g=>n.value=!1)},{default:e.withCtx(()=>[e.createVNode(d.g,{"icon-class":a.iconAfter},null,8,["icon-class"])]),_:1})])])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"default"),e.createElementVNode("footer",null,[e.renderSlot(t.$slots,"footer")])],2)}}};exports.default=f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),$=require("./VacationTable-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),$=require("./VacationTable-BmcxmYjS.cjs"),X=["onMouseenter","onMouseleave","onFocus","onBlur","onMousedown","onTouchstart"],Y={__name:"SwSlider",props:t.mergeModels({class:{type:String,default:""},size:{type:String,default:""},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},vertical:{type:Boolean,default:!1},showValue:{type:Boolean,default:!1}},{modelValue:{type:[Number,Array],required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(x){const h=t.useModel(x,"modelValue"),n=x,v=t.ref([]),w=t.ref([]),T=t.computed(()=>{let e=["sw-slider"];return n.size.length>0&&e.push("sw-"+n.size),n.class.length>0&&e.push(n.class),n.vertical&&e.push("vertical"),e}),S=e=>{const l=[...v.value];l[e]=!0,v.value=l},b=e=>{const l=[...v.value];l[e]=!1,v.value=l},B=e=>{const l=document.querySelector(".sw-slider");return l?$.J(l,n.vertical):n.vertical?{right:"100%",marginRight:"10px"}:{bottom:"100%",marginBottom:"10px"}},p=t.computed(()=>Array.isArray(h.value)),c=t.computed({get(){return p.value?[...h.value]:[h.value]},set(e){p.value?h.value=[...e].sort((l,a)=>l-a):h.value=e[0]}}),r=t.computed(()=>{const e=n.max-n.min;return c.value.map(l=>e===0?0:(l-n.min)/e*100)}),V=t.computed(()=>{if(n.vertical)if(p.value){const e=r.value[0]||0,l=r.value[r.value.length-1]||0,a=Math.min(e,l);return{height:`${Math.max(e,l)-a}%`,top:`${a}%`,left:"0",width:"100%"}}else return{height:`${r.value[0]||0}%`,top:"0",left:"0",width:"100%"};else if(p.value){const e=r.value[0]||0,l=r.value[r.value.length-1]||0,a=Math.min(e,l);return{width:`${Math.max(e,l)-a}%`,left:`${a}%`,top:"0",height:"100%"}}else return{width:`${r.value[0]||0}%`,left:"0",top:"0",height:"100%"}}),C=t.computed(()=>r.value.map((e,l)=>n.vertical?{top:`${e}%`,zIndex:c.value.length-l}:{left:`${e}%`,zIndex:c.value.length-l}));function N(e){if(p.value)return;const l=e.currentTarget.closest(".sw-slider");if(!l)return;const a=l.getBoundingClientRect(),u=n.vertical?(e.clientY-a.top)/a.height:(e.clientX-a.left)/a.width,o=Math.max(0,Math.min(1,u)),s=n.max-n.min;let i=n.min+o*s;const d=Math.round((i-n.min)/n.step);i=n.min+d*n.step,i=Math.max(n.min,Math.min(n.max,i)),c.value=[i],setTimeout(()=>{const f=[...w.value];f[0]=B(),w.value=f},0)}const E=t.ref(!1),m=t.ref(null),k=t.ref(null);function g(e,l){var u,o,s,i;const a=e.target.closest(".sw-slider");a&&(k.value=a.getBoundingClientRect(),m.value=l,E.value=!0,z(e.clientX||((o=(u=e.touches)==null?void 0:u[0])==null?void 0:o.clientX),e.clientY||((i=(s=e.touches)==null?void 0:s[0])==null?void 0:i.clientY)))}function M(e){var u,o,s,i,d;if(!E.value)return;(u=e.preventDefault)==null||u.call(e);const l=e.clientX||((s=(o=e.touches)==null?void 0:o[0])==null?void 0:s.clientX),a=e.clientY||((d=(i=e.touches)==null?void 0:i[0])==null?void 0:d.clientY);z(l,a)}function y(){E.value=!1,m.value=null}function z(e,l){if(!k.value||m.value===null)return;const a=k.value,u=n.vertical?(l-a.top)/a.height:(e-a.left)/a.width,o=Math.max(0,Math.min(1,u)),s=n.max-n.min;let i=n.min+o*s;const d=Math.round((i-n.min)/n.step);i=n.min+d*n.step,i=Math.max(n.min,Math.min(n.max,i));const f=[...c.value];f[m.value]=i,c.value=f,setTimeout(()=>{const L=[...w.value];L[m.value]=B(m.value),w.value=L},0)}return t.onMounted(()=>{window.addEventListener("mousemove",M),window.addEventListener("mouseup",y),window.addEventListener("touchmove",M,{passive:!1}),window.addEventListener("touchend",y),v.value=new Array(c.value.length).fill(!1)}),t.onUnmounted(()=>{window.removeEventListener("mousemove",M),window.removeEventListener("mouseup",y),window.removeEventListener("touchmove",M),window.removeEventListener("touchend",y)}),(e,l)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(T.value)},[t.createElementVNode("div",{class:"track",onClick:N,onMousedown:l[0]||(l[0]=t.withModifiers(a=>g(a,0),["prevent"])),onTouchstart:l[1]||(l[1]=t.withModifiers(a=>g(a.touches[0],0),["prevent"]))},[t.createElementVNode("div",{class:"fill",style:t.normalizeStyle(V.value)},null,4)],32),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value,(a,u)=>(t.openBlock(),t.createElementBlock("div",{class:"thumb",key:u,style:t.normalizeStyle(C.value[u]),onMouseenter:o=>S(u),onMouseleave:o=>b(u),onFocus:o=>S(u),onBlur:o=>b(u),onMousedown:t.withModifiers(o=>g(o,u),["prevent"]),onTouchstart:t.withModifiers(o=>g(o.touches[0],u),["prevent"])},[t.renderSlot(e.$slots,"default",{index:u,value:a}),v.value[u]&&x.showValue?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["tooltip",{"tooltip-vertical":n.vertical}]),style:t.normalizeStyle(B())},t.toDisplayString(a),7)):t.createCommentVNode("",!0)],44,X))),128))],2))}};exports.default=Y;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { mergeModels as q, useModel as D, ref as w, computed as d, createElementBlock as E, onMounted as I, onUnmounted as J, openBlock as L, normalizeClass as X, createElementVNode as Y, withModifiers as B, normalizeStyle as V, Fragment as Q, renderList as U, renderSlot as j, createCommentVNode as G, toDisplayString as H } from "vue";
|
|
2
|
-
import { J as K } from "./VacationTable-
|
|
2
|
+
import { J as K } from "./VacationTable-r0eXSOmg.js";
|
|
3
3
|
const O = ["onMouseenter", "onMouseleave", "onFocus", "onBlur", "onMousedown", "onTouchstart"], Z = {
|
|
4
4
|
__name: "SwSlider",
|
|
5
5
|
props: /* @__PURE__ */ q({
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),ve=require("vue-i18n"),B=require("./index-Dn3djtwj.cjs"),me=require("file-saver"),pe=require("exceljs"),s=require("element-plus"),P=require("@imengyu/vue3-context-menu");function fe(r){const f=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const u in r)if(u!=="default"){const n=Object.getOwnPropertyDescriptor(r,u);Object.defineProperty(f,u,n.get?n:{enumerable:!0,get:()=>r[u]})}}return f.default=r,Object.freeze(f)}const ge=fe(pe);function he(r){return/^(https?:|mailto:|tel:)/.test(r)}function ye(r,f){if(arguments.length===0||!r)return null;const u=f||"{Y}-{m}-{d} {G}:{i}:{s}";let n;typeof r=="object"?n=r:(typeof r=="string"&&(/^[0-9]+$/.test(r)?r=parseInt(r):r=r.replace(new RegExp(/-/gm),"/")),typeof r=="number"&&r.toString().length===10&&(r=r*1e3),n=new Date(r));const x="ru-RU",m={Y:n.getFullYear(),m:(n.getMonth()+1).toString().padStart(2,"0"),d:n.getDate(),dd:n.getDate().toString().padStart(2,"0"),G:n.getHours(),H:n.getHours().toString().padStart(2,"0"),i:n.getMinutes().toString().padStart(2,"0"),s:n.getSeconds().toString().padStart(2,"0"),D:new Intl.DateTimeFormat(x,{weekday:"short"}).format(n),F:new Intl.DateTimeFormat(x,{month:"long"}).format(n),M:new Intl.DateTimeFormat(x,{month:"short"}).format(n)};return u.replace(/{(dd|[YmdGHisDFM])+}/g,(c,V)=>m[V])}function Se(r){let f=r.split(r.match(/\D.*?\D?/));return f[0].length>2?f.join("-")+"T00:00:01":f.reverse().join("-")+"T00:00:01"}function Ce(r,f){if(/^\+[0-9]\s/.test(f)&&r.length===2||/^\+0\s/.test(r))return"";if(typeof r>"u"||r.length===0)return r;const u="+0 (___) ___-__-__";let n=0;const x=u.replace(/\D/g,""),m=r.replace(/\D/g,"");let c=u.replace(/[_\d]/g,b=>n<m.length?m.charAt(n++)||x.charAt(n):b);n=c.indexOf("_"),n!==-1&&(n=n<5?3:n,c=c.slice(0,n));let V=u.slice(0,r.length).replace(/_+/g,b=>`\\d{1,${b.length}}`).replace(/[+()]/g,"\\$&");return V=new RegExp(`^${V}$`),c=c.replace(/[-—]$|(\) )$/g,""),!V.test(r)||r.length<5?c:r}function ke(r,f=!1){const u=r.getBoundingClientRect();return f?u.left>50?{right:"100%",marginRight:"10px"}:{left:"100%",marginLeft:"10px"}:{bottom:"100%",marginBottom:"10px"}}const we=["href"],F={__name:"SwIcon",props:{prefix:{type:String,default:"icon"},iconClass:{type:String,required:!0},className:{type:String,default:""}},setup(r){const f=r,u=he(f.iconClass);return(n,x)=>e.unref(u)?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:0,style:"mask: url("+f.iconClass+") no-repeat 50% 50%;",class:"svg-external-icon svg-icon"},n.$attrs),null,16)):(e.openBlock(),e.createElementBlock("svg",e.mergeProps({key:1,class:"svg-icon icon-"+(f.className||f.iconClass),"aria-hidden":"true"},n.$attrs),[e.createElementVNode("use",{href:"#"+f.prefix+"-"+f.iconClass},null,8,we)],16))}},be=Object.freeze(Object.defineProperty({__proto__:null,default:F},Symbol.toStringTag,{value:"Module"})),xe={__name:"SwAlert",props:{message:{type:String,default:"Default message"},before:{type:String,default:""},class:{type:String,default:""},after:{type:String,default:""},size:{type:String,default:""},duration:{type:Number,default:6e3},type:{type:String,default:"info",validator:r=>["success","warning","error","info"].includes(r)}},emits:["closed"],setup(r,{emit:f}){const u=r,n=f,x=e.ref(!1);let m=null;const c=()=>{document.querySelector(".sw-alert-wrapper").togglePopover(),x.value=!0,document.querySelector(".sw-alert-wrapper").showPopover(),h()},V=()=>{x.value=!1,n("closed")},b=()=>{m&&(clearTimeout(m),m=null)},T=()=>{h()},h=()=>{m=setTimeout(V,u.duration)};e.onMounted(()=>{c()}),e.onUnmounted(()=>{m&&clearTimeout(m)});const D=e.computed(()=>{const g=["sw-alert"];return u.size.length>0&&g.push(`sw-${u.size}`),u.type.length>0&&g.push(`sw-${u.type}`),u.class.length>0&&g.push(u.class),g});return(g,j)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade"},{default:e.withCtx(()=>[x.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(D.value),onMouseenter:b,onMouseleave:T},[u.before.length>0?(e.openBlock(),e.createBlock(F,{key:0,"icon-class":u.before},null,8,["icon-class"])):e.renderSlot(g.$slots,"prefix",{key:1}),e.renderSlot(g.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(u.message),1)]),u.after.length>0?(e.openBlock(),e.createBlock(F,{key:2,"icon-class":u.after,onClick:V},null,8,["icon-class"])):e.renderSlot(g.$slots,"suffix",{key:3}),e.createElementVNode("footer",null,[e.renderSlot(g.$slots,"footer")])],34)):e.createCommentVNode("",!0)]),_:3}))}},Ee=Object.freeze(Object.defineProperty({__proto__:null,default:xe},Symbol.toStringTag,{value:"Module"}));document.querySelector("div.sw-alert-wrapper");const Q=Object.assign({"./components/SwAlert.vue":()=>Promise.resolve().then(()=>Ee),"./components/SwButton.vue":()=>Promise.resolve().then(()=>require("./SwButton-85-tKHA7-BpZ2q9aj.cjs")),"./components/SwCollapse.vue":()=>Promise.resolve().then(()=>require("./SwCollapse-CuN3EbT6-1y2PMRQ8.cjs")),"./components/SwDatePicker.vue":()=>Promise.resolve().then(()=>require("./SwDatePicker-C-UmCyTm-B1c4pG3O.cjs")),"./components/SwDropdown.vue":()=>Promise.resolve().then(()=>require("./SwDropdown-DQGTnnKw-BltvlnsL.cjs")),"./components/SwDropdownItem.vue":()=>Promise.resolve().then(()=>require("./SwDropdownItem-Db2TXRVI-r8WktVN3.cjs")),"./components/SwDropdownNew.vue":()=>Promise.resolve().then(()=>require("./SwDropdownNew-CYfjZFd2-DIv6p-6i.cjs")),"./components/SwFormItem.vue":()=>Promise.resolve().then(()=>require("./SwFormItem-CaA4jsoa-MFTEfPiY.cjs")),"./components/SwGide.vue":()=>Promise.resolve().then(()=>require("./SwGide-Bv05X9FW-BwlJwQvQ.cjs")),"./components/SwIcon.vue":()=>Promise.resolve().then(()=>be),"./components/SwInput.vue":()=>Promise.resolve().then(()=>require("./SwInput-B1hD3QYw-DrNbPI55.cjs")),"./components/SwMessage.vue":()=>Promise.resolve().then(()=>require("./SwMessage-D24ZbJyd-Dge6kQzo.cjs")),"./components/SwSection.vue":()=>Promise.resolve().then(()=>require("./SwSection-D8ooQ21I-Nsa_5V1p.cjs")),"./components/SwSelect.vue":()=>Promise.resolve().then(()=>require("./SwSelect-C2RKinez-KweWYzRe.cjs")),"./components/SwSkeleton.vue":()=>Promise.resolve().then(()=>require("./SwSkeleton-B7ysp8L9-RJwRbv_K.cjs")),"./components/SwSkeletonItem.vue":()=>Promise.resolve().then(()=>require("./SwSkeletonItem-CU7LvihY-BJmW7U8Z.cjs")),"./components/SwSlider.vue":()=>Promise.resolve().then(()=>require("./SwSlider-B8ah3WJf-BFKzdLM4.cjs")),"./components/SwSwitch.vue":()=>Promise.resolve().then(()=>require("./SwSwitch-6rl1IT4p-BQTT__wH.cjs")),"./components/SwTable.vue":()=>Promise.resolve().then(()=>require("./SwTable-BKZ5idCi-BMDZ1otG.cjs")),"./components/SwTableColumn.vue":()=>Promise.resolve().then(()=>require("./SwTableColumn-BLF5bPuJ-CbuAoznO.cjs")),"./components/SwTabs.vue":()=>Promise.resolve().then(()=>require("./SwTabs-DkSI4oAh-By6KQ_XO.cjs")),"./components/SwTabsPane.vue":()=>Promise.resolve().then(()=>require("./SwTabsPane-Dwtj8g7T-BUCrffEQ.cjs"))}),ee={};for(const r in Q){const f=r.split("/").pop().replace(".vue","").replace(/-(\w)/g,(u,n)=>n.toUpperCase());ee[f]=e.defineAsyncComponent(()=>Q[r]())}const Ve={class:"nav"},Ne={class:"vacation-calendar"},De={key:0},Be={key:0,class:"controls-container",style:{"margin-top":".5rem"}},Te={key:0},$e={key:1,style:{padding:"0 1rem .5rem"}},_e={style:{padding:".5rem 0 0"}},Pe={__name:"VacationTable",props:{odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"},query:String,checkEdit:{type:Boolean,default:!1}},setup(r){const{SwDatePicker:f}=ee,u=r,{t:n,d:x}=ve.useI18n(),m=e.ref([]),c=e.ref(new Date().getFullYear()),V=new Date().getMonth()>10?[{value:c.value,label:c.value},{value:c.value+1,label:c.value+1}]:[{value:c.value-1,label:c.value-1},{value:c.value,label:c.value}],b=e.ref([]),T=e.ref("100%"),h=e.ref(1),D=e.ref(!1),g=e.ref(1),j=e.ref(!1),N=e.ref(!1),A=e.ref({zIndex:3,minWidth:230,x:500,y:200}),$=e.ref(!1),q=e.ref({participants:[]}),R=e.ref([]),H=e.ref([]),C=e.ref([]),z=e.ref([{value:"all",label:n("vacationSchedule.all"),key:"all"}]),M=e.ref(!1),O=e.ref(!1),d=e.ref({name:"",length:0,code:""}),U=async()=>{u.odata.getEmployee(c.value-1+"-12-17T23:59:00").then(a=>{var t,i;return C.value.length===0?C.value=[(t=a.find(o=>o.employeeName===u.fullName))==null?void 0:t.divisionName]:C.value=C.value.includes("all")||a.some(o=>C.value.includes(o.divisionName))?C.value:[(i=a.find(o=>o.employeeName===u.fullName))==null?void 0:i.divisionName],a.forEach(o=>{z.value.some(v=>(v==null?void 0:v.value)===o.divisionName)||z.value.push({value:o.divisionName,label:o.divisionName,key:o.divisionName})}),G(),!0})};e.watch(C,async(a,t)=>{a!==t&&(b.value=[],j.value=!1,u.odata.employee.forEach(i=>{(a.includes(i.divisionName)||a.includes("all"))&&(b.value.some(o=>(o==null?void 0:o.activeText)===i.roleName)||b.value.push({val:!0,activeText:i.roleName}))}),G())});const te=(a,t)=>{console.log("event",t),console.log("column",a),a.level===2&&a.no>0&&h.value===2&&(h.value=3,g.value=a.no)},G=()=>{m.value=[];let a=[];u.odata.employee.forEach(t=>{(C.value.includes(t.divisionName)||C.value.includes("all"))&&b.value.some(i=>i.val&&i.activeText===t.roleName)&&(a.push(t.employeeKey),m.value.push({name:t.employeeName,days:[{note:""}],jobTitle:t.roleName,code:t.employeeKey}))}),le(a),D.value=!1},le=a=>{u.workSchedule.getAllVacations({year:c.value}).then(t=>{a.forEach((i,o)=>{m.value[o].days=[{note:""}],t.forEach(v=>{i===v.code&&(typeof m.value[o].days[0].dateStart>"u"?m.value[o].days[0]={dateStart:B.parseTime(v.dateStart,"{dd}.{m}.{Y}"),dateEnd:B.parseTime(v.dateEnd,"{dd}.{m}.{Y}"),note:v.note,count:v.count}:m.value[o].days.push({dateStart:B.parseTime(v.dateStart,"{dd}.{m}.{Y}"),dateEnd:B.parseTime(v.dateEnd,"{dd}.{m}.{Y}"),note:v.note,count:v.count}))})})})},ae=a=>{if(a.columnIndex<3&&S.value[a.rowIndex].key<S.value[a.rowIndex].days.length)return S.value[a.rowIndex].key===0?{rowspan:S.value[a.rowIndex].days.length,colspan:1}:{rowspan:0,colspan:0}},J=(a,t,i,o)=>{var v;if(console.log("coMenu",a,t,i,o),d.value.ids=a.ids,d.value.key=typeof a.key>"u"?m.value[a.ids].days.length:a.key,d.value.startDate=a.dateStart,d.value.endDate=a.dateEnd,d.value.name=h.value>1?a.employee:a.name,d.value.count=a.count,d.value.length=((v=a.days)==null?void 0:v.length)||0,d.value.allCount=()=>a.days.length===0?0:a.days.reduce((l,p,k)=>k!==a.key?l+parseInt(p.count):l,0),d.value.add=d.value.length>0&&a.days[a.days.length-1].count,d.value.level=t.level,d.value.holiday=H.value,A.value.y=o.clientY,A.value.x=o.clientX,h.value===1&&t.level===2&&t.no<4&&(d.value.add||a.days.length>1)&&(N.value=!0),t.level===3&&(N.value=!0),h.value>1&&t.level===2&&t.no>0)if(h.value>2){d.value.firstDate=`${t.no.toString().length===1?"0"+t.no:t.no}-${g.value.toString().length===1?"0"+g.value:g.value}-${c.value}`,console.log("firstDate",d.value.firstDate);const l=new Date(c.value,g.value-1,t.no),p=m.value[d.value.ids];if(p&&p.days)for(let k=0;k<p.days.length;k++){const w=p.days[k];if(w.dateStart&&w.dateEnd){const y=I(w.dateStart),E=I(w.dateEnd);if(y&&E&&l>=y&&l<=E){d.value.startDate=w.dateStart,d.value.endDate=w.dateEnd,d.value.key=k;break}}}N.value=!0}else h.value===2&&a[`m${t.no}`].length>0?(g.value=t.no,h.value=3):(d.value.firstDate=`01-${t.no.toString().length===1?"0"+t.no:t.no}-${c.value}`,N.value=!0)};function I(a){if(!a)return null;const t=a.split(".");if(t.length!==3)return null;const[i,o,v]=t.map(Number);return new Date(v,o-1,i)}function W(a){const t=String(a.getDate()).padStart(2,"0"),i=String(a.getMonth()+1).padStart(2,"0");return`${t}.${i}`}const K=({row:a,columnIndex:t})=>{var o;if(h.value!==3||t===0||((o=a[`m${g.value}`])==null?void 0:o.length)===0)return"";const i=new Date(c.value,g.value,t).getTime()+1e3;for(let v of a[`m${g.value}`]){const l=new Date(c.value,v.text.split("-")[0].split(".")[1],v.text.split("-")[0].split(".")[0]).getTime(),p=new Date(c.value,v.text.split("-")[1].split(".")[1],v.text.split("-")[1].split(".")[0],23,59,59).getTime();if(i>=l&&i<=p)return"vacation"}return""};function ne(a,t){const i=I(a),o=I(t);if(!i||!o||o<i)return[];const v=[];let l=new Date(i);for(;l<=o;){const p=l.getMonth()+1,k=l.getFullYear(),w=new Date(k,l.getMonth()+1,0),y=l<i?i:l,E=w>o?o:w,_=`${W(y)}-${W(E)}`;v.push({month:p,text:_}),l=new Date(k,l.getMonth()+1,1)}return v}const Y=(a,t=!1)=>{let i=m.value[d.value.ids];switch(a){case"add":i.days.push({note:""}),console.log(i.days.length);break;case"delete":t?delete i.days[t]:i.days.pop(),L(d.value.ids);break}N.value=!1},oe=a=>{O.value=a,d.value.count=a.count},re=()=>{O.value&&(m.value[d.value.ids].days[d.value.key]={...O.value,note:""},L(d.value.ids)),N.value=!1},L=a=>{u.workSchedule.rewriteFull({year:c.value,code:m.value[a].code,data:m.value[a].days.map(t=>({dateStart:t.dateStart.split(".").reverse().join("-"),dateEnd:t.dateEnd.split(".").reverse().join("-"),note:t.note,count:t.count}))})},X=a=>{u.workSchedule.sendConfirmMessage({fullname:u.fullName,confirm:a}),u.query=""};function Z(a){return new Date(2025,a-1,1).toLocaleString("ru",{month:"long"})}const S=e.computed(()=>m.value.flatMap((a,t)=>!a.days||a.days.length===0?[{...a,key:0,ids:t}]:a.days.map((i,o)=>({ids:t,key:o,...a,...i})))),ue=e.computed(()=>m.value.map((a,t)=>{const i={employee:B.byInitials(a.name),code:a.code,ids:t};for(let o=1;o<=12;o++)i[`m${o}`]=[];return a.days.forEach(o=>{if(!o.dateStart||!o.dateEnd)return;ne(o.dateStart,o.dateEnd).forEach(l=>{l.month>=1&&l.month<=12&&i[`m${l.month}`].push({text:l.text,count:o.count,dateStart:o.dateStart,dateEnd:o.dateEnd})})}),i})),ie=()=>{u.workSchedule.sendAgreementMessage({users:q.value.participants}),$.value=!1};u.workSchedule.getBoss().then(a=>{R.value=a[0].users}),B.holidays().then(a=>{H.value=a,U()});const de=()=>d.value.length<2?[{dateStart:"01.01."+c.value,dateEnd:"31.12."+c.value}]:[{dateStart:"01.01."+c.value,dateEnd:"31.12."+c.value}],se=async()=>{M.value=!0;const a=new ge.Workbook,t=a.addWorksheet(c.value.toString(),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),i={vertical:"middle",horizontal:"center"},o={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},v={vertical:"middle",horizontal:"center",wrapText:!0},l={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:c.value-1}),t.getCell("D3").value=n("workSchedule.printPlace"),t.getCell("D4").value=n("vacationSchedule.dateApprove",{year:c.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=c.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=v,t.getColumn(2).alignment=v,t.getColumn(3).alignment=v,t.getColumn(4).alignment=v,t.getColumn(5).alignment=v,t.getColumn(6).alignment=v,t.getColumn(7).alignment=v,t.getCell("D1").alignment=l,t.getCell("D2").alignment=l,t.getCell("D4").alignment=l,t.getCell("A5").alignment=i,t.getCell("C7").border=o,t.getCell("D7").border=o,t.getCell("E7").border=o,t.getCell("C8").border=o,t.getCell("D8").border=o,t.getCell("E8").border=o,t.getCell("A10").border=o,t.getCell("B10").border=o,t.getCell("C10").border=o,t.getCell("D10").border=o,t.getCell("G10").border=o,t.getCell("D11").border=o,t.getCell("E11").border=o,t.getCell("F11").border=o;let p=11;for(const y of m.value)if(y.days.length>1)y.days.forEach(E=>{let _=[y.jobTitle,y.name,y.code,E.count,E.dateStart,E.dateEnd,E.note];const ce=t.addRow(_);ce.border=o,p++}),t.mergeCells(`A${p-y.days.length+1}:A${p}`),t.mergeCells(`B${p-y.days.length+1}:B${p}`),t.mergeCells(`C${p-y.days.length+1}:C${p}`);else{let E=[y.jobTitle,y.name,y.code,y.days[0].count,y.days[0].dateStart,y.days[0].dateEnd,y.days[0].note];const _=t.addRow(E);_.border=o,p++}const k="export_"+B.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",w=await a.xlsx.writeBuffer();me.saveAs(new Blob([w]),k),M.value=!1};return u.group&&(C.value[0]=u.group),U(),(a,t)=>{const i=e.resolveComponent("el-radio-button"),o=e.resolveComponent("el-radio-group"),v=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Ve,[r.checkEdit?(e.openBlock(),e.createBlock(e.unref(s.ElSelect),{key:0,modelValue:C.value,"onUpdate:modelValue":t[0]||(t[0]=l=>C.value=l),multiple:"","collapse-tags":"","collapse-tags-tooltip":"",placeholder:"Select",style:{width:"240px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.value,l=>(e.openBlock(),e.createBlock(e.unref(s.ElOption),{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),r.checkEdit?(e.openBlock(),e.createBlock(e.unref(s.ElButton),{key:1,plain:"",onClick:t[1]||(t[1]=l=>D.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("workSchedule.jobTitle")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(s.ElSelect),{modelValue:c.value,"onUpdate:modelValue":t[2]||(t[2]=l=>c.value=l),onChange:U,placeholder:"Year",style:{width:"80px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(V),l=>(e.openBlock(),e.createBlock(e.unref(s.ElOption),{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),e.createVNode(o,{modelValue:h.value,"onUpdate:modelValue":t[3]||(t[3]=l=>h.value=l)},{default:e.withCtx(()=>[e.createVNode(i,{label:e.unref(n)("vacationSchedule.currentTable.1"),value:1},null,8,["label"]),e.createVNode(i,{label:e.unref(n)("vacationSchedule.currentTable.2"),value:2},null,8,["label"])]),_:1},8,["modelValue"]),t[19]||(t[19]=e.createElementVNode("div",{class:"expander"},null,-1)),e.createVNode(e.unref(s.ElSwitch),{modelValue:T.value,"onUpdate:modelValue":t[4]||(t[4]=l=>T.value=l),"active-text":a.$t("vacationSchedule.currentHeight"),"active-value":"100%","inactive-value":"calc(100vh - var(--el-component-size)*5 - var(--el-main-padding)*2 - var(--header-height))"},null,8,["modelValue","active-text"])]),e.createElementVNode("div",Ne,[h.value===1?(e.openBlock(),e.createBlock(e.unref(s.ElTable),{key:0,id:"printTable",data:S.value,"span-method":ae,onCellClick:J,border:"",style:{width:"100%"},size:"small","empty-text":e.unref(n)("vacationSchedule.emptyText")},{default:e.withCtx(()=>[e.createVNode(e.unref(s.ElTableColumn),{label:C.value!=="all"?e.unref(n)("vacationSchedule.title",{name:C.value[0]}):e.unref(n)("vacationSchedule.enterprise")+` ${c.value}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(s.ElTableColumn),{label:e.unref(n)("vacationSchedule.jobTitle"),width:"180",align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(S.value[l.$index].jobTitle),1)]),_:1},8,["label"]),e.createVNode(e.unref(s.ElTableColumn),{label:e.unref(n)("vacationSchedule.fullName"),width:"180",align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(S.value[l.$index].name),1)]),_:1},8,["label"]),e.createVNode(e.unref(s.ElTableColumn),{label:e.unref(n)("vacationSchedule.personnelNumber"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(S.value[l.$index].code),1)]),_:1},8,["label"]),e.createVNode(e.unref(s.ElTableColumn),{label:e.unref(n)("vacationSchedule.vacation"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(s.ElTableColumn),{label:e.unref(n)("vacationSchedule.days"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(S.value[l.$index].count),1)]),_:1},8,["label"]),e.createVNode(e.unref(s.ElTableColumn),{label:e.unref(n)("vacationSchedule.date"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(S.value[l.$index].dateStart),1)]),_:1},8,["label"]),e.createVNode(e.unref(s.ElTableColumn),{label:e.unref(n)("vacationSchedule.endDate"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(S.value[l.$index].dateEnd),1)]),_:1},8,["label"])]),_:1},8,["label"]),e.createVNode(e.unref(s.ElTableColumn),{label:e.unref(n)("vacationSchedule.note"),align:"center"},{default:e.withCtx(l=>[e.createVNode(e.unref(s.ElInput),{modelValue:m.value[S.value[l.$index].ids].days[S.value[l.$index].key].note,"onUpdate:modelValue":p=>m.value[S.value[l.$index].ids].days[S.value[l.$index].key].note=p,style:{width:"100%"},placeholder:" ",class:"noBorder",onBlur:p=>L(S.value[l.$index].ids)},null,8,["modelValue","onUpdate:modelValue","onBlur"])]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["data","empty-text"])):(e.openBlock(),e.createBlock(e.unref(s.ElTable),{key:1,data:ue.value,style:{width:"100%"},"max-height":T.value,onHeaderClick:te,onCellClick:J,size:"small","empty-text":e.unref(n)("sheet.emptyText"),"cell-class-name":K,align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(s.ElTableColumn),{label:"Календарь отпусков "+C.value.toString()+" за "+(h.value===3?Z(g.value)+" ":"")+c.value+"г.",align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(s.ElTableColumn),{prop:"employee",label:"Сотрудник",fixed:""}),h.value===2?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},e.renderList(12,l=>e.createVNode(e.unref(s.ElTableColumn),{key:l,label:Z(l),prop:`m${l}`},{default:e.withCtx(({row:p})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p[`m${l}`],(k,w)=>(e.openBlock(),e.createElementBlock("div",{key:w,class:"vacation-item"},e.toDisplayString(k.text),1))),128))]),_:2},1032,["label","prop"])),64)):e.createCommentVNode("",!0),h.value===3?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(new Date(c.value,g.value,0).getDate(),l=>(e.openBlock(),e.createBlock(e.unref(s.ElTableColumn),{key:l,label:l.toString(),align:"center",width:"40"},{default:e.withCtx(({row:p,columnIndex:k})=>[e.createElementVNode("div",null,[K({row:p,columnIndex:l})!==""?(e.openBlock(),e.createElementBlock("span",De,"ОТ")):e.createCommentVNode("",!0)])]),_:2},1032,["label"]))),128)):e.createCommentVNode("",!0)]),_:1},8,["label"])]),_:1},8,["data","max-height","empty-text"]))]),r.checkEdit?(e.openBlock(),e.createElementBlock("div",Be,[j.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(s.ElButton),{key:0,type:"primary",onClick:t[5]||(t[5]=l=>$.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.sendInformation")),1)]),_:1})),r.query==="confirm"?(e.openBlock(),e.createBlock(e.unref(s.ElButton),{key:1,type:"primary",onClick:t[6]||(t[6]=l=>X(!0))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.agreeOn")),1)]),_:1})):e.createCommentVNode("",!0),r.query==="confirm"?(e.openBlock(),e.createBlock(e.unref(s.ElButton),{key:2,type:"primary",onClick:t[7]||(t[7]=l=>X(!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(s.ElButton),{disabled:M.value,plain:"",onClick:se,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[v,M.value]]),e.createVNode(e.unref(s.ElDialog),{title:e.unref(n)("workSchedule.jobTitle"),modelValue:D.value,"onUpdate:modelValue":t[10]||(t[10]=l=>D.value=l),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(s.ElButton),{onClick:t[8]||(t[8]=l=>D.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(s.ElButton),{size:"default",type:"primary",onClick:t[9]||(t[9]=l=>{G(),D.value=!1})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(s.ElForm),{model:b.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,l=>(e.openBlock(),e.createBlock(e.unref(s.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(s.ElSwitch),{modelValue:l.val,"onUpdate:modelValue":p=>l.val=p,"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(s.ElDialog),{title:e.unref(n)("vacationSchedule.pleaseCoordinate"),modelValue:$.value,"onUpdate:modelValue":t[13]||(t[13]=l=>$.value=l),width:"500px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(s.ElButton),{onClick:t[12]||(t[12]=l=>$.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(s.ElButton),{size:"default",type:"primary",onClick:ie},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.send")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(s.ElForm),{model:q.value,autocomplete:"on"},{default:e.withCtx(()=>[e.createVNode(e.unref(s.ElSelect),{modelValue:q.value.participants,"onUpdate:modelValue":t[11]||(t[11]=l=>q.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(R.value,l=>(e.openBlock(),e.createBlock(e.unref(s.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(P.ContextMenu),{show:N.value,"onUpdate:show":t[18]||(t[18]=l=>N.value=l),options:A.value},{default:e.withCtx(()=>[e.createVNode(e.unref(P.ContextMenuItem),{label:h.value.value>1||d.value.level===3&&typeof d.value.count<"u"?d.value.name+" "+d.value.count+" "+e.unref(n)("vacationSchedule.day",d.value.count)+` ${e.unref(n)("vacationSchedule.from")}: ${d.value.allCount()+parseInt(d.value.count)}`:d.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(P.ContextMenuSeparator)),d.value.level===2&&h.value===1?(e.openBlock(),e.createElementBlock("div",Te,[d.value.length>1?(e.openBlock(),e.createBlock(e.unref(P.ContextMenuItem),{key:0,label:e.unref(n)("vacationSchedule.deleteLast"),onClick:t[14]||(t[14]=l=>Y("delete",d.value.key))},null,8,["label"])):e.createCommentVNode("",!0),d.value.add?(e.openBlock(),e.createBlock(e.unref(P.ContextMenuItem),{key:1,label:e.unref(n)("vacationSchedule.addVacation"),onClick:t[15]||(t[15]=l=>Y("add"))},null,8,["label"])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",$e,[e.createVNode(e.unref(f),{data:d.value,range:"range",limitation:de(),onInput:oe},null,8,["data","limitation"]),e.createElementVNode("div",_e,[d.value.startDate?(e.openBlock(),e.createBlock(e.unref(s.ElButton),{key:0,onClick:t[16]||(t[16]=l=>Y("delete"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.delete")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(s.ElButton),{onClick:t[17]||(t[17]=l=>N.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(s.ElButton),{onClick:re},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.save")),1)]),_:1})])]))]),_:1},8,["show","options"])],64)}}};exports.J=ke;exports.L=ye;exports.U=Se;exports.V=Ce;exports._sfc_main=Pe;exports.g=F;
|
|
@@ -145,7 +145,7 @@ const Qe = ["href"], de = {
|
|
|
145
145
|
default: tt
|
|
146
146
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
147
147
|
document.querySelector("div.sw-alert-wrapper");
|
|
148
|
-
const we = /* @__PURE__ */ Object.assign({ "./components/SwAlert.vue": () => Promise.resolve().then(() => lt), "./components/SwButton.vue": () => import("./SwButton-85-tKHA7-D0loTJgt.js"), "./components/SwCollapse.vue": () => import("./SwCollapse-CuN3EbT6-Bp57Ya_9.js"), "./components/SwDatePicker.vue": () => import("./SwDatePicker-C-UmCyTm-
|
|
148
|
+
const we = /* @__PURE__ */ Object.assign({ "./components/SwAlert.vue": () => Promise.resolve().then(() => lt), "./components/SwButton.vue": () => import("./SwButton-85-tKHA7-D0loTJgt.js"), "./components/SwCollapse.vue": () => import("./SwCollapse-CuN3EbT6-Bp57Ya_9.js"), "./components/SwDatePicker.vue": () => import("./SwDatePicker-C-UmCyTm-B2cLQbrd.js"), "./components/SwDropdown.vue": () => import("./SwDropdown-DQGTnnKw-CJPDuCfV.js"), "./components/SwDropdownItem.vue": () => import("./SwDropdownItem-Db2TXRVI-BTVxTD5o.js"), "./components/SwDropdownNew.vue": () => import("./SwDropdownNew-CYfjZFd2-nlDq08DL.js"), "./components/SwFormItem.vue": () => import("./SwFormItem-CaA4jsoa-6C3zw4iZ.js"), "./components/SwGide.vue": () => import("./SwGide-Bv05X9FW-BffDNxEd.js"), "./components/SwIcon.vue": () => Promise.resolve().then(() => et), "./components/SwInput.vue": () => import("./SwInput-B1hD3QYw-DbBfWvIh.js"), "./components/SwMessage.vue": () => import("./SwMessage-D24ZbJyd-DYlO9Avo.js"), "./components/SwSection.vue": () => import("./SwSection-D8ooQ21I-DkmOwvIl.js"), "./components/SwSelect.vue": () => import("./SwSelect-C2RKinez-BD70YvFF.js"), "./components/SwSkeleton.vue": () => import("./SwSkeleton-B7ysp8L9-DnocmEnE.js"), "./components/SwSkeletonItem.vue": () => import("./SwSkeletonItem-CU7LvihY-DdKyY6kY.js"), "./components/SwSlider.vue": () => import("./SwSlider-B8ah3WJf-BgnlLKrg.js"), "./components/SwSwitch.vue": () => import("./SwSwitch-6rl1IT4p-Cq2vi3fZ.js"), "./components/SwTable.vue": () => import("./SwTable-BKZ5idCi-DEX2rFo2.js"), "./components/SwTableColumn.vue": () => import("./SwTableColumn-BLF5bPuJ-CHI10OyO.js"), "./components/SwTabs.vue": () => import("./SwTabs-DkSI4oAh-VaIFmFrU.js"), "./components/SwTabsPane.vue": () => import("./SwTabsPane-Dwtj8g7T-Dpg9j8nR.js") }), ke = {};
|
|
149
149
|
for (const u in we) {
|
|
150
150
|
const h = u.split("/").pop().replace(".vue", "").replace(/-(\w)/g, (c, a) => a.toUpperCase());
|
|
151
151
|
ke[h] = Ae(() => we[u]());
|
|
@@ -245,7 +245,7 @@ const at = { class: "nav" }, nt = { class: "vacation-calendar" }, ot = { key: 0
|
|
|
245
245
|
};
|
|
246
246
|
}, ce = (l, e, r, o) => {
|
|
247
247
|
var v;
|
|
248
|
-
if (console.log("coMenu", l, e, r, o), d.value.ids = l.ids, d.value.key = l.key
|
|
248
|
+
if (console.log("coMenu", l, e, r, o), d.value.ids = l.ids, d.value.key = typeof l.key > "u" ? g.value[l.ids].days.length : l.key, d.value.startDate = l.dateStart, d.value.endDate = l.dateEnd, d.value.name = S.value > 1 ? l.employee : l.name, d.value.count = l.count, d.value.length = ((v = l.days) == null ? void 0 : v.length) || 0, d.value.allCount = () => l.days.length === 0 ? 0 : l.days.reduce((t, f, T) => T !== l.key ? t + parseInt(f.count) : t, 0), d.value.add = d.value.length > 0 && l.days[l.days.length - 1].count, d.value.level = e.level, d.value.holiday = se.value, X.value.y = o.clientY, X.value.x = o.clientX, S.value === 1 && e.level === 2 && e.no < 4 && (d.value.add || l.days.length > 1) && (z.value = !0), e.level === 3 && (z.value = !0), S.value > 1 && e.level === 2 && e.no > 0)
|
|
249
249
|
if (S.value > 2) {
|
|
250
250
|
d.value.firstDate = `${e.no.toString().length === 1 ? "0" + e.no : e.no}-${y.value.toString().length === 1 ? "0" + y.value : y.value}-${i.value}`, console.log("firstDate", d.value.firstDate);
|
|
251
251
|
const t = new Date(i.value, y.value - 1, e.no), f = g.value[d.value.ids];
|
|
@@ -290,9 +290,7 @@ const at = { class: "nav" }, nt = { class: "vacation-calendar" }, ot = { key: 0
|
|
|
290
290
|
const v = [];
|
|
291
291
|
let t = new Date(r);
|
|
292
292
|
for (; t <= o; ) {
|
|
293
|
-
const f = t.getMonth() + 1, T = t.getFullYear()
|
|
294
|
-
new Date(T, t.getMonth(), 1);
|
|
295
|
-
const V = new Date(T, t.getMonth() + 1, 0), b = t < r ? r : t, A = V > o ? o : V, q = `${ve(b)}-${ve(A)}`;
|
|
293
|
+
const f = t.getMonth() + 1, T = t.getFullYear(), V = new Date(T, t.getMonth() + 1, 0), b = t < r ? r : t, A = V > o ? o : V, q = `${ve(b)}-${ve(A)}`;
|
|
296
294
|
v.push({ month: f, text: q }), t = new Date(T, t.getMonth() + 1, 1);
|
|
297
295
|
}
|
|
298
296
|
return v;
|
package/dist/VacationTable.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("vue");require("vue-i18n");require("./index-Dn3djtwj.cjs");const e=require("./VacationTable-
|
|
1
|
+
"use strict";require("vue");require("vue-i18n");require("./index-Dn3djtwj.cjs");const e=require("./VacationTable-BmcxmYjS.cjs");require("file-saver");require("exceljs");require("element-plus");require("@imengyu/vue3-context-menu");module.exports=e._sfc_main;
|
package/dist/VacationTable.js
CHANGED
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),ve=require("vue-i18n"),B=require("./index-Dn3djtwj.cjs"),me=require("file-saver"),pe=require("exceljs"),s=require("element-plus"),P=require("@imengyu/vue3-context-menu");function fe(r){const f=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const u in r)if(u!=="default"){const n=Object.getOwnPropertyDescriptor(r,u);Object.defineProperty(f,u,n.get?n:{enumerable:!0,get:()=>r[u]})}}return f.default=r,Object.freeze(f)}const ge=fe(pe);function he(r){return/^(https?:|mailto:|tel:)/.test(r)}function ye(r,f){if(arguments.length===0||!r)return null;const u=f||"{Y}-{m}-{d} {G}:{i}:{s}";let n;typeof r=="object"?n=r:(typeof r=="string"&&(/^[0-9]+$/.test(r)?r=parseInt(r):r=r.replace(new RegExp(/-/gm),"/")),typeof r=="number"&&r.toString().length===10&&(r=r*1e3),n=new Date(r));const x="ru-RU",m={Y:n.getFullYear(),m:(n.getMonth()+1).toString().padStart(2,"0"),d:n.getDate(),dd:n.getDate().toString().padStart(2,"0"),G:n.getHours(),H:n.getHours().toString().padStart(2,"0"),i:n.getMinutes().toString().padStart(2,"0"),s:n.getSeconds().toString().padStart(2,"0"),D:new Intl.DateTimeFormat(x,{weekday:"short"}).format(n),F:new Intl.DateTimeFormat(x,{month:"long"}).format(n),M:new Intl.DateTimeFormat(x,{month:"short"}).format(n)};return u.replace(/{(dd|[YmdGHisDFM])+}/g,(c,V)=>m[V])}function Se(r){let f=r.split(r.match(/\D.*?\D?/));return f[0].length>2?f.join("-")+"T00:00:01":f.reverse().join("-")+"T00:00:01"}function Ce(r,f){if(/^\+[0-9]\s/.test(f)&&r.length===2||/^\+0\s/.test(r))return"";if(typeof r>"u"||r.length===0)return r;const u="+0 (___) ___-__-__";let n=0;const x=u.replace(/\D/g,""),m=r.replace(/\D/g,"");let c=u.replace(/[_\d]/g,b=>n<m.length?m.charAt(n++)||x.charAt(n):b);n=c.indexOf("_"),n!==-1&&(n=n<5?3:n,c=c.slice(0,n));let V=u.slice(0,r.length).replace(/_+/g,b=>`\\d{1,${b.length}}`).replace(/[+()]/g,"\\$&");return V=new RegExp(`^${V}$`),c=c.replace(/[-—]$|(\) )$/g,""),!V.test(r)||r.length<5?c:r}function ke(r,f=!1){const u=r.getBoundingClientRect();return f?u.left>50?{right:"100%",marginRight:"10px"}:{left:"100%",marginLeft:"10px"}:{bottom:"100%",marginBottom:"10px"}}const we=["href"],F={__name:"SwIcon",props:{prefix:{type:String,default:"icon"},iconClass:{type:String,required:!0},className:{type:String,default:""}},setup(r){const f=r,u=he(f.iconClass);return(n,x)=>e.unref(u)?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:0,style:"mask: url("+f.iconClass+") no-repeat 50% 50%;",class:"svg-external-icon svg-icon"},n.$attrs),null,16)):(e.openBlock(),e.createElementBlock("svg",e.mergeProps({key:1,class:"svg-icon icon-"+(f.className||f.iconClass),"aria-hidden":"true"},n.$attrs),[e.createElementVNode("use",{href:"#"+f.prefix+"-"+f.iconClass},null,8,we)],16))}},be=Object.freeze(Object.defineProperty({__proto__:null,default:F},Symbol.toStringTag,{value:"Module"})),xe={__name:"SwAlert",props:{message:{type:String,default:"Default message"},before:{type:String,default:""},class:{type:String,default:""},after:{type:String,default:""},size:{type:String,default:""},duration:{type:Number,default:6e3},type:{type:String,default:"info",validator:r=>["success","warning","error","info"].includes(r)}},emits:["closed"],setup(r,{emit:f}){const u=r,n=f,x=e.ref(!1);let m=null;const c=()=>{document.querySelector(".sw-alert-wrapper").togglePopover(),x.value=!0,document.querySelector(".sw-alert-wrapper").showPopover(),h()},V=()=>{x.value=!1,n("closed")},b=()=>{m&&(clearTimeout(m),m=null)},T=()=>{h()},h=()=>{m=setTimeout(V,u.duration)};e.onMounted(()=>{c()}),e.onUnmounted(()=>{m&&clearTimeout(m)});const D=e.computed(()=>{const g=["sw-alert"];return u.size.length>0&&g.push(`sw-${u.size}`),u.type.length>0&&g.push(`sw-${u.type}`),u.class.length>0&&g.push(u.class),g});return(g,j)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade"},{default:e.withCtx(()=>[x.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(D.value),onMouseenter:b,onMouseleave:T},[u.before.length>0?(e.openBlock(),e.createBlock(F,{key:0,"icon-class":u.before},null,8,["icon-class"])):e.renderSlot(g.$slots,"prefix",{key:1}),e.renderSlot(g.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(u.message),1)]),u.after.length>0?(e.openBlock(),e.createBlock(F,{key:2,"icon-class":u.after,onClick:V},null,8,["icon-class"])):e.renderSlot(g.$slots,"suffix",{key:3}),e.createElementVNode("footer",null,[e.renderSlot(g.$slots,"footer")])],34)):e.createCommentVNode("",!0)]),_:3}))}},Ee=Object.freeze(Object.defineProperty({__proto__:null,default:xe},Symbol.toStringTag,{value:"Module"}));document.querySelector("div.sw-alert-wrapper");const Q=Object.assign({"./components/SwAlert.vue":()=>Promise.resolve().then(()=>Ee),"./components/SwButton.vue":()=>Promise.resolve().then(()=>require("./SwButton-85-tKHA7-BpZ2q9aj.cjs")),"./components/SwCollapse.vue":()=>Promise.resolve().then(()=>require("./SwCollapse-CuN3EbT6-1y2PMRQ8.cjs")),"./components/SwDatePicker.vue":()=>Promise.resolve().then(()=>require("./SwDatePicker-C-UmCyTm-CTOiwZL1.cjs")),"./components/SwDropdown.vue":()=>Promise.resolve().then(()=>require("./SwDropdown-DQGTnnKw-BltvlnsL.cjs")),"./components/SwDropdownItem.vue":()=>Promise.resolve().then(()=>require("./SwDropdownItem-Db2TXRVI-DHp91ADz.cjs")),"./components/SwDropdownNew.vue":()=>Promise.resolve().then(()=>require("./SwDropdownNew-CYfjZFd2-DIv6p-6i.cjs")),"./components/SwFormItem.vue":()=>Promise.resolve().then(()=>require("./SwFormItem-CaA4jsoa-MFTEfPiY.cjs")),"./components/SwGide.vue":()=>Promise.resolve().then(()=>require("./SwGide-Bv05X9FW-BTqybd7p.cjs")),"./components/SwIcon.vue":()=>Promise.resolve().then(()=>be),"./components/SwInput.vue":()=>Promise.resolve().then(()=>require("./SwInput-B1hD3QYw-DaqUVUBC.cjs")),"./components/SwMessage.vue":()=>Promise.resolve().then(()=>require("./SwMessage-D24ZbJyd-hmjlb3jg.cjs")),"./components/SwSection.vue":()=>Promise.resolve().then(()=>require("./SwSection-D8ooQ21I-Nsa_5V1p.cjs")),"./components/SwSelect.vue":()=>Promise.resolve().then(()=>require("./SwSelect-C2RKinez-KweWYzRe.cjs")),"./components/SwSkeleton.vue":()=>Promise.resolve().then(()=>require("./SwSkeleton-B7ysp8L9-RJwRbv_K.cjs")),"./components/SwSkeletonItem.vue":()=>Promise.resolve().then(()=>require("./SwSkeletonItem-CU7LvihY-BJmW7U8Z.cjs")),"./components/SwSlider.vue":()=>Promise.resolve().then(()=>require("./SwSlider-B8ah3WJf-eotQC_I3.cjs")),"./components/SwSwitch.vue":()=>Promise.resolve().then(()=>require("./SwSwitch-6rl1IT4p-BQTT__wH.cjs")),"./components/SwTable.vue":()=>Promise.resolve().then(()=>require("./SwTable-BKZ5idCi-BMDZ1otG.cjs")),"./components/SwTableColumn.vue":()=>Promise.resolve().then(()=>require("./SwTableColumn-BLF5bPuJ-CbuAoznO.cjs")),"./components/SwTabs.vue":()=>Promise.resolve().then(()=>require("./SwTabs-DkSI4oAh-By6KQ_XO.cjs")),"./components/SwTabsPane.vue":()=>Promise.resolve().then(()=>require("./SwTabsPane-Dwtj8g7T-BUCrffEQ.cjs"))}),ee={};for(const r in Q){const f=r.split("/").pop().replace(".vue","").replace(/-(\w)/g,(u,n)=>n.toUpperCase());ee[f]=e.defineAsyncComponent(()=>Q[r]())}const Ve={class:"nav"},Ne={class:"vacation-calendar"},De={key:0},Be={key:0,class:"controls-container",style:{"margin-top":".5rem"}},Te={key:0},$e={key:1,style:{padding:"0 1rem .5rem"}},_e={style:{padding:".5rem 0 0"}},Pe={__name:"VacationTable",props:{odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"},query:String,checkEdit:{type:Boolean,default:!1}},setup(r){const{SwDatePicker:f}=ee,u=r,{t:n,d:x}=ve.useI18n(),m=e.ref([]),c=e.ref(new Date().getFullYear()),V=new Date().getMonth()>10?[{value:c.value,label:c.value},{value:c.value+1,label:c.value+1}]:[{value:c.value-1,label:c.value-1},{value:c.value,label:c.value}],b=e.ref([]),T=e.ref("100%"),h=e.ref(1),D=e.ref(!1),g=e.ref(1),j=e.ref(!1),N=e.ref(!1),A=e.ref({zIndex:3,minWidth:230,x:500,y:200}),$=e.ref(!1),q=e.ref({participants:[]}),R=e.ref([]),H=e.ref([]),C=e.ref([]),z=e.ref([{value:"all",label:n("vacationSchedule.all"),key:"all"}]),M=e.ref(!1),O=e.ref(!1),d=e.ref({name:"",length:0,code:""}),U=async()=>{u.odata.getEmployee(c.value-1+"-12-17T23:59:00").then(a=>{var t,i;return C.value.length===0?C.value=[(t=a.find(o=>o.employeeName===u.fullName))==null?void 0:t.divisionName]:C.value=C.value.includes("all")||a.some(o=>C.value.includes(o.divisionName))?C.value:[(i=a.find(o=>o.employeeName===u.fullName))==null?void 0:i.divisionName],a.forEach(o=>{z.value.some(v=>(v==null?void 0:v.value)===o.divisionName)||z.value.push({value:o.divisionName,label:o.divisionName,key:o.divisionName})}),G(),!0})};e.watch(C,async(a,t)=>{a!==t&&(b.value=[],j.value=!1,u.odata.employee.forEach(i=>{(a.includes(i.divisionName)||a.includes("all"))&&(b.value.some(o=>(o==null?void 0:o.activeText)===i.roleName)||b.value.push({val:!0,activeText:i.roleName}))}),G())});const te=(a,t)=>{console.log("event",t),console.log("column",a),a.level===2&&a.no>0&&h.value===2&&(h.value=3,g.value=a.no)},G=()=>{m.value=[];let a=[];u.odata.employee.forEach(t=>{(C.value.includes(t.divisionName)||C.value.includes("all"))&&b.value.some(i=>i.val&&i.activeText===t.roleName)&&(a.push(t.employeeKey),m.value.push({name:t.employeeName,days:[{note:""}],jobTitle:t.roleName,code:t.employeeKey}))}),le(a),D.value=!1},le=a=>{u.workSchedule.getAllVacations({year:c.value}).then(t=>{a.forEach((i,o)=>{m.value[o].days=[{note:""}],t.forEach(v=>{i===v.code&&(typeof m.value[o].days[0].dateStart>"u"?m.value[o].days[0]={dateStart:B.parseTime(v.dateStart,"{dd}.{m}.{Y}"),dateEnd:B.parseTime(v.dateEnd,"{dd}.{m}.{Y}"),note:v.note,count:v.count}:m.value[o].days.push({dateStart:B.parseTime(v.dateStart,"{dd}.{m}.{Y}"),dateEnd:B.parseTime(v.dateEnd,"{dd}.{m}.{Y}"),note:v.note,count:v.count}))})})})},ae=a=>{if(a.columnIndex<3&&S.value[a.rowIndex].key<S.value[a.rowIndex].days.length)return S.value[a.rowIndex].key===0?{rowspan:S.value[a.rowIndex].days.length,colspan:1}:{rowspan:0,colspan:0}},J=(a,t,i,o)=>{var v;if(console.log("coMenu",a,t,i,o),d.value.ids=a.ids,d.value.key=a.key||m.value[a.ids].days.length,d.value.startDate=a.dateStart,d.value.endDate=a.dateEnd,d.value.name=h.value>1?a.employee:a.name,d.value.count=a.count,d.value.length=((v=a.days)==null?void 0:v.length)||0,d.value.allCount=()=>a.days.length===0?0:a.days.reduce((l,p,k)=>k!==a.key?l+parseInt(p.count):l,0),d.value.add=d.value.length>0&&a.days[a.days.length-1].count,d.value.level=t.level,d.value.holiday=H.value,A.value.y=o.clientY,A.value.x=o.clientX,h.value===1&&t.level===2&&t.no<4&&(d.value.add||a.days.length>1)&&(N.value=!0),t.level===3&&(N.value=!0),h.value>1&&t.level===2&&t.no>0)if(h.value>2){d.value.firstDate=`${t.no.toString().length===1?"0"+t.no:t.no}-${g.value.toString().length===1?"0"+g.value:g.value}-${c.value}`,console.log("firstDate",d.value.firstDate);const l=new Date(c.value,g.value-1,t.no),p=m.value[d.value.ids];if(p&&p.days)for(let k=0;k<p.days.length;k++){const w=p.days[k];if(w.dateStart&&w.dateEnd){const y=I(w.dateStart),E=I(w.dateEnd);if(y&&E&&l>=y&&l<=E){d.value.startDate=w.dateStart,d.value.endDate=w.dateEnd,d.value.key=k;break}}}N.value=!0}else h.value===2&&a[`m${t.no}`].length>0?(g.value=t.no,h.value=3):(d.value.firstDate=`01-${t.no.toString().length===1?"0"+t.no:t.no}-${c.value}`,N.value=!0)};function I(a){if(!a)return null;const t=a.split(".");if(t.length!==3)return null;const[i,o,v]=t.map(Number);return new Date(v,o-1,i)}function W(a){const t=String(a.getDate()).padStart(2,"0"),i=String(a.getMonth()+1).padStart(2,"0");return`${t}.${i}`}const K=({row:a,columnIndex:t})=>{var o;if(h.value!==3||t===0||((o=a[`m${g.value}`])==null?void 0:o.length)===0)return"";const i=new Date(c.value,g.value,t).getTime()+1e3;for(let v of a[`m${g.value}`]){const l=new Date(c.value,v.text.split("-")[0].split(".")[1],v.text.split("-")[0].split(".")[0]).getTime(),p=new Date(c.value,v.text.split("-")[1].split(".")[1],v.text.split("-")[1].split(".")[0],23,59,59).getTime();if(i>=l&&i<=p)return"vacation"}return""};function ne(a,t){const i=I(a),o=I(t);if(!i||!o||o<i)return[];const v=[];let l=new Date(i);for(;l<=o;){const p=l.getMonth()+1,k=l.getFullYear();new Date(k,l.getMonth(),1);const w=new Date(k,l.getMonth()+1,0),y=l<i?i:l,E=w>o?o:w,_=`${W(y)}-${W(E)}`;v.push({month:p,text:_}),l=new Date(k,l.getMonth()+1,1)}return v}const Y=(a,t=!1)=>{let i=m.value[d.value.ids];switch(a){case"add":i.days.push({note:""}),console.log(i.days.length);break;case"delete":t?delete i.days[t]:i.days.pop(),L(d.value.ids);break}N.value=!1},oe=a=>{O.value=a,d.value.count=a.count},re=()=>{O.value&&(m.value[d.value.ids].days[d.value.key]={...O.value,note:""},L(d.value.ids)),N.value=!1},L=a=>{u.workSchedule.rewriteFull({year:c.value,code:m.value[a].code,data:m.value[a].days.map(t=>({dateStart:t.dateStart.split(".").reverse().join("-"),dateEnd:t.dateEnd.split(".").reverse().join("-"),note:t.note,count:t.count}))})},X=a=>{u.workSchedule.sendConfirmMessage({fullname:u.fullName,confirm:a}),u.query=""};function Z(a){return new Date(2025,a-1,1).toLocaleString("ru",{month:"long"})}const S=e.computed(()=>m.value.flatMap((a,t)=>!a.days||a.days.length===0?[{...a,key:0,ids:t}]:a.days.map((i,o)=>({ids:t,key:o,...a,...i})))),ue=e.computed(()=>m.value.map((a,t)=>{const i={employee:B.byInitials(a.name),code:a.code,ids:t};for(let o=1;o<=12;o++)i[`m${o}`]=[];return a.days.forEach(o=>{if(!o.dateStart||!o.dateEnd)return;ne(o.dateStart,o.dateEnd).forEach(l=>{l.month>=1&&l.month<=12&&i[`m${l.month}`].push({text:l.text,count:o.count,dateStart:o.dateStart,dateEnd:o.dateEnd})})}),i})),ie=()=>{u.workSchedule.sendAgreementMessage({users:q.value.participants}),$.value=!1};u.workSchedule.getBoss().then(a=>{R.value=a[0].users}),B.holidays().then(a=>{H.value=a,U()});const de=()=>d.value.length<2?[{dateStart:"01.01."+c.value,dateEnd:"31.12."+c.value}]:[{dateStart:"01.01."+c.value,dateEnd:"31.12."+c.value}],se=async()=>{M.value=!0;const a=new ge.Workbook,t=a.addWorksheet(c.value.toString(),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),i={vertical:"middle",horizontal:"center"},o={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},v={vertical:"middle",horizontal:"center",wrapText:!0},l={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:c.value-1}),t.getCell("D3").value=n("workSchedule.printPlace"),t.getCell("D4").value=n("vacationSchedule.dateApprove",{year:c.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=c.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=v,t.getColumn(2).alignment=v,t.getColumn(3).alignment=v,t.getColumn(4).alignment=v,t.getColumn(5).alignment=v,t.getColumn(6).alignment=v,t.getColumn(7).alignment=v,t.getCell("D1").alignment=l,t.getCell("D2").alignment=l,t.getCell("D4").alignment=l,t.getCell("A5").alignment=i,t.getCell("C7").border=o,t.getCell("D7").border=o,t.getCell("E7").border=o,t.getCell("C8").border=o,t.getCell("D8").border=o,t.getCell("E8").border=o,t.getCell("A10").border=o,t.getCell("B10").border=o,t.getCell("C10").border=o,t.getCell("D10").border=o,t.getCell("G10").border=o,t.getCell("D11").border=o,t.getCell("E11").border=o,t.getCell("F11").border=o;let p=11;for(const y of m.value)if(y.days.length>1)y.days.forEach(E=>{let _=[y.jobTitle,y.name,y.code,E.count,E.dateStart,E.dateEnd,E.note];const ce=t.addRow(_);ce.border=o,p++}),t.mergeCells(`A${p-y.days.length+1}:A${p}`),t.mergeCells(`B${p-y.days.length+1}:B${p}`),t.mergeCells(`C${p-y.days.length+1}:C${p}`);else{let E=[y.jobTitle,y.name,y.code,y.days[0].count,y.days[0].dateStart,y.days[0].dateEnd,y.days[0].note];const _=t.addRow(E);_.border=o,p++}const k="export_"+B.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",w=await a.xlsx.writeBuffer();me.saveAs(new Blob([w]),k),M.value=!1};return u.group&&(C.value[0]=u.group),U(),(a,t)=>{const i=e.resolveComponent("el-radio-button"),o=e.resolveComponent("el-radio-group"),v=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Ve,[r.checkEdit?(e.openBlock(),e.createBlock(e.unref(s.ElSelect),{key:0,modelValue:C.value,"onUpdate:modelValue":t[0]||(t[0]=l=>C.value=l),multiple:"","collapse-tags":"","collapse-tags-tooltip":"",placeholder:"Select",style:{width:"240px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.value,l=>(e.openBlock(),e.createBlock(e.unref(s.ElOption),{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),r.checkEdit?(e.openBlock(),e.createBlock(e.unref(s.ElButton),{key:1,plain:"",onClick:t[1]||(t[1]=l=>D.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("workSchedule.jobTitle")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(s.ElSelect),{modelValue:c.value,"onUpdate:modelValue":t[2]||(t[2]=l=>c.value=l),onChange:U,placeholder:"Year",style:{width:"80px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(V),l=>(e.openBlock(),e.createBlock(e.unref(s.ElOption),{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),e.createVNode(o,{modelValue:h.value,"onUpdate:modelValue":t[3]||(t[3]=l=>h.value=l)},{default:e.withCtx(()=>[e.createVNode(i,{label:e.unref(n)("vacationSchedule.currentTable.1"),value:1},null,8,["label"]),e.createVNode(i,{label:e.unref(n)("vacationSchedule.currentTable.2"),value:2},null,8,["label"])]),_:1},8,["modelValue"]),t[19]||(t[19]=e.createElementVNode("div",{class:"expander"},null,-1)),e.createVNode(e.unref(s.ElSwitch),{modelValue:T.value,"onUpdate:modelValue":t[4]||(t[4]=l=>T.value=l),"active-text":a.$t("vacationSchedule.currentHeight"),"active-value":"100%","inactive-value":"calc(100vh - var(--el-component-size)*5 - var(--el-main-padding)*2 - var(--header-height))"},null,8,["modelValue","active-text"])]),e.createElementVNode("div",Ne,[h.value===1?(e.openBlock(),e.createBlock(e.unref(s.ElTable),{key:0,id:"printTable",data:S.value,"span-method":ae,onCellClick:J,border:"",style:{width:"100%"},size:"small","empty-text":e.unref(n)("vacationSchedule.emptyText")},{default:e.withCtx(()=>[e.createVNode(e.unref(s.ElTableColumn),{label:C.value!=="all"?e.unref(n)("vacationSchedule.title",{name:C.value[0]}):e.unref(n)("vacationSchedule.enterprise")+` ${c.value}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(s.ElTableColumn),{label:e.unref(n)("vacationSchedule.jobTitle"),width:"180",align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(S.value[l.$index].jobTitle),1)]),_:1},8,["label"]),e.createVNode(e.unref(s.ElTableColumn),{label:e.unref(n)("vacationSchedule.fullName"),width:"180",align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(S.value[l.$index].name),1)]),_:1},8,["label"]),e.createVNode(e.unref(s.ElTableColumn),{label:e.unref(n)("vacationSchedule.personnelNumber"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(S.value[l.$index].code),1)]),_:1},8,["label"]),e.createVNode(e.unref(s.ElTableColumn),{label:e.unref(n)("vacationSchedule.vacation"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(s.ElTableColumn),{label:e.unref(n)("vacationSchedule.days"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(S.value[l.$index].count),1)]),_:1},8,["label"]),e.createVNode(e.unref(s.ElTableColumn),{label:e.unref(n)("vacationSchedule.date"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(S.value[l.$index].dateStart),1)]),_:1},8,["label"]),e.createVNode(e.unref(s.ElTableColumn),{label:e.unref(n)("vacationSchedule.endDate"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(S.value[l.$index].dateEnd),1)]),_:1},8,["label"])]),_:1},8,["label"]),e.createVNode(e.unref(s.ElTableColumn),{label:e.unref(n)("vacationSchedule.note"),align:"center"},{default:e.withCtx(l=>[e.createVNode(e.unref(s.ElInput),{modelValue:m.value[S.value[l.$index].ids].days[S.value[l.$index].key].note,"onUpdate:modelValue":p=>m.value[S.value[l.$index].ids].days[S.value[l.$index].key].note=p,style:{width:"100%"},placeholder:" ",class:"noBorder",onBlur:p=>L(S.value[l.$index].ids)},null,8,["modelValue","onUpdate:modelValue","onBlur"])]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["data","empty-text"])):(e.openBlock(),e.createBlock(e.unref(s.ElTable),{key:1,data:ue.value,style:{width:"100%"},"max-height":T.value,onHeaderClick:te,onCellClick:J,size:"small","empty-text":e.unref(n)("sheet.emptyText"),"cell-class-name":K,align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(s.ElTableColumn),{label:"Календарь отпусков "+C.value.toString()+" за "+(h.value===3?Z(g.value)+" ":"")+c.value+"г.",align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(s.ElTableColumn),{prop:"employee",label:"Сотрудник",fixed:""}),h.value===2?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},e.renderList(12,l=>e.createVNode(e.unref(s.ElTableColumn),{key:l,label:Z(l),prop:`m${l}`},{default:e.withCtx(({row:p})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p[`m${l}`],(k,w)=>(e.openBlock(),e.createElementBlock("div",{key:w,class:"vacation-item"},e.toDisplayString(k.text),1))),128))]),_:2},1032,["label","prop"])),64)):e.createCommentVNode("",!0),h.value===3?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(new Date(c.value,g.value,0).getDate(),l=>(e.openBlock(),e.createBlock(e.unref(s.ElTableColumn),{key:l,label:l.toString(),align:"center",width:"40"},{default:e.withCtx(({row:p,columnIndex:k})=>[e.createElementVNode("div",null,[K({row:p,columnIndex:l})!==""?(e.openBlock(),e.createElementBlock("span",De,"ОТ")):e.createCommentVNode("",!0)])]),_:2},1032,["label"]))),128)):e.createCommentVNode("",!0)]),_:1},8,["label"])]),_:1},8,["data","max-height","empty-text"]))]),r.checkEdit?(e.openBlock(),e.createElementBlock("div",Be,[j.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(s.ElButton),{key:0,type:"primary",onClick:t[5]||(t[5]=l=>$.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.sendInformation")),1)]),_:1})),r.query==="confirm"?(e.openBlock(),e.createBlock(e.unref(s.ElButton),{key:1,type:"primary",onClick:t[6]||(t[6]=l=>X(!0))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.agreeOn")),1)]),_:1})):e.createCommentVNode("",!0),r.query==="confirm"?(e.openBlock(),e.createBlock(e.unref(s.ElButton),{key:2,type:"primary",onClick:t[7]||(t[7]=l=>X(!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(s.ElButton),{disabled:M.value,plain:"",onClick:se,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[v,M.value]]),e.createVNode(e.unref(s.ElDialog),{title:e.unref(n)("workSchedule.jobTitle"),modelValue:D.value,"onUpdate:modelValue":t[10]||(t[10]=l=>D.value=l),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(s.ElButton),{onClick:t[8]||(t[8]=l=>D.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(s.ElButton),{size:"default",type:"primary",onClick:t[9]||(t[9]=l=>{G(),D.value=!1})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(s.ElForm),{model:b.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,l=>(e.openBlock(),e.createBlock(e.unref(s.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(s.ElSwitch),{modelValue:l.val,"onUpdate:modelValue":p=>l.val=p,"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(s.ElDialog),{title:e.unref(n)("vacationSchedule.pleaseCoordinate"),modelValue:$.value,"onUpdate:modelValue":t[13]||(t[13]=l=>$.value=l),width:"500px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(s.ElButton),{onClick:t[12]||(t[12]=l=>$.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(s.ElButton),{size:"default",type:"primary",onClick:ie},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.send")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(s.ElForm),{model:q.value,autocomplete:"on"},{default:e.withCtx(()=>[e.createVNode(e.unref(s.ElSelect),{modelValue:q.value.participants,"onUpdate:modelValue":t[11]||(t[11]=l=>q.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(R.value,l=>(e.openBlock(),e.createBlock(e.unref(s.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(P.ContextMenu),{show:N.value,"onUpdate:show":t[18]||(t[18]=l=>N.value=l),options:A.value},{default:e.withCtx(()=>[e.createVNode(e.unref(P.ContextMenuItem),{label:h.value.value>1||d.value.level===3&&typeof d.value.count<"u"?d.value.name+" "+d.value.count+" "+e.unref(n)("vacationSchedule.day",d.value.count)+` ${e.unref(n)("vacationSchedule.from")}: ${d.value.allCount()+parseInt(d.value.count)}`:d.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(P.ContextMenuSeparator)),d.value.level===2&&h.value===1?(e.openBlock(),e.createElementBlock("div",Te,[d.value.length>1?(e.openBlock(),e.createBlock(e.unref(P.ContextMenuItem),{key:0,label:e.unref(n)("vacationSchedule.deleteLast"),onClick:t[14]||(t[14]=l=>Y("delete",d.value.key))},null,8,["label"])):e.createCommentVNode("",!0),d.value.add?(e.openBlock(),e.createBlock(e.unref(P.ContextMenuItem),{key:1,label:e.unref(n)("vacationSchedule.addVacation"),onClick:t[15]||(t[15]=l=>Y("add"))},null,8,["label"])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",$e,[e.createVNode(e.unref(f),{data:d.value,range:"range",limitation:de(),onInput:oe},null,8,["data","limitation"]),e.createElementVNode("div",_e,[d.value.startDate?(e.openBlock(),e.createBlock(e.unref(s.ElButton),{key:0,onClick:t[16]||(t[16]=l=>Y("delete"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.delete")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(s.ElButton),{onClick:t[17]||(t[17]=l=>N.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(s.ElButton),{onClick:re},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("vacationSchedule.save")),1)]),_:1})])]))]),_:1},8,["show","options"])],64)}}};exports.J=ke;exports.L=ye;exports.U=Se;exports.V=Ce;exports._sfc_main=Pe;exports.g=F;
|