@studio-west/employees 0.4.5 → 0.4.6
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/package.json +1 -1
- package/dist/VacationTable.cjs +0 -1
- package/dist/VacationTable.js +0 -728
- package/dist/WorkTable.cjs +0 -3
- package/dist/WorkTable.js +0 -513
- package/dist/employees.css +0 -1
- package/dist/index-CHGzf-XH.cjs +0 -1
- package/dist/index-uVRk2ARj.js +0 -100
package/dist/WorkTable.cjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),ne=require("file-saver"),oe=require("exceljs"),g=require("./index-CHGzf-XH.cjs"),ue=require("vue-i18n"),i=require("element-plus"),q=require("@imengyu/vue3-context-menu");function re(y){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(y){for(const C in y)if(C!=="default"){const f=Object.getOwnPropertyDescriptor(y,C);Object.defineProperty(u,C,f.get?f:{enumerable:!0,get:()=>y[C]})}}return u.default=y,Object.freeze(u)}const ie=re(oe),de={style:{height:"100px",width:"100%",display:"inline-block"}},se={style:{height:"100px",width:"100%",display:"inline-block"}},ce={key:3,class:"controls-container",style:{"margin-top":".5rem"}},ve={key:0,style:{padding:"0.5em 1.5em"}},ge={key:1,style:{padding:"0.5em 1.5em"}},me={__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"}},setup(y){const{t:u,d:C}=ue.useI18n(),f=y,T=e.ref(!1),n=e.ref([]),M=e.ref("1"),w=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(M.value))),r=e.ref([]),E=e.ref(0),S=e.ref(9),p=e.ref(8),A=e.ref(!1),H=e.ref(!0),D=e.ref(!1),R=e.ref("5"),$=e.ref(1),x=e.ref("Сектор разработок и эксплуатации сети"),Y=e.ref([]),V=e.ref([]),s=e.ref({name:"Имя",length:0,code:""}),I=e.ref(!1),U=e.ref({zIndex:30,minWidth:220,x:500,y:200}),O=e.ref({});e.watch(x,async(a,l)=>{a!==l&&(V.value=[],A.value=!1,f.odata.personalManagerData.forEach(o=>{o.Status!=="Увольнение"&&o.Group===a&&(V.value.some(t=>(t==null?void 0:t.activeText)===o.Role)||V.value.push({val:!0,activeText:o.Role}))}),G())}),e.watch(M,async(a,l)=>{w.value=new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(a)),P()});const Z=(a,l,o,t)=>{s.value.ids=a.ids,s.value.key=a.key,s.value.add=a.days.length>0&&a.days[a.days.length-1].cont,s.value.level=l.level,s.value.day=o.cellIndex,U.value.y=t.clientY,U.value.x=t.clientX,l.level===2&&l.no===0&&f.checkEdit&&(s.value.name=u("workSchedule.autocomplete"),I.value=!0),l.level===3&&o.cellIndex-l.no===1&&f.checkEdit&&(b(o.cellIndex,a.ids),s.value.name=u("workSchedule.modeSelection"),I.value=!0)},P=()=>{const a=O.value,l=new Date(w.value),o=new Date(l.getFullYear(),l.getMonth()+1,0).getDate();let t=[],d=0;for(let m=1;m<=o;m++){const h=g.parseTime(l.setDate(m),"{Y}-{m}-{dd}");d+=a.nowork.includes(h)||a.holidays.includes(h)?0:a.preholidays.includes(h)?7:8;const c=a.nowork.includes(h)?"nowork":a.holidays.includes(h)?"holiday":a.preholidays.includes(h)?"preholiday":"";t.push({day:m,holidays:c,weekday:C(new Date(l.getFullYear(),l.getMonth(),m),"day")})}E.value=d,r.value=t,f.odata.getPersonalManagerData({}).then(m=>{var h;x.value=(h=m.find(c=>c.Status!=="Увольнение"&&c.Description===f.fullName))==null?void 0:h.Group,m.forEach(c=>{c.Status!=="Увольнение"&&(Y.value.some(k=>(k==null?void 0:k.value)===c.Group)||Y.value.push({value:c.Group,label:c.Group,key:c.Group}),c.Group===x.value&&!V.value.some(k=>(k==null?void 0:k.activeText)===c.Role)&&V.value.push({val:!0,activeText:c.Role}))}),G(),H.value=!1})},Q=e.computed(()=>!n.value.some(a=>a.contHour!==E.value)),W=(a,l)=>{var m,h,c;const o=new Date(w.value),t=`${o.getFullYear()}-${(o.getMonth()+1).toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}`,d=(m=n.value[l])==null?void 0:m.days.findIndex(k=>k.day===t);return l===-1||d===-1?"":((h=n.value[l].days[d])==null?void 0:h.time)+" "+((c=n.value[l].days[d])==null?void 0:c.tips)},G=()=>{n.value=[];let a=[];f.odata.personalManagerData.forEach(l=>{if(l.Status!=="Увольнение"&&l.Group===x.value&&V.value.some(o=>o.val&&o.activeText===l.Role)){let o=g.byInitials(l.Description);a.push(l.Code),n.value.push({name:o+" ("+l.Role+")",days:[],contHour:0,code:l.Code,id:!1,ids:n.value.length})}}),X(a),D.value=!1},X=a=>{f.workSchedule.getWorkSchedule({code:a,date:g.parseTime(new Date(w.value),"{Y}-{m}-{dd}")}).then(l=>{l.forEach((o,t)=>{o!==null&&(n.value[t].days=o.data.days,n.value[t].id=o.id)}),N()})},N=()=>{n.value.forEach(a=>{a.contHour=a.days.reduce((l,o)=>l+o.time,0)})},K=a=>{n.value[a].days=[],N()},_=a=>{switch(R.value){case"5":for(let l=$.value;l<=r.value.length;l++)r.value[l-1].holidays===""&&b(l,a,!0),r.value[l-1].holidays==="preholiday"&&(p.value-=1,b(l,a,!0),p.value+=1);break;case"2x2":for(let l=$.value;l<=r.value.length;l+=4)b(l,a,!0),l+1<=r.value.length&&b(l+1,a,!0);break;case"2x5":for(let l=$.value;l<=r.value.length;l+=7)for(let o=l;o<l+5&&o<=r.value.length;o++)r.value[o-1].holidays==="preholiday"?(p.value-=1,b(o,a,!0),p.value+=1):b(o,a,!0);break}},b=(a,l,o=!1)=>{const{date:t,ind:d}=z(a,l);d===-1?(n.value[l].days.push({day:t,time:p.value,tips:`(${S.value}:00 - ${S.value+p.value+1}:00)`}),N()):o||(p.value=n.value[l].days[d].time,S.value=parseInt(n.value[l].days[d].tips.slice(1,-12)))},ee=(a,l)=>{const{ind:o}=z(a,l);n.value[l].days.splice(o,1),N(),document.querySelector(".app-main").click()},L=(a,l)=>{const{date:o,ind:t}=z(a,l);n.value[l].days[t]={day:o,time:p.value,tips:`(${S.value}:00 - ${S.value+p.value+1}:00)`},N()},z=(a,l)=>{var d;const o=g.parseTime(new Date(w.value).setDate(a),"{Y}-{m}-{dd}"),t=(d=n.value[l])==null?void 0:d.days.findIndex(m=>m.day===o);return{date:o,ind:t}},le=async()=>{var J;T.value=!0;const a=new ie.Workbook,l=a.addWorksheet(C(w.value,"month"),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),o={vertical:"middle",horizontal:"center"},t={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},d={vertical:"middle",horizontal:"center",wrapText:!0};l.mergeCells(`A1:${g.cellsDynamically("A1",r.value.length+5)}1`),l.mergeCells(`A2:${g.cellsDynamically("A2",r.value.length+5)}2`),l.mergeCells("A3:A4"),l.mergeCells(`B3:${g.cellsDynamically("B3",r.value.length)}3`),l.mergeCells(`${g.cellsDynamically("B3",r.value.length+1)}3:${g.cellsDynamically("B3",r.value.length+2)}3`),l.mergeCells(`${g.cellsDynamically("B3",r.value.length+3)}3:${g.cellsDynamically("B4",r.value.length+3)}4`),l.mergeCells(`${g.cellsDynamically("B3",r.value.length+4)}3:${g.cellsDynamically("B4",r.value.length+4)}4`),l.getCell("A1").value=u("workSchedule.firm"),l.getCell("A2").value=u("workSchedule.title",{name:x.value})+C(w.value,"month")+` ${new Date(w.value).getFullYear()}`,l.getCell("A3").value=u("workSchedule.month"),l.getCell("B3").value=u("workSchedule.numbersMonth"),l.getCell(3,r.value.length+2).value=u("workSchedule.onSchedule"),l.getCell(3,r.value.length+4).value=u("workSchedule.acquainted"),l.getCell(3,r.value.length+5).value=u("workSchedule.date"),l.getCell(4,r.value.length+2).value=u("workSchedule.days"),l.getCell(4,r.value.length+3).value=`${u("workSchedule.hours")} (${E.value})`;for(let v=2;v<=r.value.length+1;v++)l.getCell(4,v).value=r.value[v-2].weekday+`
|
|
2
|
-
`+(v-1),l.getColumn(v).width=6,l.getColumn(v).alignment=d,l.getCell(4,v).border=t;l.getRow(1).height=40,l.getRow(2).height=30,l.getRow(3).height=20,l.getColumn(1).width=15,l.getColumn(r.value.length+2).width=5,l.getColumn(r.value.length+3).width=6,l.getColumn(r.value.length+4).width=13,l.getColumn(r.value.length+5).width=13,l.getColumn(1).alignment=d,l.getCell("A2").alignment=o,l.getCell("A3").alignment=o,l.getCell("B3").alignment=o,l.getCell(3,r.value.length+2).alignment=o,l.getColumn(r.value.length+2).alignment=d,l.getColumn(r.value.length+3).alignment=d,l.getColumn(r.value.length+4).alignment=o,l.getColumn(r.value.length+5).alignment=o,l.getCell("A3").border=t,l.getCell("B3").border=t,l.getCell(3,r.value.length+2).border=t,l.getCell(4,r.value.length+2).border=t,l.getCell(3,r.value.length+4).border=t,l.getCell(3,r.value.length+5).border=t,l.getCell(4,r.value.length+3).border=t;let m=0;for(const v of n.value){let F=[v.name];for(let B=1;B<=r.value.length;B++){const{ind:j}=z(B,m);j!==-1?F[B]=`${v.days[j].time} ${v.days[j].tips}`:F[B]=" "}F.push(((J=v.days)==null?void 0:J.length)||" ",v.contHour||0);const ae=l.addRow(F);ae.border=t,m++}let h="Начальник отдела";f.odata.personalManagerData.forEach(v=>{v.Status!=="Увольнение"&&v.Role==="Начальник отдела правовой и кадровой работы"&&(h=v.Description)}),l.mergeCells(`A${n.value.length+6}:P${n.value.length+6}`),l.mergeCells(`Q${n.value.length+6}:AG${n.value.length+6}`),l.mergeCells(`B${n.value.length+8}:E${n.value.length+8}`),l.mergeCells(`F${n.value.length+8}:L${n.value.length+8}`),l.mergeCells(`M${n.value.length+8}:P${n.value.length+8}`),l.mergeCells(`S${n.value.length+8}:V${n.value.length+8}`),l.mergeCells(`W${n.value.length+8}:AC${n.value.length+8}`),l.mergeCells(`AD${n.value.length+8}:AG${n.value.length+8}`),l.mergeCells(`Z${n.value.length+9}:AA${n.value.length+9}`),l.getCell(`A${n.value.length+6}`).value=u("workSchedule.byInitials"),l.getCell(`Q${n.value.length+6}`).value=u("workSchedule.supervisorHR"),l.getCell(`B${n.value.length+8}`).value=u("workSchedule.compiled")+":",l.getCell(`S${n.value.length+8}`).value=u("workSchedule.approved")+":",l.getCell(`M${n.value.length+8}`).value=g.byInitials(f.fullName),l.getCell(`AD${n.value.length+8}`).value=g.byInitials(h),l.getCell(`Z${n.value.length+9}`).value=u("workSchedule.printPlace"),l.getCell(`A${n.value.length+6}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`Q${n.value.length+6}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`B${n.value.length+8}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`F${n.value.length+8}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`M${n.value.length+8}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`AD${n.value.length+8}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`Z${n.value.length+9}`).alignment=o,l.getCell(`F${n.value.length+8}`).border={bottom:{style:"thin"}},l.getCell(`W${n.value.length+8}`).border={bottom:{style:"thin"}};const c="export_"+g.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",k=await a.xlsx.writeBuffer();ne.saveAs(new Blob([k]),c),T.value=!1},te=async()=>{A.value||f.workSchedule.addWorkSchedule({data:n.value,date:g.parseTime(new Date(w.value),"{Y}-{m}-{dd}")}).then(a=>A.value=a)};return g.holidays().then(a=>{O.value=a,P()}),(a,l)=>{const o=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",null,[y.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElSelect),{key:0,modelValue:x.value,"onUpdate:modelValue":l[0]||(l[0]=t=>x.value=t),placeholder:"Select",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Y.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElOption),{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),y.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:1,plain:"",onClick:l[1]||(l[1]=t=>D.value=!0),style:{"margin-bottom":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.jobTitle")),1)]),_:1})):e.createCommentVNode("",!0),y.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElSwitch),{key:2,modelValue:M.value,"onUpdate:modelValue":l[2]||(l[2]=t=>M.value=t),"active-text":e.unref(u)("workSchedule.currentMonth"),"active-value":"0","inactive-value":"1",style:{"margin-bottom":".5rem","margin-left":".5rem"}},null,8,["modelValue","active-text"])):e.createCommentVNode("",!0),e.createVNode(e.unref(i.ElSkeleton),{style:{width:"100%"},loading:H.value,animated:""},{template:e.withCtx(()=>[e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"100%",height:"2rem"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"4rem","margin-right":"4px"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"4rem"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"8rem","margin-right":"4px"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"8rem"}})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTable),{id:"printTable",data:n.value,style:{width:"100%"},size:"small",align:"center",onCellClick:Z,"empty-text":e.unref(u)("workSchedule.emptyText")},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(u)("workSchedule.title",{name:x.value})+e.unref(C)(w.value,"month")+` ${new Date(w.value).getFullYear()}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(u)("workSchedule.month"),width:"180",align:"center"},{default:e.withCtx(t=>[e.createElementVNode("div",de,e.toDisplayString(n.value[t.$index].name),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(u)("workSchedule.numbersMonth"),align:"center"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElTableColumn),{key:t.day,width:"45","class-name":t.holidays,align:"center",label:t.weekday+`
|
|
3
|
-
`+t.day.toString()},{default:e.withCtx(d=>[e.createElementVNode("div",se,e.toDisplayString(W(t.day,d.$index)||" "),1)]),_:2},1032,["class-name","label"]))),128))]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(u)("workSchedule.onSchedule"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(u)("workSchedule.days"),align:"center"},{default:e.withCtx(t=>[e.createTextVNode(e.toDisplayString(n.value[t.$index].days.length||0),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:`${e.unref(u)("workSchedule.hours")} ( ${E.value} )`,align:"center"},{default:e.withCtx(t=>[e.createElementVNode("div",{style:e.normalizeStyle(`color: ${E.value===t.row.contHour?"green":"red"};`)},e.toDisplayString(t.row.contHour),5)]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["data","empty-text"])]),_:1},8,["loading"]),Q.value&&y.checkEdit?(e.openBlock(),e.createElementBlock("div",ce,[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.chartsFilled"))+": ",1),A.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:0,type:"primary",onClick:te},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.confirm")),1)]),_:1})),l[17]||(l[17]=e.createTextVNode()),e.createElementVNode("span",null,e.toDisplayString(y.fullName),1)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(i.ElButton),{disabled:T.value,plain:"",onClick:le,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[o,T.value]]),e.createVNode(e.unref(i.ElDialog),{title:e.unref(u)("workSchedule.jobTitle"),modelValue:D.value,"onUpdate:modelValue":l[4]||(l[4]=t=>D.value=t),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(i.ElButton),{onClick:l[3]||(l[3]=t=>D.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{size:"default",type:"primary",onClick:G},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElForm),{ref:"dialogForm",model:V.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElSwitch),{modelValue:t.val,"onUpdate:modelValue":d=>t.val=d,"active-text":t.activeText},null,8,["modelValue","onUpdate:modelValue","active-text"])]),_:2},1024))),256))]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(q.ContextMenu),{show:I.value,"onUpdate:show":l[16]||(l[16]=t=>I.value=t),options:U.value},{default:e.withCtx(()=>[e.createVNode(e.unref(q.ContextMenuItem),{label:s.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(q.ContextMenuSeparator)),s.value.level===2?(e.openBlock(),e.createElementBlock("div",ve,[e.createVNode(e.unref(i.ElRadioGroup),{modelValue:R.value,"onUpdate:modelValue":l[5]||(l[5]=t=>R.value=t),size:"small"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElRadioButton),{label:e.unref(u)("workSchedule.Days5"),value:"5"},null,8,["label"]),e.createVNode(e.unref(i.ElRadioButton),{label:"2 Х 2",value:"2x2"}),e.createVNode(e.unref(i.ElRadioButton),{label:"2 Х 5",value:"2x5"})]),_:1},8,["modelValue"]),l[18]||(l[18]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(u)("workSchedule.fromDate"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:$.value,"onUpdate:modelValue":l[6]||(l[6]=t=>$.value=t),step:1,min:1,max:r.value.length},null,8,["modelValue","max"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(u)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:S.value,"onUpdate:modelValue":l[7]||(l[7]=t=>S.value=t),step:1,min:8,max:11},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(u)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:p.value,"onUpdate:modelValue":l[8]||(l[8]=t=>p.value=t),step:1,min:4,max:12},null,8,["modelValue"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[9]||(l[9]=t=>_(s.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.fillOut")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[10]||(l[10]=t=>K(s.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.clearRow")),1)]),_:1})])):(e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("div",null,e.toDisplayString(W(s.value.day,s.value.ids)),1),l[19]||(l[19]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(u)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:S.value,"onUpdate:modelValue":l[11]||(l[11]=t=>S.value=t),step:1,min:8,max:11,onChange:l[12]||(l[12]=t=>L(s.value.day,s.value.ids))},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(u)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:p.value,"onUpdate:modelValue":l[13]||(l[13]=t=>p.value=t),step:1,min:4,max:12,onChange:l[14]||(l[14]=t=>L(s.value.day,s.value.ids))},null,8,["modelValue"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[15]||(l[15]=t=>ee(s.value.day,s.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("workSchedule.delete")),1)]),_:1})]))]),_:1},8,["show","options"])])}}};module.exports=me;
|
package/dist/WorkTable.js
DELETED
|
@@ -1,513 +0,0 @@
|
|
|
1
|
-
import { ref as v, watch as ge, computed as Se, resolveDirective as $e, openBlock as f, createElementBlock as T, createBlock as M, unref as t, withCtx as i, Fragment as te, renderList as ae, createCommentVNode as N, createTextVNode as S, toDisplayString as g, createVNode as r, createElementVNode as k, normalizeStyle as xe, withDirectives as De } from "vue";
|
|
2
|
-
import { saveAs as Ve } from "file-saver";
|
|
3
|
-
import * as Ee from "exceljs";
|
|
4
|
-
import { p as H, b as ne, h as Me, c as D } from "./index-uVRk2ARj.js";
|
|
5
|
-
import { useI18n as Ae } from "vue-i18n";
|
|
6
|
-
import { ElSelect as Be, ElOption as Te, ElButton as A, ElSwitch as he, ElSkeleton as ze, ElSkeletonItem as W, ElTable as Fe, ElTableColumn as z, ElDialog as Ie, ElForm as Re, ElFormItem as Ye, ElRadioGroup as Ue, ElRadioButton as ue, ElSlider as P } from "element-plus";
|
|
7
|
-
import { ContextMenu as Ge, ContextMenuItem as Ne, ContextMenuSeparator as He } from "@imengyu/vue3-context-menu";
|
|
8
|
-
const We = { style: { height: "100px", width: "100%", display: "inline-block" } }, Pe = { style: { height: "100px", width: "100%", display: "inline-block" } }, je = {
|
|
9
|
-
key: 3,
|
|
10
|
-
class: "controls-container",
|
|
11
|
-
style: { "margin-top": ".5rem" }
|
|
12
|
-
}, Oe = {
|
|
13
|
-
key: 0,
|
|
14
|
-
style: { padding: "0.5em 1.5em" }
|
|
15
|
-
}, Le = {
|
|
16
|
-
key: 1,
|
|
17
|
-
style: { padding: "0.5em 1.5em" }
|
|
18
|
-
}, _e = {
|
|
19
|
-
__name: "WorkTable",
|
|
20
|
-
props: {
|
|
21
|
-
checkEdit: { type: Boolean, default: () => !0 },
|
|
22
|
-
odata: Object,
|
|
23
|
-
workSchedule: Object,
|
|
24
|
-
fullName: { type: String, default: "Вы" }
|
|
25
|
-
},
|
|
26
|
-
setup(F) {
|
|
27
|
-
const { t: d, d: j } = Ae(), $ = F, O = v(!1), n = v([
|
|
28
|
-
// { name: 'Иванов П.М. (Ведущий работник месяца)',
|
|
29
|
-
// days: [], // {day: "2024-11-01", tips: '(9:00 - 18:00)', time: 8 }
|
|
30
|
-
// contHour: 0,
|
|
31
|
-
// code: '0000-00052',
|
|
32
|
-
// ids: 0
|
|
33
|
-
// },
|
|
34
|
-
// { name: 'Петров И.С. (Ведущий работник месяца)',
|
|
35
|
-
// days: [], // {day: "2024-11-01", tips: '(9:00 - 18:00)', time: 8 }
|
|
36
|
-
// contHour: 0,
|
|
37
|
-
// code: '0000-00052'
|
|
38
|
-
// ids: 1
|
|
39
|
-
// }
|
|
40
|
-
]), L = v("1"), C = v(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1).setMonth((/* @__PURE__ */ new Date()).getMonth() + Number(L.value))), o = v([]), I = v(0), x = v(9), w = v(8), Z = v(!1), oe = v(!0), R = v(!1), X = v("5"), Y = v(1), V = v("Сектор разработок и эксплуатации сети"), K = v([]), E = v([]), h = v({ name: "Имя", length: 0, code: "" }), q = v(!1), _ = v({
|
|
41
|
-
zIndex: 30,
|
|
42
|
-
minWidth: 220,
|
|
43
|
-
x: 500,
|
|
44
|
-
y: 200
|
|
45
|
-
}), de = v({});
|
|
46
|
-
ge(V, async (a, e) => {
|
|
47
|
-
a !== e && (E.value = [], Z.value = !1, $.odata.personalManagerData.forEach((u) => {
|
|
48
|
-
u.Status !== "Увольнение" && u.Group === a && (E.value.some((l) => (l == null ? void 0 : l.activeText) === u.Role) || E.value.push({ val: !0, activeText: u.Role }));
|
|
49
|
-
}), ee());
|
|
50
|
-
}), ge(L, async (a, e) => {
|
|
51
|
-
C.value = new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1).setMonth((/* @__PURE__ */ new Date()).getMonth() + Number(a)), re();
|
|
52
|
-
});
|
|
53
|
-
const me = (a, e, u, l) => {
|
|
54
|
-
h.value.ids = a.ids, h.value.key = a.key, h.value.add = a.days.length > 0 && a.days[a.days.length - 1].cont, h.value.level = e.level, h.value.day = u.cellIndex, _.value.y = l.clientY, _.value.x = l.clientX, e.level === 2 && e.no === 0 && $.checkEdit && (h.value.name = d("workSchedule.autocomplete"), q.value = !0), e.level === 3 && u.cellIndex - e.no === 1 && $.checkEdit && (B(u.cellIndex, a.ids), h.value.name = d("workSchedule.modeSelection"), q.value = !0);
|
|
55
|
-
}, re = () => {
|
|
56
|
-
const a = de.value, e = new Date(C.value), u = new Date(e.getFullYear(), e.getMonth() + 1, 0).getDate();
|
|
57
|
-
let l = [], s = 0;
|
|
58
|
-
for (let p = 1; p <= u; p++) {
|
|
59
|
-
const y = H(e.setDate(p), "{Y}-{m}-{dd}");
|
|
60
|
-
s += a.nowork.includes(y) || a.holidays.includes(y) ? 0 : a.preholidays.includes(y) ? 7 : 8;
|
|
61
|
-
const m = a.nowork.includes(y) ? "nowork" : a.holidays.includes(y) ? "holiday" : a.preholidays.includes(y) ? "preholiday" : "";
|
|
62
|
-
l.push({ day: p, holidays: m, weekday: j(new Date(e.getFullYear(), e.getMonth(), p), "day") });
|
|
63
|
-
}
|
|
64
|
-
I.value = s, o.value = l, $.odata.getPersonalManagerData({}).then((p) => {
|
|
65
|
-
var y;
|
|
66
|
-
V.value = (y = p.find((m) => m.Status !== "Увольнение" && m.Description === $.fullName)) == null ? void 0 : y.Group, p.forEach((m) => {
|
|
67
|
-
m.Status !== "Увольнение" && (K.value.some((b) => (b == null ? void 0 : b.value) === m.Group) || K.value.push({ value: m.Group, label: m.Group, key: m.Group }), m.Group === V.value && !E.value.some((b) => (b == null ? void 0 : b.activeText) === m.Role) && E.value.push({ val: !0, activeText: m.Role }));
|
|
68
|
-
}), ee(), oe.value = !1;
|
|
69
|
-
});
|
|
70
|
-
}, ce = Se(() => !n.value.some((a) => a.contHour !== I.value)), ie = (a, e) => {
|
|
71
|
-
var p, y, m;
|
|
72
|
-
const u = new Date(C.value), l = `${u.getFullYear()}-${(u.getMonth() + 1).toString().padStart(2, "0")}-${a.toString().padStart(2, "0")}`, s = (p = n.value[e]) == null ? void 0 : p.days.findIndex((b) => b.day === l);
|
|
73
|
-
return e === -1 || s === -1 ? "" : ((y = n.value[e].days[s]) == null ? void 0 : y.time) + " " + ((m = n.value[e].days[s]) == null ? void 0 : m.tips);
|
|
74
|
-
}, ee = () => {
|
|
75
|
-
n.value = [];
|
|
76
|
-
let a = [];
|
|
77
|
-
$.odata.personalManagerData.forEach((e) => {
|
|
78
|
-
if (e.Status !== "Увольнение" && e.Group === V.value && E.value.some((u) => u.val && u.activeText === e.Role)) {
|
|
79
|
-
let u = ne(e.Description);
|
|
80
|
-
a.push(e.Code), n.value.push({ name: u + " (" + e.Role + ")", days: [], contHour: 0, code: e.Code, id: !1, ids: n.value.length });
|
|
81
|
-
}
|
|
82
|
-
}), pe(a), R.value = !1;
|
|
83
|
-
}, pe = (a) => {
|
|
84
|
-
$.workSchedule.getWorkSchedule({ code: a, date: H(new Date(C.value), "{Y}-{m}-{dd}") }).then(
|
|
85
|
-
(e) => {
|
|
86
|
-
e.forEach((u, l) => {
|
|
87
|
-
u !== null && (n.value[l].days = u.data.days, n.value[l].id = u.id);
|
|
88
|
-
}), U();
|
|
89
|
-
}
|
|
90
|
-
);
|
|
91
|
-
}, U = () => {
|
|
92
|
-
n.value.forEach((a) => {
|
|
93
|
-
a.contHour = a.days.reduce((e, u) => e + u.time, 0);
|
|
94
|
-
});
|
|
95
|
-
}, ye = (a) => {
|
|
96
|
-
n.value[a].days = [], U();
|
|
97
|
-
}, fe = (a) => {
|
|
98
|
-
switch (X.value) {
|
|
99
|
-
case "5":
|
|
100
|
-
for (let e = Y.value; e <= o.value.length; e++)
|
|
101
|
-
o.value[e - 1].holidays === "" && B(e, a, !0), o.value[e - 1].holidays === "preholiday" && (w.value -= 1, B(e, a, !0), w.value += 1);
|
|
102
|
-
break;
|
|
103
|
-
case "2x2":
|
|
104
|
-
for (let e = Y.value; e <= o.value.length; e += 4)
|
|
105
|
-
B(e, a, !0), e + 1 <= o.value.length && B(e + 1, a, !0);
|
|
106
|
-
break;
|
|
107
|
-
case "2x5":
|
|
108
|
-
for (let e = Y.value; e <= o.value.length; e += 7)
|
|
109
|
-
for (let u = e; u < e + 5 && u <= o.value.length; u++)
|
|
110
|
-
o.value[u - 1].holidays === "preholiday" ? (w.value -= 1, B(u, a, !0), w.value += 1) : B(u, a, !0);
|
|
111
|
-
break;
|
|
112
|
-
}
|
|
113
|
-
}, B = (a, e, u = !1) => {
|
|
114
|
-
const { date: l, ind: s } = J(a, e);
|
|
115
|
-
s === -1 ? (n.value[e].days.push({
|
|
116
|
-
day: l,
|
|
117
|
-
time: w.value,
|
|
118
|
-
tips: `(${x.value}:00 - ${x.value + w.value + 1}:00)`
|
|
119
|
-
}), U()) : u || (w.value = n.value[e].days[s].time, x.value = parseInt(n.value[e].days[s].tips.slice(1, -12)));
|
|
120
|
-
}, we = (a, e) => {
|
|
121
|
-
const { ind: u } = J(a, e);
|
|
122
|
-
n.value[e].days.splice(u, 1), U(), document.querySelector(".app-main").click();
|
|
123
|
-
}, se = (a, e) => {
|
|
124
|
-
const { date: u, ind: l } = J(a, e);
|
|
125
|
-
n.value[e].days[l] = {
|
|
126
|
-
day: u,
|
|
127
|
-
time: w.value,
|
|
128
|
-
tips: `(${x.value}:00 - ${x.value + w.value + 1}:00)`
|
|
129
|
-
}, U();
|
|
130
|
-
}, J = (a, e) => {
|
|
131
|
-
var s;
|
|
132
|
-
const u = H(new Date(C.value).setDate(a), "{Y}-{m}-{dd}"), l = (s = n.value[e]) == null ? void 0 : s.days.findIndex((p) => p.day === u);
|
|
133
|
-
return { date: u, ind: l };
|
|
134
|
-
}, ke = async () => {
|
|
135
|
-
var ve;
|
|
136
|
-
O.value = !0;
|
|
137
|
-
const a = new Ee.Workbook(), e = a.addWorksheet(j(C.value, "month"), { pageSetup: { paperSize: 9, orientation: "landscape", fitToPage: !0 } }), u = { vertical: "middle", horizontal: "center" }, l = { top: { style: "thin" }, left: { style: "thin" }, bottom: { style: "thin" }, right: { style: "thin" } }, s = { vertical: "middle", horizontal: "center", wrapText: !0 };
|
|
138
|
-
e.mergeCells(`A1:${D("A1", o.value.length + 5)}1`), e.mergeCells(`A2:${D("A2", o.value.length + 5)}2`), e.mergeCells("A3:A4"), e.mergeCells(`B3:${D("B3", o.value.length)}3`), e.mergeCells(`${D("B3", o.value.length + 1)}3:${D("B3", o.value.length + 2)}3`), e.mergeCells(`${D("B3", o.value.length + 3)}3:${D("B4", o.value.length + 3)}4`), e.mergeCells(`${D("B3", o.value.length + 4)}3:${D("B4", o.value.length + 4)}4`), e.getCell("A1").value = d("workSchedule.firm"), e.getCell("A2").value = d("workSchedule.title", { name: V.value }) + j(C.value, "month") + ` ${new Date(C.value).getFullYear()}`, e.getCell("A3").value = d("workSchedule.month"), e.getCell("B3").value = d("workSchedule.numbersMonth"), e.getCell(3, o.value.length + 2).value = d("workSchedule.onSchedule"), e.getCell(3, o.value.length + 4).value = d("workSchedule.acquainted"), e.getCell(3, o.value.length + 5).value = d("workSchedule.date"), e.getCell(4, o.value.length + 2).value = d("workSchedule.days"), e.getCell(4, o.value.length + 3).value = `${d("workSchedule.hours")} (${I.value})`;
|
|
139
|
-
for (let c = 2; c <= o.value.length + 1; c++)
|
|
140
|
-
e.getCell(4, c).value = o.value[c - 2].weekday + `
|
|
141
|
-
` + (c - 1), e.getColumn(c).width = 6, e.getColumn(c).alignment = s, e.getCell(4, c).border = l;
|
|
142
|
-
e.getRow(1).height = 40, e.getRow(2).height = 30, e.getRow(3).height = 20, e.getColumn(1).width = 15, e.getColumn(o.value.length + 2).width = 5, e.getColumn(o.value.length + 3).width = 6, e.getColumn(o.value.length + 4).width = 13, e.getColumn(o.value.length + 5).width = 13, e.getColumn(1).alignment = s, e.getCell("A2").alignment = u, e.getCell("A3").alignment = u, e.getCell("B3").alignment = u, e.getCell(3, o.value.length + 2).alignment = u, e.getColumn(o.value.length + 2).alignment = s, e.getColumn(o.value.length + 3).alignment = s, e.getColumn(o.value.length + 4).alignment = u, e.getColumn(o.value.length + 5).alignment = u, e.getCell("A3").border = l, e.getCell("B3").border = l, e.getCell(3, o.value.length + 2).border = l, e.getCell(4, o.value.length + 2).border = l, e.getCell(3, o.value.length + 4).border = l, e.getCell(3, o.value.length + 5).border = l, e.getCell(4, o.value.length + 3).border = l;
|
|
143
|
-
let p = 0;
|
|
144
|
-
for (const c of n.value) {
|
|
145
|
-
let Q = [c.name];
|
|
146
|
-
for (let G = 1; G <= o.value.length; G++) {
|
|
147
|
-
const { ind: le } = J(G, p);
|
|
148
|
-
le !== -1 ? Q[G] = `${c.days[le].time} ${c.days[le].tips}` : Q[G] = " ";
|
|
149
|
-
}
|
|
150
|
-
Q.push(((ve = c.days) == null ? void 0 : ve.length) || " ", c.contHour || 0);
|
|
151
|
-
const be = e.addRow(Q);
|
|
152
|
-
be.border = l, p++;
|
|
153
|
-
}
|
|
154
|
-
let y = "Начальник отдела";
|
|
155
|
-
$.odata.personalManagerData.forEach((c) => {
|
|
156
|
-
c.Status !== "Увольнение" && c.Role === "Начальник отдела правовой и кадровой работы" && (y = c.Description);
|
|
157
|
-
}), e.mergeCells(`A${n.value.length + 6}:P${n.value.length + 6}`), e.mergeCells(`Q${n.value.length + 6}:AG${n.value.length + 6}`), e.mergeCells(`B${n.value.length + 8}:E${n.value.length + 8}`), e.mergeCells(`F${n.value.length + 8}:L${n.value.length + 8}`), e.mergeCells(`M${n.value.length + 8}:P${n.value.length + 8}`), e.mergeCells(`S${n.value.length + 8}:V${n.value.length + 8}`), e.mergeCells(`W${n.value.length + 8}:AC${n.value.length + 8}`), e.mergeCells(`AD${n.value.length + 8}:AG${n.value.length + 8}`), e.mergeCells(`Z${n.value.length + 9}:AA${n.value.length + 9}`), e.getCell(`A${n.value.length + 6}`).value = d("workSchedule.byInitials"), e.getCell(`Q${n.value.length + 6}`).value = d("workSchedule.supervisorHR"), e.getCell(`B${n.value.length + 8}`).value = d("workSchedule.compiled") + ":", e.getCell(`S${n.value.length + 8}`).value = d("workSchedule.approved") + ":", e.getCell(`M${n.value.length + 8}`).value = ne($.fullName), e.getCell(`AD${n.value.length + 8}`).value = ne(y), e.getCell(`Z${n.value.length + 9}`).value = d("workSchedule.printPlace"), e.getCell(`A${n.value.length + 6}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`Q${n.value.length + 6}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`B${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`F${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`M${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "left" }, e.getCell(`AD${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "left" }, e.getCell(`Z${n.value.length + 9}`).alignment = u, e.getCell(`F${n.value.length + 8}`).border = { bottom: { style: "thin" } }, e.getCell(`W${n.value.length + 8}`).border = { bottom: { style: "thin" } };
|
|
158
|
-
const m = "export_" + H(Date.now(), "{dd}.{m}.{Y}") + ".xlsx", b = await a.xlsx.writeBuffer();
|
|
159
|
-
Ve(new Blob([b]), m), O.value = !1;
|
|
160
|
-
}, Ce = async () => {
|
|
161
|
-
Z.value || $.workSchedule.addWorkSchedule({ data: n.value, date: H(new Date(C.value), "{Y}-{m}-{dd}") }).then((a) => Z.value = a);
|
|
162
|
-
};
|
|
163
|
-
return Me().then((a) => {
|
|
164
|
-
de.value = a, re();
|
|
165
|
-
}), (a, e) => {
|
|
166
|
-
const u = $e("loading");
|
|
167
|
-
return f(), T("div", null, [
|
|
168
|
-
F.checkEdit ? (f(), M(t(Be), {
|
|
169
|
-
key: 0,
|
|
170
|
-
modelValue: V.value,
|
|
171
|
-
"onUpdate:modelValue": e[0] || (e[0] = (l) => V.value = l),
|
|
172
|
-
placeholder: "Select",
|
|
173
|
-
style: { width: "240px", "margin-bottom": ".5rem", "margin-right": ".5rem" }
|
|
174
|
-
}, {
|
|
175
|
-
default: i(() => [
|
|
176
|
-
(f(!0), T(te, null, ae(K.value, (l) => (f(), M(t(Te), {
|
|
177
|
-
key: l.value,
|
|
178
|
-
label: l.label,
|
|
179
|
-
value: l.value
|
|
180
|
-
}, null, 8, ["label", "value"]))), 128))
|
|
181
|
-
]),
|
|
182
|
-
_: 1
|
|
183
|
-
}, 8, ["modelValue"])) : N("", !0),
|
|
184
|
-
F.checkEdit ? (f(), M(t(A), {
|
|
185
|
-
key: 1,
|
|
186
|
-
plain: "",
|
|
187
|
-
onClick: e[1] || (e[1] = (l) => R.value = !0),
|
|
188
|
-
style: { "margin-bottom": ".5rem" }
|
|
189
|
-
}, {
|
|
190
|
-
default: i(() => [
|
|
191
|
-
S(g(t(d)("workSchedule.jobTitle")), 1)
|
|
192
|
-
]),
|
|
193
|
-
_: 1
|
|
194
|
-
})) : N("", !0),
|
|
195
|
-
F.checkEdit ? (f(), M(t(he), {
|
|
196
|
-
key: 2,
|
|
197
|
-
modelValue: L.value,
|
|
198
|
-
"onUpdate:modelValue": e[2] || (e[2] = (l) => L.value = l),
|
|
199
|
-
"active-text": t(d)("workSchedule.currentMonth"),
|
|
200
|
-
"active-value": "0",
|
|
201
|
-
"inactive-value": "1",
|
|
202
|
-
style: { "margin-bottom": ".5rem", "margin-left": ".5rem" }
|
|
203
|
-
}, null, 8, ["modelValue", "active-text"])) : N("", !0),
|
|
204
|
-
r(t(ze), {
|
|
205
|
-
style: { width: "100%" },
|
|
206
|
-
loading: oe.value,
|
|
207
|
-
animated: ""
|
|
208
|
-
}, {
|
|
209
|
-
template: i(() => [
|
|
210
|
-
r(t(W), {
|
|
211
|
-
variant: "text",
|
|
212
|
-
style: { width: "100%", height: "2rem" }
|
|
213
|
-
}),
|
|
214
|
-
r(t(W), {
|
|
215
|
-
variant: "text",
|
|
216
|
-
style: { width: "180px", height: "4rem", "margin-right": "4px" }
|
|
217
|
-
}),
|
|
218
|
-
r(t(W), {
|
|
219
|
-
variant: "text",
|
|
220
|
-
style: { width: "calc( 100% - 184px)", height: "4rem" }
|
|
221
|
-
}),
|
|
222
|
-
r(t(W), {
|
|
223
|
-
variant: "text",
|
|
224
|
-
style: { width: "180px", height: "8rem", "margin-right": "4px" }
|
|
225
|
-
}),
|
|
226
|
-
r(t(W), {
|
|
227
|
-
variant: "text",
|
|
228
|
-
style: { width: "calc( 100% - 184px)", height: "8rem" }
|
|
229
|
-
})
|
|
230
|
-
]),
|
|
231
|
-
default: i(() => [
|
|
232
|
-
r(t(Fe), {
|
|
233
|
-
id: "printTable",
|
|
234
|
-
data: n.value,
|
|
235
|
-
style: { width: "100%" },
|
|
236
|
-
size: "small",
|
|
237
|
-
align: "center",
|
|
238
|
-
onCellClick: me,
|
|
239
|
-
"empty-text": t(d)("workSchedule.emptyText")
|
|
240
|
-
}, {
|
|
241
|
-
default: i(() => [
|
|
242
|
-
r(t(z), {
|
|
243
|
-
label: t(d)("workSchedule.title", { name: V.value }) + t(j)(C.value, "month") + ` ${new Date(C.value).getFullYear()}`,
|
|
244
|
-
align: "center",
|
|
245
|
-
height: "34"
|
|
246
|
-
}, {
|
|
247
|
-
default: i(() => [
|
|
248
|
-
r(t(z), {
|
|
249
|
-
label: t(d)("workSchedule.month"),
|
|
250
|
-
width: "180",
|
|
251
|
-
align: "center"
|
|
252
|
-
}, {
|
|
253
|
-
default: i((l) => [
|
|
254
|
-
k("div", We, g(n.value[l.$index].name), 1)
|
|
255
|
-
]),
|
|
256
|
-
_: 1
|
|
257
|
-
}, 8, ["label"]),
|
|
258
|
-
r(t(z), {
|
|
259
|
-
label: t(d)("workSchedule.numbersMonth"),
|
|
260
|
-
align: "center"
|
|
261
|
-
}, {
|
|
262
|
-
default: i(() => [
|
|
263
|
-
(f(!0), T(te, null, ae(o.value, (l) => (f(), M(t(z), {
|
|
264
|
-
key: l.day,
|
|
265
|
-
width: "45",
|
|
266
|
-
"class-name": l.holidays,
|
|
267
|
-
align: "center",
|
|
268
|
-
label: l.weekday + `
|
|
269
|
-
` + l.day.toString()
|
|
270
|
-
}, {
|
|
271
|
-
default: i((s) => [
|
|
272
|
-
k("div", Pe, g(ie(l.day, s.$index) || " "), 1)
|
|
273
|
-
]),
|
|
274
|
-
_: 2
|
|
275
|
-
}, 1032, ["class-name", "label"]))), 128))
|
|
276
|
-
]),
|
|
277
|
-
_: 1
|
|
278
|
-
}, 8, ["label"]),
|
|
279
|
-
r(t(z), {
|
|
280
|
-
label: t(d)("workSchedule.onSchedule"),
|
|
281
|
-
align: "center"
|
|
282
|
-
}, {
|
|
283
|
-
default: i(() => [
|
|
284
|
-
r(t(z), {
|
|
285
|
-
label: t(d)("workSchedule.days"),
|
|
286
|
-
align: "center"
|
|
287
|
-
}, {
|
|
288
|
-
default: i((l) => [
|
|
289
|
-
S(g(n.value[l.$index].days.length || 0), 1)
|
|
290
|
-
]),
|
|
291
|
-
_: 1
|
|
292
|
-
}, 8, ["label"]),
|
|
293
|
-
r(t(z), {
|
|
294
|
-
label: `${t(d)("workSchedule.hours")} ( ${I.value} )`,
|
|
295
|
-
align: "center"
|
|
296
|
-
}, {
|
|
297
|
-
default: i((l) => [
|
|
298
|
-
k("div", {
|
|
299
|
-
style: xe(`color: ${I.value === l.row.contHour ? "green" : "red"};`)
|
|
300
|
-
}, g(l.row.contHour), 5)
|
|
301
|
-
]),
|
|
302
|
-
_: 1
|
|
303
|
-
}, 8, ["label"])
|
|
304
|
-
]),
|
|
305
|
-
_: 1
|
|
306
|
-
}, 8, ["label"])
|
|
307
|
-
]),
|
|
308
|
-
_: 1
|
|
309
|
-
}, 8, ["label"])
|
|
310
|
-
]),
|
|
311
|
-
_: 1
|
|
312
|
-
}, 8, ["data", "empty-text"])
|
|
313
|
-
]),
|
|
314
|
-
_: 1
|
|
315
|
-
}, 8, ["loading"]),
|
|
316
|
-
ce.value && F.checkEdit ? (f(), T("div", je, [
|
|
317
|
-
S(g(t(d)("workSchedule.chartsFilled")) + ": ", 1),
|
|
318
|
-
Z.value ? N("", !0) : (f(), M(t(A), {
|
|
319
|
-
key: 0,
|
|
320
|
-
type: "primary",
|
|
321
|
-
onClick: Ce
|
|
322
|
-
}, {
|
|
323
|
-
default: i(() => [
|
|
324
|
-
S(g(t(d)("workSchedule.confirm")), 1)
|
|
325
|
-
]),
|
|
326
|
-
_: 1
|
|
327
|
-
})),
|
|
328
|
-
e[17] || (e[17] = S()),
|
|
329
|
-
k("span", null, g(F.fullName), 1)
|
|
330
|
-
])) : N("", !0),
|
|
331
|
-
De((f(), M(t(A), {
|
|
332
|
-
disabled: O.value,
|
|
333
|
-
plain: "",
|
|
334
|
-
onClick: ke,
|
|
335
|
-
style: { "margin-top": ".5rem" }
|
|
336
|
-
}, {
|
|
337
|
-
default: i(() => [
|
|
338
|
-
S(g(t(d)("workSchedule.exportExcel")), 1)
|
|
339
|
-
]),
|
|
340
|
-
_: 1
|
|
341
|
-
}, 8, ["disabled"])), [
|
|
342
|
-
[u, O.value]
|
|
343
|
-
]),
|
|
344
|
-
r(t(Ie), {
|
|
345
|
-
title: t(d)("workSchedule.jobTitle"),
|
|
346
|
-
modelValue: R.value,
|
|
347
|
-
"onUpdate:modelValue": e[4] || (e[4] = (l) => R.value = l),
|
|
348
|
-
width: "400px"
|
|
349
|
-
}, {
|
|
350
|
-
footer: i(() => [
|
|
351
|
-
r(t(A), {
|
|
352
|
-
onClick: e[3] || (e[3] = (l) => R.value = !1),
|
|
353
|
-
size: "default"
|
|
354
|
-
}, {
|
|
355
|
-
default: i(() => [
|
|
356
|
-
S(g(a.$t("workSchedule.cancel")), 1)
|
|
357
|
-
]),
|
|
358
|
-
_: 1
|
|
359
|
-
}),
|
|
360
|
-
r(t(A), {
|
|
361
|
-
size: "default",
|
|
362
|
-
type: "primary",
|
|
363
|
-
onClick: ee
|
|
364
|
-
}, {
|
|
365
|
-
default: i(() => [
|
|
366
|
-
S(g(a.$t("workSchedule.select")), 1)
|
|
367
|
-
]),
|
|
368
|
-
_: 1
|
|
369
|
-
})
|
|
370
|
-
]),
|
|
371
|
-
default: i(() => [
|
|
372
|
-
r(t(Re), {
|
|
373
|
-
ref: "dialogForm",
|
|
374
|
-
model: E.value,
|
|
375
|
-
autocomplete: "on"
|
|
376
|
-
}, {
|
|
377
|
-
default: i(() => [
|
|
378
|
-
(f(!0), T(te, null, ae(E.value, (l) => (f(), M(t(Ye), null, {
|
|
379
|
-
default: i(() => [
|
|
380
|
-
r(t(he), {
|
|
381
|
-
modelValue: l.val,
|
|
382
|
-
"onUpdate:modelValue": (s) => l.val = s,
|
|
383
|
-
"active-text": l.activeText
|
|
384
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "active-text"])
|
|
385
|
-
]),
|
|
386
|
-
_: 2
|
|
387
|
-
}, 1024))), 256))
|
|
388
|
-
]),
|
|
389
|
-
_: 1
|
|
390
|
-
}, 8, ["model"])
|
|
391
|
-
]),
|
|
392
|
-
_: 1
|
|
393
|
-
}, 8, ["title", "modelValue"]),
|
|
394
|
-
r(t(Ge), {
|
|
395
|
-
show: q.value,
|
|
396
|
-
"onUpdate:show": e[16] || (e[16] = (l) => q.value = l),
|
|
397
|
-
options: _.value
|
|
398
|
-
}, {
|
|
399
|
-
default: i(() => [
|
|
400
|
-
r(t(Ne), {
|
|
401
|
-
label: h.value.name,
|
|
402
|
-
disabled: ""
|
|
403
|
-
}, null, 8, ["label"]),
|
|
404
|
-
r(t(He)),
|
|
405
|
-
h.value.level === 2 ? (f(), T("div", Oe, [
|
|
406
|
-
r(t(Ue), {
|
|
407
|
-
modelValue: X.value,
|
|
408
|
-
"onUpdate:modelValue": e[5] || (e[5] = (l) => X.value = l),
|
|
409
|
-
size: "small"
|
|
410
|
-
}, {
|
|
411
|
-
default: i(() => [
|
|
412
|
-
r(t(ue), {
|
|
413
|
-
label: t(d)("workSchedule.Days5"),
|
|
414
|
-
value: "5"
|
|
415
|
-
}, null, 8, ["label"]),
|
|
416
|
-
r(t(ue), {
|
|
417
|
-
label: "2 Х 2",
|
|
418
|
-
value: "2x2"
|
|
419
|
-
}),
|
|
420
|
-
r(t(ue), {
|
|
421
|
-
label: "2 Х 5",
|
|
422
|
-
value: "2x5"
|
|
423
|
-
})
|
|
424
|
-
]),
|
|
425
|
-
_: 1
|
|
426
|
-
}, 8, ["modelValue"]),
|
|
427
|
-
e[18] || (e[18] = k("br", null, null, -1)),
|
|
428
|
-
k("span", null, g(t(d)("workSchedule.fromDate")) + ":", 1),
|
|
429
|
-
r(t(P), {
|
|
430
|
-
modelValue: Y.value,
|
|
431
|
-
"onUpdate:modelValue": e[6] || (e[6] = (l) => Y.value = l),
|
|
432
|
-
step: 1,
|
|
433
|
-
min: 1,
|
|
434
|
-
max: o.value.length
|
|
435
|
-
}, null, 8, ["modelValue", "max"]),
|
|
436
|
-
k("span", null, g(t(d)("workSchedule.with")) + ":", 1),
|
|
437
|
-
r(t(P), {
|
|
438
|
-
modelValue: x.value,
|
|
439
|
-
"onUpdate:modelValue": e[7] || (e[7] = (l) => x.value = l),
|
|
440
|
-
step: 1,
|
|
441
|
-
min: 8,
|
|
442
|
-
max: 11
|
|
443
|
-
}, null, 8, ["modelValue"]),
|
|
444
|
-
k("span", null, g(t(d)("workSchedule.duration")) + ":", 1),
|
|
445
|
-
r(t(P), {
|
|
446
|
-
modelValue: w.value,
|
|
447
|
-
"onUpdate:modelValue": e[8] || (e[8] = (l) => w.value = l),
|
|
448
|
-
step: 1,
|
|
449
|
-
min: 4,
|
|
450
|
-
max: 12
|
|
451
|
-
}, null, 8, ["modelValue"]),
|
|
452
|
-
r(t(A), {
|
|
453
|
-
style: { "margin-top": ".5rem" },
|
|
454
|
-
size: "small",
|
|
455
|
-
onClick: e[9] || (e[9] = (l) => fe(h.value.ids))
|
|
456
|
-
}, {
|
|
457
|
-
default: i(() => [
|
|
458
|
-
S(g(t(d)("workSchedule.fillOut")), 1)
|
|
459
|
-
]),
|
|
460
|
-
_: 1
|
|
461
|
-
}),
|
|
462
|
-
r(t(A), {
|
|
463
|
-
style: { "margin-top": ".5rem" },
|
|
464
|
-
size: "small",
|
|
465
|
-
onClick: e[10] || (e[10] = (l) => ye(h.value.ids))
|
|
466
|
-
}, {
|
|
467
|
-
default: i(() => [
|
|
468
|
-
S(g(t(d)("workSchedule.clearRow")), 1)
|
|
469
|
-
]),
|
|
470
|
-
_: 1
|
|
471
|
-
})
|
|
472
|
-
])) : (f(), T("div", Le, [
|
|
473
|
-
k("div", null, g(ie(h.value.day, h.value.ids)), 1),
|
|
474
|
-
e[19] || (e[19] = k("br", null, null, -1)),
|
|
475
|
-
k("span", null, g(t(d)("workSchedule.with")) + ":", 1),
|
|
476
|
-
r(t(P), {
|
|
477
|
-
modelValue: x.value,
|
|
478
|
-
"onUpdate:modelValue": e[11] || (e[11] = (l) => x.value = l),
|
|
479
|
-
step: 1,
|
|
480
|
-
min: 8,
|
|
481
|
-
max: 11,
|
|
482
|
-
onChange: e[12] || (e[12] = (l) => se(h.value.day, h.value.ids))
|
|
483
|
-
}, null, 8, ["modelValue"]),
|
|
484
|
-
k("span", null, g(t(d)("workSchedule.duration")) + ":", 1),
|
|
485
|
-
r(t(P), {
|
|
486
|
-
modelValue: w.value,
|
|
487
|
-
"onUpdate:modelValue": e[13] || (e[13] = (l) => w.value = l),
|
|
488
|
-
step: 1,
|
|
489
|
-
min: 4,
|
|
490
|
-
max: 12,
|
|
491
|
-
onChange: e[14] || (e[14] = (l) => se(h.value.day, h.value.ids))
|
|
492
|
-
}, null, 8, ["modelValue"]),
|
|
493
|
-
r(t(A), {
|
|
494
|
-
style: { "margin-top": ".5rem" },
|
|
495
|
-
size: "small",
|
|
496
|
-
onClick: e[15] || (e[15] = (l) => we(h.value.day, h.value.ids))
|
|
497
|
-
}, {
|
|
498
|
-
default: i(() => [
|
|
499
|
-
S(g(t(d)("workSchedule.delete")), 1)
|
|
500
|
-
]),
|
|
501
|
-
_: 1
|
|
502
|
-
})
|
|
503
|
-
]))
|
|
504
|
-
]),
|
|
505
|
-
_: 1
|
|
506
|
-
}, 8, ["show", "options"])
|
|
507
|
-
]);
|
|
508
|
-
};
|
|
509
|
-
}
|
|
510
|
-
};
|
|
511
|
-
export {
|
|
512
|
-
_e as default
|
|
513
|
-
};
|
package/dist/employees.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.wrapper[data-v-5b3d4c74]{display:flex}.wrapper .month_year[data-v-5b3d4c74]{display:flex;justify-content:space-around;align-items:center}.wrapper .month_year span:not(.text) button[data-v-5b3d4c74]{font-size:1.3em}.wrapper>div[data-v-5b3d4c74]:not(:first-child){margin-left:2rem}.wrapper button[data-v-5b3d4c74]{height:30px;text-align:center;line-height:30px;cursor:pointer;background:none;border:none;border-radius:.2rem;transition:all .3s ease}.wrapper button[data-v-5b3d4c74]:hover:not(.disabled):not(.active){color:var(--el-color-success)}.wrapper .week[data-v-5b3d4c74]{border-bottom:1px solid var(--el-color-info);margin-bottom:.5rem}.wrapper .month[data-v-5b3d4c74],.wrapper .week[data-v-5b3d4c74]{width:250px;display:grid;grid-template-columns:1fr 1fr 1fr 1fr 1fr 1fr 1fr;gap:.2rem}.wrapper .month>button[data-v-5b3d4c74],.wrapper .week>button[data-v-5b3d4c74]{width:30px}.wrapper .month>button.disabled[data-v-5b3d4c74],.wrapper .week>button.disabled[data-v-5b3d4c74]{color:var(--el-color-info);cursor:not-allowed}.wrapper .month>button.preholiday[data-v-5b3d4c74],.wrapper .week>button.preholiday[data-v-5b3d4c74]{background-color:#ffe78070}.wrapper .month>button.weekend[data-v-5b3d4c74],.wrapper .week>button.weekend[data-v-5b3d4c74]{background-color:#ff808070}.wrapper .month>button.select[data-v-5b3d4c74],.wrapper .week>button.select[data-v-5b3d4c74]{background-color:#007bff70}.wrapper .month>button.holiday[data-v-5b3d4c74],.wrapper .week>button.holiday[data-v-5b3d4c74]{background-color:red}.wrapper .month>button.nowork[data-v-5b3d4c74],.wrapper .week>button.nowork[data-v-5b3d4c74]{background-color:red}.wrapper .month>button.active[data-v-5b3d4c74],.wrapper .week>button.active[data-v-5b3d4c74]{background-color:#007bff}.noBorder .el-input__wrapper{box-shadow:none}
|
package/dist/index-CHGzf-XH.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const i=require("js-cookie");function u(t,e){if(arguments.length===0||!t)return null;const o=e||"{Y}-{m}-{d} {G}:{i}:{s}";let r;typeof t=="object"?r=t:(typeof t=="string"&&(/^[0-9]+$/.test(t)?t=parseInt(t):t=t.replace(new RegExp(/-/gm),"/")),typeof t=="number"&&t.toString().length===10&&(t=t*1e3),r=new Date(t));const a="ru-RU",l={Y:r.getFullYear(),m:(r.getMonth()+1).toString().padStart(2,"0"),d:r.getDate(),dd:r.getDate().toString().padStart(2,"0"),G:r.getHours(),H:r.getHours().toString().padStart(2,"0"),i:r.getMinutes().toString().padStart(2,"0"),s:r.getSeconds().toString().padStart(2,"0"),D:new Intl.DateTimeFormat(a,{weekday:"short"}).format(r),F:new Intl.DateTimeFormat(a,{month:"long"}).format(r),M:new Intl.DateTimeFormat(a,{month:"short"}).format(r)};return o.replace(/{(dd|[YmdGHisDFM])+}/g,(m,c)=>l[c])}function f(t,e){let r=t.replace(/[0-9]/g,"").split("").reverse().map(a=>a.charCodeAt(0));return s(r,e,0),r.map(a=>String.fromCharCode(a)).reverse().join("")}function p(t){return t.split(" ",3).map((e,o)=>o!==0?e.slice(0,1)+".":e).join(" ")}let n={};async function g(){if(n!=null&&n.holidays)return n;try{const t=await fetch("https://cp.avanta-telecom.ru/api/v2/calendar/getHoliday",{method:"GET",mode:"cors",cache:"default",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"text/html","X-Token":h(),"Cache-Control":"no-cache"},redirect:"follow",referrerPolicy:"no-referrer"});if(!t.ok)throw new Error(`HTTP error! Status: ${t.status}`);const e=await t.json();return e.result.holiday=["2024-01-01","2024-01-02","2024-01-03","2024-01-04","2024-01-05","2024-01-06","2024-01-07","2024-01-08","2024-02-23","2024-03-08","2024-05-01","2024-05-09","2024-06-12","2024-11-04","2025-01-01","2025-01-02","2025-01-03","2025-01-04","2025-01-05","2025-01-06","2025-01-07","2025-01-08","2025-02-23","2025-03-08","2025-05-01","2025-05-09","2025-06-12","2025-11-04"],n=e.result,n}catch(t){throw console.error("Ошибка загрузки данных о праздниках:",t),t}}function s(t,e,o){if(typeof e!="number"||e<1)return!0;if(e=e-1,(typeof t[o]!="number"||t[o]<65)&&(t[o]=65),t[o]+e<=90)t[o]=t[o]+e;else{let r=Math.floor((t[o]-65+e)/26);t[o]=(t[o]-65+e)%26+65,s(t,r,o+1)}}const h=()=>i.get("X-Token")||!1;exports.byInitials=p;exports.cellsDynamically=f;exports.holidays=g;exports.parseTime=u;
|