@studio-west/employees 0.0.1
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/README.md +5 -0
- package/dist/WorkTable.cjs +3 -0
- package/dist/WorkTable.js +563 -0
- package/dist/vite.svg +1 -0
- package/package.json +25 -0
package/README.md
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Vue 3 + Vite
|
|
2
|
+
|
|
3
|
+
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
|
|
4
|
+
|
|
5
|
+
Learn more about IDE Support for Vue in the [Vue Docs Scaling up Guide](https://vuejs.org/guide/scaling-up/tooling.html#ide-support).
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
(function(e,D){typeof exports=="object"&&typeof module<"u"?module.exports=D(require("vue"),require("file-saver"),require("exceljs"),require("vue-i18n"),require("element-plus"),require("@imengyu/vue3-context-menu"),require("js-cookie")):typeof define=="function"&&define.amd?define(["vue","file-saver","exceljs","vue-i18n","element-plus","@imengyu/vue3-context-menu","js-cookie"],D):(e=typeof globalThis<"u"?globalThis:e||self,e["employees-vue"]=D(e.vue,e.fileSaver,e.ExcelJS,e.vueI18n,e.elementPlus,e.vue3ContextMenu,e.Cookies))})(this,function(e,D,_,P,i,Y,ee){"use strict";function te(u){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(u){for(const y in u)if(y!=="default"){const s=Object.getOwnPropertyDescriptor(u,y);Object.defineProperty(r,y,s.get?s:{enumerable:!0,get:()=>u[y]})}}return r.default=u,Object.freeze(r)}const le=te(_);function $(u,r){if(arguments.length===0||!u)return null;const y=r||"{Y}-{m}-{d} {G}:{i}:{s}";let s;typeof u=="object"?s=u:(typeof u=="string"&&(/^[0-9]+$/.test(u)?u=parseInt(u):u=u.replace(new RegExp(/-/gm),"/")),typeof u=="number"&&u.toString().length===10&&(u=u*1e3),s=new Date(u));const C=useApp(),n=C.language+"-"+C.language.toUpperCase(),F={Y:s.getFullYear(),m:(s.getMonth()+1).toString().padStart(2,"0"),d:s.getDate(),dd:s.getDate().toString().padStart(2,"0"),G:s.getHours(),H:s.getHours().toString().padStart(2,"0"),i:s.getMinutes().toString().padStart(2,"0"),s:s.getSeconds().toString().padStart(2,"0"),D:new Intl.DateTimeFormat(n,{weekday:"short"}).format(s),F:new Intl.DateTimeFormat(n,{month:"long"}).format(s),M:new Intl.DateTimeFormat(n,{month:"short"}).format(s)};return y.replace(/{(dd|[YmdGHisDFM])+}/g,(k,d)=>F[d])}function x(u,r){let s=u.replace(/[0-9]/g,"").split("").reverse().map(C=>C.charCodeAt(0));return process(s,r,0),s.map(C=>String.fromCharCode(C)).reverse().join("")}function G(u){return u.split(" ",3).map((r,y)=>y!==0?r.slice(0,1)+".":r).join(" ")}const ae={style:{height:"100px",width:"100%",display:"inline-block"}},ne={style:{height:"100px",width:"100%",display:"inline-block"}},oe={key:2,class:"controls-container"},re={key:0,style:{padding:"0.5em 1.5em"}},de={key:1,style:{padding:"0.5em 1.5em"}};return{__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},data:Object,workSchedule:Object,fullName:{type:String,default:"Вы"}},setup(u){const{t:r,d:y}=P.useI18n(),s=u,C=e.ref(!1),n=e.ref([]),F=e.ref(1),k=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(F.value))),d=e.ref([]),N=e.ref(0),V=e.ref(9),w=e.ref(8),I=e.ref(!1),L=e.ref(!0),B=e.ref(!1),H=e.ref("5"),T=e.ref(1),b=e.ref("Сектор разработок и эксплуатации сети"),U=e.ref([]),v=e.ref([]),g=e.ref({name:"Имя",length:0,code:""}),j=e.ref(!1),O=e.ref({zIndex:30,minWidth:220,x:500,y:200}),J=e.ref([]);e.watch(b,async(a,t)=>{a!==t&&(v.value=[],I.value=!1,s.odata.personalManagerData.forEach(o=>{o.Status!=="Увольнение"&&o.Group===a&&(v.value.some(l=>(l==null?void 0:l.activeText)===o.Role)||v.value.push({val:!0,activeText:o.Role}))}),q())}),e.watch(F,async(a,t)=>{a!==t&&(k.value=new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(a)),X())});const ie=(a,t,o,l)=>{g.value.ids=a.ids,g.value.key=a.key,g.value.add=a.days.length>0&&a.days[a.days.length-1].cont,g.value.level=t.level,g.value.day=o.cellIndex,O.value.y=l.clientY,O.value.x=l.clientX,t.level===2&&t.no===0&&s.checkEdit&&(g.value.name=r("workSchedule.autocomplete"),j.value=!0),t.level===3&&o.cellIndex-t.no===1&&s.checkEdit&&(E(o.cellIndex,a.ids),g.value.name=r("workSchedule.modeSelection"),j.value=!0)},X=()=>{const a=J.value,t=new Date(k.value),o=new Date(t.getFullYear(),t.getMonth()+1,0).getDate();let l=[],c=0;for(let m=1;m<=o;m++){const p=$(t.setDate(m),"{Y}-{m}-{dd}");c+=a.nowork.includes(p)||a.holidays.includes(p)?0:a.preholidays.includes(p)?7:8;const h=a.nowork.includes(p)?"nowork":a.holidays.includes(p)?"holiday":a.preholidays.includes(p)?"preholiday":"";l.push({day:m,holidays:h,weekday:y(new Date(t.getFullYear(),t.getMonth(),m),"day")})}N.value=c,d.value=l,s.odata.getPersonalManagerData({}).then(m=>{var p;b.value=(p=m.find(h=>h.Status!=="Увольнение"&&h.Description===s.fullName))==null?void 0:p.Group,m.forEach(h=>{h.Status!=="Увольнение"&&(U.value.some(S=>(S==null?void 0:S.value)===h.Group)||U.value.push({value:h.Group,label:h.Group,key:h.Group}),h.Group===b.value&&!v.value.some(S=>(S==null?void 0:S.activeText)===h.Role)&&v.value.push({val:!0,activeText:h.Role}))}),q(),L.value=!1})},ue=e.computed(()=>!n.value.some(a=>a.contHour!==N.value)),Z=(a,t)=>{var m,p,h;const o=new Date(k.value),l=`${o.getFullYear()}-${(o.getMonth()+1).toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}`,c=(m=n.value[t])==null?void 0:m.days.findIndex(S=>S.day===l);return t===-1||c===-1?"":((p=n.value[t].days[c])==null?void 0:p.time)+" "+((h=n.value[t].days[c])==null?void 0:h.tips)},q=()=>{n.value=[];let a=[];s.odata.personalManagerData.forEach(t=>{if(t.Status!=="Увольнение"&&t.Group===b.value&&v.value.some(o=>o.val&&o.activeText===t.Role)){let o=G(t.Description);a.push(t.Code),n.value.push({name:o+" ("+t.Role+")",days:[],contHour:0,code:t.Code,id:!1,ids:n.value.length})}}),se(a),B.value=!1},se=a=>{s.workSchedule.getWorkSchedule({code:a,date:$(new Date(k.value),"{Y}-{m}-{dd}")}).then(t=>{t.forEach((o,l)=>{o!==null&&(n.value[l].days=o.data.days,n.value[l].id=o.id)}),M()})},M=()=>{n.value.forEach(a=>{a.contHour=a.days.reduce((t,o)=>t+o.time,0)})},ce=a=>{n.value[a].days=[],M()},ge=a=>{switch(H.value){case"5":for(let t=T.value;t<=d.value.length;t++)d.value[t-1].holidays===""&&E(t,a,!0),d.value[t-1].holidays==="preholiday"&&(w.value-=1,E(t,a,!0),w.value+=1);break;case"2x2":for(let t=T.value;t<=d.value.length;t+=4)E(t,a,!0),t+1<=d.value.length&&E(t+1,a,!0);break;case"2x5":for(let t=T.value;t<=d.value.length;t+=7)for(let o=t;o<t+5&&o<=d.value.length;o++)d.value[o-1].holidays==="preholiday"?(w.value-=1,E(o,a,!0),w.value+=1):E(o,a,!0);break}},E=(a,t,o=!1)=>{const{date:l,ind:c}=z(a,t);c===-1?(n.value[t].days.push({day:l,time:w.value,tips:`(${V.value}:00 - ${V.value+w.value+1}:00)`}),M()):o||(w.value=n.value[t].days[c].time,V.value=parseInt(n.value[t].days[c].tips.slice(1,-12)))},he=(a,t)=>{const{ind:o}=z(a,t);n.value[t].days.splice(o,1),M(),document.querySelector(".app-main").click()},Q=(a,t)=>{const{date:o,ind:l}=z(a,t);n.value[t].days[l]={day:o,time:w.value,tips:`(${V.value}:00 - ${V.value+w.value+1}:00)`},M()},z=(a,t)=>{var c;const o=$(new Date(k.value).setDate(a),"{Y}-{m}-{dd}"),l=(c=n.value[t])==null?void 0:c.days.findIndex(m=>m.day===o);return{date:o,ind:l}},fe=async()=>{var K;C.value=!0;const a=new le.Workbook,t=a.addWorksheet(y(k.value,"month"),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),o={vertical:"middle",horizontal:"center"},l={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},c={vertical:"middle",horizontal:"center",wrapText:!0};t.mergeCells(`A1:${x("A1",d.value.length+5)}1`),t.mergeCells(`A2:${x("A2",d.value.length+5)}2`),t.mergeCells("A3:A4"),t.mergeCells(`B3:${x("B3",d.value.length)}3`),t.mergeCells(`${x("B3",d.value.length+1)}3:${x("B3",d.value.length+2)}3`),t.mergeCells(`${x("B3",d.value.length+3)}3:${x("B4",d.value.length+3)}4`),t.mergeCells(`${x("B3",d.value.length+4)}3:${x("B4",d.value.length+4)}4`),t.getCell("A1").value=r("workSchedule.firm"),t.getCell("A2").value=r("workSchedule.title",{name:b.value})+y(k.value,"month")+` ${new Date(k.value).getFullYear()}`,t.getCell("A3").value=r("workSchedule.month"),t.getCell("B3").value=r("workSchedule.numbersMonth"),t.getCell(3,d.value.length+2).value=r("workSchedule.onSchedule"),t.getCell(3,d.value.length+4).value=r("workSchedule.acquainted"),t.getCell(3,d.value.length+5).value=r("workSchedule.date"),t.getCell(4,d.value.length+2).value=r("workSchedule.days"),t.getCell(4,d.value.length+3).value=`${r("workSchedule.hours")} (${N.value})`;for(let f=2;f<=d.value.length+1;f++)t.getCell(4,f).value=d.value[f-2].weekday+`
|
|
2
|
+
`+(f-1),t.getColumn(f).width=6,t.getColumn(f).alignment=c,t.getCell(4,f).border=l;t.getRow(1).height=40,t.getRow(2).height=30,t.getRow(3).height=20,t.getColumn(1).width=15,t.getColumn(d.value.length+2).width=5,t.getColumn(d.value.length+3).width=6,t.getColumn(d.value.length+4).width=13,t.getColumn(d.value.length+5).width=13,t.getColumn(1).alignment=c,t.getCell("A2").alignment=o,t.getCell("A3").alignment=o,t.getCell("B3").alignment=o,t.getCell(3,d.value.length+2).alignment=o,t.getColumn(d.value.length+2).alignment=c,t.getColumn(d.value.length+3).alignment=c,t.getColumn(d.value.length+4).alignment=o,t.getColumn(d.value.length+5).alignment=o,t.getCell("A3").border=l,t.getCell("B3").border=l,t.getCell(3,d.value.length+2).border=l,t.getCell(4,d.value.length+2).border=l,t.getCell(3,d.value.length+4).border=l,t.getCell(3,d.value.length+5).border=l,t.getCell(4,d.value.length+3).border=l;let m=0;for(const f of n.value){let R=[f.name];for(let A=1;A<=d.value.length;A++){const{ind:W}=z(A,m);W!==-1?R[A]=`${f.days[W].time} ${f.days[W].tips}`:R[A]=" "}R.push(((K=f.days)==null?void 0:K.length)||" ",f.contHour||0);const pe=t.addRow(R);pe.border=l,m++}let p="Щербина Е. В.";s.odata.personalManagerData.forEach(f=>{f.Status!=="Увольнение"&&f.Role==="Начальник отдела правовой и кадровой работы"&&(p=f.Description)}),t.mergeCells(`A${n.value.length+6}:P${n.value.length+6}`),t.mergeCells(`Q${n.value.length+6}:AG${n.value.length+6}`),t.mergeCells(`B${n.value.length+8}:E${n.value.length+8}`),t.mergeCells(`F${n.value.length+8}:L${n.value.length+8}`),t.mergeCells(`M${n.value.length+8}:P${n.value.length+8}`),t.mergeCells(`S${n.value.length+8}:V${n.value.length+8}`),t.mergeCells(`W${n.value.length+8}:AC${n.value.length+8}`),t.mergeCells(`AD${n.value.length+8}:AG${n.value.length+8}`),t.mergeCells(`Z${n.value.length+9}:AA${n.value.length+9}`),t.getCell(`A${n.value.length+6}`).value=r("workSchedule.byInitials"),t.getCell(`Q${n.value.length+6}`).value=r("workSchedule.supervisorHR"),t.getCell(`B${n.value.length+8}`).value=r("workSchedule.compiled")+":",t.getCell(`S${n.value.length+8}`).value=r("workSchedule.approved")+":",t.getCell(`M${n.value.length+8}`).value=G(s.fullName),t.getCell(`AD${n.value.length+8}`).value=G(p),t.getCell(`Z${n.value.length+9}`).value=r("workSchedule.printPlace"),t.getCell(`A${n.value.length+6}`).alignment={vertical:"middle",horizontal:"right"},t.getCell(`Q${n.value.length+6}`).alignment={vertical:"middle",horizontal:"right"},t.getCell(`B${n.value.length+8}`).alignment={vertical:"middle",horizontal:"right"},t.getCell(`F${n.value.length+8}`).alignment={vertical:"middle",horizontal:"right"},t.getCell(`M${n.value.length+8}`).alignment={vertical:"middle",horizontal:"left"},t.getCell(`AD${n.value.length+8}`).alignment={vertical:"middle",horizontal:"left"},t.getCell(`Z${n.value.length+9}`).alignment=o,t.getCell(`F${n.value.length+8}`).border={bottom:{style:"thin"}},t.getCell(`W${n.value.length+8}`).border={bottom:{style:"thin"}};const h="export_"+$(Date.now(),"{dd}.{m}.{Y}")+".xlsx",S=await a.xlsx.writeBuffer();D.saveAs(new Blob([S]),h),C.value=!1},me=async()=>{I.value||s.workSchedule.addWorkSchedule({data:n.value,date:$(new Date(k.value),"{Y}-{m}-{dd}")}).then(a=>I.value=a)};return 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":ee.get("X-Token")||!1,"Cache-Control":"no-cache"},redirect:"follow",referrerPolicy:"no-referrer"}).then(a=>{if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);return a.json()}).then(a=>{J.value=a.result,X()}).catch(a=>{console.error("Ошибка загрузки файла:",a)}),(a,t)=>{const o=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",null,[u.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElSelect),{key:0,modelValue:b.value,"onUpdate:modelValue":t[0]||(t[0]=l=>b.value=l),placeholder:"Select",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,l=>(e.openBlock(),e.createBlock(e.unref(i.ElOption),{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),u.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:1,plain:"",onClick:t[1]||(t[1]=l=>B.value=!0),style:{"margin-bottom":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.jobTitle")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(i.ElSkeleton),{style:{width:"100%"},loading:L.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:ie,"empty-text":e.unref(r)("workSchedule.emptyText")},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.title",{name:b.value})+e.unref(y)(k.value,"month")+` ${new Date(k.value).getFullYear()}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.month"),width:"180",align:"center"},{default:e.withCtx(l=>[e.createElementVNode("div",ae,e.toDisplayString(n.value[l.$index].name),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.numbersMonth"),align:"center"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,l=>(e.openBlock(),e.createBlock(e.unref(i.ElTableColumn),{key:l.day,width:"45","class-name":l.holidays,align:"center",label:l.weekday+`
|
|
3
|
+
`+l.day.toString()},{default:e.withCtx(c=>[e.createElementVNode("div",ne,e.toDisplayString(Z(l.day,c.$index)||" "),1)]),_:2},1032,["class-name","label"]))),128))]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.onSchedule"),align:"center"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.days"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(n.value[l.$index].days.length||0),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:`${e.unref(r)("workSchedule.hours")} ( ${N.value} )`,align:"center"},{default:e.withCtx(l=>[e.createElementVNode("div",{style:e.normalizeStyle(`color: ${N.value===l.row.contHour?"green":"red"};`)},e.toDisplayString(l.row.contHour),5)]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["data","empty-text"])]),_:1},8,["loading"]),ue.value&&u.checkEdit?(e.openBlock(),e.createElementBlock("div",oe,[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.chartsFilled"))+": ",1),I.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:0,type:"primary",onClick:me},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.confirm")),1)]),_:1})),t[16]||(t[16]=e.createTextVNode()),e.createElementVNode("span",null,e.toDisplayString(u.fullName),1)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(i.ElButton),{disabled:C.value,plain:"",onClick:fe,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[o,C.value]]),e.createVNode(e.unref(i.ElDialog),{title:e.unref(r)("workSchedule.jobTitle"),modelValue:B.value,"onUpdate:modelValue":t[3]||(t[3]=l=>B.value=l),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(i.ElButton),{onClick:t[2]||(t[2]=l=>B.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:q},{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,l=>(e.openBlock(),e.createBlock(e.unref(i.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElSwitch),{modelValue:l.val,"onUpdate:modelValue":c=>l.val=c,"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(Y.ContextMenu),{show:j.value,"onUpdate:show":t[15]||(t[15]=l=>j.value=l),options:O.value},{default:e.withCtx(()=>[e.createVNode(e.unref(Y.ContextMenuItem),{label:g.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(Y.ContextMenuSeparator)),g.value.level===2?(e.openBlock(),e.createElementBlock("div",re,[e.createVNode(e.unref(i.ElRadioGroup),{modelValue:H.value,"onUpdate:modelValue":t[4]||(t[4]=l=>H.value=l),size:"small"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElRadioButton),{label:e.unref(r)("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"]),t[17]||(t[17]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.fromDate"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:T.value,"onUpdate:modelValue":t[5]||(t[5]=l=>T.value=l),step:1,min:1,max:d.value.length},null,8,["modelValue","max"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:V.value,"onUpdate:modelValue":t[6]||(t[6]=l=>V.value=l),step:1,min:8,max:11},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:w.value,"onUpdate:modelValue":t[7]||(t[7]=l=>w.value=l),step:1,min:4,max:12},null,8,["modelValue"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:t[8]||(t[8]=l=>ge(g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.fillOut")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:t[9]||(t[9]=l=>ce(g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.clearRow")),1)]),_:1})])):(e.openBlock(),e.createElementBlock("div",de,[e.createElementVNode("div",null,e.toDisplayString(Z(g.value.day,g.value.ids)),1),t[18]||(t[18]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:V.value,"onUpdate:modelValue":t[10]||(t[10]=l=>V.value=l),step:1,min:8,max:11,onChange:t[11]||(t[11]=l=>Q(g.value.day,g.value.ids))},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:w.value,"onUpdate:modelValue":t[12]||(t[12]=l=>w.value=l),step:1,min:4,max:12,onChange:t[13]||(t[13]=l=>Q(g.value.day,g.value.ids))},null,8,["modelValue"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:t[14]||(t[14]=l=>he(g.value.day,g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.delete")),1)]),_:1})]))]),_:1},8,["show","options"])])}}}});
|
|
@@ -0,0 +1,563 @@
|
|
|
1
|
+
import { ref as h, watch as ge, computed as Se, resolveDirective as be, openBlock as k, createElementBlock as z, createBlock as I, unref as a, withCtx as s, Fragment as te, renderList as ae, createCommentVNode as J, createTextVNode as D, toDisplayString as m, createVNode as d, createElementVNode as b, normalizeStyle as $e, withDirectives as xe } from "vue";
|
|
2
|
+
import { saveAs as De } from "file-saver";
|
|
3
|
+
import * as Ee from "exceljs";
|
|
4
|
+
import { useI18n as Ve } from "vue-i18n";
|
|
5
|
+
import { ElSelect as Me, ElOption as Te, ElButton as B, ElSkeleton as Ae, ElSkeletonItem as N, ElTable as Be, ElTableColumn as R, ElDialog as Fe, ElForm as ze, ElFormItem as Ie, ElSwitch as Re, ElRadioGroup as Ye, ElRadioButton as ne, ElSlider as W } from "element-plus";
|
|
6
|
+
import { ContextMenu as Ge, ContextMenuItem as He, ContextMenuSeparator as Ue } from "@imengyu/vue3-context-menu";
|
|
7
|
+
import je from "js-cookie";
|
|
8
|
+
function P(v, u) {
|
|
9
|
+
if (arguments.length === 0 || !v)
|
|
10
|
+
return null;
|
|
11
|
+
const E = u || "{Y}-{m}-{d} {G}:{i}:{s}";
|
|
12
|
+
let i;
|
|
13
|
+
typeof v == "object" ? i = v : (typeof v == "string" && (/^[0-9]+$/.test(v) ? v = parseInt(v) : v = v.replace(new RegExp(/-/gm), "/")), typeof v == "number" && v.toString().length === 10 && (v = v * 1e3), i = new Date(v));
|
|
14
|
+
const $ = useApp(), n = $.language + "-" + $.language.toUpperCase(), O = {
|
|
15
|
+
Y: i.getFullYear(),
|
|
16
|
+
m: (i.getMonth() + 1).toString().padStart(2, "0"),
|
|
17
|
+
d: i.getDate(),
|
|
18
|
+
dd: i.getDate().toString().padStart(2, "0"),
|
|
19
|
+
G: i.getHours(),
|
|
20
|
+
H: i.getHours().toString().padStart(2, "0"),
|
|
21
|
+
i: i.getMinutes().toString().padStart(2, "0"),
|
|
22
|
+
s: i.getSeconds().toString().padStart(2, "0"),
|
|
23
|
+
// D: this.$t('el.datepicker.weeks.' + new Intl.DateTimeFormat('en-En',{weekday: 'short'}).format(date)),
|
|
24
|
+
// F: this.$t('el.datepicker.month' + (date.getMonth() + 1)),
|
|
25
|
+
// M: this.$t('el.datepicker.months.' + Intl.DateTimeFormat('en-En',{month: 'short'}).format(date))
|
|
26
|
+
D: new Intl.DateTimeFormat(n, { weekday: "short" }).format(i),
|
|
27
|
+
F: new Intl.DateTimeFormat(n, { month: "long" }).format(i),
|
|
28
|
+
M: new Intl.DateTimeFormat(n, { month: "short" }).format(i)
|
|
29
|
+
};
|
|
30
|
+
return E.replace(/{(dd|[YmdGHisDFM])+}/g, (S, r) => O[r]);
|
|
31
|
+
}
|
|
32
|
+
function M(v, u) {
|
|
33
|
+
let i = v.replace(/[0-9]/g, "").split("").reverse().map(($) => $.charCodeAt(0));
|
|
34
|
+
return process(i, u, 0), i.map(($) => String.fromCharCode($)).reverse().join("");
|
|
35
|
+
}
|
|
36
|
+
function oe(v) {
|
|
37
|
+
return v.split(" ", 3).map((u, E) => E !== 0 ? u.slice(0, 1) + "." : u).join(" ");
|
|
38
|
+
}
|
|
39
|
+
const Ne = { style: { height: "100px", width: "100%", display: "inline-block" } }, We = { style: { height: "100px", width: "100%", display: "inline-block" } }, Pe = {
|
|
40
|
+
key: 2,
|
|
41
|
+
class: "controls-container"
|
|
42
|
+
}, Oe = {
|
|
43
|
+
key: 0,
|
|
44
|
+
style: { padding: "0.5em 1.5em" }
|
|
45
|
+
}, Le = {
|
|
46
|
+
key: 1,
|
|
47
|
+
style: { padding: "0.5em 1.5em" }
|
|
48
|
+
}, el = {
|
|
49
|
+
__name: "WorkTable",
|
|
50
|
+
props: {
|
|
51
|
+
checkEdit: { type: Boolean, default: () => !0 },
|
|
52
|
+
data: Object,
|
|
53
|
+
workSchedule: Object,
|
|
54
|
+
fullName: { type: String, default: "Вы" }
|
|
55
|
+
},
|
|
56
|
+
setup(v) {
|
|
57
|
+
const { t: u, d: E } = Ve(), i = v, $ = h(!1), n = h([
|
|
58
|
+
// { name: 'Иванов П.М. (Ведущий работник месяца)',
|
|
59
|
+
// days: [], // {day: "2024-11-01", tips: '(9:00 - 18:00)', time: 8 }
|
|
60
|
+
// contHour: 0,
|
|
61
|
+
// code: '0000-00052',
|
|
62
|
+
// ids: 0
|
|
63
|
+
// },
|
|
64
|
+
// { name: 'Петров И.С. (Ведущий работник месяца)',
|
|
65
|
+
// days: [], // {day: "2024-11-01", tips: '(9:00 - 18:00)', time: 8 }
|
|
66
|
+
// contHour: 0,
|
|
67
|
+
// code: '0000-00052'
|
|
68
|
+
// ids: 1
|
|
69
|
+
// }
|
|
70
|
+
]), O = h(1), S = h(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1).setMonth((/* @__PURE__ */ new Date()).getMonth() + Number(O.value))), r = h([]), Y = h(0), V = h(9), C = h(8), L = h(!1), ue = h(!0), G = h(!1), Q = h("5"), H = h(1), T = h("Сектор разработок и эксплуатации сети"), K = h([]), A = h([]), c = h({ name: "Имя", length: 0, code: "" }), X = h(!1), _ = h({
|
|
71
|
+
zIndex: 30,
|
|
72
|
+
minWidth: 220,
|
|
73
|
+
x: 500,
|
|
74
|
+
y: 200
|
|
75
|
+
}), re = h([]);
|
|
76
|
+
ge(T, async (t, e) => {
|
|
77
|
+
t !== e && (A.value = [], L.value = !1, i.odata.personalManagerData.forEach((o) => {
|
|
78
|
+
o.Status !== "Увольнение" && o.Group === t && (A.value.some((l) => (l == null ? void 0 : l.activeText) === o.Role) || A.value.push({ val: !0, activeText: o.Role }));
|
|
79
|
+
}), ee());
|
|
80
|
+
}), ge(O, async (t, e) => {
|
|
81
|
+
t !== e && (S.value = new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1).setMonth((/* @__PURE__ */ new Date()).getMonth() + Number(t)), de());
|
|
82
|
+
});
|
|
83
|
+
const he = (t, e, o, l) => {
|
|
84
|
+
c.value.ids = t.ids, c.value.key = t.key, c.value.add = t.days.length > 0 && t.days[t.days.length - 1].cont, c.value.level = e.level, c.value.day = o.cellIndex, _.value.y = l.clientY, _.value.x = l.clientX, e.level === 2 && e.no === 0 && i.checkEdit && (c.value.name = u("workSchedule.autocomplete"), X.value = !0), e.level === 3 && o.cellIndex - e.no === 1 && i.checkEdit && (F(o.cellIndex, t.ids), c.value.name = u("workSchedule.modeSelection"), X.value = !0);
|
|
85
|
+
}, de = () => {
|
|
86
|
+
const t = re.value, e = new Date(S.value), o = new Date(e.getFullYear(), e.getMonth() + 1, 0).getDate();
|
|
87
|
+
let l = [], g = 0;
|
|
88
|
+
for (let y = 1; y <= o; y++) {
|
|
89
|
+
const w = P(e.setDate(y), "{Y}-{m}-{dd}");
|
|
90
|
+
g += t.nowork.includes(w) || t.holidays.includes(w) ? 0 : t.preholidays.includes(w) ? 7 : 8;
|
|
91
|
+
const p = t.nowork.includes(w) ? "nowork" : t.holidays.includes(w) ? "holiday" : t.preholidays.includes(w) ? "preholiday" : "";
|
|
92
|
+
l.push({ day: y, holidays: p, weekday: E(new Date(e.getFullYear(), e.getMonth(), y), "day") });
|
|
93
|
+
}
|
|
94
|
+
Y.value = g, r.value = l, i.odata.getPersonalManagerData({}).then((y) => {
|
|
95
|
+
var w;
|
|
96
|
+
T.value = (w = y.find((p) => p.Status !== "Увольнение" && p.Description === i.fullName)) == null ? void 0 : w.Group, y.forEach((p) => {
|
|
97
|
+
p.Status !== "Увольнение" && (K.value.some((x) => (x == null ? void 0 : x.value) === p.Group) || K.value.push({ value: p.Group, label: p.Group, key: p.Group }), p.Group === T.value && !A.value.some((x) => (x == null ? void 0 : x.activeText) === p.Role) && A.value.push({ val: !0, activeText: p.Role }));
|
|
98
|
+
}), ee(), ue.value = !1;
|
|
99
|
+
});
|
|
100
|
+
}, me = Se(() => !n.value.some((t) => t.contHour !== Y.value)), ie = (t, e) => {
|
|
101
|
+
var y, w, p;
|
|
102
|
+
const o = new Date(S.value), l = `${o.getFullYear()}-${(o.getMonth() + 1).toString().padStart(2, "0")}-${t.toString().padStart(2, "0")}`, g = (y = n.value[e]) == null ? void 0 : y.days.findIndex((x) => x.day === l);
|
|
103
|
+
return e === -1 || g === -1 ? "" : ((w = n.value[e].days[g]) == null ? void 0 : w.time) + " " + ((p = n.value[e].days[g]) == null ? void 0 : p.tips);
|
|
104
|
+
}, ee = () => {
|
|
105
|
+
n.value = [];
|
|
106
|
+
let t = [];
|
|
107
|
+
i.odata.personalManagerData.forEach((e) => {
|
|
108
|
+
if (e.Status !== "Увольнение" && e.Group === T.value && A.value.some((o) => o.val && o.activeText === e.Role)) {
|
|
109
|
+
let o = oe(e.Description);
|
|
110
|
+
t.push(e.Code), n.value.push({ name: o + " (" + e.Role + ")", days: [], contHour: 0, code: e.Code, id: !1, ids: n.value.length });
|
|
111
|
+
}
|
|
112
|
+
}), ce(t), G.value = !1;
|
|
113
|
+
}, ce = (t) => {
|
|
114
|
+
i.workSchedule.getWorkSchedule({ code: t, date: P(new Date(S.value), "{Y}-{m}-{dd}") }).then(
|
|
115
|
+
(e) => {
|
|
116
|
+
e.forEach((o, l) => {
|
|
117
|
+
o !== null && (n.value[l].days = o.data.days, n.value[l].id = o.id);
|
|
118
|
+
}), U();
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
}, U = () => {
|
|
122
|
+
n.value.forEach((t) => {
|
|
123
|
+
t.contHour = t.days.reduce((e, o) => e + o.time, 0);
|
|
124
|
+
});
|
|
125
|
+
}, pe = (t) => {
|
|
126
|
+
n.value[t].days = [], U();
|
|
127
|
+
}, fe = (t) => {
|
|
128
|
+
switch (Q.value) {
|
|
129
|
+
case "5":
|
|
130
|
+
for (let e = H.value; e <= r.value.length; e++)
|
|
131
|
+
r.value[e - 1].holidays === "" && F(e, t, !0), r.value[e - 1].holidays === "preholiday" && (C.value -= 1, F(e, t, !0), C.value += 1);
|
|
132
|
+
break;
|
|
133
|
+
case "2x2":
|
|
134
|
+
for (let e = H.value; e <= r.value.length; e += 4)
|
|
135
|
+
F(e, t, !0), e + 1 <= r.value.length && F(e + 1, t, !0);
|
|
136
|
+
break;
|
|
137
|
+
case "2x5":
|
|
138
|
+
for (let e = H.value; e <= r.value.length; e += 7)
|
|
139
|
+
for (let o = e; o < e + 5 && o <= r.value.length; o++)
|
|
140
|
+
r.value[o - 1].holidays === "preholiday" ? (C.value -= 1, F(o, t, !0), C.value += 1) : F(o, t, !0);
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
}, F = (t, e, o = !1) => {
|
|
144
|
+
const { date: l, ind: g } = Z(t, e);
|
|
145
|
+
g === -1 ? (n.value[e].days.push({
|
|
146
|
+
day: l,
|
|
147
|
+
time: C.value,
|
|
148
|
+
tips: `(${V.value}:00 - ${V.value + C.value + 1}:00)`
|
|
149
|
+
}), U()) : o || (C.value = n.value[e].days[g].time, V.value = parseInt(n.value[e].days[g].tips.slice(1, -12)));
|
|
150
|
+
}, ye = (t, e) => {
|
|
151
|
+
const { ind: o } = Z(t, e);
|
|
152
|
+
n.value[e].days.splice(o, 1), U(), document.querySelector(".app-main").click();
|
|
153
|
+
}, se = (t, e) => {
|
|
154
|
+
const { date: o, ind: l } = Z(t, e);
|
|
155
|
+
n.value[e].days[l] = {
|
|
156
|
+
day: o,
|
|
157
|
+
time: C.value,
|
|
158
|
+
tips: `(${V.value}:00 - ${V.value + C.value + 1}:00)`
|
|
159
|
+
}, U();
|
|
160
|
+
}, Z = (t, e) => {
|
|
161
|
+
var g;
|
|
162
|
+
const o = P(new Date(S.value).setDate(t), "{Y}-{m}-{dd}"), l = (g = n.value[e]) == null ? void 0 : g.days.findIndex((y) => y.day === o);
|
|
163
|
+
return { date: o, ind: l };
|
|
164
|
+
}, we = async () => {
|
|
165
|
+
var ve;
|
|
166
|
+
$.value = !0;
|
|
167
|
+
const t = new Ee.Workbook(), e = t.addWorksheet(E(S.value, "month"), { pageSetup: { paperSize: 9, orientation: "landscape", fitToPage: !0 } }), o = { vertical: "middle", horizontal: "center" }, l = { top: { style: "thin" }, left: { style: "thin" }, bottom: { style: "thin" }, right: { style: "thin" } }, g = { vertical: "middle", horizontal: "center", wrapText: !0 };
|
|
168
|
+
e.mergeCells(`A1:${M("A1", r.value.length + 5)}1`), e.mergeCells(`A2:${M("A2", r.value.length + 5)}2`), e.mergeCells("A3:A4"), e.mergeCells(`B3:${M("B3", r.value.length)}3`), e.mergeCells(`${M("B3", r.value.length + 1)}3:${M("B3", r.value.length + 2)}3`), e.mergeCells(`${M("B3", r.value.length + 3)}3:${M("B4", r.value.length + 3)}4`), e.mergeCells(`${M("B3", r.value.length + 4)}3:${M("B4", r.value.length + 4)}4`), e.getCell("A1").value = u("workSchedule.firm"), e.getCell("A2").value = u("workSchedule.title", { name: T.value }) + E(S.value, "month") + ` ${new Date(S.value).getFullYear()}`, e.getCell("A3").value = u("workSchedule.month"), e.getCell("B3").value = u("workSchedule.numbersMonth"), e.getCell(3, r.value.length + 2).value = u("workSchedule.onSchedule"), e.getCell(3, r.value.length + 4).value = u("workSchedule.acquainted"), e.getCell(3, r.value.length + 5).value = u("workSchedule.date"), e.getCell(4, r.value.length + 2).value = u("workSchedule.days"), e.getCell(4, r.value.length + 3).value = `${u("workSchedule.hours")} (${Y.value})`;
|
|
169
|
+
for (let f = 2; f <= r.value.length + 1; f++)
|
|
170
|
+
e.getCell(4, f).value = r.value[f - 2].weekday + `
|
|
171
|
+
` + (f - 1), e.getColumn(f).width = 6, e.getColumn(f).alignment = g, e.getCell(4, f).border = l;
|
|
172
|
+
e.getRow(1).height = 40, e.getRow(2).height = 30, e.getRow(3).height = 20, e.getColumn(1).width = 15, e.getColumn(r.value.length + 2).width = 5, e.getColumn(r.value.length + 3).width = 6, e.getColumn(r.value.length + 4).width = 13, e.getColumn(r.value.length + 5).width = 13, e.getColumn(1).alignment = g, e.getCell("A2").alignment = o, e.getCell("A3").alignment = o, e.getCell("B3").alignment = o, e.getCell(3, r.value.length + 2).alignment = o, e.getColumn(r.value.length + 2).alignment = g, e.getColumn(r.value.length + 3).alignment = g, e.getColumn(r.value.length + 4).alignment = o, e.getColumn(r.value.length + 5).alignment = o, e.getCell("A3").border = l, e.getCell("B3").border = l, e.getCell(3, r.value.length + 2).border = l, e.getCell(4, r.value.length + 2).border = l, e.getCell(3, r.value.length + 4).border = l, e.getCell(3, r.value.length + 5).border = l, e.getCell(4, r.value.length + 3).border = l;
|
|
173
|
+
let y = 0;
|
|
174
|
+
for (const f of n.value) {
|
|
175
|
+
let q = [f.name];
|
|
176
|
+
for (let j = 1; j <= r.value.length; j++) {
|
|
177
|
+
const { ind: le } = Z(j, y);
|
|
178
|
+
le !== -1 ? q[j] = `${f.days[le].time} ${f.days[le].tips}` : q[j] = " ";
|
|
179
|
+
}
|
|
180
|
+
q.push(((ve = f.days) == null ? void 0 : ve.length) || " ", f.contHour || 0);
|
|
181
|
+
const Ce = e.addRow(q);
|
|
182
|
+
Ce.border = l, y++;
|
|
183
|
+
}
|
|
184
|
+
let w = "Щербина Е. В.";
|
|
185
|
+
i.odata.personalManagerData.forEach((f) => {
|
|
186
|
+
f.Status !== "Увольнение" && f.Role === "Начальник отдела правовой и кадровой работы" && (w = f.Description);
|
|
187
|
+
}), 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 = u("workSchedule.byInitials"), e.getCell(`Q${n.value.length + 6}`).value = u("workSchedule.supervisorHR"), e.getCell(`B${n.value.length + 8}`).value = u("workSchedule.compiled") + ":", e.getCell(`S${n.value.length + 8}`).value = u("workSchedule.approved") + ":", e.getCell(`M${n.value.length + 8}`).value = oe(i.fullName), e.getCell(`AD${n.value.length + 8}`).value = oe(w), e.getCell(`Z${n.value.length + 9}`).value = u("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 = o, e.getCell(`F${n.value.length + 8}`).border = { bottom: { style: "thin" } }, e.getCell(`W${n.value.length + 8}`).border = { bottom: { style: "thin" } };
|
|
188
|
+
const p = "export_" + P(Date.now(), "{dd}.{m}.{Y}") + ".xlsx", x = await t.xlsx.writeBuffer();
|
|
189
|
+
De(new Blob([x]), p), $.value = !1;
|
|
190
|
+
}, ke = async () => {
|
|
191
|
+
L.value || i.workSchedule.addWorkSchedule({ data: n.value, date: P(new Date(S.value), "{Y}-{m}-{dd}") }).then((t) => L.value = t);
|
|
192
|
+
};
|
|
193
|
+
return fetch(
|
|
194
|
+
"https://cp.avanta-telecom.ru/api/v2/calendar/getHoliday",
|
|
195
|
+
{
|
|
196
|
+
method: "GET",
|
|
197
|
+
// *GET, POST, PUT, DELETE, etc.
|
|
198
|
+
mode: "cors",
|
|
199
|
+
// no-cors, *cors, same-origin
|
|
200
|
+
cache: "default",
|
|
201
|
+
// *default, no-cache, reload, force-cache, only-if-cached
|
|
202
|
+
credentials: "same-origin",
|
|
203
|
+
// include, *same-origin, omit
|
|
204
|
+
headers: {
|
|
205
|
+
"Content-Type": "application/json",
|
|
206
|
+
Accept: "text/html",
|
|
207
|
+
"X-Token": je.get("X-Token") || !1,
|
|
208
|
+
"Cache-Control": "no-cache"
|
|
209
|
+
},
|
|
210
|
+
redirect: "follow",
|
|
211
|
+
// manual, *follow, error
|
|
212
|
+
referrerPolicy: "no-referrer"
|
|
213
|
+
// no-referrer, *client
|
|
214
|
+
// body: JSON.stringify(data), // body data type must match "Content-Type" header
|
|
215
|
+
}
|
|
216
|
+
).then((t) => {
|
|
217
|
+
if (!t.ok)
|
|
218
|
+
throw new Error(`HTTP error! status: ${t.status}`);
|
|
219
|
+
return t.json();
|
|
220
|
+
}).then((t) => {
|
|
221
|
+
re.value = t.result, de();
|
|
222
|
+
}).catch((t) => {
|
|
223
|
+
console.error("Ошибка загрузки файла:", t);
|
|
224
|
+
}), (t, e) => {
|
|
225
|
+
const o = be("loading");
|
|
226
|
+
return k(), z("div", null, [
|
|
227
|
+
v.checkEdit ? (k(), I(a(Me), {
|
|
228
|
+
key: 0,
|
|
229
|
+
modelValue: T.value,
|
|
230
|
+
"onUpdate:modelValue": e[0] || (e[0] = (l) => T.value = l),
|
|
231
|
+
placeholder: "Select",
|
|
232
|
+
style: { width: "240px", "margin-bottom": ".5rem", "margin-right": ".5rem" }
|
|
233
|
+
}, {
|
|
234
|
+
default: s(() => [
|
|
235
|
+
(k(!0), z(te, null, ae(K.value, (l) => (k(), I(a(Te), {
|
|
236
|
+
key: l.value,
|
|
237
|
+
label: l.label,
|
|
238
|
+
value: l.value
|
|
239
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
240
|
+
]),
|
|
241
|
+
_: 1
|
|
242
|
+
}, 8, ["modelValue"])) : J("", !0),
|
|
243
|
+
v.checkEdit ? (k(), I(a(B), {
|
|
244
|
+
key: 1,
|
|
245
|
+
plain: "",
|
|
246
|
+
onClick: e[1] || (e[1] = (l) => G.value = !0),
|
|
247
|
+
style: { "margin-bottom": ".5rem" }
|
|
248
|
+
}, {
|
|
249
|
+
default: s(() => [
|
|
250
|
+
D(m(a(u)("workSchedule.jobTitle")), 1)
|
|
251
|
+
]),
|
|
252
|
+
_: 1
|
|
253
|
+
})) : J("", !0),
|
|
254
|
+
d(a(Ae), {
|
|
255
|
+
style: { width: "100%" },
|
|
256
|
+
loading: ue.value,
|
|
257
|
+
animated: ""
|
|
258
|
+
}, {
|
|
259
|
+
template: s(() => [
|
|
260
|
+
d(a(N), {
|
|
261
|
+
variant: "text",
|
|
262
|
+
style: { width: "100%", height: "2rem" }
|
|
263
|
+
}),
|
|
264
|
+
d(a(N), {
|
|
265
|
+
variant: "text",
|
|
266
|
+
style: { width: "180px", height: "4rem", "margin-right": "4px" }
|
|
267
|
+
}),
|
|
268
|
+
d(a(N), {
|
|
269
|
+
variant: "text",
|
|
270
|
+
style: { width: "calc( 100% - 184px)", height: "4rem" }
|
|
271
|
+
}),
|
|
272
|
+
d(a(N), {
|
|
273
|
+
variant: "text",
|
|
274
|
+
style: { width: "180px", height: "8rem", "margin-right": "4px" }
|
|
275
|
+
}),
|
|
276
|
+
d(a(N), {
|
|
277
|
+
variant: "text",
|
|
278
|
+
style: { width: "calc( 100% - 184px)", height: "8rem" }
|
|
279
|
+
})
|
|
280
|
+
]),
|
|
281
|
+
default: s(() => [
|
|
282
|
+
d(a(Be), {
|
|
283
|
+
id: "printTable",
|
|
284
|
+
data: n.value,
|
|
285
|
+
style: { width: "100%" },
|
|
286
|
+
size: "small",
|
|
287
|
+
align: "center",
|
|
288
|
+
onCellClick: he,
|
|
289
|
+
"empty-text": a(u)("workSchedule.emptyText")
|
|
290
|
+
}, {
|
|
291
|
+
default: s(() => [
|
|
292
|
+
d(a(R), {
|
|
293
|
+
label: a(u)("workSchedule.title", { name: T.value }) + a(E)(S.value, "month") + ` ${new Date(S.value).getFullYear()}`,
|
|
294
|
+
align: "center",
|
|
295
|
+
height: "34"
|
|
296
|
+
}, {
|
|
297
|
+
default: s(() => [
|
|
298
|
+
d(a(R), {
|
|
299
|
+
label: a(u)("workSchedule.month"),
|
|
300
|
+
width: "180",
|
|
301
|
+
align: "center"
|
|
302
|
+
}, {
|
|
303
|
+
default: s((l) => [
|
|
304
|
+
b("div", Ne, m(n.value[l.$index].name), 1)
|
|
305
|
+
]),
|
|
306
|
+
_: 1
|
|
307
|
+
}, 8, ["label"]),
|
|
308
|
+
d(a(R), {
|
|
309
|
+
label: a(u)("workSchedule.numbersMonth"),
|
|
310
|
+
align: "center"
|
|
311
|
+
}, {
|
|
312
|
+
default: s(() => [
|
|
313
|
+
(k(!0), z(te, null, ae(r.value, (l) => (k(), I(a(R), {
|
|
314
|
+
key: l.day,
|
|
315
|
+
width: "45",
|
|
316
|
+
"class-name": l.holidays,
|
|
317
|
+
align: "center",
|
|
318
|
+
label: l.weekday + `
|
|
319
|
+
` + l.day.toString()
|
|
320
|
+
}, {
|
|
321
|
+
default: s((g) => [
|
|
322
|
+
b("div", We, m(ie(l.day, g.$index) || " "), 1)
|
|
323
|
+
]),
|
|
324
|
+
_: 2
|
|
325
|
+
}, 1032, ["class-name", "label"]))), 128))
|
|
326
|
+
]),
|
|
327
|
+
_: 1
|
|
328
|
+
}, 8, ["label"]),
|
|
329
|
+
d(a(R), {
|
|
330
|
+
label: a(u)("workSchedule.onSchedule"),
|
|
331
|
+
align: "center"
|
|
332
|
+
}, {
|
|
333
|
+
default: s(() => [
|
|
334
|
+
d(a(R), {
|
|
335
|
+
label: a(u)("workSchedule.days"),
|
|
336
|
+
align: "center"
|
|
337
|
+
}, {
|
|
338
|
+
default: s((l) => [
|
|
339
|
+
D(m(n.value[l.$index].days.length || 0), 1)
|
|
340
|
+
]),
|
|
341
|
+
_: 1
|
|
342
|
+
}, 8, ["label"]),
|
|
343
|
+
d(a(R), {
|
|
344
|
+
label: `${a(u)("workSchedule.hours")} ( ${Y.value} )`,
|
|
345
|
+
align: "center"
|
|
346
|
+
}, {
|
|
347
|
+
default: s((l) => [
|
|
348
|
+
b("div", {
|
|
349
|
+
style: $e(`color: ${Y.value === l.row.contHour ? "green" : "red"};`)
|
|
350
|
+
}, m(l.row.contHour), 5)
|
|
351
|
+
]),
|
|
352
|
+
_: 1
|
|
353
|
+
}, 8, ["label"])
|
|
354
|
+
]),
|
|
355
|
+
_: 1
|
|
356
|
+
}, 8, ["label"])
|
|
357
|
+
]),
|
|
358
|
+
_: 1
|
|
359
|
+
}, 8, ["label"])
|
|
360
|
+
]),
|
|
361
|
+
_: 1
|
|
362
|
+
}, 8, ["data", "empty-text"])
|
|
363
|
+
]),
|
|
364
|
+
_: 1
|
|
365
|
+
}, 8, ["loading"]),
|
|
366
|
+
me.value && v.checkEdit ? (k(), z("div", Pe, [
|
|
367
|
+
D(m(a(u)("workSchedule.chartsFilled")) + ": ", 1),
|
|
368
|
+
L.value ? J("", !0) : (k(), I(a(B), {
|
|
369
|
+
key: 0,
|
|
370
|
+
type: "primary",
|
|
371
|
+
onClick: ke
|
|
372
|
+
}, {
|
|
373
|
+
default: s(() => [
|
|
374
|
+
D(m(a(u)("workSchedule.confirm")), 1)
|
|
375
|
+
]),
|
|
376
|
+
_: 1
|
|
377
|
+
})),
|
|
378
|
+
e[16] || (e[16] = D()),
|
|
379
|
+
b("span", null, m(v.fullName), 1)
|
|
380
|
+
])) : J("", !0),
|
|
381
|
+
xe((k(), I(a(B), {
|
|
382
|
+
disabled: $.value,
|
|
383
|
+
plain: "",
|
|
384
|
+
onClick: we,
|
|
385
|
+
style: { "margin-top": ".5rem" }
|
|
386
|
+
}, {
|
|
387
|
+
default: s(() => [
|
|
388
|
+
D(m(a(u)("workSchedule.exportExcel")), 1)
|
|
389
|
+
]),
|
|
390
|
+
_: 1
|
|
391
|
+
}, 8, ["disabled"])), [
|
|
392
|
+
[o, $.value]
|
|
393
|
+
]),
|
|
394
|
+
d(a(Fe), {
|
|
395
|
+
title: a(u)("workSchedule.jobTitle"),
|
|
396
|
+
modelValue: G.value,
|
|
397
|
+
"onUpdate:modelValue": e[3] || (e[3] = (l) => G.value = l),
|
|
398
|
+
width: "400px"
|
|
399
|
+
}, {
|
|
400
|
+
footer: s(() => [
|
|
401
|
+
d(a(B), {
|
|
402
|
+
onClick: e[2] || (e[2] = (l) => G.value = !1),
|
|
403
|
+
size: "default"
|
|
404
|
+
}, {
|
|
405
|
+
default: s(() => [
|
|
406
|
+
D(m(t.$t("workSchedule.cancel")), 1)
|
|
407
|
+
]),
|
|
408
|
+
_: 1
|
|
409
|
+
}),
|
|
410
|
+
d(a(B), {
|
|
411
|
+
size: "default",
|
|
412
|
+
type: "primary",
|
|
413
|
+
onClick: ee
|
|
414
|
+
}, {
|
|
415
|
+
default: s(() => [
|
|
416
|
+
D(m(t.$t("workSchedule.select")), 1)
|
|
417
|
+
]),
|
|
418
|
+
_: 1
|
|
419
|
+
})
|
|
420
|
+
]),
|
|
421
|
+
default: s(() => [
|
|
422
|
+
d(a(ze), {
|
|
423
|
+
ref: "dialogForm",
|
|
424
|
+
model: A.value,
|
|
425
|
+
autocomplete: "on"
|
|
426
|
+
}, {
|
|
427
|
+
default: s(() => [
|
|
428
|
+
(k(!0), z(te, null, ae(A.value, (l) => (k(), I(a(Ie), null, {
|
|
429
|
+
default: s(() => [
|
|
430
|
+
d(a(Re), {
|
|
431
|
+
modelValue: l.val,
|
|
432
|
+
"onUpdate:modelValue": (g) => l.val = g,
|
|
433
|
+
"active-text": l.activeText
|
|
434
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "active-text"])
|
|
435
|
+
]),
|
|
436
|
+
_: 2
|
|
437
|
+
}, 1024))), 256))
|
|
438
|
+
]),
|
|
439
|
+
_: 1
|
|
440
|
+
}, 8, ["model"])
|
|
441
|
+
]),
|
|
442
|
+
_: 1
|
|
443
|
+
}, 8, ["title", "modelValue"]),
|
|
444
|
+
d(a(Ge), {
|
|
445
|
+
show: X.value,
|
|
446
|
+
"onUpdate:show": e[15] || (e[15] = (l) => X.value = l),
|
|
447
|
+
options: _.value
|
|
448
|
+
}, {
|
|
449
|
+
default: s(() => [
|
|
450
|
+
d(a(He), {
|
|
451
|
+
label: c.value.name,
|
|
452
|
+
disabled: ""
|
|
453
|
+
}, null, 8, ["label"]),
|
|
454
|
+
d(a(Ue)),
|
|
455
|
+
c.value.level === 2 ? (k(), z("div", Oe, [
|
|
456
|
+
d(a(Ye), {
|
|
457
|
+
modelValue: Q.value,
|
|
458
|
+
"onUpdate:modelValue": e[4] || (e[4] = (l) => Q.value = l),
|
|
459
|
+
size: "small"
|
|
460
|
+
}, {
|
|
461
|
+
default: s(() => [
|
|
462
|
+
d(a(ne), {
|
|
463
|
+
label: a(u)("workSchedule.Days5"),
|
|
464
|
+
value: "5"
|
|
465
|
+
}, null, 8, ["label"]),
|
|
466
|
+
d(a(ne), {
|
|
467
|
+
label: "2 Х 2",
|
|
468
|
+
value: "2x2"
|
|
469
|
+
}),
|
|
470
|
+
d(a(ne), {
|
|
471
|
+
label: "2 Х 5",
|
|
472
|
+
value: "2x5"
|
|
473
|
+
})
|
|
474
|
+
]),
|
|
475
|
+
_: 1
|
|
476
|
+
}, 8, ["modelValue"]),
|
|
477
|
+
e[17] || (e[17] = b("br", null, null, -1)),
|
|
478
|
+
b("span", null, m(a(u)("workSchedule.fromDate")) + ":", 1),
|
|
479
|
+
d(a(W), {
|
|
480
|
+
modelValue: H.value,
|
|
481
|
+
"onUpdate:modelValue": e[5] || (e[5] = (l) => H.value = l),
|
|
482
|
+
step: 1,
|
|
483
|
+
min: 1,
|
|
484
|
+
max: r.value.length
|
|
485
|
+
}, null, 8, ["modelValue", "max"]),
|
|
486
|
+
b("span", null, m(a(u)("workSchedule.with")) + ":", 1),
|
|
487
|
+
d(a(W), {
|
|
488
|
+
modelValue: V.value,
|
|
489
|
+
"onUpdate:modelValue": e[6] || (e[6] = (l) => V.value = l),
|
|
490
|
+
step: 1,
|
|
491
|
+
min: 8,
|
|
492
|
+
max: 11
|
|
493
|
+
}, null, 8, ["modelValue"]),
|
|
494
|
+
b("span", null, m(a(u)("workSchedule.duration")) + ":", 1),
|
|
495
|
+
d(a(W), {
|
|
496
|
+
modelValue: C.value,
|
|
497
|
+
"onUpdate:modelValue": e[7] || (e[7] = (l) => C.value = l),
|
|
498
|
+
step: 1,
|
|
499
|
+
min: 4,
|
|
500
|
+
max: 12
|
|
501
|
+
}, null, 8, ["modelValue"]),
|
|
502
|
+
d(a(B), {
|
|
503
|
+
style: { "margin-top": ".5rem" },
|
|
504
|
+
size: "small",
|
|
505
|
+
onClick: e[8] || (e[8] = (l) => fe(c.value.ids))
|
|
506
|
+
}, {
|
|
507
|
+
default: s(() => [
|
|
508
|
+
D(m(a(u)("workSchedule.fillOut")), 1)
|
|
509
|
+
]),
|
|
510
|
+
_: 1
|
|
511
|
+
}),
|
|
512
|
+
d(a(B), {
|
|
513
|
+
style: { "margin-top": ".5rem" },
|
|
514
|
+
size: "small",
|
|
515
|
+
onClick: e[9] || (e[9] = (l) => pe(c.value.ids))
|
|
516
|
+
}, {
|
|
517
|
+
default: s(() => [
|
|
518
|
+
D(m(a(u)("workSchedule.clearRow")), 1)
|
|
519
|
+
]),
|
|
520
|
+
_: 1
|
|
521
|
+
})
|
|
522
|
+
])) : (k(), z("div", Le, [
|
|
523
|
+
b("div", null, m(ie(c.value.day, c.value.ids)), 1),
|
|
524
|
+
e[18] || (e[18] = b("br", null, null, -1)),
|
|
525
|
+
b("span", null, m(a(u)("workSchedule.with")) + ":", 1),
|
|
526
|
+
d(a(W), {
|
|
527
|
+
modelValue: V.value,
|
|
528
|
+
"onUpdate:modelValue": e[10] || (e[10] = (l) => V.value = l),
|
|
529
|
+
step: 1,
|
|
530
|
+
min: 8,
|
|
531
|
+
max: 11,
|
|
532
|
+
onChange: e[11] || (e[11] = (l) => se(c.value.day, c.value.ids))
|
|
533
|
+
}, null, 8, ["modelValue"]),
|
|
534
|
+
b("span", null, m(a(u)("workSchedule.duration")) + ":", 1),
|
|
535
|
+
d(a(W), {
|
|
536
|
+
modelValue: C.value,
|
|
537
|
+
"onUpdate:modelValue": e[12] || (e[12] = (l) => C.value = l),
|
|
538
|
+
step: 1,
|
|
539
|
+
min: 4,
|
|
540
|
+
max: 12,
|
|
541
|
+
onChange: e[13] || (e[13] = (l) => se(c.value.day, c.value.ids))
|
|
542
|
+
}, null, 8, ["modelValue"]),
|
|
543
|
+
d(a(B), {
|
|
544
|
+
style: { "margin-top": ".5rem" },
|
|
545
|
+
size: "small",
|
|
546
|
+
onClick: e[14] || (e[14] = (l) => ye(c.value.day, c.value.ids))
|
|
547
|
+
}, {
|
|
548
|
+
default: s(() => [
|
|
549
|
+
D(m(a(u)("workSchedule.delete")), 1)
|
|
550
|
+
]),
|
|
551
|
+
_: 1
|
|
552
|
+
})
|
|
553
|
+
]))
|
|
554
|
+
]),
|
|
555
|
+
_: 1
|
|
556
|
+
}, 8, ["show", "options"])
|
|
557
|
+
]);
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
};
|
|
561
|
+
export {
|
|
562
|
+
el as default
|
|
563
|
+
};
|
package/dist/vite.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@studio-west/employees",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"files": [
|
|
5
|
+
"dist"
|
|
6
|
+
],
|
|
7
|
+
"main": "./dist/index.cjs",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"require": "./dist/index.cjs"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"scripts": {
|
|
17
|
+
"dev": "vite",
|
|
18
|
+
"build": "vite build",
|
|
19
|
+
"preview": "vite preview"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@vitejs/plugin-vue": "^5.2.1",
|
|
23
|
+
"vite": "^6.0.1"
|
|
24
|
+
}
|
|
25
|
+
}
|